vlite3 1.4.28 → 1.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/components/Carousel/Carousel.vue.d.ts +23 -23
  2. package/components/CategoryManager/CategoryManager.vue2.js +1 -1
  3. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  4. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  5. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  6. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  7. package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
  8. package/components/FilePicker/index.vue.js +2 -4
  9. package/components/Form/Form.vue.d.ts +0 -2
  10. package/components/Form/Form.vue.js +2 -2
  11. package/components/Form/Form.vue2.js +368 -336
  12. package/components/Form/index.vue.d.ts +1 -1
  13. package/components/GoogleMap.vue.d.ts +48 -0
  14. package/components/GoogleMap.vue.js +7 -0
  15. package/components/GoogleMap.vue2.js +164 -0
  16. package/components/NavbarCommandPalette.vue.js +1 -1
  17. package/components/Screen/ScreenFilter.vue.js +1 -1
  18. package/components/Tabes/Tabes.vue.d.ts +10 -1
  19. package/components/Tabes/Tabes.vue.js +1 -1
  20. package/components/Tabes/Tabes.vue2.js +234 -155
  21. package/components/Tabes/tabes.utils.d.ts +14 -0
  22. package/components/Tabes/tabes.utils.js +26 -0
  23. package/components/Tabes/types.d.ts +32 -0
  24. package/components/Workbook/Workbook.vue.d.ts +1 -1
  25. package/core/config.d.ts +6 -0
  26. package/core/index.js +13 -9
  27. package/index.d.ts +1 -0
  28. package/index.js +76 -74
  29. package/package.json +1 -1
  30. package/style.css +1 -1
  31. package/types/GoogleMap.type.d.ts +50 -0
  32. package/types/config.type.d.ts +3 -0
  33. package/types/index.d.ts +1 -0
  34. package/utils/GoogleMapLoader.d.ts +41 -0
  35. package/utils/GoogleMapLoader.js +47 -0
  36. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
package/types/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './styles.ts';
9
9
  export * from './config.type';
10
10
  export * from './list.type';
11
11
  export * from './progressbar.ts';
12
+ export * from './GoogleMap.type';
@@ -0,0 +1,41 @@
1
+ import { GoogleMapError } from '../types/GoogleMap.type';
2
+ interface GoogleMapsApi {
3
+ maps: {
4
+ Map: new (element: HTMLElement, options: Record<string, unknown>) => GoogleMapInstance;
5
+ Marker: new (options: Record<string, unknown>) => GoogleMapMarkerInstance;
6
+ event: {
7
+ clearInstanceListeners(instance: unknown): void;
8
+ trigger(instance: unknown, eventName: string): void;
9
+ };
10
+ };
11
+ }
12
+ export interface GoogleMapListener {
13
+ remove(): void;
14
+ }
15
+ export interface GoogleMapInstance {
16
+ addListener(eventName: string, handler: (event?: any) => void): GoogleMapListener;
17
+ getCenter(): {
18
+ lat(): number;
19
+ lng(): number;
20
+ } | undefined;
21
+ getZoom(): number | undefined;
22
+ setCenter(center: {
23
+ lat: number;
24
+ lng: number;
25
+ }): void;
26
+ setOptions(options: Record<string, unknown>): void;
27
+ setZoom(zoom: number): void;
28
+ }
29
+ export interface GoogleMapMarkerInstance {
30
+ addListener(eventName: string, handler: (event?: any) => void): GoogleMapListener;
31
+ setLabel(label: string | null): void;
32
+ setMap(map: GoogleMapInstance | null): void;
33
+ setPosition(position: {
34
+ lat: number;
35
+ lng: number;
36
+ }): void;
37
+ setTitle(title: string | null): void;
38
+ }
39
+ export declare function onGoogleMapsAuthFailure(handler: (error: GoogleMapError) => void): () => void;
40
+ export declare function loadGoogleMaps(apiKey: string): Promise<GoogleMapsApi>;
41
+ export {};
@@ -0,0 +1,47 @@
1
+ let t = null, d = null;
2
+ const s = /* @__PURE__ */ new Set();
3
+ let p = !1;
4
+ function l(e, n, a) {
5
+ return { code: e, message: n, cause: a };
6
+ }
7
+ function f() {
8
+ if (p || typeof window > "u") return;
9
+ p = !0;
10
+ const e = window.gm_authFailure;
11
+ window.gm_authFailure = () => {
12
+ const n = l(
13
+ "invalid-api-key",
14
+ "Google Maps rejected the API key. Check its validity and Maps JavaScript API restrictions."
15
+ );
16
+ s.forEach((a) => a(n)), typeof e == "function" && e();
17
+ };
18
+ }
19
+ function g(e) {
20
+ return f(), s.add(e), () => s.delete(e);
21
+ }
22
+ function w(e) {
23
+ if (typeof window > "u" || typeof document > "u")
24
+ return Promise.reject(
25
+ l("ssr-unavailable", "Google Maps can only be initialized in a browser.")
26
+ );
27
+ const n = window.google;
28
+ return n?.maps?.Map ? Promise.resolve(n) : t ? d !== e ? Promise.reject(
29
+ l(
30
+ "loader-conflict",
31
+ "Google Maps is already loading with a different API key on this page."
32
+ )
33
+ ) : t : (d = e, f(), t = new Promise((a, u) => {
34
+ const r = `__vliteGoogleMapsReady_${Date.now()}`, o = document.createElement("script"), c = () => delete window[r];
35
+ window[r] = () => {
36
+ c();
37
+ const i = window.google;
38
+ i?.maps?.Map ? a(i) : u(l("load-failed", "Google Maps loaded without the Maps API."));
39
+ }, o.id = "vlite3-google-maps-script", o.async = !0, o.defer = !0, o.src = `https://maps.googleapis.com/maps/api/js?key=${encodeURIComponent(e)}&callback=${r}&loading=async`, o.onerror = (i) => {
40
+ c(), t = null, d = null, o.remove(), u(l("load-failed", "Google Maps could not be loaded.", i));
41
+ }, document.head.appendChild(o);
42
+ }), t);
43
+ }
44
+ export {
45
+ w as loadGoogleMaps,
46
+ g as onGoogleMapsAuthFailure
47
+ };