react-av-timeline 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/dist/index.umd.cjs +0 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-av-timeline",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "React 音视频时间线组件",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,30 +0,0 @@
1
- (function(O,E){typeof exports=="object"&&typeof module<"u"?module.exports=E(require("react")):typeof define=="function"&&define.amd?define(["react"],E):(O=typeof globalThis<"u"?globalThis:O||self,O.index=E(O.react))})(this,(function(O){"use strict";var E={exports:{}},I={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ee;function je(){if(ee)return I;ee=1;var m=O,c=Symbol.for("react.element"),R=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function C(_,l,S){var d,b={},w=null,N=null;S!==void 0&&(w=""+S),l.key!==void 0&&(w=""+l.key),l.ref!==void 0&&(N=l.ref);for(d in l)y.call(l,d)&&!k.hasOwnProperty(d)&&(b[d]=l[d]);if(_&&_.defaultProps)for(d in l=_.defaultProps,l)b[d]===void 0&&(b[d]=l[d]);return{$$typeof:c,type:_,key:w,ref:N,props:b,_owner:x.current}}return I.Fragment=R,I.jsx=C,I.jsxs=C,I}var W={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var re;function xe(){return re||(re=1,process.env.NODE_ENV!=="production"&&(function(){var m=O,c=Symbol.for("react.element"),R=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),_=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),ne=Symbol.iterator,We="@@iterator";function Ye(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[We];return typeof r=="function"?r:null}var D=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Me("error",e,t)}}function Me(e,r,t){{var n=D.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var $e=!1,Le=!1,Ne=!1,Ve=!1,Ue=!1,ae;ae=Symbol.for("react.module.reference");function Je(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===k||Ue||e===x||e===S||e===d||Ve||e===N||$e||Le||Ne||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===b||e.$$typeof===C||e.$$typeof===_||e.$$typeof===l||e.$$typeof===ae||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ie(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case R:return"Portal";case k:return"Profiler";case x:return"StrictMode";case S:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return ie(r)+".Consumer";case C:var t=e;return ie(t._context)+".Provider";case l:return Be(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:T(e.type)||"Memo";case w:{var o=e,u=o._payload,i=o._init;try{return T(i(u))}catch{return null}}}return null}var P=Object.assign,Y=0,oe,ue,se,le,fe,ce,de;function ve(){}ve.__reactDisabledLog=!0;function qe(){{if(Y===0){oe=console.log,ue=console.info,se=console.warn,le=console.error,fe=console.group,ce=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Ke(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:oe}),info:P({},e,{value:ue}),warn:P({},e,{value:se}),error:P({},e,{value:le}),group:P({},e,{value:fe}),groupCollapsed:P({},e,{value:ce}),groupEnd:P({},e,{value:de})})}Y<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=D.ReactCurrentDispatcher,K;function V(e,r,t){{if(K===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);K=n&&n[1]||""}return`
18
- `+K+e}}var G=!1,U;{var Ge=typeof WeakMap=="function"?WeakMap:Map;U=new Ge}function pe(e,r){if(!e||G)return"";{var t=U.get(e);if(t!==void 0)return t}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=q.current,q.current=null,qe();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(h){n=h}Reflect.construct(e,[],i)}else{try{i.call()}catch(h){n=h}e.call(i.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var a=h.stack.split(`
19
- `),p=n.stack.split(`
20
- `),s=a.length-1,f=p.length-1;s>=1&&f>=0&&a[s]!==p[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==p[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==p[f]){var g=`
21
- `+a[s].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,g),g}while(s>=1&&f>=0);break}}}finally{G=!1,q.current=u,Ke(),Error.prepareStackTrace=o}var F=e?e.displayName||e.name:"",j=F?V(F):"";return typeof e=="function"&&U.set(e,j),j}function ze(e,r,t){return pe(e,!1)}function Xe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Xe(e));if(typeof e=="string")return V(e);switch(e){case S:return V("Suspense");case d:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return ze(e.render);case b:return J(e.type,r,t);case w:{var n=e,o=n._payload,u=n._init;try{return J(u(o),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,me={},he=D.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);he.setExtraStackFrame(t)}else he.setExtraStackFrame(null)}function He(e,r,t,n,o){{var u=Function.call.bind(M);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var p=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(B(o),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),B(null)),a instanceof Error&&!(a.message in me)&&(me[a.message]=!0,B(o),v("Failed %s type: %s",t,a.message),B(null))}}}var Ze=Array.isArray;function z(e){return Ze(e)}function Qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function er(e){try{return _e(e),!1}catch{return!0}}function _e(e){return""+e}function ge(e){if(er(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qe(e)),_e(e)}var ye=D.ReactCurrentOwner,rr={key:!0,ref:!0,__self:!0,__source:!0},be,Ee;function tr(e){if(M.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function nr(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ar(e,r){typeof e.ref=="string"&&ye.current}function ir(e,r){{var t=function(){be||(be=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function or(e,r){{var t=function(){Ee||(Ee=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ur=function(e,r,t,n,o,u,i){var a={$$typeof:c,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function sr(e,r,t,n,o){{var u,i={},a=null,p=null;t!==void 0&&(ge(t),a=""+t),nr(r)&&(ge(r.key),a=""+r.key),tr(r)&&(p=r.ref,ar(r,o));for(u in r)M.call(r,u)&&!rr.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||p){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(i,f),p&&or(i,f)}return ur(e,a,p,o,n,ye.current,i)}}var X=D.ReactCurrentOwner,Re=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function Te(){{if(X.current){var e=T(X.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function lr(e){return""}var Oe={};function fr(e){{var r=Te();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
-
25
- Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+T(e._owner.type)+"."),A(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Ce(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var o=Ye(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)Z(i.value)&&Ce(i.value,r)}}}function cr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===b))t=r.propTypes;else return;if(t){var n=T(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var o=T(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var we={};function Pe(e,r,t,n,o,u){{var i=Je(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=lr();p?a+=p:a+=Te();var s;e===null?s="null":z(e)?s="array":e!==void 0&&e.$$typeof===c?(s="<"+(T(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=sr(e,r,t,o,u);if(f==null)return f;if(i){var g=r.children;if(g!==void 0)if(n)if(z(g)){for(var F=0;F<g.length;F++)Se(g[F],e);Object.freeze&&Object.freeze(g)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Se(g,e)}if(M.call(r,"key")){var j=T(e),h=Object.keys(r).filter(function(gr){return gr!=="key"}),Q=h.length>0?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}";if(!we[j+Q]){var _r=h.length>0?"{"+h.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,Q,j,_r,j),we[j+Q]=!0}}return e===y?dr(f):cr(f),f}}function vr(e,r,t){return Pe(e,r,t,!0)}function pr(e,r,t){return Pe(e,r,t,!1)}var mr=pr,hr=vr;W.Fragment=y,W.jsx=mr,W.jsxs=hr})()),W}var te;function ke(){return te||(te=1,process.env.NODE_ENV==="production"?E.exports=je():E.exports=xe()),E.exports}var $=ke();const L={timeline:"_timeline_160ei_1","timeline-items":"_timeline-items_160ei_6","timeline-item":"_timeline-item_160ei_6","timeline-indicator":"_timeline-indicator_160ei_23"};function De(){var m=Math.floor(156+Math.random()*100),c=Math.floor(156+Math.random()*100),R=Math.floor(156+Math.random()*100);return"rgb("+m+","+c+","+R+")"}function Ae(m,c){return c===m.length-1?m[c]-m[c-1]:m[c+1]-m[c]}const Fe=new Array(10).fill(0).map(De);function Ie({items:m,currentTime:c,totalTime:R,scale:y=1,indicator:x,itemStyle:k}){const C=m.map(_=>_.time);return $.jsxs("div",{className:L.timeline,children:[$.jsx("div",{className:L["timeline-indicator"],...x}),$.jsx("div",{className:L["timeline-items"],style:{"--translate":`${y*50/y-c/R*y*100}%`},children:m.map((_,l)=>{const d=Ae(C,l)/R*y*100+"%";return $.jsx("span",{className:L["timeline-item"],style:{"--bg":_.style?.background||Fe[l>10?l%10:l],width:d,...k},children:_.content})})})]})}return Ie}));