@brikka/locations 1.0.11 → 1.0.13

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.cjs CHANGED
@@ -1,39 +1,37 @@
1
1
  'use strict';
2
2
 
3
+ var jsxRuntime = require('@soperio/jsx-runtime');
3
4
  var admin = require('@compill/admin');
4
5
  var form = require('@compill/form');
5
6
  var formMaps = require('@compill/form-maps');
6
7
  var hooks = require('@compill/hooks');
7
8
  var js = require('@mdi/js');
8
9
  var Yup = require('yup');
9
- var jsxRuntime = require('@soperio/jsx-runtime');
10
10
  var components = require('@compill/components');
11
11
  var next = require('@compill/next');
12
12
  var ui = require('@valerya/ui');
13
13
  var layout = require('@brikka/layout');
14
14
 
15
- function _interopNamespace(e) {
16
- if (e && e.__esModule) return e;
17
- var n = Object.create(null);
18
- if (e) {
19
- Object.keys(e).forEach(function (k) {
20
- if (k !== 'default') {
21
- var d = Object.getOwnPropertyDescriptor(e, k);
22
- Object.defineProperty(n, k, d.get ? d : {
23
- enumerable: true,
24
- get: function () { return e[k]; }
15
+ function _interopNamespaceDefault(e) {
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
25
26
  });
26
- }
27
- });
28
- }
29
- n.default = e;
30
- return Object.freeze(n);
27
+ }
28
+ n.default = e;
29
+ return Object.freeze(n);
31
30
  }
32
31
 
33
- var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
32
+ var Yup__namespace = /*#__PURE__*/_interopNamespaceDefault(Yup);
34
33
 
35
- // src/lib/AddLocationButton.tsx
36
- var editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
34
+ const editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
37
35
  formMaps.mapsHelper("location", `Search a ${locationTypeLabel}`, lat, lng, mapZoom),
38
36
  form.FormHelper.condition("location", (location) => location != null && Object.keys(location).length > 0, form.FormHelper.array(
39
37
  form.FormHelper.divider(),
@@ -41,11 +39,11 @@ var editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
41
39
  form.FormHelper.input("map.addressStreet", "Address", false, void 0, { disabled: true })
42
40
  ))
43
41
  );
44
- var editInitialValues = () => ({
42
+ const editInitialValues = () => ({
45
43
  type: "google",
46
44
  location: {}
47
45
  });
48
- var editSchema = Yup__namespace.object().shape({
46
+ const editSchema = Yup__namespace.object().shape({
49
47
  // name: Yup.string().required("Please set a name for your organisation"),
50
48
  // type: Yup.string().required("Please select a type"),
51
49
  });
@@ -75,6 +73,7 @@ function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel = "locati
75
73
  )
76
74
  ] });
77
75
  }
76
+
78
77
  function SidebarMapsCard({ title, location }) {
79
78
  const copy = hooks.useCopyToClipboard(location?.address ?? location?.name ?? "", "Address copied!");
80
79
  const googleMapsLink = `https://www.google.com/maps/search/?api=1&query=${location?.lat},${location?.lng}`;
package/dist/index.d.ts CHANGED
@@ -1,21 +1,2 @@
1
- import { ButtonBarButtonProps } from '@compill/admin';
2
- import { API } from '@compill/api';
3
- import { Location } from '@compill/models';
4
-
5
- interface NewLocationButtonProps extends ButtonBarButtonProps {
6
- api: API<Location>;
7
- lat: number;
8
- lng: number;
9
- mapZoom: number;
10
- locationTypeLabel?: string;
11
- }
12
- declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
13
-
14
- interface SidebarMapsCardProps {
15
- location?: Location;
16
- }
17
- declare function SidebarMapsCard({ title, location }: {
18
- title?: string;
19
- } & SidebarMapsCardProps): JSX.Element | null;
20
-
21
- export { NewLocationButton, type NewLocationButtonProps, SidebarMapsCard };
1
+ export * from "./lib/AddLocationButton";
2
+ export * from "./lib/SidebarMapsCard";
package/dist/index.js CHANGED
@@ -1,17 +1,16 @@
1
+ import { jsxs, Fragment, jsx } from '@soperio/jsx-runtime';
1
2
  import { ButtonBarButton, ItemEditDialog } from '@compill/admin';
2
3
  import { FormHelper } from '@compill/form';
3
4
  import { mapsHelper } from '@compill/form-maps';
4
5
  import { useModal, useCopyToClipboard } from '@compill/hooks';
5
6
  import { mdiPlus, mdiMapMarker, mdiContentCopy } from '@mdi/js';
6
7
  import * as Yup from 'yup';
7
- import { jsxs, Fragment, jsx } from '@soperio/jsx-runtime';
8
8
  import { FlexCenter } from '@compill/components';
9
9
  import { NextImageFill } from '@compill/next';
10
10
  import { IconButton } from '@valerya/ui';
11
11
  import { SidebarCard } from '@brikka/layout';
12
12
 
13
- // src/lib/AddLocationButton.tsx
14
- var editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
13
+ const editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
15
14
  mapsHelper("location", `Search a ${locationTypeLabel}`, lat, lng, mapZoom),
16
15
  FormHelper.condition("location", (location) => location != null && Object.keys(location).length > 0, FormHelper.array(
17
16
  FormHelper.divider(),
@@ -19,11 +18,11 @@ var editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
19
18
  FormHelper.input("map.addressStreet", "Address", false, void 0, { disabled: true })
20
19
  ))
21
20
  );
