@amplitude/plugin-autocapture-browser 0.9.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/LICENSE +21 -0
- package/README.md +83 -0
- package/lib/cjs/autocapture-plugin.d.ts +44 -0
- package/lib/cjs/autocapture-plugin.d.ts.map +1 -0
- package/lib/cjs/autocapture-plugin.js +232 -0
- package/lib/cjs/autocapture-plugin.js.map +1 -0
- package/lib/cjs/constants.d.ts +29 -0
- package/lib/cjs/constants.d.ts.map +1 -0
- package/lib/cjs/constants.js +34 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/helpers.d.ts +24 -0
- package/lib/cjs/helpers.d.ts.map +1 -0
- package/lib/cjs/helpers.js +228 -0
- package/lib/cjs/helpers.js.map +1 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/libs/finder.d.ts +13 -0
- package/lib/cjs/libs/finder.d.ts.map +1 -0
- package/lib/cjs/libs/finder.js +345 -0
- package/lib/cjs/libs/finder.js.map +1 -0
- package/lib/cjs/libs/messenger.d.ts +57 -0
- package/lib/cjs/libs/messenger.d.ts.map +1 -0
- package/lib/cjs/libs/messenger.js +88 -0
- package/lib/cjs/libs/messenger.js.map +1 -0
- package/lib/cjs/typings/autocapture.d.ts +2 -0
- package/lib/cjs/typings/autocapture.d.ts.map +1 -0
- package/lib/cjs/typings/autocapture.js +2 -0
- package/lib/cjs/typings/autocapture.js.map +1 -0
- package/lib/cjs/version.d.ts +2 -0
- package/lib/cjs/version.d.ts.map +1 -0
- package/lib/cjs/version.js +4 -0
- package/lib/cjs/version.js.map +1 -0
- package/lib/esm/autocapture-plugin.d.ts +44 -0
- package/lib/esm/autocapture-plugin.d.ts.map +1 -0
- package/lib/esm/autocapture-plugin.js +228 -0
- package/lib/esm/autocapture-plugin.js.map +1 -0
- package/lib/esm/constants.d.ts +29 -0
- package/lib/esm/constants.d.ts.map +1 -0
- package/lib/esm/constants.js +32 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/helpers.d.ts +24 -0
- package/lib/esm/helpers.d.ts.map +1 -0
- package/lib/esm/helpers.js +211 -0
- package/lib/esm/helpers.js.map +1 -0
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/libs/finder.d.ts +13 -0
- package/lib/esm/libs/finder.d.ts.map +1 -0
- package/lib/esm/libs/finder.js +342 -0
- package/lib/esm/libs/finder.js.map +1 -0
- package/lib/esm/libs/messenger.d.ts +57 -0
- package/lib/esm/libs/messenger.d.ts.map +1 -0
- package/lib/esm/libs/messenger.js +86 -0
- package/lib/esm/libs/messenger.js.map +1 -0
- package/lib/esm/typings/autocapture.d.ts +2 -0
- package/lib/esm/typings/autocapture.d.ts.map +1 -0
- package/lib/esm/typings/autocapture.js +2 -0
- package/lib/esm/typings/autocapture.js.map +1 -0
- package/lib/esm/version.d.ts +2 -0
- package/lib/esm/version.d.ts.map +1 -0
- package/lib/esm/version.js +2 -0
- package/lib/esm/version.js.map +1 -0
- package/lib/scripts/amplitude-min.js +1 -0
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -0
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/autocapture-plugin.d.ts +44 -0
- package/lib/scripts/autocapture-plugin.d.ts.map +1 -0
- package/lib/scripts/constants.d.ts +29 -0
- package/lib/scripts/constants.d.ts.map +1 -0
- package/lib/scripts/helpers.d.ts +24 -0
- package/lib/scripts/helpers.d.ts.map +1 -0
- package/lib/scripts/index.d.ts +3 -0
- package/lib/scripts/index.d.ts.map +1 -0
- package/lib/scripts/libs/finder.d.ts +13 -0
- package/lib/scripts/libs/finder.d.ts.map +1 -0
- package/lib/scripts/libs/messenger.d.ts +57 -0
- package/lib/scripts/libs/messenger.d.ts.map +1 -0
- package/lib/scripts/typings/autocapture.d.ts +2 -0
- package/lib/scripts/typings/autocapture.d.ts.map +1 -0
- package/lib/scripts/version.d.ts +2 -0
- package/lib/scripts/version.d.ts.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))((function(o,i){function l(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}u((r=r.apply(e,t||[])).next())}))}function r(e,t){var n,r,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)l.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return l}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var a,u,c="[Amplitude] Element Tag",d="[Amplitude] Element Text",s="[Amplitude] Element Selector",f="[Amplitude] Page URL",v="https://app.amplitude.com",p={US:v,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},h="amp-visual-tagging-selector-highlight";function g(e,n){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};a=t(t({},r),n),u=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(a.root,r);var o=m(e,"all",(function(){return m(e,"two",(function(){return m(e,"one",(function(){return m(e,"none")}))}))}));if(o){var i=k(C(o,e));return i.length>0&&(o=i[0]),w(o)}throw new Error("Selector was not found.")}function m(e,t,n){for(var r=null,u=[],c=e,d=0,s=function(){var e,s,f=T(function(e){var t=e.getAttribute("id");if(t&&a.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(c))||T.apply(void 0,l([],i(function(e){var t=Array.from(e.attributes).filter((function(e){return a.attr(e.name,e.value)}));return t.map((function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}}))}(c)),!1))||T.apply(void 0,l([],i(function(e){var t=Array.from(e.classList).filter(a.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(c)),!1))||T(function(e){var t=e.tagName.toLowerCase();if(a.tagName(t))return{name:t,penalty:2};return null}(c))||[{name:"*",penalty:3}],v=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(c);if("all"==t)v&&(f=f.concat(f.filter(A).map((function(e){return S(e,v)}))));else if("two"==t)f=f.slice(0,1),v&&(f=f.concat(f.filter(A).map((function(e){return S(e,v)}))));else if("one"==t){var p=i(f=f.slice(0,1),1)[0];v&&A(p)&&(f=[S(p,v)])}else"none"==t&&(f=[{name:"*",penalty:3}],v&&(f=[S(f[0],v)]));try{for(var h=(e=void 0,o(f)),g=h.next();!g.done;g=h.next()){(p=g.value).level=d}}catch(t){e={error:t}}finally{try{g&&!g.done&&(s=h.return)&&s.call(h)}finally{if(e)throw e.error}}if(u.push(f),u.length>=a.seedMinLength&&(r=y(u,n)))return"break";c=c.parentElement,d++};c;){if("break"===s())break}return r||(r=y(u,n)),!r&&n?n():r}function y(e,t){var n,r,i=k(L(e));if(i.length>a.threshold)return t?t():null;try{for(var l=o(i),u=l.next();!u.done;u=l.next()){var c=u.value;if(E(c))return c}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return null}function w(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var o=e[r].level||0;n=t.level===o-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function b(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function E(e){var t=w(e);switch(u.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function S(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function A(e){return"html"!==e.name&&!e.name.startsWith("#")}function T(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(N);return n.length>0?n:null}function N(e){return null!=e}function L(e,t){var n,i,l,a,u,c;return void 0===t&&(t=[]),r(this,(function(r){switch(r.label){case 0:if(!(e.length>0))return[3,9];r.label=1;case 1:r.trys.push([1,6,7,8]),n=o(e[0]),i=n.next(),r.label=2;case 2:return i.done?[3,5]:(l=i.value,[5,o(L(e.slice(1,e.length),t.concat(l)))]);case 3:r.sent(),r.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return a=r.sent(),u={error:a},[3,8];case 7:try{i&&!i.done&&(c=n.return)&&c.call(n)}finally{if(u)throw u.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:r.sent(),r.label=11;case 11:return[2]}}))}function k(e){return l([],i(e),!1).sort((function(e,t){return b(e)-b(t)}))}function C(e,t,n){var c,d,s;return void 0===n&&(n={counter:0,visited:new Map}),r(this,(function(r){switch(r.label){case 0:if(!(e.length>2&&e.length>a.optimizedMinLength))return[3,5];c=1,r.label=1;case 1:return c<e.length-1?n.counter>a.maxNumberOfTries?[2]:(n.counter+=1,(d=l([],i(e),!1)).splice(c,1),s=w(d),n.visited.has(s)?[2]:E(d)&&function(e,t){return u.querySelector(w(e))===t}(d,t)?[4,d]:[3,4]):[3,5];case 2:return r.sent(),n.visited.set(s,!0),[5,o(C(d,t,n))];case 3:r.sent(),r.label=4;case 4:return c++,[3,1];case 5:return[2]}}))}var x=["input","select","textarea"],O=function(e){if(null==e)return!1;if("string"==typeof e){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0},M=function(e){var t="";return function(e){var t,n,r=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t);return!x.includes(r)}(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach((function(e){var n,r="";(n=e)&&3===n.nodeType?e.textContent&&(r=e.textContent):r=M(e),t+=r.split(/(\s+)/).filter(O).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),t},P=function(e,t){var n,r,o="";try{return o=g(e,{className:function(e){return e!==h}})}catch(e){if(t){var i=e;t.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(i.toString()))}}var l=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(l&&(o=l),e.id)o="#".concat(e.id);else if(e.className){var a=e.className.split(" ").filter((function(e){return e!==h})).join(".");a&&(o="".concat(o,".").concat(a))}return o},j=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},_=function(e){var t=e.parentElement;if(!t)return"";var n=t.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return O(r)?r:""}return _(t)},q=function(e,t){if(e&&"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var n=t.reduce((function(t,n){n&&Array.from(e.querySelectorAll(n)).forEach((function(e){t.add(e)}));return t}),new Set);return Array.from(n)}return[]},D=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:D(null==e?void 0:e.parentElement,t):null},U=function(e,t){var n,r,o;if(!e)return{};var i=null===(o=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===o?void 0:o.call(r),l=P(e,t),a=((n={})[c]=i,n[d]=M(e),n[s]=l,n[f]=window.location.href.split("?")[0],n);return j(a)},R=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?v:t,r=this;this.endpoint=v,this.onSelect=function(e){r.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?r.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&r.notify({action:"track-selector-moved",data:t})},this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,o;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(o=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===o||o.call(r,e,this.endpoint)},e.prototype.setup=function(e){var t=this,n=void 0===e?{}:e,r=n.logger,o=n.endpoint,i=n.isElementSelectable;this.logger=r,o&&this.endpoint===v&&(this.endpoint=o);var l=null;window.addEventListener("message",(function(e){var n,r,o;if(null===(r=null===(n=t.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var a,u=null==e?void 0:e.data,c=null==u?void 0:u.action;if(c)if("ping"===c)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===c){var d=null==u?void 0:u.data;(a="https://cdn.amplitude.com/libs/visual-tagging-selector-0.2.2.js.gz",new Promise((function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=a,r.addEventListener("load",(function(){e({status:!0})}),{once:!0}),r.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(a)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(e){t(e)}}))).then((function(){var e;l=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:U,isElementSelectable:function(e){return!i||i((null==d?void 0:d.actionType)||"click",e)},onSelect:t.onSelect,onTrack:t.onTrack,visualHighlightClass:h}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===c&&(null===(o=null==l?void 0:l.close)||void 0===o||o.call(l))}})),this.notify({action:"page-loaded"})},e}(),F=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],W="data-amp-track-",z=function(e){void 0===e&&(e={});var o,i=e.cssSelectorAllowlist,l=void 0===i?F:i,a=e.pageUrlAllowlist,u=e.shouldTrackEventResolver,v=e.dataAttributePrefix,h=void 0===v?W:v,g=e.visualTaggingOptions,m=void 0===g?{enabled:!0,messenger:new R}:g,y="@amplitude/plugin-autocapture-browser",w=[],b=void 0,E=function(e,t,n){e.addEventListener(t,n),w.push({element:e,type:t,handler:n})},S=function(e,t){var n,r,o;if(!t)return!1;var i=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(!i)return!1;if(u)return u(e,t);if(!function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))}(window.location.href,a))return!1;var c=(null==t?void 0:t.type)||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}if(l){var d=l.some((function(e){var n;return!!(null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e))}));if(!d)return!1}switch(i){case"input":case"select":case"textarea":return"change"===e||"click"===e;default:var s=null===(o=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===o?void 0:o.call(window,t);return!(!s||"pointer"!==s.getPropertyValue("cursor")||"click"!==e)||"click"===e}},A=function(e,t){var n,r,o,i=null===(o=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===o?void 0:o.call(r),l="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},a=t.getAttribute("aria-label"),u=function(e,t){return e.getAttributeNames().reduce((function(n,r){if(r.startsWith(t)){var o=r.replace(t,""),i=e.getAttribute(r);o&&(n[o]=i||"")}return n}),{})}(t,h),v=_(t),p=P(t,b),g=((n={})["[Amplitude] Element ID"]=t.id,n["[Amplitude] Element Class"]=t.className,n[c]=i,n[d]=M(t),n["[Amplitude] Element Position Left"]=null==l.left?null:Math.round(l.left),n["[Amplitude] Element Position Top"]=null==l.top?null:Math.round(l.top),n["[Amplitude] Element Aria Label"]=a,n["[Amplitude] Element Attributes"]=u,n[s]=p,n["[Amplitude] Element Parent Label"]=v,n[f]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===i&&"click"===e&&t instanceof HTMLAnchorElement&&(g["[Amplitude] Element Href"]=t.href),j(g)};return{name:y,type:"enrichment",setup:function(e,i){return n(void 0,void 0,void 0,(function(){var n,a,u,c,d;return r(this,(function(r){return i?(b=e.loggerProvider,"undefined"==typeof document||(n=function(e){S("click",e)&&E(e,"click",(function(t){(null==t?void 0:t.target)!=(null==t?void 0:t.currentTarget)&&D(null==t?void 0:t.target,l)!=(null==t?void 0:t.currentTarget)||null==i||i.track("[Amplitude] Element Clicked",A("click",e))})),S("change",e)&&E(e,"change",(function(t){(null==t?void 0:t.target)!=(null==t?void 0:t.currentTarget)&&D(null==t?void 0:t.target,l)!=(null==t?void 0:t.currentTarget)||null==i||i.track("[Amplitude] Element Changed",A("change",e))}))},"undefined"!=typeof MutationObserver&&(o=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){n(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&q(e,l).map(n)}))}))}))),a=function(){q(document.body,l).forEach(n),null==o||o.observe(document.body,{subtree:!0,childList:!0})},document.body?a():window.addEventListener("load",a),null===(c=null==e?void 0:e.loggerProvider)||void 0===c||c.log("".concat(y," has been successfully added.")),window.opener&&m.enabled&&(null===(d=m.messenger)||void 0===d||d.setup(t(t({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:p[e.serverZone]}),{isElementSelectable:S})))),[2]):(null===(u=null==e?void 0:e.loggerProvider)||void 0===u||u.warn("".concat(y," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])}))}))},execute:function(e){return n(void 0,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))},teardown:function(){return n(void 0,void 0,void 0,(function(){return r(this,(function(e){return o&&o.disconnect(),w.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),w=[],[2]}))}))}}};e.DEFAULT_CSS_SELECTOR_ALLOWLIST=F,e.DEFAULT_DATA_ATTRIBUTE_PREFIX=W,e.WindowMessenger=R,e.autocapturePlugin=z,e.plugin=z,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BrowserClient, BrowserConfig, EnrichmentPlugin } from '@amplitude/analytics-types';
|
|
2
|
+
import { Messenger } from './libs/messenger';
|
|
3
|
+
import { ActionType } from './typings/autocapture';
|
|
4
|
+
type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
5
|
+
export declare const DEFAULT_CSS_SELECTOR_ALLOWLIST: string[];
|
|
6
|
+
export declare const DEFAULT_DATA_ATTRIBUTE_PREFIX = "data-amp-track-";
|
|
7
|
+
interface Options {
|
|
8
|
+
/**
|
|
9
|
+
* List of CSS selectors to allow auto tracking on.
|
|
10
|
+
* When provided, allow elements matching any selector to be tracked.
|
|
11
|
+
* Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].
|
|
12
|
+
*/
|
|
13
|
+
cssSelectorAllowlist?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* List of page URLs to allow auto tracking on.
|
|
16
|
+
* When provided, only allow tracking on these URLs.
|
|
17
|
+
* Both full URLs and regex are supported.
|
|
18
|
+
*/
|
|
19
|
+
pageUrlAllowlist?: (string | RegExp)[];
|
|
20
|
+
/**
|
|
21
|
+
* Function to determine whether an event should be tracked.
|
|
22
|
+
* When provided, this function overwrites all other allowlists and configurations.
|
|
23
|
+
* If the function returns true, the event will be tracked.
|
|
24
|
+
* If the function returns false, the event will not be tracked.
|
|
25
|
+
* @param actionType - The type of action that triggered the event.
|
|
26
|
+
* @param element - The element that triggered the event.
|
|
27
|
+
*/
|
|
28
|
+
shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Prefix for data attributes to allow auto collecting.
|
|
31
|
+
* Default is 'data-amp-track-'.
|
|
32
|
+
*/
|
|
33
|
+
dataAttributePrefix?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Options for integrating visual tagging selector.
|
|
36
|
+
*/
|
|
37
|
+
visualTaggingOptions?: {
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
messenger?: Messenger;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export declare const autocapturePlugin: (options?: Options) => BrowserEnrichmentPlugin;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=autocapture-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocapture-plugin.d.ts","sourceRoot":"","sources":["../../src/autocapture-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAU,MAAM,4BAA4B,CAAC;AAYpG,OAAO,EAAE,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,eAAO,MAAM,8BAA8B,UAS1C,CAAC;AACF,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAQ/D,UAAU,OAAO;IACf;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAEjF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,aAAa,OAAO,KAAQ,uBAyOzD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const PLUGIN_NAME = "@amplitude/plugin-autocapture-browser";
|
|
2
|
+
export declare const AMPLITUDE_ELEMENT_CLICKED_EVENT = "[Amplitude] Element Clicked";
|
|
3
|
+
export declare const AMPLITUDE_ELEMENT_CHANGED_EVENT = "[Amplitude] Element Changed";
|
|
4
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_ID = "[Amplitude] Element ID";
|
|
5
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_CLASS = "[Amplitude] Element Class";
|
|
6
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_TAG = "[Amplitude] Element Tag";
|
|
7
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_TEXT = "[Amplitude] Element Text";
|
|
8
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_HREF = "[Amplitude] Element Href";
|
|
9
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_LEFT = "[Amplitude] Element Position Left";
|
|
10
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_TOP = "[Amplitude] Element Position Top";
|
|
11
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_ARIA_LABEL = "[Amplitude] Element Aria Label";
|
|
12
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_ATTRIBUTES = "[Amplitude] Element Attributes";
|
|
13
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_SELECTOR = "[Amplitude] Element Selector";
|
|
14
|
+
export declare const AMPLITUDE_EVENT_PROP_ELEMENT_PARENT_LABEL = "[Amplitude] Element Parent Label";
|
|
15
|
+
export declare const AMPLITUDE_EVENT_PROP_PAGE_URL = "[Amplitude] Page URL";
|
|
16
|
+
export declare const AMPLITUDE_EVENT_PROP_PAGE_TITLE = "[Amplitude] Page Title";
|
|
17
|
+
export declare const AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT = "[Amplitude] Viewport Height";
|
|
18
|
+
export declare const AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH = "[Amplitude] Viewport Width";
|
|
19
|
+
export declare const AMPLITUDE_ORIGIN = "https://app.amplitude.com";
|
|
20
|
+
export declare const AMPLITUDE_ORIGIN_EU = "https://app.eu.amplitude.com";
|
|
21
|
+
export declare const AMPLITUDE_ORIGIN_STAGING = "https://apps.stag2.amplitude.com";
|
|
22
|
+
export declare const AMPLITUDE_ORIGINS_MAP: {
|
|
23
|
+
US: string;
|
|
24
|
+
EU: string;
|
|
25
|
+
STAGING: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const AMPLITUDE_VISUAL_TAGGING_SELECTOR_SCRIPT_URL = "https://cdn.amplitude.com/libs/visual-tagging-selector-0.2.2.js.gz";
|
|
28
|
+
export declare const AMPLITUDE_VISUAL_TAGGING_HIGHLIGHT_CLASS = "amp-visual-tagging-selector-highlight";
|
|
29
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,0CAA0C,CAAC;AAEnE,eAAO,MAAM,+BAA+B,gCAAgC,CAAC;AAC7E,eAAO,MAAM,+BAA+B,gCAAgC,CAAC;AAE7E,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,eAAO,MAAM,gCAAgC,4BAA4B,CAAC;AAC1E,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,0CAA0C,sCAAsC,CAAC;AAC9F,eAAO,MAAM,yCAAyC,qCAAqC,CAAC;AAC5F,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AACpF,eAAO,MAAM,yCAAyC,qCAAqC,CAAC;AAC5F,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AACpE,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,oCAAoC,gCAAgC,CAAC;AAClF,eAAO,MAAM,mCAAmC,+BAA+B,CAAC;AAGhF,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,qBAAqB;;;;CAIjC,CAAC;AAEF,eAAO,MAAM,4CAA4C,uEACa,CAAC;AAGvE,eAAO,MAAM,wCAAwC,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Logger } from '@amplitude/analytics-types';
|
|
2
|
+
export declare const isNonSensitiveString: (text: string | null) => boolean;
|
|
3
|
+
export declare const isTextNode: (node: Node) => boolean;
|
|
4
|
+
export declare const isNonSensitiveElement: (element: Element) => boolean;
|
|
5
|
+
export declare const getText: (element: Element) => string;
|
|
6
|
+
export declare const getSelector: (element: Element, logger?: Logger) => string;
|
|
7
|
+
export declare const isPageUrlAllowed: (url: string, pageUrlAllowlist: (string | RegExp)[] | undefined) => boolean;
|
|
8
|
+
export declare const getAttributesWithPrefix: (element: Element, prefix: string) => {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const isEmpty: (value: unknown) => boolean;
|
|
12
|
+
export declare const removeEmptyProperties: (properties: {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}) => {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
export declare const getNearestLabel: (element: Element) => string;
|
|
18
|
+
export declare const querySelectUniqueElements: (root: Element | Document, selectors: string[]) => Element[];
|
|
19
|
+
export declare const getClosestElement: (element: Element | null, selectors: string[]) => Element | null;
|
|
20
|
+
export declare const getEventTagProps: (element: Element, logger?: Logger) => {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
export declare const asyncLoadScript: (url: string) => Promise<unknown>;
|
|
24
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIpD,eAAO,MAAM,oBAAoB,SAAU,MAAM,GAAG,IAAI,YAgBvD,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,YAEpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,YAAa,OAAO,YAIrD,CAAC;AAGF,eAAO,MAAM,OAAO,YAAa,OAAO,KAAG,MAsB1C,CAAC;AAEF,eAAO,MAAM,WAAW,YAAa,OAAO,WAAW,MAAM,KAAG,MA+B/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,MAAM,oBAAoB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,YAU9F,CAAC;AAEF,eAAO,MAAM,uBAAuB,YAAa,OAAO,UAAU,MAAM;;CAWvE,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,OAAO,YAOrC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;CAQjC,CAAC;AAEF,eAAO,MAAM,eAAe,YAAa,OAAO,KAAG,MAYlD,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,OAAO,GAAG,QAAQ,aAAa,MAAM,EAAE,KAAG,OAAO,EAchG,CAAC;AAGF,eAAO,MAAM,iBAAiB,YAAa,OAAO,GAAG,IAAI,aAAa,MAAM,EAAE,KAAG,OAAO,GAAG,IAU1F,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAa,OAAO,WAAW,MAAM;;CAcjE,CAAC;AAEF,eAAO,MAAM,eAAe,QAAS,MAAM,qBA2B1C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { autocapturePlugin as plugin, autocapturePlugin, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './autocapture-plugin';
|
|
2
|
+
export { Messenger, Action, ActionData, Message, WindowMessenger } from './libs/messenger';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
root: Element;
|
|
3
|
+
idName: (name: string) => boolean;
|
|
4
|
+
className: (name: string) => boolean;
|
|
5
|
+
tagName: (name: string) => boolean;
|
|
6
|
+
attr: (name: string, value: string) => boolean;
|
|
7
|
+
seedMinLength: number;
|
|
8
|
+
optimizedMinLength: number;
|
|
9
|
+
threshold: number;
|
|
10
|
+
maxNumberOfTries: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function finder(input: Element, options?: Partial<Options>): string;
|
|
13
|
+
//# sourceMappingURL=finder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finder.d.ts","sourceRoot":"","sources":["../../../src/libs/finder.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAKF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,UAmChE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Logger } from '@amplitude/analytics-types';
|
|
2
|
+
import { ActionType } from '../typings/autocapture';
|
|
3
|
+
export interface Messenger {
|
|
4
|
+
logger?: Logger;
|
|
5
|
+
setup: () => void;
|
|
6
|
+
}
|
|
7
|
+
export type Action = 'ping' | 'pong' | 'page-loaded' | 'selector-loaded' | 'initialize-visual-tagging-selector' | 'close-visual-tagging-selector' | 'element-selected' | 'track-selector-mode-changed' | 'track-selector-moved';
|
|
8
|
+
interface InitializeVisualTaggingSelectorData {
|
|
9
|
+
actionType: ActionType;
|
|
10
|
+
}
|
|
11
|
+
interface ElementSelectedData {
|
|
12
|
+
'[Amplitude] Element Tag'?: string;
|
|
13
|
+
'[Amplitude] Element Text'?: string;
|
|
14
|
+
'[Amplitude] Element Selector'?: string;
|
|
15
|
+
'[Amplitude] Page URL'?: string;
|
|
16
|
+
elementScreenshot?: Blob;
|
|
17
|
+
}
|
|
18
|
+
interface TrackSelectorModeChangedData {
|
|
19
|
+
newMode: string;
|
|
20
|
+
pageUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
interface TrackSelectorMovedData {
|
|
23
|
+
newEditorLocation: string;
|
|
24
|
+
pageUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ActionData = {
|
|
27
|
+
ping: null | undefined;
|
|
28
|
+
pong: null | undefined;
|
|
29
|
+
'page-loaded': null | undefined;
|
|
30
|
+
'selector-loaded': null | undefined;
|
|
31
|
+
'initialize-visual-tagging-selector': InitializeVisualTaggingSelectorData | null | undefined;
|
|
32
|
+
'close-visual-tagging-selector': null | undefined;
|
|
33
|
+
'element-selected': ElementSelectedData;
|
|
34
|
+
'track-selector-mode-changed': TrackSelectorModeChangedData;
|
|
35
|
+
'track-selector-moved': TrackSelectorMovedData;
|
|
36
|
+
};
|
|
37
|
+
export interface Message<A extends Action> {
|
|
38
|
+
action: A;
|
|
39
|
+
data?: ActionData[A];
|
|
40
|
+
}
|
|
41
|
+
export declare class WindowMessenger implements Messenger {
|
|
42
|
+
endpoint: string;
|
|
43
|
+
logger?: Logger;
|
|
44
|
+
constructor({ origin }?: {
|
|
45
|
+
origin?: string;
|
|
46
|
+
});
|
|
47
|
+
private notify;
|
|
48
|
+
setup({ logger, endpoint, isElementSelectable, }?: {
|
|
49
|
+
logger?: Logger;
|
|
50
|
+
endpoint?: string;
|
|
51
|
+
isElementSelectable?: (action: InitializeVisualTaggingSelectorData['actionType'], element: Element) => boolean;
|
|
52
|
+
}): void;
|
|
53
|
+
private onSelect;
|
|
54
|
+
private onTrack;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=messenger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messenger.d.ts","sourceRoot":"","sources":["../../../src/libs/messenger.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,MAAM,MAAM,GACd,MAAM,GACN,MAAM,GACN,aAAa,GACb,iBAAiB,GACjB,oCAAoC,GACpC,+BAA+B,GAC/B,kBAAkB,GAClB,6BAA6B,GAC7B,sBAAsB,CAAC;AAE3B,UAAU,mCAAmC;IAC3C,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,UAAU,mBAAmB;IAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,IAAI,CAAC;CAC1B;AAED,UAAU,4BAA4B;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,sBAAsB;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,aAAa,EAAE,IAAI,GAAG,SAAS,CAAC;IAChC,iBAAiB,EAAE,IAAI,GAAG,SAAS,CAAC;IACpC,oCAAoC,EAAE,mCAAmC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7F,+BAA+B,EAAE,IAAI,GAAG,SAAS,CAAC;IAClD,kBAAkB,EAAE,mBAAmB,CAAC;IACxC,6BAA6B,EAAE,4BAA4B,CAAC;IAC5D,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AAEF,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM;IACvC,MAAM,EAAE,CAAC,CAAC;IACV,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CACtB;AAED,qBAAa,eAAgB,YAAW,SAAS;IAC/C,QAAQ,SAAoB;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEJ,EAAE,MAAyB,EAAE,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO;IAInE,OAAO,CAAC,MAAM;IAKd,KAAK,CAAC,EACJ,MAAM,EACN,QAAQ,EACR,mBAAmB,GACpB,GAAE;QACD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,mCAAmC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;KAC3G;IAiDN,OAAO,CAAC,QAAQ,CAEd;IAEF,OAAO,CAAC,OAAO,CAMb;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocapture.d.ts","sourceRoot":"","sources":["../../../src/typings/autocapture.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amplitude/plugin-autocapture-browser",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "Amplitude Inc",
|
|
6
|
+
"homepage": "https://github.com/amplitude/Amplitude-TypeScript",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "lib/cjs/index.js",
|
|
9
|
+
"module": "lib/esm/index.js",
|
|
10
|
+
"types": "lib/esm/index.d.ts",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"tag": "beta"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/amplitude/Amplitude-TypeScript.git"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "yarn bundle && yarn build:es5 && yarn build:esm",
|
|
22
|
+
"bundle": "rollup --config rollup.config.js",
|
|
23
|
+
"build:es5": "tsc -p ./tsconfig.es5.json",
|
|
24
|
+
"build:esm": "tsc -p ./tsconfig.esm.json",
|
|
25
|
+
"clean": "rimraf node_modules lib coverage",
|
|
26
|
+
"fix": "yarn fix:eslint & yarn fix:prettier",
|
|
27
|
+
"fix:eslint": "eslint '{src,test}/**/*.ts' --fix",
|
|
28
|
+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
|
|
29
|
+
"lint": "yarn lint:eslint & yarn lint:prettier",
|
|
30
|
+
"lint:eslint": "eslint '{src,test}/**/*.ts'",
|
|
31
|
+
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
|
|
32
|
+
"publish": "node ../../scripts/publish/upload-to-s3.js",
|
|
33
|
+
"test": "jest",
|
|
34
|
+
"typecheck": "tsc -p ./tsconfig.json",
|
|
35
|
+
"version": "yarn version-file && yarn add @amplitude/analytics-types@\">=1 <3\" @amplitude/analytics-client-common@\">=1 <3\"",
|
|
36
|
+
"version-file": "node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@amplitude/analytics-client-common": ">=1 <3",
|
|
43
|
+
"@amplitude/analytics-types": ">=1 <3",
|
|
44
|
+
"tslib": "^2.4.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@amplitude/analytics-browser": "^2.1.2",
|
|
48
|
+
"@rollup/plugin-commonjs": "^23.0.4",
|
|
49
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
50
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
51
|
+
"css.escape": "^1.5.1",
|
|
52
|
+
"rollup": "^2.79.1",
|
|
53
|
+
"rollup-plugin-execute": "^1.1.1",
|
|
54
|
+
"rollup-plugin-gzip": "^3.1.0",
|
|
55
|
+
"rollup-plugin-terser": "^7.0.2"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"lib"
|
|
59
|
+
],
|
|
60
|
+
"gitHead": "d509442c8e6d8769de7d4f6fc968f5d933413441"
|
|
61
|
+
}
|