@overmap-ai/core 1.0.60-forms-removal.3 → 1.0.60-forms-removal.5

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.
@@ -1,6 +1,5 @@
1
1
  import { Reducer } from "@reduxjs/toolkit";
2
- import L from "leaflet";
3
- import { ProjectFile, OvermapRootState, OvermapSelector } from "../../typings";
2
+ import { ProjectFile, OvermapRootState, OvermapSelector, MultiPointGeometry } from "../../typings";
4
3
  export interface ProjectFileState {
5
4
  projectFiles: Record<string, ProjectFile>;
6
5
  activeProjectFileId: string | null;
@@ -28,7 +27,7 @@ export declare const projectFileSlice: import("@reduxjs/toolkit").Slice<ProjectF
28
27
  payload: boolean;
29
28
  }) => void;
30
29
  saveActiveProjectFileBounds: (state: import("immer/dist/internal.js").WritableDraft<ProjectFileState>, action: {
31
- payload: [L.LatLngTuple, L.LatLngTuple];
30
+ payload: MultiPointGeometry;
32
31
  }) => void;
33
32
  setActiveProjectFileId: (state: import("immer/dist/internal.js").WritableDraft<ProjectFileState>, action: {
34
33
  payload: string | null;
@@ -44,7 +43,7 @@ export declare const projectFileSlice: import("@reduxjs/toolkit").Slice<ProjectF
44
43
  export declare const addOrReplaceProjectFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProjectFile[], "projectFiles/addOrReplaceProjectFiles">, addOrReplaceProjectFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProjectFile, "projectFiles/addOrReplaceProjectFile">, setProjectFileVisible: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
45
44
  fileId: string;
46
45
  visible: boolean;
47
- }, "projectFiles/setProjectFileVisible">, setIsImportingProjectFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "projectFiles/setIsImportingProjectFile">, setActiveProjectFileId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "projectFiles/setActiveProjectFileId">, saveActiveProjectFileBounds: import("@reduxjs/toolkit").ActionCreatorWithPayload<[L.LatLngTuple, L.LatLngTuple], "projectFiles/saveActiveProjectFileBounds">, removeProjectFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "projectFiles/removeProjectFile">, removeProjectFilesOfProject: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "projectFiles/removeProjectFilesOfProject">, resetProjectFileObjectUrls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"projectFiles/resetProjectFileObjectUrls">;
46
+ }, "projectFiles/setProjectFileVisible">, setIsImportingProjectFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "projectFiles/setIsImportingProjectFile">, setActiveProjectFileId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "projectFiles/setActiveProjectFileId">, saveActiveProjectFileBounds: import("@reduxjs/toolkit").ActionCreatorWithPayload<MultiPointGeometry, "projectFiles/saveActiveProjectFileBounds">, removeProjectFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "projectFiles/removeProjectFile">, removeProjectFilesOfProject: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "projectFiles/removeProjectFilesOfProject">, resetProjectFileObjectUrls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"projectFiles/resetProjectFileObjectUrls">;
48
47
  export declare const selectEnabledProjectFiles: (state: OvermapRootState) => Record<string, boolean | undefined>;
49
48
  export declare const selectProjectFileVisibility: OvermapSelector<Record<string, boolean>>;
50
49
  export declare const selectEnabledProjectFileMapping: (state: OvermapRootState) => Record<string, ProjectFile>;
@@ -1,7 +1,6 @@
1
1
  import { IconModel, Model, OfflineModel } from "./base";
