@jupytergis/base 0.12.1 → 0.13.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 (84) hide show
  1. package/lib/commands/index.js +2 -6
  2. package/lib/dialogs/layerBrowserDialog.d.ts +3 -3
  3. package/lib/dialogs/layerBrowserDialog.js +9 -10
  4. package/lib/dialogs/symbology/hooks/useEffectiveSymbologyParams.d.ts +16 -0
  5. package/lib/dialogs/symbology/hooks/useEffectiveSymbologyParams.js +24 -0
  6. package/lib/dialogs/symbology/hooks/useOkSignal.d.ts +6 -0
  7. package/lib/dialogs/symbology/hooks/useOkSignal.js +25 -0
  8. package/lib/dialogs/symbology/symbologyDialog.d.ts +4 -2
  9. package/lib/dialogs/symbology/symbologyDialog.js +6 -10
  10. package/lib/dialogs/symbology/symbologyUtils.d.ts +25 -2
  11. package/lib/dialogs/symbology/symbologyUtils.js +74 -4
  12. package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +3 -3
  13. package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +31 -34
  14. package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +68 -62
  15. package/lib/dialogs/symbology/vector_layer/VectorRendering.js +33 -21
  16. package/lib/dialogs/symbology/vector_layer/types/Canonical.js +23 -24
  17. package/lib/dialogs/symbology/vector_layer/types/Categorized.js +48 -49
  18. package/lib/dialogs/symbology/vector_layer/types/Graduated.js +53 -62
  19. package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +35 -34
  20. package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +45 -47
  21. package/lib/formbuilder/objectform/StoryEditorForm.js +1 -18
  22. package/lib/formbuilder/objectform/baseform.d.ts +6 -0
  23. package/lib/formbuilder/objectform/baseform.js +21 -38
  24. package/lib/formbuilder/objectform/components/LayerSelect.d.ts +7 -0
  25. package/lib/formbuilder/objectform/components/LayerSelect.js +43 -0
  26. package/lib/formbuilder/objectform/components/OpacitySlider.d.ts +4 -0
  27. package/lib/formbuilder/objectform/components/OpacitySlider.js +40 -0
  28. package/lib/formbuilder/objectform/components/SegmentFormSymbology.d.ts +3 -0
  29. package/lib/formbuilder/objectform/components/SegmentFormSymbology.js +59 -0
  30. package/lib/formbuilder/objectform/layer/storySegmentLayerForm.d.ts +2 -2
  31. package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +19 -0
  32. package/lib/mainview/mainView.d.ts +8 -2
  33. package/lib/mainview/mainView.js +41 -7
  34. package/lib/mainview/mainviewwidget.js +2 -2
  35. package/lib/panelview/leftpanel.d.ts +2 -1
  36. package/lib/panelview/leftpanel.js +28 -20
  37. package/lib/panelview/rightpanel.d.ts +4 -1
  38. package/lib/panelview/rightpanel.js +14 -20
  39. package/lib/panelview/story-maps/MobileSpectaPanel.d.ts +7 -0
  40. package/lib/panelview/story-maps/MobileSpectaPanel.js +114 -0
  41. package/lib/panelview/story-maps/StoryNavBar.d.ts +3 -2
  42. package/lib/panelview/story-maps/StoryNavBar.js +18 -6
  43. package/lib/panelview/story-maps/StoryViewerPanel.d.ts +13 -1
  44. package/lib/panelview/story-maps/StoryViewerPanel.js +168 -34
  45. package/lib/panelview/story-maps/components/StoryImageSection.d.ts +2 -7
  46. package/lib/panelview/story-maps/components/StoryImageSection.js +2 -4
  47. package/lib/panelview/story-maps/components/StorySubtitleSection.d.ts +2 -6
  48. package/lib/panelview/story-maps/components/StorySubtitleSection.js +2 -4
  49. package/lib/panelview/story-maps/components/StoryTitleSection.d.ts +2 -7
  50. package/lib/panelview/story-maps/components/StoryTitleSection.js +2 -3
  51. package/lib/shared/components/Button.js +2 -2
  52. package/lib/shared/components/Calendar.js +0 -1
  53. package/lib/shared/components/Checkbox.d.ts +1 -1
  54. package/lib/shared/components/Checkbox.js +1 -1
  55. package/lib/shared/components/Dialog.d.ts +1 -1
  56. package/lib/shared/components/Dialog.js +1 -1
  57. package/lib/shared/components/Drawer.d.ts +13 -0
  58. package/lib/shared/components/Drawer.js +59 -0
  59. package/lib/shared/components/DropdownMenu.d.ts +1 -1
  60. package/lib/shared/components/DropdownMenu.js +1 -1
  61. package/lib/shared/components/Popover.d.ts +1 -1
  62. package/lib/shared/components/Popover.js +1 -1
  63. package/lib/shared/components/RadioGroup.d.ts +1 -1
  64. package/lib/shared/components/RadioGroup.js +1 -1
  65. package/lib/shared/components/Sheet.d.ts +15 -0
  66. package/lib/shared/components/Sheet.js +64 -0
  67. package/lib/shared/components/Switch.d.ts +1 -1
  68. package/lib/shared/components/Switch.js +1 -1
  69. package/lib/shared/components/Tabs.d.ts +1 -1
  70. package/lib/shared/components/Tabs.js +1 -1
  71. package/lib/shared/components/ToggleGroup.d.ts +1 -1
  72. package/lib/shared/components/ToggleGroup.js +1 -1
  73. package/lib/shared/hooks/useLatest.d.ts +1 -0
  74. package/lib/shared/hooks/useLatest.js +8 -0
  75. package/lib/shared/hooks/useMediaQuery.d.ts +9 -0
  76. package/lib/shared/hooks/useMediaQuery.js +32 -0
  77. package/lib/tools.js +21 -34
  78. package/lib/types.d.ts +1 -0
  79. package/lib/types.js +6 -1
  80. package/package.json +5 -12
  81. package/style/base.css +15 -0
  82. package/style/shared/drawer.css +154 -0
  83. package/style/shared/sheet.css +258 -0
  84. package/style/storyPanel.css +36 -8
