andoncloud-map-widget 1.1.7 → 1.1.9

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 (47) hide show
  1. package/dist/index.d.ts +36 -6
  2. package/dist/index.js +839 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/style.css +1077 -0
  5. package/package.json +26 -24
  6. package/dist/assets/map.png +0 -0
  7. package/dist/components/Map/Control/index.d.ts +0 -11
  8. package/dist/components/Map/LayerSettings/index.d.ts +0 -10
  9. package/dist/components/Map/index.d.ts +0 -7
  10. package/dist/components/Map/styles.d.ts +0 -3
  11. package/dist/components/Map/types.d.ts +0 -2
  12. package/dist/components/SettingsFormContent/index.d.ts +0 -5
  13. package/dist/components/SettingsFormContent/styles.d.ts +0 -3
  14. package/dist/components/Widget/index.d.ts +0 -5
  15. package/dist/components/Widget/utils.d.ts +0 -12
  16. package/dist/components/WidgetView/index.d.ts +0 -4
  17. package/dist/components/WidgetView/styles.d.ts +0 -3
  18. package/dist/cypress/support/component.d.ts +0 -9
  19. package/dist/cypress.config.d.ts +0 -2
  20. package/dist/i18n.d.ts +0 -2
  21. package/dist/index.css +0 -2
  22. package/dist/index.css.map +0 -1
  23. package/dist/locales/index.d.ts +0 -25
  24. package/dist/src/components/Map/Control/index.d.ts +0 -11
  25. package/dist/src/components/Map/LayerSettings/LayerSettings.cy.d.ts +0 -1
  26. package/dist/src/components/Map/LayerSettings/index.d.ts +0 -10
  27. package/dist/src/components/Map/Map.cy.d.ts +0 -1
  28. package/dist/src/components/Map/index.d.ts +0 -5
  29. package/dist/src/components/Map/leafletLocale.d.ts +0 -1
  30. package/dist/src/components/Map/styles.d.ts +0 -3
  31. package/dist/src/components/Map/types.d.ts +0 -2
  32. package/dist/src/components/Map/useMap.d.ts +0 -20
  33. package/dist/src/components/Map/utils.d.ts +0 -16
  34. package/dist/src/components/SettingsFormContent/SettingsFormContent.cy.d.ts +0 -1
  35. package/dist/src/components/SettingsFormContent/index.d.ts +0 -5
  36. package/dist/src/components/Widget/index.d.ts +0 -5
  37. package/dist/src/components/Widget/utils.cy.d.ts +0 -1
  38. package/dist/src/components/Widget/utils.d.ts +0 -12
  39. package/dist/src/components/WidgetView/index.d.ts +0 -4
  40. package/dist/src/index.d.ts +0 -6
  41. package/dist/src/locales/index.d.ts +0 -51
  42. package/dist/src/stories/Widget.stories.d.ts +0 -5
  43. package/dist/src/types.d.ts +0 -23
  44. package/dist/src/version.d.ts +0 -1
  45. package/dist/stories/Widget.stories.d.ts +0 -5
  46. package/dist/types.d.ts +0 -23
  47. package/dist/version.d.ts +0 -1
package/package.json CHANGED
@@ -1,25 +1,23 @@
1
1
  {
2
2
  "name": "andoncloud-map-widget",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Made with create-andoncloud-widget",
5
5
  "author": "Adrian Olszewski",
6
6
  "license": "MIT",
7
+ "type": "module",
7
8
  "main": "dist/index.js",
8
- "module": "dist/index.js",
9
- "source": "src/index.tsx",
10
- "engines": {
11
- "node": ">=14"
12
- },
9
+ "types": "dist/index.d.ts",
13
10
  "scripts": {
14
- "build": "library-scripts build --type widget",
15
- "build:watch": "library-scripts build-watch --type widget",
16
- "start:preview": "cd preview && npm run start",
17
- "start": "run-p build:watch start:preview",
18
- "test": "cypress run --component",
11
+ "build": "library-scripts build",
12
+ "build:watch": "library-scripts build-watch",
13
+ "i18n:extract": "i18next src/components/**/*.tsx [-oc]",
19
14
  "lint": "eslint --ext .ts,.tsx --quiet --fix .",
20
15
  "lint:ci": "eslint --ext .ts,.tsx --quiet .",
21
- "i18n:extract": "i18next src/components/**/*.tsx [-oc]",
22
16
  "prepare": "run-s build",
17
+ "prestart": "npm run build",
18
+ "start": "run-p build:watch start:preview",
19
+ "start:preview": "cd preview && npm run start",
20
+ "test": "cypress run --component",
23
21
  "update": "ncu --reject graphql-request -u && npm install --ignore-scripts && cd preview && ncu -u && npm install",
24
22
  "version:bump": "npm version --no-git-tag-version patch"
25
23
  },
@@ -36,38 +34,42 @@
36
34
  "react-i18next": "^12.0.0"
37
35
  },
