@walkeros/web-source-browser 3.0.2 → 3.1.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/dist/dev.d.mts +22 -2
- package/dist/dev.d.ts +22 -2
- 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/index.browser.js +1 -1
- package/dist/index.d.mts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +41 -68
- package/package.json +6 -4
package/dist/walkerOS.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-source-browser",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"type": "source",
|
|
6
|
-
"platform":
|
|
6
|
+
"platform": [
|
|
7
|
+
"web"
|
|
8
|
+
],
|
|
7
9
|
"renderer": "browser",
|
|
8
10
|
"docs": "https://www.walkeros.io/docs/sources/web/browser",
|
|
9
11
|
"source": "https://github.com/elbwalker/walkerOS/tree/main/packages/web/sources/browser/src"
|
|
@@ -83,6 +85,9 @@
|
|
|
83
85
|
}
|
|
84
86
|
},
|
|
85
87
|
"examples": {
|
|
88
|
+
"createTrigger": {
|
|
89
|
+
"$code": "async e=>{let n;const t=document,i=window;return{get flow(){return n},trigger:(r,o)=>async a=>{var s,u;if(\"load\"===r||!r){const e=\"object\"==typeof o&&null!==o?o:{};if(e.url){const n=new URL(e.url);i.history.replaceState({},\"\",n.pathname)}e.title&&(t.title=e.title),e.referrer&&Object.defineProperty(t,\"referrer\",{value:e.referrer,configurable:!0})}if(a&&(t.body.innerHTML=a),!n){const t=await gh({...e,run:null==(s=e.run)||s});n={collector:t.collector,elb:t.elb}}if(!r||\"load\"===r)return;const l=\"string\"==typeof o?o:void 0,c=l?t.querySelector(l):null,d=e=>{c?c.dispatchEvent(e):console.warn(`Trigger: element not found for selector \"${l}\"`)};switch(r){case\"click\":d(new MouseEvent(\"click\",{bubbles:!0}));break;case\"submit\":d(new Event(\"submit\",{bubbles:!0}));break;case\"hover\":d(new MouseEvent(\"mouseenter\",{bubbles:!0}));break;case\"scroll\":Object.defineProperty(i,\"scrollY\",{value:\"object\"==typeof o&&null!==o&&null!=(u=o.distance)?u:500,configurable:!0}),i.dispatchEvent(new Event(\"scroll\"));break;case\"impression\":case\"visible\":c&&console.warn(`Trigger: \"${r}\" requires IntersectionObserver mock in test environment`);break;default:console.warn(`Trigger: unknown type \"${r}\"`)}}}}"
|
|
90
|
+
},
|
|
86
91
|
"env": {
|
|
87
92
|
"push": {
|
|
88
93
|
"push": {
|
|
@@ -196,15 +201,11 @@
|
|
|
196
201
|
},
|
|
197
202
|
"step": {
|
|
198
203
|
"clickEvent": {
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"attributes": {
|
|
203
|
-
"data-elb": "cta",
|
|
204
|
-
"data-elb-cta": "label:Sign Up",
|
|
205
|
-
"data-elbaction": "click:click"
|
|
206
|
-
}
|
|
204
|
+
"trigger": {
|
|
205
|
+
"type": "click",
|
|
206
|
+
"options": "button"
|
|
207
207
|
},
|
|
208
|
+
"in": "<button data-elb=\"cta\" data-elb-cta=\"label:Sign Up\" data-elbaction=\"click:click\">Sign Up</button>",
|
|
208
209
|
"out": {
|
|
209
210
|
"name": "cta click",
|
|
210
211
|
"data": {
|
|
@@ -216,22 +217,11 @@
|
|
|
216
217
|
}
|
|
217
218
|
},
|
|
218
219
|
"contextAndGlobals": {
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"attributes": {
|
|
223
|
-
"data-elb": "cta",
|
|
224
|
-
"data-elb-cta": "label:Try Now",
|
|
225
|
-
"data-elbaction": "click:signup"
|
|
226
|
-
},
|
|
227
|
-
"context": {
|
|
228
|
-
"test": "engagement_flow"
|
|
229
|
-
},
|
|
230
|
-
"globals": {
|
|
231
|
-
"language": "en",
|
|
232
|
-
"plan": "premium"
|
|
233
|
-
}
|
|
220
|
+
"trigger": {
|
|
221
|
+
"type": "click",
|
|
222
|
+
"options": "[data-elb=\"cta\"]"
|
|
234
223
|
},
|
|
224
|
+
"in": "<div data-elbcontext=\"test:engagement_flow\" data-elbglobals=\"language:en;plan:premium\"><div data-elb=\"cta\" data-elb-cta=\"label:Try Now\" data-elbaction=\"click:signup\">Try Now</div></div>",
|
|
235
225
|
"out": {
|
|
236
226
|
"name": "cta signup",
|
|
237
227
|
"data": {
|
|
@@ -253,15 +243,11 @@
|
|
|
253
243
|
}
|
|
254
244
|
},
|
|
255
245
|
"dataAttributeTypes": {
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"attributes": {
|
|
260
|
-
"data-elb": "product",
|
|
261
|
-
"data-elb-product": "price:99.99;available:true;colors[]:red;colors[]:blue",
|
|
262
|
-
"data-elbaction": "click:select"
|
|
263
|
-
}
|
|
246
|
+
"trigger": {
|
|
247
|
+
"type": "click",
|
|
248
|
+
"options": "div"
|
|
264
249
|
},
|
|
250
|
+
"in": "<div data-elb=\"product\" data-elb-product=\"price:99.99;available:true;colors[]:red;colors[]:blue\" data-elbaction=\"click:select\"></div>",
|
|
265
251
|
"out": {
|
|
266
252
|
"name": "product select",
|
|
267
253
|
"data": {
|
|
@@ -278,15 +264,11 @@
|
|
|
278
264
|
}
|
|
279
265
|
},
|
|
280
266
|
"impressionEvent": {
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"attributes": {
|
|
285
|
-
"data-elb": "banner",
|
|
286
|
-
"data-elb-banner": "type:promotional;position:sidebar",
|
|
287
|
-
"data-elbaction": "impression:view"
|
|
288
|
-
}
|
|
267
|
+
"trigger": {
|
|
268
|
+
"type": "impression",
|
|
269
|
+
"options": "div"
|
|
289
270
|
},
|
|
271
|
+
"in": "<div data-elb=\"banner\" data-elb-banner=\"type:promotional;position:sidebar\" data-elbaction=\"impression:view\"></div>",
|
|
290
272
|
"out": {
|
|
291
273
|
"name": "banner view",
|
|
292
274
|
"data": {
|
|
@@ -299,21 +281,10 @@
|
|
|
299
281
|
}
|
|
300
282
|
},
|
|
301
283
|
"nestedEntities": {
|
|
302
|
-
"
|
|
303
|
-
"
|
|
304
|
-
"element": "div[data-elb=\"product\"]",
|
|
305
|
-
"attributes": {
|
|
306
|
-
"data-elb": "product",
|
|
307
|
-
"data-elb-product": "id:SKU-42;name:Sneakers",
|
|
308
|
-
"data-elbaction": "load:view"
|
|
309
|
-
},
|
|
310
|
-
"children": [
|
|
311
|
-
{
|
|
312
|
-
"data-elb": "size",
|
|
313
|
-
"data-elb-size": "selected:large;inStock:true"
|
|
314
|
-
}
|
|
315
|
-
]
|
|
284
|
+
"trigger": {
|
|
285
|
+
"type": "load"
|
|
316
286
|
},
|
|
287
|
+
"in": "<div data-elb=\"product\" data-elb-product=\"id:SKU-42;name:Sneakers\" data-elbaction=\"load:view\"><div data-elb=\"size\" data-elb-size=\"selected:large;inStock:true\"></div></div>",
|
|
317
288
|
"out": {
|
|
318
289
|
"name": "product view",
|
|
319
290
|
"data": {
|
|
@@ -335,12 +306,15 @@
|
|
|
335
306
|
}
|
|
336
307
|
},
|
|
337
308
|
"pageView": {
|
|
338
|
-
"
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
|
|
342
|
-
|
|
309
|
+
"trigger": {
|
|
310
|
+
"type": "load",
|
|
311
|
+
"options": {
|
|
312
|
+
"url": "https://example.com/docs",
|
|
313
|
+
"title": "Documentation",
|
|
314
|
+
"referrer": "https://example.com/"
|
|
315
|
+
}
|
|
343
316
|
},
|
|
317
|
+
"in": "",
|
|
344
318
|
"out": {
|
|
345
319
|
"name": "page view",
|
|
346
320
|
"data": {
|
|
@@ -360,15 +334,11 @@
|
|
|
360
334
|
}
|
|
361
335
|
},
|
|
362
336
|
"submitEvent": {
|
|
363
|
-
"
|
|
364
|
-
"
|
|
365
|
-
"
|
|
366
|
-
"attributes": {
|
|
367
|
-
"data-elb": "signup",
|
|
368
|
-
"data-elb-signup": "plan:premium",
|
|
369
|
-
"data-elbaction": "submit:complete"
|
|
370
|
-
}
|
|
337
|
+
"trigger": {
|
|
338
|
+
"type": "submit",
|
|
339
|
+
"options": "form"
|
|
371
340
|
},
|
|
341
|
+
"in": "<form data-elb=\"signup\" data-elb-signup=\"plan:premium\" data-elbaction=\"submit:complete\"></form>",
|
|
372
342
|
"out": {
|
|
373
343
|
"name": "signup complete",
|
|
374
344
|
"data": {
|
|
@@ -379,6 +349,9 @@
|
|
|
379
349
|
"action": "complete"
|
|
380
350
|
}
|
|
381
351
|
}
|
|
352
|
+
},
|
|
353
|
+
"trigger": {
|
|
354
|
+
"$code": "(e,n)=>{if(!e||\"object\"!=typeof e)return;const t=e,i=n.document,r=n.window,o=()=>{var e,n;if(!t.attributes)return;const r=(null==(n=null==(e=t.element)?void 0:e.match(/^(\\w+)/))?void 0:n[1])||\"div\",o=i.createElement(r);for(const[e,n]of Object.entries(t.attributes))o.setAttribute(e,n);if(t.children)for(const e of t.children){const n=i.createElement(\"div\");for(const[t,i]of Object.entries(e))n.setAttribute(t,i);o.appendChild(n)}return i.body.appendChild(o),o};if(!t.trigger||\"load\"===t.trigger){if(t.url){const e=new URL(t.url);r.history.replaceState({},\"\",e.pathname)}return t.title&&(i.title=t.title),t.referrer&&Object.defineProperty(i,\"referrer\",{value:t.referrer}),void o()}return()=>{const e=o();if(e)switch(t.trigger){case\"click\":e.dispatchEvent(new MouseEvent(\"click\",{bubbles:!0}));break;case\"submit\":e.dispatchEvent(new Event(\"submit\",{bubbles:!0}));break;case\"hover\":e.dispatchEvent(new MouseEvent(\"mouseenter\",{bubbles:!0}));break;case\"scroll\":r.dispatchEvent(new Event(\"scroll\"))}}}"
|
|
382
355
|
}
|
|
383
356
|
}
|
|
384
357
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-source-browser",
|
|
3
3
|
"description": "Browser DOM source for walkerOS",
|
|
4
|
-
"version": "3.0
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"update": "npx npm-check-updates -u && npm update"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@walkeros/collector": "^3.0
|
|
35
|
-
"@walkeros/web-core": "^3.0
|
|
34
|
+
"@walkeros/collector": "^3.1.0",
|
|
35
|
+
"@walkeros/web-core": "^3.1.0"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"walkerOS": {
|
|
47
47
|
"type": "source",
|
|
48
|
-
"platform":
|
|
48
|
+
"platform": [
|
|
49
|
+
"web"
|
|
50
|
+
],
|
|
49
51
|
"renderer": "browser",
|
|
50
52
|
"docs": "https://www.walkeros.io/docs/sources/web/browser"
|
|
51
53
|
},
|