@neurodyn/react-room-viewer 0.0.29 → 0.0.30

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 CHANGED
@@ -52,6 +52,8 @@ declare const resources: {
52
52
  readonly viewInPlace: "View in place";
53
53
  readonly scanQrCode: "Scan this QR code with your phone's camera to view the object in Augmented Reality";
54
54
  readonly deviceRequirementsDisclaimer: "*Requires AR-supported device and browser. We recommend iOS 18 or later with Safari, or Android 7.0 or later with Chrome.";
55
+ readonly appClipScanTitle: "Scan with your phone camera";
56
+ readonly appClipRequirement: "AR view works on iOS 18 or later";
55
57
  };
56
58
  readonly legal: {
57
59
  readonly termsOfUse: "Terms of Use";
@@ -190,6 +192,8 @@ declare const resources: {
190
192
  readonly viewInPlace: "Примерить в комнате";
191
193
  readonly scanQrCode: "Отсканируйте этот QR-код камерой телефона, чтобы просмотреть объект в дополненной реальности";
192
194
  readonly deviceRequirementsDisclaimer: "*Требуется устройство и браузер с поддержкой AR. Рекомендуем iOS 18 или новее с Safari либо Android 7.0 или новее с Chrome.";
195
+ readonly appClipScanTitle: "Наведите камеру телефона";
196
+ readonly appClipRequirement: "AR-просмотр работает на iOS 18 и новее";
193
197
  };
194
198
  readonly legal: {
195
199
  readonly termsOfUse: "Условия использования";
package/dist/index.js CHANGED
@@ -6672,7 +6672,9 @@ const ns1 = {
6672
6672
  ar: {
6673
6673
  viewInPlace: 'View in place',
6674
6674
  scanQrCode: 'Scan this QR code with your phone\'s camera to view the object in Augmented Reality',
6675
- deviceRequirementsDisclaimer: '*Requires AR-supported device and browser. We recommend iOS 18 or later with Safari, or Android 7.0 or later with Chrome.'
6675
+ deviceRequirementsDisclaimer: '*Requires AR-supported device and browser. We recommend iOS 18 or later with Safari, or Android 7.0 or later with Chrome.',
6676
+ appClipScanTitle: 'Scan with your phone camera',
6677
+ appClipRequirement: 'AR view works on iOS 18 or later'
6676
6678
  },
6677
6679
  legal: {
6678
6680
  termsOfUse: 'Terms of Use',
@@ -6809,7 +6811,9 @@ const ns1_ns1 = {
6809
6811
  ar: {
6810
6812
  viewInPlace: 'Примерить в комнате',
6811
6813
  scanQrCode: 'Отсканируйте этот QR-код камерой телефона, чтобы просмотреть объект в дополненной реальности',
6812
- deviceRequirementsDisclaimer: '*Требуется устройство и браузер с поддержкой AR. Рекомендуем iOS 18 или новее с Safari либо Android 7.0 или новее с Chrome.'
6814
+ deviceRequirementsDisclaimer: '*Требуется устройство и браузер с поддержкой AR. Рекомендуем iOS 18 или новее с Safari либо Android 7.0 или новее с Chrome.',
6815
+ appClipScanTitle: 'Наведите камеру телефона',
6816
+ appClipRequirement: 'AR-просмотр работает на iOS 18 и новее'
6813
6817
  },
6814
6818
  legal: {
6815
6819
  termsOfUse: 'Условия использования',
@@ -17931,6 +17935,10 @@ const os = parser.getOS();
17931
17935
  const isIOS = 'iOS' === os.name;
17932
17936
  const isAndroid = 'Android' === os.name;
17933
17937
  const device_isMobile = 'mobile' === device.type;
17938
+ function isArEntryOffered(handoff, tinuuid) {
17939
+ if (!handoff || isAndroid && device_isMobile || isAndroid && 'appclip' === handoff.ar) return false;
17940
+ return 'floor' !== handoff.destination || Boolean(tinuuid);
17941
+ }
17934
17942
  function isAbsoluteUrl(value1) {
17935
17943
  return /^[a-z][a-z0-9+.-]*:/i.test(value1) || value1.startsWith('//');
17936
17944
  }
@@ -18086,7 +18094,8 @@ function AR({ className, buttonClassName, buttonLeadingIcon, buttonLabel, button
18086
18094
  usdzUrl,
18087
18095
  glbUrl
18088
18096
  ]);
18089
- if (!handoff || isAndroid && device_isMobile || 'floor' === handoff.destination && !tinuuid) return null;
18097
+ if (!isArEntryOffered(handoff, tinuuid)) return null;
18098
+ const isAppClip = 'appclip' === handoff.ar;
18090
18099
  return /*#__PURE__*/ jsxs("div", {
18091
18100
  className: utils_cn(className),
18092
18101
  ...props,
@@ -18118,15 +18127,31 @@ function AR({ className, buttonClassName, buttonLeadingIcon, buttonLabel, button
18118
18127
  data: url ?? ''
18119
18128
  })
18120
18129
  }),
18121
- /*#__PURE__*/ jsx_runtime_jsx("p", {
18130
+ isAppClip ? /*#__PURE__*/ jsxs("div", {
18131
+ className: "grid gap-2 text-center",
18132
+ children: [
18133
+ /*#__PURE__*/ jsx_runtime_jsx("p", {
18134
+ className: "text-lg text-text-sub font-medium",
18135
+ children: t('ar.appClipScanTitle')
18136
+ }),
18137
+ /*#__PURE__*/ jsx_runtime_jsx("p", {
18138
+ className: "text-sm text-text-light",
18139
+ children: t('ar.appClipRequirement')
18140
+ })
18141
+ ]
18142
+ }) : /*#__PURE__*/ jsx_runtime_jsx("p", {
18122
18143
  className: "text-lg text-center text-text-sub font-medium",
18123
18144
  children: t('ar.scanQrCode')
18124
18145
  }),
18125
18146
  /*#__PURE__*/ jsxs("p", {
18126
18147
  className: "text-xs text-center text-text-light",
18127
18148
  children: [
18128
- t('ar.deviceRequirementsDisclaimer'),
18129
- /*#__PURE__*/ jsx_runtime_jsx("br", {}),
18149
+ !isAppClip && /*#__PURE__*/ jsxs(Fragment, {
18150
+ children: [
18151
+ t('ar.deviceRequirementsDisclaimer'),
18152
+ /*#__PURE__*/ jsx_runtime_jsx("br", {})
18153
+ ]
18154
+ }),
18130
18155
  /*#__PURE__*/ jsx_runtime_jsx("a", {
18131
18156
  href: tenantConfig.TERMS_URL,
18132
18157
  target: "_blank",
@@ -19306,8 +19331,9 @@ const CARD_TEST_IDS = {
19306
19331
  function ArCardSlot({ band, slot, presentation }) {
19307
19332
  const { t } = useTranslation();
19308
19333
  const { room } = useRoomViewerRooms();
19334
+ const { type } = useRoomViewerMetadata();
19309
19335
  const { tinuuid } = useRoomViewerResource();
19310
- if (!tinuuid || isAndroid && device_isMobile) return null;
19336
+ if (!isArEntryOffered(resolveResourceProfile(type).handoff, tinuuid)) return null;
19311
19337
  if ('card' === presentation.appearance) return /*#__PURE__*/ jsxs("div", {
19312
19338
  className: "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)]",
19313
19339
  "data-chrome-slot": slot,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neurodyn/react-room-viewer",
3
3
  "type": "module",
4
- "version": "0.0.29",
4
+ "version": "0.0.30",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },