@walkeros/web-destination-plausible 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.js +1 -1
- package/dist/examples/index.mjs +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/examples/index.js
CHANGED
|
@@ -93,7 +93,7 @@ function y(e, t = {}, n = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
function C(e = {}) {
|
|
95
95
|
var _a;
|
|
96
|
-
const t = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e.group || "gr0up", o = e.count || 1, r = y({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "0.
|
|
96
|
+
const t = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e.group || "gr0up", o = e.count || 1, r = y({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "0.4.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e, { merge: false });
|
|
97
97
|
if (e.name) {
|
|
98
98
|
const [t2, n2] = (_a = e.name.split(" ")) != null ? _a : [];
|
|
99
99
|
t2 && n2 && (r.entity = t2, r.action = n2);
|
package/dist/examples/index.mjs
CHANGED
|
@@ -71,7 +71,7 @@ function y(e, t = {}, n = {}) {
|
|
|
71
71
|
}
|
|
72
72
|
function C(e = {}) {
|
|
73
73
|
var _a;
|
|
74
|
-
const t = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e.group || "gr0up", o = e.count || 1, r = y({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "0.
|
|
74
|
+
const t = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e.group || "gr0up", o = e.count || 1, r = y({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "0.4.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e, { merge: false });
|
|
75
75
|
if (e.name) {
|
|
76
76
|
const [t2, n2] = (_a = e.name.split(" ")) != null ? _a : [];
|
|
77
77
|
t2 && n2 && (r.entity = t2, r.action = n2);
|
package/dist/index.d.mts
CHANGED
|
@@ -14,6 +14,7 @@ type Plausible = (event: string, options?: {
|
|
|
14
14
|
interface Settings {
|
|
15
15
|
domain?: string;
|
|
16
16
|
}
|
|
17
|
+
type InitSettings = Partial<Settings>;
|
|
17
18
|
interface Mapping {
|
|
18
19
|
}
|
|
19
20
|
interface Env extends DestinationWeb.Env {
|
|
@@ -23,7 +24,7 @@ interface Env extends DestinationWeb.Env {
|
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
27
|
+
type Types = Destination$1.Types<Settings, Mapping, Env, InitSettings>;
|
|
27
28
|
type Destination = DestinationWeb.Destination<Types>;
|
|
28
29
|
type Config = DestinationWeb.Config<Types>;
|
|
29
30
|
interface PlausibleDestination extends Destination {
|
|
@@ -35,6 +36,7 @@ type Rules = Mapping$1.Rules<Rule>;
|
|
|
35
36
|
type index_Config = Config;
|
|
36
37
|
type index_Destination = Destination;
|
|
37
38
|
type index_Env = Env;
|
|
39
|
+
type index_InitSettings = InitSettings;
|
|
38
40
|
type index_Mapping = Mapping;
|
|
39
41
|
type index_Plausible = Plausible;
|
|
40
42
|
type index_PlausibleDestination = PlausibleDestination;
|
|
@@ -43,7 +45,7 @@ type index_Rules = Rules;
|
|
|
43
45
|
type index_Settings = Settings;
|
|
44
46
|
type index_Types = Types;
|
|
45
47
|
declare namespace index {
|
|
46
|
-
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_Mapping as Mapping, index_Plausible as Plausible, index_PlausibleDestination as PlausibleDestination, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
48
|
+
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Plausible as Plausible, index_PlausibleDestination as PlausibleDestination, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
declare const destinationPlausible: Destination;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ type Plausible = (event: string, options?: {
|
|
|
14
14
|
interface Settings {
|
|
15
15
|
domain?: string;
|
|
16
16
|
}
|
|
17
|
+
type InitSettings = Partial<Settings>;
|
|
17
18
|
interface Mapping {
|
|
18
19
|
}
|
|
19
20
|
interface Env extends DestinationWeb.Env {
|
|
@@ -23,7 +24,7 @@ interface Env extends DestinationWeb.Env {
|
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
27
|
+
type Types = Destination$1.Types<Settings, Mapping, Env, InitSettings>;
|
|
27
28
|
type Destination = DestinationWeb.Destination<Types>;
|
|
28
29
|
type Config = DestinationWeb.Config<Types>;
|
|
29
30
|
interface PlausibleDestination extends Destination {
|
|
@@ -35,6 +36,7 @@ type Rules = Mapping$1.Rules<Rule>;
|
|
|
35
36
|
type index_Config = Config;
|
|
36
37
|
type index_Destination = Destination;
|
|
37
38
|
type index_Env = Env;
|
|
39
|
+
type index_InitSettings = InitSettings;
|
|
38
40
|
type index_Mapping = Mapping;
|
|
39
41
|
type index_Plausible = Plausible;
|
|
40
42
|
type index_PlausibleDestination = PlausibleDestination;
|
|
@@ -43,7 +45,7 @@ type index_Rules = Rules;
|
|
|
43
45
|
type index_Settings = Settings;
|
|
44
46
|
type index_Types = Types;
|
|
45
47
|
declare namespace index {
|
|
46
|
-
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_Mapping as Mapping, index_Plausible as Plausible, index_PlausibleDestination as PlausibleDestination, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
48
|
+
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Plausible as Plausible, index_PlausibleDestination as PlausibleDestination, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
declare const destinationPlausible: Destination;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { Config, Destination } from './types';\nimport type { DestinationWeb } from '@walkeros/web-core';\nimport { isObject } from '@walkeros/core';\nimport { getEnv } from '@walkeros/web-core';\n\n// Types\nexport * as DestinationPlausible from './types';\n\nexport const destinationPlausible: Destination = {\n type: 'plausible',\n\n config: {},\n\n init({ config, env }) {\n const { window } = getEnv(env);\n const w = window as Window;\n const settings = config.settings || {};\n\n if (config.loadScript) addScript(settings.domain, env);\n\n w.plausible =\n w.plausible ||\n function () {\n (w.plausible!.q = w.plausible!.q || []).push(arguments);\n };\n\n return config;\n },\n\n push(event, { config, data, env }) {\n const params = isObject(data) ? data : {};\n\n const { window } = getEnv(env);\n const plausible = (window as Window).plausible!;\n plausible(`${event.name}`, params);\n },\n};\n\nfunction addScript(\n domain?: string,\n env?: DestinationWeb.Env,\n src = 'https://plausible.io/js/script.manual.js',\n) {\n const { document } = getEnv(env);\n const doc = document as Document;\n const script = doc.createElement('script');\n script.src = src;\n if (domain) script.dataset.domain = domain;\n doc.head.appendChild(script);\n}\n\nexport default destinationPlausible;\n","import type {\n Mapping as WalkerOSMapping,\n WalkerOS,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\ndeclare global {\n interface Window {\n plausible?: Plausible & { q?: IArguments[] };\n }\n}\n\nexport type Plausible = (\n event: string,\n options?: { props?: WalkerOS.AnyObject },\n) => void;\n\nexport interface Settings {\n domain?: string;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationWeb.Env {\n window: {\n plausible: Plausible & { q?: IArguments[] };\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PlausibleDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A;;;;;;;;;;AAGA,sBAAuB;;;ACHvB;;;ADQO,IAAM,uBAAoC;AAAA,EAC/C,MAAM;AAAA,EAEN,QAAQ,CAAC;AAAA,EAET,KAAK,EAAE,QAAQ,IAAI,GAAG;AACpB,UAAM,EAAE,OAAO,QAAI,wBAAO,GAAG;AAC7B,UAAM,IAAI;AACV,UAAM,WAAW,OAAO,YAAY,CAAC;AAErC,QAAI,OAAO,WAAY,WAAU,SAAS,QAAQ,GAAG;AAErD,MAAE,YACA,EAAE,aACF,WAAY;AACV,OAAC,EAAE,UAAW,IAAI,EAAE,UAAW,KAAK,CAAC,GAAG,KAAK,SAAS;AAAA,IACxD;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,MAAM,IAAI,GAAG;AACjC,UAAM,SAAS,EAAS,IAAI,IAAI,OAAO,CAAC;AAExC,UAAM,EAAE,OAAO,QAAI,wBAAO,GAAG;AAC7B,UAAM,YAAa,OAAkB;AACrC,cAAU,GAAG,MAAM,IAAI,IAAI,MAAM;AAAA,EACnC;AACF;AAEA,SAAS,UACP,QACA,KACA,MAAM,4CACN;AACA,QAAM,EAAE,UAAAA,UAAS,QAAI,wBAAO,GAAG;AAC/B,QAAM,MAAMA;AACZ,QAAM,SAAS,IAAI,cAAc,QAAQ;AACzC,SAAO,MAAM;AACb,MAAI,OAAQ,QAAO,QAAQ,SAAS;AACpC,MAAI,KAAK,YAAY,MAAM;AAC7B;AAEA,IAAO,gBAAQ;","names":["document"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { Config, Destination } from './types';\nimport type { DestinationWeb } from '@walkeros/web-core';\nimport { isObject } from '@walkeros/core';\nimport { getEnv } from '@walkeros/web-core';\n\n// Types\nexport * as DestinationPlausible from './types';\n\nexport const destinationPlausible: Destination = {\n type: 'plausible',\n\n config: {},\n\n init({ config, env }) {\n const { window } = getEnv(env);\n const w = window as Window;\n const settings = config.settings || {};\n\n if (config.loadScript) addScript(settings.domain, env);\n\n w.plausible =\n w.plausible ||\n function () {\n (w.plausible!.q = w.plausible!.q || []).push(arguments);\n };\n\n return config;\n },\n\n push(event, { config, data, env }) {\n const params = isObject(data) ? data : {};\n\n const { window } = getEnv(env);\n const plausible = (window as Window).plausible!;\n plausible(`${event.name}`, params);\n },\n};\n\nfunction addScript(\n domain?: string,\n env?: DestinationWeb.Env,\n src = 'https://plausible.io/js/script.manual.js',\n) {\n const { document } = getEnv(env);\n const doc = document as Document;\n const script = doc.createElement('script');\n script.src = src;\n if (domain) script.dataset.domain = domain;\n doc.head.appendChild(script);\n}\n\nexport default destinationPlausible;\n","import type {\n Mapping as WalkerOSMapping,\n WalkerOS,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\ndeclare global {\n interface Window {\n plausible?: Plausible & { q?: IArguments[] };\n }\n}\n\nexport type Plausible = (\n event: string,\n options?: { props?: WalkerOS.AnyObject },\n) => void;\n\nexport interface Settings {\n domain?: string;\n}\n\nexport type InitSettings = Partial<Settings>;\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationWeb.Env {\n window: {\n plausible: Plausible & { q?: IArguments[] };\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env, InitSettings>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PlausibleDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A;;;;;;;;;;AAGA,sBAAuB;;;ACHvB;;;ADQO,IAAM,uBAAoC;AAAA,EAC/C,MAAM;AAAA,EAEN,QAAQ,CAAC;AAAA,EAET,KAAK,EAAE,QAAQ,IAAI,GAAG;AACpB,UAAM,EAAE,OAAO,QAAI,wBAAO,GAAG;AAC7B,UAAM,IAAI;AACV,UAAM,WAAW,OAAO,YAAY,CAAC;AAErC,QAAI,OAAO,WAAY,WAAU,SAAS,QAAQ,GAAG;AAErD,MAAE,YACA,EAAE,aACF,WAAY;AACV,OAAC,EAAE,UAAW,IAAI,EAAE,UAAW,KAAK,CAAC,GAAG,KAAK,SAAS;AAAA,IACxD;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,MAAM,IAAI,GAAG;AACjC,UAAM,SAAS,EAAS,IAAI,IAAI,OAAO,CAAC;AAExC,UAAM,EAAE,OAAO,QAAI,wBAAO,GAAG;AAC7B,UAAM,YAAa,OAAkB;AACrC,cAAU,GAAG,MAAM,IAAI,IAAI,MAAM;AAAA,EACnC;AACF;AAEA,SAAS,UACP,QACA,KACA,MAAM,4CACN;AACA,QAAM,EAAE,UAAAA,UAAS,QAAI,wBAAO,GAAG;AAC/B,QAAM,MAAMA;AACZ,QAAM,SAAS,IAAI,cAAc,QAAQ;AACzC,SAAO,MAAM;AACb,MAAI,OAAQ,QAAO,QAAQ,SAAS;AACpC,MAAI,KAAK,YAAY,MAAM;AAC7B;AAEA,IAAO,gBAAQ;","names":["document"]}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { Config, Destination } from './types';\nimport type { DestinationWeb } from '@walkeros/web-core';\nimport { isObject } from '@walkeros/core';\nimport { getEnv } from '@walkeros/web-core';\n\n// Types\nexport * as DestinationPlausible from './types';\n\nexport const destinationPlausible: Destination = {\n type: 'plausible',\n\n config: {},\n\n init({ config, env }) {\n const { window } = getEnv(env);\n const w = window as Window;\n const settings = config.settings || {};\n\n if (config.loadScript) addScript(settings.domain, env);\n\n w.plausible =\n w.plausible ||\n function () {\n (w.plausible!.q = w.plausible!.q || []).push(arguments);\n };\n\n return config;\n },\n\n push(event, { config, data, env }) {\n const params = isObject(data) ? data : {};\n\n const { window } = getEnv(env);\n const plausible = (window as Window).plausible!;\n plausible(`${event.name}`, params);\n },\n};\n\nfunction addScript(\n domain?: string,\n env?: DestinationWeb.Env,\n src = 'https://plausible.io/js/script.manual.js',\n) {\n const { document } = getEnv(env);\n const doc = document as Document;\n const script = doc.createElement('script');\n script.src = src;\n if (domain) script.dataset.domain = domain;\n doc.head.appendChild(script);\n}\n\nexport default destinationPlausible;\n","import type {\n Mapping as WalkerOSMapping,\n WalkerOS,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\ndeclare global {\n interface Window {\n plausible?: Plausible & { q?: IArguments[] };\n }\n}\n\nexport type Plausible = (\n event: string,\n options?: { props?: WalkerOS.AnyObject },\n) => void;\n\nexport interface Settings {\n domain?: string;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationWeb.Env {\n window: {\n plausible: Plausible & { q?: IArguments[] };\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PlausibleDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";;;;;;;;;AAGA,SAAS,cAAc;;;ACHvB;;;ADQO,IAAM,uBAAoC;AAAA,EAC/C,MAAM;AAAA,EAEN,QAAQ,CAAC;AAAA,EAET,KAAK,EAAE,QAAQ,IAAI,GAAG;AACpB,UAAM,EAAE,OAAO,IAAI,OAAO,GAAG;AAC7B,UAAM,IAAI;AACV,UAAM,WAAW,OAAO,YAAY,CAAC;AAErC,QAAI,OAAO,WAAY,WAAU,SAAS,QAAQ,GAAG;AAErD,MAAE,YACA,EAAE,aACF,WAAY;AACV,OAAC,EAAE,UAAW,IAAI,EAAE,UAAW,KAAK,CAAC,GAAG,KAAK,SAAS;AAAA,IACxD;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,MAAM,IAAI,GAAG;AACjC,UAAM,SAAS,EAAS,IAAI,IAAI,OAAO,CAAC;AAExC,UAAM,EAAE,OAAO,IAAI,OAAO,GAAG;AAC7B,UAAM,YAAa,OAAkB;AACrC,cAAU,GAAG,MAAM,IAAI,IAAI,MAAM;AAAA,EACnC;AACF;AAEA,SAAS,UACP,QACA,KACA,MAAM,4CACN;AACA,QAAM,EAAE,UAAAA,UAAS,IAAI,OAAO,GAAG;AAC/B,QAAM,MAAMA;AACZ,QAAM,SAAS,IAAI,cAAc,QAAQ;AACzC,SAAO,MAAM;AACb,MAAI,OAAQ,QAAO,QAAQ,SAAS;AACpC,MAAI,KAAK,YAAY,MAAM;AAC7B;AAEA,IAAO,gBAAQ;","names":["document"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { Config, Destination } from './types';\nimport type { DestinationWeb } from '@walkeros/web-core';\nimport { isObject } from '@walkeros/core';\nimport { getEnv } from '@walkeros/web-core';\n\n// Types\nexport * as DestinationPlausible from './types';\n\nexport const destinationPlausible: Destination = {\n type: 'plausible',\n\n config: {},\n\n init({ config, env }) {\n const { window } = getEnv(env);\n const w = window as Window;\n const settings = config.settings || {};\n\n if (config.loadScript) addScript(settings.domain, env);\n\n w.plausible =\n w.plausible ||\n function () {\n (w.plausible!.q = w.plausible!.q || []).push(arguments);\n };\n\n return config;\n },\n\n push(event, { config, data, env }) {\n const params = isObject(data) ? data : {};\n\n const { window } = getEnv(env);\n const plausible = (window as Window).plausible!;\n plausible(`${event.name}`, params);\n },\n};\n\nfunction addScript(\n domain?: string,\n env?: DestinationWeb.Env,\n src = 'https://plausible.io/js/script.manual.js',\n) {\n const { document } = getEnv(env);\n const doc = document as Document;\n const script = doc.createElement('script');\n script.src = src;\n if (domain) script.dataset.domain = domain;\n doc.head.appendChild(script);\n}\n\nexport default destinationPlausible;\n","import type {\n Mapping as WalkerOSMapping,\n WalkerOS,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\ndeclare global {\n interface Window {\n plausible?: Plausible & { q?: IArguments[] };\n }\n}\n\nexport type Plausible = (\n event: string,\n options?: { props?: WalkerOS.AnyObject },\n) => void;\n\nexport interface Settings {\n domain?: string;\n}\n\nexport type InitSettings = Partial<Settings>;\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationWeb.Env {\n window: {\n plausible: Plausible & { q?: IArguments[] };\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env, InitSettings>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PlausibleDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";;;;;;;;;AAGA,SAAS,cAAc;;;ACHvB;;;ADQO,IAAM,uBAAoC;AAAA,EAC/C,MAAM;AAAA,EAEN,QAAQ,CAAC;AAAA,EAET,KAAK,EAAE,QAAQ,IAAI,GAAG;AACpB,UAAM,EAAE,OAAO,IAAI,OAAO,GAAG;AAC7B,UAAM,IAAI;AACV,UAAM,WAAW,OAAO,YAAY,CAAC;AAErC,QAAI,OAAO,WAAY,WAAU,SAAS,QAAQ,GAAG;AAErD,MAAE,YACA,EAAE,aACF,WAAY;AACV,OAAC,EAAE,UAAW,IAAI,EAAE,UAAW,KAAK,CAAC,GAAG,KAAK,SAAS;AAAA,IACxD;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,MAAM,IAAI,GAAG;AACjC,UAAM,SAAS,EAAS,IAAI,IAAI,OAAO,CAAC;AAExC,UAAM,EAAE,OAAO,IAAI,OAAO,GAAG;AAC7B,UAAM,YAAa,OAAkB;AACrC,cAAU,GAAG,MAAM,IAAI,IAAI,MAAM;AAAA,EACnC;AACF;AAEA,SAAS,UACP,QACA,KACA,MAAM,4CACN;AACA,QAAM,EAAE,UAAAA,UAAS,IAAI,OAAO,GAAG;AAC/B,QAAM,MAAMA;AACZ,QAAM,SAAS,IAAI,cAAc,QAAQ;AACzC,SAAO,MAAM;AACb,MAAI,OAAQ,QAAO,QAAQ,SAAS;AACpC,MAAI,KAAK,YAAY,MAAM;AAC7B;AAEA,IAAO,gBAAQ;","names":["document"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-plausible",
|
|
3
3
|
"description": "Plausible web destination for walkerOS",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"update": "npx npm-check-updates -u && npm update"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@walkeros/web-core": "0.4.
|
|
38
|
+
"@walkeros/web-core": "0.4.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {},
|
|
41
41
|
"repository": {
|