-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.es.js.map
1 lines (1 loc) · 39.9 KB
/
index.es.js.map
1
{"version":3,"file":"index.es.js","sources":["src/util.js","src/canvas1.js","src/canvas1n.js","src/canvas2.js","src/index.js"],"sourcesContent":["const toString = {}.toString;\n\nexport const isFunction = function(obj) {\n return toString.call(obj) === '[object CallbackFunction]' || toString.call(obj) === '[object Function]';\n}\n","const CANVAS = {};\nconst CANVAS_LIST = [];\n\nexport default function injectCanvas1(karas, createVd, Root) {\n class newRoot extends Root {\n refresh(cb, isFirst) {\n let self = this;\n let ctx = self.ctx;\n // 小程序bug,可能restore失败,刷新前手动restore下\n ctx.restore();\n\n function wrap() {\n ctx.draw && ctx.draw(true, function() {\n self.emit('myRefresh');\n });\n }\n\n super.refresh(wrap, isFirst);\n }\n }\n\n karas.createVd = function(tagName, props, children) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new newRoot(tagName, props, children);\n }\n return createVd(tagName, props, children);\n };\n\n const IMG = karas.inject.IMG;\n const INIT = karas.inject.INIT;\n const LOADING = karas.inject.LOADING;\n const LOADED = karas.inject.LOADED;\n\n karas.inject.checkSupportFontFamily = () => false\n\n karas.inject.measureImg = function(url, cb, options = {}) {\n if(url.indexOf('data:') === 0) {\n let { width = {}, height = {} } = options;\n cb({\n success: true,\n width: width.value,\n height: height.value,\n url,\n source: url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb(cache);\n }\n else if(cache.state === LOADING) {\n cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cache.task.push(cb);\n my.getImageInfo({\n src: url,\n success: function(res) {\n cache.state = LOADED;\n cache.success = true;\n cache.width = res.width;\n cache.height = res.height;\n cache.source = url;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n },\n fail: function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n },\n });\n }\n };\n\n karas.inject.isDom = function(o) {\n return o && (o.getContext || o.arc);\n }\n\n karas.inject.hasCacheCanvas = function(key) {\n return key && CANVAS.hasOwnProperty(key);\n };\n karas.inject.getCacheCanvas = function(w, h, key, message) {\n if(message) {\n key = message;\n }\n // console.log(message,CANVAS);\n if(!CANVAS[key]) {\n throw new Error('Need a cache canvas');\n }\n let o = CANVAS[key];\n return {\n ctx: o,\n canvas: o,\n draw() {\n o.draw(true);\n },\n };\n };\n karas.inject.setCacheCanvas = function(k, v) {\n CANVAS[k] = v;\n };\n\n karas.inject.releaseCacheCanvas = function(o) {\n CANVAS_LIST.push(o);\n };\n\n karas.inject.delCacheCanvas = function(key) {\n key && delete CANVAS[key];\n };\n}\n","const CANVAS = {};\nconst CANVAS_LIST = [];\n\nexport default function injectCanvas1(karas, createVd, Root) {\n class newRoot extends Root {\n refresh(cb, isFirst) {\n let self = this;\n let ctx = self.ctx;\n // 小程序bug,可能restore失败,刷新前手动restore下\n ctx.restore();\n\n function wrap() {\n ctx.draw && ctx.draw(false, function() {\n self.emit('myRefresh');\n });\n }\n\n super.refresh(wrap, isFirst);\n }\n }\n\n karas.createVd = function(tagName, props, children) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new newRoot(tagName, props, children);\n }\n return createVd(tagName, props, children);\n };\n\n const IMG = karas.inject.IMG;\n const INIT = karas.inject.INIT;\n const LOADING = karas.inject.LOADING;\n const LOADED = karas.inject.LOADED;\n\n karas.inject.checkSupportFontFamily = () => false\n\n karas.inject.measureImg = function(url, cb, optinos = {}) {\n if(url.indexOf('data:') === 0) {\n let { width = {}, height = {} } = optinos;\n cb({\n success: true,\n width: width.value,\n height: height.value,\n url,\n source: url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb(cache);\n }\n else if(cache.state === LOADING) {\n cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cache.task.push(cb);\n my.getImageInfo({\n src: url,\n success: function(res) {\n cache.state = LOADED;\n cache.success = true;\n cache.width = res.width;\n cache.height = res.height;\n cache.source = url;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n },\n fail: function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n },\n });\n }\n };\n\n karas.inject.isDom = function(o) {\n return o && (o.getContext || o.arc);\n }\n\n karas.inject.hasCacheCanvas = function(key) {\n return key && CANVAS.hasOwnProperty(key);\n };\n karas.inject.getCacheCanvas = function(w, h, key, message) {\n if(message) {\n key = message;\n }\n // console.log(message,CANVAS);\n if(!CANVAS[key]) {\n throw new Error('Need a cache canvas');\n }\n let o = CANVAS[key];\n return {\n ctx: o,\n canvas: o,\n draw() {\n o.draw(false);\n },\n };\n };\n karas.inject.setCacheCanvas = function(k, v) {\n CANVAS[k] = v;\n };\n\n karas.inject.releaseCacheCanvas = function(o) {\n CANVAS_LIST.push(o);\n };\n\n karas.inject.delCacheCanvas = function(key) {\n key && delete CANVAS[key];\n };\n}\n","import karas from 'karas';\n\nfunction recursion(dom, hash) {\n if(dom.tagName === 'img') {\n if(dom.src) {\n hash[dom.src] = true;\n }\n }\n else if(Array.isArray(dom.children)) {\n dom.children.forEach(item => {\n recursion(item, hash);\n });\n }\n let backgroundImage = dom.currentStyle[karas.enums.STYLE_KEY.BACKGROUND_IMAGE];\n if(backgroundImage && /url/i.test(backgroundImage)) {\n let url = /url(\\([^)]+\\))/.exec(backgroundImage);\n if(url) {\n hash[url[1]] = true;\n }\n }\n}\n\nconst IMG_COUNTER = {};\n\nexport default function() {\n class Root extends karas.Root {\n appendTo(dom) {\n if(dom && dom.getContext) {\n this.__dom = dom;\n this.__ctx = dom.getContext('2d');\n }\n else {\n this.__dom = dom.canvas;\n this.__ctx = dom;\n }\n this.__children = karas.builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n this.cache = !!this.props.cache;\n this.__refreshLevel = karas.refresh.level.REFLOW;\n this.__renderMode = karas.mode.CANVAS;\n this.__defs = {\n clear() {},\n };\n this.refresh(null, true);\n if(this.__dom.__root) {\n this.__dom.__root.destroy();\n }\n this.__dom.root = this;\n // 收集img\n let imgHash = {};\n recursion(this, imgHash);\n let imgList = [];\n Object.keys(imgHash).forEach(url => {\n imgList.push(url);\n IMG_COUNTER[url] = IMG_COUNTER[url] || 0;\n IMG_COUNTER[url]++;\n });\n this.__imgList = imgList;\n }\n\n refresh(cb, isFirst) {\n let self = this;\n\n function wrap() {\n self.emit('myRefresh');\n }\n\n super.refresh(wrap, isFirst);\n }\n\n __destroy() {\n super.__destroy();\n if(Array.isArray(this.__imgList)) {\n this.__imgList.forEach(url => {\n if(IMG_COUNTER[url]) {\n IMG_COUNTER[url]--;\n }\n if(!IMG_COUNTER[url]) {\n delete karas.inject.IMG[url];\n }\n });\n }\n }\n }\n\n // Root引用指过来\n let createVd = karas.createVd;\n karas.createVd = function(tagName, props, children) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n return createVd(tagName, props, children);\n };\n\n const IMG = karas.inject.IMG;\n const INIT = karas.inject.INIT;\n const LOADING = karas.inject.LOADING;\n const LOADED = karas.inject.LOADED;\n\n karas.inject.measureImg = function(url, cb, optinos = {}) {\n let { width = 0, height = 0, ctx } = optinos;\n\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb(cache);\n }\n else if(cache.state === LOADING) {\n cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cache.task.push(cb);\n // base64特殊处理\n if(url.indexOf('data:') === 0) {\n let img = ctx.canvas.createImage();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = width || img.width;\n cache.height = height || img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.width = width || img.width;\n cache.height = height || img.height;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.src = url;\n return;\n }\n my.getImageInfo({\n src: url,\n success: function(res) {\n let img = ctx.canvas.createImage();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = res.width || img.width;\n cache.height = res.height || img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.width = res.width || img.width;\n cache.height = res.height || img.height;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.src = url;\n },\n fail: function() {\n let img = ctx.canvas.createImage();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.width = img.width;\n cache.height = img.height;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n img.onload = null;\n img.onerror = null;\n };\n img.src = url;\n // cache.state = LOADED;\n // cache.success = false;\n // cache.url = url;\n // let list = cache.task.splice(0);\n // list.forEach(cb => cb(cache));\n },\n });\n }\n };\n\n karas.inject.isDom = function(o) {\n return o && (o.getContext || o.arc);\n }\n\n const CANVAS = {};\n const CANVAS_LIST = [];\n const WEBGL_LIST = [];\n\n function cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n if(my.createOffscreenCanvas) {\n o = my.createOffscreenCanvas(width, height);\n }\n else {\n o = my._createOffscreenCanvas(width, height);\n }\n }\n }\n else if(!hash[key]) {\n if(my.createOffscreenCanvas) {\n o = hash[key] = my.createOffscreenCanvas(width, height);\n }\n else {\n o = hash[key] = my._createOffscreenCanvas(width, height);\n }\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n return {\n canvas: o,\n ctx: hash === CANVAS ? o.getContext('2d')\n : (o.getContext('webgl') || o.getContext('experimental-webgl')),\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n available: true,\n release() {\n if(!key) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.canvas = null;\n this.ctx = null;\n },\n };\n }\n\n function cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n }\n\n karas.inject.hasCacheCanvas = function(key) {\n return key && CANVAS.hasOwnProperty(key);\n };\n\n karas.inject.getCacheCanvas = function(width, height, key, message) {\n return cacheCanvas(key, width, height, message);\n };\n\n karas.inject.releaseCacheCanvas = function(o) {\n CANVAS_LIST.push(o);\n };\n\n karas.inject.delCacheCanvas = function(key) {\n key && delete CANVAS[key];\n };\n};\n","import karas from 'karas';\nimport { version } from '../package.json';\nimport { isFunction } from './util';\nimport injectCanvas1 from './canvas1';\nimport injectCanvas1n from './canvas1n';\nimport injectCanvas2 from './canvas2';\n\nkaras.inject.requestAnimationFrame = function(cb) {\n return setTimeout(cb, 1000 / 60);\n};\n\nkaras.myVersion = version;\n\nclass Root extends karas.Root {\n static __isCanvas2 = false;\n\n // 需要小程序内部监听事件手动调用\n onEvent(e) {\n this.__wrapEvent(e, data => {\n this.__emitEvent(data);\n });\n }\n\n __wrapEvent(e, cb) {\n const id = this.__ctx?.id || this.__dom?.id;\n id && my.createSelectorQuery().select(`#${id}`).boundingClientRect().exec(ret => {\n let x, y;\n\n if(ret && ret[0] && e.detail) {\n const { clientX, clientY, x: ox, y: oy } = e.detail;\n const { left, top, width, height } = ret[0];\n const { __scx, __scy } = this;\n\n x = ox ?? clientX - left;\n y = oy ?? clientY - top;\n\n if(!karas.util.isNil(__scx)) {\n x /= __scx;\n }\n else {\n x *= this.width / width;\n }\n if(!karas.util.isNil(__scy)) {\n y /= __scy;\n }\n else {\n y *= this.height / height;\n }\n }\n cb({\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n },\n preventDefault() {\n },\n x,\n y,\n __hasEmitted: false,\n });\n });\n }\n\n appendTo(dom) {\n if(isFunction(dom.getContext)) {\n if(Root.__isCanvas2) {\n karas.inject.requestAnimationFrame = dom.requestAnimationFrame.bind(dom) || karas.inject.requestAnimationFrame;\n }\n this.__dom = dom;\n this.__ctx = dom.getContext('2d');\n }\n else {\n this.__dom = {};\n this.__ctx = dom;\n }\n this.__children = karas.builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n this.__refreshLevel = karas.refresh.level.REFLOW;\n this.__renderMode = karas.mode.CANVAS;\n this.__defs = {\n clear() {\n },\n };\n this.refresh(null, true);\n if(this.__dom.__root) {\n this.__dom.__root.destroy();\n }\n this.__dom.__root = this;\n }\n}\n\nconst createVd = karas.createVd;\n\nlet injected = false;\ninjectCanvas1(karas, createVd, Root);\n\nexport function setCanvasType(type) {\n // 只允许注入一次\n if(injected) {\n return;\n }\n injected = true;\n if(type === 'canvas2') {\n Root.__isCanvas2 = true;\n injectCanvas2(karas, createVd, Root);\n }\n else if(type === 'canvas1n') {\n Root.__isCanvas1n = true;\n injectCanvas1n(karas, createVd, Root);\n }\n}\n\nexport default karas;\n"],"names":["toString","isFunction","obj","call","CANVAS","injectCanvas1","karas","createVd","Root","newRoot","cb","isFirst","self","ctx","restore","wrap","draw","emit","tagName","props","children","indexOf","IMG","inject","INIT","LOADING","LOADED","checkSupportFontFamily","measureImg","url","options","width","height","success","value","source","cache","state","task","push","my","getImageInfo","src","res","list","splice","forEach","fail","isDom","o","getContext","arc","hasCacheCanvas","key","hasOwnProperty","getCacheCanvas","w","h","message","Error","canvas","setCacheCanvas","k","v","releaseCacheCanvas","CANVAS_LIST","delCacheCanvas","optinos","recursion","dom","hash","Array","isArray","item","backgroundImage","currentStyle","enums","STYLE_KEY","BACKGROUND_IMAGE","test","exec","IMG_COUNTER","__dom","__ctx","__children","builder","initRoot","__cd","__initProps","__root","__refreshLevel","refresh","level","REFLOW","__renderMode","mode","__defs","clear","destroy","root","imgHash","imgList","Object","keys","__imgList","img","createImage","onload","onerror","WEBGL_LIST","target","length","pop","createOffscreenCanvas","_createOffscreenCanvas","available","release","cacheCanvas","requestAnimationFrame","setTimeout","myVersion","version","e","__wrapEvent","data","__emitEvent","id","createSelectorQuery","select","boundingClientRect","ret","x","y","detail","clientX","clientY","ox","oy","left","top","__scx","__scy","util","isNil","event","stopPropagation","__stopPropagation","stopImmediatePropagation","__stopImmediatePropagation","preventDefault","__hasEmitted","__isCanvas2","bind","injected","setCanvasType","type","injectCanvas2","__isCanvas1n","injectCanvas1n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,QAAQ,GAAG,GAAGA,QAApB;AAEA,AAAO,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAASC,GAAT,EAAc;AACtC,SAAOF,QAAQ,CAACG,IAAT,CAAcD,GAAd,MAAuB,2BAAvB,IAAsDF,QAAQ,CAACG,IAAT,CAAcD,GAAd,MAAuB,mBAApF;AACD,CAFM;;ACFP,IAAME,MAAM,GAAG,EAAf;AACA,AAEe,SAASC,aAAT,CAAuBC,KAAvB,EAA8BC,QAA9B,EAAwCC,IAAxC,EAA8C;AAAA,MACrDC,OADqD;AAAA;;AAAA;;AAAA;AA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