@smarterplan/ngx-smarterplan-locations 0.4.19 → 0.4.21

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 (39) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/components/carousel/carousel.component.mjs +3 -3
  3. package/esm2022/lib/components/chevron/chevron.component.mjs +3 -3
  4. package/esm2022/lib/components/detail-location/detail-location.component.mjs +40 -4
  5. package/esm2022/lib/components/form-location/form-location.component.mjs +3 -3
  6. package/esm2022/lib/components/images/images.component.mjs +3 -3
  7. package/esm2022/lib/components/landmark-picker/landmark-picker.component.mjs +3 -3
  8. package/esm2022/lib/components/locations/locations.component.mjs +19 -4
  9. package/esm2022/lib/components/locations/map/map-popup/map-popup.component.mjs +3 -3
  10. package/esm2022/lib/components/locations/map/map.component.mjs +3 -3
  11. package/esm2022/lib/components/models3d/models3d.component.mjs +295 -0
  12. package/esm2022/lib/components/plan-legend/plan-legend.component.mjs +3 -3
  13. package/esm2022/lib/components/plans/calibration/calibration.component.mjs +3 -3
  14. package/esm2022/lib/components/plans/edit-plan/edit-plan.component.mjs +3 -3
  15. package/esm2022/lib/components/plans/plans.component.mjs +3 -3
  16. package/esm2022/lib/components/tab-navigation/tab-navigation.component.mjs +3 -3
  17. package/esm2022/lib/components/visits/visits.component.mjs +45 -12
  18. package/esm2022/lib/components/zones/add-audio-zone/add-audio-zone.component.mjs +3 -3
  19. package/esm2022/lib/components/zones/add-zone/add-zone.component.mjs +3 -3
  20. package/esm2022/lib/components/zones/add-zone/selection/selection.component.mjs +3 -3
  21. package/esm2022/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.mjs +3 -3
  22. package/esm2022/lib/components/zones/zones.component.mjs +3 -3
  23. package/esm2022/lib/helper.service.mjs +1 -1
  24. package/esm2022/lib/ngx-smarterplan-location-routing.module.mjs +3 -1
  25. package/esm2022/lib/ngx-smarterplan-locations.module.mjs +4 -1
  26. package/esm2022/lib/ngx-smarterplan-locations.service.mjs +1 -1
  27. package/esm2022/lib/pipes/count-audio-sweeps.pipe.mjs +1 -1
  28. package/esm2022/lib/radio-button/radio-button.component.mjs +3 -3
  29. package/esm2022/public-api.mjs +1 -1
  30. package/fesm2022/smarterplan-ngx-smarterplan-locations.mjs +424 -56
  31. package/fesm2022/smarterplan-ngx-smarterplan-locations.mjs.map +1 -1
  32. package/lib/components/detail-location/detail-location.component.d.ts +13 -0
  33. package/lib/components/locations/locations.component.d.ts +10 -0
  34. package/lib/components/locations/map/map.component.d.ts +2 -2
  35. package/lib/components/models3d/models3d.component.d.ts +84 -0
  36. package/lib/components/visits/visits.component.d.ts +8 -3
  37. package/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.d.ts +0 -1
  38. package/lib/ngx-smarterplan-locations.module.d.ts +27 -26
  39. package/package.json +2 -2
