@neurodyn/react-room-viewer 0.0.23 → 0.0.24
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.js +25 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5409,6 +5409,10 @@ var __webpack_modules__ = {
|
|
|
5409
5409
|
color: var(--v-text-dark);
|
|
5410
5410
|
}
|
|
5411
5411
|
|
|
5412
|
+
.data-\\[variant\\=destructive\\]\\:\\[\\&_svg\\:not\\(\\[class\\*\\=text-\\]\\)\\]\\:text-inherit[data-variant="destructive"] svg:not([class*="text-"]) {
|
|
5413
|
+
color: inherit;
|
|
5414
|
+
}
|
|
5415
|
+
|
|
5412
5416
|
.\\[\\&_tr\\]\\:border-b tr {
|
|
5413
5417
|
border-bottom-style: var(--tw-border-style);
|
|
5414
5418
|
border-bottom-width: 1px;
|
|
@@ -7795,7 +7799,7 @@ const RESOURCE_TYPE_PROFILES = {
|
|
|
7795
7799
|
chrome: 'immersive-room',
|
|
7796
7800
|
presentation: 'immersive-panels',
|
|
7797
7801
|
manipulation: 'panel-group',
|
|
7798
|
-
|
|
7802
|
+
productNameSource: 'collection',
|
|
7799
7803
|
catalogTitle: 'wall-panel',
|
|
7800
7804
|
introduction: 'focus-resource',
|
|
7801
7805
|
identity: 'modelled-resource',
|
|
@@ -7815,7 +7819,7 @@ const RESOURCE_TYPE_PROFILES = {
|
|
|
7815
7819
|
chrome: 'framed-scene',
|
|
7816
7820
|
presentation: 'framed-default',
|
|
7817
7821
|
manipulation: 'single-resource',
|
|
7818
|
-
|
|
7822
|
+
productNameSource: 'material',
|
|
7819
7823
|
catalogTitle: 'title',
|
|
7820
7824
|
introduction: null,
|
|
7821
7825
|
identity: 'textured-resource',
|
|
@@ -7832,7 +7836,7 @@ const RESOURCE_TYPE_PROFILES = {
|
|
|
7832
7836
|
chrome: 'immersive-room',
|
|
7833
7837
|
presentation: 'immersive-default',
|
|
7834
7838
|
manipulation: 'drag-with-rotation-handle',
|
|
7835
|
-
|
|
7839
|
+
productNameSource: 'collection',
|
|
7836
7840
|
catalogTitle: 'rugs',
|
|
7837
7841
|
introduction: null,
|
|
7838
7842
|
identity: 'modelled-resource',
|
|
@@ -7849,7 +7853,7 @@ const RESOURCE_TYPE_PROFILES = {
|
|
|
7849
7853
|
chrome: 'immersive-room',
|
|
7850
7854
|
presentation: 'immersive-default',
|
|
7851
7855
|
manipulation: 'rotate-on-floor',
|
|
7852
|
-
|
|
7856
|
+
productNameSource: 'collection',
|
|
7853
7857
|
catalogTitle: 'flooring',
|
|
7854
7858
|
introduction: null,
|
|
7855
7859
|
identity: 'modelled-resource',
|
|
@@ -8807,13 +8811,7 @@ function getListingKey(object) {
|
|
|
8807
8811
|
return object.kit?.uuid ?? object.uuid ?? object.tinuuid ?? '';
|
|
8808
8812
|
}
|
|
8809
8813
|
function getSizedDesignKey(object) {
|
|
8810
|
-
|
|
8811
|
-
const name = object.name?.trim();
|
|
8812
|
-
const sizeSuffix = meta ? ` — ${meta.size}` : null;
|
|
8813
|
-
if (name && sizeSuffix && name.endsWith(sizeSuffix)) {
|
|
8814
|
-
const designName = name.slice(0, -sizeSuffix.length).trim();
|
|
8815
|
-
if (designName) return `rug-name:${designName}`;
|
|
8816
|
-
}
|
|
8814
|
+
if (object.kit?.uuid) return object.kit.uuid;
|
|
8817
8815
|
return `object:${getListingKey(object)}`;
|
|
8818
8816
|
}
|
|
8819
8817
|
const PRODUCT_COMPOSITION_ANSWERS = {
|
|
@@ -8835,16 +8833,13 @@ const PRODUCT_COMPOSITION_ANSWERS = {
|
|
|
8835
8833
|
};
|
|
8836
8834
|
const MATERIAL_ROLE_ANSWERS = {
|
|
8837
8835
|
'product-identity': {
|
|
8838
|
-
catalogsEveryMaterial: true
|
|
8839
|
-
namesProduct: true
|
|
8836
|
+
catalogsEveryMaterial: true
|
|
8840
8837
|
},
|
|
8841
8838
|
finish: {
|
|
8842
|
-
catalogsEveryMaterial: false
|
|
8843
|
-
namesProduct: false
|
|
8839
|
+
catalogsEveryMaterial: false
|
|
8844
8840
|
},
|
|
8845
8841
|
placeholder: {
|
|
8846
|
-
catalogsEveryMaterial: false
|
|
8847
|
-
namesProduct: false
|
|
8842
|
+
catalogsEveryMaterial: false
|
|
8848
8843
|
}
|
|
8849
8844
|
};
|
|
8850
8845
|
function resolveProductCompositionAnswers(type) {
|
|
@@ -8869,8 +8864,7 @@ function resolveResourceIdentityAnswers(type) {
|
|
|
8869
8864
|
return RESOURCE_IDENTITY_ANSWERS[resolveResourceProfile(type).identity];
|
|
8870
8865
|
}
|
|
8871
8866
|
function getResourceProductName(type, object, material, fallback = '') {
|
|
8872
|
-
|
|
8873
|
-
return namesProduct ? material?.name ?? object?.name ?? object?.kit?.name ?? fallback : object?.kit?.name ?? object?.name ?? material?.name ?? fallback;
|
|
8867
|
+
return 'material' === resolveResourceProfile(type).productNameSource ? material?.name ?? object?.name ?? object?.kit?.name ?? fallback : object?.kit?.name?.trim() || object?.name?.trim() || material?.name?.trim() || fallback;
|
|
8874
8868
|
}
|
|
8875
8869
|
function getMaterialId(material) {
|
|
8876
8870
|
return material.hid ?? '';
|
|
@@ -8982,13 +8976,14 @@ function useRoomViewerMaterialCatalog({ includeEmbeddedObject = false } = {}) {
|
|
|
8982
8976
|
const { requiresMaterialModel } = resolveResourceIdentityAnswers(type);
|
|
8983
8977
|
const { getCollapseKey } = resolveProductCompositionAnswers(type);
|
|
8984
8978
|
const { catalogsEveryMaterial } = resolveMaterialRoleAnswers(type);
|
|
8985
|
-
const {
|
|
8979
|
+
const { composition, productNameSource } = resolveResourceProfile(type);
|
|
8986
8980
|
const fetchedObjects = (0, __rspack_external_react.useMemo)(()=>data?.pages.flatMap((page)=>page.objs ?? []) ?? [], [
|
|
8987
8981
|
data
|
|
8988
8982
|
]);
|
|
8989
|
-
const unresolvedObjects = (0, __rspack_external_react.useMemo)(()=>'
|
|
8990
|
-
|
|
8991
|
-
|
|
8983
|
+
const unresolvedObjects = (0, __rspack_external_react.useMemo)(()=>'material' === productNameSource ? [] : fetchedObjects.filter((object)=>object.tinuuid && (!object.kit?.uuid || !object.kit.name?.trim()) && (!requiresMaterialModel || object.materials?.[0]?.native?.glbUrl)), [
|
|
8984
|
+
fetchedObjects,
|
|
8985
|
+
productNameSource,
|
|
8986
|
+
requiresMaterialModel
|
|
8992
8987
|
]);
|
|
8993
8988
|
const collectionQueries = useQueries({
|
|
8994
8989
|
queries: unresolvedObjects.map((object)=>({
|
|
@@ -9015,7 +9010,10 @@ function useRoomViewerMaterialCatalog({ includeEmbeddedObject = false } = {}) {
|
|
|
9015
9010
|
return [
|
|
9016
9011
|
{
|
|
9017
9012
|
...object,
|
|
9018
|
-
kit: query?.data?.kit
|
|
9013
|
+
kit: query?.data?.kit ? {
|
|
9014
|
+
...object.kit,
|
|
9015
|
+
...query.data.kit
|
|
9016
|
+
} : object.kit
|
|
9019
9017
|
}
|
|
9020
9018
|
];
|
|
9021
9019
|
});
|
|
@@ -9043,17 +9041,16 @@ function useRoomViewerMaterialCatalog({ includeEmbeddedObject = false } = {}) {
|
|
|
9043
9041
|
return catalogMaterials?.map((material)=>{
|
|
9044
9042
|
const materialId = getMaterialId(material);
|
|
9045
9043
|
if (!materialId || !object.tinuuid) return null;
|
|
9044
|
+
const productName = getResourceProductName(type, object, material, name);
|
|
9046
9045
|
return {
|
|
9047
9046
|
materialId,
|
|
9048
|
-
|
|
9049
|
-
productName: getResourceProductName(type, object, material, name),
|
|
9047
|
+
productName,
|
|
9050
9048
|
material,
|
|
9051
9049
|
tinuuid: object.tinuuid
|
|
9052
9050
|
};
|
|
9053
9051
|
}).filter((item)=>null !== item) ?? [];
|
|
9054
9052
|
}), [
|
|
9055
9053
|
catalogsEveryMaterial,
|
|
9056
|
-
catalogLabel,
|
|
9057
9054
|
composition,
|
|
9058
9055
|
objects,
|
|
9059
9056
|
type,
|
|
@@ -14676,7 +14673,7 @@ function dropdown_menu_DropdownMenuItem({ className, inset, variant = 'default',
|
|
|
14676
14673
|
"data-slot": "dropdown-menu-item",
|
|
14677
14674
|
"data-inset": inset,
|
|
14678
14675
|
"data-variant": variant,
|
|
14679
|
-
className: utils_cn('relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden hover:bg-background-base focus:bg-background-base data-[highlighted]:bg-background-base data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:hover:bg-destructive/10 data-[highlighted][data-variant=destructive]:bg-destructive/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=text-])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0', inset && 'pl-8', className),
|
|
14676
|
+
className: utils_cn('relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden hover:bg-background-base focus:bg-background-base data-[highlighted]:bg-background-base data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:hover:bg-destructive/10 data-[highlighted][data-variant=destructive]:bg-destructive/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=text-])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*=text-])]:text-inherit [&_svg]:pointer-events-none [&_svg]:shrink-0', inset && 'pl-8', className),
|
|
14680
14677
|
...props
|
|
14681
14678
|
});
|
|
14682
14679
|
}
|