@@ -0,0 +1,59 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from 'react';
13
+ import { Drawer as DrawerPrimitive } from 'vaul';
14
+ import { cn } from './utils';
15
+ function Drawer(_a) {
16
+ var props = __rest(_a, []);
17
+ return React.createElement(DrawerPrimitive.Root, Object.assign({ "data-slot": "drawer" }, props));
18
+ }
19
+ function DrawerTrigger(_a) {
20
+ var props = __rest(_a, []);
21
+ return React.createElement(DrawerPrimitive.Trigger, Object.assign({ "data-slot": "drawer-trigger" }, props));
22
+ }
23
+ function DrawerPortal(_a) {
24
+ var props = __rest(_a, []);
25
+ return React.createElement(DrawerPrimitive.Portal, Object.assign({ "data-slot": "drawer-portal" }, props));
26
+ }
27
+ function DrawerClose(_a) {
28
+ var props = __rest(_a, []);
29
+ return React.createElement(DrawerPrimitive.Close, Object.assign({ "data-slot": "drawer-close" }, props));
30
+ }
31
+ function DrawerOverlay(_a) {
32
+ var { className } = _a, props = __rest(_a, ["className"]);
33
+ return (React.createElement(DrawerPrimitive.Overlay, Object.assign({ "data-slot": "drawer-overlay", className: cn('jgis-drawer-overlay', className) }, props)));
34
+ }
35
+ function DrawerContent(_a) {
36
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
37
+ return (React.createElement(DrawerPortal, { "data-slot": "drawer-portal" },
38
+ React.createElement(DrawerOverlay, null),
39
+ React.createElement(DrawerPrimitive.Content, Object.assign({ "data-slot": "drawer-content", className: cn('jgis-drawer-content', className) }, props),
40
+ React.createElement("div", { className: "jgis-drawer-handle" }),
41
+ children)));
42
+ }
43
+ function DrawerHeader(_a) {
44
+ var { className } = _a, props = __rest(_a, ["className"]);
45
+ return (React.createElement("div", Object.assign({ "data-slot": "drawer-header", className: cn('jgis-drawer-header', className) }, props)));
46
+ }
47
+ function DrawerFooter(_a) {
48
+ var { className } = _a, props = __rest(_a, ["className"]);
49
+ return (React.createElement("div", Object.assign({ "data-slot": "drawer-footer", className: cn('jgis-drawer-footer', className) }, props)));
50
+ }
51
+ function DrawerTitle(_a) {
52
+ var { className } = _a, props = __rest(_a, ["className"]);
53
+ return (React.createElement(DrawerPrimitive.Title, Object.assign({ "data-slot": "drawer-title", className: cn('jgis-drawer-title', className) }, props)));
54
+ }
55
+ function DrawerDescription(_a) {
56
+ var { className } = _a, props = __rest(_a, ["className"]);
57
+ return (React.createElement(DrawerPrimitive.Description, Object.assign({ "data-slot": "drawer-description", className: cn('jgis-drawer-description', className) }, props)));
58
+ }
59
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -1,4 +1,4 @@
1
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
4
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
13
12
  import { Check, ChevronRight, Circle } from 'lucide-react';
