@object-ui/plugin-map 3.3.0 → 3.3.1

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-map",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Map visualization plugin for Object UI",
7
- "homepage": "https://www.objectui.org",
7
+ "homepage": "https://www.objectui.org/docs/plugins/plugin-map",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/objectstack-ai/objectui.git",
10
+ "url": "git+https://github.com/objectstack-ai/objectui.git",
11
11
  "directory": "packages/plugin-map"
12
12
  },
13
13
  "bugs": {
@@ -24,15 +24,15 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@objectstack/spec": "^4.0.3",
27
+ "@objectstack/spec": "^4.0.4",
28
28
  "lucide-react": "^1.8.0",
29
- "maplibre-gl": "^5.23.0",
29
+ "maplibre-gl": "^5.24.0",
30
30
  "react-map-gl": "^8.1.1",
31
- "zod": "^4.3.6",
32
- "@object-ui/components": "3.3.0",
33
- "@object-ui/core": "3.3.0",
34
- "@object-ui/react": "3.3.0",
35
- "@object-ui/types": "3.3.0"
31
+ "zod": "^4.4.3",
32
+ "@object-ui/components": "3.3.1",
33
+ "@object-ui/core": "3.3.1",
34
+ "@object-ui/react": "3.3.1",
35
+ "@object-ui/types": "3.3.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": "^18.0.0 || ^19.0.0",
@@ -42,10 +42,33 @@
42
42
  "@types/react": "19.2.14",
43
43
  "@types/react-dom": "19.2.3",
44
44
  "@vitejs/plugin-react": "^6.0.1",
45
- "typescript": "^6.0.2",
46
- "vite": "^8.0.8",
45
+ "typescript": "^6.0.3",
46
+ "vite": "^8.0.9",
47
47
  "vite-plugin-dts": "^4.5.4"
48
48
  },
