@terraware/web-components 4.2.13 → 4.2.14-rc.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/components/AntSwitch/index.js +8 -14
- package/components/Autocomplete/Autocomplete.js +67 -70
- package/components/Badge/index.js +16 -20
- package/components/BusySpinner/index.js +30 -35
- package/components/Button/Button.js +23 -27
- package/components/Button/button.test.js +8 -10
- package/components/Checkbox.js +10 -19
- package/components/Confirm/index.js +44 -51
- package/components/DatePicker/DatePicker.js +116 -117
- package/components/DialogBox/DialogBox.js +76 -66
- package/components/Divisor.js +15 -20
- package/components/Dropdown.js +54 -61
- package/components/EditableTable/index.js +129 -135
- package/components/ErrorBox/ErrorBox.js +37 -36
- package/components/FileChooser/index.js +73 -77
- package/components/FormBottomBar/index.js +63 -69
- package/components/Icon/Icon.js +14 -21
- package/components/Icon/icons/index.js +251 -257
- package/components/IconTooltip/index.js +29 -34
- package/components/Map/MapBox.js +199 -220
- package/components/Map/MapContainer.js +14 -18
- package/components/Map/MapDateSliderControl.js +44 -46
- package/components/Map/MapDrawer.js +32 -33
- package/components/Map/MapLegend.js +96 -95
- package/components/Map/MapViewStyleControl.js +38 -48
- package/components/Map/ReactMapboxWrapper.js +2 -9
- package/components/Map/index.js +47 -55
- package/components/Map/types.js +2 -8
- package/components/Map/useMaintainLayerOrder.js +4 -11
- package/components/Markdown/index.js +14 -21
- package/components/Message/Message.js +59 -51
- package/components/MultiSelect/MultiSelect.test.js +22 -24
- package/components/MultiSelect/index.js +73 -69
- package/components/Navbar/NavFooter.js +8 -13
- package/components/Navbar/NavItem.js +43 -37
- package/components/Navbar/NavSection.js +13 -17
- package/components/Navbar/Navbar.js +35 -38
- package/components/Navbar/SubNavbar.js +8 -13
- package/components/Note.js +14 -19
- package/components/OverlayModal/OverlayModal.js +36 -37
- package/components/PageForm/index.js +30 -35
- package/components/PhotoChooser/index.js +93 -98
- package/components/Pill/index.js +29 -31
- package/components/PillList/index.js +16 -22
- package/components/PlacementWrapper/index.js +20 -25
- package/components/PopoverMenu/Popover.js +33 -37
- package/components/PopoverMenu/index.js +41 -46
- package/components/PopoverMultiSelect/index.js +18 -21
- package/components/ProgressCircle/ProgressCircle.js +23 -26
- package/components/RadioButton.js +7 -14
- package/components/Select/Select.js +8 -13
- package/components/Select/SelectT.js +110 -108
- package/components/Separator/index.js +8 -14
- package/components/Size.js +1 -5
- package/components/Slider/index.js +7 -13
- package/components/SummaryBox.js +36 -39
- package/components/Tabs/index.js +75 -77
- package/components/TextTruncated/index.js +64 -65
- package/components/Textfield/Textfield.js +100 -95
- package/components/Textfield/TruncatedTextArea.js +44 -46
- package/components/TimelineSlider/TimelineMarker.js +24 -28
- package/components/TimelineSlider/TimelineRail.js +5 -11
- package/components/TimelineSlider/index.js +47 -51
- package/components/Tooltip/Tooltip.js +21 -26
- package/components/ViewPhotosDialog/index.js +58 -62
- package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
- package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Annotation.js +197 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
- package/components/VirtualWalkthrough/Application.d.ts +9 -0
- package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Application.js +32 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AutoRotator.js +217 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
- package/components/VirtualWalkthrough/CameraInfo.js +88 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
- package/components/VirtualWalkthrough/GradientSky.js +73 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatControls.js +252 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatModel.js +60 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts +27 -0
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts.map +1 -0
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +282 -0
- package/components/VirtualWalkthrough/annotation-styles.css +5 -0
- package/components/VirtualWalkthrough/application-styles.css +4 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
- package/components/VirtualWalkthrough/boundary-ring.js +125 -0
- package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/groundPlane.js +47 -0
- package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
- package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
- package/components/svg/BlobbyGrayIconImage.js +36 -41
- package/components/svg/BlobbyGrayIconImport.js +36 -41
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
- package/components/svg/BlobbyIconCloudChecked.js +161 -158
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
- package/components/svg/BlobbyIconFolder.js +161 -158
- package/components/svg/BlobbyIconGraphReport.js +161 -158
- package/components/svg/BlobbyIconHappy.js +161 -158
- package/components/svg/BlobbyIconHeartMonitor.js +161 -158
- package/components/svg/BlobbyIconLeaf.js +161 -158
- package/components/svg/BlobbyIconLibrary.js +161 -158
- package/components/svg/BlobbyIconNursery.js +163 -160
- package/components/svg/BlobbyIconOrganization.js +161 -158
- package/components/svg/BlobbyIconParchment.js +161 -158
- package/components/svg/BlobbyIconPeople.js +161 -158
- package/components/svg/BlobbyIconSeedBank.js +161 -158
- package/components/svg/BlobbyIconSeedling.js +161 -158
- package/components/svg/BlobbyIconSeeds.js +161 -158
- package/components/svg/BlobbyIconSite.js +164 -161
- package/components/svg/BlobbyIconSparkles.js +161 -158
- package/components/svg/BlobbyIconWrench.js +161 -158
- package/components/svg/Bug.js +18 -27
- package/components/svg/Calendar.js +18 -27
- package/components/svg/CaretDown.js +18 -27
- package/components/svg/CaretLeft.js +18 -27
- package/components/svg/CaretRight.js +18 -27
- package/components/svg/CaretUp.js +18 -27
- package/components/svg/ChevronDown.js +18 -27
- package/components/svg/ChevronUp.js +18 -27
- package/components/svg/Close.js +18 -27
- package/components/svg/Critical.js +18 -27
- package/components/svg/Edit.js +161 -158
- package/components/svg/Error.js +18 -27
- package/components/svg/Filter.js +18 -27
- package/components/svg/Folder.js +18 -27
- package/components/svg/Help.js +18 -27
- package/components/svg/Home.js +18 -27
- package/components/svg/IconAdd.js +18 -27
- package/components/svg/IconArrowRight.js +19 -28
- package/components/svg/IconBusinessNetwork.js +18 -27
- package/components/svg/IconCalendar.js +18 -27
- package/components/svg/IconCancel.js +18 -27
- package/components/svg/IconChargingBattery.js +18 -27
- package/components/svg/IconChecklist.js +19 -28
- package/components/svg/IconCheckmark.js +18 -27
- package/components/svg/IconCoinInHand.js +18 -27
- package/components/svg/IconColumns.js +18 -27
- package/components/svg/IconComment.js +18 -27
- package/components/svg/IconDashboard.js +18 -27
- package/components/svg/IconDataMigration.js +18 -27
- package/components/svg/IconDocument.js +19 -28
- package/components/svg/IconDownloadFromTheCloud.js +19 -28
- package/components/svg/IconEdit.js +19 -28
- package/components/svg/IconExpand.js +19 -28
- package/components/svg/IconExport.js +18 -27
- package/components/svg/IconExternalLink.js +18 -27
- package/components/svg/IconEye.js +18 -27
- package/components/svg/IconEyeOff.js +18 -27
- package/components/svg/IconFile.js +18 -27
- package/components/svg/IconFolder.js +18 -27
- package/components/svg/IconFullScreen.js +18 -27
- package/components/svg/IconFutures.js +18 -27
- package/components/svg/IconGraphReport.js +18 -27
- package/components/svg/IconHeartMonitor.js +18 -27
- package/components/svg/IconHelp.js +19 -28
- package/components/svg/IconHistory.js +18 -27
- package/components/svg/IconImport.js +18 -27
- package/components/svg/IconIndex.js +18 -27
- package/components/svg/IconLayers.js +18 -27
- package/components/svg/IconLibrary.js +18 -27
- package/components/svg/IconList.js +18 -27
- package/components/svg/IconLivePlant.js +18 -27
- package/components/svg/IconLocations.js +18 -27
- package/components/svg/IconMail.js +18 -27
- package/components/svg/IconManager.js +18 -27
- package/components/svg/IconMarker.js +18 -27
- package/components/svg/IconMenu.js +18 -27
- package/components/svg/IconMenuHorizontal.js +18 -27
- package/components/svg/IconModule.js +18 -27
- package/components/svg/IconMyLocation.js +18 -27
- package/components/svg/IconNote.js +19 -28
- package/components/svg/IconNursery.js +18 -27
- package/components/svg/IconOrg.js +18 -27
- package/components/svg/IconParchment.js +18 -27
- package/components/svg/IconPhoto.js +18 -27
- package/components/svg/IconPlantsFilled.js +18 -27
- package/components/svg/IconRedo.js +18 -27
- package/components/svg/IconRestorationSite.js +18 -27
- package/components/svg/IconSeedBank.js +18 -27
- package/components/svg/IconSeedling.js +18 -27
- package/components/svg/IconSettings.js +18 -27
- package/components/svg/IconSlice.js +18 -27
- package/components/svg/IconSubmit.js +18 -27
- package/components/svg/IconSubtract.js +19 -28
- package/components/svg/IconSynced.js +18 -27
- package/components/svg/IconTrashCan.js +18 -27
- package/components/svg/IconTreasureMap.js +18 -27
- package/components/svg/IconUnavailable.js +18 -27
- package/components/svg/IconUndo.js +18 -27
- package/components/svg/IconVariable.js +18 -27
- package/components/svg/IconVideo.js +19 -28
- package/components/svg/IconWifi.js +18 -27
- package/components/svg/Info.js +18 -27
- package/components/svg/Key.js +18 -27
- package/components/svg/Leaf.js +18 -27
- package/components/svg/Lock.js +18 -27
- package/components/svg/Logo.js +40 -45
- package/components/svg/MenuVertical.js +18 -27
- package/components/svg/Notification.js +18 -27
- package/components/svg/Person.js +18 -27
- package/components/svg/Plus.js +18 -27
- package/components/svg/RestorationSite.js +18 -27
- package/components/svg/Search.js +18 -27
- package/components/svg/Seeds.js +18 -27
- package/components/svg/Site.js +18 -27
- package/components/svg/Sparkles.js +18 -27
- package/components/svg/Species.js +18 -27
- package/components/svg/Species2.js +161 -158
- package/components/svg/Spinner.js +27 -36
- package/components/svg/Star.js +18 -27
- package/components/svg/Success.js +18 -27
- package/components/svg/SuccessFilled.js +18 -27
- package/components/svg/TerrawareLogoDesktop.js +44 -49
- package/components/svg/TerrawareLogoMobile.js +20 -29
- package/components/svg/Touchscreen.js +18 -27
- package/components/svg/UploadCloud.js +161 -158
- package/components/svg/Warning.js +18 -27
- package/components/svg/WelcomeClipboard.js +130 -135
- package/components/svg/index.js +127 -895
- package/components/table/EnhancedTableToolbar.js +45 -47
- package/components/table/EnhancedTableToolbarV2.js +18 -26
- package/components/table/TableCellRenderer.js +137 -143
- package/components/table/TableHeader.js +45 -47
- package/components/table/TableHeaderItem.js +65 -64
- package/components/table/density.js +3 -11
- package/components/table/index.js +225 -218
- package/components/table/sort.js +8 -18
- package/components/table/sort.test.js +6 -8
- package/components/table/types.js +1 -5
- package/components/types/index.js +1 -5
- package/hooks/useBoolean.d.ts +4 -0
- package/hooks/useBoolean.d.ts.map +1 -0
- package/hooks/useBoolean.js +12 -0
- package/hooks/useCameraPosition.d.ts +8 -0
- package/hooks/useCameraPosition.d.ts.map +1 -0
- package/hooks/useCameraPosition.js +33 -0
- package/hooks/useDevicePerformance.d.ts +9 -0
- package/hooks/useDevicePerformance.d.ts.map +1 -0
- package/hooks/useDevicePerformance.js +16 -0
- package/index.js +57 -398
- package/license-report.html +1 -1
- package/package.json +10 -3
- package/style-dictionary-dist/TerrawareTheme.js +1 -7
- package/theme.js +7 -14
- package/utils/color.d.ts +2 -0
- package/utils/color.d.ts.map +1 -0
- package/utils/color.js +14 -0
- package/utils/date.js +13 -24
- package/utils/date.test.js +40 -43
- package/utils/index.js +5 -53
- package/utils/preventDefaultEvent.js +1 -7
- package/utils/text.js +2 -9
- package/utils/text.test.js +9 -11
- package/utils/useDeviceInfo.js +10 -16
- package/virtualWalkthrough.d.ts +34 -0
- package/virtualWalkthrough.d.ts.map +1 -0
- package/virtualWalkthrough.js +30 -0
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
require("react-multi-carousel/lib/styles.css");
|
|
12
|
-
var _material = require("@mui/material");
|
|
13
|
-
var _BusySpinner = _interopRequireDefault(require("../BusySpinner"));
|
|
14
|
-
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
15
|
-
var _DialogBox = _interopRequireDefault(require("../DialogBox/DialogBox"));
|
|
16
|
-
require("./styles.scss");
|
|
17
|
-
function ViewPhotosDialog(props) {
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import Carousel from 'react-multi-carousel';
|
|
3
|
+
import 'react-multi-carousel/lib/styles.css';
|
|
4
|
+
import { Box, Typography } from '@mui/material';
|
|
5
|
+
import BusySpinner from '../BusySpinner';
|
|
6
|
+
import Button from '../Button/Button';
|
|
7
|
+
import DialogBox from '../DialogBox/DialogBox';
|
|
8
|
+
import './styles.scss';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export default function ViewPhotosDialog(props) {
|
|
18
11
|
const {
|
|
19
12
|
onClose,
|
|
20
13
|
open,
|
|
@@ -26,11 +19,11 @@ function ViewPhotosDialog(props) {
|
|
|
26
19
|
numbered,
|
|
27
20
|
dots
|
|
28
21
|
} = props;
|
|
29
|
-
const [isPreviousDisabled, setIsPreviousDisabled] =
|
|
30
|
-
const [isNextDisabled, setIsNextDisabled] =
|
|
31
|
-
const [isLoading, setIsLoading] =
|
|
32
|
-
const [selectedSlide, setSelectedSlide] =
|
|
33
|
-
const myCarousel =
|
|
22
|
+
const [isPreviousDisabled, setIsPreviousDisabled] = useState(false);
|
|
23
|
+
const [isNextDisabled, setIsNextDisabled] = useState(false);
|
|
24
|
+
const [isLoading, setIsLoading] = useState([]);
|
|
25
|
+
const [selectedSlide, setSelectedSlide] = useState(initialSelectedSlide);
|
|
26
|
+
const myCarousel = useRef(null);
|
|
34
27
|
const responsive = {
|
|
35
28
|
mobile: {
|
|
36
29
|
breakpoint: {
|
|
@@ -40,7 +33,7 @@ function ViewPhotosDialog(props) {
|
|
|
40
33
|
items: 1
|
|
41
34
|
}
|
|
42
35
|
};
|
|
43
|
-
const handleChange =
|
|
36
|
+
const handleChange = useCallback(args => {
|
|
44
37
|
if (myCarousel.current) {
|
|
45
38
|
if (myCarousel.current.state.currentSlide + 1 >= photos.length) {
|
|
46
39
|
setIsNextDisabled(true);
|
|
@@ -65,16 +58,16 @@ function ViewPhotosDialog(props) {
|
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
60
|
}, [photos.length, selectedSlide, initialSelectedSlide, selectedSlide]);
|
|
68
|
-
|
|
61
|
+
useEffect(() => {
|
|
69
62
|
setIsLoading(new Array(photos.length).fill(true));
|
|
70
63
|
}, [photos.length]);
|
|
71
|
-
|
|
64
|
+
useEffect(() => {
|
|
72
65
|
setSelectedSlide(initialSelectedSlide);
|
|
73
66
|
}, [initialSelectedSlide]);
|
|
74
|
-
|
|
67
|
+
useEffect(() => {
|
|
75
68
|
handleChange();
|
|
76
69
|
}, [open, handleChange]);
|
|
77
|
-
|
|
70
|
+
useEffect(() => {
|
|
78
71
|
if (myCarousel.current) {
|
|
79
72
|
myCarousel.current.goToSlide(selectedSlide);
|
|
80
73
|
}
|
|
@@ -84,53 +77,56 @@ function ViewPhotosDialog(props) {
|
|
|
84
77
|
newIsLoading[index] = false;
|
|
85
78
|
setIsLoading(newIsLoading);
|
|
86
79
|
};
|
|
87
|
-
return /*#__PURE__*/
|
|
80
|
+
return /*#__PURE__*/_jsx(DialogBox, {
|
|
88
81
|
onClose: onClose,
|
|
89
82
|
open: open,
|
|
90
83
|
title: title,
|
|
91
84
|
size: "large",
|
|
92
85
|
scrolled: true,
|
|
93
|
-
middleButtons: [/*#__PURE__*/
|
|
86
|
+
middleButtons: [/*#__PURE__*/_jsx(Button, {
|
|
94
87
|
label: prevButtonLabel,
|
|
95
88
|
priority: "secondary",
|
|
96
89
|
onClick: () => setSelectedSlide(slide => Math.max(0, slide - 1)),
|
|
97
|
-
key: "button-1",
|
|
98
90
|
disabled: isPreviousDisabled,
|
|
99
91
|
icon: "caretLeft"
|
|
100
|
-
}), /*#__PURE__*/
|
|
92
|
+
}, 'button-1'), /*#__PURE__*/_jsx(Button, {
|
|
101
93
|
label: nextButtonLabel,
|
|
102
94
|
onClick: () => setSelectedSlide(slide => Math.min(photos.length - 1, slide + 1)),
|
|
103
|
-
key: "button-2",
|
|
104
95
|
disabled: isNextDisabled,
|
|
105
96
|
rightIcon: "caretRight"
|
|
106
|
-
})]
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
97
|
+
}, 'button-2')],
|
|
98
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
99
|
+
sx: {
|
|
100
|
+
'& .react-multi-carousel-list': {
|
|
101
|
+
paddingBottom: '20px'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
children: [/*#__PURE__*/_jsx(Carousel, {
|
|
105
|
+
responsive: responsive,
|
|
106
|
+
ref: myCarousel,
|
|
107
|
+
showDots: dots ?? true,
|
|
108
|
+
arrows: false,
|
|
109
|
+
ssr: true,
|
|
110
|
+
afterChange: handleChange,
|
|
111
|
+
children: photos.map((p, i) => /*#__PURE__*/_jsxs("div", {
|
|
112
|
+
className: "view-photos-dialog-container",
|
|
113
|
+
children: [isLoading[i] ? /*#__PURE__*/_jsx(BusySpinner, {
|
|
114
|
+
noBackground: true
|
|
115
|
+
}) : undefined, /*#__PURE__*/_jsx("a", {
|
|
116
|
+
href: p.url,
|
|
117
|
+
target: "blank",
|
|
118
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
119
|
+
className: "view-photos-dialog-image",
|
|
120
|
+
src: p.url,
|
|
121
|
+
alt: p.alt,
|
|
122
|
+
onLoad: () => finishLoading(i)
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
}, `photo-${i}-container`))
|
|
126
|
+
}), numbered ? /*#__PURE__*/_jsx(Typography, {
|
|
127
|
+
className: "photo-numbering",
|
|
128
|
+
children: `${selectedSlide + 1}/${photos.length}`
|
|
129
|
+
}) : undefined, photos[selectedSlide] && photos[selectedSlide].decoration]
|
|
130
|
+
})
|
|
131
|
+
});
|
|
136
132
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import './annotation-styles.css';
|
|
2
|
+
export type AnnotationIconType = 'text' | 'image' | 'video';
|
|
3
|
+
export interface AnnotationProps {
|
|
4
|
+
position: [number, number, number];
|
|
5
|
+
title: string;
|
|
6
|
+
bodyText?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
imageUrl?: string;
|
|
9
|
+
icon?: AnnotationIconType;
|
|
10
|
+
cameraPosition?: [number, number, number];
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
isEdit?: boolean;
|
|
13
|
+
isSelected?: boolean;
|
|
14
|
+
isViewed?: boolean;
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
onPositionChange?: (position: [number, number, number]) => void;
|
|
17
|
+
onView?: (annotation: AnnotationProps, screenX: number, screenY: number) => void;
|
|
18
|
+
onScreenPositionUpdate?: (index: number, screenX: number, screenY: number, size?: number) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A 3D annotation component that displays a hotspot in the scene.
|
|
22
|
+
* When clicked, displays annotation text and moves the camera.
|
|
23
|
+
* In edit mode, shows a translate gizmo when selected.
|
|
24
|
+
*
|
|
25
|
+
* @param props.position - The world position of the annotation
|
|
26
|
+
* @param props.index - The index of the annotation, used as a unique identifier
|
|
27
|
+
* @param props.title - The title displayed in the annotation
|
|
28
|
+
* @param props.bodyText - Optional description displayed in the annotation
|
|
29
|
+
* @param props.label - Optional label displayed on the hotspot
|
|
30
|
+
* @param props.cameraPosition - Optional camera position to move to when clicked. If undefined, camera stays at current position
|
|
31
|
+
* @param props.visible - Optional flag to show/hide the annotation. Defaults to true
|
|
32
|
+
* @param props.isEdit - Optional flag for edit mode. Defaults to false
|
|
33
|
+
* @param props.isSelected - Optional flag indicating if this annotation is selected. Defaults to false
|
|
34
|
+
* @param props.onSelect - Optional callback when annotation is clicked in edit mode
|
|
35
|
+
* @param props.onPositionChange - Optional callback when annotation position changes
|
|
36
|
+
*/
|
|
37
|
+
declare const Annotation: (props: AnnotationProps & {
|
|
38
|
+
index: number;
|
|
39
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export default Annotation;
|
|
41
|
+
//# sourceMappingURL=Annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualWalkthrough/Annotation.tsx"],"names":[],"mappings":"AAUA,OAAO,yBAAyB,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAS5D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnG;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,UAAU,GAAI,OAAO,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,4CAiL7D,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { Entity } from '@playcanvas/react';
|
|
3
|
+
import { Script } from '@playcanvas/react/components';
|
|
4
|
+
import { useApp } from '@playcanvas/react/hooks';
|
|
5
|
+
import { Gizmo, TranslateGizmo } from 'playcanvas';
|
|
6
|
+
import { Annotation as PcAnnotation } from 'playcanvas/scripts/esm/annotations.mjs';
|
|
7
|
+
import { CameraControls } from 'playcanvas/scripts/esm/camera-controls.mjs';
|
|
8
|
+
import { useCameraPosition } from '../../hooks/useCameraPosition';
|
|
9
|
+
import './annotation-styles.css';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* Target normalized-device x coordinate for a clicked annotation. +0.5 places
|
|
13
|
+
* the hotspot three quarters across the screen (25% from the right), leaving room
|
|
14
|
+
* for the annotation panel on the left without covering the hotspot.
|
|
15
|
+
*/
|
|
16
|
+
const VIEW_HORIZONTAL_NDC_BIAS = 0.5;
|
|
17
|
+
/**
|
|
18
|
+
* A 3D annotation component that displays a hotspot in the scene.
|
|
19
|
+
* When clicked, displays annotation text and moves the camera.
|
|
20
|
+
* In edit mode, shows a translate gizmo when selected.
|
|
21
|
+
*
|
|
22
|
+
* @param props.position - The world position of the annotation
|
|
23
|
+
* @param props.index - The index of the annotation, used as a unique identifier
|
|
24
|
+
* @param props.title - The title displayed in the annotation
|
|
25
|
+
* @param props.bodyText - Optional description displayed in the annotation
|
|
26
|
+
* @param props.label - Optional label displayed on the hotspot
|
|
27
|
+
* @param props.cameraPosition - Optional camera position to move to when clicked. If undefined, camera stays at current position
|
|
28
|
+
* @param props.visible - Optional flag to show/hide the annotation. Defaults to true
|
|
29
|
+
* @param props.isEdit - Optional flag for edit mode. Defaults to false
|
|
30
|
+
* @param props.isSelected - Optional flag indicating if this annotation is selected. Defaults to false
|
|
31
|
+
* @param props.onSelect - Optional callback when annotation is clicked in edit mode
|
|
32
|
+
* @param props.onPositionChange - Optional callback when annotation position changes
|
|
33
|
+
*/
|
|
34
|
+
const Annotation = props => {
|
|
35
|
+
const {
|
|
36
|
+
position,
|
|
37
|
+
cameraPosition,
|
|
38
|
+
bodyText,
|
|
39
|
+
imageUrl,
|
|
40
|
+
icon,
|
|
41
|
+
title,
|
|
42
|
+
label,
|
|
43
|
+
visible = true,
|
|
44
|
+
isEdit = false,
|
|
45
|
+
isSelected = false,
|
|
46
|
+
isViewed = false,
|
|
47
|
+
onSelect,
|
|
48
|
+
onPositionChange,
|
|
49
|
+
onView,
|
|
50
|
+
onScreenPositionUpdate,
|
|
51
|
+
index
|
|
52
|
+
} = props;
|
|
53
|
+
const app = useApp();
|
|
54
|
+
const {
|
|
55
|
+
setCamera
|
|
56
|
+
} = useCameraPosition();
|
|
57
|
+
const gizmoRef = useRef(null);
|
|
58
|
+
const layerRef = useRef(null);
|
|
59
|
+
|
|
60
|
+
// Use refs to always call the latest callback values
|
|
61
|
+
const isEditRef = useRef(isEdit);
|
|
62
|
+
const onSelectRef = useRef(onSelect);
|
|
63
|
+
const onViewRef = useRef(onView);
|
|
64
|
+
const onScreenPositionUpdateRef = useRef(onScreenPositionUpdate);
|
|
65
|
+
const positionRef = useRef(position);
|
|
66
|
+
const cameraPositionRef = useRef(cameraPosition);
|
|
67
|
+
const annotationForViewRef = useRef({
|
|
68
|
+
position,
|
|
69
|
+
title,
|
|
70
|
+
label,
|
|
71
|
+
bodyText,
|
|
72
|
+
imageUrl,
|
|
73
|
+
cameraPosition
|
|
74
|
+
});
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
isEditRef.current = isEdit;
|
|
77
|
+
onSelectRef.current = onSelect;
|
|
78
|
+
onViewRef.current = onView;
|
|
79
|
+
onScreenPositionUpdateRef.current = onScreenPositionUpdate;
|
|
80
|
+
positionRef.current = position;
|
|
81
|
+
cameraPositionRef.current = cameraPosition;
|
|
82
|
+
annotationForViewRef.current = {
|
|
83
|
+
position,
|
|
84
|
+
title,
|
|
85
|
+
label,
|
|
86
|
+
bodyText,
|
|
87
|
+
imageUrl,
|
|
88
|
+
cameraPosition
|
|
89
|
+
};
|
|
90
|
+
}, [isEdit, onSelect, onView, onScreenPositionUpdate, position, cameraPosition, title, label, bodyText, imageUrl]);
|
|
91
|
+
|
|
92
|
+
// Create a stable callback that reads from refs, because this is read from TfAnnotationManager when the annotation is added to the scene
|
|
93
|
+
const handleClick = useCallback((screenX, screenY) => {
|
|
94
|
+
if (isEditRef.current) {
|
|
95
|
+
onSelectRef.current?.();
|
|
96
|
+
} else {
|
|
97
|
+
setCamera(positionRef.current, cameraPositionRef.current, VIEW_HORIZONTAL_NDC_BIAS);
|
|
98
|
+
if (onViewRef.current && screenX !== undefined && screenY !== undefined) {
|
|
99
|
+
onViewRef.current(annotationForViewRef.current, screenX, screenY);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, [setCamera]);
|
|
103
|
+
|
|
104
|
+
// Stable callback so its identity doesn't churn the underlying script prop each frame.
|
|
105
|
+
const handleScreenPositionUpdate = useCallback((screenX, screenY, size) => {
|
|
106
|
+
onScreenPositionUpdateRef.current?.(index, screenX, screenY, size);
|
|
107
|
+
}, [index]);
|
|
108
|
+
const entityName = useMemo(() => `annotation-${index}`, [index]);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
const shouldShowGizmo = isEdit && isSelected && visible;
|
|
111
|
+
const cleanupGizmo = () => {
|
|
112
|
+
if (gizmoRef.current) {
|
|
113
|
+
try {
|
|
114
|
+
gizmoRef.current.detach();
|
|
115
|
+
gizmoRef.current.destroy();
|
|
116
|
+
} catch (error) {
|
|
117
|
+
// Ignore cleanup errors
|
|
118
|
+
}
|
|
119
|
+
gizmoRef.current = null;
|
|
120
|
+
}
|
|
121
|
+
if (layerRef.current && app.scene?.layers) {
|
|
122
|
+
try {
|
|
123
|
+
const layer = app.scene.layers.getLayerByName('Gizmo');
|
|
124
|
+
if (layer) {
|
|
125
|
+
app.scene.layers.remove(layerRef.current);
|
|
126
|
+
}
|
|
127
|
+
} catch (error) {
|
|
128
|
+
// Ignore cleanup errors
|
|
129
|
+
}
|
|
130
|
+
layerRef.current = null;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
if (!shouldShowGizmo) {
|
|
134
|
+
cleanupGizmo();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const setupGizmo = () => {
|
|
138
|
+
const annotationEntity = app.root.findByName(entityName);
|
|
139
|
+
const cameraEntity = app.root.findByName('camera');
|
|
140
|
+
const cameraComponent = cameraEntity?.camera;
|
|
141
|
+
const cameraControls = cameraEntity?.script?.get(CameraControls.scriptName);
|
|
142
|
+
if (!annotationEntity || !cameraComponent) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
if (!gizmoRef.current) {
|
|
146
|
+
if (!layerRef.current) {
|
|
147
|
+
layerRef.current = Gizmo.createLayer(app);
|
|
148
|
+
}
|
|
149
|
+
const gizmo = new TranslateGizmo(cameraComponent, layerRef.current);
|
|
150
|
+
gizmo.size = 0.75;
|
|
151
|
+
gizmo.snapIncrement = 0.01;
|
|
152
|
+
gizmo.coordSpace = 'world';
|
|
153
|
+
gizmo.on('transform:start', () => {
|
|
154
|
+
if (cameraControls) {
|
|
155
|
+
cameraControls.enabled = false;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
gizmo.on('transform:end', () => {
|
|
159
|
+
if (cameraControls) {
|
|
160
|
+
cameraControls.enabled = true;
|
|
161
|
+
}
|
|
162
|
+
if (onPositionChange) {
|
|
163
|
+
const pos = annotationEntity.getPosition();
|
|
164
|
+
onPositionChange([pos.x, pos.y, pos.z]);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
gizmo.attach([annotationEntity]);
|
|
168
|
+
gizmoRef.current = gizmo;
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
171
|
+
};
|
|
172
|
+
const intervalId = setInterval(() => {
|
|
173
|
+
if (setupGizmo()) {
|
|
174
|
+
clearInterval(intervalId);
|
|
175
|
+
}
|
|
176
|
+
}, 100);
|
|
177
|
+
return () => {
|
|
178
|
+
clearInterval(intervalId);
|
|
179
|
+
cleanupGizmo();
|
|
180
|
+
};
|
|
181
|
+
}, [app, isEdit, isSelected, visible, onPositionChange, entityName]);
|
|
182
|
+
return /*#__PURE__*/_jsx(Entity, {
|
|
183
|
+
name: entityName,
|
|
184
|
+
position: position,
|
|
185
|
+
children: /*#__PURE__*/_jsx(Script, {
|
|
186
|
+
script: PcAnnotation,
|
|
187
|
+
title: title,
|
|
188
|
+
label: label,
|
|
189
|
+
icon: icon,
|
|
190
|
+
text: bodyText,
|
|
191
|
+
enabled: visible,
|
|
192
|
+
onClickCallback: handleClick,
|
|
193
|
+
onScreenPositionUpdateCallback: isViewed ? handleScreenPositionUpdate : undefined
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
export default Annotation;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnnotationProps } from './Annotation';
|
|
2
|
+
export interface AnnotationEditPaneStrings {
|
|
3
|
+
editAnnotation: string;
|
|
4
|
+
title: string;
|
|
5
|
+
titleTooltip: string;
|
|
6
|
+
description: string;
|
|
7
|
+
descriptionTooltip: string;
|
|
8
|
+
label: string;
|
|
9
|
+
labelTooltip: string;
|
|
10
|
+
}
|
|
11
|
+
interface AnnotationEditPaneProps {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
annotation: AnnotationProps | null;
|
|
14
|
+
strings: AnnotationEditPaneStrings;
|
|
15
|
+
onUpdate: (updates: Partial<AnnotationProps>) => void;
|
|
16
|
+
onTextFieldFocus?: (isFocused: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const AnnotationEditPane: ({ visible, annotation, strings, onUpdate, onTextFieldFocus }: AnnotationEditPaneProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export default AnnotationEditPane;
|
|
20
|
+
//# sourceMappingURL=AnnotationEditPane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationEditPane.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualWalkthrough/AnnotationEditPane.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,uBAAuB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,yBAAyB,CAAC;IACnC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACtD,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AAED,QAAA,MAAM,kBAAkB,GAAI,8DAA8D,uBAAuB,mDA+HhH,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { Box, Fade, Tooltip, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import Textfield from '../Textfield/Textfield';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const AnnotationEditPane = ({
|
|
6
|
+
visible,
|
|
7
|
+
annotation,
|
|
8
|
+
strings,
|
|
9
|
+
onUpdate,
|
|
10
|
+
onTextFieldFocus
|
|
11
|
+
}) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const textFieldSx = useMemo(() => ({
|
|
14
|
+
'& .textfield-label': {
|
|
15
|
+
color: `${theme.palette.grey[400]} !important`
|
|
16
|
+
},
|
|
17
|
+
'& .textfield-value': {
|
|
18
|
+
backgroundColor: `${theme.palette.grey[800]} !important`,
|
|
19
|
+
borderColor: `${theme.palette.grey[700]} !important`
|
|
20
|
+
},
|
|
21
|
+
'& input': {
|
|
22
|
+
color: `${theme.palette.common.white} !important`
|
|
23
|
+
}
|
|
24
|
+
}), [theme]);
|
|
25
|
+
const handleTitleChange = useCallback(value => {
|
|
26
|
+
onUpdate({
|
|
27
|
+
title: value
|
|
28
|
+
});
|
|
29
|
+
}, [onUpdate]);
|
|
30
|
+
const handleBodyTextChange = useCallback(value => {
|
|
31
|
+
onUpdate({
|
|
32
|
+
bodyText: value
|
|
33
|
+
});
|
|
34
|
+
}, [onUpdate]);
|
|
35
|
+
const handleLabelChange = useCallback(value => {
|
|
36
|
+
onUpdate({
|
|
37
|
+
label: value
|
|
38
|
+
});
|
|
39
|
+
}, [onUpdate]);
|
|
40
|
+
const handleFocus = useCallback(() => {
|
|
41
|
+
onTextFieldFocus?.(true);
|
|
42
|
+
}, [onTextFieldFocus]);
|
|
43
|
+
const handleBlur = useCallback(() => {
|
|
44
|
+
onTextFieldFocus?.(false);
|
|
45
|
+
}, [onTextFieldFocus]);
|
|
46
|
+
if (!annotation) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
50
|
+
sx: {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
top: 0,
|
|
53
|
+
left: 0,
|
|
54
|
+
right: 0,
|
|
55
|
+
bottom: 0,
|
|
56
|
+
pointerEvents: 'none',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
justifyContent: 'flex-start',
|
|
59
|
+
alignItems: 'flex-start',
|
|
60
|
+
padding: 2,
|
|
61
|
+
zIndex: 1001
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/_jsx(Fade, {
|
|
64
|
+
in: visible,
|
|
65
|
+
timeout: 500,
|
|
66
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
67
|
+
sx: {
|
|
68
|
+
backgroundColor: theme.palette.grey[900],
|
|
69
|
+
color: theme.palette.common.white,
|
|
70
|
+
borderRadius: 2,
|
|
71
|
+
padding: 3,
|
|
72
|
+
minWidth: 320,
|
|
73
|
+
maxWidth: 400,
|
|
74
|
+
pointerEvents: 'auto'
|
|
75
|
+
},
|
|
76
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
77
|
+
sx: {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'column',
|
|
80
|
+
gap: 2
|
|
81
|
+
},
|
|
82
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
83
|
+
sx: {
|
|
84
|
+
fontWeight: 600
|
|
85
|
+
},
|
|
86
|
+
children: strings.editAnnotation
|
|
87
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
88
|
+
title: strings.titleTooltip,
|
|
89
|
+
placement: "top",
|
|
90
|
+
disableFocusListener: true,
|
|
91
|
+
children: /*#__PURE__*/_jsx(Textfield, {
|
|
92
|
+
id: "annotation-title",
|
|
93
|
+
label: strings.title,
|
|
94
|
+
type: "text",
|
|
95
|
+
value: annotation.title,
|
|
96
|
+
onChange: handleTitleChange,
|
|
97
|
+
onFocus: handleFocus,
|
|
98
|
+
onBlur: handleBlur,
|
|
99
|
+
sx: textFieldSx,
|
|
100
|
+
required: true
|
|
101
|
+
})
|
|
102
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
103
|
+
title: strings.descriptionTooltip,
|
|
104
|
+
placement: "top",
|
|
105
|
+
disableFocusListener: true,
|
|
106
|
+
children: /*#__PURE__*/_jsx(Textfield, {
|
|
107
|
+
id: "annotation-body",
|
|
108
|
+
label: strings.description,
|
|
109
|
+
type: "text",
|
|
110
|
+
value: annotation.bodyText ?? '',
|
|
111
|
+
onChange: handleBodyTextChange,
|
|
112
|
+
onFocus: handleFocus,
|
|
113
|
+
onBlur: handleBlur,
|
|
114
|
+
sx: textFieldSx
|
|
115
|
+
})
|
|
116
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
117
|
+
title: strings.labelTooltip,
|
|
118
|
+
placement: "top",
|
|
119
|
+
disableFocusListener: true,
|
|
120
|
+
children: /*#__PURE__*/_jsx(Textfield, {
|
|
121
|
+
id: "annotation-label",
|
|
122
|
+
label: strings.label,
|
|
123
|
+
type: "text",
|
|
124
|
+
value: annotation.label ?? '',
|
|
125
|
+
onChange: handleLabelChange,
|
|
126
|
+
onFocus: handleFocus,
|
|
127
|
+
onBlur: handleBlur,
|
|
128
|
+
sx: textFieldSx
|
|
129
|
+
})
|
|
130
|
+
})]
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
export default AnnotationEditPane;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnnotationProps } from './Annotation';
|
|
2
|
+
interface AnnotationPanelProps {
|
|
3
|
+
annotation: AnnotationProps | null;
|
|
4
|
+
hotspotPosition?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
size?: number;
|
|
8
|
+
} | null;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const AnnotationPanel: ({ annotation, hotspotPosition, onClose }: AnnotationPanelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default AnnotationPanel;
|
|
13
|
+
//# sourceMappingURL=AnnotationPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualWalkthrough/AnnotationPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,UAAU,oBAAoB;IAC5B,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IAInC,eAAe,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAuDD,QAAA,MAAM,eAAe,GAAI,0CAA0C,oBAAoB,mDAoItF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|