@@ -43,6 +43,10 @@ export declare class DetailLocationComponent implements OnInit, OnDestroy {
43
43
  selectedTarget3dModel: string | null;
44
44
  sourceVisits: Visit[];
45
45
  visits: Visit[];
46
+ /** The capture a visitor opens by default, of any viewer type. Null means none chosen. */
47
+ defaultCaptureID: string | null;
48
+ savingDefaultCapture: boolean;
49
+ defaultCaptureError: string | null;
46
50
  landmarkSourceA: Vec3 | null;
47
51
  landmarkTargetA: Vec3 | null;
48
52
  landmarkSourceB: Vec3 | null;
@@ -69,6 +73,15 @@ export declare class DetailLocationComponent implements OnInit, OnDestroy {
69
73
  onCancel(): void;
70
74
  onErase(): Promise<void>;
71
75
  onGetDpeData(): Promise<void>;
76
+ /**
77
+ * Stores which capture a visitor opens by default.
78
+ *
79
+ * One field on the space, not a flag per capture, so the two admin screens cannot disagree:
80
+ * setting it from either one writes the same place, and there is nothing to clear elsewhere.
81
+ */
82
+ onDefaultCaptureChange(): Promise<void>;
83
+ /** Label for a visit in the default picker, naming the viewer it opens in. */
84
+ visitLabel(visit: Visit): string;
72
85
  /** Toggles visibility of the admin "copy POIs from another location" form. */
73
86
  toggleCopyPoisForm(): void;
74
87
  onSourceLandmarkPicked(slot: 'A' | 'B', point: Vec3): void;
@@ -41,6 +41,16 @@ export declare class LocationsComponent implements OnInit {
41
41
  onAddLocation(): void;
42
42
  handleImageInput(files: FileList): void;
43
43
  onFormChange(event: any): void;
44
+ /**
45
+ * The visits shown under a location.
46
+ *
47
+ * Everyone gets the first one, which is the location's main entry point. Managers also get the
48
+ * rest, so a site carrying both a Matterport tour and one or more 3D models can be opened in
49
+ * either without going through the admin screens.
50
+ */
51
+ visitsToShow(loc: Space): Visit[];
52
+ /** True when this visit opens in the Three.js viewer rather than Matterport. */
53
+ isThreeJsVisit(visit: Visit): boolean;
44
54
  onVisitClick(loc: Space, visit: Visit): Promise<void>;
45
55
  applyResultsSearchBar(results: Space[]): void;
46
56
  getSearchType(): SearchObjectType;
@@ -7,9 +7,9 @@ export declare class MapComponent implements OnChanges, AfterViewInit {
7
7
  spaces: Space[];
8
8
  popupContainer: ViewContainerRef;
9
9
  options: {
10
- layers: import("leaflet").TileLayer[];
10
+ layers: any[];
11
11
  zoom: number;
12
- center: import("leaflet").LatLng;
12
+ center: any;
13
13
  };
14
14
  layers: any[];
15
15
  map: any;
@@ -0,0 +1,84 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
5
+ import { Visit, MenuItem, ThreeJsImportService, CaptureService, NodeService, SpaceService, VisitService, Space, ValidatorsService } from '@smarterplan/ngx-smarterplan-core';
6
+ import { TranslateService } from '@ngx-translate/core';
7
+ import { Subject } from 'rxjs';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * Admin screen for the 3D models a site can be visited with.
11
+ *
12
+ * These are stored the same way Matterport visits are - a Capture plus a Node - with the viewer set
13
+ * to THREEJS and the .glb's S3 key in the node's model3D. Sharing the storage is what lets a site
14
+ * carry several models and what makes tags follow the same POI records in either viewer; the split
15
+ * here is only in the form: a 3D model is a name and a file, where a Matterport visit is a model ID
16
+ * and capture details. Placement and alignment are not asked for here - the viewer's alignment tool
17
+ * writes them into the capture's metadata once someone calibrates against a real scene.
18
+ */
19
+ export declare class Models3dComponent implements OnInit {
20
+ private fb;
21
+ private route;
22
+ private router;
23
+ private modalService;
24
+ private spaceService;
25
+ private visitService;
26
+ private captureService;
27
+ private nodeService;
28
+ private threejsImportService;
29
+ validatorsService: ValidatorsService;
30
+ private translate;
31
+ content: any;
32
+ menuItems: MenuItem[];
33
+ currentSpace: Space;
34
+ spaceId: string;
35
+ /** Only the visits captured as 3D models; Matterport ones stay on the Virtual Visits screen. */
36
+ models: Visit[];
37
+ modelForm: UntypedFormGroup;
38
+ modelIndexDetails: number;
39
+ isEditing: boolean;
40
+ isProcessing: boolean;
41
+ submitted: boolean;
42
+ errorMessage: string | null;
43
+ modalReference: any;
44
+ destroy$: Subject<unknown>;
45
+ constructor(fb: UntypedFormBuilder, route: ActivatedRoute, router: Router, modalService: NgbModal, spaceService: SpaceService, visitService: VisitService, captureService: CaptureService, nodeService: NodeService, threejsImportService: ThreeJsImportService, validatorsService: ValidatorsService, translate: TranslateService);
46
+ ngOnInit(): Promise<void>;
47
+ ngOnDestroy(): void;
48
+ reload(): Promise<void>;
49
+ setupMenuItems(): void;
50
+ onGoBack(): void;
51
+ onToggleDetail(index: number): void;
52
+ onAdd(): void;
53
+ onEdit(model: Visit): void;
54
+ onCancel(): void;
55
+ initForm(input?: Visit): void;
56
+ /** Upload progress as a percentage, or null when nothing is uploading. */
57
+ uploadPercent: number | null;
58
+ uploadedFileName: string | null;
59
+ /**
60
+ * Uploads the chosen .glb and puts the resulting key on the form.
61
+ *
62
+ * Storage.put authenticates with the signed-in user's session rather than separate S3
63
+ * credentials, so anyone who can reach this screen can upload - which is what makes picking a
64
+ * file a better ask than typing a key someone else had to produce.
65
+ */
66
+ onFileSelected(event: Event): Promise<void>;
67
+ /** Validation error for the .glb key, or null. */
68
+ get modelKeyError(): string | null;
69
+ onSubmit(): Promise<void>;
70
+ /** Creates the capture, its node, and the zone/plan/navigation the viewer needs. */
71
+ private createModel;
72
+ onDelete(model: Visit): Promise<void>;
73
+ /**
74
+ * Turns whatever was thrown into something readable.
75
+ *
76
+ * AppSync rejections arrive as { errors: [{ message }] } with no `message` of their own, so the
77
+ * obvious `error.message ?? String(error)` renders them as "[object Object]" - which hides
78
+ * exactly the cases worth reading, like the backend refusing an enum value it does not know.
79
+ */
80
+ private describeError;
81
+ getDismissReason(reason: any): string;
82
+ static ɵfac: i0.ɵɵFactoryDeclaration<Models3dComponent, never>;
83
+ static ɵcmp: i0.ɵɵComponentDeclaration<Models3dComponent, "lib-models3d", never, {}, {}, never, never, false, never>;
84
+ }
@@ -2,13 +2,14 @@ import { OnInit } from '@angular/core';
2
2
  import { UntypedFormGroup, UntypedFormBuilder, AbstractControl } from '@angular/forms';
3
3
  import { ActivatedRoute, Router } from '@angular/router';
4
4
  import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
5
- import { Visit, MenuItem, MatterportImportService, CaptureService, NodeService, SpaceService, VisitService, ValidatorsService, NavigatorService } from '@smarterplan/ngx-smarterplan-core';
5
+ import { Visit, MenuItem, MatterportImportService, ThreeJsImportService, CaptureService, NodeService, SpaceService, VisitService, CaptureViewer, ValidatorsService, NavigatorService } from '@smarterplan/ngx-smarterplan-core';
6
6
  import { TranslateService } from '@ngx-translate/core';
7
7
  import { Subject } from 'rxjs';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class VisitsComponent implements OnInit {
10
10
  private fb;
11
11
  private matterportImportService;
12
+ private threejsImportService;
12
13
  private captureService;
13
14
  private nodeService;
14
15
  private spaceService;
@@ -38,13 +39,17 @@ export declare class VisitsComponent implements OnInit {
38
39
  errorForm: boolean;
39
40
  isProcessing: boolean;
40
41
  destroy$: Subject<unknown>;
41
- constructor(fb: UntypedFormBuilder, matterportImportService: MatterportImportService, captureService: CaptureService, nodeService: NodeService, spaceService: SpaceService, route: ActivatedRoute, modalService: NgbModal, visitService: VisitService, validatorsService: ValidatorsService, translate: TranslateService, navigatorService: NavigatorService, router: Router);
42
+ constructor(fb: UntypedFormBuilder, matterportImportService: MatterportImportService, threejsImportService: ThreeJsImportService, captureService: CaptureService, nodeService: NodeService, spaceService: SpaceService, route: ActivatedRoute, modalService: NgbModal, visitService: VisitService, validatorsService: ValidatorsService, translate: TranslateService, navigatorService: NavigatorService, router: Router);
42
43
  ngOnInit(): Promise<void>;
43
44
  ngOnDestroy(): void;
44
45
  setupMenuItems(): void;
45
46
  onGoBack(): void;
46
47
  resetVisits(): Promise<void>;
47
48
  initVisitForm(input?: Visit): void;
49
+ /** True while the form is set to create a Three.js visit, which asks for different fields. */
50
+ get isThreeJsVisit(): boolean;
51
+ /** Validation error for the 3D model field, or null. Only meaningful for Three.js visits. */
52
+ get modelKeyError(): string | null;
48
53
  onToggleDetail(index: any): Promise<void>;
49
54
  onAddVisit(): void;
50
55
  onEdit(visit: any): void;
@@ -54,7 +59,7 @@ export declare class VisitsComponent implements OnInit {
54
59
  onCancel(): void;
55
60
  onDelete(visit: Visit, needPermission?: boolean): Promise<void>;
56
61
  private getDismissReason;
57
- launchImport(model3D: any, surface: any, node: any, imagesOnly?: boolean, overrideExisting?: boolean): Promise<void>;
62
+ launchImport(model3D: any, surface: any, node: any, viewerType: CaptureViewer, imagesOnly?: boolean, overrideExisting?: boolean, placementMetadata?: string): Promise<void>;
58
63
  private cancelImport;
59
64
  onImportImages(visit: Visit, overrideExisting: any): void;
60
65
  isFormError(control: any): boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="projects/ngx-smarterplan-locations/node_modules/panzoom" />
2
1
  import { EventEmitter, OnInit } from '@angular/core';
3
2
  import { TranslateService } from '@ngx-translate/core';
4
3
  import { Navigation, NavigationService, Plan, Zone, ZoneService, PlanService } from '@smarterplan/ngx-smarterplan-core';
@@ -5,33 +5,34 @@ import * as i3 from "./components/landmark-picker/landmark-picker.component";
5
5
  import * as i4 from "./components/plans/calibration/calibration.component";
6
6
  import * as i5 from "./components/plans/plans.component";
7
7
  import * as i6 from "./components/visits/visits.component";
8
- import * as i7 from "./components/zones/zones.component";
9
- import * as i8 from "./components/images/images.component";
10
- import * as i9 from "./components/plans/edit-plan/edit-plan.component";
11
- import * as i10 from "./components/tab-navigation/tab-navigation.component";
12
- import * as i11 from "./components/locations/map/map.component";
13
- import * as i12 from "./components/locations/map/map-popup/map-popup.component";
14
- import * as i13 from "./components/form-location/form-location.component";
15
- import * as i14 from "./components/chevron/chevron.component";
16
- import * as i15 from "./components/zones/add-zone/add-zone.component";
17
- import * as i16 from "./components/zones/add-zone/selection/selection.component";
18
- import * as i17 from "./components/carousel/carousel.component";
19
- import * as i18 from "./components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component";
20
- import * as i19 from "./components/zones/add-audio-zone/add-audio-zone.component";
21
- import * as i20 from "./radio-button/radio-button.component";
22
- import * as i21 from "./components/plan-legend/plan-legend.component";
23
- import * as i22 from "./pipes/count-audio-sweeps.pipe";
24
- import * as i23 from "ng2-pdf-viewer";
25
- import * as i24 from "@angular/cdk/clipboard";
26
- import * as i25 from "@ng-bootstrap/ng-bootstrap";
27
- import * as i26 from "@angular/common";
28
- import * as i27 from "@ngx-translate/core";
29
- import * as i28 from "@asymmetrik/ngx-leaflet";
30
- import * as i29 from "@angular/forms";
31
- import * as i30 from "@smarterplan/ngx-smarterplan-core";
32
- import * as i31 from "./ngx-smarterplan-location-routing.module";
8
+ import * as i7 from "./components/models3d/models3d.component";
9
+ import * as i8 from "./components/zones/zones.component";
10
+ import * as i9 from "./components/images/images.component";
11
+ import * as i10 from "./components/plans/edit-plan/edit-plan.component";
12
+ import * as i11 from "./components/tab-navigation/tab-navigation.component";
13
+ import * as i12 from "./components/locations/map/map.component";
14
+ import * as i13 from "./components/locations/map/map-popup/map-popup.component";
15
+ import * as i14 from "./components/form-location/form-location.component";
16
+ import * as i15 from "./components/chevron/chevron.component";
17
+ import * as i16 from "./components/zones/add-zone/add-zone.component";
18
+ import * as i17 from "./components/zones/add-zone/selection/selection.component";
19
+ import * as i18 from "./components/carousel/carousel.component";
20
+ import * as i19 from "./components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component";
21
+ import * as i20 from "./components/zones/add-audio-zone/add-audio-zone.component";
22
+ import * as i21 from "./radio-button/radio-button.component";
23
+ import * as i22 from "./components/plan-legend/plan-legend.component";
24
+ import * as i23 from "./pipes/count-audio-sweeps.pipe";
25
+ import * as i24 from "ng2-pdf-viewer";
26
+ import * as i25 from "@angular/cdk/clipboard";
27
+ import * as i26 from "@ng-bootstrap/ng-bootstrap";
28
+ import * as i27 from "@angular/common";
29
+ import * as i28 from "@ngx-translate/core";
30
+ import * as i29 from "@asymmetrik/ngx-leaflet";
31
+ import * as i30 from "@angular/forms";
32
+ import * as i31 from "@smarterplan/ngx-smarterplan-core";
33
+ import * as i32 from "./ngx-smarterplan-location-routing.module";
33
34
  export declare class NgxSmarterplanLocationsModule {
34
35
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSmarterplanLocationsModule, never>;
35
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSmarterplanLocationsModule, [typeof i1.LocationsComponent, typeof i2.DetailLocationComponent, typeof i3.LandmarkPickerComponent, typeof i4.CalibrationComponent, typeof i5.PlansComponent, typeof i6.VisitsComponent, typeof i7.ZonesComponent, typeof i8.ImagesComponent, typeof i9.EditPlanComponent, typeof i10.TabNavigationComponent, typeof i11.MapComponent, typeof i12.MapPopupComponent, typeof i13.FormLocationComponent, typeof i14.ChevronComponent, typeof i15.AddZoneComponent, typeof i16.SelectionComponent, typeof i17.CarouselComponent, typeof i18.SweepPlanSelectionComponent, typeof i19.AddAudioZoneComponent, typeof i20.RadioButtonComponent, typeof i21.PlanLegendComponent, typeof i22.CountAudioSweepsPipe], [typeof i23.PdfViewerModule, typeof i24.ClipboardModule, typeof i25.NgbModule, typeof i25.NgbAlertModule, typeof i26.CommonModule, typeof i27.TranslateModule, typeof i28.LeafletModule, typeof i29.FormsModule, typeof i29.ReactiveFormsModule, typeof i30.NgxSmarterplanCoreModule, typeof i31.LocationsRoutingModule], [typeof i11.MapComponent, typeof i10.TabNavigationComponent]>;
36
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSmarterplanLocationsModule, [typeof i1.LocationsComponent, typeof i2.DetailLocationComponent, typeof i3.LandmarkPickerComponent, typeof i4.CalibrationComponent, typeof i5.PlansComponent, typeof i6.VisitsComponent, typeof i7.Models3dComponent, typeof i8.ZonesComponent, typeof i9.ImagesComponent, typeof i10.EditPlanComponent, typeof i11.TabNavigationComponent, typeof i12.MapComponent, typeof i13.MapPopupComponent, typeof i14.FormLocationComponent, typeof i15.ChevronComponent, typeof i16.AddZoneComponent, typeof i17.SelectionComponent, typeof i18.CarouselComponent, typeof i19.SweepPlanSelectionComponent, typeof i20.AddAudioZoneComponent, typeof i21.RadioButtonComponent, typeof i22.PlanLegendComponent, typeof i23.CountAudioSweepsPipe], [typeof i24.PdfViewerModule, typeof i25.ClipboardModule, typeof i26.NgbModule, typeof i26.NgbAlertModule, typeof i27.CommonModule, typeof i28.TranslateModule, typeof i29.LeafletModule, typeof i30.FormsModule, typeof i30.ReactiveFormsModule, typeof i31.NgxSmarterplanCoreModule, typeof i32.LocationsRoutingModule], [typeof i12.MapComponent, typeof i11.TabNavigationComponent]>;
36
37
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxSmarterplanLocationsModule>;
37
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smarterplan/ngx-smarterplan-locations",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "dependencies": {
5
5
  "tslib": "^2.4.0"
6
6
  },
@@ -11,7 +11,7 @@
11
11
  "@asymmetrik/ngx-leaflet": "^17.0.0",
12
12
  "@ng-bootstrap/ng-bootstrap": "^16.0.0",
13
13
  "@ngx-translate/core": "^17.0.0",
14
- "@smarterplan/ngx-smarterplan-core": "^1.4.15",
14
+ "@smarterplan/ngx-smarterplan-core": "^1.4.17",
15
15
  "leaflet": "^1.9.4",
16
16
  "ng2-pdf-viewer": "^10.0.0",
17
17
  "panzoom": "^9.4.1"