22
- var editInitialValues = () => ({
21
+ const editInitialValues = () => ({
23
22
  type: "google",
24
23
  location: {}
25
24
  });
26
- var editSchema = Yup.object().shape({
25
+ const editSchema = Yup.object().shape({
27
26
  // name: Yup.string().required("Please set a name for your organisation"),
28
27
  // type: Yup.string().required("Please select a type"),
29
28
  });
@@ -53,6 +52,7 @@ function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel = "locati
53
52
  )
54
53
  ] });
55
54
  }
55
+
56
56
  function SidebarMapsCard({ title, location }) {
57
57
  const copy = useCopyToClipboard(location?.address ?? location?.name ?? "", "Address copied!");
58
58
  const googleMapsLink = `https://www.google.com/maps/search/?api=1&query=${location?.lat},${location?.lng}`;
@@ -0,0 +1,11 @@
1
+ import { ButtonBarButtonProps } from "@compill/admin";
2
+ import { API } from "@compill/api";
3
+ import { Location } from "@compill/models";
4
+ export interface NewLocationButtonProps extends ButtonBarButtonProps {
5
+ api: API<Location>;
6
+ lat: number;
7
+ lng: number;
8
+ mapZoom: number;
9
+ locationTypeLabel?: string;
10
+ }
11
+ export declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Location } from "@compill/models";
2
+ interface SidebarMapsCardProps {
3
+ location?: Location;
4
+ }
5
+ export declare function SidebarMapsCard({ title, location }: {
6
+ title?: string;
7
+ } & SidebarMapsCardProps): JSX.Element | null;
8
+ export {};
package/package.json CHANGED
@@ -1,19 +1,11 @@
1
1
  {
2
2
  "name": "@brikka/locations",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
- "type": "module",
7
- "main": "./dist/index.cjs",
8
- "module": "./dist/index.js",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
9
8
  "types": "./dist/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.cjs"
15
- }
16
- },
17
9
  "devDependencies": {
18
10
  "eslint": "^9.38.0",
19
11
  "typescript": "5.9.2",
@@ -28,19 +20,19 @@
28
20
  "dependencies": {
29
21
  "@mdi/js": "^7.4.47",
30
22
  "yup": "^1.1.0",
31
- "@soperio/react": "1.0.20",
32
- "@valerya/ui": "1.0.20",
33
- "@compill/api": "1.0.61",
34
- "@brikka/layout": "1.0.84",
35
- "@compill/components": "1.0.54",
36
- "@compill/form": "1.0.71",
37
- "@soperio/jsx-runtime": "1.0.20",
38
- "@compill/auth": "1.0.81",
39
- "@compill/admin": "1.0.106",
40
- "@compill/hooks": "1.0.47",
41
- "@compill/next": "1.0.62",
42
- "@compill/form-maps": "1.0.18",
43
- "@compill/models": "1.0.16"
23
+ "@soperio/jsx-runtime": "1.0.24",
24
+ "@brikka/layout": "1.0.87",
25
+ "@compill/admin": "1.0.109",
26
+ "@soperio/react": "1.0.24",
27
+ "@valerya/ui": "1.0.27",
28
+ "@compill/auth": "1.0.84",
29
+ "@compill/components": "1.0.57",
30
+ "@compill/api": "1.0.64",
31
+ "@compill/form": "1.0.74",
32
+ "@compill/form-maps": "1.0.21",
33
+ "@compill/hooks": "1.0.50",
34
+ "@compill/next": "1.0.64",
35
+ "@compill/models": "1.0.19"
44
36
  },
45
37
  "publishConfig": {
46
38
  "access": "public"
@@ -49,7 +41,7 @@
49
41
  "dist"
50
42
  ],
51
43
  "scripts": {
52
- "build": "tsup src/index.ts --format esm,cjs --dts --clean",
44
+ "build": "rimraf dist && rollup -c && tsc -p tsconfig.build.json",
53
45
  "dev": "tsup src/index.ts --format esm --dts --watch",
54
46
  "lint": "eslint . --max-warnings 0",
55
47
  "check-types": "tsc --noEmit"
package/dist/index.d.cts DELETED
@@ -1,21 +0,0 @@
1
- import { ButtonBarButtonProps } from '@compill/admin';
2
- import { API } from '@compill/api';
3
- import { Location } from '@compill/models';
4
-
5
- interface NewLocationButtonProps extends ButtonBarButtonProps {
6
- api: API<Location>;
7
- lat: number;
8
- lng: number;
9
- mapZoom: number;
10
- locationTypeLabel?: string;
11
- }
12
- declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
13
-
14
- interface SidebarMapsCardProps {
15
- location?: Location;
16
- }
17
- declare function SidebarMapsCard({ title, location }: {
18
- title?: string;
19
- } & SidebarMapsCardProps): JSX.Element | null;
20
-
21
- export { NewLocationButton, type NewLocationButtonProps, SidebarMapsCard };