@heroui/agent 0.2.0-beta.7 → 0.2.0-beta.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 (49) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/README.md +15 -10
  3. package/dist/chart-content-BBHQVMP4.js +1 -0
  4. package/dist/chunk-2XBFFSW2.js +1 -0
  5. package/dist/chunk-64RI74L5.js +1 -0
  6. package/dist/chunk-6ZJJN322.js +1 -0
  7. package/dist/chunk-7KCGPNEN.js +1 -0
  8. package/dist/chunk-BBB5EHDN.js +5 -0
  9. package/dist/chunk-CR3H7AVI.js +1 -0
  10. package/dist/chunk-HCLXS4HQ.js +1 -0
  11. package/dist/chunk-MXLGM4WV.js +1 -0
  12. package/dist/chunk-OA3TG5CS.js +1 -0
  13. package/dist/chunk-PZJ4NC3J.js +1 -0
  14. package/dist/chunk-RNNGE7KM.js +1 -0
  15. package/dist/chunk-S6OIAJSC.js +1 -0
  16. package/dist/chunk-SUDHJNTJ.js +2 -0
  17. package/dist/chunk-WUAFMD7Z.js +2 -0
  18. package/dist/component-renderer-GG6JVRUG.js +1 -0
  19. package/dist/composer-draft-NSKK65F3.js +1 -0
  20. package/dist/composer-image-draft-KAGTNQR7.js +1 -0
  21. package/dist/contracts.d.ts +50 -19
  22. package/dist/contracts.js +2 -2545
  23. package/dist/css/index.css +1 -1
  24. package/dist/embed-runtime-GYXK7V6N.js +5 -0
  25. package/dist/identity-3P8-17km.d.ts +95 -0
  26. package/dist/index.d.ts +46 -10
  27. package/dist/index.js +1 -28
  28. package/dist/interactive-map-surface-WC2LPCR7.js +1 -0
  29. package/dist/internal/client-tools.js +1 -0
  30. package/dist/internal/models.js +1 -0
  31. package/dist/internal/runtime.js +1 -0
  32. package/dist/internal/theme.js +1 -0
  33. package/dist/next.d.ts +2 -1
  34. package/dist/next.js +1 -22
  35. package/dist/server.d.ts +1 -1
  36. package/dist/server.js +1 -260
  37. package/package.json +6 -6
  38. package/dist/chart-content-E4NPTUPR.js +0 -2696
  39. package/dist/chunk-3FG5NRTX.js +0 -9
  40. package/dist/chunk-6O3SFXJK.js +0 -325
  41. package/dist/chunk-FNGGMHVR.js +0 -625
  42. package/dist/chunk-OQGXZY5L.js +0 -1091
  43. package/dist/chunk-TOOT6SZ2.js +0 -74
  44. package/dist/chunk-V5S5FRGV.js +0 -984
  45. package/dist/chunk-VJA52U5P.js +0 -137
  46. package/dist/component-renderer-46EJDPTB.js +0 -10627
  47. package/dist/embed-runtime-UF7XJIFA.js +0 -7650
  48. package/dist/identity-Z6i6pL0F.d.ts +0 -166
  49. package/dist/interactive-map-surface-67KHT3VB.js +0 -362