13
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  const DropdownMenu = DropdownMenuPrimitive.Root;
16
16
  const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
@@ -1,4 +1,4 @@
1
- import * as PopoverPrimitive from '@radix-ui/react-popover';
1
+ import { Popover as PopoverPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare const Popover: React.FC<React.ComponentProps<typeof PopoverPrimitive.Root>>;
4
4
  declare const PopoverTrigger: React.FC<React.ComponentProps<typeof PopoverPrimitive.Trigger>>;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as PopoverPrimitive from '@radix-ui/react-popover';
12
+ import { Popover as PopoverPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  const Popover = (_a) => {
@@ -1,4 +1,4 @@
1
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
1
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
4
4
  declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
13
12
  import { CircleIcon } from 'lucide-react';
13
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  import { cn } from './utils';
16
16
  function RadioGroup(_a) {
@@ -0,0 +1,15 @@
1
+ import { Dialog as SheetPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
4
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
+ declare function SheetContent({ className, children, side, showCloseButton, container, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
+ side?: 'top' | 'right' | 'bottom' | 'left';
8
+ showCloseButton?: boolean;
9
+ container: HTMLElement;
10
+ }): React.JSX.Element;
11
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
14
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
15
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,64 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { XIcon } from 'lucide-react';
13
+ import { Dialog as SheetPrimitive } from 'radix-ui';
14
+ import * as React from 'react';
15
+ import { Button } from './Button';
16
+ import { cn } from './utils';
17
+ function Sheet(_a) {
18
+ var props = __rest(_a, []);
19
+ return React.createElement(SheetPrimitive.Root, Object.assign({ "data-slot": "sheet" }, props));
20
+ }
21
+ function SheetTrigger(_a) {
22
+ var props = __rest(_a, []);
23
+ return React.createElement(SheetPrimitive.Trigger, Object.assign({ "data-slot": "sheet-trigger" }, props));
24
+ }
25
+ function SheetClose(_a) {
26
+ var props = __rest(_a, []);
27
+ return React.createElement(SheetPrimitive.Close, Object.assign({ "data-slot": "sheet-close" }, props));
28
+ }
29
+ function SheetPortal(_a) {
30
+ var props = __rest(_a, []);
31
+ return React.createElement(SheetPrimitive.Portal, Object.assign({ "data-slot": "sheet-portal" }, props));
32
+ }
33
+ function SheetOverlay(_a) {
34
+ var { className } = _a, props = __rest(_a, ["className"]);
35
+ return (React.createElement(SheetPrimitive.Overlay, Object.assign({ "data-slot": "sheet-overlay", className: cn('jgis-sheet-overlay', className) }, props)));
36
+ }
37
+ function SheetContent(_a) {
38
+ var { className, children, side = 'right', showCloseButton = true, container } = _a, props = __rest(_a, ["className", "children", "side", "showCloseButton", "container"]);
39
+ return (React.createElement(SheetPortal, null,
40
+ React.createElement(SheetOverlay, null),
41
+ React.createElement(SheetPrimitive.Content, Object.assign({ "data-slot": "sheet-content", "data-side": side, className: cn('jgis-sheet-content', className) }, props),
42
+ children,
43
+ showCloseButton && (React.createElement(SheetPrimitive.Close, { "data-slot": "sheet-close", asChild: true },
44
+ React.createElement(Button, { variant: "ghost", className: "jgis-sheet-close", size: "icon-sm" },
45
+ React.createElement(XIcon, null),
46
+ React.createElement("span", { className: "jgis-sr-only" }, "Close")))))));
47
+ }
48
+ function SheetHeader(_a) {
49
+ var { className } = _a, props = __rest(_a, ["className"]);
50
+ return (React.createElement("div", Object.assign({ "data-slot": "sheet-header", className: cn('jgis-sheet-header', className) }, props)));
51
+ }
52
+ function SheetFooter(_a) {
53
+ var { className } = _a, props = __rest(_a, ["className"]);
54
+ return (React.createElement("div", Object.assign({ "data-slot": "sheet-footer", className: cn('jgis-sheet-footer', className) }, props)));
55
+ }
56
+ function SheetTitle(_a) {
57
+ var { className } = _a, props = __rest(_a, ["className"]);
58
+ return (React.createElement(SheetPrimitive.Title, Object.assign({ "data-slot": "sheet-title", className: cn('jgis-sheet-title', className) }, props)));
59
+ }
60
+ function SheetDescription(_a) {
61
+ var { className } = _a, props = __rest(_a, ["className"]);
62
+ return (React.createElement(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className: cn('jgis-sheet-description', className) }, props)));
63
+ }
64
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -1,4 +1,4 @@
1
- import * as SwitchPrimitive from '@radix-ui/react-switch';
1
+ import { Switch as SwitchPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): React.JSX.Element;
4
4
  export { Switch };
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as SwitchPrimitive from '@radix-ui/react-switch';
12
+ import { Switch as SwitchPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  function Switch(_a) {
@@ -1,4 +1,4 @@
1
- import * as TabsPrimitive from '@radix-ui/react-tabs';
1
+ import { Tabs as TabsPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  interface IPanelTabProps {
4
4
  className: string;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as TabsPrimitive from '@radix-ui/react-tabs';
12
+ import { Tabs as TabsPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  const Tabs = (_a) => {
@@ -1,5 +1,5 @@
1
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
2
1
  import { type VariantProps } from 'class-variance-authority';
2
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
3
3
  import * as React from 'react';
4
4
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
5
5
  variant?: "default" | "outline" | null | undefined;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
13
12
  import { cva } from 'class-variance-authority';
13
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  import { cn } from './utils';
16
16
  const toggleVariants = cva('jgis-toggle', {
@@ -0,0 +1 @@
1
+ export declare function useLatest<T>(value: T): React.MutableRefObject<T>;
@@ -0,0 +1,8 @@
1
+ import { useEffect, useRef } from 'react';
2
+ export function useLatest(value) {
3
+ const ref = useRef(value);
4
+ useEffect(() => {
5
+ ref.current = value;
6
+ }, [value]);
7
+ return ref;
8
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Subscribes to a media query and returns whether it currently matches.
3
+ * Updates when the viewport changes (resize, orientation).
4
+ *
5
+ * @param query - Media query string (e.g. '(max-width: 768px)').
6
+ * @returns True if the query matches, false otherwise (and when window is unavailable).
7
+ */
8
+ declare function useMediaQuery(query: string): boolean;
9
+ export default useMediaQuery;
@@ -0,0 +1,32 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * Subscribes to a media query and returns whether it currently matches.
4
+ * Updates when the viewport changes (resize, orientation).
5
+ *
6
+ * @param query - Media query string (e.g. '(max-width: 768px)').
7
+ * @returns True if the query matches, false otherwise (and when window is unavailable).
8
+ */
9
+ function useMediaQuery(query) {
10
+ const [matches, setMatches] = useState(() => {
11
+ if (typeof window === 'undefined') {
12
+ return false;
13
+ }
14
+ return window.matchMedia(query).matches;
15
+ });
16
+ useEffect(() => {
17
+ if (typeof window === 'undefined') {
18
+ return;
19
+ }
20
+ const mediaQuery = window.matchMedia(query);
21
+ const handleChange = (event) => {
22
+ setMatches(event.matches);
23
+ };
24
+ setMatches(mediaQuery.matches);
25
+ mediaQuery.addEventListener('change', handleChange);
26
+ return () => {
27
+ mediaQuery.removeEventListener('change', handleChange);
28
+ };
29
+ }, [query]);
30
+ return matches;
31
+ }
32
+ export default useMediaQuery;
package/lib/tools.js CHANGED
@@ -5,7 +5,7 @@ import { VectorTile } from '@mapbox/vector-tile';
5
5
  import { compressors } from 'hyparquet-compressors';
6
6
  import Protobuf from 'pbf';
7
7
  import shp from 'shpjs';
8
- import RASTER_LAYER_GALLERY from "../rasterlayer_gallery/raster_layer_gallery.json";
8
+ import LAYER_GALLERY from "../layer_gallery.json";
9
9
  export const debounce = (func, timeout = 100) => {
10
10
  let timeoutId;
11
11
  return (...args) => {
@@ -112,27 +112,29 @@ export function deepCopy(value) {
112
112
  * @param layerBrowserRegistry Registry to add layers to
113
113
  */
114
114
  export function createDefaultLayerRegistry(layerBrowserRegistry) {
115
- const RASTER_THUMBNAILS = {};
115
+ const LAYER_THUMBNAILS = {};
116
116
  /**
117
117
  * Generate object to hold thumbnail URLs
118
118
  */
119
119
  const importAll = (r) => {
120
120
  r.keys().forEach(key => {
121
121
  const imageName = key.replace('./', '').replace(/\.\w+$/, '');
122
- RASTER_THUMBNAILS[imageName] = r(key);
122
+ LAYER_THUMBNAILS[imageName] = r(key);
123
123
  });
124
124
  };
125
- const context = require.context('../rasterlayer_gallery', false, /\.(png|jpe?g|gif|svg)$/);
125
+ const context = require.context('../layer_gallery', false, /\.(png|jpe?g|gif|svg)$/);
126
126
  importAll(context);
127
- for (const entry of Object.keys(RASTER_LAYER_GALLERY)) {
128
- const xyzprovider = RASTER_LAYER_GALLERY[entry];
129
- if ('url' in xyzprovider) {
130
- const tile = convertToRegistryEntry(entry, xyzprovider);
127
+ for (const entry of Object.keys(LAYER_GALLERY)) {
128
+ const layerProvider = LAYER_GALLERY[entry];
129
+ if ('thumbnailPath' in layerProvider) {
130
+ /*flat layer provider*/
131
+ const tile = convertToRegistryEntry(entry, layerProvider);
131
132
  layerBrowserRegistry.addRegistryLayer(tile);
132
133
  }
133
134
  else {
134
- Object.keys(xyzprovider).forEach(mapName => {
135
- const tile = convertToRegistryEntry(xyzprovider[mapName]['name'], xyzprovider[mapName], entry);
135
+ /* nested layer provider */
136
+ Object.keys(layerProvider).forEach(mapName => {
137
+ const tile = convertToRegistryEntry(layerProvider[mapName]['name'], layerProvider[mapName], entry);
136
138
  layerBrowserRegistry.addRegistryLayer(tile);
137
139
  });
138
140
  }
@@ -142,35 +144,20 @@ export function createDefaultLayerRegistry(layerBrowserRegistry) {
142
144
  * Parse tile information from providers to be usable in the layer registry
143
145
  *
144
146
  * @param entry - The name of the entry, which may also serve as the default provider name if none is specified.
145
- * @param xyzprovider - An object containing the XYZ provider's details, including name, URL, zoom levels, attribution, and possibly other properties relevant to the provider.
147
+ * @param layerProvider - An object containing the provider's details, including name, URL, zoom levels, attribution, and possibly other properties relevant to the provider.
146
148
  * @param provider - Optional. Specifies the provider name. If not provided, the `entry` parameter is used as the default provider name.
147
149
  * @returns - An object representing the registry entry
148
150
  */
149
- function convertToRegistryEntry(entry, xyzprovider, provider) {
150
- const urlParameters = {};
151
- if (xyzprovider.time) {
152
- urlParameters.time = xyzprovider.time;
153
- }
154
- if (xyzprovider.variant) {
155
- urlParameters.variant = xyzprovider.variant;
156
- }
157
- if (xyzprovider.tilematrixset) {
158
- urlParameters.tilematrixset = xyzprovider.tilematrixset;
159
- }
160
- if (xyzprovider.format) {
161
- urlParameters.format = xyzprovider.format;
162
- }
151
+ function convertToRegistryEntry(entry, layerProvider, provider) {
163
152
  return {
164
153
  name: entry,
165
- thumbnail: RASTER_THUMBNAILS[xyzprovider['name'].replace('.', '-')],
166
- source: {
167
- url: xyzprovider['url'],
168
- minZoom: xyzprovider['min_zoom'] || 0,
169
- maxZoom: xyzprovider['max_zoom'] || 24,
170
- attribution: xyzprovider['attribution'] || '',
171
- provider: provider !== null && provider !== void 0 ? provider : entry,
172
- urlParameters,
173
- },
154
+ thumbnail: LAYER_THUMBNAILS[layerProvider['name'].replace('.', '-')],
155
+ sourceType: layerProvider['sourceType'],
156
+ layerType: layerProvider['layerType'],
157
+ sourceParameters: layerProvider['sourceParameters'],
158
+ layerParameters: layerProvider['layerParameters'],
159
+ provider: provider !== null && provider !== void 0 ? provider : entry.split('.', 1)[0],
160
+ description: layerProvider['description'],
174
161
  };
175
162
  }
176
163
  }
package/lib/types.d.ts CHANGED
@@ -27,3 +27,4 @@ declare global {
27
27
  }
28
28
  declare const classificationModes: readonly ["quantile", "equal interval", "jenks", "pretty", "logarithmic", "continuous"];
29
29
  export type ClassificationMode = (typeof classificationModes)[number];
30
+ export declare const SYMBOLOGY_VALID_LAYER_TYPES: string[];
package/lib/types.js CHANGED
@@ -6,4 +6,9 @@ const classificationModes = [
6
6
  'logarithmic',
7
7
  'continuous',
8
8
  ];
9
- export {};
9
+ export const SYMBOLOGY_VALID_LAYER_TYPES = [
10
+ 'VectorLayer',
11
+ 'VectorTileLayer',
12
+ 'WebGlLayer',
13
+ 'HeatmapLayer',
14
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/base",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "A JupyterLab extension for 3D modelling.",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -44,7 +44,7 @@
44
44
  "@jupyter/collaboration": "^4",
45
45
  "@jupyter/react-components": "^0.16.6",
46
46
  "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
47
- "@jupytergis/schema": "^0.12.1",
47
+ "@jupytergis/schema": "^0.13.0",
48
48
  "@jupyterlab/application": "^4.3.0",
49
49
  "@jupyterlab/apputils": "^4.3.0",
50
50
  "@jupyterlab/completer": "^4.3.0",
@@ -64,15 +64,6 @@
64
64
  "@lumino/widgets": "^2.0.0",
65
65
  "@mapbox/vector-tile": "^2.0.3",
66
66
  "@naisutech/react-tree": "^3.0.1",
67
- "@radix-ui/react-checkbox": "^1.3.2",
68
- "@radix-ui/react-dialog": "^1.1.15",
69
- "@radix-ui/react-dropdown-menu": "^2.1.15",
70
- "@radix-ui/react-popover": "^1.1.14",
71
- "@radix-ui/react-radio-group": "^1.3.8",
72
- "@radix-ui/react-slot": "^1.2.3",
73
- "@radix-ui/react-switch": "^1.2.6",
74
- "@radix-ui/react-tabs": "^1.1.12",
75
- "@radix-ui/react-toggle-group": "^1.1.10",
76
67
  "@rjsf/core": "^4.2.0",
77
68
  "@rjsf/validator-ajv8": "^5.23.1",
78
69
  "ajv": "^8.14.0",
@@ -94,6 +85,7 @@
94
85
  "pmtiles": "^3.0.7",
95
86
  "proj4": "2.19.3",
96
87
  "proj4-list": "1.0.4",
88
+ "radix-ui": "^1.4.3",
97
89
  "react": "^18.0.1",
98
90
  "react-day-picker": "^9.7.0",
99
91
  "react-markdown": "^10.1.0",
@@ -101,7 +93,8 @@
101
93
  "styled-components": "^5.3.6",
102
94
  "three": "^0.135.0",
103
95
  "three-mesh-bvh": "^0.5.17",
104
- "uuid": "^11.0.3"
96
+ "uuid": "^11.0.3",
97
+ "vaul": "^1.1.2"
105
98
  },
106
99
  "devDependencies": {
107
100
  "@apidevtools/json-schema-ref-parser": "^9.0.9",
package/style/base.css CHANGED
@@ -24,6 +24,8 @@
24
24
  @import url('./shared/checkbox.css');
25
25
  @import url('./shared/radioGroup.css');
26
26
  @import url('./shared/dialog.css');
27
+ @import url('./shared/drawer.css');
28
+ @import url('./shared/sheet.css');
27
29
  @import url('./shared/switch.css');
28
30
  @import url('./shared/popover.css');
29
31
  @import url('./shared/command.css');
@@ -66,6 +68,14 @@
66
68
  flex-direction: column;
67
69
  }
68
70
 
71
+ .jGIS-symbology-override-item {
72
+ display: flex;
73
+ flex-direction: column;
74
+ align-items: center;
75
+ padding-bottom: 1rem;
76
+ border-bottom: solid 1px var(--jp-border-color0);
77
+ }
78
+
69
79
  .jp-gis-text-label {
70
80
  margin: 0;
71
81
  padding: 0;
@@ -170,3 +180,8 @@ button.jp-mod-styled.jp-mod-reject {
170
180
  margin: 0;
171
181
  }
172
182
  }
183
+
184
+ /* Fix for map in mobile specta view */
185
+ body[data-notebook='specta'] #main.jp-ThemedContainer {
186
+ overflow: visible;
187
+ }
@@ -0,0 +1,154 @@
1
+ @keyframes drawer-fade-in {
2
+ from {
3
+ opacity: 0;
4
+ }
5
+ to {
6
+ opacity: 1;
7
+ }
8
+ }
9
+
10
+ @keyframes drawer-fade-out {
11
+ from {
12
+ opacity: 1;
13
+ }
14
+ to {
15
+ opacity: 0;
16
+ }
17
+ }
18
+
19
+ .jgis-drawer-overlay {
20
+ position: fixed;
21
+ inset: 0;
22
+ z-index: 50;
23
+ background-color: color-mix(in srgb, black, transparent 90%);
24
+ backdrop-filter: blur(2px);
25
+ }
26
+
27
+ .jgis-drawer-overlay[data-state='open'] {
28
+ animation: drawer-fade-in 0.2s ease-out;
29
+ }
30
+
31
+ .jgis-drawer-overlay[data-state='closed'] {
32
+ animation: drawer-fade-out 0.2s ease-in;
33
+ }
34
+
35
+ .jgis-drawer-content {
36
+ position: fixed;
37
+ z-index: 50;
38
+ display: flex;
39
+ flex-direction: column;
40
+ font-size: 0.875rem;
41
+ background-color: var(--jp-layout-color0);
42
+ color: var(--jp-ui-font-color0);
43
+ border-color: var(--jp-border-color0);
44
+ }
45
+
46
+ /* Bottom */
47
+ .jgis-drawer-content[data-vaul-drawer-direction='bottom'] {
48
+ left: 0;
49
+ right: 0;
50
+ bottom: 0;
51
+ margin-top: 6rem;
52
+ max-height: 80vh;
53
+ border-top-width: 1px;
54
+ border-top-style: solid;
55
+ border-radius: 0.75rem 0.75rem 0 0;
56
+ }
57
+
58
+ /* Top */
59
+ .jgis-drawer-content[data-vaul-drawer-direction='top'] {
60
+ left: 0;
61
+ right: 0;
62
+ top: 0;
63
+ margin-bottom: 6rem;
64
+ max-height: 80vh;
65
+ border-bottom-width: 1px;
66
+ border-bottom-style: solid;
67
+ border-radius: 0 0 0.75rem 0.75rem;
68
+ }
69
+
70
+ /* Left */
71
+ .jgis-drawer-content[data-vaul-drawer-direction='left'] {
72
+ top: 0;
73
+ bottom: 0;
74
+ left: 0;
75
+ width: 75%;
76
+ border-right-width: 1px;
77
+ border-right-style: solid;
78
+ border-radius: 0 0.75rem 0.75rem 0;
79
+ }
80
+
81
+ @media (min-width: 640px) {
82
+ .jgis-drawer-content[data-vaul-drawer-direction='left'] {
83
+ max-width: 24rem;
84
+ }
85
+ }
86
+
87
+ /* Right */
88
+ .jgis-drawer-content[data-vaul-drawer-direction='right'] {
89
+ top: 0;
90
+ bottom: 0;
91
+ right: 0;
92
+ width: 75%;
93
+ border-left-width: 1px;
94
+ border-left-style: solid;
95
+ border-radius: 0.75rem 0 0 0.75rem;
96
+ }
97
+
98
+ @media (min-width: 640px) {
99
+ .jgis-drawer-content[data-vaul-drawer-direction='right'] {
100
+ max-width: 24rem;
101
+ }
102
+ }
103
+
104
+ .jgis-drawer-handle {
105
+ display: none;
106
+ margin: 1rem auto 0;
107
+ height: 0.25rem;
108
+ width: 100px;
109
+ flex-shrink: 0;
110
+ border-radius: 9999px;
111
+ background-color: var(--jp-layout-color2);
112
+ }
113
+
114
+ .jgis-drawer-content[data-vaul-drawer-direction='bottom'] .jgis-drawer-handle {
115
+ display: block;
116
+ }
117
+
118
+ .jgis-drawer-header {
119
+ display: flex;
120
+ flex-direction: column;
121
+ gap: 0.125rem;
122
+ padding: 1rem;
123
+ }
124
+
125
+ .jgis-drawer-content[data-vaul-drawer-direction='bottom'] .jgis-drawer-header,
126
+ .jgis-drawer-content[data-vaul-drawer-direction='top'] .jgis-drawer-header {
127
+ text-align: center;
128
+ }
129
+
130
+ @media (min-width: 768px) {
131
+ .jgis-drawer-header {
132
+ gap: 0.125rem;
133
+ text-align: left;
134
+ }
135
+ }
136
+
137
+ .jgis-drawer-footer {
138
+ display: flex;
139
+ flex-direction: column;
140
+ gap: 0.5rem;
141
+ padding: 1rem;
142
+ margin-top: auto;
143
+ }
144
+
145
+ .jgis-drawer-title {
146
+ font-size: 1rem;
147
+ font-weight: 500;
148
+ color: var(--jp-ui-font-color0);
149
+ }
150
+
151
+ .jgis-drawer-description {
152
+ font-size: 0.875rem;
153
+ color: var(--jp-ui-font-color2);
154
+ }