38
36
  "devDependencies": {
37
+ "@craco/craco": "^7.1.0",
39
38
  "@emotion/react": "^11.14.0",
40
39
  "@emotion/styled": "^11.14.1",
41
40
  "@mui/icons-material": "^7.3.9",
42
41
  "@mui/lab": "^7.0.1-beta.23",
43
42
  "@mui/material": "^7.3.9",
44
43
  "@mui/x-date-pickers": "^8.27.2",
44
+ "@tsdown/css": "^0.21.4",
45
45
  "@types/leaflet": "^1.9.21",
46
46
  "@types/react": "^19.2.14",
47
47
  "@types/style-inject": "^0.3.5",
48
48
  "@types/uuid": "^10.0.0",
49
49
  "actioncable": "^5.2.8",
50
- "andoncloud-dashboard-toolkit": "^1.5.20",
51
- "andoncloud-library-scripts": "^1.0.16",
52
- "andoncloud-sdk": "^1.7.8",
53
- "andoncloud-widget-base": "^1.2.12",
54
- "cypress": "^15.11.0",
55
- "eslint-config-andoncloud": "^1.0.0",
50
+ "ajv": "^8.18.0",
51
+ "andoncloud-dashboard-toolkit": "^1.5.54",
52
+ "andoncloud-library-scripts": "^2.0.0",
53
+ "andoncloud-sdk": "^1.7.25",
54
+ "andoncloud-widget-base": "^1.2.24",
55
+ "cypress": "^15.12.0",
56
+ "eslint-config-andoncloud": "^1.1.0",
56
57
  "graphql-request": "^6.1.0",
57
- "i18next": "^25.8.14",
58
+ "i18next": "^25.10.9",
58
59
  "mobx": "^6.15.0",
59
60
  "mobx-react-lite": "^4.1.1",
60
- "npm-check-updates": "^19.6.3",
61
+ "npm-check-updates": "^19.6.5",
61
62
  "npm-run-all": "^4.1.5",
62
63
  "postcss": "^8.5.8",
63
64
  "react": "^19.2.4",
64
65
  "react-dom": "^19.2.4",
65
- "react-i18next": "^16.5.5",
66
- "react-router-dom": "^7.13.1",
66
+ "react-i18next": "^16.6.5",
67
+ "react-router-dom": "^7.13.2",
67
68
  "react-scripts": "^5.0.1",
68
- "sass": "^1.97.3",
69
+ "sass": "^1.98.0",
69
70
  "style-inject": "^0.3.0",
70
- "typescript": "^5.9.3",
71
+ "tsdown": "^0.21.4",
72
+ "typescript": "~5.9.3",
71
73
  "webpack-dev-server": "^5.2.3"
72
74
  },
