Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lin-media/highlight

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lin-media/highlight - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

LICENSE

6

dist/index.js

@@ -1,2 +0,2 @@

module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=require("@lin-media/utils")},function(t,e,n){"use strict";var r=n(7),i=n.n(r)()((function(t){return t[1]}));i.push([t.i,".highlight-container{position:absolute;top:0;display:flex;align-items:center;justify-content:center;height:3px;padding:5px 0;cursor:pointer;transform:translateX(-50%)}.highlight-container:hover .highlight-point{width:8px;height:6px}.highlight-container:hover .highlight-point-tip{opacity:1}.highlight-point{width:6px;height:3px;background-color:#fff;border-radius:6px;transition:all 0.2s ease-in-out}.highlight-point-tip{position:absolute;top:0;left:50%;box-sizing:border-box;padding:5px 7px;font-size:12px;color:#fff;text-align:center;white-space:nowrap;pointer-events:none;background-color:rgba(0,0,0,0.62);border-radius:4px;opacity:0;transition:opacity 0.2s ease-in-out;transform:translate(-50%, -100%)}\n",""]),e.a=i},function(t,e){t.exports=require("@lin-media/player")},function(t,e,n){(function(n){var r,i,o,a,c,u,s,l,f,p,h,d,y,v,g,b,m,w,_,j,x,O,S,E,P;
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=require("@lin-media/utils")},function(t,e,n){"use strict";var r=n(7),i=n.n(r)()((function(t){return t[1]}));i.push([t.i,".highlight-container{position:absolute;top:0;display:flex;align-items:center;justify-content:center;height:3px;padding:5px 0;cursor:pointer;transform:translateX(-50%)}.highlight-container:hover .highlight-point{width:8px;height:6px}.highlight-container:hover .highlight-point-tip{opacity:1}.highlight-point{width:6px;height:3px;background-color:#fff;border-radius:6px;transition:all 0.2s ease-in-out}.highlight-point-tip{position:absolute;top:0;left:50%;box-sizing:border-box;padding:5px 7px;font-size:12px;color:#fff;text-align:center;white-space:nowrap;pointer-events:none;background-color:rgba(0,0,0,0.62);border-radius:4px;opacity:0;transition:opacity 0.2s ease-in-out;transform:translate(-50%, -100%)}\n",""]),e.a=i},function(t,e){t.exports=require("@lin-media/player")},function(t,e,n){(function(n){var r,i,o,a,c,l,s,u,f,p,h,d,y,v,g,b,_,m,w,j,x,O,S,E,P;
/*! *****************************************************************************

@@ -15,4 +15,4 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */!function(T){var C="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:{};function M(t,e){return t!==C&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,r){return t[n]=e?e(n,r):r}}void 0===(r=function(t){!function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};i=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)},o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},c=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},u=function(t,e){return function(n,r){e(n,r,t)}},s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function c(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},p=function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||P(e,t,n)},P=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]},h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},y=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t},v=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,i++)r[i]=o[a];return r},g=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},b=function(t){return this instanceof b?(this.v=t,this):new b(t)},m=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof b?Promise.resolve(n.value.v).then(u,s):l(o[0][2],n)}catch(t){l(o[0][3],t)}var n}function u(t){c("next",t)}function s(t){c("throw",t)}function l(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}},w=function(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:i?i(e):e}:i}},_=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}},j=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};var n=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};x=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&P(e,t,r);return n(e,t),e},O=function(t){return t&&t.__esModule?t:{default:t}},S=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)},E=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},t("__extends",i),t("__assign",o),t("__rest",a),t("__decorate",c),t("__param",u),t("__metadata",s),t("__awaiter",l),t("__generator",f),t("__exportStar",p),t("__createBinding",P),t("__values",h),t("__read",d),t("__spread",y),t("__spreadArrays",v),t("__spreadArray",g),t("__await",b),t("__asyncGenerator",m),t("__asyncDelegator",w),t("__asyncValues",_),t("__makeTemplateObject",j),t("__importStar",x),t("__importDefault",O),t("__classPrivateFieldGet",S),t("__classPrivateFieldSet",E)}(M(C,M(t)))}.apply(e,[e]))||(t.exports=r)}()}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(8);t.exports=function(t){"use strict";t=t||{};var e="",n=r.$each,i=t.highlightList,o=(t.$value,t.$index,r.$escape),a=t.duration;return n(i,(function(t,n){e+="\r\n<span class='highlight-container' style=\"left: ",e+=o(t.time/a*100),e+="%;\" data-index='",e+=o(n),e+="'>\r\n<span class=\"highlight-point\" data-index='",e+=o(n),e+='\'></span>\r\n<span class="highlight-point-tip">',e+=o(t.text),e+="</span>\r\n</span>\r\n"})),e+="\r\n"}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function c(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function u(t,e){for(var n={},r=[],i=0;i<t.length;i++){var o=t[i],u=e.base?o[0]+e.base:o[0],s=n[u]||0,l="".concat(u," ").concat(s);n[u]=s+1;var f=c(l),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==f?(a[f].references++,a[f].updater(p)):a.push({identifier:l,updater:v(p,e),references:1}),r.push(l)}return r}function s(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var l,f=(l=[],function(t,e){return l[t]=e,l.filter(Boolean).join("\n")});function p(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=f(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var d=null,y=0;function v(t,e){var n,r,i;if(e.singleton){var o=y++;n=d||(d=s(e)),r=p.bind(null,n,o,!1),i=p.bind(null,n,o,!0)}else n=s(e),r=h.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=u(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=c(n[r]);a[i].references--}for(var o=u(t,e),s=0;s<n.length;s++){var l=c(n[s]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=o}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);r&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e,n){"use strict";t.exports=n(9)},function(t,e,n){"use strict";(function(e){
***************************************************************************** */!function(T){var I="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:{};function C(t,e){return t!==I&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,r){return t[n]=e?e(n,r):r}}void 0===(r=function(t){!function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};i=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)},o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},c=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){return function(n,r){e(n,r,t)}},s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},p=function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||P(e,t,n)},P=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]},h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},y=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t},v=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,i++)r[i]=o[a];return r},g=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},b=function(t){return this instanceof b?(this.v=t,this):new b(t)},_=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof b?Promise.resolve(n.value.v).then(l,s):u(o[0][2],n)}catch(t){u(o[0][3],t)}var n}function l(t){c("next",t)}function s(t){c("throw",t)}function u(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}},m=function(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:i?i(e):e}:i}},w=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}},j=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};var n=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};x=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&P(e,t,r);return n(e,t),e},O=function(t){return t&&t.__esModule?t:{default:t}},S=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)},E=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},t("__extends",i),t("__assign",o),t("__rest",a),t("__decorate",c),t("__param",l),t("__metadata",s),t("__awaiter",u),t("__generator",f),t("__exportStar",p),t("__createBinding",P),t("__values",h),t("__read",d),t("__spread",y),t("__spreadArrays",v),t("__spreadArray",g),t("__await",b),t("__asyncGenerator",_),t("__asyncDelegator",m),t("__asyncValues",w),t("__makeTemplateObject",j),t("__importStar",x),t("__importDefault",O),t("__classPrivateFieldGet",S),t("__classPrivateFieldSet",E)}(C(I,C(t)))}.apply(e,[e]))||(t.exports=r)}()}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(8);t.exports=function(t){"use strict";t=t||{};var e="",n=r.$each,i=t.highlightList,o=(t.$value,t.$index,r.$escape),a=t.duration;return n(i,(function(t,n){e+="\n<span class='highlight-container' style=\"left: ",e+=o(t.time/a*100),e+="%;\" data-index='",e+=o(n),e+="'>\n<span class=\"highlight-point\" data-index='",e+=o(n),e+='\'></span>\n<span class="highlight-point-tip">',e+=o(t.text),e+="</span>\n</span>\n"})),e+="\n"}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function c(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},r=[],i=0;i<t.length;i++){var o=t[i],l=e.base?o[0]+e.base:o[0],s=n[l]||0,u="".concat(l," ").concat(s);n[l]=s+1;var f=c(u),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==f?(a[f].references++,a[f].updater(p)):a.push({identifier:u,updater:v(p,e),references:1}),r.push(u)}return r}function s(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,f=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function p(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=f(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var d=null,y=0;function v(t,e){var n,r,i;if(e.singleton){var o=y++;n=d||(d=s(e)),r=p.bind(null,n,o,!1),i=p.bind(null,n,o,!0)}else n=s(e),r=h.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=c(n[r]);a[i].references--}for(var o=l(t,e),s=0;s<n.length;s++){var u=c(n[s]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=o}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";t.exports=n(9)},function(t,e,n){"use strict";(function(e){
/*! art-template@runtime | https://github.com/aui/art-template */
var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},r=Object.create(n),i=/["&'<>]/;r.$escape=function(t){return function(t){var e=""+t,n=i.exec(e);if(!n)return t;var r="",o=void 0,a=void 0,c=void 0;for(o=n.index,a=0;o<e.length;o++){switch(e.charCodeAt(o)){case 34:c="&#34;";break;case 38:c="&#38;";break;case 39:c="&#39;";break;case 60:c="&#60;";break;case 62:c="&#62;";break;default:continue}a!==o&&(r+=e.substring(a,o)),a=o+1,r+=c}return a!==o?r+e.substring(a,o):r}(function t(e){"string"!=typeof e&&(e=null==e?"":"function"==typeof e?t(e.call(e)):JSON.stringify(e));return e}(t))},r.$each=function(t,e){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)e(t[n],n);else for(var i in t)e(t[i],i)},t.exports=r}).call(this,n(4))},function(t,e,n){"use strict";n.r(e),n.d(e,"HighlightEvents",(function(){return r}));var r,i=n(3),o=n(5),a=n.n(o),c=n(6),u=n.n(c),s=n(1),l={insert:"head",singleton:!1},f=(u()(s.a,l),s.a.locals,n(0)),p=n(2);!function(t){t.HIGHLIGHTCLICK="highlight-click"}(r||(r={}));var h={jump:!0,showTip:!0},d=function(){function t(t,e){var n;this.load=!0,this.el=t,this.instance=e;var r=null!==(n=this.instance.options.Highlight)&&void 0!==n?n:{};this.options=Object(i.__assign)(Object(i.__assign)({},h),r),this.initVar(),this.init(),this.initInstanceListener(),this.initMethods()}return t.prototype.initMethods=function(){var t=this;Object.defineProperty(this.instance,"highlight",{get:function(){return{set:function(e){t.setHighlight(e)},destroy:function(){t.destroyHighlight()}}}})},t.prototype.initVar=function(){this.eventManager=new f.EventManager},Object.defineProperty(t.prototype,"duration",{get:function(){return this.instance.duration},enumerable:!1,configurable:!0}),t.prototype.initInstanceListener=function(){var t=this;this.instance.$on(p.PlayerEvents.DESTROY,(function(){t.destroyHighlight()}))},t.prototype.init=function(){var t=this;this.duration&&this.duration>0?(this.load=!0,this.initElement()):this.instance.$once(p.VideoEvents.LOADEDMETADATA,(function(){t.load=!0,t.initElement()}))},t.prototype.initElement=function(){var t=this.options.list;if(this.load&&Object(f.isArray)(t)&&0!==t.length){this.removeElementAndListener();var e=this.el.querySelector(".player-process-content"),n=document.createElement("div");n.innerHTML=a()({highlightList:t,duration:this.duration}),this.element=n,null==e||e.appendChild(n),this.initListener(),this.adjustPosition()}},t.prototype.adjustPosition=function(){var t=this.element.querySelectorAll(".highlight-point-tip"),e=Object(f.getBoundingClientRect)(this.el),n=e.left,r=e.right;this.adjustLeft(t,n),this.adjustRight(t,r)},t.prototype.adjustLeft=function(t,e){for(var n,r=t.length,i=0;i<r;i++){var o=t[i];if(!(e>Object(f.getBoundingClientRect)(o).left))break;var a=(null!==(n=Object(f.getBoundingClientRect)(o.parentElement).left)&&void 0!==n?n:0)-e;o.style.left=-a+"px",o.style.transform="translate(0,-100%)"}},t.prototype.adjustRight=function(t,e){for(var n,r=t.length-1;r>=0;r--){var i=t[r];if(!(e<Object(f.getBoundingClientRect)(i).right))break;var o=e-(null!==(n=Object(f.getBoundingClientRect)(i.parentElement).right)&&void 0!==n?n:0);i.style.left=o+"px",i.style.transform="translate(-100%,-100%)"}},t.prototype.initListener=function(){var t;null===(t=this.eventManager)||void 0===t||t.addEventListener({element:this.element,eventName:"click",handler:this.onClick.bind(this)})},t.prototype.onClick=function(t){var e=this.options,n=e.jump,i=e.showTip,o=t.target.dataset;if(o&&o.index){var a=this.options.list[o.index];n&&this.instance.seek(a.time),i&&this.instance.setNotice(a.text),this.instance.$emit(r.HIGHLIGHTCLICK,a)}},t.prototype.removeElementAndListener=function(){var t,e;null===(t=this.eventManager)||void 0===t||t.removeEventListener(),null===(e=this.element)||void 0===e||e.remove(),this.element=null},t.prototype.setHighlight=function(t){this.options.list=t,this.initElement()},t.prototype.destroyHighlight=function(){this.options.list=[],this.removeElementAndListener()},t.pluginName="Highlight",t}();e.default=d}]);
var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},r=Object.create(n),i=/["&'<>]/;r.$escape=function(t){return function(t){var e=""+t,n=i.exec(e);if(!n)return t;var r="",o=void 0,a=void 0,c=void 0;for(o=n.index,a=0;o<e.length;o++){switch(e.charCodeAt(o)){case 34:c="&#34;";break;case 38:c="&#38;";break;case 39:c="&#39;";break;case 60:c="&#60;";break;case 62:c="&#62;";break;default:continue}a!==o&&(r+=e.substring(a,o)),a=o+1,r+=c}return a!==o?r+e.substring(a,o):r}(function t(e){"string"!=typeof e&&(e=null==e?"":"function"==typeof e?t(e.call(e)):JSON.stringify(e));return e}(t))},r.$each=function(t,e){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)e(t[n],n);else for(var i in t)e(t[i],i)},t.exports=r}).call(this,n(4))},function(t,e,n){"use strict";n.r(e);var r,i=n(3),o=n(5),a=n.n(o),c=n(6),l=n.n(c),s=n(1),u={insert:"head",singleton:!1},f=(l()(s.a,u),s.a.locals,n(0)),p=n(2),h=n.n(p);!function(t){t.HIGHLIGHTCLICK="highlight-click"}(r||(r={}));var d={jump:!0,showTip:!0},y=function(){function t(t,e){var n;this._load=!0,this._eventManager=new f.EventManager,this._el=e,this._playerInstance=t;var r=null!==(n=t.$options.Highlight)&&void 0!==n?n:{};this._options=Object(i.__assign)(Object(i.__assign)({},d),r),this._init(),this._initInstanceListener(),this._initMethods()}return t.prototype._initMethods=function(){var t=this;Object.defineProperty(this._playerInstance,"highlight",{get:function(){return{set:function(e){t._setHighlight(e)},destroy:function(){t._destroyHighlight()}}}})},Object.defineProperty(t.prototype,"duration",{get:function(){return this._playerInstance.duration},enumerable:!1,configurable:!0}),t.prototype._initInstanceListener=function(){this._playerInstance.$on(h.a.PlayerEvents.DESTROY,this._destroyHighlight.bind(this))},t.prototype._init=function(){var t=this;this.duration&&this.duration>0?(this._load=!0,this._initElement()):this._playerInstance.$once(h.a.VideoEvents.LOADEDMETADATA,(function(){t._load=!0,t._initElement()}))},t.prototype._initElement=function(){var t=this._options.list;if(this._load&&Object(f.isArray)(t)&&0!==t.length){this._removeElementAndListener();var e=this._el.querySelector(".player-process-content"),n=document.createElement("div");n.innerHTML=a()({highlightList:t,duration:this.duration}),this._element=n,null==e||e.appendChild(n),this._initListener(),this._adjustPosition()}},t.prototype._adjustPosition=function(){var t=this._element.querySelectorAll(".highlight-point-tip"),e=Object(f.getBoundingClientRect)(this._el),n=e.left,r=e.right;this._adjustLeft(t,n),this._adjustRight(t,r)},t.prototype._adjustLeft=function(t,e){for(var n,r=t.length,i=0;i<r;i++){var o=t[i];if(!(e>Object(f.getBoundingClientRect)(o).left))break;var a=(null!==(n=Object(f.getBoundingClientRect)(o.parentElement).left)&&void 0!==n?n:0)-e;o.style.left=-a+"px",o.style.transform="translate(0,-100%)"}},t.prototype._adjustRight=function(t,e){for(var n,r=t.length-1;r>=0;r--){var i=t[r];if(!(e<Object(f.getBoundingClientRect)(i).right))break;var o=e-(null!==(n=Object(f.getBoundingClientRect)(i.parentElement).right)&&void 0!==n?n:0);i.style.left=o+"px",i.style.transform="translate(-100%,-100%)"}},t.prototype._initListener=function(){var t;null===(t=this._eventManager)||void 0===t||t.addEventListener({element:this._element,eventName:"click",handler:this._onClick.bind(this)})},t.prototype._onClick=function(t){var e=this._options,n=e.jump,i=e.showTip,o=t.target.dataset;if(o&&o.index){var a=this._options.list[o.index];n&&this._playerInstance.seek(a.time),i&&this._playerInstance.setNotice(a.text),this._playerInstance.$emit(r.HIGHLIGHTCLICK,a)}},t.prototype._removeElementAndListener=function(){var t,e;null===(t=this._eventManager)||void 0===t||t.removeEventListener(),null===(e=this._element)||void 0===e||e.remove(),this._element=null},t.prototype._setHighlight=function(t){this._options.list=t,this._initElement()},t.prototype._destroyHighlight=function(){this._options.list=[],this._removeElementAndListener()},t.customEvents=r,t.pluginName="Highlight",t}();e.default=y}]);

@@ -1,5 +0,3 @@

import Highlight from "./src/highlight";
import Highlight from "./src/index";
export default Highlight;
export * from "./src/config/event";
{
"name": "@lin-media/highlight",
"version": "1.0.0",
"version": "1.0.2",
"description": "highlight",

@@ -22,5 +22,6 @@ "main": "dist/index.js",

"dependencies": {
"@lin-media/player": "^1.0.0",
"@lin-media/utils": "^1.0.0"
}
"@lin-media/player": "^2.0.0",
"@lin-media/utils": "^1.0.2"
},
"gitHead": "f5bb7e86e9fefb503d702a098be3b430fc1319f2"
}

@@ -0,0 +0,0 @@ # 自定义进度条提示点

// 插件名
export const pluginName = "Highlight";

@@ -0,0 +0,0 @@ // 高亮插件事件

@@ -0,0 +0,0 @@ export type HighlightListItem = {

@@ -1,3 +0,2 @@

import Highlight from "./src/highlight";
import Highlight from "./src/index";
export default Highlight;
export * from "./src/config/event";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc