@jupytergis/base 0.10.1 → 0.11.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.
- package/lib/commands/BaseCommandIDs.d.ts +1 -0
- package/lib/commands/BaseCommandIDs.js +2 -0
- package/lib/commands/index.js +14 -0
- package/lib/constants.js +1 -0
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +1 -5
- package/lib/formbuilder/formselectors.js +5 -1
- package/lib/formbuilder/objectform/StoryEditorForm.d.ts +8 -0
- package/lib/formbuilder/objectform/StoryEditorForm.js +10 -0
- package/lib/formbuilder/objectform/components/StorySegmentReset.d.ts +8 -0
- package/lib/formbuilder/objectform/components/StorySegmentReset.js +24 -0
- package/lib/formbuilder/objectform/layer/index.d.ts +1 -0
- package/lib/formbuilder/objectform/layer/index.js +1 -0
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.d.ts +5 -0
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +32 -0
- package/lib/mainview/mainView.js +61 -7
- package/lib/panelview/components/layers.d.ts +2 -1
- package/lib/panelview/components/layers.js +31 -23
- package/lib/panelview/components/story-maps/PreviewModeSwitch.d.ts +7 -0
- package/lib/panelview/components/story-maps/PreviewModeSwitch.js +12 -0
- package/lib/panelview/components/story-maps/StoryEditorPanel.d.ts +7 -0
- package/lib/panelview/components/story-maps/StoryEditorPanel.js +29 -0
- package/lib/panelview/components/story-maps/StoryNavBar.d.ts +9 -0
- package/lib/panelview/components/story-maps/StoryNavBar.js +11 -0
- package/lib/panelview/components/story-maps/StoryViewerPanel.d.ts +7 -0
- package/lib/panelview/components/story-maps/StoryViewerPanel.js +166 -0
- package/lib/panelview/leftpanel.js +87 -5
- package/lib/panelview/rightpanel.js +32 -2
- package/lib/shared/components/Calendar.d.ts +1 -1
- package/lib/shared/components/Command.d.ts +18 -0
- package/lib/shared/components/Command.js +60 -0
- package/lib/shared/components/Dialog.d.ts +15 -0
- package/lib/shared/components/Dialog.js +62 -0
- package/lib/shared/components/RadioGroup.d.ts +5 -0
- package/lib/shared/components/RadioGroup.js +26 -0
- package/lib/shared/components/Switch.d.ts +4 -0
- package/lib/shared/components/Switch.js +20 -0
- package/lib/toolbar/widget.d.ts +10 -0
- package/lib/toolbar/widget.js +49 -0
- package/lib/tools.js +1 -1
- package/package.json +8 -3
- package/style/base.css +4 -0
- package/style/leftPanel.css +18 -0
- package/style/shared/button.css +1 -1
- package/style/shared/dialog.css +177 -0
- package/style/shared/radioGroup.css +55 -0
- package/style/shared/switch.css +63 -0
- package/style/shared/tabs.css +3 -2
- package/style/storyPanel.css +68 -0
- package/style/tabPanel.css +1 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import Markdown from 'react-markdown';
|
|
3
|
+
import StoryNavBar from './StoryNavBar';
|
|
4
|
+
function StoryViewerPanel({ model }) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6
|
+
const [currentIndexDisplayed, setCurrentIndexDisplayed] = useState(0);
|
|
7
|
+
const [storyData, setStoryData] = useState((_a = model.getSelectedStory().story) !== null && _a !== void 0 ? _a : null);
|
|
8
|
+
const [imageLoaded, setImageLoaded] = useState(false);
|
|
9
|
+
// Derive story segments from story data
|
|
10
|
+
const storySegments = useMemo(() => {
|
|
11
|
+
if (!(storyData === null || storyData === void 0 ? void 0 : storyData.storySegments)) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
return storyData.storySegments
|
|
15
|
+
.map(storySegmentId => model.getLayer(storySegmentId))
|
|
16
|
+
.filter((layer) => layer !== undefined);
|
|
17
|
+
}, [storyData, model]);
|
|
18
|
+
// Derive current story segment from story segments and currentIndexDisplayed
|
|
19
|
+
const currentStorySegment = useMemo(() => {
|
|
20
|
+
return storySegments[currentIndexDisplayed];
|
|
21
|
+
}, [storySegments, currentIndexDisplayed]);
|
|
22
|
+
// Derive active slide and layer name from current story segment
|
|
23
|
+
const activeSlide = useMemo(() => {
|
|
24
|
+
return currentStorySegment === null || currentStorySegment === void 0 ? void 0 : currentStorySegment.parameters;
|
|
25
|
+
}, [currentStorySegment]);
|
|
26
|
+
const layerName = useMemo(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = currentStorySegment === null || currentStorySegment === void 0 ? void 0 : currentStorySegment.name) !== null && _a !== void 0 ? _a : '';
|
|
29
|
+
}, [currentStorySegment]);
|
|
30
|
+
// Derive story segment ID for zooming
|
|
31
|
+
const currentStorySegmentId = useMemo(() => {
|
|
32
|
+
var _a;
|
|
33
|
+
return (_a = storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) === null || _a === void 0 ? void 0 : _a[currentIndexDisplayed];
|
|
34
|
+
}, [storyData, currentIndexDisplayed]);
|
|
35
|
+
const zoomToCurrentLayer = () => {
|
|
36
|
+
if (currentStorySegmentId) {
|
|
37
|
+
model.centerOnPosition(currentStorySegmentId);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const setSelectedLayerByIndex = useCallback((index) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const storySegmentId = (_a = storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) === null || _a === void 0 ? void 0 : _a[index];
|
|
43
|
+
if (storySegmentId) {
|
|
44
|
+
model.selected = {
|
|
45
|
+
[storySegmentId]: {
|
|
46
|
+
type: 'layer',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}, [storyData, model]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const updateStory = () => {
|
|
53
|
+
const { story } = model.getSelectedStory();
|
|
54
|
+
setStoryData(story !== null && story !== void 0 ? story : null);
|
|
55
|
+
// Reset to first slide when story changes
|
|
56
|
+
setCurrentIndexDisplayed(0);
|
|
57
|
+
};
|
|
58
|
+
updateStory();
|
|
59
|
+
model.sharedModel.storyMapsChanged.connect(updateStory);
|
|
60
|
+
return () => {
|
|
61
|
+
model.sharedModel.storyMapsChanged.disconnect(updateStory);
|
|
62
|
+
};
|
|
63
|
+
}, [model]);
|
|
64
|
+
// Prefetch image when slide changes
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
var _a;
|
|
67
|
+
const imageUrl = (_a = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _a === void 0 ? void 0 : _a.image;
|
|
68
|
+
if (!imageUrl) {
|
|
69
|
+
setImageLoaded(false);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Reset state
|
|
73
|
+
setImageLoaded(false);
|
|
74
|
+
// Preload the image
|
|
75
|
+
const img = new Image();
|
|
76
|
+
img.onload = () => {
|
|
77
|
+
setImageLoaded(true);
|
|
78
|
+
};
|
|
79
|
+
img.onerror = () => {
|
|
80
|
+
setImageLoaded(false);
|
|
81
|
+
};
|
|
82
|
+
img.src = imageUrl;
|
|
83
|
+
// Cleanup: abort loading if component unmounts or slide changes
|
|
84
|
+
return () => {
|
|
85
|
+
img.onload = null;
|
|
86
|
+
img.onerror = null;
|
|
87
|
+
};
|
|
88
|
+
}, [(_b = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _b === void 0 ? void 0 : _b.image]);
|
|
89
|
+
// Auto-zoom when slide changes
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (currentStorySegmentId) {
|
|
92
|
+
zoomToCurrentLayer();
|
|
93
|
+
}
|
|
94
|
+
}, [currentStorySegmentId, model]);
|
|
95
|
+
// Set selected layer on initial render and when story data changes
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if ((storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) && currentIndexDisplayed >= 0) {
|
|
98
|
+
setSelectedLayerByIndex(currentIndexDisplayed);
|
|
99
|
+
}
|
|
100
|
+
}, [storyData, currentIndexDisplayed, setSelectedLayerByIndex]);
|
|
101
|
+
// Listen for layer selection changes in unguided mode
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
// ! TODO this logic (getting a single selected layer) is also in the processing index.ts, move to tools
|
|
104
|
+
const handleSelectedStorySegmentChange = () => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
// This is just to update the displayed content
|
|
107
|
+
// So bail early if we don't need to do that
|
|
108
|
+
if (!storyData || storyData.storyType !== 'unguided') {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const localState = model.sharedModel.awareness.getLocalState();
|
|
112
|
+
if (!localState || !((_a = localState['selected']) === null || _a === void 0 ? void 0 : _a.value)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const selectedLayers = Object.keys(localState['selected'].value);
|
|
116
|
+
// Ensure only one layer is selected
|
|
117
|
+
if (selectedLayers.length !== 1) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const selectedLayerId = selectedLayers[0];
|
|
121
|
+
const selectedLayer = model.getLayer(selectedLayerId);
|
|
122
|
+
if (!selectedLayer || selectedLayer.type !== 'StorySegmentLayer') {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const index = (_b = storyData.storySegments) === null || _b === void 0 ? void 0 : _b.indexOf(selectedLayerId);
|
|
126
|
+
if (index === undefined || index === -1) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
setCurrentIndexDisplayed(index);
|
|
130
|
+
};
|
|
131
|
+
model.sharedModel.awareness.on('change', handleSelectedStorySegmentChange);
|
|
132
|
+
return () => {
|
|
133
|
+
model.sharedModel.awareness.off('change', handleSelectedStorySegmentChange);
|
|
134
|
+
};
|
|
135
|
+
}, [model, storyData]);
|
|
136
|
+
const handlePrev = () => {
|
|
137
|
+
if (currentIndexDisplayed > 0) {
|
|
138
|
+
const newIndex = currentIndexDisplayed - 1;
|
|
139
|
+
setCurrentIndexDisplayed(newIndex);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const handleNext = () => {
|
|
143
|
+
if (currentIndexDisplayed < storySegments.length - 1) {
|
|
144
|
+
const newIndex = currentIndexDisplayed + 1;
|
|
145
|
+
setCurrentIndexDisplayed(newIndex);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
if (!storyData || ((_c = storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) === null || _c === void 0 ? void 0 : _c.length) === 0) {
|
|
149
|
+
return (React.createElement("div", { style: { padding: '0 0.5rem 0.5rem 0.5rem' } },
|
|
150
|
+
React.createElement("p", null, "No Segments available. Add one using the Add Layer menu.")));
|
|
151
|
+
}
|
|
152
|
+
return (React.createElement("div", { className: "jgis-story-viewer-panel" },
|
|
153
|
+
((_d = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _d === void 0 ? void 0 : _d.image) && imageLoaded ? (React.createElement("div", { className: "jgis-story-viewer-image-container" },
|
|
154
|
+
React.createElement("img", { src: activeSlide.content.image, alt: activeSlide.content.title || 'Story map image', className: "jgis-story-viewer-image" }),
|
|
155
|
+
React.createElement("h1", { className: "jgis-story-viewer-image-title" }, layerName !== null && layerName !== void 0 ? layerName : `Slide ${currentIndexDisplayed + 1}`),
|
|
156
|
+
storyData.storyType === 'guided' && (React.createElement("div", { className: "jgis-story-viewer-nav-container" },
|
|
157
|
+
React.createElement(StoryNavBar, { onPrev: handlePrev, onNext: handleNext, hasPrev: currentIndexDisplayed > 0, hasNext: currentIndexDisplayed < storySegments.length - 1 }))))) : (React.createElement(React.Fragment, null,
|
|
158
|
+
React.createElement("h1", { className: "jgis-story-viewer-title" }, storyData.title),
|
|
159
|
+
storyData.storyType === 'guided' && (React.createElement(StoryNavBar, { onPrev: handlePrev, onNext: handleNext, hasPrev: currentIndexDisplayed > 0, hasNext: currentIndexDisplayed < storySegments.length - 1 })))),
|
|
160
|
+
React.createElement("h2", { className: "jgis-story-viewer-subtitle" }, ((_e = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _e === void 0 ? void 0 : _e.title)
|
|
161
|
+
? activeSlide.content.title
|
|
162
|
+
: 'Slide Title'),
|
|
163
|
+
((_f = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _f === void 0 ? void 0 : _f.markdown) && (React.createElement("div", { className: "jgis-story-viewer-content" },
|
|
164
|
+
React.createElement(Markdown, null, activeSlide.content.markdown)))));
|
|
165
|
+
}
|
|
166
|
+
export default StoryViewerPanel;
|
|
@@ -4,26 +4,106 @@ import { PanelTabs, TabsContent, TabsList, TabsTrigger, } from '../shared/compon
|
|
|
4
4
|
import StacPanel from '../stacBrowser/components/StacPanel';
|
|
5
5
|
import FilterComponent from './components/filter-panel/Filter';
|
|
6
6
|
export const LeftPanel = (props) => {
|
|
7
|
+
var _a;
|
|
7
8
|
const [settings, setSettings] = React.useState(props.model.jgisSettings);
|
|
9
|
+
const [options, setOptions] = React.useState(props.model.getOptions());
|
|
10
|
+
const storyMapPresentationMode = (_a = options.storyMapPresentationMode) !== null && _a !== void 0 ? _a : false;
|
|
11
|
+
const [layerTree, setLayerTree] = React.useState(props.model.getLayerTree());
|
|
8
12
|
React.useEffect(() => {
|
|
9
13
|
const onSettingsChanged = () => {
|
|
10
14
|
setSettings(Object.assign({}, props.model.jgisSettings));
|
|
11
15
|
};
|
|
16
|
+
const onOptionsChanged = () => {
|
|
17
|
+
setOptions(Object.assign({}, props.model.getOptions()));
|
|
18
|
+
};
|
|
19
|
+
const updateLayerTree = () => {
|
|
20
|
+
setLayerTree(props.model.getLayerTree() || []);
|
|
21
|
+
};
|
|
12
22
|
props.model.settingsChanged.connect(onSettingsChanged);
|
|
23
|
+
props.model.sharedOptionsChanged.connect(onOptionsChanged);
|
|
24
|
+
props.model.sharedModel.layersChanged.connect(updateLayerTree);
|
|
25
|
+
props.model.sharedModel.layerTreeChanged.connect(updateLayerTree);
|
|
26
|
+
updateLayerTree();
|
|
13
27
|
return () => {
|
|
14
28
|
props.model.settingsChanged.disconnect(onSettingsChanged);
|
|
29
|
+
props.model.sharedOptionsChanged.disconnect(onOptionsChanged);
|
|
30
|
+
props.model.sharedModel.layersChanged.disconnect(updateLayerTree);
|
|
31
|
+
props.model.sharedModel.layerTreeChanged.disconnect(updateLayerTree);
|
|
15
32
|
};
|
|
16
33
|
}, [props.model]);
|
|
34
|
+
// Since story segments are technically layers they are stored in the layer tree, so we separate them
|
|
35
|
+
// from regular layers. Process the tree once to build both filtered and story segment trees.
|
|
36
|
+
const { filteredLayerTree, storySegmentLayerTree } = React.useMemo(() => {
|
|
37
|
+
const filtered = [];
|
|
38
|
+
const storySegments = [];
|
|
39
|
+
const processLayer = (layer) => {
|
|
40
|
+
if (typeof layer === 'string') {
|
|
41
|
+
const layerData = props.model.getLayer(layer);
|
|
42
|
+
const isStorySegment = (layerData === null || layerData === void 0 ? void 0 : layerData.type) === 'StorySegmentLayer';
|
|
43
|
+
return {
|
|
44
|
+
filtered: isStorySegment ? null : layer,
|
|
45
|
+
storySegment: isStorySegment ? layer : null,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// For layer groups, recursively process their layers
|
|
49
|
+
const filteredGroupLayers = [];
|
|
50
|
+
const storySegmentGroupLayers = [];
|
|
51
|
+
for (const groupLayer of layer.layers) {
|
|
52
|
+
const result = processLayer(groupLayer);
|
|
53
|
+
if (result.filtered !== null) {
|
|
54
|
+
filteredGroupLayers.push(result.filtered);
|
|
55
|
+
}
|
|
56
|
+
if (result.storySegment !== null) {
|
|
57
|
+
storySegmentGroupLayers.push(result.storySegment);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
filtered: filteredGroupLayers.length > 0
|
|
62
|
+
? Object.assign(Object.assign({}, layer), { layers: filteredGroupLayers }) : null,
|
|
63
|
+
storySegment: storySegmentGroupLayers.length > 0
|
|
64
|
+
? Object.assign(Object.assign({}, layer), { layers: storySegmentGroupLayers }) : null,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
for (const layer of layerTree) {
|
|
68
|
+
const result = processLayer(layer);
|
|
69
|
+
if (result.filtered !== null) {
|
|
70
|
+
filtered.push(result.filtered);
|
|
71
|
+
}
|
|
72
|
+
if (result.storySegment !== null) {
|
|
73
|
+
storySegments.push(result.storySegment);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Reverse filteredLayerTree before returning
|
|
77
|
+
filtered.reverse();
|
|
78
|
+
return {
|
|
79
|
+
filteredLayerTree: filtered,
|
|
80
|
+
storySegmentLayerTree: storySegments,
|
|
81
|
+
};
|
|
82
|
+
}, [layerTree]);
|
|
83
|
+
// Updates story segments array based on layer tree array
|
|
84
|
+
React.useEffect(() => {
|
|
85
|
+
const { storySegmentId, story } = props.model.getSelectedStory();
|
|
86
|
+
if (!story) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
props.model.sharedModel.updateStoryMap(storySegmentId, Object.assign(Object.assign({}, story), { storySegments: storySegmentLayerTree }));
|
|
90
|
+
}, [storySegmentLayerTree]);
|
|
17
91
|
const allLeftTabsDisabled = settings.layersDisabled &&
|
|
18
92
|
settings.stacBrowserDisabled &&
|
|
19
|
-
settings.filtersDisabled
|
|
93
|
+
settings.filtersDisabled &&
|
|
94
|
+
settings.storyMapsDisabled;
|
|
20
95
|
const leftPanelVisible = !settings.leftPanelDisabled && !allLeftTabsDisabled;
|
|
21
96
|
const tabInfo = [
|
|
22
97
|
!settings.layersDisabled ? { name: 'layers', title: 'Layers' } : false,
|
|
23
|
-
!settings.stacBrowserDisabled
|
|
98
|
+
!settings.stacBrowserDisabled && !storyMapPresentationMode
|
|
24
99
|
? { name: 'stac', title: 'Stac Browser' }
|
|
25
100
|
: false,
|
|
26
|
-
!settings.filtersDisabled
|
|
101
|
+
!settings.filtersDisabled && !storyMapPresentationMode
|
|
102
|
+
? { name: 'filters', title: 'Filters' }
|
|
103
|
+
: false,
|
|
104
|
+
!settings.storyMapsDisabled
|
|
105
|
+
? { name: 'segments', title: 'Segments' }
|
|
106
|
+
: false,
|
|
27
107
|
].filter(Boolean);
|
|
28
108
|
const [curTab, setCurTab] = React.useState(tabInfo.length > 0 ? tabInfo[0].name : undefined);
|
|
29
109
|
return (React.createElement("div", { className: "jgis-left-panel-container", style: { display: leftPanelVisible ? 'block' : 'none' } },
|
|
@@ -37,9 +117,11 @@ export const LeftPanel = (props) => {
|
|
|
37
117
|
}
|
|
38
118
|
} }, tab.title)))),
|
|
39
119
|
!settings.layersDisabled && (React.createElement(TabsContent, { value: "layers", className: "jgis-panel-tab-content jp-gis-layerPanel" },
|
|
40
|
-
React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state }))),
|
|
120
|
+
React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: filteredLayerTree }))),
|
|
41
121
|
!settings.stacBrowserDisabled && (React.createElement(TabsContent, { value: "stac", className: "jgis-panel-tab-content" },
|
|
42
122
|
React.createElement(StacPanel, { model: props.model }))),
|
|
43
123
|
!settings.filtersDisabled && (React.createElement(TabsContent, { value: "filters", className: "jgis-panel-tab-content" },
|
|
44
|
-
React.createElement(FilterComponent, { model: props.model })))
|
|
124
|
+
React.createElement(FilterComponent, { model: props.model }))),
|
|
125
|
+
!settings.storyMapsDisabled && (React.createElement(TabsContent, { value: "segments", className: "jgis-panel-tab-content" },
|
|
126
|
+
React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: storySegmentLayerTree }))))));
|
|
45
127
|
};
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AnnotationsPanel } from './annotationPanel';
|
|
3
3
|
import { IdentifyPanelComponent } from './components/identify-panel/IdentifyPanel';
|
|
4
|
+
import { PreviewModeSwitch } from './components/story-maps/PreviewModeSwitch';
|
|
5
|
+
import StoryEditorPanel from './components/story-maps/StoryEditorPanel';
|
|
6
|
+
import StoryViewerPanel from './components/story-maps/StoryViewerPanel';
|
|
4
7
|
import { ObjectPropertiesReact } from './objectproperties';
|
|
5
8
|
import { PanelTabs, TabsContent, TabsList, TabsTrigger, } from '../shared/components/Tabs';
|
|
6
9
|
export const RightPanel = props => {
|
|
10
|
+
var _a;
|
|
11
|
+
const [displayEditor, setDisplayEditor] = React.useState(true);
|
|
7
12
|
const [settings, setSettings] = React.useState(props.model.jgisSettings);
|
|
13
|
+
const [options, setOptions] = React.useState(props.model.getOptions());
|
|
14
|
+
const storyMapPresentationMode = (_a = options.storyMapPresentationMode) !== null && _a !== void 0 ? _a : false;
|
|
8
15
|
const tabInfo = [
|
|
9
|
-
!settings.objectPropertiesDisabled
|
|
16
|
+
!settings.objectPropertiesDisabled && !storyMapPresentationMode
|
|
10
17
|
? { name: 'objectProperties', title: 'Object Properties' }
|
|
11
18
|
: false,
|
|
19
|
+
!settings.storyMapsDisabled
|
|
20
|
+
? {
|
|
21
|
+
name: 'storyPanel',
|
|
22
|
+
title: displayEditor ? 'Story Editor' : 'Story Map',
|
|
23
|
+
}
|
|
24
|
+
: false,
|
|
12
25
|
!settings.annotationsDisabled
|
|
13
26
|
? { name: 'annotations', title: 'Annotations' }
|
|
14
27
|
: false,
|
|
@@ -16,11 +29,19 @@ export const RightPanel = props => {
|
|
|
16
29
|
? { name: 'identifyPanel', title: 'Identified Features' }
|
|
17
30
|
: false,
|
|
18
31
|
].filter(Boolean);
|
|
19
|
-
const [curTab, setCurTab] = React.useState(
|
|
32
|
+
const [curTab, setCurTab] = React.useState(() => {
|
|
33
|
+
if (storyMapPresentationMode) {
|
|
34
|
+
return 'storyPanel';
|
|
35
|
+
}
|
|
36
|
+
return tabInfo.length > 0 ? tabInfo[0].name : '';
|
|
37
|
+
});
|
|
20
38
|
React.useEffect(() => {
|
|
21
39
|
const onSettingsChanged = () => {
|
|
22
40
|
setSettings(Object.assign({}, props.model.jgisSettings));
|
|
23
41
|
};
|
|
42
|
+
const onOptionsChanged = () => {
|
|
43
|
+
setOptions(Object.assign({}, props.model.getOptions()));
|
|
44
|
+
};
|
|
24
45
|
let currentlyIdentifiedFeatures = undefined;
|
|
25
46
|
const onAwerenessChanged = (_, clients) => {
|
|
26
47
|
var _a;
|
|
@@ -34,9 +55,11 @@ export const RightPanel = props => {
|
|
|
34
55
|
}
|
|
35
56
|
};
|
|
36
57
|
props.model.settingsChanged.connect(onSettingsChanged);
|
|
58
|
+
props.model.sharedOptionsChanged.connect(onOptionsChanged);
|
|
37
59
|
props.model.clientStateChanged.connect(onAwerenessChanged);
|
|
38
60
|
return () => {
|
|
39
61
|
props.model.settingsChanged.disconnect(onSettingsChanged);
|
|
62
|
+
props.model.sharedOptionsChanged.disconnect(onOptionsChanged);
|
|
40
63
|
props.model.clientStateChanged.disconnect(onAwerenessChanged);
|
|
41
64
|
};
|
|
42
65
|
}, [props.model]);
|
|
@@ -45,6 +68,9 @@ export const RightPanel = props => {
|
|
|
45
68
|
settings.identifyDisabled;
|
|
46
69
|
const rightPanelVisible = !settings.rightPanelDisabled && !allRightTabsDisabled;
|
|
47
70
|
const [selectedObjectProperties, setSelectedObjectProperties] = React.useState(undefined);
|
|
71
|
+
const toggleEditor = () => {
|
|
72
|
+
setDisplayEditor(!displayEditor);
|
|
73
|
+
};
|
|
48
74
|
return (React.createElement("div", { className: "jgis-right-panel-container", style: { display: rightPanelVisible ? 'block' : 'none' } },
|
|
49
75
|
React.createElement(PanelTabs, { className: "jgis-panel-tabs", curTab: curTab },
|
|
50
76
|
React.createElement(TabsList, null, tabInfo.map(tab => (React.createElement(TabsTrigger, { className: "jGIS-layer-browser-category", key: tab.name, value: tab.name, onClick: () => {
|
|
@@ -57,6 +83,10 @@ export const RightPanel = props => {
|
|
|
57
83
|
} }, tab.title)))),
|
|
58
84
|
!settings.objectPropertiesDisabled && (React.createElement(TabsContent, { value: "objectProperties", className: "jgis-panel-tab-content" },
|
|
59
85
|
React.createElement(ObjectPropertiesReact, { setSelectedObject: setSelectedObjectProperties, selectedObject: selectedObjectProperties, formSchemaRegistry: props.formSchemaRegistry, model: props.model }))),
|
|
86
|
+
!settings.storyMapsDisabled && (React.createElement(TabsContent, { value: "storyPanel", className: "jgis-panel-tab-content", style: { paddingTop: 0 } },
|
|
87
|
+
React.createElement("div", { style: { padding: '0 0.5rem 0.5rem 0.5rem' } },
|
|
88
|
+
!storyMapPresentationMode && (React.createElement(PreviewModeSwitch, { checked: !displayEditor, onCheckedChange: toggleEditor })),
|
|
89
|
+
storyMapPresentationMode || !displayEditor ? (React.createElement(StoryViewerPanel, { model: props.model })) : (React.createElement(StoryEditorPanel, { model: props.model }))))),
|
|
60
90
|
!settings.annotationsDisabled && (React.createElement(TabsContent, { value: "annotations", className: "jgis-panel-tab-content" },
|
|
61
91
|
React.createElement(AnnotationsPanel, { annotationModel: props.annotationModel, jgisModel: props.model }))),
|
|
62
92
|
!settings.identifyDisabled && (React.createElement(TabsContent, { value: "identifyPanel", className: "jgis-panel-tab-content" },
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dialog } from "./Dialog";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { Command as CommandPrimitive } from 'cmdk';
|
|
13
|
+
import { SearchIcon } from 'lucide-react';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./Dialog";
|
|
16
|
+
import { cn } from './utils';
|
|
17
|
+
function Command(_a) {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (React.createElement(CommandPrimitive, Object.assign({ "data-slot": "command", className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className) }, props)));
|
|
20
|
+
}
|
|
21
|
+
function CommandDialog(_a) {
|
|
22
|
+
var { title = 'Command Palette', description = 'Search for a command to run...', children, className, showCloseButton = true } = _a, props = __rest(_a, ["title", "description", "children", "className", "showCloseButton"]);
|
|
23
|
+
return (React.createElement(Dialog, Object.assign({}, props),
|
|
24
|
+
React.createElement(DialogHeader, { className: "sr-only" },
|
|
25
|
+
React.createElement(DialogTitle, null, title),
|
|
26
|
+
React.createElement(DialogDescription, null, description)),
|
|
27
|
+
React.createElement(DialogContent, { className: cn('overflow-hidden p-0', className), showCloseButton: showCloseButton },
|
|
28
|
+
React.createElement(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5" }, children))));
|
|
29
|
+
}
|
|
30
|
+
function CommandInput(_a) {
|
|
31
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
+
return (React.createElement("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3" },
|
|
33
|
+
React.createElement(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
34
|
+
React.createElement(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className: cn('placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className) }, props))));
|
|
35
|
+
}
|
|
36
|
+
function CommandList(_a) {
|
|
37
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
+
return (React.createElement(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className: cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className) }, props)));
|
|
39
|
+
}
|
|
40
|
+
function CommandEmpty(_a) {
|
|
41
|
+
var props = __rest(_a, []);
|
|
42
|
+
return (React.createElement(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: "py-6 text-center text-sm" }, props)));
|
|
43
|
+
}
|
|
44
|
+
function CommandGroup(_a) {
|
|
45
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
46
|
+
return (React.createElement(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className) }, props)));
|
|
47
|
+
}
|
|
48
|
+
function CommandSeparator(_a) {
|
|
49
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
50
|
+
return (React.createElement(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className: cn('bg-border -mx-1 h-px', className) }, props)));
|
|
51
|
+
}
|
|
52
|
+
function CommandItem(_a) {
|
|
53
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
+
return (React.createElement(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props)));
|
|
55
|
+
}
|
|
56
|
+
function CommandShortcut(_a) {
|
|
57
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
58
|
+
return (React.createElement("span", Object.assign({ "data-slot": "command-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className) }, props)));
|
|
59
|
+
}
|
|
60
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,62 @@
|
|
|
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 DialogPrimitive from '@radix-ui/react-dialog';
|
|
13
|
+
import { XIcon } from 'lucide-react';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { cn } from './utils';
|
|
16
|
+
function Dialog(_a) {
|
|
17
|
+
var props = __rest(_a, []);
|
|
18
|
+
return React.createElement(DialogPrimitive.Root, Object.assign({ "data-slot": "dialog" }, props));
|
|
19
|
+
}
|
|
20
|
+
function DialogTrigger(_a) {
|
|
21
|
+
var props = __rest(_a, []);
|
|
22
|
+
return React.createElement(DialogPrimitive.Trigger, Object.assign({ "data-slot": "dialog-trigger" }, props));
|
|
23
|
+
}
|
|
24
|
+
function DialogPortal(_a) {
|
|
25
|
+
var props = __rest(_a, []);
|
|
26
|
+
return React.createElement(DialogPrimitive.Portal, Object.assign({ "data-slot": "dialog-portal" }, props));
|
|
27
|
+
}
|
|
28
|
+
function DialogClose(_a) {
|
|
29
|
+
var props = __rest(_a, []);
|
|
30
|
+
return React.createElement(DialogPrimitive.Close, Object.assign({ "data-slot": "dialog-close" }, props));
|
|
31
|
+
}
|
|
32
|
+
function DialogOverlay(_a) {
|
|
33
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
34
|
+
return (React.createElement(DialogPrimitive.Overlay, Object.assign({ "data-slot": "dialog-overlay", className: cn('jgis-dialog-overlay', className) }, props)));
|
|
35
|
+
}
|
|
36
|
+
function DialogContent(_a) {
|
|
37
|
+
var { className, children, showCloseButton = true } = _a, props = __rest(_a, ["className", "children", "showCloseButton"]);
|
|
38
|
+
return (React.createElement(DialogPortal, { "data-slot": "dialog-portal" },
|
|
39
|
+
React.createElement(DialogOverlay, null),
|
|
40
|
+
React.createElement(DialogPrimitive.Content, Object.assign({ "data-slot": "dialog-content", className: cn('jgis-dialog-content', className) }, props),
|
|
41
|
+
children,
|
|
42
|
+
showCloseButton && (React.createElement(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "jgis-dialog-close" },
|
|
43
|
+
React.createElement(XIcon, null),
|
|
44
|
+
React.createElement("span", { className: "jgis-sr-only" }, "Close"))))));
|
|
45
|
+
}
|
|
46
|
+
function DialogHeader(_a) {
|
|
47
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
+
return (React.createElement("div", Object.assign({ "data-slot": "dialog-header", className: cn('jgis-dialog-header', className) }, props)));
|
|
49
|
+
}
|
|
50
|
+
function DialogFooter(_a) {
|
|
51
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
52
|
+
return (React.createElement("div", Object.assign({ "data-slot": "dialog-footer", className: cn('jgis-dialog-footer', className) }, props)));
|
|
53
|
+
}
|
|
54
|
+
function DialogTitle(_a) {
|
|
55
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
56
|
+
return (React.createElement(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className: cn('jgis-dialog-title', className) }, props)));
|
|
57
|
+
}
|
|
58
|
+
function DialogDescription(_a) {
|
|
59
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
60
|
+
return (React.createElement(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", className: cn('jgis-dialog-description', className) }, props)));
|
|
61
|
+
}
|
|
62
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,26 @@
|
|
|
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 RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
13
|
+
import { CircleIcon } from 'lucide-react';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { cn } from './utils';
|
|
16
|
+
function RadioGroup(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return (React.createElement(RadioGroupPrimitive.Root, Object.assign({ "data-slot": "radio-group", className: cn('jgis-radio-group', className) }, props)));
|
|
19
|
+
}
|
|
20
|
+
function RadioGroupItem(_a) {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (React.createElement(RadioGroupPrimitive.Item, Object.assign({ "data-slot": "radio-group-item", className: cn('jgis-radio-group-item', className) }, props),
|
|
23
|
+
React.createElement(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "jgis-radio-group-indicator" },
|
|
24
|
+
React.createElement(CircleIcon, { className: "jgis-radio-group-indicator-icon" }))));
|
|
25
|
+
}
|
|
26
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,20 @@
|
|
|
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 SwitchPrimitive from '@radix-ui/react-switch';
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { cn } from './utils';
|
|
15
|
+
function Switch(_a) {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (React.createElement(SwitchPrimitive.Root, Object.assign({ "data-slot": "switch", className: cn('jgis-switch', className) }, props),
|
|
18
|
+
React.createElement(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "jgis-switch-thumb" })));
|
|
19
|
+
}
|
|
20
|
+
export { Switch };
|
package/lib/toolbar/widget.d.ts
CHANGED
|
@@ -12,7 +12,17 @@ export declare class Separator extends Widget {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class ToolbarWidget extends ReactiveToolbar {
|
|
14
14
|
private _model;
|
|
15
|
+
private _newSubMenu;
|
|
15
16
|
constructor(options: ToolbarWidget.IOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Updates the story segment menu item based on settings
|
|
19
|
+
*/
|
|
20
|
+
private _updateStorySegmentMenuItem;
|
|
21
|
+
/**
|
|
22
|
+
* Handles settings changes
|
|
23
|
+
*/
|
|
24
|
+
private _onSettingsChanged;
|
|
25
|
+
dispose(): void;
|
|
16
26
|
}
|
|
17
27
|
export declare namespace ToolbarWidget {
|
|
18
28
|
interface IOptions extends Toolbar.IOptions {
|