@neurodyn/react-room-viewer 0.0.34 → 0.1.0

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +152 -2
  2. package/dist/index.js +396 -146
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ declare const resources: {
51
51
  };
52
52
  readonly legal: {
53
53
  readonly termsOfUse: "Terms of Use";
54
- readonly conjunction: "and";
54
+ readonly conjunction: " and ";
55
55
  readonly privacyPolicy: "Privacy Policy";
56
56
  };
57
57
  readonly shareMessage: {
@@ -201,7 +201,7 @@ declare const resources: {
201
201
  };
202
202
  readonly legal: {
203
203
  readonly termsOfUse: "Условия использования";
204
- readonly conjunction: "и";
204
+ readonly conjunction: " и ";
205
205
  readonly privacyPolicy: "Политика конфиденциальности";
206
206
  };
207
207
  readonly shareMessage: {
@@ -331,6 +331,156 @@ declare const resources: {
331
331
  };
332
332
  };
333
333
  };
334
+ ar: {
335
+ translation: {
336
+ readonly matting: "الحافة الداخلية";
337
+ readonly close: "إغلاق";
338
+ readonly mattingOptions: {
339
+ readonly none: "بدون";
340
+ };
341
+ readonly units: {
342
+ readonly cm: "سم";
343
+ readonly in: "بوصة";
344
+ };
345
+ readonly ar: {
346
+ readonly viewInPlace: "اعرضه في مكانك";
347
+ readonly scanQrCode: "امسح رمز QR هذا بكاميرا هاتفك لعرض المنتج بتقنية الواقع المعزز";
348
+ readonly deviceRequirementsDisclaimer: "*يتطلب جهازًا ومتصفحًا يدعمان الواقع المعزز. نوصي بنظام iOS 18 أو أحدث مع Safari، أو Android 7.0 أو أحدث مع Chrome.";
349
+ readonly appClipScanTitle: "امسح الرمز بكاميرا هاتفك";
350
+ readonly appClipRequirement: "يعمل عرض الواقع المعزز على iOS 18 أو أحدث";
351
+ };
352
+ readonly legal: {
353
+ readonly termsOfUse: "شروط الاستخدام";
354
+ readonly conjunction: " و";
355
+ readonly privacyPolicy: "سياسة الخصوصية";
356
+ };
357
+ readonly shareMessage: {
358
+ readonly 'wall-panel': "معاينة ألواح الجدران";
359
+ readonly wallart: "معاينة اللوحة الفنية";
360
+ readonly rugs: "معاينة السجادة";
361
+ readonly flooring: "معاينة الأرضية";
362
+ };
363
+ readonly rooms: {
364
+ readonly 'room-example-11': "غرفة نموذجية 11";
365
+ readonly 'room-example-12': "غرفة نموذجية 12";
366
+ readonly 'room-example-13': "غرفة نموذجية 13";
367
+ readonly 'room-example-14': "غرفة نموذجية 14";
368
+ readonly 'room-example-15': "غرفة نموذجية 15";
369
+ readonly 'carpet-bathroom': "الحمّام";
370
+ readonly 'carpet-bedroom': "غرفة النوم";
371
+ readonly 'carpet-entryway': "المدخل";
372
+ readonly 'carpet-living-room': "غرفة المعيشة";
373
+ };
374
+ readonly scene: {
375
+ readonly tunePosition: "ضبط الموضع";
376
+ readonly angle: "الزاوية";
377
+ readonly rotation: "الدوران";
378
+ readonly resetPosition: "إعادة التعيين";
379
+ };
380
+ readonly accessError: {
381
+ readonly unauthorized: "مفتاح API غير صالح";
382
+ readonly 'payment-required': "العارض غير متاح مؤقتًا";
383
+ };
384
+ readonly loadError: {
385
+ readonly 'viewer-load-failed': "تعذّر تحميل العارض. يُرجى المحاولة مرة أخرى.";
386
+ readonly 'artwork-load-failed': "تعذّر تحميل الصورة — رابطها مفقود أو غير صحيح في إعدادات الأداة.";
387
+ readonly 'room-load-failed': "تعذّر تحميل صورة الغرفة. يُرجى المحاولة مرة أخرى.";
388
+ };
389
+ readonly missingSurface: {
390
+ readonly floor: {
391
+ readonly title: "لم نتمكن من العثور على الأرضية";
392
+ readonly body: "جرّب صورة تظهر فيها الأرضية.";
393
+ };
394
+ readonly wall: {
395
+ readonly title: "لم نتمكن من العثور على جدار";
396
+ readonly body: "جرّب صورة يظهر فيها جدار.";
397
+ };
398
+ readonly uploadAnother: "رفع صورة أخرى";
399
+ };
400
+ readonly wallPanel: {
401
+ readonly loading: "جارٍ تحميل الخامة";
402
+ readonly panelActions: "إجراءات اللوح {{number}}";
403
+ readonly retry: "تعذّر التحميل. اختر مرة أخرى لإعادة المحاولة.";
404
+ readonly actions: "إجراءات اللوح";
405
+ readonly materials: "الخامات";
406
+ readonly materialFallback: "الخامة {{number}}";
407
+ readonly rotate: "تدوير اللوح";
408
+ readonly delete: "حذف اللوح";
409
+ };
410
+ readonly wallArt: {
411
+ readonly pictureFrame: "الإطار";
412
+ };
413
+ readonly resourceType: {
414
+ readonly 'wall-panel': {
415
+ readonly productCategory: "لوح جداري";
416
+ readonly productCardTitle: "اللوح المحدد";
417
+ readonly replaceProduct: "استبدال اللوح";
418
+ readonly replaceProductShort: "استبدال";
419
+ };
420
+ readonly wallart: {
421
+ readonly productCardTitle: "اللوحة الفنية المحددة";
422
+ readonly appearance: "استبدال";
423
+ };
424
+ readonly rugs: {
425
+ readonly productCategory: "سجادة";
426
+ readonly productCardTitle: "السجادة المحددة";
427
+ readonly replaceProduct: "استبدال السجادة";
428
+ readonly replaceProductShort: "استبدال";
429
+ };
430
+ readonly flooring: {
431
+ readonly productCategory: "أرضية";
432
+ readonly productCardTitle: "الأرضية المحددة";
433
+ readonly replaceProduct: "استبدال الأرضية";
434
+ readonly replaceProductShort: "استبدال";
435
+ };
436
+ };
437
+ readonly floor: {
438
+ readonly scene: {
439
+ readonly share: "مشاركة";
440
+ readonly download: "تنزيل";
441
+ readonly hideCatalog: "إخفاء الكتالوج";
442
+ readonly description: "الوصف";
443
+ readonly interiorCardTitle: "التصميم الداخلي";
444
+ readonly tryAtHome: "جرّبه في منزلك";
445
+ readonly tryAtHomeBody: "عبر كاميرا هاتفك";
446
+ };
447
+ readonly materialSelection: {
448
+ readonly flooring: "اختر الأرضية";
449
+ readonly rugs: "اختر سجادة";
450
+ readonly 'wall-panel': "اختر لوحًا";
451
+ readonly title: "اختيار الخامة";
452
+ };
453
+ readonly interiorSelection: {
454
+ readonly title: "اختر التصميم الداخلي";
455
+ readonly uploadPhoto: "ارفع صورتك";
456
+ readonly invalidFile: "تعذّر رفع الصورة، يُرجى المحاولة مرة أخرى";
457
+ readonly customTitle: "صورك";
458
+ readonly presetsTitle: "تصاميم داخلية جاهزة";
459
+ readonly currentInterior: "التصميم الداخلي الحالي";
460
+ readonly chooseInterior: "اختر التصميم الداخلي";
461
+ readonly chooseInteriorShort: "اختر";
462
+ };
463
+ readonly processing: {
464
+ readonly title: "جارٍ تجهيز غرفتك";
465
+ readonly progressLabel: "تقدّم تجهيز الغرفة";
466
+ readonly stages: {
467
+ readonly reading: "جارٍ قراءة صورتك...";
468
+ readonly mapping: "جارٍ تحديد الأرضيات والجدران...";
469
+ readonly lighting: "جارٍ موازنة الإضاءة والمنظور...";
470
+ readonly finalizing: "جارٍ إنشاء المعاينة...";
471
+ readonly ready: "الغرفة جاهزة...";
472
+ };
473
+ };
474
+ readonly error: {
475
+ readonly title: "حدث خطأ ما";
476
+ readonly processingBody: "لم نتمكن هذه المرة من رفع الصورة ومعالجتها";
477
+ readonly loadBody: "تعذّر تحميل العارض. يُرجى المحاولة مرة أخرى.";
478
+ readonly tryAgain: "حاول مرة أخرى";
479
+ readonly cancel: "إلغاء";
480
+ };
481
+ };
482
+ };
483
+ };
334
484
  };
