@walkeros/walker.js 0.3.3 → 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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=walkerjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkerjs.d.ts","sourceRoot":"","sources":["../src/walkerjs.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { parseInlineConfig } from '@walkeros/web-core';
2
+ import { createWalkerjs } from './index';
3
+ if (window && document) {
4
+ const initializeWalker = async () => {
5
+ let globalConfig;
6
+ // Check for config from script tag
7
+ const scriptElement = document.querySelector('script[data-elbconfig]');
8
+ if (scriptElement) {
9
+ const configValue = scriptElement.getAttribute('data-elbconfig') || '';
10
+ if (configValue.includes(':')) {
11
+ // Inline config: "elb:track;run:false;instance:myWalker"
12
+ globalConfig = parseInlineConfig(configValue);
13
+ }
14
+ else if (configValue) {
15
+ // Named config: "myWalkerConfig"
16
+ globalConfig = window[configValue];
17
+ }
18
+ }
19
+ // Fallback to window.elbConfig
20
+ if (!globalConfig)
21
+ globalConfig = window.elbConfig;
22
+ // Auto-initialize if config is found
23
+ if (globalConfig) {
24
+ await createWalkerjs(globalConfig);
25
+ }
26
+ };
27
+ // Initialize immediately if DOM is ready, otherwise wait for DOM ready
28
+ if (document.readyState === 'loading') {
29
+ document.addEventListener('DOMContentLoaded', initializeWalker);
30
+ }
31
+ else {
32
+ initializeWalker();
33
+ }
34
+ }
35
+ //# sourceMappingURL=walkerjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkerjs.js","sourceRoot":"","sources":["../src/walkerjs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;IACvB,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAClC,IAAI,YAAgC,CAAC;QAErC,mCAAmC;QACnC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;QACvE,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,WAAW,GAAG,aAAa,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAEvE,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,yDAAyD;gBACzD,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAW,CAAC;YAC1D,CAAC;iBAAM,IAAI,WAAW,EAAE,CAAC;gBACvB,iCAAiC;gBACjC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAW,CAAC;YAC/C,CAAC;QACH,CAAC;QAED,+BAA+B;QAC/B,IAAI,CAAC,YAAY;YAAE,YAAY,GAAG,MAAM,CAAC,SAAmB,CAAC;QAE7D,qCAAqC;QACrC,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,cAAc,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC;IAEF,uEAAuE;IACvE,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACtC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,gBAAgB,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkeros/walker.js",
3
- "version": "0.3.3",
3
+ "version": "0.4.1",
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",
@@ -19,11 +19,13 @@
19
19
  "types": "./dist/index.d.ts",
20
20
  "default": "./dist/index.es5.js"
21
21
  },
22
- "./src/schemas": "./src/schemas.ts"
22
+ "./src/schemas": "./src/schemas.ts",
23
+ "./src/dev": "./src/dev.ts"
23
24
  },
24
25
  "files": [
25
26
  "dist/**",
26
27
  "src/schemas.ts",
28
+ "src/dev.ts",
27
29
  "README.md",
28
30
  "CHANGELOG.md"
29
31
  ],
@@ -36,11 +38,11 @@
36
38
  "preview": "npm run build && npx serve -l 3333 examples"
37
39
  },
38
40
  "dependencies": {
39
- "@walkeros/core": "0.3.1",
40
- "@walkeros/collector": "0.3.1",
41
- "@walkeros/web-core": "0.3.1",
42
- "@walkeros/web-source-browser": "0.3.2",
43
- "@walkeros/web-source-datalayer": "0.3.1"
41
+ "@walkeros/core": "0.4.1",
42
+ "@walkeros/collector": "0.4.1",
43
+ "@walkeros/web-core": "0.4.1",
44
+ "@walkeros/web-source-browser": "0.4.1",
45
+ "@walkeros/web-source-datalayer": "0.4.1"
44
46
  },
45
47
  "devDependencies": {
46
48
  "@swc/jest": "^0.2.36",
package/src/dev.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * as schemas from './schemas';
2
+
3
+ export {
4
+ settings,
5
+ browserConfig,
6
+ dataLayerConfig,
7
+ collectorConfig,
8
+ } from './schemas';