react-av-timeline 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/dist/Component.d.ts +2 -1
- package/dist/assets/index-8VjGMH1s.css +1 -0
- package/dist/assets/index-DmvArn_g.js +33 -0
- package/dist/index.html +14 -0
- package/package.json +9 -9
- package/dist/index.css +0 -1
- package/dist/index.js +0 -658
- package/dist/index.umd.cjs +0 -30
package/dist/index.umd.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
(function(R,E){typeof exports=="object"&&typeof module<"u"?module.exports=E(require("react")):typeof define=="function"&&define.amd?define(["react"],E):(R=typeof globalThis<"u"?globalThis:R||self,R.index=E(R.react))})(this,(function(R){"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 Pe(){if(ee)return I;ee=1;var c=R,d=Symbol.for("react.element"),T=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,x=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function O(b,f,C){var v,y={},S=null,N=null;C!==void 0&&(S=""+C),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(N=f.ref);for(v in f)g.call(f,v)&&!k.hasOwnProperty(v)&&(y[v]=f[v]);if(b&&b.defaultProps)for(v in f=b.defaultProps,f)y[v]===void 0&&(y[v]=f[v]);return{$$typeof:d,type:b,key:S,ref:N,props:y,_owner:x.current}}return I.Fragment=T,I.jsx=O,I.jsxs=O,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 c=R,d=Symbol.for("react.element"),T=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),b=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),ne=Symbol.iterator,Ie="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[Ie];return typeof r=="function"?r:null}var D=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(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 Me=!1,$e=!1,Le=!1,Ne=!1,Ve=!1,ae;ae=Symbol.for("react.module.reference");function Ue(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===k||Ve||e===x||e===C||e===v||Ne||e===N||Me||$e||Le||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===y||e.$$typeof===O||e.$$typeof===b||e.$$typeof===f||e.$$typeof===ae||e.getModuleId!==void 0))}function Je(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 j(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 g:return"Fragment";case T:return"Portal";case k:return"Profiler";case x:return"StrictMode";case C:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return ie(r)+".Consumer";case O:var t=e;return ie(t._context)+".Provider";case f:return Je(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:j(e.type)||"Memo";case S:{var o=e,u=o._payload,i=o._init;try{return j(i(u))}catch{return null}}}return null}var w=Object.assign,Y=0,oe,ue,se,le,fe,ce,de;function ve(){}ve.__reactDisabledLog=!0;function Be(){{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 qe(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},e,{value:oe}),info:w({},e,{value:ue}),warn:w({},e,{value:se}),error:w({},e,{value:le}),group:w({},e,{value:fe}),groupCollapsed:w({},e,{value:ce}),groupEnd:w({},e,{value:de})})}Y<0&&p("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 Ke=typeof WeakMap=="function"?WeakMap:Map;U=new Ke}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,Be();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
|
-
`),m=n.stack.split(`
|
|
20
|
-
`),s=a.length-1,l=m.length-1;s>=1&&l>=0&&a[s]!==m[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==m[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==m[l]){var _=`
|
|
21
|
-
`+a[s].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,_),_}while(s>=1&&l>=0);break}}}finally{G=!1,q.current=u,qe(),Error.prepareStackTrace=o}var F=e?e.displayName||e.name:"",P=F?V(F):"";return typeof e=="function"&&U.set(e,P),P}function Ge(e,r,t){return pe(e,!1)}function ze(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,ze(e));if(typeof e=="string")return V(e);switch(e){case C:return V("Suspense");case v:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ge(e.render);case y:return J(e.type,r,t);case S:{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 Xe(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 m=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 m.name="Invariant Violation",m}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),p("%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),p("Failed %s type: %s",t,a.message),B(null))}}}var He=Array.isArray;function z(e){return He(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return _e(e),!1}catch{return!0}}function _e(e){return""+e}function ge(e){if(Qe(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),_e(e)}var ye=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},be,Re;function rr(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 tr(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 nr(e,r){typeof e.ref=="string"&&ye.current}function ar(e,r){{var t=function(){be||(be=!0,p("%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 ir(e,r){{var t=function(){Re||(Re=!0,p("%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 or=function(e,r,t,n,o,u,i){var a={$$typeof:d,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 ur(e,r,t,n,o){{var u,i={},a=null,m=null;t!==void 0&&(ge(t),a=""+t),tr(r)&&(ge(r.key),a=""+r.key),rr(r)&&(m=r.ref,nr(r,o));for(u in r)M.call(r,u)&&!er.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||m){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(i,l),m&&ir(i,l)}return or(e,a,m,o,n,ye.current,i)}}var X=D.ReactCurrentOwner,Ee=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===d}function Te(){{if(X.current){var e=j(X.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function sr(e){return""}var Oe={};function lr(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 je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+j(e._owner.type)+"."),A(e),p('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 Ce(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&je(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var o=We(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)Z(i.value)&&je(i.value,r)}}}function fr(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===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=j(r);Xe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var o=j(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(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),p("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),p("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Se={};function we(e,r,t,n,o,u){{var i=Ue(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 m=sr();m?a+=m:a+=Te();var s;e===null?s="null":z(e)?s="array":e!==void 0&&e.$$typeof===d?(s="<"+(j(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,p("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 l=ur(e,r,t,o,u);if(l==null)return l;if(i){var _=r.children;if(_!==void 0)if(n)if(z(_)){for(var F=0;F<_.length;F++)Ce(_[F],e);Object.freeze&&Object.freeze(_)}else p("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 Ce(_,e)}if(M.call(r,"key")){var P=j(e),h=Object.keys(r).filter(function(_r){return _r!=="key"}),Q=h.length>0?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}";if(!Se[P+Q]){var hr=h.length>0?"{"+h.join(": ..., ")+": ...}":"{}";p(`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,P,hr,P),Se[P+Q]=!0}}return e===g?cr(l):fr(l),l}}function dr(e,r,t){return we(e,r,t,!0)}function vr(e,r,t){return we(e,r,t,!1)}var pr=vr,mr=dr;W.Fragment=g,W.jsx=pr,W.jsxs=mr})()),W}var te;function ke(){return te||(te=1,process.env.NODE_ENV==="production"?E.exports=Pe():E.exports=xe()),E.exports}var $=ke();const L={timeline:"_timeline_1tjsb_1","timeline-items":"_timeline-items_1tjsb_6","timeline-item":"_timeline-item_1tjsb_6","timeline-indicator":"_timeline-indicator_1tjsb_23"};function De(){var c=Math.floor(156+Math.random()*100),d=Math.floor(156+Math.random()*100),T=Math.floor(156+Math.random()*100);return"rgb("+c+","+d+","+T+")"}function Ae(c,d){return d===c.length-1?c[d]-c[d-1]:c[d+1]-c[d]}function Fe({items:c,currentTime:d,totalTime:T,scale:g=1,indicator:x}){const k=R.useRef(new Array(c.length).fill(0).map(De));return $.jsxs("div",{className:L.timeline,children:[$.jsx("div",{className:L["timeline-indicator"],...x}),$.jsx("div",{className:L["timeline-items"],style:{"--translate":`${g*50/g-d/T*g*100}%`},children:c.map((O,b)=>{const f=c.map(y=>y.time),v=Ae(f,b)/T*g*100+"%";return $.jsx("span",{className:L["timeline-item"],style:{"--bg":O.style?.background||k.current[b],width:v},children:O.content})})})]})}return Fe}));
|