@walkeros/walker.js 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkeros/walker.js",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Ready-to-use walkerOS bundle with browser source, collector, and dataLayer support",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -18,10 +18,12 @@
18
18
  "./es5": {
19
19
  "types": "./dist/index.d.ts",
20
20
  "default": "./dist/index.es5.js"
21
- }
21
+ },
22
+ "./src/schemas": "./src/schemas.ts"
22
23
  },
23
24
  "files": [
24
25
  "dist/**",
26
+ "src/schemas.ts",
25
27
  "README.md",
26
28
  "CHANGELOG.md"
27
29
  ],
@@ -34,11 +36,11 @@
34
36
  "preview": "npm run build && npx serve -l 3333 examples"
35
37
  },
36
38
  "dependencies": {
37
- "@walkeros/core": "0.2.1",
38
- "@walkeros/collector": "0.2.1",
39
- "@walkeros/web-core": "0.2.1",
40
- "@walkeros/web-source-browser": "0.2.1",
41
- "@walkeros/web-source-datalayer": "0.2.1"
39
+ "@walkeros/core": "0.3.0",
40
+ "@walkeros/collector": "0.3.0",
41
+ "@walkeros/web-core": "0.3.0",
42
+ "@walkeros/web-source-browser": "0.3.0",
43
+ "@walkeros/web-source-datalayer": "0.3.0"
42
44
  },
43
45
  "devDependencies": {
44
46
  "@swc/jest": "^0.2.36",
package/src/schemas.ts ADDED
@@ -0,0 +1,109 @@
1
+ import type { RJSFSchema } from '@rjsf/utils';
2
+
3
+ export const settings: RJSFSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ elb: {
7
+ type: 'string',
8
+ default: 'elb',
9
+ description: 'Global function name for event tracking',
10
+ },
11
+ name: {
12
+ type: 'string',
13
+ default: 'walkerjs',
14
+ description: 'Global instance name',
15
+ },
16
+ run: {
17
+ type: 'boolean',
18
+ default: true,
19
+ description: 'Auto-initialize walker.js on load',
20
+ },
21
+ browser: {
22
+ type: 'object',
23
+ default: {
24
+ run: true,
25
+ session: true,
26
+ scope: 'document.body',
27
+ pageview: true,
28
+ },
29
+ description:
30
+ 'Browser source configuration. Set to false to disable. See browser configuration section below for details.',
31
+ },
32
+ dataLayer: {
33
+ type: 'object',
34
+ default: false,
35
+ description:
36
+ 'DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below.',
37
+ },
38
+ collector: {
39
+ type: 'object',
40
+ default: {},
41
+ description:
42
+ 'Collector configuration including destinations and consent settings. See collector configuration section below.',
43
+ },
44
+ },
45
+ };
46
+
47
+ export const browserConfig: RJSFSchema = {
48
+ type: 'object',
49
+ properties: {
50
+ 'browser.run': {
51
+ type: 'boolean',
52
+ default: true,
53
+ description: 'Auto-start DOM tracking',
54
+ },
55
+ 'browser.session': {
56
+ type: 'boolean',
57
+ default: true,
58
+ description: 'Enable session tracking',
59
+ },
60
+ 'browser.scope': {
61
+ type: 'string',
62
+ default: 'document.body',
63
+ description: 'DOM element scope for tracking',
64
+ },
65
+ 'browser.pageview': {
66
+ type: 'boolean',
67
+ default: true,
68
+ description: 'Enable automatic page view events',
69
+ },
70
+ },
71
+ };
72
+
73
+ export const dataLayerConfig: RJSFSchema = {
74
+ type: 'object',
75
+ properties: {
76
+ dataLayer: {
77
+ type: 'boolean',
78
+ default: false,
79
+ description: 'Enable dataLayer integration with defaults',
80
+ },
81
+ 'dataLayer.name': {
82
+ type: 'string',
83
+ default: 'dataLayer',
84
+ description: 'DataLayer variable name',
85
+ },
86
+ 'dataLayer.prefix': {
87
+ type: 'string',
88
+ default: 'dataLayer',
89
+ description: 'Event prefix for dataLayer events',
90
+ },
91
+ },
92
+ };
93
+
94
+ export const collectorConfig: RJSFSchema = {
95
+ type: 'object',
96
+ properties: {
97
+ 'collector.consent': {
98
+ type: 'object',
99
+ default: { functional: true },
100
+ description: 'Default consent state',
101
+ },
102
+ 'collector.destinations': {
103
+ type: 'object',
104
+ default: {},
105
+ description:
106
+ 'Destination configurations. See destinations documentation for available options.',
107
+ },
108
+ },
109
+ };