@neurodyn/react-room-viewer 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -273,9 +273,11 @@ declare const resources: {
|
|
|
273
273
|
|
|
274
274
|
export declare function RoomViewer({ type, src, tinuuid, name, language, width, height, dimensionUnit, displayUnit, apiKey, source, widgetSession, className, ...props }: RoomViewerProps & React_2.ComponentProps<'div'>): JSX.Element;
|
|
275
275
|
|
|
276
|
-
export declare function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, displayUnit, name, language, apiKey, source, widgetSession, open, defaultOpen, onOpenChange, ...props }: RoomViewerDialogProps): JSX.Element;
|
|
276
|
+
export declare function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, displayUnit, name, language, apiKey, source, widgetSession, disableClose, open, defaultOpen, onOpenChange, ...props }: RoomViewerDialogProps): JSX.Element;
|
|
277
277
|
|
|
278
278
|
declare interface RoomViewerDialogProps extends Omit<RoomViewerRootProps, 'showDialogCloseButton' | 'viewerSurface' | 'dialogPortalContainer' | 'viewerDialogOpen' | 'onViewerDialogOpenChange'>, Omit<DialogProps, 'children' | 'modal'> {
|
|
279
|
+
/** Hide close controls and prevent user dismissal for rugs and flooring. Defaults to false. */
|
|
280
|
+
disableClose?: boolean;
|
|
279
281
|
/** The controlled open state of the dialog. */
|
|
280
282
|
open?: boolean;
|
|
281
283
|
/** The open state of the dialog when it is initially rendered. */
|
package/dist/index.js
CHANGED
|
@@ -11799,6 +11799,7 @@ function MaterialSummaryCard({ actionLabel, actionClassName, actionPlacement, cl
|
|
|
11799
11799
|
});
|
|
11800
11800
|
return /*#__PURE__*/ jsxs("div", {
|
|
11801
11801
|
className: className,
|
|
11802
|
+
"data-neurodyn-room-viewer-product": "",
|
|
11802
11803
|
"data-testid": testId,
|
|
11803
11804
|
children: [
|
|
11804
11805
|
/*#__PURE__*/ jsx_runtime_jsx("div", {
|
|
@@ -11974,6 +11975,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
11974
11975
|
type: "button",
|
|
11975
11976
|
variant: "secondary",
|
|
11976
11977
|
"aria-label": t('floor.scene.share'),
|
|
11978
|
+
"data-neurodyn-room-viewer-share": "",
|
|
11977
11979
|
disabled: !canShare || isSharing,
|
|
11978
11980
|
onClick: handleShare,
|
|
11979
11981
|
className: "size-10 rounded-full px-0 lg:h-9 lg:w-auto lg:rounded-xl lg:px-3.5",
|
|
@@ -11991,6 +11993,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
11991
11993
|
type: "button",
|
|
11992
11994
|
variant: "secondary",
|
|
11993
11995
|
"aria-label": t('floor.scene.download'),
|
|
11996
|
+
"data-neurodyn-room-viewer-download": "",
|
|
11994
11997
|
disabled: isDownloading,
|
|
11995
11998
|
onClick: handleDownload,
|
|
11996
11999
|
className: "size-10 rounded-full px-0 lg:h-9 lg:w-auto lg:rounded-xl lg:px-3.5",
|
|
@@ -12056,6 +12059,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12056
12059
|
/*#__PURE__*/ jsxs("div", {
|
|
12057
12060
|
className: "flex h-24 w-[254px] items-center gap-4 overflow-hidden rounded-2xl bg-background-containers p-4 text-left text-text-dark shadow-[var(--shadow-login)]",
|
|
12058
12061
|
"data-testid": "floor-room-card",
|
|
12062
|
+
"data-neurodyn-room-viewer-room": "",
|
|
12059
12063
|
children: [
|
|
12060
12064
|
/*#__PURE__*/ jsx_runtime_jsx("img", {
|
|
12061
12065
|
src: room.imageUrl,
|
|
@@ -12087,6 +12091,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12087
12091
|
canShowAr && /*#__PURE__*/ jsxs("div", {
|
|
12088
12092
|
className: "pointer-events-auto flex h-24 w-[280px] items-center gap-4 overflow-hidden rounded-2xl bg-background-containers p-4 text-text-dark shadow-[var(--shadow-login)]",
|
|
12089
12093
|
"data-testid": "floor-ar-card",
|
|
12094
|
+
"data-neurodyn-room-viewer-try-at-home": "",
|
|
12090
12095
|
children: [
|
|
12091
12096
|
/*#__PURE__*/ jsx_runtime_jsx("img", {
|
|
12092
12097
|
src: room.imageUrl,
|
|
@@ -12136,6 +12141,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12136
12141
|
/*#__PURE__*/ jsxs("div", {
|
|
12137
12142
|
className: "flex h-[72px] items-center justify-between gap-3 overflow-hidden rounded-2xl bg-background-containers p-4 text-left text-text-dark shadow-[var(--shadow-login)]",
|
|
12138
12143
|
"data-testid": "floor-tablet-room-card",
|
|
12144
|
+
"data-neurodyn-room-viewer-room": "",
|
|
12139
12145
|
children: [
|
|
12140
12146
|
/*#__PURE__*/ jsxs("span", {
|
|
12141
12147
|
className: "flex min-w-0 items-center gap-2",
|
|
@@ -12173,6 +12179,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12173
12179
|
}),
|
|
12174
12180
|
canShowAr && /*#__PURE__*/ jsx_runtime_jsx(AR, {
|
|
12175
12181
|
className: "w-full",
|
|
12182
|
+
"data-neurodyn-room-viewer-try-at-home": "",
|
|
12176
12183
|
buttonLabel: t('floor.scene.tryAtHome'),
|
|
12177
12184
|
buttonLeadingIcon: /*#__PURE__*/ jsx_runtime_jsx(Vizbl, {
|
|
12178
12185
|
className: "size-5"
|
|
@@ -12209,6 +12216,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12209
12216
|
children: [
|
|
12210
12217
|
/*#__PURE__*/ jsxs("div", {
|
|
12211
12218
|
className: "flex w-full items-center justify-between gap-3 rounded-full bg-background-containers text-left",
|
|
12219
|
+
"data-neurodyn-room-viewer-room": "",
|
|
12212
12220
|
children: [
|
|
12213
12221
|
/*#__PURE__*/ jsxs("span", {
|
|
12214
12222
|
className: "flex min-w-0 items-center gap-2",
|
|
@@ -12246,6 +12254,7 @@ function FloorSceneChrome({ actions, canShowAr, companyName, hasActiveError, mat
|
|
|
12246
12254
|
}),
|
|
12247
12255
|
canShowAr && /*#__PURE__*/ jsx_runtime_jsx(AR, {
|
|
12248
12256
|
className: "w-full",
|
|
12257
|
+
"data-neurodyn-room-viewer-try-at-home": "",
|
|
12249
12258
|
buttonLabel: t('floor.scene.tryAtHome'),
|
|
12250
12259
|
buttonLeadingIcon: /*#__PURE__*/ jsx_runtime_jsx(Vizbl, {
|
|
12251
12260
|
className: "size-6"
|
|
@@ -12437,7 +12446,7 @@ function InteriorSelectionScreen(props) {
|
|
|
12437
12446
|
})
|
|
12438
12447
|
});
|
|
12439
12448
|
}
|
|
12440
|
-
function InteriorSelectionDialog({ open, portalContainer, onOpenChange, ...entryProps }) {
|
|
12449
|
+
function InteriorSelectionDialog({ open, showCloseButton = true, portalContainer, onOpenChange, ...entryProps }) {
|
|
12441
12450
|
const { t } = useTranslation();
|
|
12442
12451
|
return /*#__PURE__*/ jsx_runtime_jsx(Dialog, {
|
|
12443
12452
|
open: open,
|
|
@@ -12458,7 +12467,7 @@ function InteriorSelectionDialog({ open, portalContainer, onOpenChange, ...entry
|
|
|
12458
12467
|
}),
|
|
12459
12468
|
/*#__PURE__*/ jsx_runtime_jsx(InteriorSelectionEntry, {
|
|
12460
12469
|
...entryProps,
|
|
12461
|
-
showCloseButton:
|
|
12470
|
+
showCloseButton: showCloseButton
|
|
12462
12471
|
})
|
|
12463
12472
|
]
|
|
12464
12473
|
})
|
|
@@ -13647,6 +13656,7 @@ function FloorViewerLayout({ showDialogCloseButton = false }) {
|
|
|
13647
13656
|
if (!floorController.interiorSelection.shouldRender) return null;
|
|
13648
13657
|
if ('dialog' === floorController.interiorSelection.presentation) return /*#__PURE__*/ jsx_runtime_jsx(InteriorSelectionDialog, {
|
|
13649
13658
|
open: floorController.interiorSelection.open,
|
|
13659
|
+
showCloseButton: showDialogCloseButton || floorController.scene.shouldRender,
|
|
13650
13660
|
portalContainer: activeDialogPortalContainer,
|
|
13651
13661
|
rooms: floorController.sourceRooms,
|
|
13652
13662
|
customRooms: floorController.customRooms,
|
|
@@ -14727,9 +14737,10 @@ configureApiClient({
|
|
|
14727
14737
|
configureNodeApiClient({
|
|
14728
14738
|
baseURL: config_env.NODE_API_BASE_URL
|
|
14729
14739
|
});
|
|
14730
|
-
function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, displayUnit, name, language, apiKey, source, widgetSession, open, defaultOpen, onOpenChange, ...props }) {
|
|
14740
|
+
function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, displayUnit, name, language, apiKey, source, widgetSession, disableClose = false, open, defaultOpen, onOpenChange, ...props }) {
|
|
14731
14741
|
const [themeRoot, setThemeRoot] = useState(null);
|
|
14732
14742
|
const placement = resolveResourcePlacement(normalizeResourceType(type));
|
|
14743
|
+
const isCloseDisabled = 'floor' === placement && disableClose;
|
|
14733
14744
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
|
|
14734
14745
|
const dialogOpen = open ?? uncontrolledOpen;
|
|
14735
14746
|
const [hasRenderedDialogContent, setHasRenderedDialogContent] = useState(dialogOpen);
|
|
@@ -14740,6 +14751,7 @@ function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, di
|
|
|
14740
14751
|
dialogOpen
|
|
14741
14752
|
]);
|
|
14742
14753
|
function handleOpenChange(nextOpen) {
|
|
14754
|
+
if (!nextOpen && isCloseDisabled) return;
|
|
14743
14755
|
if (void 0 === open) setUncontrolledOpen(nextOpen);
|
|
14744
14756
|
onOpenChange?.(nextOpen);
|
|
14745
14757
|
}
|
|
@@ -14756,7 +14768,7 @@ function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, di
|
|
|
14756
14768
|
apiKey: apiKey,
|
|
14757
14769
|
source: source,
|
|
14758
14770
|
widgetSession: widgetSession,
|
|
14759
|
-
showDialogCloseButton:
|
|
14771
|
+
showDialogCloseButton: !isCloseDisabled,
|
|
14760
14772
|
viewerSurface: "dialog",
|
|
14761
14773
|
dialogPortalContainer: themeRoot,
|
|
14762
14774
|
viewerDialogOpen: dialogOpen,
|
|
@@ -14768,6 +14780,7 @@ function RoomViewerDialog({ type, src, tinuuid, width, height, dimensionUnit, di
|
|
|
14768
14780
|
children: fontsinline.A
|
|
14769
14781
|
}), document.head),
|
|
14770
14782
|
/*#__PURE__*/ createPortal(/*#__PURE__*/ jsxs(react_shadow.div, {
|
|
14783
|
+
"data-neurodyn-room-viewer-root": "",
|
|
14771
14784
|
style: {
|
|
14772
14785
|
display: 'block',
|
|
14773
14786
|
letterSpacing: 'normal',
|
|
@@ -14835,6 +14848,7 @@ function RoomViewer({ type, src, tinuuid, name, language, width, height, dimensi
|
|
|
14835
14848
|
width: '100%'
|
|
14836
14849
|
},
|
|
14837
14850
|
...props,
|
|
14851
|
+
"data-neurodyn-room-viewer-root": "",
|
|
14838
14852
|
children: [
|
|
14839
14853
|
/*#__PURE__*/ jsx_runtime_jsx("style", {
|
|
14840
14854
|
children: shadowRootCssText
|