73
75
  "files": [
Binary file
@@ -1,11 +0,0 @@
1
- import React, { JSX } from 'react';
2
- import L from 'leaflet';
3
- interface Props {
4
- mapRef: React.RefObject<L.Map | null>;
5
- position: L.ControlPosition;
6
- children?: React.ReactNode;
7
- container?: React.HTMLAttributes<HTMLDivElement>;
8
- prepend?: boolean;
9
- }
10
- declare const Control: (props: Props) => JSX.Element;
11
- export default Control;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { WidgetViewData } from '@/types';
3
- import { ShapeLayer } from '../types';
4
- interface LayerSettingsProps {
5
- data: WidgetViewData;
6
- layer: ShapeLayer;
7
- updateFeature: (feature: GeoJSON.Feature) => Promise<void>;
8
- }
9
- export declare const LayerSettings: React.FC<LayerSettingsProps>;
10
- export {};
@@ -1,7 +0,0 @@
1
- import 'leaflet-contextmenu';
2
- import 'leaflet-contextmenu/dist/leaflet.contextmenu.css';
3
- import 'leaflet-path-drag';
4
- import React from 'react';
5
- import { MapProps } from '@/types';
6
- declare const Map: React.FC<MapProps>;
7
- export default Map;
@@ -1,3 +0,0 @@
1
- import { SxProps, Theme } from '@mui/material/styles';
2
- declare const styles: Record<string, SxProps<Theme>>;
3
- export default styles;
@@ -1,2 +0,0 @@
1
- import { Polygon } from 'leaflet';
2
- export type ShapeLayer = Polygon;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { SettingsFormContentProps } from 'andoncloud-widget-base';
3
- import { WidgetData, WidgetSettings } from '@/types';
4
- declare const SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>>;
5
- export default SettingsFormContent;
@@ -1,3 +0,0 @@
1
- import { SxProps, Theme } from '@mui/material/styles';
2
- declare const styles: Record<string, SxProps<Theme>>;
3
- export default styles;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { WidgetProps } from 'andoncloud-dashboard-toolkit';
3
- import { WidgetData, WidgetSettings } from '@/types';
4
- declare const Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>>;
5
- export default Widget;
@@ -1,12 +0,0 @@
1
- import { TFunction } from 'i18next';
2
- import * as yup from 'yup';
3
- export declare const getSettingsFormProps: (t: TFunction) => {
4
- initialValues: {
5
- floorPlanId: string;
6
- };
7
- validationSchema: yup.ObjectSchema<{
8
- floorPlanId: string;
9
- }, yup.AnyObject, {
10
- floorPlanId: undefined;
11
- }, "">;
12
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { WidgetViewProps } from '@/types';
3
- declare const WidgetView: React.FC<WidgetViewProps>;
4
- export default WidgetView;
@@ -1,3 +0,0 @@
1
- import { SxProps, Theme } from '@mui/material/styles';
2
- declare const styles: Record<string, SxProps<Theme>>;
3
- export default styles;
@@ -1,9 +0,0 @@
1
- import { mount } from 'cypress/react';
2
- declare global {
3
- namespace Cypress {
4
- interface Chainable {
5
- mount: typeof mount;
6
- getByTestId(selector: string, options?: Partial<Cypress.Loggable & Cypress.Timeoutable & Cypress.Withinable & Cypress.Shadow>): Cypress.Chainable<JQuery<HTMLElement>>;
7
- }
8
- }
9
- }
@@ -1,2 +0,0 @@
1
- declare const _default: Cypress.ConfigOptions<any>;
2
- export default _default;
package/dist/i18n.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const i18n: any;
2
- export default i18n;
package/dist/index.css DELETED
@@ -1,2 +0,0 @@
1
- @import "~leaflet/dist/leaflet.css";@import "~leaflet-draw/dist/leaflet.draw.css";@keyframes pulse{0%{stroke:#155ed1}70%{stroke:transparent}to{stroke:#155ed1}}.leaflet-container{background:#e0e0e0;height:100%}.leaflet-touch .leaflet-bar{border:none}.leaflet-bar a{background-color:hsla(0,0%,100%,.75);color:#464646;line-height:27px!important}.leaflet-bar a.leaflet-disabled{filter:opacity(.2)}.leaflet-bar a:not(.leaflet-disabled):hover{background-color:hsla(0,0%,100%,.75);filter:opacity(.8)}.leaflet-top{background:rgba(72,74,78,.95);border-bottom:1px solid #717171;display:flex;height:50px;width:50%}.leaflet-right{display:inline-flex;justify-content:flex-end}.leaflet-control-attribution.leaflet-control{display:none}.leaflet-draw{background:rgba(72,74,78,.95);height:100vh}.leaflet-draw.leaflet-control{margin:50px 0 0;padding:10px}.leaflet-draw-actions a{background-color:hsla(0,0%,100%,.85);color:#464646;line-height:27px!important}.leaflet-draw-actions a:hover{background-color:hsla(0,0%,100%,.85);filter:opacity(.8)}.leaflet-control-zoom{display:inline-flex}.leaflet-control-zoom-in,.leaflet-control-zoom-out{border-radius:2px!important}.leaflet-control-zoom-out{margin-left:2px}.leaflet-tooltip{background:transparent;border:none;box-shadow:none;color:#fff;font-weight:600;padding:.5em 1em;text-shadow:0 0 6px #000}.leaflet-path-draggable{stroke-dasharray:10;animation:pulse 2s infinite}.leaflet-popup-content-wrapper{background:rgba(14,16,19,.95);box-shadow:0 0 6px #e0e0e0;color:#e0e0e0;font-weight:600}.leaflet-popup-content-wrapper .leaflet-popup-content p{margin:.5rem 0}.leaflet-popup-tip{background:rgba(51,51,51,.95);box-shadow:0 0 6px #fff}.leaflet-contextmenu{background-color:#fff;border-radius:4px;box-shadow:0 1px 7px rgba(0,0,0,.4);cursor:default;display:none;padding:4px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-contextmenu a.leaflet-contextmenu-item{border-bottom:1px solid transparent;border-top:1px solid transparent;color:#222;cursor:default;display:block;font-size:12px;line-height:20px;outline:none;padding:0 12px;text-decoration:none}.leaflet-contextmenu a.leaflet-contextmenu-item-disabled{opacity:.5}.leaflet-contextmenu a.leaflet-contextmenu-item.over{background-color:#f4f4f4;border-bottom:1px solid #f0f0f0;border-top:1px solid #f0f0f0}.leaflet-contextmenu a.leaflet-contextmenu-item-disabled.over{background-color:inherit;border-bottom:1px solid transparent;border-top:1px solid transparent}.leaflet-contextmenu-icon{border:0;float:left;height:16px;margin:2px 8px 0 0;width:16px}.leaflet-contextmenu-separator{border-bottom:1px solid #ccc;margin:5px 0}
2
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.css","leaflet.contextmenu.css"],"names":[],"mappings":"AAAA,mCAAmC,CACnC,6CAA6C,CAE7C,iBACE,GACE,cACF,CAEA,IACE,kBACF,CAEA,GACE,cACF,CACF,CAEA,mBAEE,kBAAmB,CADnB,WAEF,CAEA,4BACE,WACF,CAEA,eAGE,oCAA2C,CAD3C,aAAc,CADd,0BAGF,CAEA,gCACE,kBACF,CAEA,4CAEE,oCAA2C,CAD3C,kBAEF,CAEA,aAKE,6BAAkC,CADlC,+BAAgC,CAHhC,YAAa,CAEb,WAAY,CADZ,SAIF,CAEA,eACE,mBAAoB,CACpB,wBACF,CAEA,6CACE,YACF,CAEA,cAEE,6BAAkC,CADlC,YAEF,CAEA,8BAEE,eAAgB,CAChB,YACF,CAEA,wBAGE,oCAA2C,CAD3C,aAAc,CADd,0BAGF,CAEA,8BAEE,oCAA2C,CAD3C,kBAEF,CAEA,sBACE,mBACF,CAMA,mDAHE,2BAMF,CAHA,0BACE,eAEF,CAEA,iBAOE,sBAAuB,CADvB,WAAY,CAFZ,eAAgB,CADhB,UAAY,CADZ,eAAgB,CADhB,gBAAkB,CAIlB,wBAGF,CAEA,wBACE,mBAAoB,CACpB,2BACF,CAEA,+BAIE,6BAAkC,CADlC,0BAA+B,CAF/B,aAAc,CACd,eAGF,CAEA,wDACE,cACF,CAEA,mBAEE,6BAAkC,CADlC,uBAEF,CC1HA,qBAMI,qBAAsB,CAFtB,iBAAkB,CAFlB,mCAAqC,CAKrC,cAAe,CANf,YAAa,CAIb,aAAc,CAGd,wBAAyB,CACzB,qBAAsB,CACtB,gBACJ,CAEA,gDAQI,mCAAoC,CADpC,gCAAiC,CALjC,UAAW,CAOX,cAAe,CARf,aAAc,CAEd,cAAe,CACf,gBAAiB,CAMjB,YAAa,CAJb,cAAe,CADf,oBAMJ,CAEA,yDACI,UACJ,CAEA,qDACI,wBAAyB,CAEzB,+BAAgC,CADhC,4BAEJ,CAEA,8DACI,wBAAyB,CAEzB,mCAAoC,CADpC,gCAEJ,CAEA,0BAKI,QAAS,CADT,UAAW,CADX,WAAY,CAFZ,kBAAmB,CACnB,UAIJ,CAEA,+BACI,4BAA6B,CAC7B,YACJ","file":"index.css","sourcesContent":["@import '~leaflet/dist/leaflet.css';\n@import '~leaflet-draw/dist/leaflet.draw.css';\n\n@keyframes pulse {\n 0% {\n stroke: #155ed1;\n }\n\n 70% {\n stroke: transparent;\n }\n\n 100% {\n stroke: #155ed1;\n }\n}\n\n.leaflet-container {\n height: 100%;\n background: #e0e0e0;\n}\n\n.leaflet-touch .leaflet-bar {\n border: none;\n}\n\n.leaflet-bar a {\n line-height: 27px !important;\n color: #464646;\n background-color: rgba(255, 255, 255, 0.75);\n}\n\n.leaflet-bar a.leaflet-disabled {\n filter: opacity(0.2);\n}\n\n.leaflet-bar a:not(.leaflet-disabled):hover {\n filter: opacity(0.8);\n background-color: rgba(255, 255, 255, 0.75);\n}\n\n.leaflet-top {\n display: flex;\n width: 50%;\n height: 50px;\n border-bottom: 1px solid #717171;\n background: rgba(72, 74, 78, 0.95);\n}\n\n.leaflet-right {\n display: inline-flex;\n justify-content: flex-end;\n}\n\n.leaflet-control-attribution.leaflet-control {\n display: none;\n}\n\n.leaflet-draw {\n height: 100vh;\n background: rgba(72, 74, 78, 0.95);\n}\n\n.leaflet-draw.leaflet-control {\n margin: 0;\n margin-top: 50px;\n padding: 10px;\n}\n\n.leaflet-draw-actions a {\n line-height: 27px !important;\n color: #464646;\n background-color: rgba(255, 255, 255, 0.85);\n}\n\n.leaflet-draw-actions a:hover {\n filter: opacity(0.8);\n background-color: rgba(255, 255, 255, 0.85);\n}\n\n.leaflet-control-zoom {\n display: inline-flex;\n}\n\n.leaflet-control-zoom-in {\n border-radius: 2px !important;\n}\n\n.leaflet-control-zoom-out {\n margin-left: 2px;\n border-radius: 2px !important;\n}\n\n.leaflet-tooltip {\n padding: 0.5em 1em;\n font-weight: 600;\n color: white;\n box-shadow: none;\n text-shadow: 0px 0px 6px rgba(0, 0, 0, 1);\n border: none;\n background: transparent;\n}\n\n.leaflet-path-draggable {\n stroke-dasharray: 10;\n animation: pulse 2s infinite;\n}\n\n.leaflet-popup-content-wrapper {\n color: #e0e0e0;\n font-weight: 600;\n box-shadow: #e0e0e0 0px 0px 6px;\n background: rgba(14, 16, 19, 0.95);\n}\n\n.leaflet-popup-content-wrapper .leaflet-popup-content p {\n margin: 0.5rem 0;\n}\n\n.leaflet-popup-tip {\n box-shadow: #ffffff 0px 0px 6px;\n background: rgba(51, 51, 51, 0.95);\n}\n",".leaflet-contextmenu {\n display: none;\n box-shadow: 0 1px 7px rgba(0,0,0,0.4);\n -webkit-border-radius: 4px;\n border-radius: 4px;\n padding: 4px 0;\n background-color: #fff;\n cursor: default;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.leaflet-contextmenu a.leaflet-contextmenu-item {\n display: block;\n color: #222;\n font-size: 12px;\n line-height: 20px;\n text-decoration: none;\n padding: 0 12px;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n cursor: default;\n outline: none;\n}\n\n.leaflet-contextmenu a.leaflet-contextmenu-item-disabled {\n opacity: 0.5;\n}\n\n.leaflet-contextmenu a.leaflet-contextmenu-item.over {\n background-color: #f4f4f4;\n border-top: 1px solid #f0f0f0;\n border-bottom: 1px solid #f0f0f0;\n}\n\n.leaflet-contextmenu a.leaflet-contextmenu-item-disabled.over {\n background-color: inherit;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n}\n\n.leaflet-contextmenu-icon {\n margin: 2px 8px 0 0;\n width: 16px;\n height: 16px;\n float: left;\n border: 0;\n}\n\n.leaflet-contextmenu-separator {\n border-bottom: 1px solid #ccc;\n margin: 5px 0;\n}\n"]}
@@ -1,25 +0,0 @@
1
- declare const resources: {
2
- en: {
3
- translation: {
4
- Duplicate: string;
5
- "Area settings": string;
6
- Workplace: string;
7
- Freeze: string;
8
- "Floor plan": string;
9
- "Order number": string;
10
- "Product number": string;
11
- };
12
- };
13
- pl: {
14
- translation: {
15
- Duplicate: string;
16
- "Area settings": string;
17
- Workplace: string;
18
- Freeze: string;
19
- "Floor plan": string;
20
- "Order number": string;
21
- "Product number": string;
22
- };
23
- };
24
- };
25
- export default resources;
@@ -1,11 +0,0 @@
1
- import React, { JSX } from 'react';
2
- import L from 'leaflet';
3
- interface Props {
4
- mapRef: React.RefObject<L.Map | null>;
5
- position: L.ControlPosition;
6
- children?: React.ReactNode;
7
- container?: React.HTMLAttributes<HTMLDivElement>;
8
- prepend?: boolean;
9
- }
10
- declare const Control: (props: Props) => JSX.Element;
11
- export default Control;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { WidgetViewData } from '@/types';
3
- import { ShapeLayer } from '../types';
4
- interface LayerSettingsProps {
5
- data: WidgetViewData;
6
- layer: ShapeLayer;
7
- updateFeature: (feature: GeoJSON.Feature) => Promise<void>;
8
- }
9
- export declare const LayerSettings: React.FC<LayerSettingsProps>;
10
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import 'leaflet-contextmenu/dist/leaflet.contextmenu.css';
2
- import React from 'react';
3
- import { MapProps } from '@/types';
4
- declare const Map: React.FC<MapProps>;
5
- export default Map;
@@ -1 +0,0 @@
1
- export declare const setLeafletLocale: (t: (key: string) => string) => void;
@@ -1,3 +0,0 @@
1
- import { SxProps, Theme } from '@mui/material/styles';
2
- declare const styles: Record<string, SxProps<Theme>>;
3
- export default styles;
@@ -1,2 +0,0 @@
1
- import { Polygon } from 'leaflet';
2
- export type ShapeLayer = Polygon;
@@ -1,20 +0,0 @@
1
- import 'leaflet-contextmenu';
2
- import 'leaflet-path-drag';
3
- import React from 'react';
4
- import { Dimensions } from 'react-image-size';
5
- import L from 'leaflet';
6
- import { MapProps } from '@/types';
7
- import { ShapeLayer } from './types';
8
- declare const useMap: ({ data, settings, updateSettings, updateSidePanelProps, editMode }: MapProps) => {
9
- containerRef: React.RefObject<null>;
10
- mapRef: React.RefObject<L.Map | null>;
11
- imageUrl: string | undefined;
12
- imageDimensions: Dimensions | null;
13
- viewChanged: boolean;
14
- onFeatureGroupReady: (_featureGroup: L.FeatureGroup) => void;
15
- onDrawCreatedRef: React.RefObject<((layer: ShapeLayer) => Promise<void>) | null>;
16
- onDrawEditedRef: React.RefObject<((layers: ShapeLayer[]) => Promise<void>) | null>;
17
- onDrawDeletedRef: React.RefObject<((layers: ShapeLayer[]) => Promise<void>) | null>;
18
- saveMapView: () => Promise<void>;
19
- };
20
- export default useMap;
@@ -1,16 +0,0 @@
1
- import { AndonLightColor } from 'andoncloud-dashboard-toolkit';
2
- import L, { Content } from 'leaflet';
3
- import { Dimensions } from 'react-image-size';
4
- import { ShapeLayer } from './types';
5
- export declare const DEFAULT_STYLE: {
6
- fillColor: string;
7
- fillOpacity: number;
8
- color: string;
9
- };
10
- export declare const mapStatusColorToHex: (color: AndonLightColor) => string;
11
- export declare const calcImageBounds: (map: L.Map, imageDimensions: Dimensions) => L.LatLngBounds;
12
- export declare const makeDraggable: (layer: ShapeLayer) => void;
13
- export declare const setInitialStyles: (layer: ShapeLayer) => void;
14
- export declare const bindTooltip: (content: Content, layer: ShapeLayer) => void;
15
- export declare const centerTooltip: (layer: ShapeLayer) => void;
16
- export declare const offsetLatLngs: (latLngs: L.LatLng[][] | L.LatLng[]) => L.LatLng[][] | L.LatLng[];
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { SettingsFormContentProps } from 'andoncloud-widget-base';
3
- import { WidgetData, WidgetSettings } from '@/types';
4
- declare const SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>>;
5
- export default SettingsFormContent;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { WidgetProps } from 'andoncloud-dashboard-toolkit';
3
- import { WidgetData, WidgetSettings } from '@/types';
4
- declare const Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>>;
5
- export default Widget;
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { TFunction } from 'i18next';
2
- import * as yup from 'yup';
3
- export declare const getSettingsFormProps: (t: TFunction) => {
4
- initialValues: {
5
- floorPlanId: string;
6
- };
7
- validationSchema: yup.ObjectSchema<{
8
- floorPlanId: string;
9
- }, yup.AnyObject, {
10
- floorPlanId: undefined;
11
- }, "">;
12
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { WidgetViewProps } from '@/types';
3
- declare const WidgetView: React.FC<WidgetViewProps>;
4
- export default WidgetView;
@@ -1,6 +0,0 @@
1
- import './index.css';
2
- export { default as Widget } from './components/Widget';
3
- export declare const getDisplayName: (lang: "en" | "pl") => "Map" | "Mapa" | "map-widget";
4
- export declare const requiredFeatures: string[];
5
- export declare const extraPermissions: string[];
6
- export { LIBRARY_VERSION as version } from './version';
@@ -1,51 +0,0 @@
1
- declare const resources: {
2
- en: {
3
- translation: {
4
- Duplicate: string;
5
- "Area settings": string;
6
- Workplace: string;
7
- Freeze: string;
8
- "Floor plan": string;
9
- "Order number": string;
10
- "Product number": string;
11
- "leaflet.draw.toolbar.actions.text": string;
12
- "leaflet.draw.toolbar.finish.text": string;
13
- "leaflet.draw.toolbar.undo.text": string;
14
- "leaflet.draw.handlers.polygon.tooltip.start": string;
15
- "leaflet.draw.handlers.polygon.tooltip.cont": string;
16
- "leaflet.draw.handlers.polygon.tooltip.end": string;
17
- "leaflet.edit.toolbar.actions.save.text": string;
18
- "leaflet.edit.toolbar.actions.cancel.text": string;
19
- "leaflet.edit.toolbar.actions.clearAll.text": string;
20
- "leaflet.edit.toolbar.buttons.edit": string;
21
- "leaflet.edit.toolbar.buttons.editDisabled": string;
22
- "leaflet.edit.toolbar.buttons.remove": string;
23
- "leaflet.edit.toolbar.buttons.removeDisabled": string;
24
- };
25
- };
26
- pl: {
27
- translation: {
28
- Duplicate: string;
29
- "Area settings": string;
30
- Workplace: string;
31
- Freeze: string;
32
- "Floor plan": string;
33
- "Order number": string;
34
- "Product number": string;
35
- "leaflet.draw.toolbar.actions.text": string;
36
- "leaflet.draw.toolbar.finish.text": string;
37
- "leaflet.draw.toolbar.undo.text": string;
38
- "leaflet.draw.handlers.polygon.tooltip.start": string;
39
- "leaflet.draw.handlers.polygon.tooltip.cont": string;
40
- "leaflet.draw.handlers.polygon.tooltip.end": string;
41
- "leaflet.edit.toolbar.actions.save.text": string;
42
- "leaflet.edit.toolbar.actions.cancel.text": string;
43
- "leaflet.edit.toolbar.actions.clearAll.text": string;
44
- "leaflet.edit.toolbar.buttons.edit": string;
45
- "leaflet.edit.toolbar.buttons.editDisabled": string;
46
- "leaflet.edit.toolbar.buttons.remove": string;
47
- "leaflet.edit.toolbar.buttons.removeDisabled": string;
48
- };
49
- };
50
- };
51
- export default resources;
@@ -1,5 +0,0 @@
1
- import { ComponentMeta } from '@storybook/react';
2
- import Widget from '../components/Widget';
3
- declare const _default: ComponentMeta<typeof Widget>;
4
- export default _default;
5
- export declare const Default: any;
@@ -1,23 +0,0 @@
1
- import type { BaseWidgetData, BaseWidgetSettings, FloorPlan, ListStatusChanges_StatusChange, ListWorkplaces_Workplace } from 'andoncloud-dashboard-toolkit';
2
- import { BaseWidgetViewProps } from 'andoncloud-widget-base';
3
- import { LatLng } from 'leaflet';
4
- export interface WidgetViewData {
5
- workplaces: ListWorkplaces_Workplace[];
6
- statusChanges: ListStatusChanges_StatusChange[];
7
- }
8
- interface WidgetSettingsData {
9
- floorPlans: FloorPlan[];
10
- }
11
- export interface WidgetData extends BaseWidgetData, WidgetViewData, WidgetSettingsData {
12
- }
13
- export interface WidgetSettings extends BaseWidgetSettings {
14
- floorPlanId: string;
15
- center: LatLng;
16
- zoom: number;
17
- features: GeoJSON.Feature[];
18
- }
19
- export interface WidgetViewProps extends BaseWidgetViewProps<WidgetData, WidgetSettings> {
20
- }
21
- export interface MapProps extends WidgetViewProps {
22
- }
23
- export {};
@@ -1 +0,0 @@
1
- export declare const LIBRARY_VERSION = "1.1.7";
@@ -1,5 +0,0 @@
1
- import { ComponentMeta } from '@storybook/react';
2
- import Widget from '../components/Widget';
3
- declare const _default: ComponentMeta<typeof Widget>;
4
- export default _default;
5
- export declare const Default: any;
package/dist/types.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { BaseWidgetData, BaseWidgetSettings, FloorPlan, ListStatusChanges_StatusChange, ListWorkplaces_Workplace } from 'andoncloud-dashboard-toolkit';
2
- import { BaseWidgetViewProps } from 'andoncloud-widget-base';
3
- import { LatLng } from 'leaflet';
4
- export interface WidgetViewData {
5
- workplaces: ListWorkplaces_Workplace[];
6
- statusChanges: ListStatusChanges_StatusChange[];
7
- }
8
- interface WidgetSettingsData {
9
- floorPlans: FloorPlan[];
10
- }
11
- export interface WidgetData extends BaseWidgetData, WidgetViewData, WidgetSettingsData {
12
- }
13
- export interface WidgetSettings extends BaseWidgetSettings {
14
- floorPlanId: string;
15
- center: LatLng;
16
- zoom: number;
17
- features: GeoJSON.Feature[];
18
- }
19
- export interface WidgetViewProps extends BaseWidgetViewProps<WidgetData, WidgetSettings> {
20
- }
21
- export interface MapProps extends WidgetViewProps {
22
- }
23
- export {};
package/dist/version.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const LIBRARY_VERSION = "1.1.6";