335
485
 
336
486
  export declare function RoomViewer({ type, src, tinuuid, roomId, name, language, width, height, dimensionUnit, displayUnit, apiKey, source, widgetSession, className, ...props }: RoomViewerProps & React_2.ComponentProps<'div'>): JSX.Element;
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Component, Suspense, createContext, memo, use as external_react_use, useCallback, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo as external_react_useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
3
+ import { Direction, Popover, Select, Slider } from "radix-ui";
3
4
  import { createPortal } from "react-dom";
4
5
  import { I18nextProvider, initReactI18next, useTranslation } from "react-i18next";
5
6
  import react_shadow from "react-shadow";
@@ -27,7 +28,6 @@ import { formatHex, oklch } from "culori";
27
28
  import qrcode from "qrcode";
28
29
  import { GLTFExporter } from "three/examples/jsm/exporters/GLTFExporter.js";
29
30
  import { USDZExporter } from "three/examples/jsm/exporters/USDZExporter.js";
30
- import { Popover, Select, Slider } from "radix-ui";
31
31
  var __webpack_modules__ = {
32
32
  "./src/style.css?inline" (module, __webpack_exports__, __webpack_require__) {
33
33
  __webpack_require__.d(__webpack_exports__, {
@@ -512,6 +512,10 @@ var __webpack_modules__ = {
512
512
  position: static;
513
513
  }
514
514
 
515
+ .sticky {
516
+ position: sticky;
517
+ }
518
+
515
519
  .inset-0 {
516
520
  inset: calc(var(--spacing) * 0);
517
521
  }
@@ -524,6 +528,38 @@ var __webpack_modules__ = {
524
528
  inset-block: calc(var(--spacing) * 0);
525
529
  }
526
530
 
531
+ .start-0 {
532
+ inset-inline-start: calc(var(--spacing) * 0);
533
+ }
534
+
535
+ .start-2 {
536
+ inset-inline-start: calc(var(--spacing) * 2);
537
+ }
538
+
539
+ .start-6 {
540
+ inset-inline-start: calc(var(--spacing) * 6);
541
+ }
542
+
543
+ .end-0 {
544
+ inset-inline-end: calc(var(--spacing) * 0);
545
+ }
546
+
547
+ .end-1 {
548
+ inset-inline-end: calc(var(--spacing) * 1);
549
+ }
550
+
551
+ .end-2 {
552
+ inset-inline-end: calc(var(--spacing) * 2);
553
+ }
554
+
555
+ .end-4 {
556
+ inset-inline-end: calc(var(--spacing) * 4);
557
+ }
558
+
559
+ .end-6 {
560
+ inset-inline-end: calc(var(--spacing) * 6);
561
+ }
562
+
527
563
  .top-0 {
528
564
  top: calc(var(--spacing) * 0);
529
565
  }
@@ -572,14 +608,6 @@ var __webpack_modules__ = {
572
608
  top: 100%;
573
609
  }
574
610
 
575
- .right-0 {
576
- right: calc(var(--spacing) * 0);
577
- }
578
-
579
- .right-1 {
580
- right: calc(var(--spacing) * 1);
581
- }
582
-
583
611
  .right-2 {
584
612
  right: calc(var(--spacing) * 2);
585
613
  }
@@ -588,14 +616,6 @@ var __webpack_modules__ = {
588
616
  right: calc(var(--spacing) * 3);
589
617
  }
590
618
 
591
- .right-4 {
592
- right: calc(var(--spacing) * 4);
593
- }
594
-
595
- .right-6 {
596
- right: calc(var(--spacing) * 6);
597
- }
598
-
599
619
  .right-\\[-1\\.36\\%\\] {
600
620
  right: -1.36%;
601
621
  }
@@ -632,14 +652,6 @@ var __webpack_modules__ = {
632
652
  left: 50%;
633
653
  }
634
654
 
635
- .left-2 {
636
- left: calc(var(--spacing) * 2);
637
- }
638
-
639
- .left-6 {
640
- left: calc(var(--spacing) * 6);
641
- }
642
-
643
655
  .left-\\[-1\\.36\\%\\] {
644
656
  left: -1.36%;
645
657
  }
@@ -758,6 +770,14 @@ var __webpack_modules__ = {
758
770
  margin-inline-start: -1px;
759
771
  }
760
772
 
773
+ .ms-4 {
774
+ margin-inline-start: calc(var(--spacing) * 4);
775
+ }
776
+
777
+ .ms-auto {
778
+ margin-inline-start: auto;
779
+ }
780
+
761
781
  .-mt-2 {
762
782
  margin-top: calc(var(--spacing) * -2);
763
783
  }
@@ -790,14 +810,6 @@ var __webpack_modules__ = {
790
810
  margin-left: calc(var(--spacing) * 1);
791
811
  }
792
812
 
793
- .ml-4 {
794
- margin-left: calc(var(--spacing) * 4);
795
- }
796
-
797
- .ml-auto {
798
- margin-left: auto;
799
- }
800
-
801
813
  .box-border {
802
814
  box-sizing: border-box;
803
815
  }
@@ -2325,6 +2337,30 @@ var __webpack_modules__ = {
2325
2337
  padding-block: calc(var(--spacing) * 14);
2326
2338
  }
2327
2339
 
2340
+ .ps-2 {
2341
+ padding-inline-start: calc(var(--spacing) * 2);
2342
+ }
2343
+
2344
+ .ps-3 {
2345
+ padding-inline-start: calc(var(--spacing) * 3);
2346
+ }
2347
+
2348
+ .ps-8 {
2349
+ padding-inline-start: calc(var(--spacing) * 8);
2350
+ }
2351
+
2352
+ .pe-1 {
2353
+ padding-inline-end: calc(var(--spacing) * 1);
2354
+ }
2355
+
2356
+ .pe-2 {
2357
+ padding-inline-end: calc(var(--spacing) * 2);
2358
+ }
2359
+
2360
+ .pe-8 {
2361
+ padding-inline-end: calc(var(--spacing) * 8);
2362
+ }
2363
+
2328
2364
  .pt-1 {
2329
2365
  padding-top: calc(var(--spacing) * 1);
2330
2366
  }
@@ -2345,10 +2381,6 @@ var __webpack_modules__ = {
2345
2381
  padding-right: calc(var(--spacing) * 1);
2346
2382
  }
2347
2383
 
2348
- .pr-2 {
2349
- padding-right: calc(var(--spacing) * 2);
2350
- }
2351
-
2352
2384
  .pr-2\\.5 {
2353
2385
  padding-right: calc(var(--spacing) * 2.5);
2354
2386
  }
@@ -2361,10 +2393,6 @@ var __webpack_modules__ = {
2361
2393
  padding-right: calc(var(--spacing) * 5);
2362
2394
  }
2363
2395
 
2364
- .pr-8 {
2365
- padding-right: calc(var(--spacing) * 8);
2366
- }
2367
-
2368
2396
  .pb-4 {
2369
2397
  padding-bottom: calc(var(--spacing) * 4);
2370
2398
  }
@@ -2381,18 +2409,10 @@ var __webpack_modules__ = {
2381
2409
  padding-bottom: 5px;
2382
2410
  }
2383
2411
 
2384
- .pl-2 {
2385
- padding-left: calc(var(--spacing) * 2);
2386
- }
2387
-
2388
2412
  .pl-3 {
2389
2413
  padding-left: calc(var(--spacing) * 3);
2390
2414
  }
2391
2415
 
2392
- .pl-8 {
2393
- padding-left: calc(var(--spacing) * 8);
2394
- }
2395
-
2396
2416
  .text-center {
2397
2417
  text-align: center;
2398
2418
  }
@@ -2401,6 +2421,10 @@ var __webpack_modules__ = {
2401
2421
  text-align: left;
2402
2422
  }
2403
2423
 
2424
+ .text-start {
2425
+ text-align: start;
2426
+ }
2427
+
2404
2428
  .align-middle {
2405
2429
  vertical-align: middle;
2406
2430
  }
@@ -4616,6 +4640,10 @@ var __webpack_modules__ = {
4616
4640
  }
4617
4641
 
4618
4642
  @media (width >= 640px) {
4643
+ .sm\\:end-6 {
4644
+ inset-inline-end: calc(var(--spacing) * 6);
4645
+ }
4646
+
4619
4647
  .sm\\:top-6 {
4620
4648
  top: calc(var(--spacing) * 6);
4621
4649
  }
@@ -4624,10 +4652,6 @@ var __webpack_modules__ = {
4624
4652
  top: 50%;
4625
4653
  }
4626
4654
 
4627
- .sm\\:right-6 {
4628
- right: calc(var(--spacing) * 6);
4629
- }
4630
-
4631
4655
  .sm\\:bottom-auto {
4632
4656
  bottom: auto;
4633
4657
  }
@@ -4858,6 +4882,10 @@ var __webpack_modules__ = {
4858
4882
  }
4859
4883
  }
4860
4884
 
4885
+ .rtl\\:rotate-180:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
4886
+ rotate: 180deg;
4887
+ }
4888
+
4861
4889
  .dark\\:bg-input\\/30:is(.dark *) {
4862
4890
  background-color: var(--input);
4863
4891
  }
@@ -5087,6 +5115,10 @@ var __webpack_modules__ = {
5087
5115
  }
5088
5116
  }
5089
5117
 
5118
+ .\\[data-chrome-slot\\=\\"ar-card\\"\\]\\:visible:is(), .\\[data-chrome-slot\\=\\"product-card\\"\\]\\:visible:is() {
5119
+ visibility: visible;
5120
+ }
5121
+
5090
5122
  :is(.\\*\\:\\[span\\]\\:last\\:flex > *):is(span):last-child {
5091
5123
  display: flex;
5092
5124
  }
@@ -5454,8 +5486,17 @@ var __webpack_modules__ = {
5454
5486
  font-display: swap;
5455
5487
  }
5456
5488
 
5489
+ @font-face {
5490
+ font-family: __tw4_shd_noto_arabic_7x4q2;
5491
+ src: url("https://fonts.gstatic.com/s/notosansarabic/v33/nwpCtLGrOAZMl5nJ_wfgRg3DrWFZWsnVBJ_sS6tlqHHFlj4wv4r4xA.woff2") format("woff2");
5492
+ font-weight: 100 900;
5493
+ font-style: normal;
5494
+ font-display: swap;
5495
+ unicode-range: U+6??, U+750-77F, U+870-891, U+897-8E1, U+8E3-8FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
5496
+ }
5497
+
5457
5498
  :root {
5458
- --v-font-family: "__tw4_shd_inter_7x4q2", sans-serif;
5499
+ --v-font-family: "__tw4_shd_inter_7x4q2", "__tw4_shd_noto_arabic_7x4q2", sans-serif;
5459
5500
  font-family: var(--v-font-family);
5460
5501
  font-feature-settings: "liga" 1, "calt" 1;
5461
5502
  -webkit-font-smoothing: antialiased;
@@ -6121,6 +6162,15 @@ var __webpack_modules__ = {
6121
6162
  font-style: normal;
6122
6163
  font-display: swap;
6123
6164
  }
6165
+
6166
+ @font-face {
6167
+ font-family: __tw4_shd_noto_arabic_7x4q2;
6168
+ src: url("https://fonts.gstatic.com/s/notosansarabic/v33/nwpCtLGrOAZMl5nJ_wfgRg3DrWFZWsnVBJ_sS6tlqHHFlj4wv4r4xA.woff2") format("woff2");
6169
+ font-weight: 100 900;
6170
+ font-style: normal;
6171
+ font-display: swap;
6172
+ unicode-range: U+6??, U+750-77F, U+870-891, U+897-8E1, U+8E3-8FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
6173
+ }
6124
6174
  `,
6125
6175
  ""
6126
6176
  ]);
@@ -6253,6 +6303,155 @@ function ThemeProvider({ children, defaultTheme = 'system', storageKey = 'v-them
6253
6303
  }
6254
6304
  var fontsinline = __webpack_require__("../ui/src/styles/fonts.css?inline");
6255
6305
  const ns1 = {
6306
+ matting: 'الحافة الداخلية',
6307
+ close: 'إغلاق',
6308
+ mattingOptions: {
6309
+ none: 'بدون'
6310
+ },
6311
+ units: {
6312
+ cm: 'سم',
6313
+ in: 'بوصة'
6314
+ },
6315
+ ar: {
6316
+ viewInPlace: 'اعرضه في مكانك',
6317
+ scanQrCode: 'امسح رمز QR هذا بكاميرا هاتفك لعرض المنتج بتقنية الواقع المعزز',
6318
+ deviceRequirementsDisclaimer: '*يتطلب جهازًا ومتصفحًا يدعمان الواقع المعزز. نوصي بنظام iOS 18 أو أحدث مع Safari، أو Android 7.0 أو أحدث مع Chrome.',
6319
+ appClipScanTitle: 'امسح الرمز بكاميرا هاتفك',
6320
+ appClipRequirement: 'يعمل عرض الواقع المعزز على iOS 18 أو أحدث'
6321
+ },
6322
+ legal: {
6323
+ termsOfUse: 'شروط الاستخدام',
6324
+ conjunction: ' و',
6325
+ privacyPolicy: 'سياسة الخصوصية'
6326
+ },
6327
+ shareMessage: {
6328
+ 'wall-panel': 'معاينة ألواح الجدران',
6329
+ wallart: 'معاينة اللوحة الفنية',
6330
+ rugs: 'معاينة السجادة',
6331
+ flooring: 'معاينة الأرضية'
6332
+ },
6333
+ rooms: {
6334
+ 'room-example-11': 'غرفة نموذجية 11',
6335
+ 'room-example-12': 'غرفة نموذجية 12',
6336
+ 'room-example-13': 'غرفة نموذجية 13',
6337
+ 'room-example-14': 'غرفة نموذجية 14',
6338
+ 'room-example-15': 'غرفة نموذجية 15',
6339
+ 'carpet-bathroom': 'الحمّام',
6340
+ 'carpet-bedroom': 'غرفة النوم',
6341
+ 'carpet-entryway': 'المدخل',
6342
+ 'carpet-living-room': 'غرفة المعيشة'
6343
+ },
6344
+ scene: {
6345
+ tunePosition: 'ضبط الموضع',
6346
+ angle: 'الزاوية',
6347
+ rotation: 'الدوران',
6348
+ resetPosition: 'إعادة التعيين'
6349
+ },
6350
+ accessError: {
6351
+ unauthorized: 'مفتاح API غير صالح',
6352
+ 'payment-required': 'العارض غير متاح مؤقتًا'
6353
+ },
6354
+ loadError: {
6355
+ 'viewer-load-failed': 'تعذّر تحميل العارض. يُرجى المحاولة مرة أخرى.',
6356
+ 'artwork-load-failed': 'تعذّر تحميل الصورة — رابطها مفقود أو غير صحيح في إعدادات الأداة.',
6357
+ 'room-load-failed': 'تعذّر تحميل صورة الغرفة. يُرجى المحاولة مرة أخرى.'
6358
+ },
6359
+ missingSurface: {
6360
+ floor: {
6361
+ title: 'لم نتمكن من العثور على الأرضية',
6362
+ body: 'جرّب صورة تظهر فيها الأرضية.'
6363
+ },
6364
+ wall: {
6365
+ title: 'لم نتمكن من العثور على جدار',
6366
+ body: 'جرّب صورة يظهر فيها جدار.'
6367
+ },
6368
+ uploadAnother: 'رفع صورة أخرى'
6369
+ },
6370
+ wallPanel: {
6371
+ loading: 'جارٍ تحميل الخامة',
6372
+ panelActions: 'إجراءات اللوح {{number}}',
6373
+ retry: 'تعذّر التحميل. اختر مرة أخرى لإعادة المحاولة.',
6374
+ actions: 'إجراءات اللوح',
6375
+ materials: 'الخامات',
6376
+ materialFallback: 'الخامة {{number}}',
6377
+ rotate: 'تدوير اللوح',
6378
+ delete: 'حذف اللوح'
6379
+ },
6380
+ wallArt: {
6381
+ pictureFrame: 'الإطار'
6382
+ },
6383
+ resourceType: {
6384
+ 'wall-panel': {
6385
+ productCategory: 'لوح جداري',
6386
+ productCardTitle: 'اللوح المحدد',
6387
+ replaceProduct: 'استبدال اللوح',
6388
+ replaceProductShort: 'استبدال'
6389
+ },
6390
+ wallart: {
6391
+ productCardTitle: 'اللوحة الفنية المحددة',
6392
+ appearance: 'استبدال'
6393
+ },
6394
+ rugs: {
6395
+ productCategory: 'سجادة',
6396
+ productCardTitle: 'السجادة المحددة',
6397
+ replaceProduct: 'استبدال السجادة',
6398
+ replaceProductShort: 'استبدال'
6399
+ },
6400
+ flooring: {
6401
+ productCategory: 'أرضية',
6402
+ productCardTitle: 'الأرضية المحددة',
6403
+ replaceProduct: 'استبدال الأرضية',
6404
+ replaceProductShort: 'استبدال'
6405
+ }
6406
+ },
6407
+ floor: {
6408
+ scene: {
6409
+ share: 'مشاركة',
6410
+ download: 'تنزيل',
6411
+ hideCatalog: 'إخفاء الكتالوج',
6412
+ description: 'الوصف',
6413
+ interiorCardTitle: 'التصميم الداخلي',
6414
+ tryAtHome: 'جرّبه في منزلك',
6415
+ tryAtHomeBody: 'عبر كاميرا هاتفك'
6416
+ },
6417
+ materialSelection: {
6418
+ flooring: 'اختر الأرضية',
6419
+ rugs: 'اختر سجادة',
6420
+ 'wall-panel': 'اختر لوحًا',
6421
+ title: 'اختيار الخامة'
6422
+ },
6423
+ interiorSelection: {
6424
+ title: 'اختر التصميم الداخلي',
6425
+ uploadPhoto: 'ارفع صورتك',
6426
+ invalidFile: 'تعذّر رفع الصورة، يُرجى المحاولة مرة أخرى',
6427
+ customTitle: 'صورك',
6428
+ presetsTitle: 'تصاميم داخلية جاهزة',
6429
+ currentInterior: 'التصميم الداخلي الحالي',
6430
+ chooseInterior: 'اختر التصميم الداخلي',
6431
+ chooseInteriorShort: 'اختر'
6432
+ },
6433
+ processing: {
6434
+ title: 'جارٍ تجهيز غرفتك',
6435
+ progressLabel: 'تقدّم تجهيز الغرفة',
6436
+ stages: {
6437
+ reading: 'جارٍ قراءة صورتك...',
6438
+ mapping: 'جارٍ تحديد الأرضيات والجدران...',
6439
+ lighting: 'جارٍ موازنة الإضاءة والمنظور...',
6440
+ finalizing: 'جارٍ إنشاء المعاينة...',
6441
+ ready: 'الغرفة جاهزة...'
6442
+ }
6443
+ },
6444
+ error: {
6445
+ title: 'حدث خطأ ما',
6446
+ processingBody: 'لم نتمكن هذه المرة من رفع الصورة ومعالجتها',
6447
+ loadBody: 'تعذّر تحميل العارض. يُرجى المحاولة مرة أخرى.',
6448
+ tryAgain: 'حاول مرة أخرى',
6449
+ cancel: 'إلغاء'
6450
+ }
6451
+ }
6452
+ };
6453
+ const ar_ns1 = ns1;
6454
+ const ns1_ns1 = {
6256
6455
  matting: 'Matting',
6257
6456
  close: 'Close',
6258
6457
  mattingOptions: {
@@ -6271,7 +6470,7 @@ const ns1 = {
6271
6470
  },
6272
6471
  legal: {
6273
6472
  termsOfUse: 'Terms of Use',
6274
- conjunction: 'and',
6473
+ conjunction: ' and ',
6275
6474
  privacyPolicy: 'Privacy Policy'
6276
6475
  },
6277
6476
  shareMessage: {
@@ -6400,8 +6599,8 @@ const ns1 = {
6400
6599
  }
6401
6600
  }
6402
6601
  };
6403
- const en_ns1 = ns1;
6404
- const ns1_ns1 = {
6602
+ const en_ns1 = ns1_ns1;
6603
+ const ru_ns1_ns1 = {
6405
6604
  matting: 'Паспарту',
6406
6605
  close: 'Закрыть',
6407
6606
  mattingOptions: {
@@ -6420,7 +6619,7 @@ const ns1_ns1 = {
6420
6619
  },
6421
6620
  legal: {
6422
6621
  termsOfUse: 'Условия использования',
6423
- conjunction: 'и',
6622
+ conjunction: ' и ',
6424
6623
  privacyPolicy: 'Политика конфиденциальности'
6425
6624
  },
6426
6625
  shareMessage: {
@@ -6549,17 +6748,20 @@ const ns1_ns1 = {
6549
6748
  }
6550
6749
  }
6551
6750
  };
6552
- const ru_ns1 = ns1_ns1;
6751
+ const ru_ns1 = ru_ns1_ns1;
6553
6752
  const resources = {
6554
6753
  en: {
6555
6754
  translation: en_ns1
6556
6755
  },
6557
6756
  ru: {
6558
6757
  translation: ru_ns1
6758
+ },
6759
+ ar: {
6760
+ translation: ar_ns1
6559
6761
  }
6560
6762
  };
6561
- const roomViewerI18n = i18next.createInstance();
6562
- roomViewerI18n.use(i18next_browser_languagedetector).use(initReactI18next).init({
6763
+ const ROOM_VIEWER_LANGUAGES = Object.keys(resources);
6764
+ const initOptions = {
6563
6765
  debug: false,
6564
6766
  detection: {
6565
6767
  caches: []
@@ -6569,7 +6771,38 @@ roomViewerI18n.use(i18next_browser_languagedetector).use(initReactI18next).init(
6569
6771
  interpolation: {
6570
6772
  escapeValue: false
6571
6773
  }
6572
- });
6774
+ };
6775
+ function createRoomViewerI18n(language) {
6776
+ const instance = i18next.createInstance();
6777
+ instance.use(i18next_browser_languagedetector).init({
6778
+ ...initOptions,
6779
+ lng: language
6780
+ });
6781
+ return instance;
6782
+ }
6783
+ const roomViewerI18n = i18next.createInstance();
6784
+ roomViewerI18n.use(i18next_browser_languagedetector).use(initReactI18next).init(initOptions);
6785
+ function resolveRoomViewerLanguage(i18n) {
6786
+ const language = i18n.resolvedLanguage ?? i18n.language;
6787
+ return ROOM_VIEWER_LANGUAGES.find((candidate)=>candidate === language) ?? 'en';
6788
+ }
6789
+ function getRoomViewerDirection(language) {
6790
+ return 'ar' === language ? 'rtl' : 'ltr';
6791
+ }
6792
+ function useRoomViewerLanguage() {
6793
+ const { i18n } = useTranslation();
6794
+ return resolveRoomViewerLanguage(i18n);
6795
+ }
6796
+ function useRoomViewerDirection(viewerI18n) {
6797
+ const { i18n } = useTranslation(void 0, {
6798
+ i18n: viewerI18n
6799
+ });
6800
+ const language = resolveRoomViewerLanguage(i18n);
6801
+ return {
6802
+ language,
6803
+ direction: getRoomViewerDirection(language)
6804
+ };
6805
+ }
6573
6806
  const PROPERTY_BLOCK_RE = /@property\s+(--[^{\s]+)\s*\{([^}]*)\}/g;
6574
6807
  const INITIAL_VALUE_RE = /initial-value:([^;}]+)/i;
6575
6808
  const NON_INHERITING_RE = /inherits:\s*false(?:\s*;|\s*$)/i;
@@ -7094,65 +7327,65 @@ async function publicApiControllerActivateWallart(params, config = {}) {
7094
7327
  });
7095
7328
  return res.data;
7096
7329
  }
7097
- async function publicApiControllerGetKitItems(data, config = {}) {
7330
+ async function publicApiControllerIssueWidgetToken(data, config = {}) {
7098
7331
  const { client: request = client_client, ...requestConfig } = config;
7099
7332
  const requestData = data;
7100
7333
  const res = await request({
7101
7334
  method: "POST",
7102
- url: "/public/kits/items",
7335
+ url: "/public/widget/token",
7103
7336
  data: requestData,
7104
7337
  ...requestConfig
7105
7338
  });
7106
7339
  return res.data;
7107
7340
  }
7108
- async function publicApiControllerGetPublicObjects(data, params, config = {}) {
7341
+ async function publicApiControllerReadKitItems(data, config = {}) {
7109
7342
  const { client: request = client_client, ...requestConfig } = config;
7110
7343
  const requestData = data;
7111
7344
  const res = await request({
7112
7345
  method: "POST",
7113
- url: "/public/objects/public",
7114
- params,
7346
+ url: "/public/kits/items",
7115
7347
  data: requestData,
7116
7348
  ...requestConfig
7117
7349
  });
7118
7350
  return res.data;
7119
7351
  }
7120
- async function publicApiControllerGetShopifyWidgetRooms(params, config = {}) {
7352
+ async function publicApiControllerReadObjectByTinuuid({ tinuuid }, params, config = {}) {
7121
7353
  const { client: request = client_client, ...requestConfig } = config;
7122
7354
  const res = await request({
7123
- method: "POST",
7124
- url: "/public/widget/shopify/get-rooms",
7355
+ method: "GET",
7356
+ url: `/public/objects/by-tinuuid/${tinuuid}`,
7125
7357
  params,
7126
7358
  ...requestConfig
7127
7359
  });
7128
7360
  return res.data;
7129
7361
  }
7130
- async function publicApiControllerGetWidgetRooms(config = {}) {
7362
+ async function publicApiControllerReadPublicObjects(data, params, config = {}) {
7131
7363
  const { client: request = client_client, ...requestConfig } = config;
7364
+ const requestData = data;
7132
7365
  const res = await request({
7133
7366
  method: "POST",
7134
- url: "/public/widget/get-rooms",
7367
+ url: "/public/objects/public",
7368
+ params,
7369
+ data: requestData,
7135
7370
  ...requestConfig
7136
7371
  });
7137
7372
  return res.data;
7138
7373
  }
7139
- async function publicApiControllerIssueWidgetToken(data, config = {}) {
7374
+ async function publicApiControllerReadShopifyWidgetRooms(params, config = {}) {
7140
7375
  const { client: request = client_client, ...requestConfig } = config;
7141
- const requestData = data;
7142
7376
  const res = await request({
7143
7377
  method: "POST",
7144
- url: "/public/widget/token",
7145
- data: requestData,
7378
+ url: "/public/widget/shopify/get-rooms",
7379
+ params,
7146
7380
  ...requestConfig
7147
7381
  });
7148
7382
  return res.data;
7149
7383
  }
7150
- async function publicApiControllerReadObjectByTinuuid({ tinuuid }, params, config = {}) {
7384
+ async function publicApiControllerReadWidgetRooms(config = {}) {
7151
7385
  const { client: request = client_client, ...requestConfig } = config;
7152
7386
  const res = await request({
7153
- method: "GET",
7154
- url: `/public/objects/by-tinuuid/${tinuuid}`,
7155
- params,
7387
+ method: "POST",
7388
+ url: "/public/widget/get-rooms",
7156
7389
  ...requestConfig
7157
7390
  });
7158
7391
  return res.data;
@@ -7263,10 +7496,20 @@ function createWidgetSessionClient(activationData, options) {
7263
7496
  function sendWidgetEvent(session, event, options = {}) {
7264
7497
  if (!session) return;
7265
7498
  const createWidgetEvent = options.createWidgetEvent ?? createWidgetEventViaGeneratedApi;
7266
- session.getApiConfigForRequest(options.apiConfig).then((apiConfig)=>createWidgetEvent({
7499
+ session.getApiConfigForRequest(options.apiConfig).then((apiConfig)=>{
7500
+ const pagePath = currentPagePath();
7501
+ return createWidgetEvent({
7267
7502
  event,
7268
- timestamp: new Date().toISOString()
7269
- }, apiConfig)).catch(()=>{});
7503
+ timestamp: new Date().toISOString(),
7504
+ ...pagePath ? {
7505
+ page_path: pagePath
7506
+ } : {}
7507
+ }, apiConfig);
7508
+ }).catch(()=>{});
7509
+ }
7510
+ function currentPagePath(locationRef = globalThis.location) {
7511
+ const path = locationRef?.pathname;
7512
+ return 'string' == typeof path && path.startsWith('/') ? path : void 0;
7270
7513
  }
7271
7514
  async function getRoomViewerPublicApiHeaders(options) {
7272
7515
  const headers = {
@@ -7278,9 +7521,10 @@ async function getRoomViewerPublicApiHeaders(options) {
7278
7521
  return headers;
7279
7522
  }
7280
7523
  function getRoomViewerLanguageHeaders(options) {
7281
- return options.language ? {
7282
- Lang: options.language
7283
- } : void 0;
7524
+ if (!options.language) return;
7525
+ return {
7526
+ Lang: 'ru' === options.language ? 'ru' : 'en'
7527
+ };
7284
7528
  }
7285
7529
  function roomViewerObjectQueryKey(tinuuid, options) {
7286
7530
  return [
@@ -7357,7 +7601,7 @@ async function fetchRoomViewerOwnerObjects(ownerUuid, page, options) {
7357
7601
  signal: options.signal
7358
7602
  });
7359
7603
  const { query, config } = getRoomViewerPublicApiQuery(options);
7360
- return await publicApiControllerGetPublicObjects({
7604
+ return await publicApiControllerReadPublicObjects({
7361
7605
  ...data,
7362
7606
  productType: getRoomViewerPublicApiProductType(options)
7363
7607
  }, query, {
@@ -7380,7 +7624,7 @@ async function fetchRoomViewerKitObjects(kitUuid, _ownerUuid, page, options) {
7380
7624
  signal: options.signal
7381
7625
  });
7382
7626
  const { query, config } = getRoomViewerPublicApiQuery(options);
7383
- const response = await publicApiControllerGetKitItems({
7627
+ const response = await publicApiControllerReadKitItems({
7384
7628
  kitUuid,
7385
7629
  page,
7386
7630
  limit: KIT_PAGE_LIMIT
@@ -7419,10 +7663,10 @@ async function fetchRoomViewerRooms(options) {
7419
7663
  signal: options.signal
7420
7664
  };
7421
7665
  const publicQuery = getRoomViewerPublicApiQuery(options);
7422
- const response = 'shopify' === options.source ? await publicApiControllerGetShopifyWidgetRooms(publicQuery.query, {
7666
+ const response = 'shopify' === options.source ? await publicApiControllerReadShopifyWidgetRooms(publicQuery.query, {
7423
7667
  ...config,
7424
7668
  ...publicQuery.config
7425
- }) : await publicApiControllerGetWidgetRooms(config);
7669
+ }) : await publicApiControllerReadWidgetRooms(config);
7426
7670
  return response.rooms.filter((room)=>false !== room.active).sort((left, right)=>(left.position ?? 0) - (right.position ?? 0)).map((room)=>({
7427
7671
  id: room.id,
7428
7672
  name: room.name,
@@ -7505,7 +7749,7 @@ function DialogContent({ className, children, contentInsideOverlay = false, show
7505
7749
  children,
7506
7750
  showCloseButton && /*#__PURE__*/ jsxs(Close, {
7507
7751
  "data-slot": "dialog-close",
7508
- className: "focus-visible:ring-ring/30 absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
7752
+ className: "focus-visible:ring-ring/30 absolute top-4 end-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
7509
7753
  children: [
7510
7754
  /*#__PURE__*/ jsx(XIcon, {
7511
7755
  className: "size-6"
@@ -8084,19 +8328,19 @@ function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
8084
8328
  "data-slot": "dropdown-menu-item",
8085
8329
  "data-inset": inset,
8086
8330
  "data-variant": variant,
8087
- 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),
8331
+ 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 && 'ps-8', className),
8088
8332
  ...props
8089
8333
  });
8090
8334
  }
8091
8335
  function DropdownMenuCheckboxItem({ className, children, checked, indicatorPosition = 'left', ...props }) {
8092
8336
  return /*#__PURE__*/ jsxs(CheckboxItem, {
8093
8337
  "data-slot": "dropdown-menu-checkbox-item",
8094
- className: utils_cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden hover:bg-background-base focus:bg-background-base data-[highlighted]:bg-background-base data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'right' === indicatorPosition && 'pr-8 pl-2', className),
8338
+ className: utils_cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden hover:bg-background-base focus:bg-background-base data-[highlighted]:bg-background-base data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'right' === indicatorPosition && 'pe-8 ps-2', className),
8095
8339
  checked: checked,
8096
8340
  ...props,
8097
8341
  children: [
8098
8342
  /*#__PURE__*/ jsx("span", {
8099
- className: utils_cn('pointer-events-none absolute flex size-3.5 items-center justify-center', 'right' === indicatorPosition ? 'right-2' : 'left-2'),
8343
+ className: utils_cn('pointer-events-none absolute flex size-3.5 items-center justify-center', 'right' === indicatorPosition ? 'end-2' : 'start-2'),
8100
8344
  children: /*#__PURE__*/ jsx(ItemIndicator, {
8101
8345
  children: /*#__PURE__*/ jsx(CheckIcon, {
8102
8346
  className: "size-4"
@@ -8111,7 +8355,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
8111
8355
  return /*#__PURE__*/ jsx(react_dropdown_menu_Label, {
8112
8356
  "data-slot": "dropdown-menu-label",
8113
8357
  "data-inset": inset,
8114
- className: utils_cn('px-2 py-1.5 text-sm font-medium', inset && 'pl-8', className),
8358
+ className: utils_cn('px-2 py-1.5 text-sm font-medium', inset && 'ps-8', className),
8115
8359
  ...props
8116
8360
  });
8117
8361
  }
@@ -12230,7 +12474,7 @@ function InteriorSelectionEntry({ rooms, customRooms, selectedRoomId, isInvalidF
12230
12474
  function renderInteriorCards(interiorRooms) {
12231
12475
  return interiorRooms.map((room)=>/*#__PURE__*/ jsxs("button", {
12232
12476
  type: "button",
12233
- className: "group relative aspect-[4/3] overflow-hidden rounded-2xl bg-background-base text-left transition focus-visible:ring-2 focus-visible:ring-icons-normal focus-visible:outline-hidden",
12477
+ className: "group relative aspect-[4/3] overflow-hidden rounded-2xl bg-background-base text-start transition focus-visible:ring-2 focus-visible:ring-icons-normal focus-visible:outline-hidden",
12234
12478
  "aria-pressed": room.id === selectedRoomId,
12235
12479
  onClick: ()=>onSelectRoom(room.id),
12236
12480
  children: [
@@ -12255,7 +12499,7 @@ function InteriorSelectionEntry({ rooms, customRooms, selectedRoomId, isInvalidF
12255
12499
  type: "button",
12256
12500
  variant: "outline",
12257
12501
  size: "icon",
12258
- className: "absolute top-4 right-4 sm:top-6 sm:right-6",
12502
+ className: "absolute top-4 end-4 sm:top-6 sm:end-6",
12259
12503
  "aria-label": t('close'),
12260
12504
  "data-testid": "floor-interior-selection-icon-close",
12261
12505
  children: /*#__PURE__*/ jsx(close_Close, {})
@@ -12308,7 +12552,7 @@ function InteriorSelectionEntry({ rooms, customRooms, selectedRoomId, isInvalidF
12308
12552
  ]
12309
12553
  }),
12310
12554
  /*#__PURE__*/ jsx("div", {
12311
- className: "grid min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pr-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
12555
+ className: "grid min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pe-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
12312
12556
  "data-testid": "floor-interior-selection-scroll-content",
12313
12557
  children: /*#__PURE__*/ jsxs("div", {
12314
12558
  className: "grid min-h-max gap-4",
@@ -12771,7 +13015,7 @@ function MaterialSelectionContent({ className, gridClassName, titleClassName, on
12771
13015
  /*#__PURE__*/ jsx("div", {
12772
13016
  "data-testid": "material-selection-grid",
12773
13017
  ref: gridRef,
12774
- className: utils_cn('min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain pr-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden', gridClassName),
13018
+ className: utils_cn('min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain pe-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden', gridClassName),
12775
13019
  onScroll: handleScroll,
12776
13020
  children: /*#__PURE__*/ jsxs("div", {
12777
13021
  className: "grid min-h-max grid-cols-3 gap-x-2 gap-y-2",
@@ -12784,7 +13028,7 @@ function MaterialSelectionContent({ className, gridClassName, titleClassName, on
12784
13028
  type: "button",
12785
13029
  "data-selected": isSelected,
12786
13030
  "aria-pressed": isSelected,
12787
- className: "group flex min-w-0 flex-col gap-1 rounded-lg bg-background-containers text-left focus-visible:ring-2 focus-visible:ring-icons-normal focus-visible:outline-hidden",
13031
+ className: "group flex min-w-0 flex-col gap-1 rounded-lg bg-background-containers text-start focus-visible:ring-2 focus-visible:ring-icons-normal focus-visible:outline-hidden",
12788
13032
  onClick: ()=>handleSelectMaterial(materialId),
12789
13033
  onKeyDown: (event)=>{
12790
13034
  if ('Enter' === event.key || ' ' === event.key) {
@@ -12804,7 +13048,7 @@ function MaterialSelectionContent({ className, gridClassName, titleClassName, on
12804
13048
  className: "size-6 text-icons-normal"
12805
13049
  }),
12806
13050
  isSelected && /*#__PURE__*/ jsx("span", {
12807
- className: "absolute top-1 right-1 grid size-6 place-items-center rounded-full bg-icons-blue text-icons-white",
13051
+ className: "absolute top-1 end-1 grid size-6 place-items-center rounded-full bg-icons-blue text-icons-white",
12808
13052
  "data-testid": "material-selection-selected-check",
12809
13053
  children: /*#__PURE__*/ jsx(CheckDone, {
12810
13054
  className: "size-4"
@@ -12965,7 +13209,7 @@ function ProcessingRoomDialog({ isComplete, open, onCloseAnimationEnd, onOpenCha
12965
13209
  className: "flex min-w-0 items-center justify-between gap-3",
12966
13210
  children: [
12967
13211
  /*#__PURE__*/ jsx("span", {
12968
- className: "typo-base-14 min-w-0 flex-1 truncate text-left font-medium text-text-light",
13212
+ className: "typo-base-14 min-w-0 flex-1 truncate text-start font-medium text-text-light",
12969
13213
  children: t(activeStage.translationKey)
12970
13214
  }),
12971
13215
  /*#__PURE__*/ jsxs("span", {
@@ -13334,9 +13578,7 @@ function QRCode({ data, foreground, background, robustness = 'M', className, ...
13334
13578
  });
13335
13579
  }
13336
13580
  function useRoomViewerTenant() {
13337
- const { i18n } = useTranslation();
13338
- const language = i18n.resolvedLanguage ?? i18n.language;
13339
- return 'ru' === language ? 'arizo' : 'vizbl';
13581
+ return 'ru' === useRoomViewerLanguage() ? 'arizo' : 'vizbl';
13340
13582
  }
13341
13583
  function isAbsoluteUrl(value) {
13342
13584
  return /^[a-z][a-z0-9+.-]*:/i.test(value) || value.startsWith('//');
@@ -13629,9 +13871,7 @@ function AR({ className, buttonClassName, buttonLeadingIcon, buttonLabel, button
13629
13871
  },
13630
13872
  children: t('legal.termsOfUse')
13631
13873
  }),
13632
- ' ',
13633
13874
  t('legal.conjunction'),
13634
- ' ',
13635
13875
  /*#__PURE__*/ jsx("a", {
13636
13876
  href: tenantConfig.PRIVACY_URL,
13637
13877
  target: "_blank",
@@ -13786,12 +14026,12 @@ function SelectContent({ className, children, position = 'item-aligned', align =
13786
14026
  function SelectItem({ className, children, ...props }) {
13787
14027
  return /*#__PURE__*/ jsxs(Select.Item, {
13788
14028
  "data-slot": "select-item",
13789
- className: utils_cn('relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md py-2.5 pr-8 pl-3 outline-hidden', 'typo-base-16 text-text-sub', 'focus:bg-background-base focus:text-text-dark', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-6 [&_svg:not([class*=text-])]:text-text-dark', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', className),
14029
+ className: utils_cn('relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md py-2.5 pe-8 ps-3 outline-hidden', 'typo-base-16 text-text-sub', 'focus:bg-background-base focus:text-text-dark', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-6 [&_svg:not([class*=text-])]:text-text-dark', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', className),
13790
14030
  ...props,
13791
14031
  children: [
13792
14032
  /*#__PURE__*/ jsx("span", {
13793
14033
  "data-slot": "select-item-indicator",
13794
- className: "absolute right-2 flex size-6 items-center justify-center",
14034
+ className: "absolute end-2 flex size-6 items-center justify-center",
13795
14035
  children: /*#__PURE__*/ jsx(Select.ItemIndicator, {
13796
14036
  children: /*#__PURE__*/ jsx(CheckDone, {
13797
14037
  className: "size-5"
@@ -14274,9 +14514,9 @@ function ResetPositionButton() {
14274
14514
  });
14275
14515
  }
14276
14516
  const CONTAINER_CLASS_NAMES = {
14277
- card: 'flex min-h-24 w-fit max-w-100 items-center gap-4 rounded-2xl bg-background-containers p-4 text-left text-text-dark shadow-[var(--shadow-login)]',
14278
- 'compact-card': 'flex min-h-[116px] w-fit max-w-[421px] items-center gap-4 rounded-2xl bg-background-containers p-4 text-left text-text-dark shadow-[var(--shadow-login)]',
14279
- 'flow-card': 'flex items-center justify-start gap-4 border-b border-border-light bg-background-containers p-4 text-left'
14517
+ card: 'flex min-h-24 w-fit max-w-100 items-center gap-4 rounded-2xl bg-background-containers p-4 text-start text-text-dark shadow-[var(--shadow-login)]',
14518
+ 'compact-card': 'flex min-h-[116px] w-fit max-w-[421px] items-center gap-4 rounded-2xl bg-background-containers p-4 text-start text-text-dark shadow-[var(--shadow-login)]',
14519
+ 'flow-card': 'flex items-center justify-start gap-4 border-b border-border-light bg-background-containers p-4 text-start'
14280
14520
  };
14281
14521
  const ICON_CLASS_NAMES = {
14282
14522
  card: 'size-6 text-icons-normal',
@@ -14410,7 +14650,7 @@ function ProductCardSlot({ actions, band, slot, presentation }) {
14410
14650
  children: [
14411
14651
  /*#__PURE__*/ jsx(SelectTrigger, {
14412
14652
  size: "sm",
14413
- className: "ml-auto w-fit min-w-0 shrink data-[size=sm]:h-8 *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate",
14653
+ className: "ms-auto w-fit min-w-0 shrink data-[size=sm]:h-8 *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate",
14414
14654
  "data-testid": `${testId}-variant-select`,
14415
14655
  children: /*#__PURE__*/ jsx(SelectValue, {})
14416
14656
  }),
@@ -14431,9 +14671,9 @@ function ProductCardSlot({ actions, band, slot, presentation }) {
14431
14671
  });
14432
14672
  }
14433
14673
  const RoomCardSlot_CONTAINER_CLASS_NAMES = {
14434
- card: '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)]',
14435
- 'framed-row': '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)]',
14436
- 'plain-row': 'flex w-full items-center justify-between gap-3 rounded-full bg-background-containers text-left'
14674
+ card: 'flex h-24 w-[254px] items-center gap-4 overflow-hidden rounded-2xl bg-background-containers p-4 text-start text-text-dark shadow-[var(--shadow-login)]',
14675
+ 'framed-row': 'flex h-[72px] items-center justify-between gap-3 overflow-hidden rounded-2xl bg-background-containers p-4 text-start text-text-dark shadow-[var(--shadow-login)]',
14676
+ 'plain-row': 'flex w-full items-center justify-between gap-3 rounded-full bg-background-containers text-start'
14437
14677
  };
14438
14678
  const RoomCardSlot_CARD_TEST_IDS = {
14439
14679
  desktop: 'floor-room-card',
@@ -15802,7 +16042,7 @@ function ImmersiveRoomChrome({ showDialogCloseButton = false }) {
15802
16042
  })
15803
16043
  }),
15804
16044
  /*#__PURE__*/ jsxs("div", {
15805
- className: "pointer-events-none absolute top-0 right-0 left-0 z-20 flex min-h-22 items-start justify-between gap-4 bg-linear-to-b from-black/75 via-black/35 to-transparent px-4 pt-4 pb-8 text-constant-white sm:px-6 lg:min-h-25 lg:pt-6",
16045
+ className: "pointer-events-none absolute top-0 end-0 start-0 z-20 flex min-h-22 items-start justify-between gap-4 bg-linear-to-b from-black/75 via-black/35 to-transparent px-4 pt-4 pb-8 text-constant-white sm:px-6 lg:min-h-25 lg:pt-6",
15806
16046
  children: [
15807
16047
  /*#__PURE__*/ jsx("div", {
15808
16048
  className: "min-w-0 pt-1",
@@ -15898,7 +16138,7 @@ function ImmersiveRoomChrome({ showDialogCloseButton = false }) {
15898
16138
  ]
15899
16139
  }),
15900
16140
  /*#__PURE__*/ jsxs("div", {
15901
- className: "pointer-events-none absolute right-6 bottom-6 left-6 z-20 hidden items-end justify-between gap-4 lg:flex",
16141
+ className: "pointer-events-none absolute end-6 bottom-6 start-6 z-20 hidden items-end justify-between gap-4 lg:flex",
15902
16142
  "data-testid": "floor-desktop-cards",
15903
16143
  children: [
15904
16144
  /*#__PURE__*/ jsx("div", {
@@ -15920,7 +16160,7 @@ function ImmersiveRoomChrome({ showDialogCloseButton = false }) {
15920
16160
  ]
15921
16161
  }),
15922
16162
  /*#__PURE__*/ jsxs("div", {
15923
- className: "pointer-events-none absolute right-6 bottom-6 left-6 z-20 hidden items-end justify-between gap-2 sm:flex lg:hidden",
16163
+ className: "pointer-events-none absolute end-6 bottom-6 start-6 z-20 hidden items-end justify-between gap-2 sm:flex lg:hidden",
15924
16164
  "data-testid": "floor-tablet-cards",
15925
16165
  children: [
15926
16166
  /*#__PURE__*/ jsx("div", {
@@ -15966,7 +16206,7 @@ function ImmersiveRoomChrome({ showDialogCloseButton = false }) {
15966
16206
  }),
15967
16207
  isMaterialSelectionPanelOpen && !hasActiveError && /*#__PURE__*/ jsx(MaterialSelectionContent, {
15968
16208
  [MATERIAL_SELECTION_PANEL_ATTRIBUTE]: true,
15969
- className: "absolute bottom-[152px] left-6 z-30 hidden max-h-[calc(100%-252px)] w-[348px] rounded-2xl bg-background-containers sm:flex lg:bottom-[132px] lg:max-h-[calc(100%-232px)]",
16209
+ className: "absolute bottom-[152px] start-6 z-30 hidden max-h-[calc(100%-252px)] w-[348px] rounded-2xl bg-background-containers sm:flex lg:bottom-[132px] lg:max-h-[calc(100%-232px)]",
15970
16210
  gridClassName: "px-4 pb-4",
15971
16211
  titleClassName: "px-4 pt-4",
15972
16212
  onOpenChange: handleCloseMaterialSelection
@@ -16093,11 +16333,6 @@ function RoomViewerContainer(props) {
16093
16333
  ...props
16094
16334
  });
16095
16335
  }
16096
- function useRoomViewerLanguage() {
16097
- const { i18n } = useTranslation();
16098
- const language = i18n.resolvedLanguage ?? i18n.language;
16099
- return 'ru' === language ? 'ru' : 'en';
16100
- }
16101
16336
  function isBlankArtworkSource(src) {
16102
16337
  return 'string' != typeof src || 0 === src.trim().length;
16103
16338
  }
@@ -16662,7 +16897,7 @@ function RoomViewerRoot({ type, src, tinuuid, roomId, name, height, width, langu
16662
16897
  type
16663
16898
  ]);
16664
16899
  useEffect(()=>{
16665
- if ('string' == typeof language) i18n.changeLanguage(language);
16900
+ if ('string' == typeof language && language !== i18n.language) i18n.changeLanguage(language);
16666
16901
  }, [
16667
16902
  i18n,
16668
16903
  language
@@ -16697,6 +16932,8 @@ configureApiClient({
16697
16932
  });
16698
16933
  function RoomViewerDialog({ type, src, tinuuid, roomId, width, height, dimensionUnit, displayUnit, name, language, apiKey, source, widgetSession, disableClose = false, open, defaultOpen, onOpenChange }) {
16699
16934
  const [themeRoot, setThemeRoot] = useState(null);
16935
+ const [viewerI18n] = useState(()=>createRoomViewerI18n(language));
16936
+ const { language: uiLanguage, direction } = useRoomViewerDirection(viewerI18n);
16700
16937
  const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
16701
16938
  const dialogOpen = open ?? uncontrolledOpen;
16702
16939
  const [hasRenderedDialogContent, setHasRenderedDialogContent] = useState(dialogOpen);
@@ -16749,6 +16986,7 @@ function RoomViewerDialog({ type, src, tinuuid, roomId, width, height, dimension
16749
16986
  style: {
16750
16987
  display: 'block',
16751
16988
  letterSpacing: 'normal',
16989
+ position: 'relative',
16752
16990
  zIndex: 2147483647
16753
16991
  },
16754
16992
  children: [
@@ -16759,15 +16997,20 @@ function RoomViewerDialog({ type, src, tinuuid, roomId, width, height, dimension
16759
16997
  children: shadowRootCssText
16760
16998
  }),
16761
16999
  /*#__PURE__*/ jsx("div", {
16762
- ref: setThemeRoot
17000
+ ref: setThemeRoot,
17001
+ dir: direction,
17002
+ lang: uiLanguage
16763
17003
  }),
16764
17004
  themeRoot && /*#__PURE__*/ jsx(ThemeProvider, {
16765
17005
  root: themeRoot,
16766
17006
  storageKey: "neurodyn-theme",
16767
17007
  defaultTheme: "light",
16768
- children: /*#__PURE__*/ jsx(I18nextProvider, {
16769
- i18n: roomViewerI18n,
16770
- children: shouldRenderRoomViewerRoot && roomViewerRoot
17008
+ children: /*#__PURE__*/ jsx(Direction.Provider, {
17009
+ dir: direction,
17010
+ children: /*#__PURE__*/ jsx(I18nextProvider, {
17011
+ i18n: viewerI18n,
17012
+ children: shouldRenderRoomViewerRoot && roomViewerRoot
17013
+ })
16771
17014
  })
16772
17015
  })
16773
17016
  ]
@@ -16777,6 +17020,8 @@ function RoomViewerDialog({ type, src, tinuuid, roomId, width, height, dimension
16777
17020
  }
16778
17021
  function RoomViewer({ type, src, tinuuid, roomId, name, language, width, height, dimensionUnit, displayUnit, apiKey, source, widgetSession, className, ...props }) {
16779
17022
  const [themeRoot, setThemeRoot] = useState(null);
17023
+ const [viewerI18n] = useState(()=>createRoomViewerI18n(language));
17024
+ const { language: uiLanguage, direction } = useRoomViewerDirection(viewerI18n);
16780
17025
  return /*#__PURE__*/ jsxs(Fragment, {
16781
17026
  children: [
16782
17027
  /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx("style", {
@@ -16797,6 +17042,8 @@ function RoomViewer({ type, src, tinuuid, roomId, name, language, width, height,
16797
17042
  }),
16798
17043
  /*#__PURE__*/ jsx("div", {
16799
17044
  ref: setThemeRoot,
17045
+ dir: direction,
17046
+ lang: uiLanguage,
16800
17047
  style: {
16801
17048
  height: '100%',
16802
17049
  width: '100%'
@@ -16805,22 +17052,25 @@ function RoomViewer({ type, src, tinuuid, roomId, name, language, width, height,
16805
17052
  root: themeRoot,
16806
17053
  storageKey: "neurodyn-theme",
16807
17054
  defaultTheme: "light",
16808
- children: /*#__PURE__*/ jsx(I18nextProvider, {
16809
- i18n: roomViewerI18n,
16810
- children: /*#__PURE__*/ jsx(RoomViewerRoot, {
16811
- type: type,
16812
- src: src,
16813
- tinuuid: tinuuid,
16814
- roomId: roomId,
16815
- name: name,
16816
- language: language,
16817
- width: width,
16818
- height: height,
16819
- dimensionUnit: dimensionUnit,
16820
- displayUnit: displayUnit,
16821
- apiKey: apiKey,
16822
- source: source,
16823
- widgetSession: widgetSession
17055
+ children: /*#__PURE__*/ jsx(Direction.Provider, {
17056
+ dir: direction,
17057
+ children: /*#__PURE__*/ jsx(I18nextProvider, {
17058
+ i18n: viewerI18n,
17059
+ children: /*#__PURE__*/ jsx(RoomViewerRoot, {
17060
+ type: type,
17061
+ src: src,
17062
+ tinuuid: tinuuid,
17063
+ roomId: roomId,
17064
+ name: name,
17065
+ language: language,
17066
+ width: width,
17067
+ height: height,
17068
+ dimensionUnit: dimensionUnit,
17069
+ displayUnit: displayUnit,
17070
+ apiKey: apiKey,
17071
+ source: source,
17072
+ widgetSession: widgetSession
17073
+ })
16824
17074
  })
16825
17075
  })
16826
17076
  })
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.34",
4
+ "version": "0.1.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },