@gui-chat-plugin/google-map 0.4.1 → 0.5.0
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/README.md +5 -0
- package/dist/core/definition.d.ts +4 -0
- package/dist/core/definition.d.ts.map +1 -1
- package/dist/core/plugin.d.ts +1 -1
- package/dist/core/plugin.d.ts.map +1 -1
- package/dist/core/samples.d.ts.map +1 -1
- package/dist/core/types.d.ts +3 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/samples-B6EsSrT6.cjs +99 -0
- package/dist/{samples-CH-C0Bol.js → samples-BkkQxtFT.js} +65 -8
- package/dist/style.css +2 -2
- package/dist/vue/View.vue.d.ts +1 -0
- package/dist/vue/View.vue.d.ts.map +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +159 -138
- package/package.json +11 -11
- package/dist/samples-Xgow5I6W.cjs +0 -76
package/README.md
CHANGED
|
@@ -132,3 +132,8 @@ Try these prompts to test the plugin:
|
|
|
132
132
|
## License
|
|
133
133
|
|
|
134
134
|
MIT
|
|
135
|
+
|
|
136
|
+
## Related
|
|
137
|
+
|
|
138
|
+
- Protocol spec: [gui-chat-protocol](https://github.com/receptron/gui-chat-protocol)
|
|
139
|
+
- Reference implementations using this protocol: [mulmoclaude](https://github.com/receptron/mulmoclaude) · [MulmoChat](https://github.com/receptron/MulmoChat)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/core/definition.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/core/definition.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiM3B,CAAC"}
|
package/dist/core/plugin.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ToolContext, ToolResult, ToolPluginCore } from "gui-chat-protocol"
|
|
|
2
2
|
import type { MapToolData, MapArgs, MapJsonData } from "./types";
|
|
3
3
|
import { TOOL_NAME, TOOL_DEFINITION } from "./definition";
|
|
4
4
|
export declare const executeMapControl: (__context: ToolContext, args: MapArgs) => Promise<ToolResult<MapToolData, MapJsonData>>;
|
|
5
|
-
export declare const systemPrompt = "You have access to the mapControl tool for interactive map operations.\n\n## Basic Usage\n\nShow a location:\n```\nmapControl(location: \"Tokyo Station\")\nmapControl(action: \"showLocation\", location: \"Paris, France\")\n```\n\n## Available Actions\n\n### showLocation (default)\nDisplay a location on the map with a marker.\n- Use `location` for place names/addresses\n- Or use `lat` and `lng` for coordinates\n\n### setCenter\nMove the map center without adding markers.\n```\nmapControl(action: \"setCenter\", location: \"Shibuya, Tokyo\")\n```\n\n### setZoom\nChange the zoom level (1-21).\n- 1-5: Continent/Country level\n- 6-10: Region/City level\n- 11-15: Street level\n- 16-21: Building level\n```\nmapControl(action: \"setZoom\", zoom: 12)\n```\n\n### addMarker\nAdd a marker at a location (without centering).\n```\nmapControl(action: \"addMarker\", location: \"Tokyo Tower\", markerTitle: \"Tokyo Tower\", markerLabel: \"T\")\n```\n\n### clearMarkers\nRemove all markers from the map.\n```\nmapControl(action: \"clearMarkers\")\n```\n\n### findPlaces\nSearch for nearby places using Google Places API.\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\")\nmapControl(action: \"findPlaces\", placeType: \"restaurant\")\nmapControl(action: \"findPlaces\", searchQuery: \"coffee\", placeType: \"cafe\")\n```\n\n### getDirections\nGet directions between two locations.\n```\nmapControl(action: \"getDirections\", origin: \"Tokyo Station\", destination: \"Tokyo Tower\", travelMode: \"WALKING\")\n```\nTravel modes: DRIVING, WALKING, BICYCLING, TRANSIT\n\n## Response Data\n\nThe map will return JSON data with the results of each action, including:\n- Current center coordinates and zoom level\n- Markers on the map\n- Place search results with ratings and addresses\n- Route information with distance and duration";
|
|
5
|
+
export declare const systemPrompt = "You have access to the mapControl tool for interactive map operations.\n\n## Basic Usage\n\nShow a location:\n```\nmapControl(location: \"Tokyo Station\")\nmapControl(action: \"showLocation\", location: \"Paris, France\")\n```\n\n## Available Actions\n\n### showLocation (default)\nDisplay a location on the map with a marker.\n- Use `location` for place names/addresses\n- Or use `lat` and `lng` for coordinates\n\n### setCenter\nMove the map center without adding markers.\n```\nmapControl(action: \"setCenter\", location: \"Shibuya, Tokyo\")\n```\n\n### setZoom\nChange the zoom level (1-21).\n- 1-5: Continent/Country level\n- 6-10: Region/City level\n- 11-15: Street level\n- 16-21: Building level\n```\nmapControl(action: \"setZoom\", zoom: 12)\n```\n\n### addMarker\nAdd a marker at a location (without centering).\n```\nmapControl(action: \"addMarker\", location: \"Tokyo Tower\", markerTitle: \"Tokyo Tower\", markerLabel: \"T\")\n```\n\n### clearMarkers\nRemove all markers from the map.\n```\nmapControl(action: \"clearMarkers\")\n```\n\n### findPlaces\nSearch for nearby places using Google Places API.\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\")\nmapControl(action: \"findPlaces\", placeType: \"restaurant\")\nmapControl(action: \"findPlaces\", searchQuery: \"coffee\", placeType: \"cafe\")\n```\n\n### getDirections\nGet directions between two locations.\n```\nmapControl(action: \"getDirections\", origin: \"Tokyo Station\", destination: \"Tokyo Tower\", travelMode: \"WALKING\")\n```\nTravel modes: DRIVING, WALKING, BICYCLING, TRANSIT\n\n## Grouping operations onto one map (groupId)\n\nBy default each call renders its own map. To build ONE map from\nseveral calls \u2014 e.g. show a city, drop several markers, then draw a\nroute \u2014 pass the SAME `groupId` on every related call. Markers\naccumulate, directions overlay, and the center follows the latest\ncall, all on a single shared map.\n\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\", location: \"Shibuya\", groupId: \"tokyo-food-trip\")\nmapControl(action: \"addMarker\", location: \"Ichiran Shibuya\", groupId: \"tokyo-food-trip\")\nmapControl(action: \"getDirections\", origin: \"Shibuya Station\", destination: \"Ichiran Shibuya\", travelMode: \"WALKING\", groupId: \"tokyo-food-trip\")\n```\n\nTo update that same map later (move a marker, change the route),\nreuse the same `groupId`. To start a separate, unrelated map, use a\nNEW `groupId`. Omit `groupId` for a one-off standalone map.\n\nPick a short, descriptive, stable id per logical map (e.g.\n\"tokyo-food-trip\", \"office-commute\"). Reusing one id across\nunrelated topics will pile unrelated markers onto one map.\n\n## Response Data\n\nThe map will return JSON data with the results of each action, including:\n- Current center coordinates and zoom level\n- Markers on the map\n- Place search results with ratings and addresses\n- Route information with distance and duration\n- The `groupId` this result belongs to (echoed back)";
|
|
6
6
|
export declare const pluginCore: ToolPluginCore<MapToolData, MapJsonData, MapArgs>;
|
|
7
7
|
export { TOOL_NAME, TOOL_DEFINITION };
|
|
8
8
|
export declare const executeMap: (__context: ToolContext, args: MapArgs) => Promise<ToolResult<MapToolData, MapJsonData>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAa,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA2B1D,eAAO,MAAM,iBAAiB,GAC5B,WAAW,WAAW,EACtB,MAAM,OAAO,KACZ,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAa,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA2B1D,eAAO,MAAM,iBAAiB,GAC5B,WAAW,WAAW,EACtB,MAAM,OAAO,KACZ,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CA0G9C,CAAC;AAEF,eAAO,MAAM,YAAY,08FAyF8B,CAAC;AAExD,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAOxE,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AACtC,eAAO,MAAM,UAAU,cAnNV,WAAW,QAChB,OAAO,KACZ,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAiNJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/core/samples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/core/samples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,UAAU,EAsL/B,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface MapToolData {
|
|
|
49
49
|
origin?: string | LatLng;
|
|
50
50
|
destination?: string | LatLng;
|
|
51
51
|
travelMode?: TravelMode;
|
|
52
|
+
groupId?: string;
|
|
52
53
|
}
|
|
53
54
|
export interface MapJsonData {
|
|
54
55
|
action: MapAction;
|
|
@@ -59,6 +60,7 @@ export interface MapJsonData {
|
|
|
59
60
|
places?: PlaceResult[];
|
|
60
61
|
route?: DirectionRoute;
|
|
61
62
|
error?: string;
|
|
63
|
+
groupId?: string;
|
|
62
64
|
}
|
|
63
65
|
export interface MapArgs {
|
|
64
66
|
action?: MapAction;
|
|
@@ -73,5 +75,6 @@ export interface MapArgs {
|
|
|
73
75
|
travelMode?: TravelMode;
|
|
74
76
|
markerTitle?: string;
|
|
75
77
|
markerLabel?: string;
|
|
78
|
+
groupId?: string;
|
|
76
79
|
}
|
|
77
80
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,WAAW,GACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,CAAC;AAGpB,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,aAAa,GACb,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,mBAAmB,GACnB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,cAAc,GACd,yBAAyB,GACzB,WAAW,GACX,SAAS,GACT,eAAe,GACf,eAAe,GACf,QAAQ,GACR,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,oBAAoB,GACpB,YAAY,GACZ,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,KAAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,gBAAgB,GAChB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAGzE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,WAAW,GACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,CAAC;AAGpB,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,aAAa,GACb,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,mBAAmB,GACnB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,cAAc,GACd,yBAAyB,GACzB,WAAW,GACX,SAAS,GACT,eAAe,GACf,eAAe,GACf,QAAQ,GACR,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,oBAAoB,GACpB,YAAY,GACZ,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,KAAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,gBAAgB,GAChB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAGzE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAYD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./samples-B6EsSrT6.cjs");exports.TOOL_DEFINITION=e.o,exports.TOOL_NAME=e.s,exports.executeMap=e.n,exports.executeMapControl=e.r,exports.pluginCore=e.i,exports.samples=e.t,exports.systemPrompt=e.a;
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./samples-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./samples-BkkQxtFT.js";
|
|
2
2
|
export { r as TOOL_DEFINITION, a as TOOL_NAME, n as executeMap, i as executeMapControl, t as pluginCore, o as samples, e as systemPrompt };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./samples-B6EsSrT6.cjs");require("./core.cjs"),exports.TOOL_DEFINITION=e.o,exports.TOOL_NAME=e.s,exports.executeMap=e.n,exports.executeMapControl=e.r,exports.pluginCore=e.i,exports.samples=e.t,exports.systemPrompt=e.a;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./samples-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./samples-BkkQxtFT.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
export { r as TOOL_DEFINITION, a as TOOL_NAME, n as executeMap, i as executeMapControl, t as pluginCore, o as samples, e as systemPrompt };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var e=`mapControl`,t={type:`function`,name:e,description:`Control a Google Map interactively. Supports showing locations, adding markers, searching for places, and getting directions.
|
|
2
|
+
|
|
3
|
+
Available actions:
|
|
4
|
+
- showLocation: Display a location on the map (default action)
|
|
5
|
+
- setCenter: Change the map center without markers
|
|
6
|
+
- setZoom: Change the zoom level (1-21)
|
|
7
|
+
- addMarker: Add a marker to the map
|
|
8
|
+
- clearMarkers: Remove all markers from the map
|
|
9
|
+
- findPlaces: Search for nearby places using Google Places API
|
|
10
|
+
- getDirections: Get directions between two locations`,parameters:{type:`object`,properties:{action:{type:`string`,enum:[`showLocation`,`setCenter`,`setZoom`,`addMarker`,`clearMarkers`,`findPlaces`,`getDirections`],description:`The action to perform. Defaults to 'showLocation' if not specified.`},location:{type:`string`,description:`Location name, address, or place (e.g., 'Tokyo Station', 'Paris, France'). Used with showLocation, setCenter, addMarker actions.`},lat:{type:`number`,description:`Latitude coordinate. Can be used instead of location for precise positioning.`},lng:{type:`number`,description:`Longitude coordinate. Can be used instead of location for precise positioning.`},zoom:{type:`integer`,minimum:1,maximum:21,description:`Zoom level for setZoom action (1=world, 15=streets, 21=buildings). Default is 15.`},searchQuery:{type:`string`,description:`Text search query for findPlaces action (e.g., 'ramen', 'coffee shop').`},placeType:{type:`string`,enum:`accounting.airport.amusement_park.aquarium.art_gallery.atm.bakery.bank.bar.beauty_salon.bicycle_store.book_store.bowling_alley.bus_station.cafe.campground.car_dealer.car_rental.car_repair.car_wash.casino.cemetery.church.city_hall.clothing_store.convenience_store.courthouse.dentist.department_store.doctor.drugstore.electrician.electronics_store.embassy.fire_station.florist.funeral_home.furniture_store.gas_station.gym.hair_care.hardware_store.hindu_temple.home_goods_store.hospital.insurance_agency.jewelry_store.laundry.lawyer.library.light_rail_station.liquor_store.local_government_office.locksmith.lodging.meal_delivery.meal_takeaway.mosque.movie_rental.movie_theater.moving_company.museum.night_club.painter.park.parking.pet_store.pharmacy.physiotherapist.plumber.police.post_office.primary_school.real_estate_agency.restaurant.roofing_contractor.rv_park.school.secondary_school.shoe_store.shopping_mall.spa.stadium.storage.store.subway_station.supermarket.synagogue.taxi_stand.tourist_attraction.train_station.transit_station.travel_agency.university.veterinary_care.zoo`.split(`.`),description:`Type of place to search for with findPlaces action. Use with or instead of searchQuery.`},origin:{type:`string`,description:`Starting point for getDirections action. Can be a place name or address.`},destination:{type:`string`,description:`End point for getDirections action. Can be a place name or address.`},travelMode:{type:`string`,enum:[`DRIVING`,`WALKING`,`BICYCLING`,`TRANSIT`],description:`Travel mode for getDirections action. Defaults to DRIVING.`},markerTitle:{type:`string`,description:`Title for the marker (shown on hover) when using addMarker.`},markerLabel:{type:`string`,description:`Single character label displayed on the marker when using addMarker.`},groupId:{type:`string`,description:`Optional grouping key. Reuse the SAME groupId across calls that should appear on ONE shared map — e.g. searching places then drawing a route for the same trip, or later updating that map. Markers accumulate, directions overlay, and the center follows the latest call. Use a NEW groupId to start a separate, unrelated map. Omit for a one-off standalone map. (Unrelated to Google Maps' own map style id.)`}},required:[]}},n=`showLocation`,r=15,i=`DRIVING`,a=()=>`marker_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,o=e=>Number.isInteger(e)&&e>=1&&e<=21,s=e=>!!(e.location||e.lat!==void 0&&e.lng!==void 0),c=e=>e.lat!==void 0&&e.lng!==void 0?{lat:e.lat,lng:e.lng}:e.location,l=async(e,t)=>{let l=t.action||n,u=t.groupId;switch(l){case`showLocation`:case`setCenter`:case`addMarker`:{if(!s(t))throw Error(`${l} requires either 'location' or both 'lat' and 'lng' parameters`);let e=c(t),n={action:l,location:e,groupId:u};l===`addMarker`&&(n.marker={id:a(),position:typeof e==`string`?{lat:0,lng:0}:e,title:t.markerTitle,label:t.markerLabel?.charAt(0)});let r=typeof e==`string`?e:`${e?.lat}, ${e?.lng}`;return{message:{showLocation:`Showing ${r} on the map`,setCenter:`Centering map on ${r}`,addMarker:`Adding marker at ${r}`}[l],data:n}}case`setZoom`:{let e=t.zoom??r;if(!o(e))throw Error(`Zoom level must be an integer between 1 and 21`);return{message:`Setting zoom level to ${e}`,data:{action:l,zoom:e,groupId:u}}}case`clearMarkers`:return{message:`Clearing all markers from the map`,data:{action:l,groupId:u}};case`findPlaces`:if(!t.searchQuery&&!t.placeType)throw Error(`findPlaces requires either 'searchQuery' or 'placeType' parameter`);return{message:`Searching for ${t.searchQuery?`"${t.searchQuery}"`:t.placeType} nearby`,data:{action:l,searchQuery:t.searchQuery,placeType:t.placeType,groupId:u}};case`getDirections`:{if(!t.origin||!t.destination)throw Error(`getDirections requires both 'origin' and 'destination' parameters`);let e=t.travelMode||i;return{message:`Getting ${e.toLowerCase()} directions from ${t.origin} to ${t.destination}`,data:{action:l,origin:t.origin,destination:t.destination,travelMode:e,groupId:u}}}default:throw Error(`Unknown action: ${l}`)}},u=`You have access to the mapControl tool for interactive map operations.
|
|
11
|
+
|
|
12
|
+
## Basic Usage
|
|
13
|
+
|
|
14
|
+
Show a location:
|
|
15
|
+
\`\`\`
|
|
16
|
+
mapControl(location: "Tokyo Station")
|
|
17
|
+
mapControl(action: "showLocation", location: "Paris, France")
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
## Available Actions
|
|
21
|
+
|
|
22
|
+
### showLocation (default)
|
|
23
|
+
Display a location on the map with a marker.
|
|
24
|
+
- Use \`location\` for place names/addresses
|
|
25
|
+
- Or use \`lat\` and \`lng\` for coordinates
|
|
26
|
+
|
|
27
|
+
### setCenter
|
|
28
|
+
Move the map center without adding markers.
|
|
29
|
+
\`\`\`
|
|
30
|
+
mapControl(action: "setCenter", location: "Shibuya, Tokyo")
|
|
31
|
+
\`\`\`
|
|
32
|
+
|
|
33
|
+
### setZoom
|
|
34
|
+
Change the zoom level (1-21).
|
|
35
|
+
- 1-5: Continent/Country level
|
|
36
|
+
- 6-10: Region/City level
|
|
37
|
+
- 11-15: Street level
|
|
38
|
+
- 16-21: Building level
|
|
39
|
+
\`\`\`
|
|
40
|
+
mapControl(action: "setZoom", zoom: 12)
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
### addMarker
|
|
44
|
+
Add a marker at a location (without centering).
|
|
45
|
+
\`\`\`
|
|
46
|
+
mapControl(action: "addMarker", location: "Tokyo Tower", markerTitle: "Tokyo Tower", markerLabel: "T")
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
### clearMarkers
|
|
50
|
+
Remove all markers from the map.
|
|
51
|
+
\`\`\`
|
|
52
|
+
mapControl(action: "clearMarkers")
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
### findPlaces
|
|
56
|
+
Search for nearby places using Google Places API.
|
|
57
|
+
\`\`\`
|
|
58
|
+
mapControl(action: "findPlaces", searchQuery: "ramen")
|
|
59
|
+
mapControl(action: "findPlaces", placeType: "restaurant")
|
|
60
|
+
mapControl(action: "findPlaces", searchQuery: "coffee", placeType: "cafe")
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
### getDirections
|
|
64
|
+
Get directions between two locations.
|
|
65
|
+
\`\`\`
|
|
66
|
+
mapControl(action: "getDirections", origin: "Tokyo Station", destination: "Tokyo Tower", travelMode: "WALKING")
|
|
67
|
+
\`\`\`
|
|
68
|
+
Travel modes: DRIVING, WALKING, BICYCLING, TRANSIT
|
|
69
|
+
|
|
70
|
+
## Grouping operations onto one map (groupId)
|
|
71
|
+
|
|
72
|
+
By default each call renders its own map. To build ONE map from
|
|
73
|
+
several calls — e.g. show a city, drop several markers, then draw a
|
|
74
|
+
route — pass the SAME \`groupId\` on every related call. Markers
|
|
75
|
+
accumulate, directions overlay, and the center follows the latest
|
|
76
|
+
call, all on a single shared map.
|
|
77
|
+
|
|
78
|
+
\`\`\`
|
|
79
|
+
mapControl(action: "findPlaces", searchQuery: "ramen", location: "Shibuya", groupId: "tokyo-food-trip")
|
|
80
|
+
mapControl(action: "addMarker", location: "Ichiran Shibuya", groupId: "tokyo-food-trip")
|
|
81
|
+
mapControl(action: "getDirections", origin: "Shibuya Station", destination: "Ichiran Shibuya", travelMode: "WALKING", groupId: "tokyo-food-trip")
|
|
82
|
+
\`\`\`
|
|
83
|
+
|
|
84
|
+
To update that same map later (move a marker, change the route),
|
|
85
|
+
reuse the same \`groupId\`. To start a separate, unrelated map, use a
|
|
86
|
+
NEW \`groupId\`. Omit \`groupId\` for a one-off standalone map.
|
|
87
|
+
|
|
88
|
+
Pick a short, descriptive, stable id per logical map (e.g.
|
|
89
|
+
"tokyo-food-trip", "office-commute"). Reusing one id across
|
|
90
|
+
unrelated topics will pile unrelated markers onto one map.
|
|
91
|
+
|
|
92
|
+
## Response Data
|
|
93
|
+
|
|
94
|
+
The map will return JSON data with the results of each action, including:
|
|
95
|
+
- Current center coordinates and zoom level
|
|
96
|
+
- Markers on the map
|
|
97
|
+
- Place search results with ratings and addresses
|
|
98
|
+
- Route information with distance and duration
|
|
99
|
+
- The \`groupId\` this result belongs to (echoed back)`,d={toolDefinition:t,execute:l,generatingMessage:`Loading map...`,isEnabled:e=>!!e?.googleMapKey,backends:[`map`],systemPrompt:u},f=l,p=[{name:`Show Tokyo Station`,args:{action:`showLocation`,location:`Tokyo Station, Japan`}},{name:`Show Eiffel Tower`,args:{action:`showLocation`,location:`Eiffel Tower, Paris, France`}},{name:`Show coordinates`,args:{action:`showLocation`,lat:40.7128,lng:-74.006}},{name:`Center on Shibuya`,args:{action:`setCenter`,location:`Shibuya, Tokyo`}},{name:`Zoom to street level`,args:{action:`setZoom`,zoom:17}},{name:`Zoom to city level`,args:{action:`setZoom`,zoom:12}},{name:`Add marker at Tokyo Tower`,args:{action:`addMarker`,location:`Tokyo Tower, Japan`,markerTitle:`Tokyo Tower`,markerLabel:`T`}},{name:`Add marker with coordinates`,args:{action:`addMarker`,lat:35.6586,lng:139.7454,markerTitle:`Custom Location`}},{name:`Clear all markers`,args:{action:`clearMarkers`}},{name:`Find nearby ramen`,args:{action:`findPlaces`,searchQuery:`ramen`}},{name:`Find restaurants`,args:{action:`findPlaces`,placeType:`restaurant`}},{name:`Find coffee shops`,args:{action:`findPlaces`,searchQuery:`coffee`,placeType:`cafe`}},{name:`Directions: Tokyo Station to Shibuya`,args:{action:`getDirections`,origin:`Tokyo Station`,destination:`Shibuya Station`,travelMode:`DRIVING`}},{name:`Walking directions`,args:{action:`getDirections`,origin:`Shinjuku Station`,destination:`Tokyo Metropolitan Government Building`,travelMode:`WALKING`}},{name:`Driving directions`,args:{action:`getDirections`,origin:`Narita Airport`,destination:`Tokyo Station`,travelMode:`DRIVING`}},{name:`Trip A ①: center Shibuya`,args:{action:`showLocation`,location:`Shibuya, Tokyo`,groupId:`tokyo-food-trip`}},{name:`Trip A ②: + marker Ichiran`,args:{action:`addMarker`,location:`Ichiran Shibuya`,markerTitle:`Ichiran`,markerLabel:`I`,groupId:`tokyo-food-trip`}},{name:`Trip A ③: + marker Hachiko`,args:{action:`addMarker`,location:`Hachiko Statue, Shibuya`,markerTitle:`Hachiko`,markerLabel:`H`,groupId:`tokyo-food-trip`}},{name:`Trip A ④: + walking route`,args:{action:`getDirections`,origin:`Shibuya Station`,destination:`Ichiran Shibuya`,travelMode:`WALKING`,groupId:`tokyo-food-trip`}},{name:`Trip B: Paris (separate map)`,args:{action:`showLocation`,location:`Eiffel Tower, Paris`,groupId:`paris-day`}}];Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
|
|
@@ -71,6 +71,10 @@ var e = "mapControl", t = {
|
|
|
71
71
|
markerLabel: {
|
|
72
72
|
type: "string",
|
|
73
73
|
description: "Single character label displayed on the marker when using addMarker."
|
|
74
|
+
},
|
|
75
|
+
groupId: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Optional grouping key. Reuse the SAME groupId across calls that should appear on ONE shared map — e.g. searching places then drawing a route for the same trip, or later updating that map. Markers accumulate, directions overlay, and the center follows the latest call. Use a NEW groupId to start a separate, unrelated map. Omit for a one-off standalone map. (Unrelated to Google Maps' own map style id.)"
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
80
|
required: []
|
|
@@ -79,7 +83,7 @@ var e = "mapControl", t = {
|
|
|
79
83
|
lat: e.lat,
|
|
80
84
|
lng: e.lng
|
|
81
85
|
} : e.location, l = async (e, t) => {
|
|
82
|
-
let l = t.action || n;
|
|
86
|
+
let l = t.action || n, u = t.groupId;
|
|
83
87
|
switch (l) {
|
|
84
88
|
case "showLocation":
|
|
85
89
|
case "setCenter":
|
|
@@ -87,7 +91,8 @@ var e = "mapControl", t = {
|
|
|
87
91
|
if (!s(t)) throw Error(`${l} requires either 'location' or both 'lat' and 'lng' parameters`);
|
|
88
92
|
let e = c(t), n = {
|
|
89
93
|
action: l,
|
|
90
|
-
location: e
|
|
94
|
+
location: e,
|
|
95
|
+
groupId: u
|
|
91
96
|
};
|
|
92
97
|
l === "addMarker" && (n.marker = {
|
|
93
98
|
id: a(),
|
|
@@ -115,13 +120,17 @@ var e = "mapControl", t = {
|
|
|
115
120
|
message: `Setting zoom level to ${e}`,
|
|
116
121
|
data: {
|
|
117
122
|
action: l,
|
|
118
|
-
zoom: e
|
|
123
|
+
zoom: e,
|
|
124
|
+
groupId: u
|
|
119
125
|
}
|
|
120
126
|
};
|
|
121
127
|
}
|
|
122
128
|
case "clearMarkers": return {
|
|
123
129
|
message: "Clearing all markers from the map",
|
|
124
|
-
data: {
|
|
130
|
+
data: {
|
|
131
|
+
action: l,
|
|
132
|
+
groupId: u
|
|
133
|
+
}
|
|
125
134
|
};
|
|
126
135
|
case "findPlaces":
|
|
127
136
|
if (!t.searchQuery && !t.placeType) throw Error("findPlaces requires either 'searchQuery' or 'placeType' parameter");
|
|
@@ -130,7 +139,8 @@ var e = "mapControl", t = {
|
|
|
130
139
|
data: {
|
|
131
140
|
action: l,
|
|
132
141
|
searchQuery: t.searchQuery,
|
|
133
|
-
placeType: t.placeType
|
|
142
|
+
placeType: t.placeType,
|
|
143
|
+
groupId: u
|
|
134
144
|
}
|
|
135
145
|
};
|
|
136
146
|
case "getDirections": {
|
|
@@ -142,13 +152,14 @@ var e = "mapControl", t = {
|
|
|
142
152
|
action: l,
|
|
143
153
|
origin: t.origin,
|
|
144
154
|
destination: t.destination,
|
|
145
|
-
travelMode: e
|
|
155
|
+
travelMode: e,
|
|
156
|
+
groupId: u
|
|
146
157
|
}
|
|
147
158
|
};
|
|
148
159
|
}
|
|
149
160
|
default: throw Error(`Unknown action: ${l}`);
|
|
150
161
|
}
|
|
151
|
-
}, u = "You have access to the mapControl tool for interactive map operations.\n\n## Basic Usage\n\nShow a location:\n```\nmapControl(location: \"Tokyo Station\")\nmapControl(action: \"showLocation\", location: \"Paris, France\")\n```\n\n## Available Actions\n\n### showLocation (default)\nDisplay a location on the map with a marker.\n- Use `location` for place names/addresses\n- Or use `lat` and `lng` for coordinates\n\n### setCenter\nMove the map center without adding markers.\n```\nmapControl(action: \"setCenter\", location: \"Shibuya, Tokyo\")\n```\n\n### setZoom\nChange the zoom level (1-21).\n- 1-5: Continent/Country level\n- 6-10: Region/City level\n- 11-15: Street level\n- 16-21: Building level\n```\nmapControl(action: \"setZoom\", zoom: 12)\n```\n\n### addMarker\nAdd a marker at a location (without centering).\n```\nmapControl(action: \"addMarker\", location: \"Tokyo Tower\", markerTitle: \"Tokyo Tower\", markerLabel: \"T\")\n```\n\n### clearMarkers\nRemove all markers from the map.\n```\nmapControl(action: \"clearMarkers\")\n```\n\n### findPlaces\nSearch for nearby places using Google Places API.\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\")\nmapControl(action: \"findPlaces\", placeType: \"restaurant\")\nmapControl(action: \"findPlaces\", searchQuery: \"coffee\", placeType: \"cafe\")\n```\n\n### getDirections\nGet directions between two locations.\n```\nmapControl(action: \"getDirections\", origin: \"Tokyo Station\", destination: \"Tokyo Tower\", travelMode: \"WALKING\")\n```\nTravel modes: DRIVING, WALKING, BICYCLING, TRANSIT\n\n## Response Data\n\nThe map will return JSON data with the results of each action, including:\n- Current center coordinates and zoom level\n- Markers on the map\n- Place search results with ratings and addresses\n- Route information with distance and duration", d = {
|
|
162
|
+
}, u = "You have access to the mapControl tool for interactive map operations.\n\n## Basic Usage\n\nShow a location:\n```\nmapControl(location: \"Tokyo Station\")\nmapControl(action: \"showLocation\", location: \"Paris, France\")\n```\n\n## Available Actions\n\n### showLocation (default)\nDisplay a location on the map with a marker.\n- Use `location` for place names/addresses\n- Or use `lat` and `lng` for coordinates\n\n### setCenter\nMove the map center without adding markers.\n```\nmapControl(action: \"setCenter\", location: \"Shibuya, Tokyo\")\n```\n\n### setZoom\nChange the zoom level (1-21).\n- 1-5: Continent/Country level\n- 6-10: Region/City level\n- 11-15: Street level\n- 16-21: Building level\n```\nmapControl(action: \"setZoom\", zoom: 12)\n```\n\n### addMarker\nAdd a marker at a location (without centering).\n```\nmapControl(action: \"addMarker\", location: \"Tokyo Tower\", markerTitle: \"Tokyo Tower\", markerLabel: \"T\")\n```\n\n### clearMarkers\nRemove all markers from the map.\n```\nmapControl(action: \"clearMarkers\")\n```\n\n### findPlaces\nSearch for nearby places using Google Places API.\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\")\nmapControl(action: \"findPlaces\", placeType: \"restaurant\")\nmapControl(action: \"findPlaces\", searchQuery: \"coffee\", placeType: \"cafe\")\n```\n\n### getDirections\nGet directions between two locations.\n```\nmapControl(action: \"getDirections\", origin: \"Tokyo Station\", destination: \"Tokyo Tower\", travelMode: \"WALKING\")\n```\nTravel modes: DRIVING, WALKING, BICYCLING, TRANSIT\n\n## Grouping operations onto one map (groupId)\n\nBy default each call renders its own map. To build ONE map from\nseveral calls — e.g. show a city, drop several markers, then draw a\nroute — pass the SAME `groupId` on every related call. Markers\naccumulate, directions overlay, and the center follows the latest\ncall, all on a single shared map.\n\n```\nmapControl(action: \"findPlaces\", searchQuery: \"ramen\", location: \"Shibuya\", groupId: \"tokyo-food-trip\")\nmapControl(action: \"addMarker\", location: \"Ichiran Shibuya\", groupId: \"tokyo-food-trip\")\nmapControl(action: \"getDirections\", origin: \"Shibuya Station\", destination: \"Ichiran Shibuya\", travelMode: \"WALKING\", groupId: \"tokyo-food-trip\")\n```\n\nTo update that same map later (move a marker, change the route),\nreuse the same `groupId`. To start a separate, unrelated map, use a\nNEW `groupId`. Omit `groupId` for a one-off standalone map.\n\nPick a short, descriptive, stable id per logical map (e.g.\n\"tokyo-food-trip\", \"office-commute\"). Reusing one id across\nunrelated topics will pile unrelated markers onto one map.\n\n## Response Data\n\nThe map will return JSON data with the results of each action, including:\n- Current center coordinates and zoom level\n- Markers on the map\n- Place search results with ratings and addresses\n- Route information with distance and duration\n- The `groupId` this result belongs to (echoed back)", d = {
|
|
152
163
|
toolDefinition: t,
|
|
153
164
|
execute: l,
|
|
154
165
|
generatingMessage: "Loading map...",
|
|
@@ -249,7 +260,7 @@ var e = "mapControl", t = {
|
|
|
249
260
|
action: "getDirections",
|
|
250
261
|
origin: "Tokyo Station",
|
|
251
262
|
destination: "Shibuya Station",
|
|
252
|
-
travelMode: "
|
|
263
|
+
travelMode: "DRIVING"
|
|
253
264
|
}
|
|
254
265
|
},
|
|
255
266
|
{
|
|
@@ -269,6 +280,52 @@ var e = "mapControl", t = {
|
|
|
269
280
|
destination: "Tokyo Station",
|
|
270
281
|
travelMode: "DRIVING"
|
|
271
282
|
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "Trip A ①: center Shibuya",
|
|
286
|
+
args: {
|
|
287
|
+
action: "showLocation",
|
|
288
|
+
location: "Shibuya, Tokyo",
|
|
289
|
+
groupId: "tokyo-food-trip"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "Trip A ②: + marker Ichiran",
|
|
294
|
+
args: {
|
|
295
|
+
action: "addMarker",
|
|
296
|
+
location: "Ichiran Shibuya",
|
|
297
|
+
markerTitle: "Ichiran",
|
|
298
|
+
markerLabel: "I",
|
|
299
|
+
groupId: "tokyo-food-trip"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "Trip A ③: + marker Hachiko",
|
|
304
|
+
args: {
|
|
305
|
+
action: "addMarker",
|
|
306
|
+
location: "Hachiko Statue, Shibuya",
|
|
307
|
+
markerTitle: "Hachiko",
|
|
308
|
+
markerLabel: "H",
|
|
309
|
+
groupId: "tokyo-food-trip"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "Trip A ④: + walking route",
|
|
314
|
+
args: {
|
|
315
|
+
action: "getDirections",
|
|
316
|
+
origin: "Shibuya Station",
|
|
317
|
+
destination: "Ichiran Shibuya",
|
|
318
|
+
travelMode: "WALKING",
|
|
319
|
+
groupId: "tokyo-food-trip"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: "Trip B: Paris (separate map)",
|
|
324
|
+
args: {
|
|
325
|
+
action: "showLocation",
|
|
326
|
+
location: "Eiffel Tower, Paris",
|
|
327
|
+
groupId: "paris-day"
|
|
328
|
+
}
|
|
272
329
|
}
|
|
273
330
|
];
|
|
274
331
|
//#endregion
|
package/dist/style.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! tailwindcss v4.
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-50:oklch(98% .016 73.684);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-50:oklch(98.2% .018 155.826);--color-green-600:oklch(62.7% .194 149.214);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-600:oklch(55.8% .288 302.321);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.top-4{top:calc(var(--spacing) * 4)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-96{height:calc(var(--spacing) * 96)}.h-\[600px\]{height:600px}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-24{width:calc(var(--spacing) * 24)}.w-80{width:calc(var(--spacing) * 80)}.w-\[100px\]{width:100px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-300{border-color:var(--color-red-300)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-600{color:var(--color-orange-600)}.text-purple-600{color:var(--color-purple-600)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-700{color:var(--color-yellow-700)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab, red, red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media (width>=64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes pulse{50%{opacity:.5}}
|
|
1
|
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-50:oklch(98% .016 73.684);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-50:oklch(98.2% .018 155.826);--color-green-600:oklch(62.7% .194 149.214);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-600:oklch(55.8% .288 302.321);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-4{top:calc(var(--spacing) * 4)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-96{height:calc(var(--spacing) * 96)}.h-\[600px\]{height:600px}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-24{width:calc(var(--spacing) * 24)}.w-80{width:calc(var(--spacing) * 80)}.w-\[100px\]{width:100px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-300{border-color:var(--color-red-300)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-600{color:var(--color-orange-600)}.text-purple-600{color:var(--color-purple-600)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-700{color:var(--color-yellow-700)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab, red, red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media (width>=64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes pulse{50%{opacity:.5}}
|
|
3
3
|
/*$vite$:1*/
|
package/dist/vue/View.vue.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ToolResult } from "gui-chat-protocol";
|
|
|
2
2
|
import type { MapToolData, MapJsonData } from "../core/types";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
selectedResult: ToolResult<MapToolData> | null;
|
|
5
|
+
results?: ToolResult<MapToolData>[] | null;
|
|
5
6
|
googleMapKey?: string | null;
|
|
6
7
|
onUpdateResult?: (jsonData: MapJsonData) => void;
|
|
7
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"AAszBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAOZ,MAAM,eAAe,CAAC;AAEvB,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAO/C,OAAO,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD,CAAC;AA+gCF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./samples-Xgow5I6W.cjs`);let t=require(`vue`);var n={class:`w-full h-full bg-white flex flex-col relative`},r={class:`p-4 border-b border-gray-200`},i={class:`text-xl font-bold text-gray-800`},a={key:0,class:`text-gray-600 text-sm`},o={class:`flex-1 min-h-0 flex`},s={class:`flex-1 relative`},c={key:1,class:`w-full h-full flex items-center justify-center bg-gray-100`},l={class:`text-center p-8`},u=[`href`],d={key:2,class:`absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center`},f={key:3,class:`absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded`},p={key:4,class:`absolute top-4 right-4 flex flex-col gap-1`},m={key:0,class:`w-80 border-l border-gray-200 overflow-y-auto`},h={key:0,class:`p-4`},g={class:`space-y-3`},ee=[`onClick`],_={class:`font-medium text-gray-800`},v={class:`text-sm text-gray-600 mt-1`},y={key:0,class:`flex items-center mt-1`},b={class:`text-sm text-gray-600`},x={key:0,class:`text-gray-400`},te={key:1,class:`p-4`},S={class:`bg-blue-50 rounded-lg p-3 mb-4`},ne={class:`text-lg font-medium text-gray-800`},C={class:`text-gray-600`},w={class:`text-sm text-gray-600 mb-3`},T={class:`space-y-2`},E=[`onClick`],re={class:`text-gray-800`},ie={class:`text-gray-500 mt-1`},D=(0,t.defineComponent)({__name:`View`,props:{selectedResult:{},googleMapKey:{},onUpdateResult:{type:Function}},setup(e){let D=e,O=(0,t.ref)(null),k=(0,t.ref)(null),A=(0,t.ref)(new Map),j=(0,t.ref)(null),M=(0,t.ref)(null),N=(0,t.ref)(null),P,F,I=(0,t.ref)(!1),L=(0,t.ref)(null),R=(0,t.ref)([]),z=(0,t.ref)(null),B=(0,t.ref)(null),V=(0,t.ref)(15),H=(0,t.computed)(()=>({showLocation:`Map Location`,setCenter:`Map View`,setZoom:`Map View`,addMarker:`Map Marker`,clearMarkers:`Map`,findPlaces:`Place Search`,getDirections:`Directions`})[D.selectedResult?.data?.action||`showLocation`]||`Map`),U=(0,t.computed)(()=>{let e=D.selectedResult?.data;if(!e)return``;switch(e.action){case`showLocation`:case`setCenter`:case`addMarker`:return G(e.location);case`setZoom`:return`Zoom level: ${e.zoom}`;case`findPlaces`:return e.searchQuery||e.placeType||``;case`getDirections`:return`${e.origin} → ${e.destination}`;default:return``}}),ae=(0,t.computed)(()=>R.value.length>0||z.value!==null),W=(0,t.computed)(()=>{let e=D.selectedResult?.data;if(!e?.location)return``;let t=G(e.location);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`}),G=e=>e?typeof e==`string`?e:`${e.lat}, ${e.lng}`:``,K=e=>new DOMParser().parseFromString(e,`text/html`).body.textContent||``,q=()=>{let e=[];return A.value.forEach((t,n)=>{let r=t.position;if(r){let i=typeof r.lat==`function`?r.lat():r.lat,a=typeof r.lng==`function`?r.lng():r.lng;e.push({id:n,position:{lat:i,lng:a},title:t.title||void 0})}}),e},J=(e,t,n)=>{if(!D.onUpdateResult)return;let r={action:D.selectedResult?.data?.action||`showLocation`,success:e,center:B.value||void 0,zoom:V.value,markers:q(),...n};t&&(r.error=t),D.onUpdateResult(r)},oe=()=>new Promise((e,t)=>{if(typeof google<`u`&&google.maps&&typeof google.maps.importLibrary==`function`){e();return}let n=document.querySelector(`script[src*="maps.googleapis.com"]`),r=n=>{typeof google<`u`&&google.maps&&typeof google.maps.importLibrary==`function`?e():Date.now()-n>1e4?t(Error(`Timeout waiting for Google Maps to load`)):setTimeout(()=>r(n),50)};if(n){r(Date.now());return}let i=document.createElement(`script`);i.src=`https://maps.googleapis.com/maps/api/js?key=${D.googleMapKey}&loading=async`,i.async=!0,i.defer=!0,i.onload=()=>r(Date.now()),i.onerror=()=>t(Error(`Failed to load Google Maps`)),document.head.appendChild(i)}),se=async()=>{if(!(!O.value||!D.googleMapKey)&&!k.value)try{await oe();let e=await google.maps.importLibrary(`marker`),t=await google.maps.importLibrary(`places`);P=e.AdvancedMarkerElement,F=t.Place,k.value=new google.maps.Map(O.value,{center:{lat:35.6812,lng:139.7671},zoom:V.value,mapTypeControl:!0,streetViewControl:!0,fullscreenControl:!0,mapId:`DEMO_MAP_ID`}),N.value=new google.maps.Geocoder,j.value=new google.maps.DirectionsService,M.value=new google.maps.DirectionsRenderer,M.value.setMap(k.value),k.value.addListener(`center_changed`,()=>{let e=k.value?.getCenter();e&&(B.value={lat:e.lat(),lng:e.lng()})}),k.value.addListener(`zoom_changed`,()=>{V.value=k.value?.getZoom()||15}),D.selectedResult?.data&&await Q(D.selectedResult.data)}catch(e){L.value=e instanceof Error?e.message:`Failed to initialize map`}},Y=async e=>typeof e==`string`?N.value?new Promise(t=>{N.value.geocode({address:e},(e,n)=>{if(n===`OK`&&e&&e[0]){let n=e[0].geometry.location;t({lat:n.lat(),lng:n.lng()})}else t(null)})}):null:e,X=(e,t,n,r)=>{let i;if(r){let e=document.createElement(`div`);e.className=`marker-label`,e.style.cssText=`background: #4285f4; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px;`,e.textContent=r,i=e}let a=new P({position:e,map:k.value,title:n,content:i});return A.value.set(t,a),a},Z=()=>{A.value.forEach(e=>{e.map=null}),A.value.clear()},Q=async e=>{if(k.value){I.value=!0,L.value=null;try{switch(e.action){case`showLocation`:case`setCenter`:{if(!e.location)throw Error(`Location is required`);let t=await Y(e.location);if(!t)throw Error(`Could not find location`);k.value.setCenter(t),B.value=t,e.action===`showLocation`&&X(t,`location_${Date.now()}`,typeof e.location==`string`?e.location:void 0),J(!0);break}case`setZoom`:{let t=e.zoom||15;k.value.setZoom(t),V.value=t,J(!0);break}case`addMarker`:{if(!e.location)throw Error(`Location is required for marker`);let t=await Y(e.location);if(!t)throw Error(`Could not find location for marker`);X(t,e.marker?.id||`marker_${Date.now()}`,e.marker?.title,e.marker?.label),J(!0);break}case`clearMarkers`:Z(),M.value?.setDirections({routes:[],request:{}}),R.value=[],z.value=null,J(!0);break;case`findPlaces`:await ce(e.searchQuery,e.placeType);break;case`getDirections`:if(!e.origin||!e.destination)throw Error(`Origin and destination are required`);await le(e.origin,e.destination,e.travelMode||`DRIVING`);break}}catch(e){let t=e instanceof Error?e.message:`An error occurred`;L.value=t,J(!1,t)}finally{I.value=!1}}},ce=async(e,t)=>{if(!k.value||!F)return;let n=k.value.getCenter();if(n)try{let r={textQuery:e||t||``,locationBias:{center:{lat:n.lat(),lng:n.lng()},radius:5e3},fields:[`id`,`displayName`,`formattedAddress`,`location`,`rating`,`userRatingCount`,`types`,`regularOpeningHours`],maxResultCount:10};t&&!e&&(r.includedType=t);let{places:i}=await F.searchByText(r);if(i&&i.length>0){[...A.value.keys()].filter(e=>e.startsWith(`place_`)).forEach(e=>{let t=A.value.get(e);t&&(t.map=null,A.value.delete(e))});let e=i.map((e,t)=>{let n=e.location,r=n?{lat:n.lat(),lng:n.lng()}:{lat:0,lng:0};return n&&X(r,`place_${e.id}`,e.displayName||void 0,String(t+1)),{placeId:e.id||``,name:e.displayName||``,address:e.formattedAddress||``,location:r,rating:e.rating??void 0,userRatingsTotal:e.userRatingCount??void 0,types:e.types,openNow:void 0}});if(R.value=e,z.value=null,e.length>0){let t=new google.maps.LatLngBounds;e.forEach(e=>{t.extend(e.location)}),k.value?.fitBounds(t)}J(!0,void 0,{places:e})}else J(!1,`No places found`)}catch{J(!1,`No places found`)}},le=async(e,t,n)=>{if(!j.value||!M.value)return;let r={origin:e,destination:t,travelMode:n};return new Promise(e=>{j.value.route(r,(t,n)=>{if(n===google.maps.DirectionsStatus.OK&&t){M.value.setDirections(t);let e=t.routes[0]?.legs[0];if(e){let n={summary:t.routes[0].summary||``,distance:e.distance?.text||``,duration:e.duration?.text||``,startAddress:e.start_address||``,endAddress:e.end_address||``,steps:e.steps?.map(e=>({instruction:e.instructions||``,distance:e.distance?.text||``,duration:e.duration?.text||``,travelMode:e.travel_mode||``,startLocation:e.start_location?{lat:e.start_location.lat(),lng:e.start_location.lng()}:void 0,endLocation:e.end_location?{lat:e.end_location.lat(),lng:e.end_location.lng()}:void 0}))||[],polyline:t.routes[0].overview_polyline||``};z.value=n,R.value=[],J(!0,void 0,{route:n})}}else J(!1,`Could not find directions`);e()})})},ue=e=>{k.value&&(k.value.setCenter(e.location),k.value.setZoom(17))},de=e=>{if(!k.value)return;let t=e.startLocation||e.endLocation;t&&(k.value.setCenter(t),k.value.setZoom(18))},fe=()=>{if(!k.value)return;let e=k.value.getZoom()||15;e<21&&k.value.setZoom(e+1)},pe=()=>{if(!k.value)return;let e=k.value.getZoom()||15;e>1&&k.value.setZoom(e-1)},$=null;return(0,t.watch)(()=>D.selectedResult?.data,async e=>{if(e&&k.value){let t=JSON.stringify(e);if(t===$)return;$=t,await Q(e)}}),(0,t.onMounted)(()=>{D.googleMapKey&&se()}),(0,t.onUnmounted)(()=>{Z()}),(D,A)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[(0,t.createElementVNode)(`div`,r,[(0,t.createElementVNode)(`h2`,i,(0,t.toDisplayString)(H.value),1),U.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,a,(0,t.toDisplayString)(U.value),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,o,[(0,t.createElementVNode)(`div`,s,[e.googleMapKey?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`mapContainer`,ref:O,class:`w-full h-full`},null,512)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,c,[(0,t.createElementVNode)(`div`,l,[A[0]||=(0,t.createElementVNode)(`div`,{class:`text-gray-500 mb-4`},`Google Maps API key not configured`,-1),W.value?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,href:W.value,target:`_blank`,class:`inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors`},` Open in Google Maps `,8,u)):(0,t.createCommentVNode)(``,!0)])])),I.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,d,[...A[1]||=[(0,t.createElementVNode)(`div`,{class:`text-gray-600`},`Loading...`,-1)]])):(0,t.createCommentVNode)(``,!0),L.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,f,(0,t.toDisplayString)(L.value),1)):(0,t.createCommentVNode)(``,!0),e.googleMapKey&&k.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,p,[(0,t.createElementVNode)(`button`,{onClick:fe,class:`w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center`,title:`Zoom in`},` + `),(0,t.createElementVNode)(`button`,{onClick:pe,class:`w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center`,title:`Zoom out`},` − `)])):(0,t.createCommentVNode)(``,!0)]),ae.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,m,[R.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,h,[A[3]||=(0,t.createElementVNode)(`h3`,{class:`font-semibold text-gray-800 mb-3`},`Search Results`,-1),(0,t.createElementVNode)(`div`,g,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(R.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.placeId,class:`p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors`,onClick:t=>ue(e)},[(0,t.createElementVNode)(`div`,_,(0,t.toDisplayString)(e.name),1),(0,t.createElementVNode)(`div`,v,(0,t.toDisplayString)(e.address),1),e.rating?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[A[2]||=(0,t.createElementVNode)(`span`,{class:`text-yellow-500 mr-1`},`★`,-1),(0,t.createElementVNode)(`span`,b,[(0,t.createTextVNode)((0,t.toDisplayString)(e.rating.toFixed(1))+` `,1),e.userRatingsTotal?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,x,` (`+(0,t.toDisplayString)(e.userRatingsTotal)+`) `,1)):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0),e.openNow===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([e.openNow?`text-green-600`:`text-red-600`,`text-sm mt-1`])},(0,t.toDisplayString)(e.openNow?`Open now`:`Closed`),3))],8,ee))),128))])])):(0,t.createCommentVNode)(``,!0),z.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,te,[A[6]||=(0,t.createElementVNode)(`h3`,{class:`font-semibold text-gray-800 mb-3`},`Directions`,-1),(0,t.createElementVNode)(`div`,S,[(0,t.createElementVNode)(`div`,ne,(0,t.toDisplayString)(z.value.distance),1),(0,t.createElementVNode)(`div`,C,(0,t.toDisplayString)(z.value.duration),1)]),(0,t.createElementVNode)(`div`,w,[(0,t.createElementVNode)(`div`,null,[A[4]||=(0,t.createElementVNode)(`strong`,null,`From:`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(z.value.startAddress),1)]),(0,t.createElementVNode)(`div`,null,[A[5]||=(0,t.createElementVNode)(`strong`,null,`To:`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(z.value.endAddress),1)])]),(0,t.createElementVNode)(`div`,T,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(z.value.steps,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`p-2 bg-gray-50 rounded text-sm cursor-pointer hover:bg-blue-50 transition-colors`,onClick:t=>de(e)},[(0,t.createElementVNode)(`div`,re,(0,t.toDisplayString)(K(e.instruction)),1),(0,t.createElementVNode)(`div`,ie,(0,t.toDisplayString)(e.distance)+` · `+(0,t.toDisplayString)(e.duration),1)],8,E))),128))])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])]))}}),O={class:`text-xs text-gray-600 mt-1 truncate`},k=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let n=e,r=e=>e?typeof e==`string`?e:`${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:``,i=(0,t.computed)(()=>({showLocation:`Map Location`,setCenter:`Center Map`,setZoom:`Zoom`,addMarker:`Add Marker`,clearMarkers:`Clear Markers`,findPlaces:`Place Search`,getDirections:`Directions`})[n.result.data?.action||`showLocation`]||`Map`),a=(0,t.computed)(()=>{let e=n.result.data;if(!e)return``;switch(e.action){case`showLocation`:case`setCenter`:case`addMarker`:return r(e.location);case`setZoom`:return`Level ${e.zoom}`;case`clearMarkers`:return`All markers cleared`;case`findPlaces`:return e.searchQuery||e.placeType||`Search`;case`getDirections`:return`${typeof e.origin==`string`?e.origin:`Start`} → ${typeof e.destination==`string`?e.destination:`End`}`;default:return r(e.location)}}),o=(0,t.computed)(()=>({showLocation:`bg-blue-50`,setCenter:`bg-blue-50`,setZoom:`bg-purple-50`,addMarker:`bg-green-50`,clearMarkers:`bg-gray-50`,findPlaces:`bg-yellow-50`,getDirections:`bg-orange-50`})[n.result.data?.action||`showLocation`]||`bg-blue-50`),s=(0,t.computed)(()=>({showLocation:`text-blue-600`,setCenter:`text-blue-600`,setZoom:`text-purple-600`,addMarker:`text-green-600`,clearMarkers:`text-gray-600`,findPlaces:`text-yellow-700`,getDirections:`text-orange-600`})[n.result.data?.action||`showLocation`]||`text-blue-600`);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`text-center p-4 rounded`,o.value])},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`font-medium`,s.value])},(0,t.toDisplayString)(i.value),3),(0,t.createElementVNode)(`div`,O,(0,t.toDisplayString)(a.value),1)],2))}}),A={...e.i,viewComponent:D,previewComponent:k,samples:e.t},j={plugin:A};exports.Preview=k,exports.TOOL_DEFINITION=e.o,exports.TOOL_NAME=e.s,exports.View=D,exports.default=j,exports.executeMap=e.n,exports.plugin=A,exports.pluginCore=e.i,exports.samples=e.t;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./samples-B6EsSrT6.cjs");let t=require("vue");var n={class:`w-full h-full bg-white flex flex-col relative`},r={class:`p-4 border-b border-gray-200`},i={class:`text-xl font-bold text-gray-800`},a={key:0,class:`text-gray-600 text-sm`},o={class:`flex-1 min-h-0 flex`},s={class:`flex-1 relative`},ee={key:1,class:`w-full h-full flex items-center justify-center bg-gray-100`},te={class:`text-center p-8`},ne=[`href`],c={key:2,class:`absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center`},l={key:3,class:`absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded`},u={key:4,class:`absolute top-4 right-4 flex flex-col gap-1`},re={key:0,class:`w-80 border-l border-gray-200 overflow-y-auto`},d={key:0,class:`p-4`},ie={class:`space-y-3`},ae=[`onClick`],oe={class:`font-medium text-gray-800`},se={class:`text-sm text-gray-600 mt-1`},ce={key:0,class:`flex items-center mt-1`},le={class:`text-sm text-gray-600`},f={key:0,class:`text-gray-400`},p={key:1,class:`p-4`},m={class:`bg-blue-50 rounded-lg p-3 mb-4`},h={class:`text-lg font-medium text-gray-800`},g={class:`text-gray-600`},_={class:`text-sm text-gray-600 mb-3`},v={class:`space-y-2`},y=[`onClick`],b={class:`text-gray-800`},ue={class:`text-gray-500 mt-1`},x=(0,t.defineComponent)({__name:`View`,props:{selectedResult:{},results:{},googleMapKey:{},onUpdateResult:{type:Function}},setup(e){let x=e,S=(0,t.ref)(null),C=(0,t.ref)(null),w=(0,t.ref)(new Map),T=(0,t.ref)(null),E=(0,t.ref)(null),D=(0,t.ref)(null),O,k,A=(0,t.ref)(!1),j=(0,t.ref)(null),M=(0,t.ref)([]),N=(0,t.ref)(null),P=(0,t.ref)(null),F=(0,t.ref)(15),I=()=>Array.isArray(x.results),L=(0,t.computed)(()=>{if(I()){let e=x.results??[];return e[e.length-1]?.data??void 0}return x.selectedResult?.data??void 0}),R=(0,t.computed)(()=>({showLocation:`Map Location`,setCenter:`Map View`,setZoom:`Map View`,addMarker:`Map Marker`,clearMarkers:`Map`,findPlaces:`Place Search`,getDirections:`Directions`})[L.value?.action||`showLocation`]||`Map`),z=(0,t.computed)(()=>{let e=L.value;if(!e)return``;switch(e.action){case`showLocation`:case`setCenter`:case`addMarker`:return H(e.location);case`setZoom`:return`Zoom level: ${e.zoom}`;case`findPlaces`:return e.searchQuery||e.placeType||``;case`getDirections`:return`${e.origin} → ${e.destination}`;default:return``}}),B=(0,t.computed)(()=>M.value.length>0||N.value!==null),V=(0,t.computed)(()=>{let e=L.value;if(!e?.location)return``;let t=H(e.location);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`}),H=e=>e?typeof e==`string`?e:`${e.lat}, ${e.lng}`:``,U=e=>new DOMParser().parseFromString(e,`text/html`).body.textContent||``,de=()=>{let e=[];return w.value.forEach((t,n)=>{let r=t.position;if(r){let i=typeof r.lat==`function`?r.lat():r.lat,a=typeof r.lng==`function`?r.lng():r.lng;e.push({id:n,position:{lat:i,lng:a},title:t.title||void 0})}}),e},W=(e,t,n)=>{if(!x.onUpdateResult)return;let r=L.value,i={action:r?.action||`showLocation`,success:e,groupId:r?.groupId,center:P.value||void 0,zoom:F.value,markers:de(),...n};t&&(i.error=t),x.onUpdateResult(i)},fe=()=>new Promise((e,t)=>{if(typeof google<`u`&&google.maps&&typeof google.maps.importLibrary==`function`){e();return}let n=document.querySelector(`script[src*="maps.googleapis.com"]`),r=n=>{typeof google<`u`&&google.maps&&typeof google.maps.importLibrary==`function`?e():Date.now()-n>1e4?t(Error(`Timeout waiting for Google Maps to load`)):setTimeout(()=>r(n),50)};if(n){r(Date.now());return}let i=document.createElement(`script`);i.src=`https://maps.googleapis.com/maps/api/js?key=${x.googleMapKey}&loading=async`,i.async=!0,i.defer=!0,i.onload=()=>r(Date.now()),i.onerror=()=>t(Error(`Failed to load Google Maps`)),document.head.appendChild(i)}),pe=async()=>{if(!(!S.value||!x.googleMapKey)&&!C.value)try{await fe();let e=await google.maps.importLibrary(`marker`),t=await google.maps.importLibrary(`places`);O=e.AdvancedMarkerElement,k=t.Place,C.value=new google.maps.Map(S.value,{center:{lat:35.6812,lng:139.7671},zoom:F.value,mapTypeControl:!0,streetViewControl:!0,fullscreenControl:!0,mapId:`DEMO_MAP_ID`}),D.value=new google.maps.Geocoder,T.value=new google.maps.DirectionsService,E.value=new google.maps.DirectionsRenderer,E.value.setMap(C.value),C.value.addListener(`center_changed`,()=>{let e=C.value?.getCenter();e&&(P.value={lat:e.lat(),lng:e.lng()})}),C.value.addListener(`zoom_changed`,()=>{F.value=C.value?.getZoom()||15}),I()?await $():x.selectedResult?.data&&(X=JSON.stringify(x.selectedResult.data),await J(x.selectedResult.data))}catch(e){j.value=e instanceof Error?e.message:`Failed to initialize map`}},G=async e=>typeof e==`string`?D.value?new Promise(t=>{D.value.geocode({address:e},(e,n)=>{if(n===`OK`&&e&&e[0]){let n=e[0].geometry.location;t({lat:n.lat(),lng:n.lng()})}else t(null)})}):null:e,K=(e,t,n,r)=>{let i;if(r){let e=document.createElement(`div`);e.className=`marker-label`,e.style.cssText=`background: #4285f4; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px;`,e.textContent=r,i=e}let a=new O({position:e,map:C.value,title:n,content:i});return w.value.set(t,a),a},q=()=>{w.value.forEach(e=>{e.map=null}),w.value.clear()},J=async e=>{if(C.value){A.value=!0,j.value=null;try{switch(e.action){case`showLocation`:case`setCenter`:{if(!e.location)throw Error(`Location is required`);let t=await G(e.location);if(!t)throw Error(`Could not find location`);C.value.setCenter(t),P.value=t,e.action===`showLocation`&&K(t,`location_${Date.now()}`,typeof e.location==`string`?e.location:void 0),W(!0);break}case`setZoom`:{let t=e.zoom||15;C.value.setZoom(t),F.value=t,W(!0);break}case`addMarker`:{if(!e.location)throw Error(`Location is required for marker`);let t=await G(e.location);if(!t)throw Error(`Could not find location for marker`);K(t,e.marker?.id||`marker_${Date.now()}`,e.marker?.title,e.marker?.label),W(!0);break}case`clearMarkers`:q(),E.value?.setDirections({routes:[],request:{}}),M.value=[],N.value=null,W(!0);break;case`findPlaces`:await me(e.searchQuery,e.placeType);break;case`getDirections`:if(!e.origin||!e.destination)throw Error(`Origin and destination are required`);await ye(e.origin,e.destination,e.travelMode||`DRIVING`);break}}catch(e){let t=e instanceof Error?e.message:`An error occurred`;j.value=t,W(!1,t)}finally{A.value=!1}}},me=async(e,t)=>{if(!C.value||!k)return;let n=C.value.getCenter();if(n)try{let r={textQuery:e||t||``,locationBias:{center:{lat:n.lat(),lng:n.lng()},radius:5e3},fields:[`id`,`displayName`,`formattedAddress`,`location`,`rating`,`userRatingCount`,`types`,`regularOpeningHours`],maxResultCount:10};t&&!e&&(r.includedType=t);let{places:i}=await k.searchByText(r);if(i&&i.length>0){[...w.value.keys()].filter(e=>e.startsWith(`place_`)).forEach(e=>{let t=w.value.get(e);t&&(t.map=null,w.value.delete(e))});let e=i.map((e,t)=>{let n=e.location,r=n?{lat:n.lat(),lng:n.lng()}:{lat:0,lng:0};return n&&K(r,`place_${e.id}`,e.displayName||void 0,String(t+1)),{placeId:e.id||``,name:e.displayName||``,address:e.formattedAddress||``,location:r,rating:e.rating??void 0,userRatingsTotal:e.userRatingCount??void 0,types:e.types,openNow:void 0}});if(M.value=e,N.value=null,e.length>0){let t=new google.maps.LatLngBounds;e.forEach(e=>{t.extend(e.location)}),C.value?.fitBounds(t)}W(!0,void 0,{places:e})}else W(!1,`No places found`)}catch{W(!1,`No places found`)}},Y=e=>e?{lat:e.lat(),lng:e.lng()}:void 0,he=e=>({instruction:e.instructions||``,distance:e.distance?.text||``,duration:e.duration?.text||``,travelMode:e.travel_mode||``,startLocation:Y(e.start_location),endLocation:Y(e.end_location)}),ge=e=>{let t=e.routes[0],n=t?.legs[0];return!t||!n?null:{summary:t.summary||``,distance:n.distance?.text||``,duration:n.duration?.text||``,startAddress:n.start_address||``,endAddress:n.end_address||``,steps:n.steps?.map(he)||[],polyline:t.overview_polyline||``}},_e=e=>{if(e instanceof Error&&`code`in e){let{code:t}=e;return typeof t==`string`?t:null}return null},ve=(e,t)=>_e(e)===`ZERO_RESULTS`?t===`TRANSIT`?`No transit route found. The Google Directions API does not provide transit directions within Japan.`:`No route found between these locations.`:e instanceof Error?e.message:`Could not find directions`,ye=async(e,t,n)=>{if(!T.value||!E.value)return;let r={origin:e,destination:t,travelMode:n};try{let e=await T.value.route(r),t=ge(e);if(!t)throw Error(`No route found between these locations.`);E.value.setDirections(e),N.value=t,M.value=[],W(!0,void 0,{route:t})}catch(e){throw Error(ve(e,n),{cause:e})}},be=e=>{C.value&&(C.value.setCenter(e.location),C.value.setZoom(17))},xe=e=>{if(!C.value)return;let t=e.startLocation||e.endLocation;t&&(C.value.setCenter(t),C.value.setZoom(18))},Se=()=>{if(!C.value)return;let e=C.value.getZoom()||15;e<21&&C.value.setZoom(e+1)},Ce=()=>{if(!C.value)return;let e=C.value.getZoom()||15;e>1&&C.value.setZoom(e-1)},X=null;(0,t.watch)(()=>x.selectedResult?.data,async e=>{if(!I()&&e&&C.value){let t=JSON.stringify(e);if(t===X)return;X=t,await J(e)}});let Z=0,Q,$=async()=>{if(!C.value||!x.results)return;let e=x.results,t=e[0]?.data?.groupId??null;(t!==Q||e.length<Z)&&(q(),N.value=null,M.value=[],Z=0,Q=t);for(let t=Z;t<e.length;t++){let n=e[t]?.data;n&&await J(n)}Z=e.length};return(0,t.watch)(()=>(x.results??[]).map(e=>JSON.stringify(e.data)).join(``),async()=>{I()&&C.value&&await $()}),(0,t.onMounted)(()=>{x.googleMapKey&&pe()}),(0,t.onUnmounted)(()=>{q()}),(x,w)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[(0,t.createElementVNode)(`div`,r,[(0,t.createElementVNode)(`h2`,i,(0,t.toDisplayString)(R.value),1),z.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,a,(0,t.toDisplayString)(z.value),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,o,[(0,t.createElementVNode)(`div`,s,[e.googleMapKey?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`mapContainer`,ref:S,class:`w-full h-full`},null,512)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ee,[(0,t.createElementVNode)(`div`,te,[w[0]||=(0,t.createElementVNode)(`div`,{class:`text-gray-500 mb-4`},`Google Maps API key not configured`,-1),V.value?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,href:V.value,target:`_blank`,class:`inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors`},` Open in Google Maps `,8,ne)):(0,t.createCommentVNode)(``,!0)])])),A.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,c,[...w[1]||=[(0,t.createElementVNode)(`div`,{class:`text-gray-600`},`Loading...`,-1)]])):(0,t.createCommentVNode)(``,!0),j.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,l,(0,t.toDisplayString)(j.value),1)):(0,t.createCommentVNode)(``,!0),e.googleMapKey&&C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,u,[(0,t.createElementVNode)(`button`,{onClick:Se,class:`w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center`,title:`Zoom in`},` + `),(0,t.createElementVNode)(`button`,{onClick:Ce,class:`w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center`,title:`Zoom out`},` − `)])):(0,t.createCommentVNode)(``,!0)]),B.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,re,[M.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,d,[w[3]||=(0,t.createElementVNode)(`h3`,{class:`font-semibold text-gray-800 mb-3`},`Search Results`,-1),(0,t.createElementVNode)(`div`,ie,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(M.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.placeId,class:`p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors`,onClick:t=>be(e)},[(0,t.createElementVNode)(`div`,oe,(0,t.toDisplayString)(e.name),1),(0,t.createElementVNode)(`div`,se,(0,t.toDisplayString)(e.address),1),e.rating?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ce,[w[2]||=(0,t.createElementVNode)(`span`,{class:`text-yellow-500 mr-1`},`★`,-1),(0,t.createElementVNode)(`span`,le,[(0,t.createTextVNode)((0,t.toDisplayString)(e.rating.toFixed(1))+` `,1),e.userRatingsTotal?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,f,` (`+(0,t.toDisplayString)(e.userRatingsTotal)+`) `,1)):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0),e.openNow===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([e.openNow?`text-green-600`:`text-red-600`,`text-sm mt-1`])},(0,t.toDisplayString)(e.openNow?`Open now`:`Closed`),3))],8,ae))),128))])])):(0,t.createCommentVNode)(``,!0),N.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,p,[w[6]||=(0,t.createElementVNode)(`h3`,{class:`font-semibold text-gray-800 mb-3`},`Directions`,-1),(0,t.createElementVNode)(`div`,m,[(0,t.createElementVNode)(`div`,h,(0,t.toDisplayString)(N.value.distance),1),(0,t.createElementVNode)(`div`,g,(0,t.toDisplayString)(N.value.duration),1)]),(0,t.createElementVNode)(`div`,_,[(0,t.createElementVNode)(`div`,null,[w[4]||=(0,t.createElementVNode)(`strong`,null,`From:`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(N.value.startAddress),1)]),(0,t.createElementVNode)(`div`,null,[w[5]||=(0,t.createElementVNode)(`strong`,null,`To:`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(N.value.endAddress),1)])]),(0,t.createElementVNode)(`div`,v,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(N.value.steps,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`p-2 bg-gray-50 rounded text-sm cursor-pointer hover:bg-blue-50 transition-colors`,onClick:t=>xe(e)},[(0,t.createElementVNode)(`div`,b,(0,t.toDisplayString)(U(e.instruction)),1),(0,t.createElementVNode)(`div`,ue,(0,t.toDisplayString)(e.distance)+` · `+(0,t.toDisplayString)(e.duration),1)],8,y))),128))])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])]))}}),S={class:`text-xs text-gray-600 mt-1 truncate`},C=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let n=e,r=e=>e?typeof e==`string`?e:`${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:``,i=(0,t.computed)(()=>({showLocation:`Map Location`,setCenter:`Center Map`,setZoom:`Zoom`,addMarker:`Add Marker`,clearMarkers:`Clear Markers`,findPlaces:`Place Search`,getDirections:`Directions`})[n.result.data?.action||`showLocation`]||`Map`),a=(0,t.computed)(()=>{let e=n.result.data;if(!e)return``;switch(e.action){case`showLocation`:case`setCenter`:case`addMarker`:return r(e.location);case`setZoom`:return`Level ${e.zoom}`;case`clearMarkers`:return`All markers cleared`;case`findPlaces`:return e.searchQuery||e.placeType||`Search`;case`getDirections`:return`${typeof e.origin==`string`?e.origin:`Start`} → ${typeof e.destination==`string`?e.destination:`End`}`;default:return r(e.location)}}),o=(0,t.computed)(()=>({showLocation:`bg-blue-50`,setCenter:`bg-blue-50`,setZoom:`bg-purple-50`,addMarker:`bg-green-50`,clearMarkers:`bg-gray-50`,findPlaces:`bg-yellow-50`,getDirections:`bg-orange-50`})[n.result.data?.action||`showLocation`]||`bg-blue-50`),s=(0,t.computed)(()=>({showLocation:`text-blue-600`,setCenter:`text-blue-600`,setZoom:`text-purple-600`,addMarker:`text-green-600`,clearMarkers:`text-gray-600`,findPlaces:`text-yellow-700`,getDirections:`text-orange-600`})[n.result.data?.action||`showLocation`]||`text-blue-600`);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`text-center p-4 rounded`,o.value])},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`font-medium`,s.value])},(0,t.toDisplayString)(i.value),3),(0,t.createElementVNode)(`div`,S,(0,t.toDisplayString)(a.value),1)],2))}}),w={...e.i,viewComponent:x,previewComponent:C,samples:e.t},T={plugin:w};exports.Preview=C,exports.TOOL_DEFINITION=e.o,exports.TOOL_NAME=e.s,exports.View=x,exports.default=T,exports.executeMap=e.n,exports.plugin=w,exports.pluginCore=e.i,exports.samples=e.t;
|
package/dist/vue.js
CHANGED
|
@@ -1,45 +1,52 @@
|
|
|
1
|
-
import { i as e, n as t, o as n, s as r, t as i } from "./samples-
|
|
1
|
+
import { i as e, n as t, o as n, s as r, t as i } from "./samples-BkkQxtFT.js";
|
|
2
2
|
import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, defineComponent as d, normalizeClass as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, watch as y } from "vue";
|
|
3
3
|
//#region src/vue/View.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class: "p-4 border-b border-gray-200" },
|
|
4
|
+
var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class: "p-4 border-b border-gray-200" }, S = { class: "text-xl font-bold text-gray-800" }, ee = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-gray-600 text-sm"
|
|
7
|
-
},
|
|
7
|
+
}, te = { class: "flex-1 min-h-0 flex" }, ne = { class: "flex-1 relative" }, re = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "w-full h-full flex items-center justify-center bg-gray-100"
|
|
10
|
-
},
|
|
10
|
+
}, ie = { class: "text-center p-8" }, ae = ["href"], oe = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center"
|
|
13
|
-
},
|
|
13
|
+
}, se = {
|
|
14
14
|
key: 3,
|
|
15
15
|
class: "absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded"
|
|
16
|
-
},
|
|
16
|
+
}, ce = {
|
|
17
17
|
key: 4,
|
|
18
18
|
class: "absolute top-4 right-4 flex flex-col gap-1"
|
|
19
|
-
},
|
|
19
|
+
}, le = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "w-80 border-l border-gray-200 overflow-y-auto"
|
|
22
|
-
},
|
|
22
|
+
}, ue = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "p-4"
|
|
25
|
-
},
|
|
25
|
+
}, de = { class: "space-y-3" }, fe = ["onClick"], pe = { class: "font-medium text-gray-800" }, me = { class: "text-sm text-gray-600 mt-1" }, he = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "flex items-center mt-1"
|
|
28
|
-
},
|
|
28
|
+
}, ge = { class: "text-sm text-gray-600" }, _e = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "text-gray-400"
|
|
31
|
-
},
|
|
31
|
+
}, ve = {
|
|
32
32
|
key: 1,
|
|
33
33
|
class: "p-4"
|
|
34
|
-
},
|
|
34
|
+
}, ye = { class: "bg-blue-50 rounded-lg p-3 mb-4" }, be = { class: "text-lg font-medium text-gray-800" }, xe = { class: "text-gray-600" }, C = { class: "text-sm text-gray-600 mb-3" }, w = { class: "space-y-2" }, T = ["onClick"], E = { class: "text-gray-800" }, D = { class: "text-gray-500 mt-1" }, O = /* @__PURE__ */ d({
|
|
35
35
|
__name: "View",
|
|
36
36
|
props: {
|
|
37
37
|
selectedResult: {},
|
|
38
|
+
results: {},
|
|
38
39
|
googleMapKey: {},
|
|
39
40
|
onUpdateResult: { type: Function }
|
|
40
41
|
},
|
|
41
42
|
setup(e) {
|
|
42
|
-
let t = e, n = g(null), r = g(null), i = g(/* @__PURE__ */ new Map()), d = g(null),
|
|
43
|
+
let t = e, n = g(null), r = g(null), i = g(/* @__PURE__ */ new Map()), d = g(null), O = g(null), k = g(null), A, j, M = g(!1), N = g(null), P = g([]), F = g(null), I = g(null), L = g(15), R = () => Array.isArray(t.results), z = o(() => {
|
|
44
|
+
if (R()) {
|
|
45
|
+
let e = t.results ?? [];
|
|
46
|
+
return e[e.length - 1]?.data ?? void 0;
|
|
47
|
+
}
|
|
48
|
+
return t.selectedResult?.data ?? void 0;
|
|
49
|
+
}), Se = o(() => ({
|
|
43
50
|
showLocation: "Map Location",
|
|
44
51
|
setCenter: "Map View",
|
|
45
52
|
setZoom: "Map View",
|
|
@@ -47,24 +54,24 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
47
54
|
clearMarkers: "Map",
|
|
48
55
|
findPlaces: "Place Search",
|
|
49
56
|
getDirections: "Directions"
|
|
50
|
-
})[
|
|
51
|
-
let e =
|
|
57
|
+
})[z.value?.action || "showLocation"] || "Map"), B = o(() => {
|
|
58
|
+
let e = z.value;
|
|
52
59
|
if (!e) return "";
|
|
53
60
|
switch (e.action) {
|
|
54
61
|
case "showLocation":
|
|
55
62
|
case "setCenter":
|
|
56
|
-
case "addMarker": return
|
|
63
|
+
case "addMarker": return H(e.location);
|
|
57
64
|
case "setZoom": return `Zoom level: ${e.zoom}`;
|
|
58
65
|
case "findPlaces": return e.searchQuery || e.placeType || "";
|
|
59
66
|
case "getDirections": return `${e.origin} → ${e.destination}`;
|
|
60
67
|
default: return "";
|
|
61
68
|
}
|
|
62
|
-
}),
|
|
63
|
-
let e =
|
|
69
|
+
}), Ce = o(() => P.value.length > 0 || F.value !== null), V = o(() => {
|
|
70
|
+
let e = z.value;
|
|
64
71
|
if (!e?.location) return "";
|
|
65
|
-
let
|
|
66
|
-
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(
|
|
67
|
-
}),
|
|
72
|
+
let t = H(e.location);
|
|
73
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`;
|
|
74
|
+
}), H = (e) => e ? typeof e == "string" ? e : `${e.lat}, ${e.lng}` : "", we = (e) => new DOMParser().parseFromString(e, "text/html").body.textContent || "", Te = () => {
|
|
68
75
|
let e = [];
|
|
69
76
|
return i.value.forEach((t, n) => {
|
|
70
77
|
let r = t.position;
|
|
@@ -80,18 +87,19 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
80
87
|
});
|
|
81
88
|
}
|
|
82
89
|
}), e;
|
|
83
|
-
},
|
|
90
|
+
}, U = (e, n, r) => {
|
|
84
91
|
if (!t.onUpdateResult) return;
|
|
85
|
-
let i = {
|
|
86
|
-
action:
|
|
92
|
+
let i = z.value, a = {
|
|
93
|
+
action: i?.action || "showLocation",
|
|
87
94
|
success: e,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
groupId: i?.groupId,
|
|
96
|
+
center: I.value || void 0,
|
|
97
|
+
zoom: L.value,
|
|
98
|
+
markers: Te(),
|
|
91
99
|
...r
|
|
92
100
|
};
|
|
93
|
-
n && (
|
|
94
|
-
},
|
|
101
|
+
n && (a.error = n), t.onUpdateResult(a);
|
|
102
|
+
}, Ee = () => new Promise((e, n) => {
|
|
95
103
|
if (typeof google < "u" && google.maps && typeof google.maps.importLibrary == "function") {
|
|
96
104
|
e();
|
|
97
105
|
return;
|
|
@@ -105,34 +113,34 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
105
113
|
}
|
|
106
114
|
let a = document.createElement("script");
|
|
107
115
|
a.src = `https://maps.googleapis.com/maps/api/js?key=${t.googleMapKey}&loading=async`, a.async = !0, a.defer = !0, a.onload = () => i(Date.now()), a.onerror = () => n(/* @__PURE__ */ Error("Failed to load Google Maps")), document.head.appendChild(a);
|
|
108
|
-
}),
|
|
116
|
+
}), De = async () => {
|
|
109
117
|
if (!(!n.value || !t.googleMapKey) && !r.value) try {
|
|
110
|
-
await
|
|
118
|
+
await Ee();
|
|
111
119
|
let e = await google.maps.importLibrary("marker"), i = await google.maps.importLibrary("places");
|
|
112
|
-
|
|
120
|
+
A = e.AdvancedMarkerElement, j = i.Place, r.value = new google.maps.Map(n.value, {
|
|
113
121
|
center: {
|
|
114
122
|
lat: 35.6812,
|
|
115
123
|
lng: 139.7671
|
|
116
124
|
},
|
|
117
|
-
zoom:
|
|
125
|
+
zoom: L.value,
|
|
118
126
|
mapTypeControl: !0,
|
|
119
127
|
streetViewControl: !0,
|
|
120
128
|
fullscreenControl: !0,
|
|
121
129
|
mapId: "DEMO_MAP_ID"
|
|
122
|
-
}),
|
|
130
|
+
}), k.value = new google.maps.Geocoder(), d.value = new google.maps.DirectionsService(), O.value = new google.maps.DirectionsRenderer(), O.value.setMap(r.value), r.value.addListener("center_changed", () => {
|
|
123
131
|
let e = r.value?.getCenter();
|
|
124
|
-
e && (
|
|
132
|
+
e && (I.value = {
|
|
125
133
|
lat: e.lat(),
|
|
126
134
|
lng: e.lng()
|
|
127
135
|
});
|
|
128
136
|
}), r.value.addListener("zoom_changed", () => {
|
|
129
|
-
|
|
130
|
-
}), t.selectedResult?.data && await
|
|
137
|
+
L.value = r.value?.getZoom() || 15;
|
|
138
|
+
}), R() ? await $() : t.selectedResult?.data && (X = JSON.stringify(t.selectedResult.data), await q(t.selectedResult.data));
|
|
131
139
|
} catch (e) {
|
|
132
|
-
|
|
140
|
+
N.value = e instanceof Error ? e.message : "Failed to initialize map";
|
|
133
141
|
}
|
|
134
|
-
},
|
|
135
|
-
|
|
142
|
+
}, W = async (e) => typeof e == "string" ? k.value ? new Promise((t) => {
|
|
143
|
+
k.value.geocode({ address: e }, (e, n) => {
|
|
136
144
|
if (n === "OK" && e && e[0]) {
|
|
137
145
|
let n = e[0].geometry.location;
|
|
138
146
|
t({
|
|
@@ -141,71 +149,71 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
141
149
|
});
|
|
142
150
|
} else t(null);
|
|
143
151
|
});
|
|
144
|
-
}) : null : e,
|
|
152
|
+
}) : null : e, G = (e, t, n, a) => {
|
|
145
153
|
let o;
|
|
146
154
|
if (a) {
|
|
147
155
|
let e = document.createElement("div");
|
|
148
156
|
e.className = "marker-label", e.style.cssText = "background: #4285f4; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px;", e.textContent = a, o = e;
|
|
149
157
|
}
|
|
150
|
-
let s = new
|
|
158
|
+
let s = new A({
|
|
151
159
|
position: e,
|
|
152
160
|
map: r.value,
|
|
153
161
|
title: n,
|
|
154
162
|
content: o
|
|
155
163
|
});
|
|
156
164
|
return i.value.set(t, s), s;
|
|
157
|
-
},
|
|
165
|
+
}, K = () => {
|
|
158
166
|
i.value.forEach((e) => {
|
|
159
167
|
e.map = null;
|
|
160
168
|
}), i.value.clear();
|
|
161
|
-
},
|
|
169
|
+
}, q = async (e) => {
|
|
162
170
|
if (r.value) {
|
|
163
|
-
|
|
171
|
+
M.value = !0, N.value = null;
|
|
164
172
|
try {
|
|
165
173
|
switch (e.action) {
|
|
166
174
|
case "showLocation":
|
|
167
175
|
case "setCenter": {
|
|
168
176
|
if (!e.location) throw Error("Location is required");
|
|
169
|
-
let t = await
|
|
177
|
+
let t = await W(e.location);
|
|
170
178
|
if (!t) throw Error("Could not find location");
|
|
171
|
-
r.value.setCenter(t),
|
|
179
|
+
r.value.setCenter(t), I.value = t, e.action === "showLocation" && G(t, `location_${Date.now()}`, typeof e.location == "string" ? e.location : void 0), U(!0);
|
|
172
180
|
break;
|
|
173
181
|
}
|
|
174
182
|
case "setZoom": {
|
|
175
183
|
let t = e.zoom || 15;
|
|
176
|
-
r.value.setZoom(t),
|
|
184
|
+
r.value.setZoom(t), L.value = t, U(!0);
|
|
177
185
|
break;
|
|
178
186
|
}
|
|
179
187
|
case "addMarker": {
|
|
180
188
|
if (!e.location) throw Error("Location is required for marker");
|
|
181
|
-
let t = await
|
|
189
|
+
let t = await W(e.location);
|
|
182
190
|
if (!t) throw Error("Could not find location for marker");
|
|
183
|
-
|
|
191
|
+
G(t, e.marker?.id || `marker_${Date.now()}`, e.marker?.title, e.marker?.label), U(!0);
|
|
184
192
|
break;
|
|
185
193
|
}
|
|
186
194
|
case "clearMarkers":
|
|
187
|
-
|
|
195
|
+
K(), O.value?.setDirections({
|
|
188
196
|
routes: [],
|
|
189
197
|
request: {}
|
|
190
|
-
}),
|
|
198
|
+
}), P.value = [], F.value = null, U(!0);
|
|
191
199
|
break;
|
|
192
200
|
case "findPlaces":
|
|
193
|
-
await
|
|
201
|
+
await Oe(e.searchQuery, e.placeType);
|
|
194
202
|
break;
|
|
195
203
|
case "getDirections":
|
|
196
204
|
if (!e.origin || !e.destination) throw Error("Origin and destination are required");
|
|
197
|
-
await
|
|
205
|
+
await Ne(e.origin, e.destination, e.travelMode || "DRIVING");
|
|
198
206
|
break;
|
|
199
207
|
}
|
|
200
208
|
} catch (e) {
|
|
201
209
|
let t = e instanceof Error ? e.message : "An error occurred";
|
|
202
|
-
|
|
210
|
+
N.value = t, U(!1, t);
|
|
203
211
|
} finally {
|
|
204
|
-
|
|
212
|
+
M.value = !1;
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
|
-
},
|
|
208
|
-
if (!r.value || !
|
|
215
|
+
}, Oe = async (e, t) => {
|
|
216
|
+
if (!r.value || !j) return;
|
|
209
217
|
let n = r.value.getCenter();
|
|
210
218
|
if (n) try {
|
|
211
219
|
let a = {
|
|
@@ -230,7 +238,7 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
230
238
|
maxResultCount: 10
|
|
231
239
|
};
|
|
232
240
|
t && !e && (a.includedType = t);
|
|
233
|
-
let { places: o } = await
|
|
241
|
+
let { places: o } = await j.searchByText(a);
|
|
234
242
|
if (o && o.length > 0) {
|
|
235
243
|
[...i.value.keys()].filter((e) => e.startsWith("place_")).forEach((e) => {
|
|
236
244
|
let t = i.value.get(e);
|
|
@@ -244,7 +252,7 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
244
252
|
lat: 0,
|
|
245
253
|
lng: 0
|
|
246
254
|
};
|
|
247
|
-
return n &&
|
|
255
|
+
return n && G(r, `place_${e.id}`, e.displayName || void 0, String(t + 1)), {
|
|
248
256
|
placeId: e.id || "",
|
|
249
257
|
name: e.displayName || "",
|
|
250
258
|
address: e.formattedAddress || "",
|
|
@@ -255,130 +263,143 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
255
263
|
openNow: void 0
|
|
256
264
|
};
|
|
257
265
|
});
|
|
258
|
-
if (
|
|
266
|
+
if (P.value = e, F.value = null, e.length > 0) {
|
|
259
267
|
let t = new google.maps.LatLngBounds();
|
|
260
268
|
e.forEach((e) => {
|
|
261
269
|
t.extend(e.location);
|
|
262
270
|
}), r.value?.fitBounds(t);
|
|
263
271
|
}
|
|
264
|
-
|
|
265
|
-
} else
|
|
272
|
+
U(!0, void 0, { places: e });
|
|
273
|
+
} else U(!1, "No places found");
|
|
266
274
|
} catch {
|
|
267
|
-
|
|
275
|
+
U(!1, "No places found");
|
|
268
276
|
}
|
|
269
|
-
},
|
|
270
|
-
|
|
277
|
+
}, J = (e) => e ? {
|
|
278
|
+
lat: e.lat(),
|
|
279
|
+
lng: e.lng()
|
|
280
|
+
} : void 0, ke = (e) => ({
|
|
281
|
+
instruction: e.instructions || "",
|
|
282
|
+
distance: e.distance?.text || "",
|
|
283
|
+
duration: e.duration?.text || "",
|
|
284
|
+
travelMode: e.travel_mode || "",
|
|
285
|
+
startLocation: J(e.start_location),
|
|
286
|
+
endLocation: J(e.end_location)
|
|
287
|
+
}), Ae = (e) => {
|
|
288
|
+
let t = e.routes[0], n = t?.legs[0];
|
|
289
|
+
return !t || !n ? null : {
|
|
290
|
+
summary: t.summary || "",
|
|
291
|
+
distance: n.distance?.text || "",
|
|
292
|
+
duration: n.duration?.text || "",
|
|
293
|
+
startAddress: n.start_address || "",
|
|
294
|
+
endAddress: n.end_address || "",
|
|
295
|
+
steps: n.steps?.map(ke) || [],
|
|
296
|
+
polyline: t.overview_polyline || ""
|
|
297
|
+
};
|
|
298
|
+
}, je = (e) => {
|
|
299
|
+
if (e instanceof Error && "code" in e) {
|
|
300
|
+
let { code: t } = e;
|
|
301
|
+
return typeof t == "string" ? t : null;
|
|
302
|
+
}
|
|
303
|
+
return null;
|
|
304
|
+
}, Me = (e, t) => je(e) === "ZERO_RESULTS" ? t === "TRANSIT" ? "No transit route found. The Google Directions API does not provide transit directions within Japan." : "No route found between these locations." : e instanceof Error ? e.message : "Could not find directions", Ne = async (e, t, n) => {
|
|
305
|
+
if (!d.value || !O.value) return;
|
|
271
306
|
let r = {
|
|
272
307
|
origin: e,
|
|
273
308
|
destination: t,
|
|
274
309
|
travelMode: n
|
|
275
310
|
};
|
|
276
|
-
|
|
277
|
-
d.value.route(r,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
distance: e.distance?.text || "",
|
|
285
|
-
duration: e.duration?.text || "",
|
|
286
|
-
startAddress: e.start_address || "",
|
|
287
|
-
endAddress: e.end_address || "",
|
|
288
|
-
steps: e.steps?.map((e) => ({
|
|
289
|
-
instruction: e.instructions || "",
|
|
290
|
-
distance: e.distance?.text || "",
|
|
291
|
-
duration: e.duration?.text || "",
|
|
292
|
-
travelMode: e.travel_mode || "",
|
|
293
|
-
startLocation: e.start_location ? {
|
|
294
|
-
lat: e.start_location.lat(),
|
|
295
|
-
lng: e.start_location.lng()
|
|
296
|
-
} : void 0,
|
|
297
|
-
endLocation: e.end_location ? {
|
|
298
|
-
lat: e.end_location.lat(),
|
|
299
|
-
lng: e.end_location.lng()
|
|
300
|
-
} : void 0
|
|
301
|
-
})) || [],
|
|
302
|
-
polyline: t.routes[0].overview_polyline || ""
|
|
303
|
-
};
|
|
304
|
-
V.value = n, B.value = [], q(!0, void 0, { route: n });
|
|
305
|
-
}
|
|
306
|
-
} else q(!1, "Could not find directions");
|
|
307
|
-
e();
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
}, we = (e) => {
|
|
311
|
+
try {
|
|
312
|
+
let e = await d.value.route(r), t = Ae(e);
|
|
313
|
+
if (!t) throw Error("No route found between these locations.");
|
|
314
|
+
O.value.setDirections(e), F.value = t, P.value = [], U(!0, void 0, { route: t });
|
|
315
|
+
} catch (e) {
|
|
316
|
+
throw Error(Me(e, n), { cause: e });
|
|
317
|
+
}
|
|
318
|
+
}, Pe = (e) => {
|
|
311
319
|
r.value && (r.value.setCenter(e.location), r.value.setZoom(17));
|
|
312
|
-
},
|
|
320
|
+
}, Y = (e) => {
|
|
313
321
|
if (!r.value) return;
|
|
314
322
|
let t = e.startLocation || e.endLocation;
|
|
315
323
|
t && (r.value.setCenter(t), r.value.setZoom(18));
|
|
316
|
-
},
|
|
324
|
+
}, Fe = () => {
|
|
317
325
|
if (!r.value) return;
|
|
318
326
|
let e = r.value.getZoom() || 15;
|
|
319
327
|
e < 21 && r.value.setZoom(e + 1);
|
|
320
|
-
},
|
|
328
|
+
}, Ie = () => {
|
|
321
329
|
if (!r.value) return;
|
|
322
330
|
let e = r.value.getZoom() || 15;
|
|
323
331
|
e > 1 && r.value.setZoom(e - 1);
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
if (e && r.value) {
|
|
332
|
+
}, X = null;
|
|
333
|
+
y(() => t.selectedResult?.data, async (e) => {
|
|
334
|
+
if (!R() && e && r.value) {
|
|
327
335
|
let t = JSON.stringify(e);
|
|
328
|
-
if (t ===
|
|
329
|
-
|
|
336
|
+
if (t === X) return;
|
|
337
|
+
X = t, await q(e);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
let Z = 0, Q, $ = async () => {
|
|
341
|
+
if (!r.value || !t.results) return;
|
|
342
|
+
let e = t.results, n = e[0]?.data?.groupId ?? null;
|
|
343
|
+
(n !== Q || e.length < Z) && (K(), F.value = null, P.value = [], Z = 0, Q = n);
|
|
344
|
+
for (let t = Z; t < e.length; t++) {
|
|
345
|
+
let n = e[t]?.data;
|
|
346
|
+
n && await q(n);
|
|
330
347
|
}
|
|
348
|
+
Z = e.length;
|
|
349
|
+
};
|
|
350
|
+
return y(() => (t.results ?? []).map((e) => JSON.stringify(e.data)).join(""), async () => {
|
|
351
|
+
R() && r.value && await $();
|
|
331
352
|
}), p(() => {
|
|
332
|
-
t.googleMapKey &&
|
|
353
|
+
t.googleMapKey && De();
|
|
333
354
|
}), m(() => {
|
|
334
|
-
|
|
335
|
-
}), (t, i) => (h(), c("div", b, [l("div", x, [l("h2",
|
|
355
|
+
K();
|
|
356
|
+
}), (t, i) => (h(), c("div", b, [l("div", x, [l("h2", S, v(Se.value), 1), B.value ? (h(), c("p", ee, v(B.value), 1)) : s("", !0)]), l("div", te, [l("div", ne, [
|
|
336
357
|
e.googleMapKey ? (h(), c("div", {
|
|
337
358
|
key: 0,
|
|
338
359
|
ref_key: "mapContainer",
|
|
339
360
|
ref: n,
|
|
340
361
|
class: "w-full h-full"
|
|
341
|
-
}, null, 512)) : (h(), c("div",
|
|
362
|
+
}, null, 512)) : (h(), c("div", re, [l("div", ie, [i[0] ||= l("div", { class: "text-gray-500 mb-4" }, "Google Maps API key not configured", -1), V.value ? (h(), c("a", {
|
|
342
363
|
key: 0,
|
|
343
|
-
href:
|
|
364
|
+
href: V.value,
|
|
344
365
|
target: "_blank",
|
|
345
366
|
class: "inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"
|
|
346
|
-
}, " Open in Google Maps ", 8,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
e.googleMapKey && r.value ? (h(), c("div",
|
|
350
|
-
onClick:
|
|
367
|
+
}, " Open in Google Maps ", 8, ae)) : s("", !0)])])),
|
|
368
|
+
M.value ? (h(), c("div", oe, [...i[1] ||= [l("div", { class: "text-gray-600" }, "Loading...", -1)]])) : s("", !0),
|
|
369
|
+
N.value ? (h(), c("div", se, v(N.value), 1)) : s("", !0),
|
|
370
|
+
e.googleMapKey && r.value ? (h(), c("div", ce, [l("button", {
|
|
371
|
+
onClick: Fe,
|
|
351
372
|
class: "w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",
|
|
352
373
|
title: "Zoom in"
|
|
353
374
|
}, " + "), l("button", {
|
|
354
|
-
onClick:
|
|
375
|
+
onClick: Ie,
|
|
355
376
|
class: "w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",
|
|
356
377
|
title: "Zoom out"
|
|
357
378
|
}, " − ")])) : s("", !0)
|
|
358
|
-
]),
|
|
379
|
+
]), Ce.value ? (h(), c("div", le, [P.value.length > 0 ? (h(), c("div", ue, [i[3] ||= l("h3", { class: "font-semibold text-gray-800 mb-3" }, "Search Results", -1), l("div", de, [(h(!0), c(a, null, _(P.value, (e) => (h(), c("div", {
|
|
359
380
|
key: e.placeId,
|
|
360
381
|
class: "p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors",
|
|
361
|
-
onClick: (t) =>
|
|
382
|
+
onClick: (t) => Pe(e)
|
|
362
383
|
}, [
|
|
363
|
-
l("div",
|
|
364
|
-
l("div",
|
|
365
|
-
e.rating ? (h(), c("div",
|
|
384
|
+
l("div", pe, v(e.name), 1),
|
|
385
|
+
l("div", me, v(e.address), 1),
|
|
386
|
+
e.rating ? (h(), c("div", he, [i[2] ||= l("span", { class: "text-yellow-500 mr-1" }, "★", -1), l("span", ge, [u(v(e.rating.toFixed(1)) + " ", 1), e.userRatingsTotal ? (h(), c("span", _e, " (" + v(e.userRatingsTotal) + ") ", 1)) : s("", !0)])])) : s("", !0),
|
|
366
387
|
e.openNow === void 0 ? s("", !0) : (h(), c("div", {
|
|
367
388
|
key: 1,
|
|
368
389
|
class: f([e.openNow ? "text-green-600" : "text-red-600", "text-sm mt-1"])
|
|
369
390
|
}, v(e.openNow ? "Open now" : "Closed"), 3))
|
|
370
|
-
], 8,
|
|
391
|
+
], 8, fe))), 128))])])) : s("", !0), F.value ? (h(), c("div", ve, [
|
|
371
392
|
i[6] ||= l("h3", { class: "font-semibold text-gray-800 mb-3" }, "Directions", -1),
|
|
372
|
-
l("div",
|
|
373
|
-
l("div",
|
|
374
|
-
l("div",
|
|
393
|
+
l("div", ye, [l("div", be, v(F.value.distance), 1), l("div", xe, v(F.value.duration), 1)]),
|
|
394
|
+
l("div", C, [l("div", null, [i[4] ||= l("strong", null, "From:", -1), u(" " + v(F.value.startAddress), 1)]), l("div", null, [i[5] ||= l("strong", null, "To:", -1), u(" " + v(F.value.endAddress), 1)])]),
|
|
395
|
+
l("div", w, [(h(!0), c(a, null, _(F.value.steps, (e, t) => (h(), c("div", {
|
|
375
396
|
key: t,
|
|
376
397
|
class: "p-2 bg-gray-50 rounded text-sm cursor-pointer hover:bg-blue-50 transition-colors",
|
|
377
|
-
onClick: (t) =>
|
|
378
|
-
}, [l("div",
|
|
398
|
+
onClick: (t) => Y(e)
|
|
399
|
+
}, [l("div", E, v(we(e.instruction)), 1), l("div", D, v(e.distance) + " · " + v(e.duration), 1)], 8, T))), 128))])
|
|
379
400
|
])) : s("", !0)])) : s("", !0)])]));
|
|
380
401
|
}
|
|
381
|
-
}),
|
|
402
|
+
}), k = { class: "text-xs text-gray-600 mt-1 truncate" }, A = /* @__PURE__ */ d({
|
|
382
403
|
__name: "Preview",
|
|
383
404
|
props: { result: {} },
|
|
384
405
|
setup(e) {
|
|
@@ -420,13 +441,13 @@ var b = { class: "w-full h-full bg-white flex flex-col relative" }, x = { class:
|
|
|
420
441
|
findPlaces: "text-yellow-700",
|
|
421
442
|
getDirections: "text-orange-600"
|
|
422
443
|
})[t.result.data?.action || "showLocation"] || "text-blue-600");
|
|
423
|
-
return (e, t) => (h(), c("div", { class: f(["text-center p-4 rounded", a.value]) }, [l("div", { class: f(["font-medium", s.value]) }, v(r.value), 3), l("div",
|
|
444
|
+
return (e, t) => (h(), c("div", { class: f(["text-center p-4 rounded", a.value]) }, [l("div", { class: f(["font-medium", s.value]) }, v(r.value), 3), l("div", k, v(i.value), 1)], 2));
|
|
424
445
|
}
|
|
425
|
-
}),
|
|
446
|
+
}), j = {
|
|
426
447
|
...e,
|
|
427
|
-
viewComponent:
|
|
428
|
-
previewComponent:
|
|
448
|
+
viewComponent: O,
|
|
449
|
+
previewComponent: A,
|
|
429
450
|
samples: i
|
|
430
|
-
},
|
|
451
|
+
}, M = { plugin: j };
|
|
431
452
|
//#endregion
|
|
432
|
-
export {
|
|
453
|
+
export { A as Preview, n as TOOL_DEFINITION, r as TOOL_NAME, O as View, M as default, t as executeMap, j as plugin, e as pluginCore, i as samples };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gui-chat-plugin/google-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Google Map location plugin for GUI Chat applications",
|
|
6
6
|
"author": "receptron",
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@eslint/js": "^10.0.1",
|
|
38
|
-
"@tailwindcss/vite": "^4.
|
|
39
|
-
"@types/google.maps": "^3.
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
41
|
-
"@typescript-eslint/parser": "^8.59.
|
|
42
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
43
|
-
"eslint": "^10.
|
|
38
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
39
|
+
"@types/google.maps": "^3.64.1",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
41
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
42
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
43
|
+
"eslint": "^10.4.0",
|
|
44
44
|
"eslint-plugin-vue": "^10.9.1",
|
|
45
45
|
"globals": "^17.6.0",
|
|
46
46
|
"gui-chat-protocol": "^0.3.3",
|
|
47
|
-
"openai": "^6.
|
|
48
|
-
"tailwindcss": "^4.
|
|
47
|
+
"openai": "^6.39.0",
|
|
48
|
+
"tailwindcss": "^4.3.0",
|
|
49
49
|
"typescript": "~6.0.3",
|
|
50
|
-
"vite": "^8.0.
|
|
50
|
+
"vite": "^8.0.14",
|
|
51
51
|
"vue": "^3.5.34",
|
|
52
52
|
"vue-eslint-parser": "^10.4.0",
|
|
53
|
-
"vue-tsc": "^3.
|
|
53
|
+
"vue-tsc": "^3.3.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"vue": "^3.5.0"
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var e=`mapControl`,t={type:`function`,name:e,description:`Control a Google Map interactively. Supports showing locations, adding markers, searching for places, and getting directions.
|
|
2
|
-
|
|
3
|
-
Available actions:
|
|
4
|
-
- showLocation: Display a location on the map (default action)
|
|
5
|
-
- setCenter: Change the map center without markers
|
|
6
|
-
- setZoom: Change the zoom level (1-21)
|
|
7
|
-
- addMarker: Add a marker to the map
|
|
8
|
-
- clearMarkers: Remove all markers from the map
|
|
9
|
-
- findPlaces: Search for nearby places using Google Places API
|
|
10
|
-
- getDirections: Get directions between two locations`,parameters:{type:`object`,properties:{action:{type:`string`,enum:[`showLocation`,`setCenter`,`setZoom`,`addMarker`,`clearMarkers`,`findPlaces`,`getDirections`],description:`The action to perform. Defaults to 'showLocation' if not specified.`},location:{type:`string`,description:`Location name, address, or place (e.g., 'Tokyo Station', 'Paris, France'). Used with showLocation, setCenter, addMarker actions.`},lat:{type:`number`,description:`Latitude coordinate. Can be used instead of location for precise positioning.`},lng:{type:`number`,description:`Longitude coordinate. Can be used instead of location for precise positioning.`},zoom:{type:`integer`,minimum:1,maximum:21,description:`Zoom level for setZoom action (1=world, 15=streets, 21=buildings). Default is 15.`},searchQuery:{type:`string`,description:`Text search query for findPlaces action (e.g., 'ramen', 'coffee shop').`},placeType:{type:`string`,enum:`accounting.airport.amusement_park.aquarium.art_gallery.atm.bakery.bank.bar.beauty_salon.bicycle_store.book_store.bowling_alley.bus_station.cafe.campground.car_dealer.car_rental.car_repair.car_wash.casino.cemetery.church.city_hall.clothing_store.convenience_store.courthouse.dentist.department_store.doctor.drugstore.electrician.electronics_store.embassy.fire_station.florist.funeral_home.furniture_store.gas_station.gym.hair_care.hardware_store.hindu_temple.home_goods_store.hospital.insurance_agency.jewelry_store.laundry.lawyer.library.light_rail_station.liquor_store.local_government_office.locksmith.lodging.meal_delivery.meal_takeaway.mosque.movie_rental.movie_theater.moving_company.museum.night_club.painter.park.parking.pet_store.pharmacy.physiotherapist.plumber.police.post_office.primary_school.real_estate_agency.restaurant.roofing_contractor.rv_park.school.secondary_school.shoe_store.shopping_mall.spa.stadium.storage.store.subway_station.supermarket.synagogue.taxi_stand.tourist_attraction.train_station.transit_station.travel_agency.university.veterinary_care.zoo`.split(`.`),description:`Type of place to search for with findPlaces action. Use with or instead of searchQuery.`},origin:{type:`string`,description:`Starting point for getDirections action. Can be a place name or address.`},destination:{type:`string`,description:`End point for getDirections action. Can be a place name or address.`},travelMode:{type:`string`,enum:[`DRIVING`,`WALKING`,`BICYCLING`,`TRANSIT`],description:`Travel mode for getDirections action. Defaults to DRIVING.`},markerTitle:{type:`string`,description:`Title for the marker (shown on hover) when using addMarker.`},markerLabel:{type:`string`,description:`Single character label displayed on the marker when using addMarker.`}},required:[]}},n=`showLocation`,r=15,i=`DRIVING`,a=()=>`marker_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,o=e=>Number.isInteger(e)&&e>=1&&e<=21,s=e=>!!(e.location||e.lat!==void 0&&e.lng!==void 0),c=e=>e.lat!==void 0&&e.lng!==void 0?{lat:e.lat,lng:e.lng}:e.location,l=async(e,t)=>{let l=t.action||n;switch(l){case`showLocation`:case`setCenter`:case`addMarker`:{if(!s(t))throw Error(`${l} requires either 'location' or both 'lat' and 'lng' parameters`);let e=c(t),n={action:l,location:e};l===`addMarker`&&(n.marker={id:a(),position:typeof e==`string`?{lat:0,lng:0}:e,title:t.markerTitle,label:t.markerLabel?.charAt(0)});let r=typeof e==`string`?e:`${e?.lat}, ${e?.lng}`;return{message:{showLocation:`Showing ${r} on the map`,setCenter:`Centering map on ${r}`,addMarker:`Adding marker at ${r}`}[l],data:n}}case`setZoom`:{let e=t.zoom??r;if(!o(e))throw Error(`Zoom level must be an integer between 1 and 21`);return{message:`Setting zoom level to ${e}`,data:{action:l,zoom:e}}}case`clearMarkers`:return{message:`Clearing all markers from the map`,data:{action:l}};case`findPlaces`:if(!t.searchQuery&&!t.placeType)throw Error(`findPlaces requires either 'searchQuery' or 'placeType' parameter`);return{message:`Searching for ${t.searchQuery?`"${t.searchQuery}"`:t.placeType} nearby`,data:{action:l,searchQuery:t.searchQuery,placeType:t.placeType}};case`getDirections`:{if(!t.origin||!t.destination)throw Error(`getDirections requires both 'origin' and 'destination' parameters`);let e=t.travelMode||i;return{message:`Getting ${e.toLowerCase()} directions from ${t.origin} to ${t.destination}`,data:{action:l,origin:t.origin,destination:t.destination,travelMode:e}}}default:throw Error(`Unknown action: ${l}`)}},u=`You have access to the mapControl tool for interactive map operations.
|
|
11
|
-
|
|
12
|
-
## Basic Usage
|
|
13
|
-
|
|
14
|
-
Show a location:
|
|
15
|
-
\`\`\`
|
|
16
|
-
mapControl(location: "Tokyo Station")
|
|
17
|
-
mapControl(action: "showLocation", location: "Paris, France")
|
|
18
|
-
\`\`\`
|
|
19
|
-
|
|
20
|
-
## Available Actions
|
|
21
|
-
|
|
22
|
-
### showLocation (default)
|
|
23
|
-
Display a location on the map with a marker.
|
|
24
|
-
- Use \`location\` for place names/addresses
|
|
25
|
-
- Or use \`lat\` and \`lng\` for coordinates
|
|
26
|
-
|
|
27
|
-
### setCenter
|
|
28
|
-
Move the map center without adding markers.
|
|
29
|
-
\`\`\`
|
|
30
|
-
mapControl(action: "setCenter", location: "Shibuya, Tokyo")
|
|
31
|
-
\`\`\`
|
|
32
|
-
|
|
33
|
-
### setZoom
|
|
34
|
-
Change the zoom level (1-21).
|
|
35
|
-
- 1-5: Continent/Country level
|
|
36
|
-
- 6-10: Region/City level
|
|
37
|
-
- 11-15: Street level
|
|
38
|
-
- 16-21: Building level
|
|
39
|
-
\`\`\`
|
|
40
|
-
mapControl(action: "setZoom", zoom: 12)
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
### addMarker
|
|
44
|
-
Add a marker at a location (without centering).
|
|
45
|
-
\`\`\`
|
|
46
|
-
mapControl(action: "addMarker", location: "Tokyo Tower", markerTitle: "Tokyo Tower", markerLabel: "T")
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
### clearMarkers
|
|
50
|
-
Remove all markers from the map.
|
|
51
|
-
\`\`\`
|
|
52
|
-
mapControl(action: "clearMarkers")
|
|
53
|
-
\`\`\`
|
|
54
|
-
|
|
55
|
-
### findPlaces
|
|
56
|
-
Search for nearby places using Google Places API.
|
|
57
|
-
\`\`\`
|
|
58
|
-
mapControl(action: "findPlaces", searchQuery: "ramen")
|
|
59
|
-
mapControl(action: "findPlaces", placeType: "restaurant")
|
|
60
|
-
mapControl(action: "findPlaces", searchQuery: "coffee", placeType: "cafe")
|
|
61
|
-
\`\`\`
|
|
62
|
-
|
|
63
|
-
### getDirections
|
|
64
|
-
Get directions between two locations.
|
|
65
|
-
\`\`\`
|
|
66
|
-
mapControl(action: "getDirections", origin: "Tokyo Station", destination: "Tokyo Tower", travelMode: "WALKING")
|
|
67
|
-
\`\`\`
|
|
68
|
-
Travel modes: DRIVING, WALKING, BICYCLING, TRANSIT
|
|
69
|
-
|
|
70
|
-
## Response Data
|
|
71
|
-
|
|
72
|
-
The map will return JSON data with the results of each action, including:
|
|
73
|
-
- Current center coordinates and zoom level
|
|
74
|
-
- Markers on the map
|
|
75
|
-
- Place search results with ratings and addresses
|
|
76
|
-
- Route information with distance and duration`,d={toolDefinition:t,execute:l,generatingMessage:`Loading map...`,isEnabled:e=>!!e?.googleMapKey,backends:[`map`],systemPrompt:u},f=l,p=[{name:`Show Tokyo Station`,args:{action:`showLocation`,location:`Tokyo Station, Japan`}},{name:`Show Eiffel Tower`,args:{action:`showLocation`,location:`Eiffel Tower, Paris, France`}},{name:`Show coordinates`,args:{action:`showLocation`,lat:40.7128,lng:-74.006}},{name:`Center on Shibuya`,args:{action:`setCenter`,location:`Shibuya, Tokyo`}},{name:`Zoom to street level`,args:{action:`setZoom`,zoom:17}},{name:`Zoom to city level`,args:{action:`setZoom`,zoom:12}},{name:`Add marker at Tokyo Tower`,args:{action:`addMarker`,location:`Tokyo Tower, Japan`,markerTitle:`Tokyo Tower`,markerLabel:`T`}},{name:`Add marker with coordinates`,args:{action:`addMarker`,lat:35.6586,lng:139.7454,markerTitle:`Custom Location`}},{name:`Clear all markers`,args:{action:`clearMarkers`}},{name:`Find nearby ramen`,args:{action:`findPlaces`,searchQuery:`ramen`}},{name:`Find restaurants`,args:{action:`findPlaces`,placeType:`restaurant`}},{name:`Find coffee shops`,args:{action:`findPlaces`,searchQuery:`coffee`,placeType:`cafe`}},{name:`Directions: Tokyo Station to Shibuya`,args:{action:`getDirections`,origin:`Tokyo Station`,destination:`Shibuya Station`,travelMode:`TRANSIT`}},{name:`Walking directions`,args:{action:`getDirections`,origin:`Shinjuku Station`,destination:`Tokyo Metropolitan Government Building`,travelMode:`WALKING`}},{name:`Driving directions`,args:{action:`getDirections`,origin:`Narita Airport`,destination:`Tokyo Station`,travelMode:`DRIVING`}}];Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|