2
- import { Marker } from "./geo";
3
- export interface Asset extends OfflineModel {
4
- marker: Marker | null;
2
+ import { RequiredMarkableModel } from "./geo";
3
+ export interface Asset extends OfflineModel, RequiredMarkableModel {
5
4
  asset_type: string;
6
5
  created_at?: string;
7
6
  label: string | null;
@@ -0,0 +1,10 @@
1
+ export interface CanvasModel {
2
+ canvas_marker_x: number;
3
+ canvas_marker_y: number;
4
+ }
5
+ export interface CanvasBoundedModel {
6
+ canvas_bounds_min_x: number;
7
+ canvas_bounds_min_y: number;
8
+ canvas_bounds_max_x: number;
9
+ canvas_bounds_max_y: number;
10
+ }
@@ -1,7 +1,6 @@
1
1
  import { HTMLInputTypeAttribute } from "react";
2
2
  import { CreatedByModel, OfflineModel, Payload, SubmittedAtModel } from "./base";
3
3
  import { FileWithNameModel } from '../files';
4
- import { Marker } from "./geo";
5
4
  export interface BaseSerializedField<TIdentifier extends FieldTypeIdentifier = FieldTypeIdentifier> extends BaseSerializedObject<TIdentifier> {
6
5
  label: string;
7
6
  required: boolean;
@@ -80,7 +79,7 @@ export interface SerializedUploadField extends BaseSerializedField {
80
79
  export type ISerializedField = SerializedTextField | SerializedBooleanField | SerializedNumberField | SerializedDateField | SerializedStringField | SerializedSelectField | SerializedFieldSection | SerializedMultiStringField | SerializedMultiSelectField | SerializedUploadField | SerializedQrField;
81
80
  export type ISerializedOnlyField = Exclude<ISerializedField, SerializedFieldSection>;
82
81
  /** All the possible field values */
83
- export type FieldValue = string | number | boolean | string[] | File[] | Date | Marker | null;
82
+ export type FieldValue = string | number | boolean | string[] | File[] | Date | null;
84
83
  export type FieldTypeIdentifier = "string" | "text" | "boolean" | "number" | "date" | "select" | "custom" | "section" | "multi-string" | "multi-select" | "upload" | "qr";
85
84
  export interface BaseSerializedObject<TIdentifier extends FieldTypeIdentifier = FieldTypeIdentifier> {
86
85
  description?: string | null;
@@ -1,10 +1,18 @@
1
1
  export type Coordinates = [number, number];
2
- export interface Geometry {
3
- type: string;
2
+ export interface PointGeometry {
3
+ type: "Point";
4
4
  coordinates: Coordinates;
5
5
  }
6
- export interface Marker {
7
- type: "Feature";
8
- geometry: Geometry;
9
- properties: object;
6
+ export interface MultiPointGeometry {
7
+ type: "MultiPoint";
8
+ coordinates: [Coordinates, Coordinates];
9
+ }
10
+ export interface RequiredBoundableModel {
11
+ geo_bounds: MultiPointGeometry;
12
+ }
13
+ export interface RequiredMarkableModel {
14
+ geo_marker: PointGeometry;
15
+ }
16
+ export interface MarkableModel {
17
+ geo_marker?: PointGeometry;
10
18
  }
@@ -2,7 +2,8 @@ export * from "./access";
2
2
  export * from "./attachments";
3
3
  export * from "./base";
4
4
  export * from "./categories";
5
- export * from "./components";
5
+ export * from "./assets";
6
+ export * from "./canvas";
6
7
  export * from "./forms";
7
8
  export * from "./geo";
8
9
  export * from "./issues";
@@ -1,7 +1,7 @@
1
1
  import { CreatedByModel, Offline, OfflineModel } from "./base";
2
2
  import { IssuePriority, IssueStatus } from "../../enums";
3
3
  import { WorkspaceIndexedModel } from "./workspace";
4
- import { Marker } from "./geo";
4
+ import { MarkableModel } from "./geo";
5
5
  import { CreatedUserForm, SubmittedUserForm, UserForm } from "./forms";
6
6
  import { User } from "./users";
7
7
  import { CSSColor } from "../colors";
@@ -27,7 +27,7 @@ export type Stored<TModel> = Created<TModel> | Submitted<TModel>;
27
27
  * Represents the properties you can always expect on any object representing an issue. These are the minimal details
28
28
  * required when creating an issue.
29
29
  */
30
- export interface Issue extends Pick<WorkspaceIndexedModel, "index_workspace"> {
30
+ export interface Issue extends Pick<WorkspaceIndexedModel, "index_workspace">, MarkableModel {
31
31
  title?: string | null;
32
32
  description?: string | null;
33
33
  priority?: IssuePriority;
@@ -36,7 +36,6 @@ export interface Issue extends Pick<WorkspaceIndexedModel, "index_workspace"> {
36
36
  due_date?: string | Date | null;
37
37
  category?: string | null;
38
38
  visible_in_workspaces: string[];
39
- marker?: Marker | null;
40
39
  issue_type?: string | null;
41
40
  }
42
41
  /**
@@ -57,7 +56,7 @@ export interface CreatedIssue extends SubmittedIssue, Pick<WorkspaceIndexedModel
57
56
  assigned_to: Exclude<Issue["assigned_to"], undefined>;
58
57
  due_date: Exclude<Issue["due_date"], undefined>;
59
58
  category: Exclude<Issue["category"], undefined>;
60
- marker: Exclude<Issue["marker"], undefined>;
59
+ geo_marker: Exclude<Issue["geo_marker"], undefined>;
61
60
  created_at: string;
62
61
  }
63
62
  export interface IssueComment extends OfflineModel {
@@ -1,20 +1,18 @@
1
1
  import { Model, OfflineModel } from "./base";
2
- import L from "leaflet";
3
2
  import { FileWithNameModel } from "../files";
4
- export interface Project extends Model {
3
+ import { RequiredBoundableModel } from "./geo";
4
+ export interface Project extends Model, RequiredBoundableModel {
5
5
  id: number;
6
6
  name: string;
7
7
  owner_organization: number | null;
8
8
  owner_user: number | null;
9
- bounds: [L.LatLngTuple, L.LatLngTuple] | undefined;
10
9
  invited?: boolean;
11
10
  issues_count?: number;
12
11
  form_submissions_count?: number;
13
12
  }
14
- export interface ProjectFile extends OfflineModel, FileWithNameModel {
13
+ export interface ProjectFile extends OfflineModel, FileWithNameModel, RequiredBoundableModel {
15
14
  submitted_at: string;
16
15
  z_index: number;
17
- bounds?: [L.LatLngTuple, L.LatLngTuple];
18
16
  project: number;
19
17
  }
20
18
  export type ProjectPayload = Omit<Project, "id" | "file" | "fileBlob">;
@@ -1,20 +1,17 @@
1
1
  import L from "leaflet";
2
- import { Coordinates, Geometry, Marker } from "../typings";
2
+ import { Coordinates, MultiPointGeometry, PointGeometry } from "../typings";
3
3
  export declare const coordinatesToLiteral: (coordinates: Coordinates) => L.LatLngLiteral;
4
4
  export declare const literalToCoordinates: (literal: L.LatLngLiteral) => Coordinates;
5
5
  /**
6
6
  * Flip coordinates from [lng, lat] to [lat, lng]
7
7
  */
8
8
  export declare const flipCoordinates: (coordinates: L.LatLngTuple) => Coordinates;
9
- export declare const markerToCoordinates: (marker: Marker) => Coordinates;
10
9
  export declare function offsetPositionByMeters(originalPosition: L.LatLng, latMeters: number, lngMeters: number): L.LatLngLiteral;
11
- export declare const coordinatesToPointGeometry: (coordinates: Coordinates) => Geometry;
12
- export declare const createPointMarker: (coordinates: Coordinates) => Marker;
10
+ export declare const createPointGeometry: (coordinates: Coordinates) => PointGeometry;
13
11
  export declare const coordinatesAreEqual: (a: Coordinates, b: Coordinates) => boolean;
14
12
  export declare const coordinatesToText: (coordinates: Coordinates | null | undefined, decimalPlaces?: number) => string;
15
13
  export declare const coordinatesToUrlText: (coordinates: Coordinates) => string;
16
- export declare const getMarkerCoordinates: (marker: Marker | null) => Coordinates | undefined;
17
- export declare const markerCoordinatesToText: (marker: Marker | null, decimalPlaces?: number) => string;
18
14
  export declare const openCoordsInGoogleMaps: (coordinates: Coordinates) => void;
19
15
  export declare const openDirectionsInGoogleMaps: (startingPoint: Coordinates, destination: Coordinates) => void;
20
- export declare const worldBounds: [L.LatLngTuple, L.LatLngTuple];
16
+ export declare const worldBounds: MultiPointGeometry;
17
+ export declare const createMultiPointGeometry: (coordinates: [Coordinates, Coordinates]) => MultiPointGeometry;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.60-forms-removal.3",
6
+ "version": "1.0.60-forms-removal.5",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",