49
+ "keywords": [
50
+ "objectui",
51
+ "sdui",
52
+ "schema-driven-ui",
53
+ "react",
54
+ "tailwind",
55
+ "shadcn",
56
+ "objectstack",
57
+ "plugin",
58
+ "map",
59
+ "geo",
60
+ "leaflet"
61
+ ],
62
+ "author": "ObjectStack Team <team@objectstack.ai>",
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "files": [
67
+ "dist",
68
+ "README.md",
69
+ "CHANGELOG.md",
70
+ "LICENSE"
71
+ ],
49
72
  "scripts": {
50
73
  "build": "vite build",
51
74
  "test": "vitest run",
@@ -1,34 +0,0 @@
1
-
2
- > @object-ui/plugin-map@3.3.0 build /home/runner/work/objectui/objectui/packages/plugin-map
3
- > vite build
4
-
5
- vite v8.0.8 building client environment for production...
6
- 
7
- rendering chunks...
8
- 
9
- [vite:dts] Start generate declaration files...
10
- src/ObjectMap.tsx:31:8 - error TS2882: Cannot find module or type declarations for side-effect import of 'maplibre-gl/dist/maplibre-gl.css'.
11
-
12
- 31 import 'maplibre-gl/dist/maplibre-gl.css';
13
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14
-
15
- [vite:dts] Declaration files built in 18746ms.
16
- 
17
- computing gzip size...
18
- dist/index.css 69.82 kB │ gzip: 10.12 kB
19
- dist/chunk-vKJrgz-R.js 1.20 kB │ gzip: 0.66 kB
20
- dist/index.js 126.65 kB │ gzip: 31.48 kB
21
- dist/maplibre-gl-DK6BxsIK.js 1,362.99 kB │ gzip: 305.24 kB
22
-
23
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
24
- - vite:dts (94%)
25
- - vite:css (5%)
26
- See https://rolldown.rs/options/checks#plugintimings for more details.
27
- 
28
- 
29
- rendering chunks...
30
- computing gzip size...
31
- dist/index.css 69.82 kB │ gzip: 10.12 kB
32
- dist/index.umd.cjs 1,119.99 kB │ gzip: 299.59 kB
33
-
34
- ✓ built in 22.53s
@@ -1,110 +0,0 @@
1
- import React from 'react';
2
- import { render, screen, waitFor, fireEvent } from '@testing-library/react';
3
- import { describe, it, expect, vi } from 'vitest';
4
- import { ObjectMap } from './ObjectMap';
5
- import { DataSource } from '@object-ui/types';
6
-
7
- // Mock react-map-gl/maplibre components to check they are receiving the right props/children
8
- // without relying on real WebGL canvas rendering.
9
- vi.mock('react-map-gl/maplibre', () => ({
10
- default: ({ children }: any) => <div aria-label="Map">{children}</div>,
11
- Map: ({ children }: any) => <div aria-label="Map">{children}</div>,
12
- NavigationControl: () => <div data-testid="nav-control" />,
13
- Marker: ({ children, longitude, latitude, onClick }: any) => (
14
- <div
15
- data-testid="map-marker"
16
- data-lat={latitude}
17
- data-lng={longitude}
18
- onClick={onClick}
19
- >
20
- {children}
21
- </div>
22
- ),
23
- Popup: ({ children }: any) => <div data-testid="map-popup">{children}</div>,
24
- }));
25
-
26
- const mockData = [
27
- { id: '1', name: 'Loc 1', latitude: 40, longitude: -74 },
28
- { id: '2', name: 'Loc 2', latitude: 41, longitude: -75 },
29
- ];
30
-
31
- const mockDataSource: DataSource = {
32
- find: vi.fn(),
33
- findOne: vi.fn(),
34
- create: vi.fn(),
35
- update: vi.fn(),
36
- delete: vi.fn(),
37
- getObjectSchema: vi.fn(),
38
- };
39
-
40
- describe('ObjectMap', () => {
41
- it('renders with static value provider', async () => {
42
- const schema: any = {
43
- type: 'map',
44
- map: {
45
- latitudeField: 'latitude',
46
- longitudeField: 'longitude',
47
- titleField: 'name'
48
- },
49
- data: {
50
- provider: 'value',
51
- items: mockData
52
- }
53
- };
54
-
55
- render(<ObjectMap schema={schema} />);
56
-
57
- // Wait for loading to finish
58
- await waitFor(() => {
59
- expect(screen.queryByText('Loading map...')).toBeNull();
60
- });
61
-
62
- // Check if map is rendered
63
- expect(screen.getByLabelText('Map')).toBeDefined();
64
-
65
- // Check if markers are rendered using testid from our mock
66
- await waitFor(() => {
67
- const markers = screen.getAllByTestId('map-marker');
68
- expect(markers).toHaveLength(2);
69
- // Verify coordinates of first marker
70
- expect(markers[0]).toHaveAttribute('data-lat', '40');
71
- expect(markers[0]).toHaveAttribute('data-lng', '-74');
72
- });
73
-
74
- // Check content inside marker (the emoji)
75
- expect(screen.getAllByText('📍')).toHaveLength(2);
76
- });
77
-
78
- it('fetches data with object provider', async () => {
79
- (mockDataSource.find as any).mockResolvedValue({ data: mockData });
80
-
81
- const schema: any = {
82
- type: 'map',
83
- map: {
84
- latitudeField: 'latitude',
85
- longitudeField: 'longitude',
86
- titleField: 'name'
87
- },
88
- data: {
89
- provider: 'object',
90
- object: 'locations'
91
- }
92
- };
93
-
94
- render(<ObjectMap schema={schema} dataSource={mockDataSource} />);
95
-
96
- // Wait for loading to finish
97
- await waitFor(() => {
98
- expect(screen.queryByText('Loading map...')).toBeNull();
99
- });
100
-
101
- // Verify dataSource.find was called
102
- expect(mockDataSource.find).toHaveBeenCalledWith('locations', expect.anything());
103
-
104
- // Check markers
105
- await waitFor(() => {
106
- const markers = screen.getAllByTestId('map-marker');
107
- expect(markers).toHaveLength(2);
108
- });
109
- });
110
- });