@nuxt/scripts 1.0.0-beta.30 → 1.0.0-beta.32
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/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{CYlYSSNW.js → CxpRPAAJ.js} +1 -1
- package/dist/client/_nuxt/{D5FIkDae.js → D0d_xOOu.js} +1 -1
- package/dist/client/_nuxt/{AwAKM0sG.js → DxzaVa0B.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d7ecb215-eee2-4720-b2bc-f3ad271b9c30.json +1 -0
- package/dist/client/_nuxt/entry.esAfLJmC.css +1 -0
- package/dist/client/_nuxt/ojT6Btul.js +162 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +23 -45
- package/dist/module.d.ts +23 -45
- package/dist/module.json +1 -1
- package/dist/module.mjs +241 -227
- package/dist/registry.d.mts +6 -1
- package/dist/registry.d.ts +6 -1
- package/dist/registry.mjs +150 -11
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +5 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +11 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +5 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +14 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +50 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +14 -0
- package/dist/runtime/registry/gravatar.d.ts +1 -1
- package/dist/runtime/server/proxy-handler.js +25 -36
- package/dist/runtime/server/utils/privacy.d.ts +0 -8
- package/dist/runtime/server/utils/privacy.js +7 -7
- package/dist/runtime/types.d.ts +71 -13
- package/dist/shared/scripts.T4Z99VT8.mjs +37 -0
- package/dist/stats.mjs +7 -15
- package/dist/types-source.mjs +16 -2
- package/dist/types.d.mts +1 -1
- package/package.json +2 -2
- package/dist/client/_nuxt/Bl23o3st.js +0 -162
- package/dist/client/_nuxt/builds/meta/f0b4dd20-8496-4003-b7a3-05cbae515923.json +0 -1
- package/dist/client/_nuxt/entry.C5SUNdim.css +0 -1
- package/dist/shared/scripts.ViOoYQXH.mjs +0 -381
package/dist/registry.d.mts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ResolvePathOptions } from '@nuxt/kit';
|
|
2
|
+
import { ProxyPrivacyInput } from '../dist/runtime/server/utils/privacy.js';
|
|
2
3
|
import { RegistryScript } from '../dist/runtime/types.js';
|
|
3
4
|
|
|
5
|
+
declare const PRIVACY_NONE: ProxyPrivacyInput;
|
|
6
|
+
declare const PRIVACY_FULL: ProxyPrivacyInput;
|
|
7
|
+
declare const PRIVACY_HEATMAP: ProxyPrivacyInput;
|
|
8
|
+
declare const PRIVACY_IP_ONLY: ProxyPrivacyInput;
|
|
4
9
|
declare function registry(resolve?: (path: string, opts?: ResolvePathOptions | undefined) => Promise<string>): Promise<RegistryScript[]>;
|
|
5
10
|
|
|
6
|
-
export { registry };
|
|
11
|
+
export { PRIVACY_FULL, PRIVACY_HEATMAP, PRIVACY_IP_ONLY, PRIVACY_NONE, registry };
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ResolvePathOptions } from '@nuxt/kit';
|
|
2
|
+
import { ProxyPrivacyInput } from '../dist/runtime/server/utils/privacy.js';
|
|
2
3
|
import { RegistryScript } from '../dist/runtime/types.js';
|
|
3
4
|
|
|
5
|
+
declare const PRIVACY_NONE: ProxyPrivacyInput;
|
|
6
|
+
declare const PRIVACY_FULL: ProxyPrivacyInput;
|
|
7
|
+
declare const PRIVACY_HEATMAP: ProxyPrivacyInput;
|
|
8
|
+
declare const PRIVACY_IP_ONLY: ProxyPrivacyInput;
|
|
4
9
|
declare function registry(resolve?: (path: string, opts?: ResolvePathOptions | undefined) => Promise<string>): Promise<RegistryScript[]>;
|
|
5
10
|
|
|
6
|
-
export { registry };
|
|
11
|
+
export { PRIVACY_FULL, PRIVACY_HEATMAP, PRIVACY_IP_ONLY, PRIVACY_NONE, registry };
|
package/dist/registry.mjs
CHANGED
|
@@ -56,6 +56,20 @@ const LOGOS = {
|
|
|
56
56
|
snapchatPixel: `<svg width="50" height="50" viewBox="147.353 39.286 514.631 514.631" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path style="fill:#FFFC00;" d="M147.553,423.021v0.023c0.308,11.424,0.403,22.914,2.33,34.268 c2.042,12.012,4.961,23.725,10.53,34.627c7.529,14.756,17.869,27.217,30.921,37.396c9.371,7.309,19.608,13.111,30.94,16.771 c16.524,5.33,33.571,7.373,50.867,7.473c10.791,0.068,21.575,0.338,32.37,0.293c78.395-0.33,156.792,0.566,235.189-0.484 c10.403-0.141,20.636-1.41,30.846-3.277c19.569-3.582,36.864-11.932,51.661-25.133c17.245-15.381,28.88-34.205,34.132-56.924 c3.437-14.85,4.297-29.916,4.444-45.035v-3.016c0-1.17-0.445-256.892-0.486-260.272c-0.115-9.285-0.799-18.5-2.54-27.636 c-2.117-11.133-5.108-21.981-10.439-32.053c-5.629-10.641-12.68-20.209-21.401-28.57c-13.359-12.81-28.775-21.869-46.722-26.661 c-16.21-4.327-32.747-5.285-49.405-5.27c-0.027-0.004-0.09-0.173-0.094-0.255H278.56c-0.005,0.086-0.008,0.172-0.014,0.255 c-9.454,0.173-18.922,0.102-28.328,1.268c-10.304,1.281-20.509,3.21-30.262,6.812c-15.362,5.682-28.709,14.532-40.11,26.347 c-12.917,13.386-22.022,28.867-26.853,46.894c-4.31,16.084-5.248,32.488-5.271,49.008"/><path style="fill:#FFFFFF;" d="M407.001,473.488c-1.068,0-2.087-0.039-2.862-0.076c-0.615,0.053-1.25,0.076-1.886,0.076 c-22.437,0-37.439-10.607-50.678-19.973c-9.489-6.703-18.438-13.031-28.922-14.775c-5.149-0.854-10.271-1.287-15.22-1.287 c-8.917,0-15.964,1.383-21.109,2.389c-3.166,0.617-5.896,1.148-8.006,1.148c-2.21,0-4.895-0.49-6.014-4.311 c-0.887-3.014-1.523-5.934-2.137-8.746c-1.536-7.027-2.65-11.316-5.281-11.723c-28.141-4.342-44.768-10.738-48.08-18.484 c-0.347-0.814-0.541-1.633-0.584-2.443c-0.129-2.309,1.501-4.334,3.777-4.711c22.348-3.68,42.219-15.492,59.064-35.119 c13.049-15.195,19.457-29.713,20.145-31.316c0.03-0.072,0.065-0.148,0.101-0.217c3.247-6.588,3.893-12.281,1.926-16.916 c-3.626-8.551-15.635-12.361-23.58-14.882c-1.976-0.625-3.845-1.217-5.334-1.808c-7.043-2.782-18.626-8.66-17.083-16.773 c1.124-5.916,8.949-10.036,15.273-10.036c1.756,0,3.312,0.308,4.622,0.923c7.146,3.348,13.575,5.045,19.104,5.045 c6.876,0,10.197-2.618,11-3.362c-0.198-3.668-0.44-7.546-0.674-11.214c0-0.004-0.005-0.048-0.005-0.048 c-1.614-25.675-3.627-57.627,4.546-75.95c24.462-54.847,76.339-59.112,91.651-59.112c0.408,0,6.674-0.062,6.674-0.062 c0.283-0.005,0.59-0.009,0.908-0.009c15.354,0,67.339,4.27,91.816,59.15c8.173,18.335,6.158,50.314,4.539,76.016l-0.076,1.23 c-0.222,3.49-0.427,6.793-0.6,9.995c0.756,0.696,3.795,3.096,9.978,3.339c5.271-0.202,11.328-1.891,17.998-5.014 c2.062-0.968,4.345-1.169,5.895-1.169c2.343,0,4.727,0.456,6.714,1.285l0.106,0.041c5.66,2.009,9.367,6.024,9.447,10.242 c0.071,3.932-2.851,9.809-17.223,15.485c-1.472,0.583-3.35,1.179-5.334,1.808c-7.952,2.524-19.951,6.332-23.577,14.878 c-1.97,4.635-1.322,10.326,1.926,16.912c0.036,0.072,0.067,0.145,0.102,0.221c1,2.344,25.205,57.535,79.209,66.432 c2.275,0.379,3.908,2.406,3.778,4.711c-0.048,0.828-0.248,1.656-0.598,2.465c-3.289,7.703-19.915,14.09-48.064,18.438 c-2.642,0.408-3.755,4.678-5.277,11.668c-0.63,2.887-1.271,5.717-2.146,8.691c-0.819,2.797-2.641,4.164-5.567,4.164h-0.441 c-1.905,0-4.604-0.346-8.008-1.012c-5.95-1.158-12.623-2.236-21.109-2.236c-4.948,0-10.069,0.434-15.224,1.287 c-10.473,1.744-19.421,8.062-28.893,14.758C444.443,462.88,429.436,473.488,407.001,473.488"/><path style="fill:#020202;" d="M408.336,124.235c14.455,0,64.231,3.883,87.688,56.472c7.724,17.317,5.744,48.686,4.156,73.885 c-0.248,3.999-0.494,7.875-0.694,11.576l-0.084,1.591l1.062,1.185c0.429,0.476,4.444,4.672,13.374,5.017l0.144,0.008l0.15-0.003 c5.904-0.225,12.554-2.059,19.776-5.442c1.064-0.498,2.48-0.741,3.978-0.741c1.707,0,3.521,0.321,5.017,0.951l0.226,0.09 c3.787,1.327,6.464,3.829,6.505,6.093c0.022,1.28-0.935,5.891-14.359,11.194c-1.312,0.518-3.039,1.069-5.041,1.7 c-8.736,2.774-21.934,6.96-26.376,17.427c-2.501,5.896-1.816,12.854,2.034,20.678c1.584,3.697,26.52,59.865,82.631,69.111 c-0.011,0.266-0.079,0.557-0.229,0.9c-0.951,2.24-6.996,9.979-44.612,15.783c-5.886,0.902-7.328,7.5-9,15.17 c-0.604,2.746-1.218,5.518-2.062,8.381c-0.258,0.865-0.306,0.914-1.233,0.914c-0.128,0-0.278,0-0.442,0 c-1.668,0-4.2-0.346-7.135-0.922c-5.345-1.041-12.647-2.318-21.982-2.318c-5.21,0-10.577,0.453-15.962,1.352 c-11.511,1.914-20.872,8.535-30.786,15.543c-13.314,9.408-27.075,19.143-48.071,19.143c-0.917,0-1.812-0.031-2.709-0.076 l-0.236-0.01l-0.237,0.018c-0.515,0.045-1.034,0.068-1.564,0.068c-20.993,0-34.76-9.732-48.068-19.143 c-9.916-7.008-19.282-13.629-30.791-15.543c-5.38-0.896-10.752-1.352-15.959-1.352c-9.333,0-16.644,1.428-21.978,2.471 c-2.935,0.574-5.476,1.066-7.139,1.066c-1.362,0-1.388-0.08-1.676-1.064c-0.844-2.865-1.461-5.703-2.062-8.445 c-1.676-7.678-3.119-14.312-9.002-15.215c-37.613-5.809-43.659-13.561-44.613-15.795c-0.149-0.352-0.216-0.652-0.231-0.918 c56.11-9.238,81.041-65.408,82.63-69.119c3.857-7.818,4.541-14.775,2.032-20.678c-4.442-10.461-17.638-14.653-26.368-17.422 c-2.007-0.635-3.735-1.187-5.048-1.705c-11.336-4.479-14.823-8.991-14.305-11.725c0.601-3.153,6.067-6.359,10.837-6.359 c1.072,0,2.012,0.173,2.707,0.498c7.747,3.631,14.819,5.472,21.022,5.472c9.751,0,14.091-4.537,14.557-5.055l1.057-1.182 l-0.085-1.583c-0.197-3.699-0.44-7.574-0.696-11.565c-1.583-25.205-3.563-56.553,4.158-73.871 c23.37-52.396,72.903-56.435,87.525-56.435c0.36,0,6.717-0.065,6.717-0.065C407.744,124.239,408.033,124.235,408.336,124.235 M408.336,115.197h-0.017c-0.333,0-0.646,0-0.944,0.004c-2.376,0.024-6.282,0.062-6.633,0.066c-8.566,0-25.705,1.21-44.115,9.336 c-10.526,4.643-19.994,10.921-28.14,18.66c-9.712,9.221-17.624,20.59-23.512,33.796c-8.623,19.336-6.576,51.905-4.932,78.078 l0.006,0.041c0.176,2.803,0.361,5.73,0.53,8.582c-1.265,0.581-3.316,1.194-6.339,1.194c-4.864,0-10.648-1.555-17.187-4.619 c-1.924-0.896-4.12-1.349-6.543-1.349c-3.893,0-7.997,1.146-11.557,3.239c-4.479,2.63-7.373,6.347-8.159,10.468 c-0.518,2.726-0.493,8.114,5.492,13.578c3.292,3.008,8.128,5.782,14.37,8.249c1.638,0.645,3.582,1.261,5.641,1.914 c7.145,2.271,17.959,5.702,20.779,12.339c1.429,3.365,0.814,7.793-1.823,13.145c-0.069,0.146-0.138,0.289-0.201,0.439 c-0.659,1.539-6.807,15.465-19.418,30.152c-7.166,8.352-15.059,15.332-23.447,20.752c-10.238,6.617-21.316,10.943-32.923,12.855 c-4.558,0.748-7.813,4.809-7.559,9.424c0.078,1.33,0.39,2.656,0.931,3.939c0.004,0.008,0.009,0.016,0.013,0.023 c1.843,4.311,6.116,7.973,13.063,11.203c8.489,3.943,21.185,7.26,37.732,9.855c0.836,1.59,1.704,5.586,2.305,8.322 c0.629,2.908,1.285,5.898,2.22,9.074c1.009,3.441,3.626,7.553,10.349,7.553c2.548,0,5.478-0.574,8.871-1.232 c4.969-0.975,11.764-2.305,20.245-2.305c4.702,0,9.575,0.414,14.48,1.229c9.455,1.574,17.606,7.332,27.037,14 c13.804,9.758,29.429,20.803,53.302,20.803c0.651,0,1.304-0.021,1.949-0.066c0.789,0.037,1.767,0.066,2.799,0.066 c23.88,0,39.501-11.049,53.29-20.799l0.022-0.02c9.433-6.66,17.575-12.41,27.027-13.984c4.903-0.814,9.775-1.229,14.479-1.229 c8.102,0,14.517,1.033,20.245,2.15c3.738,0.736,6.643,1.09,8.872,1.09l0.218,0.004h0.226c4.917,0,8.53-2.699,9.909-7.422 c0.916-3.109,1.57-6.029,2.215-8.986c0.562-2.564,1.46-6.674,2.296-8.281c16.558-2.6,29.249-5.91,37.739-9.852 c6.931-3.215,11.199-6.873,13.053-11.166c0.556-1.287,0.881-2.621,0.954-3.979c0.261-4.607-2.999-8.676-7.56-9.424 c-51.585-8.502-74.824-61.506-75.785-63.758c-0.062-0.148-0.132-0.295-0.205-0.438c-2.637-5.354-3.246-9.777-1.816-13.148 c2.814-6.631,13.621-10.062,20.771-12.332c2.07-0.652,4.021-1.272,5.646-1.914c7.039-2.78,12.07-5.796,15.389-9.221 c3.964-4.083,4.736-7.995,4.688-10.555c-0.121-6.194-4.856-11.698-12.388-14.393c-2.544-1.052-5.445-1.607-8.399-1.607 c-2.011,0-4.989,0.276-7.808,1.592c-6.035,2.824-11.441,4.368-16.082,4.588c-2.468-0.125-4.199-0.66-5.32-1.171 c0.141-2.416,0.297-4.898,0.458-7.486l0.067-1.108c1.653-26.19,3.707-58.784-4.92-78.134c-5.913-13.253-13.853-24.651-23.604-33.892 c-8.178-7.744-17.678-14.021-28.242-18.661C434.052,116.402,416.914,115.197,408.336,115.197"/><rect x="147.553" y="39.443" style="fill:none;" width="514.231" height="514.23"/></svg>`
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
const PRIVACY_NONE = { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false };
|
|
60
|
+
const PRIVACY_FULL = { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true };
|
|
61
|
+
const PRIVACY_HEATMAP = { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true };
|
|
62
|
+
const PRIVACY_IP_ONLY = { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false };
|
|
63
|
+
const FATHOM_SELF_HOSTED_RE = /\.src\.indexOf\("cdn\.usefathom\.com"\)\s*<\s*0/;
|
|
64
|
+
const RYBBIT_HOST_SPLIT_RE = /\w+\.split\(["']\/script\.js["']\)\[0\]/g;
|
|
65
|
+
const CAP_FULL_PT = { bundle: true, reverseProxyIntercept: true, partytown: true };
|
|
66
|
+
const CAP_FULL = { bundle: true, reverseProxyIntercept: true };
|
|
67
|
+
const CAP_BUNDLE_PT = { bundle: true, partytown: true };
|
|
68
|
+
const CAP_BUNDLE = { bundle: true };
|
|
69
|
+
const CAP_PROXY = { reverseProxyIntercept: true };
|
|
70
|
+
const DEF_FULL = { bundle: true, reverseProxyIntercept: true };
|
|
71
|
+
const DEF_BUNDLE = { bundle: true };
|
|
72
|
+
const DEF_PROXY = { reverseProxyIntercept: true };
|
|
59
73
|
async function registry(resolve) {
|
|
60
74
|
resolve = resolve || ((s) => Promise.resolve(s));
|
|
61
75
|
return [
|
|
@@ -63,6 +77,11 @@ async function registry(resolve) {
|
|
|
63
77
|
registryKey: "plausibleAnalytics",
|
|
64
78
|
label: "Plausible Analytics",
|
|
65
79
|
category: "analytics",
|
|
80
|
+
capabilities: CAP_FULL_PT,
|
|
81
|
+
defaultCapability: DEF_FULL,
|
|
82
|
+
domains: ["plausible.io"],
|
|
83
|
+
privacy: PRIVACY_NONE,
|
|
84
|
+
autoInject: { configField: "endpoint", computeValue: (proxyPrefix) => `${proxyPrefix}/plausible.io/api/event` },
|
|
66
85
|
scriptBundling: (options) => {
|
|
67
86
|
if (options?.scriptId)
|
|
68
87
|
return `https://plausible.io/js/pa-${options.scriptId}.js`;
|
|
@@ -80,6 +99,10 @@ async function registry(resolve) {
|
|
|
80
99
|
label: "Cloudflare Web Analytics",
|
|
81
100
|
src: "https://static.cloudflareinsights.com/beacon.min.js",
|
|
82
101
|
category: "analytics",
|
|
102
|
+
capabilities: CAP_FULL_PT,
|
|
103
|
+
defaultCapability: DEF_FULL,
|
|
104
|
+
domains: ["static.cloudflareinsights.com", "cloudflareinsights.com"],
|
|
105
|
+
privacy: PRIVACY_NONE,
|
|
83
106
|
logo: LOGOS.cloudflareWebAnalytics,
|
|
84
107
|
import: {
|
|
85
108
|
name: "useScriptCloudflareWebAnalytics",
|
|
@@ -91,6 +114,10 @@ async function registry(resolve) {
|
|
|
91
114
|
label: "Vercel Analytics",
|
|
92
115
|
src: "https://va.vercel-scripts.com/v1/script.js",
|
|
93
116
|
category: "analytics",
|
|
117
|
+
capabilities: CAP_FULL,
|
|
118
|
+
defaultCapability: DEF_FULL,
|
|
119
|
+
domains: ["va.vercel-scripts.com"],
|
|
120
|
+
privacy: PRIVACY_NONE,
|
|
94
121
|
logo: LOGOS.vercelAnalytics,
|
|
95
122
|
import: {
|
|
96
123
|
name: "useScriptVercelAnalytics",
|
|
@@ -102,6 +129,18 @@ async function registry(resolve) {
|
|
|
102
129
|
label: "PostHog",
|
|
103
130
|
src: false,
|
|
104
131
|
scriptBundling: false,
|
|
132
|
+
capabilities: CAP_PROXY,
|
|
133
|
+
defaultCapability: DEF_PROXY,
|
|
134
|
+
domains: ["us-assets.i.posthog.com", "us.i.posthog.com", "eu-assets.i.posthog.com", "eu.i.posthog.com"],
|
|
135
|
+
privacy: PRIVACY_NONE,
|
|
136
|
+
autoInject: {
|
|
137
|
+
configField: "apiHost",
|
|
138
|
+
computeValue: (proxyPrefix, config) => {
|
|
139
|
+
const region = config.region || "us";
|
|
140
|
+
const host = region === "eu" ? "eu.i.posthog.com" : "us.i.posthog.com";
|
|
141
|
+
return `${proxyPrefix}/${host}`;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
105
144
|
category: "analytics",
|
|
106
145
|
logo: LOGOS.posthog,
|
|
107
146
|
import: {
|
|
@@ -114,6 +153,13 @@ async function registry(resolve) {
|
|
|
114
153
|
label: "Fathom Analytics",
|
|
115
154
|
src: "https://cdn.usefathom.com/script.js",
|
|
116
155
|
category: "analytics",
|
|
156
|
+
capabilities: CAP_FULL_PT,
|
|
157
|
+
defaultCapability: DEF_FULL,
|
|
158
|
+
domains: ["cdn.usefathom.com"],
|
|
159
|
+
privacy: PRIVACY_NONE,
|
|
160
|
+
postProcess(output) {
|
|
161
|
+
return output.replace(FATHOM_SELF_HOSTED_RE, '.src.indexOf("cdn.usefathom.com")<-1');
|
|
162
|
+
},
|
|
117
163
|
logo: LOGOS.fathomAnalytics,
|
|
118
164
|
import: {
|
|
119
165
|
name: "useScriptFathomAnalytics",
|
|
@@ -125,6 +171,10 @@ async function registry(resolve) {
|
|
|
125
171
|
label: "Matomo Analytics",
|
|
126
172
|
scriptBundling: false,
|
|
127
173
|
// breaks script
|
|
174
|
+
capabilities: CAP_FULL_PT,
|
|
175
|
+
defaultCapability: DEF_FULL,
|
|
176
|
+
domains: ["cdn.matomo.cloud"],
|
|
177
|
+
privacy: PRIVACY_NONE,
|
|
128
178
|
category: "analytics",
|
|
129
179
|
logo: LOGOS.matomoAnalytics,
|
|
130
180
|
import: {
|
|
@@ -135,6 +185,17 @@ async function registry(resolve) {
|
|
|
135
185
|
{
|
|
136
186
|
registryKey: "rybbitAnalytics",
|
|
137
187
|
label: "Rybbit Analytics",
|
|
188
|
+
capabilities: CAP_FULL,
|
|
189
|
+
defaultCapability: DEF_FULL,
|
|
190
|
+
domains: ["app.rybbit.io"],
|
|
191
|
+
privacy: PRIVACY_NONE,
|
|
192
|
+
autoInject: { configField: "analyticsHost", computeValue: (proxyPrefix) => `${proxyPrefix}/app.rybbit.io/api` },
|
|
193
|
+
postProcess(output, rewrites) {
|
|
194
|
+
const rybbitRewrite = rewrites.find((r) => r.from === "app.rybbit.io");
|
|
195
|
+
if (rybbitRewrite)
|
|
196
|
+
output = output.replace(RYBBIT_HOST_SPLIT_RE, `self.location.origin+"${rybbitRewrite.to}/api"`);
|
|
197
|
+
return output;
|
|
198
|
+
},
|
|
138
199
|
scriptBundling: (options) => {
|
|
139
200
|
const host = options?.analyticsHost;
|
|
140
201
|
if (host && !host.startsWith("/"))
|
|
@@ -151,6 +212,11 @@ async function registry(resolve) {
|
|
|
151
212
|
{
|
|
152
213
|
registryKey: "databuddyAnalytics",
|
|
153
214
|
label: "Databuddy Analytics",
|
|
215
|
+
capabilities: CAP_FULL,
|
|
216
|
+
defaultCapability: DEF_FULL,
|
|
217
|
+
domains: ["cdn.databuddy.cc", "basket.databuddy.cc"],
|
|
218
|
+
privacy: PRIVACY_NONE,
|
|
219
|
+
autoInject: { configField: "apiUrl", computeValue: (proxyPrefix) => `${proxyPrefix}/basket.databuddy.cc` },
|
|
154
220
|
scriptBundling: () => "https://cdn.databuddy.cc/databuddy.js",
|
|
155
221
|
category: "analytics",
|
|
156
222
|
logo: LOGOS.databuddyAnalytics,
|
|
@@ -162,6 +228,9 @@ async function registry(resolve) {
|
|
|
162
228
|
{
|
|
163
229
|
registryKey: "segment",
|
|
164
230
|
label: "Segment",
|
|
231
|
+
capabilities: CAP_BUNDLE_PT,
|
|
232
|
+
// reverseProxyIntercept fails: SDK constructs API URLs dynamically
|
|
233
|
+
defaultCapability: DEF_BUNDLE,
|
|
165
234
|
scriptBundling: (options) => {
|
|
166
235
|
return joinURL("https://cdn.segment.com/analytics.js/v1", options?.writeKey || "", "analytics.min.js");
|
|
167
236
|
},
|
|
@@ -175,6 +244,8 @@ async function registry(resolve) {
|
|
|
175
244
|
{
|
|
176
245
|
registryKey: "mixpanelAnalytics",
|
|
177
246
|
label: "Mixpanel",
|
|
247
|
+
capabilities: CAP_BUNDLE_PT,
|
|
248
|
+
defaultCapability: DEF_BUNDLE,
|
|
178
249
|
scriptBundling: (options) => {
|
|
179
250
|
if (!options?.token)
|
|
180
251
|
return false;
|
|
@@ -191,6 +262,8 @@ async function registry(resolve) {
|
|
|
191
262
|
registryKey: "bingUet",
|
|
192
263
|
label: "Bing UET",
|
|
193
264
|
src: "https://bat.bing.com/bat.js",
|
|
265
|
+
capabilities: CAP_BUNDLE_PT,
|
|
266
|
+
defaultCapability: DEF_BUNDLE,
|
|
194
267
|
category: "ad",
|
|
195
268
|
logo: LOGOS.bingUet,
|
|
196
269
|
import: {
|
|
@@ -203,6 +276,10 @@ async function registry(resolve) {
|
|
|
203
276
|
label: "Meta Pixel",
|
|
204
277
|
src: "https://connect.facebook.net/en_US/fbevents.js",
|
|
205
278
|
category: "ad",
|
|
279
|
+
capabilities: CAP_FULL_PT,
|
|
280
|
+
defaultCapability: DEF_FULL,
|
|
281
|
+
domains: ["connect.facebook.net", "www.facebook.com", "facebook.com", "pixel.facebook.com"],
|
|
282
|
+
privacy: PRIVACY_FULL,
|
|
206
283
|
logo: LOGOS.metaPixel,
|
|
207
284
|
import: {
|
|
208
285
|
name: "useScriptMetaPixel",
|
|
@@ -214,6 +291,10 @@ async function registry(resolve) {
|
|
|
214
291
|
label: "X Pixel",
|
|
215
292
|
src: "https://static.ads-twitter.com/uwt.js",
|
|
216
293
|
category: "ad",
|
|
294
|
+
capabilities: CAP_FULL_PT,
|
|
295
|
+
defaultCapability: DEF_FULL,
|
|
296
|
+
domains: ["analytics.twitter.com", "static.ads-twitter.com", "t.co"],
|
|
297
|
+
privacy: PRIVACY_FULL,
|
|
217
298
|
logo: LOGOS.xPixel,
|
|
218
299
|
import: {
|
|
219
300
|
name: "useScriptXPixel",
|
|
@@ -224,6 +305,10 @@ async function registry(resolve) {
|
|
|
224
305
|
registryKey: "tiktokPixel",
|
|
225
306
|
label: "TikTok Pixel",
|
|
226
307
|
category: "ad",
|
|
308
|
+
capabilities: CAP_FULL_PT,
|
|
309
|
+
defaultCapability: DEF_FULL,
|
|
310
|
+
domains: ["analytics.tiktok.com"],
|
|
311
|
+
privacy: PRIVACY_FULL,
|
|
227
312
|
logo: LOGOS.tiktokPixel,
|
|
228
313
|
import: {
|
|
229
314
|
name: "useScriptTikTokPixel",
|
|
@@ -240,6 +325,10 @@ async function registry(resolve) {
|
|
|
240
325
|
label: "Snapchat Pixel",
|
|
241
326
|
src: "https://sc-static.net/scevent.min.js",
|
|
242
327
|
category: "ad",
|
|
328
|
+
capabilities: CAP_FULL_PT,
|
|
329
|
+
defaultCapability: DEF_FULL,
|
|
330
|
+
domains: ["sc-static.net", "tr.snapchat.com", "pixel.tapad.com"],
|
|
331
|
+
privacy: PRIVACY_FULL,
|
|
243
332
|
logo: LOGOS.snapchatPixel,
|
|
244
333
|
import: {
|
|
245
334
|
name: "useScriptSnapchatPixel",
|
|
@@ -251,6 +340,10 @@ async function registry(resolve) {
|
|
|
251
340
|
label: "Reddit Pixel",
|
|
252
341
|
src: "https://www.redditstatic.com/ads/pixel.js",
|
|
253
342
|
category: "ad",
|
|
343
|
+
capabilities: CAP_FULL_PT,
|
|
344
|
+
defaultCapability: DEF_FULL,
|
|
345
|
+
domains: ["www.redditstatic.com", "alb.reddit.com", "pixel-config.reddit.com"],
|
|
346
|
+
privacy: PRIVACY_FULL,
|
|
254
347
|
logo: LOGOS.redditPixel,
|
|
255
348
|
import: {
|
|
256
349
|
name: "useScriptRedditPixel",
|
|
@@ -261,7 +354,10 @@ async function registry(resolve) {
|
|
|
261
354
|
{
|
|
262
355
|
registryKey: "googleAdsense",
|
|
263
356
|
label: "Google Adsense",
|
|
264
|
-
|
|
357
|
+
capabilities: CAP_FULL,
|
|
358
|
+
defaultCapability: DEF_FULL,
|
|
359
|
+
proxyConfig: "googleAnalytics",
|
|
360
|
+
// shares GA's domains/privacy
|
|
265
361
|
scriptBundling: (options) => {
|
|
266
362
|
if (!options?.client) {
|
|
267
363
|
return false;
|
|
@@ -281,6 +377,10 @@ async function registry(resolve) {
|
|
|
281
377
|
registryKey: "carbonAds",
|
|
282
378
|
label: "Carbon Ads",
|
|
283
379
|
scriptBundling: false,
|
|
380
|
+
capabilities: CAP_FULL,
|
|
381
|
+
defaultCapability: DEF_FULL,
|
|
382
|
+
domains: ["cdn.carbonads.com"],
|
|
383
|
+
privacy: PRIVACY_NONE,
|
|
284
384
|
category: "ad",
|
|
285
385
|
logo: LOGOS.carbonAds
|
|
286
386
|
},
|
|
@@ -288,6 +388,10 @@ async function registry(resolve) {
|
|
|
288
388
|
{
|
|
289
389
|
registryKey: "intercom",
|
|
290
390
|
label: "Intercom",
|
|
391
|
+
capabilities: CAP_FULL,
|
|
392
|
+
defaultCapability: DEF_FULL,
|
|
393
|
+
domains: ["widget.intercom.io", "api-iam.intercom.io", "api-iam.eu.intercom.io", "api-iam.au.intercom.io", "js.intercomcdn.com", "downloads.intercomcdn.com", "video-messages.intercomcdn.com"],
|
|
394
|
+
privacy: PRIVACY_IP_ONLY,
|
|
291
395
|
scriptBundling(options) {
|
|
292
396
|
if (!options?.app_id) {
|
|
293
397
|
return false;
|
|
@@ -304,6 +408,10 @@ async function registry(resolve) {
|
|
|
304
408
|
{
|
|
305
409
|
registryKey: "hotjar",
|
|
306
410
|
label: "Hotjar",
|
|
411
|
+
capabilities: CAP_FULL,
|
|
412
|
+
defaultCapability: DEF_FULL,
|
|
413
|
+
domains: ["static.hotjar.com", "script.hotjar.com", "vars.hotjar.com", "in.hotjar.com", "vc.hotjar.com", "vc.hotjar.io", "metrics.hotjar.io", "insights.hotjar.com", "ask.hotjar.io", "events.hotjar.io", "identify.hotjar.com", "surveystats.hotjar.io"],
|
|
414
|
+
privacy: PRIVACY_HEATMAP,
|
|
307
415
|
scriptBundling(options) {
|
|
308
416
|
if (!options?.id) {
|
|
309
417
|
return false;
|
|
@@ -322,6 +430,10 @@ async function registry(resolve) {
|
|
|
322
430
|
{
|
|
323
431
|
registryKey: "clarity",
|
|
324
432
|
label: "Clarity",
|
|
433
|
+
capabilities: CAP_FULL_PT,
|
|
434
|
+
defaultCapability: DEF_FULL,
|
|
435
|
+
domains: ["www.clarity.ms", "scripts.clarity.ms", "d.clarity.ms", "e.clarity.ms", "k.clarity.ms"],
|
|
436
|
+
privacy: PRIVACY_HEATMAP,
|
|
325
437
|
scriptBundling(options) {
|
|
326
438
|
if (!options?.id) {
|
|
327
439
|
return false;
|
|
@@ -340,6 +452,7 @@ async function registry(resolve) {
|
|
|
340
452
|
registryKey: "stripe",
|
|
341
453
|
label: "Stripe",
|
|
342
454
|
scriptBundling: false,
|
|
455
|
+
// needs fingerprinting for fraud detection
|
|
343
456
|
category: "payments",
|
|
344
457
|
logo: LOGOS.stripe,
|
|
345
458
|
import: {
|
|
@@ -352,6 +465,10 @@ async function registry(resolve) {
|
|
|
352
465
|
label: "Lemon Squeezy",
|
|
353
466
|
src: false,
|
|
354
467
|
// should not be bundled
|
|
468
|
+
capabilities: CAP_FULL,
|
|
469
|
+
defaultCapability: DEF_FULL,
|
|
470
|
+
domains: ["assets.lemonsqueezy.com"],
|
|
471
|
+
privacy: PRIVACY_NONE,
|
|
355
472
|
category: "payments",
|
|
356
473
|
logo: LOGOS.lemonSqueezy,
|
|
357
474
|
import: {
|
|
@@ -363,7 +480,7 @@ async function registry(resolve) {
|
|
|
363
480
|
registryKey: "paypal",
|
|
364
481
|
label: "PayPal",
|
|
365
482
|
src: false,
|
|
366
|
-
//
|
|
483
|
+
// needs fingerprinting for fraud detection
|
|
367
484
|
category: "payments",
|
|
368
485
|
logo: LOGOS.paypal,
|
|
369
486
|
import: {
|
|
@@ -375,6 +492,10 @@ async function registry(resolve) {
|
|
|
375
492
|
{
|
|
376
493
|
registryKey: "vimeoPlayer",
|
|
377
494
|
label: "Vimeo Player",
|
|
495
|
+
capabilities: CAP_FULL,
|
|
496
|
+
defaultCapability: DEF_FULL,
|
|
497
|
+
domains: ["player.vimeo.com"],
|
|
498
|
+
privacy: PRIVACY_IP_ONLY,
|
|
378
499
|
category: "video",
|
|
379
500
|
logo: LOGOS.vimeoPlayer,
|
|
380
501
|
import: {
|
|
@@ -385,6 +506,10 @@ async function registry(resolve) {
|
|
|
385
506
|
{
|
|
386
507
|
registryKey: "youtubePlayer",
|
|
387
508
|
label: "YouTube Player",
|
|
509
|
+
capabilities: CAP_FULL,
|
|
510
|
+
defaultCapability: DEF_FULL,
|
|
511
|
+
domains: ["www.youtube.com"],
|
|
512
|
+
privacy: PRIVACY_IP_ONLY,
|
|
388
513
|
category: "video",
|
|
389
514
|
logo: LOGOS.youtubePlayer,
|
|
390
515
|
import: {
|
|
@@ -441,6 +566,9 @@ async function registry(resolve) {
|
|
|
441
566
|
{
|
|
442
567
|
registryKey: "crisp",
|
|
443
568
|
label: "Crisp",
|
|
569
|
+
capabilities: CAP_BUNDLE,
|
|
570
|
+
// reverseProxyIntercept fails: SDK loads secondary scripts at runtime
|
|
571
|
+
defaultCapability: DEF_BUNDLE,
|
|
444
572
|
category: "support",
|
|
445
573
|
logo: LOGOS.crisp,
|
|
446
574
|
import: {
|
|
@@ -466,18 +594,13 @@ async function registry(resolve) {
|
|
|
466
594
|
{
|
|
467
595
|
registryKey: "googleRecaptcha",
|
|
468
596
|
label: "Google reCAPTCHA",
|
|
597
|
+
scriptBundling: false,
|
|
598
|
+
// needs fingerprinting for bot detection
|
|
469
599
|
category: "utility",
|
|
470
600
|
logo: LOGOS.googleRecaptcha,
|
|
471
601
|
import: {
|
|
472
602
|
name: "useScriptGoogleRecaptcha",
|
|
473
603
|
from: await resolve("./runtime/registry/google-recaptcha")
|
|
474
|
-
},
|
|
475
|
-
scriptBundling(options) {
|
|
476
|
-
if (!options?.siteKey) {
|
|
477
|
-
return false;
|
|
478
|
-
}
|
|
479
|
-
const baseUrl = options?.recaptchaNet ? "https://www.recaptcha.net/recaptcha" : "https://www.google.com/recaptcha";
|
|
480
|
-
return `${baseUrl}/${options?.enterprise ? "enterprise.js" : "api.js"}`;
|
|
481
604
|
}
|
|
482
605
|
},
|
|
483
606
|
{
|
|
@@ -485,7 +608,7 @@ async function registry(resolve) {
|
|
|
485
608
|
label: "Google Sign-In",
|
|
486
609
|
src: "https://accounts.google.com/gsi/client",
|
|
487
610
|
scriptBundling: false,
|
|
488
|
-
// CORS prevents bundling
|
|
611
|
+
// CORS prevents bundling, needs fingerprinting for auth
|
|
489
612
|
category: "utility",
|
|
490
613
|
logo: LOGOS.googleSignIn,
|
|
491
614
|
import: {
|
|
@@ -496,6 +619,9 @@ async function registry(resolve) {
|
|
|
496
619
|
{
|
|
497
620
|
registryKey: "googleTagManager",
|
|
498
621
|
label: "Google Tag Manager",
|
|
622
|
+
capabilities: CAP_BUNDLE,
|
|
623
|
+
// reverseProxyIntercept fails: GTM dynamically loads scripts at runtime
|
|
624
|
+
defaultCapability: DEF_BUNDLE,
|
|
499
625
|
category: "tag-manager",
|
|
500
626
|
import: {
|
|
501
627
|
name: "useScriptGoogleTagManager",
|
|
@@ -523,6 +649,10 @@ async function registry(resolve) {
|
|
|
523
649
|
{
|
|
524
650
|
registryKey: "googleAnalytics",
|
|
525
651
|
label: "Google Analytics",
|
|
652
|
+
capabilities: CAP_FULL_PT,
|
|
653
|
+
defaultCapability: DEF_FULL,
|
|
654
|
+
domains: ["www.google-analytics.com", "analytics.google.com", "stats.g.doubleclick.net", "pagead2.googlesyndication.com", "www.googleadservices.com", "googleads.g.doubleclick.net"],
|
|
655
|
+
privacy: PRIVACY_HEATMAP,
|
|
526
656
|
category: "analytics",
|
|
527
657
|
import: {
|
|
528
658
|
name: "useScriptGoogleAnalytics",
|
|
@@ -539,6 +669,11 @@ async function registry(resolve) {
|
|
|
539
669
|
{
|
|
540
670
|
registryKey: "umamiAnalytics",
|
|
541
671
|
label: "Umami Analytics",
|
|
672
|
+
capabilities: CAP_FULL_PT,
|
|
673
|
+
defaultCapability: DEF_FULL,
|
|
674
|
+
domains: ["cloud.umami.is", "api-gateway.umami.dev"],
|
|
675
|
+
privacy: PRIVACY_NONE,
|
|
676
|
+
autoInject: { configField: "hostUrl", computeValue: (proxyPrefix) => `${proxyPrefix}/cloud.umami.is` },
|
|
542
677
|
scriptBundling: () => "https://cloud.umami.is/script.js",
|
|
543
678
|
category: "analytics",
|
|
544
679
|
logo: LOGOS.umamiAnalytics,
|
|
@@ -551,6 +686,10 @@ async function registry(resolve) {
|
|
|
551
686
|
registryKey: "gravatar",
|
|
552
687
|
label: "Gravatar",
|
|
553
688
|
src: "https://secure.gravatar.com/js/gprofiles.js",
|
|
689
|
+
capabilities: CAP_FULL,
|
|
690
|
+
defaultCapability: DEF_FULL,
|
|
691
|
+
domains: ["secure.gravatar.com", "gravatar.com"],
|
|
692
|
+
privacy: PRIVACY_IP_ONLY,
|
|
554
693
|
category: "utility",
|
|
555
694
|
logo: LOGOS.gravatar,
|
|
556
695
|
import: {
|
|
@@ -564,4 +703,4 @@ async function registry(resolve) {
|
|
|
564
703
|
];
|
|
565
704
|
}
|
|
566
705
|
|
|
567
|
-
export { registry };
|
|
706
|
+
export { PRIVACY_FULL, PRIVACY_HEATMAP, PRIVACY_IP_ONLY, PRIVACY_NONE, registry };
|
|
@@ -12,10 +12,13 @@ export interface MarkerClustererOptions {
|
|
|
12
12
|
renderer?: unknown;
|
|
13
13
|
onClusterClick?: unknown;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export interface MarkerClustererContext {
|
|
16
16
|
markerClusterer: ShallowRef<MarkerClustererInstance | undefined>;
|
|
17
17
|
requestRerender: () => void;
|
|
18
|
-
|
|
18
|
+
/** Increments after each clustering cycle; watch to detect cluster membership changes */
|
|
19
|
+
clusteringVersion: ShallowRef<number>;
|
|
20
|
+
}
|
|
21
|
+
export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<MarkerClustererContext>;
|
|
19
22
|
declare const _default: typeof __VLS_export;
|
|
20
23
|
export default _default;
|
|
21
24
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { provide, shallowRef, watch } from "vue";
|
|
2
|
+
import { inject, provide, shallowRef, watch } from "vue";
|
|
3
3
|
import { bindGoogleMapsEvents } from "./bindGoogleMapsEvents";
|
|
4
|
+
import { MAP_INJECTION_KEY } from "./injectionKeys";
|
|
4
5
|
import { useGoogleMapsResource } from "./useGoogleMapsResource";
|
|
5
6
|
export const MARKER_CLUSTERER_INJECTION_KEY = /* @__PURE__ */ Symbol("marker-clusterer");
|
|
6
7
|
</script>
|
|
@@ -15,6 +16,8 @@ const markerClustererEvents = [
|
|
|
15
16
|
"clusteringbegin",
|
|
16
17
|
"clusteringend"
|
|
17
18
|
];
|
|
19
|
+
const mapContext = inject(MAP_INJECTION_KEY, void 0);
|
|
20
|
+
const clusteringVersion = shallowRef(0);
|
|
18
21
|
const markerClusterer = useGoogleMapsResource({
|
|
19
22
|
async create({ map }) {
|
|
20
23
|
const { MarkerClusterer } = await import("@googlemaps/markerclusterer");
|
|
@@ -23,6 +26,9 @@ const markerClusterer = useGoogleMapsResource({
|
|
|
23
26
|
...props.options
|
|
24
27
|
});
|
|
25
28
|
bindGoogleMapsEvents(clusterer, emit, { withPayload: markerClustererEvents });
|
|
29
|
+
clusterer.addListener("clusteringend", () => {
|
|
30
|
+
clusteringVersion.value++;
|
|
31
|
+
});
|
|
26
32
|
return clusterer;
|
|
27
33
|
},
|
|
28
34
|
cleanup(clusterer, { mapsApi }) {
|
|
@@ -39,6 +45,8 @@ watch(
|
|
|
39
45
|
(ready) => {
|
|
40
46
|
if (!ready)
|
|
41
47
|
return;
|
|
48
|
+
if (!mapContext?.map.value?.getProjection())
|
|
49
|
+
return;
|
|
42
50
|
rerenderPending.value = false;
|
|
43
51
|
try {
|
|
44
52
|
markerClusterer.value.render();
|
|
@@ -53,7 +61,8 @@ provide(
|
|
|
53
61
|
MARKER_CLUSTERER_INJECTION_KEY,
|
|
54
62
|
{
|
|
55
63
|
markerClusterer,
|
|
56
|
-
requestRerender
|
|
64
|
+
requestRerender,
|
|
65
|
+
clusteringVersion
|
|
57
66
|
}
|
|
58
67
|
);
|
|
59
68
|
</script>
|
|
@@ -12,10 +12,13 @@ export interface MarkerClustererOptions {
|
|
|
12
12
|
renderer?: unknown;
|
|
13
13
|
onClusterClick?: unknown;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export interface MarkerClustererContext {
|
|
16
16
|
markerClusterer: ShallowRef<MarkerClustererInstance | undefined>;
|
|
17
17
|
requestRerender: () => void;
|
|
18
|
-
|
|
18
|
+
/** Increments after each clustering cycle; watch to detect cluster membership changes */
|
|
19
|
+
clusteringVersion: ShallowRef<number>;
|
|
20
|
+
}
|
|
21
|
+
export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<MarkerClustererContext>;
|
|
19
22
|
declare const _default: typeof __VLS_export;
|
|
20
23
|
export default _default;
|
|
21
24
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
@@ -33,6 +33,18 @@ type __VLS_Props = {
|
|
|
33
33
|
* @default true
|
|
34
34
|
*/
|
|
35
35
|
blockMapInteraction?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Pan the map so the overlay is fully visible when opened, similar to InfoWindow behavior.
|
|
38
|
+
* Set to `true` for default 40px padding, or a number for custom padding.
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
panOnOpen?: boolean | number;
|
|
42
|
+
/**
|
|
43
|
+
* Automatically hide the overlay when its parent marker joins a cluster (on zoom out).
|
|
44
|
+
* Only applies when nested inside a ScriptGoogleMapsMarkerClusterer.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
hideWhenClustered?: boolean;
|
|
36
48
|
};
|
|
37
49
|
type __VLS_ModelProps = {
|
|
38
50
|
'open'?: boolean;
|
|
@@ -52,6 +64,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
52
64
|
anchor: OverlayAnchor;
|
|
53
65
|
pane: OverlayPane;
|
|
54
66
|
blockMapInteraction: boolean;
|
|
67
|
+
panOnOpen: boolean | number;
|
|
68
|
+
hideWhenClustered: boolean;
|
|
55
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
70
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { inject, useTemplateRef, watch } from "vue";
|
|
3
3
|
import { ADVANCED_MARKER_ELEMENT_INJECTION_KEY, MARKER_INJECTION_KEY } from "./injectionKeys";
|
|
4
|
+
import { MARKER_CLUSTERER_INJECTION_KEY } from "./ScriptGoogleMapsMarkerClusterer.vue";
|
|
4
5
|
import { useGoogleMapsResource } from "./useGoogleMapsResource";
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
position: { type: null, required: false },
|
|
@@ -8,11 +9,14 @@ const props = defineProps({
|
|
|
8
9
|
offset: { type: Object, required: false },
|
|
9
10
|
pane: { type: String, required: false, default: "floatPane" },
|
|
10
11
|
zIndex: { type: Number, required: false },
|
|
11
|
-
blockMapInteraction: { type: Boolean, required: false, default: true }
|
|
12
|
+
blockMapInteraction: { type: Boolean, required: false, default: true },
|
|
13
|
+
panOnOpen: { type: [Boolean, Number], required: false, default: true },
|
|
14
|
+
hideWhenClustered: { type: Boolean, required: false, default: true }
|
|
12
15
|
});
|
|
13
16
|
const open = defineModel("open", { type: Boolean, ...{ default: void 0 } });
|
|
14
17
|
const markerContext = inject(MARKER_INJECTION_KEY, void 0);
|
|
15
18
|
const advancedMarkerElementContext = inject(ADVANCED_MARKER_ELEMENT_INJECTION_KEY, void 0);
|
|
19
|
+
const markerClustererContext = inject(MARKER_CLUSTERER_INJECTION_KEY, void 0);
|
|
16
20
|
function getResolvedPosition() {
|
|
17
21
|
if (props.position)
|
|
18
22
|
return props.position;
|
|
@@ -44,6 +48,25 @@ const ANCHOR_TRANSFORMS = {
|
|
|
44
48
|
};
|
|
45
49
|
const overlayContent = useTemplateRef("overlay-content");
|
|
46
50
|
const listeners = [];
|
|
51
|
+
function panMapToFitOverlay(el, map, padding) {
|
|
52
|
+
const child = el.firstElementChild;
|
|
53
|
+
if (!child)
|
|
54
|
+
return;
|
|
55
|
+
const overlayRect = child.getBoundingClientRect();
|
|
56
|
+
const mapRect = map.getDiv().getBoundingClientRect();
|
|
57
|
+
let panX = 0;
|
|
58
|
+
let panY = 0;
|
|
59
|
+
if (overlayRect.top - padding < mapRect.top)
|
|
60
|
+
panY = overlayRect.top - mapRect.top - padding;
|
|
61
|
+
if (overlayRect.bottom + padding > mapRect.bottom)
|
|
62
|
+
panY = overlayRect.bottom - mapRect.bottom + padding;
|
|
63
|
+
if (overlayRect.left - padding < mapRect.left)
|
|
64
|
+
panX = overlayRect.left - mapRect.left - padding;
|
|
65
|
+
else if (overlayRect.right + padding > mapRect.right)
|
|
66
|
+
panX = overlayRect.right - mapRect.right + padding;
|
|
67
|
+
if (panX !== 0 || panY !== 0)
|
|
68
|
+
map.panBy(panX, panY);
|
|
69
|
+
}
|
|
47
70
|
const overlay = useGoogleMapsResource({
|
|
48
71
|
// ready condition accesses .value on ShallowRefs — tracked by whenever() in useGoogleMapsResource
|
|
49
72
|
ready: () => !!overlayContent.value && !!(props.position || markerContext?.marker.value || advancedMarkerElementContext?.advancedMarkerElement.value),
|
|
@@ -57,6 +80,12 @@ const overlay = useGoogleMapsResource({
|
|
|
57
80
|
if (props.blockMapInteraction)
|
|
58
81
|
mapsApi.OverlayView.preventMapHitsAndGesturesFrom(el);
|
|
59
82
|
}
|
|
83
|
+
if (props.panOnOpen) {
|
|
84
|
+
const padding = typeof props.panOnOpen === "number" ? props.panOnOpen : 40;
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
panMapToFitOverlay(el, map, padding);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
60
89
|
}
|
|
61
90
|
draw() {
|
|
62
91
|
if (open.value === false) {
|
|
@@ -148,6 +177,26 @@ watch([() => props.pane, () => props.blockMapInteraction], () => {
|
|
|
148
177
|
overlay.value.setMap(map);
|
|
149
178
|
}
|
|
150
179
|
});
|
|
180
|
+
if (markerClustererContext && (markerContext || advancedMarkerElementContext)) {
|
|
181
|
+
watch(
|
|
182
|
+
() => markerClustererContext.clusteringVersion.value,
|
|
183
|
+
() => {
|
|
184
|
+
if (!props.hideWhenClustered || open.value === false)
|
|
185
|
+
return;
|
|
186
|
+
const clusterer = markerClustererContext.markerClusterer.value;
|
|
187
|
+
if (!clusterer?.clusters)
|
|
188
|
+
return;
|
|
189
|
+
const parentMarker = advancedMarkerElementContext?.advancedMarkerElement.value ?? markerContext?.marker.value;
|
|
190
|
+
if (!parentMarker)
|
|
191
|
+
return;
|
|
192
|
+
const isClustered = clusterer.clusters.some(
|
|
193
|
+
(cluster) => cluster.count > 1 && cluster.markers?.includes(parentMarker)
|
|
194
|
+
);
|
|
195
|
+
if (isClustered)
|
|
196
|
+
open.value = false;
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
151
200
|
defineExpose({ overlay });
|
|
152
201
|
</script>
|
|
153
202
|
|
|
@@ -33,6 +33,18 @@ type __VLS_Props = {
|
|
|
33
33
|
* @default true
|
|
34
34
|
*/
|
|
35
35
|
blockMapInteraction?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Pan the map so the overlay is fully visible when opened, similar to InfoWindow behavior.
|
|
38
|
+
* Set to `true` for default 40px padding, or a number for custom padding.
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
panOnOpen?: boolean | number;
|
|
42
|
+
/**
|
|
43
|
+
* Automatically hide the overlay when its parent marker joins a cluster (on zoom out).
|
|
44
|
+
* Only applies when nested inside a ScriptGoogleMapsMarkerClusterer.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
hideWhenClustered?: boolean;
|
|
36
48
|
};
|
|
37
49
|
type __VLS_ModelProps = {
|
|
38
50
|
'open'?: boolean;
|
|
@@ -52,6 +64,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
52
64
|
anchor: OverlayAnchor;
|
|
53
65
|
pane: OverlayPane;
|
|
54
66
|
blockMapInteraction: boolean;
|
|
67
|
+
panOnOpen: boolean | number;
|
|
68
|
+
hideWhenClustered: boolean;
|
|
55
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
70
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -5,7 +5,7 @@ export type GravatarInput = RegistryScriptInput<typeof GravatarOptions>;
|
|
|
5
5
|
export interface GravatarApi {
|
|
6
6
|
/**
|
|
7
7
|
* Get a proxied avatar URL for a given SHA256 email hash.
|
|
8
|
-
* When
|
|
8
|
+
* When proxy mode is enabled, this routes through your server.
|
|
9
9
|
*/
|
|
10
10
|
getAvatarUrl: (hash: string, options?: {
|
|
11
11
|
size?: number;
|