@@ -1,137 +0,0 @@
1
- // ../agent-ui/src/components/display-information/map/map-utils.ts
2
- var MAX_MERCATOR_LATITUDE = 85.051129;
3
- var TILE_SIZE = 256;
4
- var TILE_RADIUS_X = 3;
5
- var TILE_RADIUS_Y = 2;
6
- function getMapSelectionCenter(locations, selectedLocationId, fallback) {
7
- const selectedLocation = locations.find((location) => location.id === selectedLocationId);
8
- return selectedLocation ? { latitude: selectedLocation.latitude, longitude: selectedLocation.longitude } : fallback;
9
- }
10
- function clamp(value, min, max) {
11
- return Math.min(Math.max(value, min), max);
12
- }
13
- function project({ latitude, longitude }, zoom) {
14
- const scale = TILE_SIZE * 2 ** zoom;
15
- const clampedLatitude = clamp(latitude, -MAX_MERCATOR_LATITUDE, MAX_MERCATOR_LATITUDE);
16
- const latitudeRadians = clampedLatitude * Math.PI / 180;
17
- const sinLatitude = Math.sin(latitudeRadians);
18
- return {
19
- x: (longitude + 180) / 360 * scale,
20
- y: (0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI)) * scale
21
- };
22
- }
23
- function wrapWorldDelta(delta, worldSize) {
24
- if (delta > worldSize / 2) return delta - worldSize;
25
- if (delta < -worldSize / 2) return delta + worldSize;
26
- return delta;
27
- }
28
- function resolveLongitudeCenter(locations) {
29
- if (locations.length === 1) return locations[0].longitude;
30
- const longitudes = locations.map((location) => (location.longitude + 360) % 360).sort((first, second) => first - second);
31
- let largestGap = -1;
32
- let arcStart = longitudes[0];
33
- for (let index = 0; index < longitudes.length; index += 1) {
34
- const current = longitudes[index];
35
- const next = index === longitudes.length - 1 ? longitudes[0] + 360 : longitudes[index + 1];
36
- const gap = next - current;
37
- if (gap > largestGap) {
38
- largestGap = gap;
39
- arcStart = next % 360;
40
- }
41
- }
42
- const center = (arcStart + (360 - largestGap) / 2) % 360;
43
- return center > 180 ? center - 360 : center;
44
- }
45
- function resolveCenter(locations, center) {
46
- if (center) return center;
47
- let minLatitude = locations[0].latitude;
48
- let maxLatitude = locations[0].latitude;
49
- for (const location of locations.slice(1)) {
50
- minLatitude = Math.min(minLatitude, location.latitude);
51
- maxLatitude = Math.max(maxLatitude, location.latitude);
52
- }
53
- return {
54
- latitude: (minLatitude + maxLatitude) / 2,
55
- longitude: resolveLongitudeCenter(locations)
56
- };
57
- }
58
- function resolveZoom(locations, center, zoom, maximumZoom) {
59
- if (zoom !== void 0) return clamp(zoom, 1, maximumZoom);
60
- if (locations.length === 1) return Math.min(14, maximumZoom);
61
- for (let candidate = Math.min(16, maximumZoom); candidate >= 2; candidate -= 1) {
62
- const centerPoint = project(center, candidate);
63
- const worldSize = TILE_SIZE * 2 ** candidate;
64
- const first = project(locations[0], candidate);
65
- const firstX = wrapWorldDelta(first.x - centerPoint.x, worldSize);
66
- const firstY = first.y - centerPoint.y;
67
- let minX = firstX;
68
- let maxX = firstX;
69
- let minY = firstY;
70
- let maxY = firstY;
71
- for (const location of locations.slice(1)) {
72
- const point = project(location, candidate);
73
- const pointX = wrapWorldDelta(point.x - centerPoint.x, worldSize);
74
- const pointY = point.y - centerPoint.y;
75
- minX = Math.min(minX, pointX);
76
- maxX = Math.max(maxX, pointX);
77
- minY = Math.min(minY, pointY);
78
- maxY = Math.max(maxY, pointY);
79
- }
80
- if (maxX - minX <= 420 && maxY - minY <= 190) return candidate;
81
- }
82
- return Math.min(2, maximumZoom);
83
- }
84
- function createMapLayout(component, maximumZoom = 18) {
85
- maximumZoom = Number.isFinite(maximumZoom) ? clamp(Math.floor(maximumZoom), 1, 18) : 18;
86
- const center = resolveCenter(component.locations, component.viewport?.center);
87
- const zoom = resolveZoom(component.locations, center, component.viewport?.zoom, maximumZoom);
88
- const centerPoint = project(center, zoom);
89
- const centerTileX = Math.floor(centerPoint.x / TILE_SIZE);
90
- const centerTileY = Math.floor(centerPoint.y / TILE_SIZE);
91
- const tileCount = 2 ** zoom;
92
- const tiles = [];
93
- for (let y = centerTileY - TILE_RADIUS_Y; y <= centerTileY + TILE_RADIUS_Y; y += 1) {
94
- if (y < 0 || y >= tileCount) continue;
95
- for (let x = centerTileX - TILE_RADIUS_X; x <= centerTileX + TILE_RADIUS_X; x += 1) {
96
- const wrappedX = (x % tileCount + tileCount) % tileCount;
97
- tiles.push({
98
- key: `${zoom}-${x}-${y}`,
99
- x: x * TILE_SIZE - centerPoint.x,
100
- xIndex: wrappedX,
101
- y: y * TILE_SIZE - centerPoint.y,
102
- yIndex: y,
103
- zoom
104
- });
105
- }
106
- }
107
- return {
108
- center,
109
- points: component.locations.map((location) => {
110
- const point = project(location, zoom);
111
- const worldSize = TILE_SIZE * 2 ** zoom;
112
- return {
113
- id: location.id,
114
- x: wrapWorldDelta(point.x - centerPoint.x, worldSize),
115
- y: point.y - centerPoint.y
116
- };
117
- }),
118
- tiles,
119
- zoom
120
- };
121
- }
122
- function getInitialMapLocationId(component) {
123
- if (component.initialLocationId && component.locations.some((location) => location.id === component.initialLocationId)) {
124
- return component.initialLocationId;
125
- }
126
- let best = component.locations[0];
127
- for (const location of component.locations.slice(1)) {
128
- if ((location.relevance ?? -1) > (best.relevance ?? -1)) best = location;
129
- }
130
- return best.id;
131
- }
132
-
133
- export {
134
- getMapSelectionCenter,
135
- createMapLayout,
136
- getInitialMapLocationId
137
- };