UNPKG

11.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"vue-content-loader.min.js","sources":["../node_modules/babel-helper-vue-jsx-merge-props/index.js","../src/uid.js","../src/ContentLoader.js","../src/BulletListLoader.js","../src/CodeLoader.js","../src/FacebookLoader.js","../src/ListLoader.js","../src/InstagramLoader.js"],"sourcesContent":["var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/\n\nmodule.exports = function mergeJSXProps (objs) {\n return objs.reduce(function (a, b) {\n var aa, bb, key, nestedKey, temp\n for (key in b) {\n aa = a[key]\n bb = b[key]\n if (aa && nestRE.test(key)) {\n // normalize class\n if (key === 'class') {\n if (typeof aa === 'string') {\n temp = aa\n a[key] = aa = {}\n aa[temp] = true\n }\n if (typeof bb === 'string') {\n temp = bb\n b[key] = bb = {}\n bb[temp] = true\n }\n }\n if (key === 'on' || key === 'nativeOn' || key === 'hook') {\n // merge functions\n for (nestedKey in bb) {\n aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])\n }\n } else if (Array.isArray(aa)) {\n a[key] = aa.concat(bb)\n } else if (Array.isArray(bb)) {\n a[key] = [aa].concat(bb)\n } else {\n for (nestedKey in bb) {\n aa[nestedKey] = bb[nestedKey]\n }\n }\n } else {\n a[key] = b[key]\n }\n }\n return a\n }, {})\n}\n\nfunction mergeFn (a, b) {\n return function () {\n a && a.apply(this, arguments)\n b && b.apply(this, arguments)\n }\n}\n","export default () =>\n Math.random()\n .toString(36)\n .substring(2)\n","import uid from './uid'\n\nexport default {\n name: 'ContentLoader',\n\n functional: true,\n\n props: {\n width: {\n type: Number,\n default: 400\n },\n height: {\n type: Number,\n default: 130\n },\n speed: {\n type: Number,\n default: 2\n },\n preserveAspectRatio: {\n type: String,\n default: 'xMidYMid meet'\n },\n primaryColor: {\n type: String,\n default: '#f9f9f9'\n },\n secondaryColor: {\n type: String,\n default: '#ecebeb'\n },\n uniqueKey: {\n type: String\n },\n animate: {\n type: Boolean,\n default: true\n }\n },\n\n render(h, { props, data, children }) {\n const idClip = props.uniqueKey ? `${props.uniqueKey}-idClip` : uid()\n const idGradient = props.uniqueKey ? `${props.uniqueKey}-idGradient` : uid()\n\n return (\n <svg\n {...data}\n viewBox={`0 0 ${props.width} ${props.height}`}\n version=\"1.1\"\n preserveAspectRatio={props.preserveAspectRatio}\n >\n <rect\n style={{ fill: `url(#${idGradient})` }}\n clip-path={`url(#${idClip})`}\n x=\"0\"\n y=\"0\"\n width={props.width}\n height={props.height}\n />\n\n <defs>\n <clipPath id={idClip}>\n {children || (\n <rect\n x=\"0\"\n y=\"0\"\n rx=\"5\"\n ry=\"5\"\n width={props.width}\n height={props.height}\n />\n )}\n </clipPath>\n\n <linearGradient id={idGradient}>\n <stop offset=\"0%\" stop-color={props.primaryColor}>\n {props.animate ? (\n <animate\n attributeName=\"offset\"\n values=\"-2; 1\"\n dur={`${props.speed}s`}\n repeatCount=\"indefinite\"\n />\n ) : null}\n </stop>\n <stop offset=\"50%\" stop-color={props.secondaryColor}>\n {props.animate ? (\n <animate\n attributeName=\"offset\"\n values=\"-1.5; 1.5\"\n dur={`${props.speed}s`}\n repeatCount=\"indefinite\"\n />\n ) : null}\n </stop>\n <stop offset=\"100%\" stop-color={props.primaryColor}>\n {props.animate ? (\n <animate\n attributeName=\"offset\"\n values=\"-1; 2\"\n dur={`${props.speed}s`}\n repeatCount=\"indefinite\"\n />\n ) : null}\n </stop>\n </linearGradient>\n </defs>\n </svg>\n )\n }\n}\n","import ContentLoader from './ContentLoader'\n\nexport default {\n name: 'BulletListLoader',\n functional: true,\n render(h, { data }) {\n return (\n <ContentLoader {...data}>\n <circle cx=\"10\" cy=\"20\" r=\"8\" />\n <rect x=\"25\" y=\"15\" rx=\"5\" ry=\"5\" width=\"220\" height=\"10\" />\n <circle cx=\"10\" cy=\"50\" r=\"8\" />\n <rect x=\"25\" y=\"45\" rx=\"5\" ry=\"5\" width=\"220\" height=\"10\" />\n <circle cx=\"10\" cy=\"80\" r=\"8\" />\n <rect x=\"25\" y=\"75\" rx=\"5\" ry=\"5\" width=\"220\" height=\"10\" />\n <circle cx=\"10\" cy=\"110\" r=\"8\" />\n <rect x=\"25\" y=\"105\" rx=\"5\" ry=\"5\" width=\"220\" height=\"10\" />\n </ContentLoader>\n )\n }\n}\n","import ContentLoader from './ContentLoader'\n\nexport default {\n name: 'CodeLoader',\n functional: true,\n render(h, { data }) {\n return (\n <ContentLoader {...data}>\n <rect x=\"0\" y=\"0\" rx=\"3\" ry=\"3\" width=\"70\" height=\"10\" />\n <rect x=\"80\" y=\"0\" rx=\"3\" ry=\"3\" width=\"100\" height=\"10\" />\n <rect x=\"190\" y=\"0\" rx=\"3\" ry=\"3\" width=\"10\" height=\"10\" />\n\n <rect x=\"15\" y=\"20\" rx=\"3\" ry=\"3\" width=\"130\" height=\"10\" />\n <rect x=\"155\" y=\"20\" rx=\"3\" ry=\"3\" width=\"130\" height=\"10\" />\n\n <rect x=\"15\" y=\"40\" rx=\"3\" ry=\"3\" width=\"90\" height=\"10\" />\n <rect x=\"115\" y=\"40\" rx=\"3\" ry=\"3\" width=\"60\" height=\"10\" />\n <rect x=\"185\" y=\"40\" rx=\"3\" ry=\"3\" width=\"60\" height=\"10\" />\n\n <rect x=\"0\" y=\"60\" rx=\"3\" ry=\"3\" width=\"30\" height=\"10\" />\n </ContentLoader>\n )\n }\n}\n","import ContentLoader from './ContentLoader'\n\nexport default {\n name: 'FacebookLoader',\n functional: true,\n render(h, { data }) {\n return (\n <ContentLoader {...data}>\n <rect x=\"70\" y=\"15\" rx=\"4\" ry=\"4\" width=\"117\" height=\"6.4\" />\n <rect x=\"70\" y=\"35\" rx=\"3\" ry=\"3\" width=\"85\" height=\"6.4\" />\n <rect x=\"0\" y=\"80\" rx=\"3\" ry=\"3\" width=\"350\" height=\"6.4\" />\n <rect x=\"0\" y=\"100\" rx=\"3\" ry=\"3\" width=\"380\" height=\"6.4\" />\n <rect x=\"0\" y=\"120\" rx=\"3\" ry=\"3\" width=\"201\" height=\"6.4\" />\n <circle cx=\"30\" cy=\"30\" r=\"30\" />\n </ContentLoader>\n )\n }\n}\n","import ContentLoader from './ContentLoader'\n\nexport default {\n name: 'ListLoader',\n functional: true,\n render(h, { data }) {\n return (\n <ContentLoader {...data}>\n <rect x=\"0\" y=\"0\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" />\n <rect x=\"20\" y=\"20\" rx=\"3\" ry=\"3\" width=\"220\" height=\"10\" />\n <rect x=\"20\" y=\"40\" rx=\"3\" ry=\"3\" width=\"170\" height=\"10\" />\n <rect x=\"0\" y=\"60\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" />\n <rect x=\"20\" y=\"80\" rx=\"3\" ry=\"3\" width=\"200\" height=\"10\" />\n <rect x=\"20\" y=\"100\" rx=\"3\" ry=\"3\" width=\"80\" height=\"10\" />\n </ContentLoader>\n )\n }\n}\n","import ContentLoader from './ContentLoader'\n\nexport default {\n name: 'InstagramLoader',\n functional: true,\n render(h, { data }) {\n return (\n <ContentLoader {...data} height={480}>\n <circle cx=\"30\" cy=\"30\" r=\"30\" />\n\n <rect x=\"75\" y=\"13\" rx=\"4\" ry=\"4\" width=\"100\" height=\"13\" />\n <rect x=\"75\" y=\"37\" rx=\"4\" ry=\"4\" width=\"50\" height=\"8\" />\n <rect x=\"0\" y=\"70\" rx=\"5\" ry=\"5\" width=\"400\" height=\"400\" />\n </ContentLoader>\n )\n }\n}\n"],"names":["nestRE","objs","reduce","a","b","aa","bb","key","nestedKey","temp","test","mergeFn","Array","isArray","concat","apply","this","arguments","Math","random","toString","substring","Number","String","Boolean","h","props","data","children","idClip","uniqueKey","uid","idGradient","width","height","preserveAspectRatio","primaryColor","animate","speed","secondaryColor","ContentLoader"],"mappings":"iMAAA,IAAIA,EAAS,iDAEI,SAAwBC,GACvC,OAAOA,EAAKC,OAAO,SAAUC,EAAGC,GAC9B,IAAIC,EAAIC,EAAIC,EAAKC,EAAWC,EAC5B,IAAKF,KAAOH,EAGV,GAFAC,EAAKF,EAAE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