From 62889a9f8a839a213f671ce6e745c78ee01770e4 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 5 Dec 2017 00:04:00 -0800 Subject: [PATCH 1/7] Added navigation logging --- src/renderer/js/main.js | 18 +- src/renderer/js/redux/reducers/navigation.js | 11 +- src/renderer/package.json | 1 + src/renderer/yarn.lock | 314 ++++++++++++++----- 4 files changed, 257 insertions(+), 87 deletions(-) diff --git a/src/renderer/js/main.js b/src/renderer/js/main.js index 759b2a179..cd691a62a 100644 --- a/src/renderer/js/main.js +++ b/src/renderer/js/main.js @@ -9,6 +9,8 @@ import { doDaemonReady } from "redux/actions/app"; import { doNavigate } from "redux/actions/navigation"; import { doDownloadLanguages } from "redux/actions/settings"; import * as types from "constants/action_types"; +import amplitude from "amplitude-js"; +import lbry from "lbry.js"; const env = ENV; const { remote, ipcRenderer, shell } = require("electron"); @@ -48,6 +50,9 @@ ipcRenderer.on("window-is-focused", (event, data) => { document.addEventListener("click", event => { var target = event.target; while (target && target !== document) { + if (target.matches("a") || target.matches("button")) { + // TODO: Log event + } if ( target.matches('a[href^="http"]') || target.matches('a[href^="mailto"]') @@ -92,4 +97,15 @@ var init = function() { } }; -init(); +lbry.status({ session_status: true }).then(info => { + amplitude + .getInstance() + .init( + "0b130efdcbdbf86ec2f7f9eff354033e", + null, + { deviceId: info.lbry_id }, + function() { + init(); + } + ); +}); diff --git a/src/renderer/js/redux/reducers/navigation.js b/src/renderer/js/redux/reducers/navigation.js index 00453f9de..e32658b76 100644 --- a/src/renderer/js/redux/reducers/navigation.js +++ b/src/renderer/js/redux/reducers/navigation.js @@ -1,5 +1,6 @@ import * as types from "constants/action_types"; import { parseQueryParams } from "util/query_params"; +import amplitude from "amplitude-js"; const currentPath = () => { const hash = document.location.hash; @@ -69,6 +70,14 @@ reducers[types.WINDOW_SCROLLED] = (state, action) => { export default function reducer(state = defaultState, action) { const handler = reducers[action.type]; - if (handler) return handler(state, action); + if (handler) { + let nextState = handler(state, action); + if (nextState.currentPath !== state.currentPath) { + amplitude + .getInstance() + .logEvent("NAVIGATION", { destination: nextState.currentPath }); + } + return nextState; + } return state; } diff --git a/src/renderer/package.json b/src/renderer/package.json index 4a6e9f03e..50e40f883 100644 --- a/src/renderer/package.json +++ b/src/renderer/package.json @@ -22,6 +22,7 @@ }, "homepage": "https://github.com/lbryio/lbry-app", "dependencies": { + "amplitude-js": "^4.0.0", "from2": "^2.3.0", "jshashes": "^1.0.7", "localforage": "^1.5.0", diff --git a/src/renderer/yarn.lock b/src/renderer/yarn.lock index d7049810b..6faa612e4 100644 --- a/src/renderer/yarn.lock +++ b/src/renderer/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@segment/top-domain@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@segment/top-domain/-/top-domain-3.0.0.tgz#02e5a5a4fd42a9f6cf886b05e82f104012a3c3a7" + dependencies: + component-cookie "^1.1.2" + component-url "^0.2.1" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -56,9 +63,9 @@ ajv@^4.7.0, ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0, ajv@^5.1.5, ajv@^5.2.3: - version "5.4.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.4.0.tgz#32d1cf08dbc80c432f426f12e10b2511f6b46474" +ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.3: + version "5.5.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.0.tgz#eb2840746e9dc48bd5e063a36e3fd400c5eab5a9" dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -81,6 +88,16 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +amplitude-js@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/amplitude-js/-/amplitude-js-4.0.0.tgz#70bbc0ec893b01d00453d3765f78bc0f32a395cc" + dependencies: + "@segment/top-domain" "^3.0.0" + blueimp-md5 "^2.10.0" + json3 "^3.3.2" + lodash "^4.17.4" + ua-parser-js "github:amplitude/ua-parser-js#ed538f1" + ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -276,7 +293,11 @@ aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" -aws4@^1.2.1: +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" @@ -997,6 +1018,10 @@ block-stream@*: dependencies: inherits "~2.0.0" +blueimp-md5@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.10.0.tgz#02f0843921f90dca14f5b8920a38593201d6964d" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -1033,6 +1058,18 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" @@ -1198,8 +1235,8 @@ caniuse-api@^1.5.2: lodash.uniq "^4.5.0" caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: - version "1.0.30000769" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000769.tgz#c230b9c1b9e8db3e1c0d858c96e685741b96cc10" + version "1.0.30000777" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000777.tgz#2e19adba63bdd7c501df637a862adead7f4bc054" cardinal@^1.0.0: version "1.0.0" @@ -1376,8 +1413,8 @@ codemirror-spell-checker@*: typo-js "*" codemirror@*: - version "5.31.0" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.31.0.tgz#ecf3d057eb74174147066bfc7c5f37b4c4e07df2" + version "5.32.0" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.32.0.tgz#cb6ff5d8ef36d0b10f031130e2d9ebeee92c902e" color-convert@^1.3.0, color-convert@^1.9.0: version "1.9.1" @@ -1426,8 +1463,8 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: delayed-stream "~1.0.0" commander@^2.11.0, commander@^2.5.0, commander@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + version "2.12.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" commondir@^1.0.1: version "1.0.1" @@ -1464,6 +1501,16 @@ commonmark@^0.24.0: mdurl "~ 1.0.1" string.prototype.repeat "^0.2.0" +component-cookie@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/component-cookie/-/component-cookie-1.1.3.tgz#053e14a3bd7748154f55724fd39a60c01994ebed" + dependencies: + debug "*" + +component-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/component-url/-/component-url-0.2.1.tgz#4e4f4799c43ead9fd3ce91b5a305d220208fee47" + compressible@~2.0.11: version "2.0.12" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.12.tgz#c59a5c99db76767e9876500e271ef63b3493bd66" @@ -1525,8 +1572,8 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" convert-source-map@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" cookie-signature@1.0.6: version "1.0.6" @@ -1613,6 +1660,12 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + crypto-browserify@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.3.0.tgz#b9fc75bb4a0ed61dcf1cd5dae96eb30c9c3e506c" @@ -1747,15 +1800,15 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.5.1, debug@^2.6.3, debug@^2.6.6, debug@^2.6.8: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" +debug@*, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" -debug@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" +debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.5.1, debug@^2.6.3, debug@^2.6.6, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" @@ -1849,18 +1902,18 @@ detect-indent@^4.0.0: repeating "^2.0.0" detect-libc@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.2.tgz#71ad5d204bf17a6a6ca8f450c61454066ef461e1" + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" detect-node@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" detective@^4.3.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" + version "4.7.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.0.tgz#6276e150f9e50829ad1f90ace4d9a2304188afcf" dependencies: - acorn "^4.0.3" + acorn "^5.2.1" defined "^1.0.0" diffie-hellman@^5.0.0: @@ -1896,11 +1949,10 @@ doctrine@1.5.0, doctrine@^1.2.2: isarray "^1.0.0" doctrine@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" + version "2.0.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" dependencies: esutils "^2.0.2" - isarray "^1.0.0" domain-browser@^1.1.1: version "1.1.7" @@ -2015,8 +2067,8 @@ error-ex@^1.2.0: is-arrayish "^0.2.1" es-abstract@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227" + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -2041,8 +2093,8 @@ es3ify@^0.1.3: through "~2.3.4" es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.35" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.35.tgz#18ee858ce6a3c45c7d79e91c15fcca9ec568494f" + version "0.10.37" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.37.tgz#0ee741d148b80069ba27d020393756af257defc3" dependencies: es6-iterator "~2.0.1" es6-symbol "~3.1.1" @@ -2340,7 +2392,7 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -express@^4.13.3: +express@^4.16.2: version "4.16.2" resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" dependencies: @@ -2375,7 +2427,7 @@ express@^4.13.3: utils-merge "1.0.1" vary "~1.1.2" -extend@~3.0.0: +extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -2593,6 +2645,14 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" @@ -2847,6 +2907,10 @@ har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -2863,6 +2927,13 @@ har-validator@~4.2.1: ajv "^4.9.1" har-schema "^1.0.5" +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -2926,6 +2997,15 @@ hawk@3.1.3, hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2938,6 +3018,10 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + hoist-non-react-statics@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0" @@ -3011,6 +3095,14 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + https-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" @@ -3151,8 +3243,8 @@ interpret@^0.6.4: resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" interpret@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0" + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" invariant@^2.0.0, invariant@^2.2.2: version "2.2.2" @@ -3300,8 +3392,8 @@ is-path-in-cwd@^1.0.0: is-path-inside "^1.0.0" is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" dependencies: path-is-inside "^1.0.1" @@ -3404,8 +3496,8 @@ isurl@^1.0.0-alpha5: is-object "^1.0.1" js-base64@^2.1.8, js-base64@^2.1.9: - version "2.3.2" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf" + version "2.4.0" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.0.tgz#9e566fee624751a1d720c966cd6226d29d4025aa" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -3673,8 +3765,8 @@ loader-utils@^1.0.2, loader-utils@^1.1.0: json5 "^0.5.0" localforage@^1.5.0: - version "1.5.3" - resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.5.3.tgz#698aa16af1022340b240be9d93192e8af022ff16" + version "1.5.5" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.5.5.tgz#55fc1c3a88a47f67f5fac6f1231b25ff13556423" dependencies: lie "3.0.2" @@ -4027,10 +4119,14 @@ mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, dependencies: mime-db "~1.30.0" -mime@1.4.1, mime@^1.2.11, mime@^1.3.4: +mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" +mime@^1.2.11, mime@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" @@ -4091,8 +4187,8 @@ multicast-dns-service-types@^1.1.0: resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" multicast-dns@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.0.tgz#13f22d0c32dc5ee82a32878e3c380d875b3eab22" + version "6.2.1" + resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.1.tgz#c5035defa9219d30640558a49298067352098060" dependencies: dns-packet "^1.0.1" thunky "^0.1.0" @@ -4363,7 +4459,7 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1: +oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -4660,6 +4756,10 @@ performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -4825,8 +4925,8 @@ postcss-minify-selectors@^2.0.4: postcss-selector-parser "^2.0.0" postcss-modules-extract-imports@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz#b614c9720be6816eaee35fb3a5faa1dba6a05ddb" + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz#66140ecece38ef06bf0d3e355d69bf59d141ea85" dependencies: postcss "^6.0.1" @@ -5047,7 +5147,7 @@ q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" -qs@6.5.1: +qs@6.5.1, qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" @@ -5123,8 +5223,8 @@ raw-body@2.3.2: unpipe "1.0.0" rc-progress@^2.0.6: - version "2.2.4" - resolved "https://registry.yarnpkg.com/rc-progress/-/rc-progress-2.2.4.tgz#45dbdb91cdd71cb5ce22e61313a351ceb5b1488a" + version "2.2.5" + resolved "https://registry.yarnpkg.com/rc-progress/-/rc-progress-2.2.5.tgz#e61d0544bf9d4208e5ba32fc50962159e7f952a3" dependencies: babel-runtime "6.x" prop-types "^15.5.8" @@ -5164,11 +5264,12 @@ react-markdown@^2.5.0: prop-types "^15.5.1" react-modal@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.1.5.tgz#9cfdb7634b5003148ffb7c8ead13a36f671d744e" + version "3.1.6" + resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.1.6.tgz#82e63f1ec86b80e242518250d066ee37fa035f8a" dependencies: exenv "^1.2.0" prop-types "^15.5.10" + warning "^3.0.0" react-paginate@^5.0.0: version "5.0.0" @@ -5460,32 +5561,34 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2, request@~2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" +request@2, request@^2.81.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" combined-stream "~1.0.5" - extend "~3.0.0" + extend "~3.0.1" forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" -request@2.81.0, request@^2.81.0: +request@2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -5512,6 +5615,31 @@ request@2.81.0, request@^2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" +request@~2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5790,6 +5918,12 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + sockjs-client@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.4.tgz#5babe386b775e4cf14e7520911452654016c8b12" @@ -5991,7 +6125,7 @@ string_decoder@^1.0.0, string_decoder@~1.0.3: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4: +stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -6067,8 +6201,8 @@ svgo@^0.7.0: whet.extend "~0.9.9" symbol-observable@^1.0.1, symbol-observable@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + version "1.1.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.1.0.tgz#5c68fd8d54115d9dfb72a84720549222e8db9b32" table@^3.7.8: version "3.8.3" @@ -6162,7 +6296,7 @@ to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -tough-cookie@~2.3.0: +tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: @@ -6233,6 +6367,10 @@ ua-parser-js@^0.7.9: version "0.7.17" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" +"ua-parser-js@github:amplitude/ua-parser-js#ed538f1": + version "0.7.10" + resolved "https://codeload.github.com/amplitude/ua-parser-js/tar.gz/ed538f1" + uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" @@ -6371,7 +6509,7 @@ uuid@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" @@ -6423,6 +6561,12 @@ vm-browserify@0.0.4: dependencies: indexof "0.0.1" +warning@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" + dependencies: + loose-envify "^1.0.0" + watchpack@^0.2.1: version "0.2.9" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-0.2.9.tgz#62eaa4ab5e5ba35fdfc018275626e3c0f5e3fb0b" @@ -6453,18 +6597,18 @@ webpack-core@~0.6.9: source-map "~0.4.1" webpack-dev-middleware@^1.11.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.0.tgz#d34efefb2edda7e1d3b5dbe07289513219651709" + version "1.12.2" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz#f8fc1120ce3b4fc5680ceecb43d777966b21105e" dependencies: memory-fs "~0.4.1" - mime "^1.3.4" + mime "^1.5.0" path-is-absolute "^1.0.0" range-parser "^1.0.3" time-stamp "^2.0.0" webpack-dev-server@^2.4.4: - version "2.9.4" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz#7883e61759c6a4b33e9b19ec4037bd4ab61428d1" + version "2.9.5" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.9.5.tgz#79336fba0087a66ae491f4869f6545775b18daa8" dependencies: ansi-html "0.0.7" array-includes "^3.0.3" @@ -6474,7 +6618,7 @@ webpack-dev-server@^2.4.4: connect-history-api-fallback "^1.3.0" debug "^3.1.0" del "^3.0.0" - express "^4.13.3" + express "^4.16.2" html-entities "^1.2.0" http-proxy-middleware "~0.17.4" import-local "^0.1.1" @@ -6509,8 +6653,8 @@ webpack-notifier@^1.5.0: strip-ansi "^3.0.1" webpack-sources@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.2.tgz#d0148ec083b3b5ccef1035a6b3ec16442983b27a" + version "1.1.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" dependencies: source-list-map "^2.0.0" source-map "~0.6.1" @@ -6542,8 +6686,8 @@ webpack@^1.12.0: webpack-core "~0.6.9" webpack@^3.0.0: - version "3.8.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.8.1.tgz#b16968a81100abe61608b0153c9159ef8bb2bd83" + version "3.9.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.9.1.tgz#9a60aa544ed5d4d454c069e3f521aa007e02643c" dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" -- 2.45.2 From 080dd1c05d341661800a552d18b93ffa12f088c6 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 5 Dec 2017 00:31:34 -0800 Subject: [PATCH 2/7] Fixed loading screen problem --- src/renderer/js/main.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/renderer/js/main.js b/src/renderer/js/main.js index cd691a62a..ba4eb4c77 100644 --- a/src/renderer/js/main.js +++ b/src/renderer/js/main.js @@ -10,7 +10,6 @@ import { doNavigate } from "redux/actions/navigation"; import { doDownloadLanguages } from "redux/actions/settings"; import * as types from "constants/action_types"; import amplitude from "amplitude-js"; -import lbry from "lbry.js"; const env = ENV; const { remote, ipcRenderer, shell } = require("electron"); @@ -97,15 +96,8 @@ var init = function() { } }; -lbry.status({ session_status: true }).then(info => { - amplitude - .getInstance() - .init( - "0b130efdcbdbf86ec2f7f9eff354033e", - null, - { deviceId: info.lbry_id }, - function() { - init(); - } - ); -}); +amplitude + .getInstance() + .init("0b130efdcbdbf86ec2f7f9eff354033e", null, null, function() { + init(); + }); -- 2.45.2 From 1479b9e4af8878b051c382246d5c07db69088b31 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 5 Dec 2017 13:05:59 -0800 Subject: [PATCH 3/7] Added user ID logging --- src/renderer/js/main.js | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/renderer/js/main.js b/src/renderer/js/main.js index ba4eb4c77..d6f02341a 100644 --- a/src/renderer/js/main.js +++ b/src/renderer/js/main.js @@ -10,6 +10,7 @@ import { doNavigate } from "redux/actions/navigation"; import { doDownloadLanguages } from "redux/actions/settings"; import * as types from "constants/action_types"; import amplitude from "amplitude-js"; +import lbry from "lbry"; const env = ENV; const { remote, ipcRenderer, shell } = require("electron"); @@ -70,18 +71,29 @@ var init = function() { app.store.dispatch(doDownloadLanguages()); function onDaemonReady() { - window.sessionStorage.setItem("loaded", "y"); //once we've made it here once per session, we don't need to show splash again - app.store.dispatch(doDaemonReady()); + lbry.status().then(info => { + amplitude + .getInstance() + .init( + "0b130efdcbdbf86ec2f7f9eff354033e", + info.lbry_id, + null, + function() { + window.sessionStorage.setItem("loaded", "y"); //once we've made it here once per session, we don't need to show splash again + app.store.dispatch(doDaemonReady()); - ReactDOM.render( - -
- - -
-
, - canvas - ); + ReactDOM.render( + +
+ + +
+
, + canvas + ); + } + ); + }); } if (window.sessionStorage.getItem("loaded") == "y") { @@ -96,8 +108,4 @@ var init = function() { } }; -amplitude - .getInstance() - .init("0b130efdcbdbf86ec2f7f9eff354033e", null, null, function() { - init(); - }); +init(); -- 2.45.2 From f80a13e8eae20dbc84560a74f476525bff79e74d Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 5 Dec 2017 16:16:54 -0800 Subject: [PATCH 4/7] Log all clicks --- src/renderer/js/main.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/renderer/js/main.js b/src/renderer/js/main.js index d6f02341a..4bfd824e9 100644 --- a/src/renderer/js/main.js +++ b/src/renderer/js/main.js @@ -51,7 +51,25 @@ document.addEventListener("click", event => { var target = event.target; while (target && target !== document) { if (target.matches("a") || target.matches("button")) { - // TODO: Log event + // TODO: Look into using accessiblity labels (this would also make the app more accessible) + let hrefParts = window.location.href.split("#"); + let element = target.title || target.text.trim(); + if (element) { + amplitude + .getInstance() + .logEvent("CLICK", { + target: element, + location: + hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", + }); + } else { + amplitude + .getInstance() + .logEvent("UNMARKED_CLICK", { + location: + hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", + }); + } } if ( target.matches('a[href^="http"]') || -- 2.45.2 From 920a54c810e49f0b98e109d807537f1054be6ef0 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 5 Dec 2017 17:16:06 -0800 Subject: [PATCH 5/7] Added comment to indicate API key --- src/renderer/js/main.js | 61 +++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/src/renderer/js/main.js b/src/renderer/js/main.js index 4bfd824e9..9c63a17f0 100644 --- a/src/renderer/js/main.js +++ b/src/renderer/js/main.js @@ -55,20 +55,16 @@ document.addEventListener("click", event => { let hrefParts = window.location.href.split("#"); let element = target.title || target.text.trim(); if (element) { - amplitude - .getInstance() - .logEvent("CLICK", { - target: element, - location: - hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", - }); + amplitude.getInstance().logEvent("CLICK", { + target: element, + location: + hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", + }); } else { - amplitude - .getInstance() - .logEvent("UNMARKED_CLICK", { - location: - hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", - }); + amplitude.getInstance().logEvent("UNMARKED_CLICK", { + location: + hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", + }); } } if ( @@ -90,27 +86,26 @@ var init = function() { function onDaemonReady() { lbry.status().then(info => { - amplitude - .getInstance() - .init( - "0b130efdcbdbf86ec2f7f9eff354033e", - info.lbry_id, - null, - function() { - window.sessionStorage.setItem("loaded", "y"); //once we've made it here once per session, we don't need to show splash again - app.store.dispatch(doDaemonReady()); + amplitude.getInstance().init( + // Amplitude API Key + "0b130efdcbdbf86ec2f7f9eff354033e", + info.lbry_id, + null, + function() { + window.sessionStorage.setItem("loaded", "y"); //once we've made it here once per session, we don't need to show splash again + app.store.dispatch(doDaemonReady()); - ReactDOM.render( - -
- - -
-
, - canvas - ); - } - ); + ReactDOM.render( + +
+ + +
+
, + canvas + ); + } + ); }); } -- 2.45.2 From 0b3e9f1179d83399286bf6c439e658fc313e7a88 Mon Sep 17 00:00:00 2001 From: hackrush Date: Wed, 6 Dec 2017 01:04:32 +0530 Subject: [PATCH 6/7] Channel names in pages appear highlighted Used classnames library for determining classname changes --- CHANGELOG.md | 2 ++ src/renderer/js/component/uriIndicator/view.jsx | 10 ++++++++-- src/renderer/scss/component/_channel-indicator.scss | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1273376a1..ac595bc6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ Web UI version numbers should always match the corresponding version of LBRY App ### Changed * The credit balance displayed in the main app navigation displays two decimal places instead of one. * Moved all redux code into /redux folder + * Channel names in pages are highlighted to indicate them being clickable(#814) + * ### Fixed * Long channel names causing inconsistent thumbnail sizes (#721) diff --git a/src/renderer/js/component/uriIndicator/view.jsx b/src/renderer/js/component/uriIndicator/view.jsx index cff4bd073..3bf850d11 100644 --- a/src/renderer/js/component/uriIndicator/view.jsx +++ b/src/renderer/js/component/uriIndicator/view.jsx @@ -1,7 +1,8 @@ import React from "react"; import { Icon } from "component/common"; import Link from "component/link"; -import lbryuri from "lbryuri.js"; +import lbryuri from "lbryuri"; +import classnames from "classnames"; class UriIndicator extends React.PureComponent { componentWillMount() { @@ -60,7 +61,12 @@ class UriIndicator extends React.PureComponent { const inner = ( - + {channelName} {" "} {!signatureIsValid ? ( diff --git a/src/renderer/scss/component/_channel-indicator.scss b/src/renderer/scss/component/_channel-indicator.scss index 6c63a4235..50b7648d0 100644 --- a/src/renderer/scss/component/_channel-indicator.scss +++ b/src/renderer/scss/component/_channel-indicator.scss @@ -1,9 +1,9 @@ .channel-name { - display: inline-block; + display: inline-flex; overflow: hidden; white-space: nowrap; - text-overflow: ellipsis + text-overflow: ellipsis; } // this shouldn't know about the card width -- 2.45.2 From 6b3685ba091465d7c9d50bd86941c800066c5746 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Wed, 6 Dec 2017 12:38:07 -0800 Subject: [PATCH 7/7] Added more understandable error message --- src/renderer/js/redux/actions/content.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/js/redux/actions/content.js b/src/renderer/js/redux/actions/content.js index ab3b630a8..cb0b3d766 100644 --- a/src/renderer/js/redux/actions/content.js +++ b/src/renderer/js/redux/actions/content.js @@ -280,13 +280,17 @@ export function doLoadVideo(uri) { dispatch(doDownloadFile(uri, streamInfo)); } }) - .catch(error => { + .catch(() => { dispatch(doSetPlayingUri(null)); dispatch({ type: types.LOADING_VIDEO_FAILED, data: { uri }, }); - dispatch(doAlertError(error)); + dispatch( + doAlertError( + `Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.` + ) + ); }); }; } -- 2.45.2