jails-js 5.0.0-beta.8 → 5.0.1

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/dist/jails.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"jails.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,QAAS,GAAIH,GACM,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,MAAM,WACT,M,oHCKA,IAAIC,M,8EAEFA,MADoB,oBAAXC,OACDA,YACmB,IAAX,oBAAAC,EACR,oBAAAA,OAEAC,EAGV,MAAMC,iBAAmBJ,MAEnBK,eAAiB,CACrBC,kBAAmB,IAAIC,OAAO,IAAM,KACpCC,kBAAmB,IAAID,OAAO,IAAK,KACnCE,WAAWC,GACc,mBAATA,EAEhBC,OAAM,CAACC,EAAS,KACPA,EACJC,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,UAEnBC,eAAeF,GACb,MAAM,kBAAEJ,EAAiB,kBAAEF,GAAsBD,eAC3CU,EAAcH,EAAOC,QAAQ,UAAW,IAAIG,OAAOC,MAAM,KACzDC,EAAS,GACf,IAAIC,EACAC,EACAC,EACJ,IAAKD,EAAI,EAAGA,EAAIL,EAAYO,OAAQF,GAAK,EAAG,CAC1C,IACIG,EACAC,EAFAC,EAAOV,EAAYK,GAGvB,GAAU,IAANA,EAASF,EAAOQ,KAAKD,QACpB,GAA0B,IAAtBA,EAAKE,QAAQ,MAAqC,IAAvBF,EAAKE,QAAQ,KAI/C,GAHAJ,EAAyC,IAAtBE,EAAKE,QAAQ,KAAanB,EAAoBF,EACjEkB,EAAqC,IAAtBC,EAAKE,QAAQ,KAAa,IAAM,IAEH,IAAxCF,EAAKG,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AO1T,SAAQmV,GAAKA,EAAE3T,KAAKuR,QAEjDqC,uBACI5T,KAAKoR,aAAae,QAAQnS,KAAKuR,aACxBvR,KAAKoR,oBACLpR,KAAKuR,YACLvR,KAAK0I,SAEhBmL,8BC/EgBC,CAAazZ,EAAQqX,EAAc/K,EAAWD,GAC9DqN,eAAezZ,OAAO2E,EAAM6S,Q","sources":["webpack://jails/webpack/universalModuleDefinition","webpack://jails/./node_modules/template7/dist/template7.esm.js","webpack://jails/webpack/bootstrap","webpack://jails/webpack/runtime/define property getters","webpack://jails/webpack/runtime/global","webpack://jails/webpack/runtime/hasOwnProperty shorthand","webpack://jails/webpack/runtime/make namespace object","webpack://jails/./src/template-system.ts","webpack://jails/./src/utils/index.js","webpack://jails/./src/utils/events.js","webpack://jails/./src/utils/pubsub.js","webpack://jails/./node_modules/morphdom/dist/morphdom-esm.js","webpack://jails/./src/component.ts","webpack://jails/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"jails\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"jails\"] = factory();\n\telse\n\t\troot[\"jails\"] = factory();\n})(self, function() {\nreturn ","/**\n * Template7 1.4.2\n * Mobile-first HTML template engine\n * \n * http://www.idangero.us/template7/\n * \n * Copyright 2019, Vladimir Kharlampidi\n * The iDangero.us\n * http://www.idangero.us/\n * \n * Licensed under MIT\n * \n * Released on: June 14, 2019\n */\n\nlet t7ctx;\nif (typeof window !== 'undefined') {\n t7ctx = window;\n} else if (typeof global !== 'undefined') {\n t7ctx = global;\n} else {\n t7ctx = undefined;\n}\n\nconst Template7Context = t7ctx;\n\nconst Template7Utils = {\n quoteSingleRexExp: new RegExp('\\'', 'g'),\n quoteDoubleRexExp: new RegExp('\"', 'g'),\n isFunction(func) {\n return typeof func === 'function';\n },\n escape(string = '') {\n return string\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;');\n },\n helperToSlices(string) {\n const { quoteDoubleRexExp, quoteSingleRexExp } = Template7Utils;\n const helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');\n const slices = [];\n let shiftIndex;\n let i;\n let j;\n for (i = 0; i < helperParts.length; i += 1) {\n let part = helperParts[i];\n let blockQuoteRegExp;\n let openingQuote;\n if (i === 0) slices.push(part);\n else if (part.indexOf('\"') === 0 || part.indexOf('\\'') === 0) {\n blockQuoteRegExp = part.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = part.indexOf('\"') === 0 ? '\"' : '\\'';\n // Plain String\n if (part.match(blockQuoteRegExp).length === 2) {\n // One word string\n slices.push(part);\n } else {\n // Find closed Index\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n part += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n slices.push(part);\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n } else if (part.indexOf('=') > 0) {\n // Hash\n const hashParts = part.split('=');\n const hashName = hashParts[0];\n let hashContent = hashParts[1];\n if (!blockQuoteRegExp) {\n blockQuoteRegExp = hashContent.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = hashContent.indexOf('\"') === 0 ? '\"' : '\\'';\n }\n if (hashContent.match(blockQuoteRegExp).length !== 2) {\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n hashContent += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n const hash = [hashName, hashContent.replace(blockQuoteRegExp, '')];\n slices.push(hash);\n } else {\n // Plain variable\n slices.push(part);\n }\n }\n return slices;\n },\n stringToBlocks(string) {\n const blocks = [];\n let i;\n let j;\n if (!string) return [];\n const stringBlocks = string.split(/({{[^{^}]*}})/);\n for (i = 0; i < stringBlocks.length; i += 1) {\n let block = stringBlocks[i];\n if (block === '') continue;\n if (block.indexOf('{{') < 0) {\n blocks.push({\n type: 'plain',\n content: block,\n });\n } else {\n if (block.indexOf('{/') >= 0) {\n continue;\n }\n block = block\n .replace(/{{([#/])*([ ])*/, '{{$1')\n .replace(/([ ])*}}/, '}}');\n if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {\n // Simple variable\n blocks.push({\n type: 'variable',\n contextName: block.replace(/[{}]/g, ''),\n });\n continue;\n }\n // Helpers\n const helperSlices = Template7Utils.helperToSlices(block);\n let helperName = helperSlices[0];\n const isPartial = helperName === '>';\n const helperContext = [];\n const helperHash = {};\n for (j = 1; j < helperSlices.length; j += 1) {\n const slice = helperSlices[j];\n if (Array.isArray(slice)) {\n // Hash\n helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];\n } else {\n helperContext.push(slice);\n }\n }\n\n if (block.indexOf('{#') >= 0) {\n // Condition/Helper\n let helperContent = '';\n let elseContent = '';\n let toSkip = 0;\n let shiftIndex;\n let foundClosed = false;\n let foundElse = false;\n let depth = 0;\n for (j = i + 1; j < stringBlocks.length; j += 1) {\n if (stringBlocks[j].indexOf('{{#') >= 0) {\n depth += 1;\n }\n if (stringBlocks[j].indexOf('{{/') >= 0) {\n depth -= 1;\n }\n if (stringBlocks[j].indexOf(`{{#${helperName}`) >= 0) {\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n toSkip += 1;\n } else if (stringBlocks[j].indexOf(`{{/${helperName}`) >= 0) {\n if (toSkip > 0) {\n toSkip -= 1;\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n } else {\n shiftIndex = j;\n foundClosed = true;\n break;\n }\n } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) {\n foundElse = true;\n } else {\n if (!foundElse) helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n }\n }\n if (foundClosed) {\n if (shiftIndex) i = shiftIndex;\n if (helperName === 'raw') {\n blocks.push({\n type: 'plain',\n content: helperContent,\n });\n } else {\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n content: helperContent,\n inverseContent: elseContent,\n hash: helperHash,\n });\n }\n }\n } else if (block.indexOf(' ') > 0) {\n if (isPartial) {\n helperName = '_partial';\n if (helperContext[0]) {\n if (helperContext[0].indexOf('[') === 0) helperContext[0] = helperContext[0].replace(/[[\\]]/g, '');\n else helperContext[0] = `\"${helperContext[0].replace(/\"|'/g, '')}\"`;\n }\n }\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n hash: helperHash,\n });\n }\n }\n }\n return blocks;\n },\n parseJsVariable(expression, replace, object) {\n return expression.split(/([+ \\-*/^()&=|<>!%:?])/g).reduce((arr, part) => {\n if (!part) {\n return arr;\n }\n if (part.indexOf(replace) < 0) {\n arr.push(part);\n return arr;\n }\n if (!object) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n let variable = object;\n if (part.indexOf(`${replace}.`) >= 0) {\n part.split(`${replace}.`)[1].split('.').forEach((partName) => {\n if (partName in variable) variable = variable[partName];\n else variable = undefined;\n });\n }\n if (\n (typeof variable === 'string')\n || Array.isArray(variable)\n || (variable.constructor && variable.constructor === Object)\n ) {\n variable = JSON.stringify(variable);\n }\n if (variable === undefined) variable = 'undefined';\n\n arr.push(variable);\n return arr;\n }, []).join('');\n\n },\n parseJsParents(expression, parents) {\n return expression.split(/([+ \\-*^()&=|<>!%:?])/g).reduce((arr, part) => {\n if (!part) {\n return arr;\n }\n\n if (part.indexOf('../') < 0) {\n arr.push(part);\n return arr;\n }\n\n if (!parents || parents.length === 0) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n const levelsUp = part.split('../').length - 1;\n const parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1];\n\n let variable = parentData;\n const parentPart = part.replace(/..\\//g, '');\n parentPart.split('.').forEach((partName) => {\n if (typeof variable[partName] !== 'undefined') variable = variable[partName];\n else variable = 'undefined';\n });\n if (variable === false || variable === true) {\n arr.push(JSON.stringify(variable));\n return arr;\n }\n if (variable === null || variable === 'undefined') {\n arr.push(JSON.stringify(''));\n return arr;\n }\n arr.push(JSON.stringify(variable));\n return arr;\n }, []).join('');\n },\n getCompileVar(name, ctx, data = 'data_1') {\n let variable = ctx;\n let parts;\n let levelsUp = 0;\n let newDepth;\n if (name.indexOf('../') === 0) {\n levelsUp = name.split('../').length - 1;\n newDepth = variable.split('_')[1] - levelsUp;\n variable = `ctx_${newDepth >= 1 ? newDepth : 1}`;\n parts = name.split('../')[levelsUp].split('.');\n } else if (name.indexOf('@global') === 0) {\n variable = 'Template7.global';\n parts = name.split('@global.')[1].split('.');\n } else if (name.indexOf('@root') === 0) {\n variable = 'root';\n parts = name.split('@root.')[1].split('.');\n } else {\n parts = name.split('.');\n }\n for (let i = 0; i < parts.length; i += 1) {\n const part = parts[i];\n if (part.indexOf('@') === 0) {\n let dataLevel = data.split('_')[1];\n if (levelsUp > 0) {\n dataLevel = newDepth;\n }\n if (i > 0) {\n variable += `[(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})]`;\n } else {\n variable = `(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})`;\n }\n } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) {\n variable += `[${part}]`;\n } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) {\n variable = part.replace('this', ctx);\n } else {\n variable += `.${part}`;\n }\n }\n return variable;\n },\n getCompiledArguments(contextArray, ctx, data) {\n const arr = [];\n for (let i = 0; i < contextArray.length; i += 1) {\n if (/^['\"]/.test(contextArray[i])) arr.push(contextArray[i]);\n else if (/^(true|false|\\d+)$/.test(contextArray[i])) arr.push(contextArray[i]);\n else {\n arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data));\n }\n }\n\n return arr.join(', ');\n },\n};\n\n/* eslint no-eval: \"off\" */\n\nconst Template7Helpers = {\n _partial(partialName, options) {\n const ctx = this;\n const p = Template7Class.partials[partialName];\n if (!p || (p && !p.template)) return '';\n if (!p.compiled) {\n p.compiled = new Template7Class(p.template).compile();\n }\n Object.keys(options.hash).forEach((hashName) => {\n ctx[hashName] = options.hash[hashName];\n });\n return p.compiled(ctx, options.data, options.root);\n },\n escape(context) {\n if (typeof context === 'undefined' || context === null) return '';\n if (typeof context !== 'string') {\n throw new Error('Template7: Passed context to \"escape\" helper should be a string');\n }\n return Template7Utils.escape(context);\n },\n if(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n unless(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (!ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n each(context, options) {\n let ctx = context;\n let ret = '';\n let i = 0;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (Array.isArray(ctx)) {\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n for (i = 0; i < ctx.length; i += 1) {\n ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i });\n }\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n } else {\n // eslint-disable-next-line\n for (const key in ctx) {\n i += 1;\n ret += options.fn(ctx[key], { key });\n }\n }\n if (i > 0) return ret;\n return options.inverse(this);\n },\n with(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); }\n return options.fn(ctx);\n },\n join(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n return ctx.join(options.hash.delimiter || options.hash.delimeter);\n },\n js(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n return eval(func).call(this);\n },\n js_if(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n const condition = eval(func).call(this);\n if (condition) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n};\nTemplate7Helpers.js_compare = Template7Helpers.js_if;\n\nconst Template7Options = {};\nconst Template7Partials = {};\n\nclass Template7Class {\n constructor(template) {\n const t = this;\n t.template = template;\n }\n compile(template = this.template, depth = 1) {\n const t = this;\n if (t.compiled) return t.compiled;\n\n if (typeof template !== 'string') {\n throw new Error('Template7: Template must be a string');\n }\n const { stringToBlocks, getCompileVar, getCompiledArguments } = Template7Utils;\n\n const blocks = stringToBlocks(template);\n const ctx = `ctx_${depth}`;\n const data = `data_${depth}`;\n if (blocks.length === 0) {\n return function empty() { return ''; };\n }\n\n function getCompileFn(block, newDepth) {\n if (block.content) return t.compile(block.content, newDepth);\n return function empty() { return ''; };\n }\n function getCompileInverse(block, newDepth) {\n if (block.inverseContent) return t.compile(block.inverseContent, newDepth);\n return function empty() { return ''; };\n }\n\n let resultString = '';\n if (depth === 1) {\n resultString += `(function (${ctx}, ${data}, root) {\\n`;\n } else {\n resultString += `(function (${ctx}, ${data}) {\\n`;\n }\n if (depth === 1) {\n resultString += 'function isArray(arr){return Array.isArray(arr);}\\n';\n resultString += 'function isFunction(func){return (typeof func === \\'function\\');}\\n';\n resultString += 'function c(val, ctx) {if (typeof val !== \"undefined\" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return \"\";}\\n';\n resultString += 'root = root || ctx_1 || {};\\n';\n }\n resultString += 'var r = \\'\\';\\n';\n let i;\n for (i = 0; i < blocks.length; i += 1) {\n const block = blocks[i];\n // Plain block\n if (block.type === 'plain') {\n // eslint-disable-next-line\n resultString += `r +='${(block.content).replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/'/g, '\\\\' + '\\'')}';`;\n continue;\n }\n let variable;\n let compiledArguments;\n // Variable block\n if (block.type === 'variable') {\n variable = getCompileVar(block.contextName, ctx, data);\n resultString += `r += c(${variable}, ${ctx});`;\n }\n // Helpers block\n if (block.type === 'helper') {\n let parents;\n if (ctx !== 'ctx_1') {\n const level = ctx.split('_')[1];\n let parentsString = `ctx_${level - 1}`;\n for (let j = level - 2; j >= 1; j -= 1) {\n parentsString += `, ctx_${j}`;\n }\n parents = `[${parentsString}]`;\n } else {\n parents = `[${ctx}]`;\n }\n let dynamicHelper;\n if (block.helperName.indexOf('[') === 0) {\n block.helperName = getCompileVar(block.helperName.replace(/[[\\]]/g, ''), ctx, data);\n dynamicHelper = true;\n }\n if (dynamicHelper || block.helperName in Template7Helpers) {\n compiledArguments = getCompiledArguments(block.contextName, ctx, data);\n resultString += `r += (Template7Helpers${dynamicHelper ? `[${block.helperName}]` : `.${block.helperName}`}).call(${ctx}, ${compiledArguments && (`${compiledArguments}, `)}{hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n } else if (block.contextName.length > 0) {\n throw new Error(`Template7: Missing helper: \"${block.helperName}\"`);\n } else {\n variable = getCompileVar(block.helperName, ctx, data);\n resultString += `if (${variable}) {`;\n resultString += `if (isArray(${variable})) {`;\n resultString += `r += (Template7Helpers.each).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}else {';\n resultString += `r += (Template7Helpers.with).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}}';\n }\n }\n }\n resultString += '\\nreturn r;})';\n\n if (depth === 1) {\n // eslint-disable-next-line\n t.compiled = eval(resultString);\n return t.compiled;\n }\n return resultString;\n }\n static get options() {\n return Template7Options;\n }\n static get partials() {\n return Template7Partials;\n }\n static get helpers() {\n return Template7Helpers;\n }\n}\n\nfunction Template7(...args) {\n const [template, data] = args;\n if (args.length === 2) {\n let instance = new Template7Class(template);\n const rendered = instance.compile()(data);\n instance = null;\n return (rendered);\n }\n return new Template7Class(template);\n}\nTemplate7.registerHelper = function registerHelper(name, fn) {\n Template7Class.helpers[name] = fn;\n};\nTemplate7.unregisterHelper = function unregisterHelper(name) {\n Template7Class.helpers[name] = undefined;\n delete Template7Class.helpers[name];\n};\nTemplate7.registerPartial = function registerPartial(name, template) {\n Template7Class.partials[name] = { template };\n};\nTemplate7.unregisterPartial = function unregisterPartial(name) {\n if (Template7Class.partials[name]) {\n Template7Class.partials[name] = undefined;\n delete Template7Class.partials[name];\n }\n};\nTemplate7.compile = function compile(template, options) {\n const instance = new Template7Class(template, options);\n return instance.compile();\n};\n\nTemplate7.options = Template7Class.options;\nTemplate7.helpers = Template7Class.helpers;\nTemplate7.partials = Template7Class.partials;\n\nexport default Template7;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import template7 from 'template7';\nimport { stripTemplateTag, decodeHtmlEntities } from './utils';\nexport default function templateSystem(element) {\n const directives = [htmlRepeatAndIf];\n const vdom = element.cloneNode(true);\n stripTemplateTag(vdom);\n const newvdom = directives.reduce((_, directive) => directive(vdom), vdom);\n const html = newvdom.outerHTML.replace(/html-/g, '');\n const template = template7.compile(html);\n return (data) => {\n return template(data);\n };\n}\n/**@Directives */\nconst htmlRepeatAndIf = (vdom) => {\n const nodes = Array\n .from(vdom.querySelectorAll('[html-repeat],[html-if]'))\n .reverse();\n if (nodes.length) {\n nodes.forEach(node => {\n if (node.getAttribute('html-repeat')) {\n const instruction = node.getAttribute('html-repeat');\n node.removeAttribute('html-repeat');\n node.setAttribute('scope', '{{scope this}}');\n const open = document.createTextNode(`{{#each ${instruction}}}`);\n const close = document.createTextNode('{{/each}}');\n node.parentNode.insertBefore(open, node);\n node.parentNode.insertBefore(close, node.nextSibling);\n }\n else if (node.getAttribute('html-if')) {\n const instruction = node.getAttribute('html-if');\n node.removeAttribute('html-if');\n node.setAttribute('scope', '{{scope this}}');\n const open = document.createTextNode(`{{#ifexp \"${instruction}\"}}`);\n const close = document.createTextNode('{{/ifexp}}');\n node.parentNode.insertBefore(open, node);\n node.parentNode.insertBefore(close, node.nextSibling);\n }\n });\n }\n return vdom;\n};\n/**@Global Settings */\ntemplate7.global = {};\n/**@Helpers */\ntemplate7.registerHelper('scope', (context, options) => {\n const { data } = options;\n const { first, index, last, root } = data;\n const scope = Object.assign(Object.assign({}, context), { ['$first']: first, ['$index']: index, ['$last']: last, ['$parent']: root });\n return JSON.stringify(scope).replace(/\\\"/g, '\\'');\n});\ntemplate7.registerHelper('ifexp', function (value, options) {\n const condition = decodeHtmlEntities(value);\n const { root, data } = options;\n try {\n const expression = (new Function('root', `with(root){ return ${condition} }`)).call(root, root);\n return expression ? options.fn(this, data) : options.inverse(this, data);\n }\n catch (err) {\n return options.inverse(this, data);\n }\n});\n","import templateSystem from '../template-system'\n\nexport const rAF = (fn) => {\n\t(requestAnimationFrame || setTimeout)(fn, 1000 / 60)\n}\n\nexport const uuid = () => {\n\treturn 'xxxxxxxx'.replace(/[xy]/g, (c) => {\n\t\tconst r = Math.random() * 8 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)\n\t\treturn v.toString(8)\n\t})\n}\n\nexport const stripTemplateTag = (element) => {\n\tconst templates = Array.from(element.querySelectorAll('template'))\n\t// https://gist.github.com/harmenjanssen/07e425248779c65bc5d11b02fb913274\n\ttemplates.forEach(template => {\n\t\ttemplate.parentNode.replaceChild(template.content, template)\n\t\tstripTemplateTag(template.content)\n\t})\n}\n\nexport const dup = (o) => {\n\treturn JSON.parse(JSON.stringify(o))\n}\n\nexport const createTemplate = (html, templates) => {\n\n\tconst vroot = document.createElement('div')\n\tvroot.innerHTML = html\n\tstripTemplateTag(vroot)\n\n\tArray\n\t\t.from(vroot.querySelectorAll('[data-component]'))\n\t\t.forEach(c => {\n\t\t\tconst tplid = c.getAttribute('tplid')\n\t\t\tconst cache = templates[tplid]\n\t\t\tif (cache)\n\t\t\t\tc.outerHTML = cache\n\t\t})\n\n\treturn vroot.innerHTML\n}\n\nexport const createTemplateId = (element, templates) => {\n\n\tconst tplid = element.getAttribute('tplid')\n\n\tif (!tplid) {\n\t\tconst id = uuid()\n\t\telement.setAttribute('tplid', id)\n\t\ttemplates[id] = templateSystem(element)\n\t\treturn templates[id]\n\t}\n\n\treturn templates[tplid]\n}\n\nexport const buildtemplates = (target, components, templates) => {\n\n\treturn Array\n\t\t.from(target.querySelectorAll('*'))\n\t\t.filter(node => node.tagName.toLocaleLowerCase() in components)\n\t\t.reverse()\n\t\t.map(node => {\n\t\t\tcreateTemplateId(node, templates)\n\t\t\treturn node\n\t\t})\n}\n\nexport const decodeHtmlEntities = (str) => {\n\tconst textarea = document.createElement('textarea')\n\ttextarea.innerHTML = str\n\treturn textarea.value\n}\n","const customEvent = (() => {\n\treturn ('CustomEvent' in window && typeof window.CustomEvent === 'function')\n\t\t? (name, data) => new CustomEvent(name, data)\n\t\t: (name, data) => {\n\t\t\tconst newEvent = document.createEvent('CustomEvent')\n\t\t\tnewEvent.initCustomEvent(name, true, true, data)\n\t\t\treturn newEvent\n\t\t}\n})()\n\nconst handler = (node, ev) => {\n\treturn function (e) {\n\t\tconst scope = this\n\t\tconst detail = e.detail || {}\n\t\tnode.__events[ev].forEach(o => {\n\t\t\to.handler.apply(scope, [e].concat(detail.args))\n\t\t})\n\t}\n}\n\nconst removeListener = (node, ev) => {\n\tif (node.__events[ev] && node.__events[ev].listener) {\n\t\tnode.removeEventListener(\n\t\t\tev,\n\t\t\tnode.__events[ev].listener,\n\t\t\t(ev == 'focus' || ev == 'blur' || ev == 'mouseenter' || ev == 'mouseleave'))\n\t\tdelete node.__events[ev]\n\t}\n}\n\nconst delegate = (node, selector, callback) => {\n\treturn function (e) {\n\n\t\tconst element = this\n\t\tconst detail = e.detail || {}\n\n\t\tlet parent = e.target\n\n\t\twhile (parent) {\n\t\t\tif (parent.matches(selector)) {\n\t\t\t\te.delegateTarget = parent\n\t\t\t\tcallback.apply(element, [e].concat(detail.args))\n\t\t\t}\n\t\t\tif( parent === node ) break\n\t\t\tparent = parent.parentNode\n\t\t}\n\t}\n}\n\nexport const on = (node, ev, selectorOrCallback, callback) => {\n\n\tnode.__events = node.__events || {}\n\tnode.__events[ev] = (node.__events[ev] || [])\n\n\tif (!node.__events[ev].length) {\n\t\tconst fn = handler(node, ev)\n\t\tnode.addEventListener(\n\t\t\tev,\n\t\t\tfn,\n\t\t\t(ev == 'focus' || ev == 'blur' || ev == 'mouseenter' || ev == 'mouseleave'))\n\t\tnode.__events[ev].listener = fn\n\t}\n\n\tif (selectorOrCallback.call) {\n\t\tnode.__events[ev].push({ handler: selectorOrCallback, callback: selectorOrCallback })\n\t} else {\n\t\tnode.__events[ev].push({ handler: delegate(node, selectorOrCallback, callback), callback })\n\t}\n}\n\nexport const off = (node, ev, fn) => {\n\n\tif (fn && node.__events[ev] && node.__events[ev].length) {\n\t\tvar old = node.__events[ev]\n\t\tnode.__events[ev] = node.__events[ev].filter(function (o) { return o.callback != fn; })\n\t\tnode.__events[ev].listener = old.listener\n\t\tif (!node.__events[ev].length)\n\t\t\tremoveListener(node, ev)\n\t} else {\n\t\tremoveListener(node, ev)\n\t}\n}\n\nexport const trigger = (node, name, args) => {\n\tnode.dispatchEvent(customEvent(name, { bubbles: true, detail: args }))\n}\n","const topics = {}\nconst _async = {}\n\nexport const publish = (name, params) => {\n\t_async[name] = Object.assign({}, _async[name], params)\n\tif( topics[name] )\n\t\ttopics[name].forEach(topic => topic(params))\n}\n\nexport const subscribe = (name, method) => {\n\ttopics[name] = topics[name] || []\n\ttopics[name].push(method)\n\tif ( name in _async ) {\n\t\tmethod(_async[name])\n\t}\n}\n\nexport const unsubscribe = (topic) => {\n\ttopics[topic.name] = (topics[topic.name] || [])\n\t\t.filter(t => t != topic.method)\n\tif (!topics[topic.name].length) {\n\t\tdelete topics[topic.name]\n\t\tdelete _async[topic.name]\n\t}\n}\n","var DOCUMENT_FRAGMENT_NODE = 11;\n\nfunction morphAttrs(fromNode, toNode) {\n var toNodeAttrs = toNode.attributes;\n var attr;\n var attrName;\n var attrNamespaceURI;\n var attrValue;\n var fromValue;\n\n // document-fragments dont have attributes so lets not do anything\n if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {\n return;\n }\n\n // update attributes on original DOM element\n for (var i = toNodeAttrs.length - 1; i >= 0; i--) {\n attr = toNodeAttrs[i];\n attrName = attr.name;\n attrNamespaceURI = attr.namespaceURI;\n attrValue = attr.value;\n\n if (attrNamespaceURI) {\n attrName = attr.localName || attrName;\n fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);\n\n if (fromValue !== attrValue) {\n if (attr.prefix === 'xmlns'){\n attrName = attr.name; // It's not allowed to set an attribute with the XMLNS namespace without specifying the `xmlns` prefix\n }\n fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);\n }\n } else {\n fromValue = fromNode.getAttribute(attrName);\n\n if (fromValue !== attrValue) {\n fromNode.setAttribute(attrName, attrValue);\n }\n }\n }\n\n // Remove any extra attributes found on the original DOM element that\n // weren't found on the target element.\n var fromNodeAttrs = fromNode.attributes;\n\n for (var d = fromNodeAttrs.length - 1; d >= 0; d--) {\n attr = fromNodeAttrs[d];\n attrName = attr.name;\n attrNamespaceURI = attr.namespaceURI;\n\n if (attrNamespaceURI) {\n attrName = attr.localName || attrName;\n\n if (!toNode.hasAttributeNS(attrNamespaceURI, attrName)) {\n fromNode.removeAttributeNS(attrNamespaceURI, attrName);\n }\n } else {\n if (!toNode.hasAttribute(attrName)) {\n fromNode.removeAttribute(attrName);\n }\n }\n }\n}\n\nvar range; // Create a range object for efficently rendering strings to elements.\nvar NS_XHTML = 'http://www.w3.org/1999/xhtml';\n\nvar doc = typeof document === 'undefined' ? undefined : document;\nvar HAS_TEMPLATE_SUPPORT = !!doc && 'content' in doc.createElement('template');\nvar HAS_RANGE_SUPPORT = !!doc && doc.createRange && 'createContextualFragment' in doc.createRange();\n\nfunction createFragmentFromTemplate(str) {\n var template = doc.createElement('template');\n template.innerHTML = str;\n return template.content.childNodes[0];\n}\n\nfunction createFragmentFromRange(str) {\n if (!range) {\n range = doc.createRange();\n range.selectNode(doc.body);\n }\n\n var fragment = range.createContextualFragment(str);\n return fragment.childNodes[0];\n}\n\nfunction createFragmentFromWrap(str) {\n var fragment = doc.createElement('body');\n fragment.innerHTML = str;\n return fragment.childNodes[0];\n}\n\n/**\n * This is about the same\n * var html = new DOMParser().parseFromString(str, 'text/html');\n * return html.body.firstChild;\n *\n * @method toElement\n * @param {String} str\n */\nfunction toElement(str) {\n str = str.trim();\n if (HAS_TEMPLATE_SUPPORT) {\n // avoid restrictions on content for things like `<tr><th>Hi</th></tr>` which\n // createContextualFragment doesn't support\n // <template> support not available in IE\n return createFragmentFromTemplate(str);\n } else if (HAS_RANGE_SUPPORT) {\n return createFragmentFromRange(str);\n }\n\n return createFragmentFromWrap(str);\n}\n\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n * nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */\nfunction compareNodeNames(fromEl, toEl) {\n var fromNodeName = fromEl.nodeName;\n var toNodeName = toEl.nodeName;\n var fromCodeStart, toCodeStart;\n\n if (fromNodeName === toNodeName) {\n return true;\n }\n\n fromCodeStart = fromNodeName.charCodeAt(0);\n toCodeStart = toNodeName.charCodeAt(0);\n\n // If the target element is a virtual DOM node or SVG node then we may\n // need to normalize the tag name before comparing. Normal HTML elements that are\n // in the \"http://www.w3.org/1999/xhtml\"\n // are converted to upper case\n if (fromCodeStart <= 90 && toCodeStart >= 97) { // from is upper and to is lower\n return fromNodeName === toNodeName.toUpperCase();\n } else if (toCodeStart <= 90 && fromCodeStart >= 97) { // to is upper and from is lower\n return toNodeName === fromNodeName.toUpperCase();\n } else {\n return false;\n }\n}\n\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */\nfunction createElementNS(name, namespaceURI) {\n return !namespaceURI || namespaceURI === NS_XHTML ?\n doc.createElement(name) :\n doc.createElementNS(namespaceURI, name);\n}\n\n/**\n * Copies the children of one DOM element to another DOM element\n */\nfunction moveChildren(fromEl, toEl) {\n var curChild = fromEl.firstChild;\n while (curChild) {\n var nextChild = curChild.nextSibling;\n toEl.appendChild(curChild);\n curChild = nextChild;\n }\n return toEl;\n}\n\nfunction syncBooleanAttrProp(fromEl, toEl, name) {\n if (fromEl[name] !== toEl[name]) {\n fromEl[name] = toEl[name];\n if (fromEl[name]) {\n fromEl.setAttribute(name, '');\n } else {\n fromEl.removeAttribute(name);\n }\n }\n}\n\nvar specialElHandlers = {\n OPTION: function(fromEl, toEl) {\n var parentNode = fromEl.parentNode;\n if (parentNode) {\n var parentName = parentNode.nodeName.toUpperCase();\n if (parentName === 'OPTGROUP') {\n parentNode = parentNode.parentNode;\n parentName = parentNode && parentNode.nodeName.toUpperCase();\n }\n if (parentName === 'SELECT' && !parentNode.hasAttribute('multiple')) {\n if (fromEl.hasAttribute('selected') && !toEl.selected) {\n // Workaround for MS Edge bug where the 'selected' attribute can only be\n // removed if set to a non-empty value:\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12087679/\n fromEl.setAttribute('selected', 'selected');\n fromEl.removeAttribute('selected');\n }\n // We have to reset select element's selectedIndex to -1, otherwise setting\n // fromEl.selected using the syncBooleanAttrProp below has no effect.\n // The correct selectedIndex will be set in the SELECT special handler below.\n parentNode.selectedIndex = -1;\n }\n }\n syncBooleanAttrProp(fromEl, toEl, 'selected');\n },\n /**\n * The \"value\" attribute is special for the <input> element since it sets\n * the initial value. Changing the \"value\" attribute without changing the\n * \"value\" property will have no effect since it is only used to the set the\n * initial value. Similar for the \"checked\" attribute, and \"disabled\".\n */\n INPUT: function(fromEl, toEl) {\n syncBooleanAttrProp(fromEl, toEl, 'checked');\n syncBooleanAttrProp(fromEl, toEl, 'disabled');\n\n if (fromEl.value !== toEl.value) {\n fromEl.value = toEl.value;\n }\n\n if (!toEl.hasAttribute('value')) {\n fromEl.removeAttribute('value');\n }\n },\n\n TEXTAREA: function(fromEl, toEl) {\n var newValue = toEl.value;\n if (fromEl.value !== newValue) {\n fromEl.value = newValue;\n }\n\n var firstChild = fromEl.firstChild;\n if (firstChild) {\n // Needed for IE. Apparently IE sets the placeholder as the\n // node value and vise versa. This ignores an empty update.\n var oldValue = firstChild.nodeValue;\n\n if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) {\n return;\n }\n\n firstChild.nodeValue = newValue;\n }\n },\n SELECT: function(fromEl, toEl) {\n if (!toEl.hasAttribute('multiple')) {\n var selectedIndex = -1;\n var i = 0;\n // We have to loop through children of fromEl, not toEl since nodes can be moved\n // from toEl to fromEl directly when morphing.\n // At the time this special handler is invoked, all children have already been morphed\n // and appended to / removed from fromEl, so using fromEl here is safe and correct.\n var curChild = fromEl.firstChild;\n var optgroup;\n var nodeName;\n while(curChild) {\n nodeName = curChild.nodeName && curChild.nodeName.toUpperCase();\n if (nodeName === 'OPTGROUP') {\n optgroup = curChild;\n curChild = optgroup.firstChild;\n } else {\n if (nodeName === 'OPTION') {\n if (curChild.hasAttribute('selected')) {\n selectedIndex = i;\n break;\n }\n i++;\n }\n curChild = curChild.nextSibling;\n if (!curChild && optgroup) {\n curChild = optgroup.nextSibling;\n optgroup = null;\n }\n }\n }\n\n fromEl.selectedIndex = selectedIndex;\n }\n }\n};\n\nvar ELEMENT_NODE = 1;\nvar DOCUMENT_FRAGMENT_NODE$1 = 11;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\n\nfunction noop() {}\n\nfunction defaultGetNodeKey(node) {\n if (node) {\n return (node.getAttribute && node.getAttribute('id')) || node.id;\n }\n}\n\nfunction morphdomFactory(morphAttrs) {\n\n return function morphdom(fromNode, toNode, options) {\n if (!options) {\n options = {};\n }\n\n if (typeof toNode === 'string') {\n if (fromNode.nodeName === '#document' || fromNode.nodeName === 'HTML' || fromNode.nodeName === 'BODY') {\n var toNodeHtml = toNode;\n toNode = doc.createElement('html');\n toNode.innerHTML = toNodeHtml;\n } else {\n toNode = toElement(toNode);\n }\n }\n\n var getNodeKey = options.getNodeKey || defaultGetNodeKey;\n var onBeforeNodeAdded = options.onBeforeNodeAdded || noop;\n var onNodeAdded = options.onNodeAdded || noop;\n var onBeforeElUpdated = options.onBeforeElUpdated || noop;\n var onElUpdated = options.onElUpdated || noop;\n var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || noop;\n var onNodeDiscarded = options.onNodeDiscarded || noop;\n var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || noop;\n var childrenOnly = options.childrenOnly === true;\n\n // This object is used as a lookup to quickly find all keyed elements in the original DOM tree.\n var fromNodesLookup = Object.create(null);\n var keyedRemovalList = [];\n\n function addKeyedRemoval(key) {\n keyedRemovalList.push(key);\n }\n\n function walkDiscardedChildNodes(node, skipKeyedNodes) {\n if (node.nodeType === ELEMENT_NODE) {\n var curChild = node.firstChild;\n while (curChild) {\n\n var key = undefined;\n\n if (skipKeyedNodes && (key = getNodeKey(curChild))) {\n // If we are skipping keyed nodes then we add the key\n // to a list so that it can be handled at the very end.\n addKeyedRemoval(key);\n } else {\n // Only report the node as discarded if it is not keyed. We do this because\n // at the end we loop through all keyed elements that were unmatched\n // and then discard them in one final pass.\n onNodeDiscarded(curChild);\n if (curChild.firstChild) {\n walkDiscardedChildNodes(curChild, skipKeyedNodes);\n }\n }\n\n curChild = curChild.nextSibling;\n }\n }\n }\n\n /**\n * Removes a DOM node out of the original DOM\n *\n * @param {Node} node The node to remove\n * @param {Node} parentNode The nodes parent\n * @param {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.\n * @return {undefined}\n */\n function removeNode(node, parentNode, skipKeyedNodes) {\n if (onBeforeNodeDiscarded(node) === false) {\n return;\n }\n\n if (parentNode) {\n parentNode.removeChild(node);\n }\n\n onNodeDiscarded(node);\n walkDiscardedChildNodes(node, skipKeyedNodes);\n }\n\n // // TreeWalker implementation is no faster, but keeping this around in case this changes in the future\n // function indexTree(root) {\n // var treeWalker = document.createTreeWalker(\n // root,\n // NodeFilter.SHOW_ELEMENT);\n //\n // var el;\n // while((el = treeWalker.nextNode())) {\n // var key = getNodeKey(el);\n // if (key) {\n // fromNodesLookup[key] = el;\n // }\n // }\n // }\n\n // // NodeIterator implementation is no faster, but keeping this around in case this changes in the future\n //\n // function indexTree(node) {\n // var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT);\n // var el;\n // while((el = nodeIterator.nextNode())) {\n // var key = getNodeKey(el);\n // if (key) {\n // fromNodesLookup[key] = el;\n // }\n // }\n // }\n\n function indexTree(node) {\n if (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE$1) {\n var curChild = node.firstChild;\n while (curChild) {\n var key = getNodeKey(curChild);\n if (key) {\n fromNodesLookup[key] = curChild;\n }\n\n // Walk recursively\n indexTree(curChild);\n\n curChild = curChild.nextSibling;\n }\n }\n }\n\n indexTree(fromNode);\n\n function handleNodeAdded(el) {\n onNodeAdded(el);\n\n var curChild = el.firstChild;\n while (curChild) {\n var nextSibling = curChild.nextSibling;\n\n var key = getNodeKey(curChild);\n if (key) {\n var unmatchedFromEl = fromNodesLookup[key];\n // if we find a duplicate #id node in cache, replace `el` with cache value\n // and morph it to the child node.\n if (unmatchedFromEl && compareNodeNames(curChild, unmatchedFromEl)) {\n curChild.parentNode.replaceChild(unmatchedFromEl, curChild);\n morphEl(unmatchedFromEl, curChild);\n } else {\n handleNodeAdded(curChild);\n }\n } else {\n // recursively call for curChild and it's children to see if we find something in\n // fromNodesLookup\n handleNodeAdded(curChild);\n }\n\n curChild = nextSibling;\n }\n }\n\n function cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey) {\n // We have processed all of the \"to nodes\". If curFromNodeChild is\n // non-null then we still have some from nodes left over that need\n // to be removed\n while (curFromNodeChild) {\n var fromNextSibling = curFromNodeChild.nextSibling;\n if ((curFromNodeKey = getNodeKey(curFromNodeChild))) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n curFromNodeChild = fromNextSibling;\n }\n }\n\n function morphEl(fromEl, toEl, childrenOnly) {\n var toElKey = getNodeKey(toEl);\n\n if (toElKey) {\n // If an element with an ID is being morphed then it will be in the final\n // DOM so clear it out of the saved elements collection\n delete fromNodesLookup[toElKey];\n }\n\n if (!childrenOnly) {\n // optional\n if (onBeforeElUpdated(fromEl, toEl) === false) {\n return;\n }\n\n // update attributes on original DOM element first\n morphAttrs(fromEl, toEl);\n // optional\n onElUpdated(fromEl);\n\n if (onBeforeElChildrenUpdated(fromEl, toEl) === false) {\n return;\n }\n }\n\n if (fromEl.nodeName !== 'TEXTAREA') {\n morphChildren(fromEl, toEl);\n } else {\n specialElHandlers.TEXTAREA(fromEl, toEl);\n }\n }\n\n function morphChildren(fromEl, toEl) {\n var curToNodeChild = toEl.firstChild;\n var curFromNodeChild = fromEl.firstChild;\n var curToNodeKey;\n var curFromNodeKey;\n\n var fromNextSibling;\n var toNextSibling;\n var matchingFromEl;\n\n // walk the children\n outer: while (curToNodeChild) {\n toNextSibling = curToNodeChild.nextSibling;\n curToNodeKey = getNodeKey(curToNodeChild);\n\n // walk the fromNode children all the way through\n while (curFromNodeChild) {\n fromNextSibling = curFromNodeChild.nextSibling;\n\n if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n curFromNodeKey = getNodeKey(curFromNodeChild);\n\n var curFromNodeType = curFromNodeChild.nodeType;\n\n // this means if the curFromNodeChild doesnt have a match with the curToNodeChild\n var isCompatible = undefined;\n\n if (curFromNodeType === curToNodeChild.nodeType) {\n if (curFromNodeType === ELEMENT_NODE) {\n // Both nodes being compared are Element nodes\n\n if (curToNodeKey) {\n // The target node has a key so we want to match it up with the correct element\n // in the original DOM tree\n if (curToNodeKey !== curFromNodeKey) {\n // The current element in the original DOM tree does not have a matching key so\n // let's check our lookup to see if there is a matching element in the original\n // DOM tree\n if ((matchingFromEl = fromNodesLookup[curToNodeKey])) {\n if (fromNextSibling === matchingFromEl) {\n // Special case for single element removals. To avoid removing the original\n // DOM node out of the tree (since that can break CSS transitions, etc.),\n // we will instead discard the current node and wait until the next\n // iteration to properly match up the keyed target element with its matching\n // element in the original tree\n isCompatible = false;\n } else {\n // We found a matching keyed element somewhere in the original DOM tree.\n // Let's move the original DOM node into the current position and morph\n // it.\n\n // NOTE: We use insertBefore instead of replaceChild because we want to go through\n // the `removeNode()` function for the node that is being discarded so that\n // all lifecycle hooks are correctly invoked\n fromEl.insertBefore(matchingFromEl, curFromNodeChild);\n\n // fromNextSibling = curFromNodeChild.nextSibling;\n\n if (curFromNodeKey) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n\n curFromNodeChild = matchingFromEl;\n }\n } else {\n // The nodes are not compatible since the \"to\" node has a key and there\n // is no matching keyed node in the source tree\n isCompatible = false;\n }\n }\n } else if (curFromNodeKey) {\n // The original has a key\n isCompatible = false;\n }\n\n isCompatible = isCompatible !== false && compareNodeNames(curFromNodeChild, curToNodeChild);\n if (isCompatible) {\n // We found compatible DOM elements so transform\n // the current \"from\" node to match the current\n // target DOM node.\n // MORPH\n morphEl(curFromNodeChild, curToNodeChild);\n }\n\n } else if (curFromNodeType === TEXT_NODE || curFromNodeType == COMMENT_NODE) {\n // Both nodes being compared are Text or Comment nodes\n isCompatible = true;\n // Simply update nodeValue on the original node to\n // change the text value\n if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) {\n curFromNodeChild.nodeValue = curToNodeChild.nodeValue;\n }\n\n }\n }\n\n if (isCompatible) {\n // Advance both the \"to\" child and the \"from\" child since we found a match\n // Nothing else to do as we already recursively called morphChildren above\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n // No compatible match so remove the old node from the DOM and continue trying to find a\n // match in the original DOM. However, we only do this if the from node is not keyed\n // since it is possible that a keyed node might match up with a node somewhere else in the\n // target tree and we don't want to discard it just yet since it still might find a\n // home in the final DOM tree. After everything is done we will remove any keyed nodes\n // that didn't find a home\n if (curFromNodeKey) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n\n curFromNodeChild = fromNextSibling;\n } // END: while(curFromNodeChild) {}\n\n // If we got this far then we did not find a candidate match for\n // our \"to node\" and we exhausted all of the children \"from\"\n // nodes. Therefore, we will just append the current \"to\" node\n // to the end\n if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && compareNodeNames(matchingFromEl, curToNodeChild)) {\n fromEl.appendChild(matchingFromEl);\n // MORPH\n morphEl(matchingFromEl, curToNodeChild);\n } else {\n var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);\n if (onBeforeNodeAddedResult !== false) {\n if (onBeforeNodeAddedResult) {\n curToNodeChild = onBeforeNodeAddedResult;\n }\n\n if (curToNodeChild.actualize) {\n curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || doc);\n }\n fromEl.appendChild(curToNodeChild);\n handleNodeAdded(curToNodeChild);\n }\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n }\n\n cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey);\n\n var specialElHandler = specialElHandlers[fromEl.nodeName];\n if (specialElHandler) {\n specialElHandler(fromEl, toEl);\n }\n } // END: morphChildren(...)\n\n var morphedNode = fromNode;\n var morphedNodeType = morphedNode.nodeType;\n var toNodeType = toNode.nodeType;\n\n if (!childrenOnly) {\n // Handle the case where we are given two DOM nodes that are not\n // compatible (e.g. <div> --> <span> or <div> --> TEXT)\n if (morphedNodeType === ELEMENT_NODE) {\n if (toNodeType === ELEMENT_NODE) {\n if (!compareNodeNames(fromNode, toNode)) {\n onNodeDiscarded(fromNode);\n morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));\n }\n } else {\n // Going from an element node to a text node\n morphedNode = toNode;\n }\n } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node\n if (toNodeType === morphedNodeType) {\n if (morphedNode.nodeValue !== toNode.nodeValue) {\n morphedNode.nodeValue = toNode.nodeValue;\n }\n\n return morphedNode;\n } else {\n // Text node to something else\n morphedNode = toNode;\n }\n }\n }\n\n if (morphedNode === toNode) {\n // The \"to node\" was not compatible with the \"from node\" so we had to\n // toss out the \"from node\" and use the \"to node\"\n onNodeDiscarded(fromNode);\n } else {\n if (toNode.isSameNode && toNode.isSameNode(morphedNode)) {\n return;\n }\n\n morphEl(morphedNode, toNode, childrenOnly);\n\n // We now need to loop over any keyed nodes that might need to be\n // removed. We only do the removal if we know that the keyed node\n // never found a match. When a keyed node is matched up we remove\n // it out of fromNodesLookup and we use fromNodesLookup to determine\n // if a keyed node has been matched up or not\n if (keyedRemovalList) {\n for (var i=0, len=keyedRemovalList.length; i<len; i++) {\n var elToRemove = fromNodesLookup[keyedRemovalList[i]];\n if (elToRemove) {\n removeNode(elToRemove, elToRemove.parentNode, false);\n }\n }\n }\n }\n\n if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {\n if (morphedNode.actualize) {\n morphedNode = morphedNode.actualize(fromNode.ownerDocument || doc);\n }\n // If we had to swap out the from node with a new node because the old\n // node was not compatible with the target node then we need to\n // replace the old DOM node in the original DOM tree. This is only\n // possible if the original DOM node was part of a DOM tree which\n // we know is the case if it has a parent node.\n fromNode.parentNode.replaceChild(morphedNode, fromNode);\n }\n\n return morphedNode;\n };\n}\n\nvar morphdom = morphdomFactory(morphAttrs);\n\nexport default morphdom;\n","import { rAF, dup, buildtemplates } from './utils';\nimport { on, off, trigger } from './utils/events';\nimport { publish, subscribe, unsubscribe } from './utils/pubsub';\nimport morphdom from 'morphdom';\nexport default function WebComponent(module, dependencies, templates, components) {\n return class extends HTMLElement {\n constructor() {\n super();\n let batchUpdates = [];\n buildtemplates(this, components, templates);\n const tplid = this.getAttribute('tplid');\n const template = templates[tplid];\n this.__internal__ = {\n main: () => null,\n unmount: () => null,\n onupdate: _ => _,\n view: module.view ? module.view : _ => _,\n state: module.model ? dup(module.model) : {}\n };\n this.base = {\n template,\n dependencies,\n publish,\n subscribe,\n unsubscribe,\n elm: this,\n main: (fn) => { this.__internal__.main = fn; },\n unmount: (fn) => { this.__internal__.unmount = fn; },\n onupdate: (fn) => { this.__internal__.onupdate = fn; },\n render: (data = this.__internal__.state) => {\n if (!document.body.contains(this))\n return;\n batchUpdates.push(this.__internal__.view(data));\n rAF(_ => {\n if (batchUpdates.length) {\n const batchData = {};\n batchUpdates.forEach(d => Object.assign(batchData, d));\n batchUpdates = [];\n this.__internal__.state = Object.assign(this.__internal__.state, batchData);\n const newdata = dup(this.__internal__.state);\n const newhtml = this.base.template(newdata);\n morphdom(this, newhtml, morphdomOptions(this, data));\n Array\n .from(this.querySelectorAll('*'))\n .filter(el => el.__internal__)\n .map(el => {\n rAF(_ => {\n el.__internal__.onupdate(newdata);\n el.base.render(newdata);\n });\n });\n }\n });\n },\n state: {\n set: (data) => {\n if (data.constructor === Function) {\n const newstate = dup(this.__internal__.state);\n data(newstate);\n this.base.render(newstate);\n }\n else {\n this.base.render(data);\n }\n return new Promise((resolve) => rAF(_ => rAF(resolve)));\n },\n get: () => {\n return dup(this.__internal__.state);\n }\n },\n on: (eventName, selectorOrCallback, callback) => {\n on(this, eventName, selectorOrCallback, callback);\n },\n off: (eventName, callback) => {\n off(this, eventName, callback);\n },\n trigger: (eventName, target, args) => {\n if (target.constructor === String)\n trigger(this.querySelector(target), eventName, { args: args });\n else\n trigger(this, eventName, { args: target });\n },\n emit: (...args) => {\n trigger(this, args.shift(), { args: args });\n }\n };\n module.default(this.base);\n }\n connectedCallback() {\n this.base.render();\n this.__internal__.main().forEach(f => f(this.base));\n }\n disconnectedCallback() {\n this.__internal__.unmount(this.base);\n delete this.__internal__;\n delete this.base;\n delete this.__events;\n }\n attributeChangedCallback() {\n //TODO\n }\n };\n}\nconst morphdomOptions = (_parent, data) => {\n return {\n onNodeAdded: onUpdates(_parent),\n onElUpdated: onUpdates(_parent),\n onBeforeElChildrenUpdated: checkStatic,\n onBeforeElUpdated: checkStatic,\n getNodeKey(node) {\n if (node.nodeType === 1 && node.getAttribute('tplid'))\n return node.dataset.key || node.getAttribute('tplid');\n return false;\n }\n };\n};\nconst checkStatic = (node) => {\n if ('static' in node.dataset) {\n return false;\n }\n};\nconst onUpdates = (_parent) => (node) => {\n if (node.nodeType === 1) {\n if (node.getAttribute && node.getAttribute('scope')) {\n const scope = JSON.parse(node.getAttribute('scope').replace(/\\'/g, '\\\"'));\n Array.from(node.querySelectorAll('*'))\n .filter(el => el.__internal__)\n .map(el => {\n const data = Object.assign(el.__internal__.state, dup(_parent.__internal__.state), scope);\n el.__internal__.onupdate(data);\n el.base.render(data);\n });\n node.removeAttribute('scope');\n }\n }\n};\n","import { buildtemplates, stripTemplateTag } from './utils';\nimport WebComponent from './component';\nexport const templates = {};\nexport const components = {};\nexport default {\n register(name, module, dependencies = {}) {\n components[name] = { name, module, dependencies };\n },\n start() {\n const body = document.body;\n stripTemplateTag(body);\n buildtemplates(body, components, templates);\n registerComponents();\n }\n};\nconst registerComponents = () => {\n Object\n .values(components)\n .forEach(({ name, module, dependencies }) => {\n const Element = WebComponent(module, dependencies, templates, components);\n customElements.define(name, Element);\n });\n};\n"],"names":["root","factory","exports","module","define","amd","self","t7ctx","window","g","undefined","Template7Context","Template7Utils","quoteSingleRexExp","RegExp","quoteDoubleRexExp","isFunction","func","escape","string","replace","helperToSlices","helperParts","trim","split","slices","shiftIndex","i","j","length","blockQuoteRegExp","openingQuote","part","push","indexOf","match","hashParts","hashName","hashContent","hash","stringToBlocks","blocks","stringBlocks","block","type","content","contextName","helperSlices","helperName","isPartial","helperContext","helperHash","slice","Array","isArray","helperContent","elseContent","toSkip","foundClosed","foundElse","depth","inverseContent","parseJsVariable","expression","object","reduce","arr","JSON","stringify","variable","forEach","partName","constructor","Object","join","parseJsParents","parents","levelsUp","getCompileVar","name","ctx","data","parts","newDepth","dataLevel","Number","isFinite","getCompiledArguments","contextArray","test","Template7Helpers","_partial","partialName","options","this","p","Template7Class","partials","template","compiled","compile","keys","context","Error","if","call","fn","inverse","unless","each","ret","reverse","first","last","index","key","with","delimiter","delimeter","js","execute","prop","re1","re2","Template7","global","eval","js_if","condition","js_compare","Template7Options","Template7Partials","t","getCompileFn","getCompileInverse","resultString","compiledArguments","dynamicHelper","level","parentsString","helpers","args","instance","rendered","registerHelper","unregisterHelper","registerPartial","unregisterPartial","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","o","defineProperty","enumerable","get","globalThis","Function","e","obj","prototype","hasOwnProperty","r","Symbol","toStringTag","value","htmlRepeatAndIf","vdom","nodes","from","querySelectorAll","node","getAttribute","instruction","removeAttribute","setAttribute","open","document","createTextNode","close","parentNode","insertBefore","nextSibling","scope","assign","decodeHtmlEntities","err","rAF","requestAnimationFrame","setTimeout","stripTemplateTag","element","replaceChild","dup","parse","buildtemplates","target","components","templates","filter","tagName","toLocaleLowerCase","map","tplid","id","c","Math","random","toString","directives","cloneNode","html","_","directive","outerHTML","templateSystem","createTemplateId","str","textarea","createElement","innerHTML","customEvent","CustomEvent","newEvent","createEvent","initCustomEvent","handler","ev","detail","__events","apply","concat","removeListener","listener","removeEventListener","delegate","selector","callback","parent","matches","delegateTarget","trigger","dispatchEvent","bubbles","topics","_async","publish","params","topic","subscribe","method","unsubscribe","range","doc","HAS_TEMPLATE_SUPPORT","HAS_RANGE_SUPPORT","createRange","compareNodeNames","fromEl","toEl","fromCodeStart","toCodeStart","fromNodeName","nodeName","toNodeName","charCodeAt","toUpperCase","syncBooleanAttrProp","specialElHandlers","OPTION","parentName","hasAttribute","selected","selectedIndex","INPUT","TEXTAREA","newValue","firstChild","oldValue","nodeValue","placeholder","SELECT","optgroup","curChild","noop","defaultGetNodeKey","fromNode","toNode","toNodeHtml","childNodes","createFragmentFromTemplate","selectNode","body","createContextualFragment","createFragmentFromRange","fragment","createFragmentFromWrap","getNodeKey","onBeforeNodeAdded","onNodeAdded","onBeforeElUpdated","onElUpdated","onBeforeNodeDiscarded","onNodeDiscarded","onBeforeElChildrenUpdated","childrenOnly","fromNodesLookup","create","keyedRemovalList","addKeyedRemoval","walkDiscardedChildNodes","skipKeyedNodes","nodeType","removeNode","removeChild","handleNodeAdded","el","unmatchedFromEl","morphEl","toElKey","attr","attrName","attrNamespaceURI","attrValue","toNodeAttrs","attributes","namespaceURI","localName","getAttributeNS","prefix","setAttributeNS","fromNodeAttrs","hasAttributeNS","removeAttributeNS","morphAttrs","curToNodeKey","curFromNodeKey","fromNextSibling","toNextSibling","matchingFromEl","curToNodeChild","curFromNodeChild","outer","isSameNode","curFromNodeType","isCompatible","appendChild","onBeforeNodeAddedResult","actualize","ownerDocument","cleanupFromEl","specialElHandler","morphChildren","indexTree","morphedNode","morphedNodeType","toNodeType","nextChild","moveChildren","createElementNS","len","elToRemove","morphdomOptions","_parent","onUpdates","checkStatic","dataset","__internal__","state","onupdate","base","render","register","dependencies","start","registerComponents","values","Element","HTMLElement","super","batchUpdates","main","unmount","view","model","elm","contains","batchData","newdata","newhtml","set","newstate","Promise","resolve","on","eventName","selectorOrCallback","addEventListener","off","old","String","querySelector","emit","shift","default","connectedCallback","f","disconnectedCallback","attributeChangedCallback","WebComponent","customElements"],"sourceRoot":""}
package/src/Component.ts DELETED
@@ -1,178 +0,0 @@
1
- import { rAF, dup, buildtemplates } from './utils'
2
- import { on, off, trigger } from './utils/events'
3
- import { publish, subscribe, unsubscribe } from './utils/pubsub'
4
- import morphdom from 'morphdom'
5
-
6
- type MainArgs = () => Array<Function>
7
-
8
- export default function WebComponent(module, dependencies, templates, components) {
9
-
10
- return class extends HTMLElement {
11
-
12
- constructor() {
13
-
14
- super()
15
-
16
- let batchUpdates = []
17
-
18
- buildtemplates(this, components, templates)
19
-
20
- const tplid = this.getAttribute('tplid')
21
- const template = templates[tplid]
22
-
23
- this.__internal__ = {
24
- main: () => null,
25
- unmount: () => null,
26
- onupdate: _ => _,
27
- view: module.view ? module.view : _ => _,
28
- state: module.model ? dup(module.model) : {}
29
- }
30
-
31
- this.base = {
32
- template,
33
- dependencies,
34
- publish,
35
- subscribe,
36
- unsubscribe,
37
- elm: this,
38
-
39
- main: (fn: MainArgs) => { this.__internal__.main = fn },
40
- unmount: (fn: () => null) => { this.__internal__.unmount = fn },
41
- onupdate: (fn: () => null) => { this.__internal__.onupdate = fn },
42
-
43
- render: (data: any = this.__internal__.state) => {
44
-
45
- if (!document.body.contains(this))
46
- return
47
-
48
-
49
- batchUpdates.push(this.__internal__.view(data))
50
-
51
- rAF(_ => {
52
-
53
- if (batchUpdates.length) {
54
-
55
- const batchData = {}
56
- batchUpdates.forEach(d => Object.assign(batchData, d))
57
- batchUpdates = []
58
-
59
- this.__internal__.state = Object.assign(this.__internal__.state, batchData)
60
-
61
- const newdata = dup(this.__internal__.state)
62
- const newhtml = this.base.template(newdata)
63
-
64
- morphdom(this, newhtml, morphdomOptions(this, data))
65
-
66
- Array
67
- .from(this.querySelectorAll('*'))
68
- .filter(el => el.__internal__)
69
- .map(el => {
70
- rAF(_ => {
71
- el.__internal__.onupdate(newdata)
72
- el.base.render(newdata)
73
- })
74
- })
75
- }
76
- })
77
- },
78
-
79
- state: {
80
- set: (data: any) => {
81
- if (data.constructor === Function) {
82
- const newstate = dup(this.__internal__.state)
83
- data(newstate)
84
- this.base.render(newstate)
85
- } else {
86
- this.base.render(data)
87
- }
88
- return new Promise((resolve) => rAF(_ => rAF(resolve)))
89
- },
90
-
91
- get: () => {
92
- return dup(this.__internal__.state)
93
- }
94
- },
95
-
96
- on: (eventName: string, selectorOrCallback: object | Function, callback: Function) => {
97
- on(this, eventName, selectorOrCallback, callback)
98
- },
99
-
100
- off: (eventName: string, callback: Function) => {
101
- off(this, eventName, callback)
102
- },
103
-
104
- trigger: (eventName: string, target: string, args: any) => {
105
- if (target.constructor === String)
106
- trigger(this.querySelector(target), eventName, { args: args })
107
- else trigger(this, eventName, { args: target })
108
- },
109
-
110
- emit: (...args) => {
111
- trigger(this, args.shift(), { args: args })
112
- }
113
- }
114
-
115
- module.default(this.base)
116
- }
117
-
118
- connectedCallback() {
119
- this.base.render()
120
- this.__internal__.main().forEach(f => f(this.base))
121
- }
122
-
123
- disconnectedCallback() {
124
- this.__internal__.unmount(this.base)
125
- delete this.__internal__
126
- delete this.base
127
- delete this.__events
128
- }
129
-
130
- attributeChangedCallback() {
131
- //TODO
132
- }
133
- }
134
- }
135
-
136
- const morphdomOptions = (_parent, data) => {
137
-
138
- return {
139
-
140
- onNodeAdded: onUpdates(_parent),
141
- onElUpdated: onUpdates(_parent),
142
- onBeforeElChildrenUpdated: checkStatic,
143
- onBeforeElUpdated: checkStatic,
144
-
145
- getNodeKey(node) {
146
- if (node.nodeType === 1 && node.getAttribute('tplid'))
147
- return node.dataset.key || node.getAttribute('tplid')
148
- return false
149
- }
150
- }
151
- }
152
-
153
- const checkStatic = (node) => {
154
- if ('static' in node.dataset) {
155
- return false
156
- }
157
- }
158
-
159
- const onUpdates = (_parent) => (node) => {
160
-
161
- if (node.nodeType === 1) {
162
-
163
- if (node.getAttribute && node.getAttribute('scope')) {
164
-
165
- const scope = JSON.parse(node.getAttribute('scope').replace(/\'/g, '\"'))
166
-
167
- Array.from(node.querySelectorAll('*'))
168
- .filter(el => el.__internal__)
169
- .map(el => {
170
- const data = Object.assign(el.__internal__.state, dup(_parent.__internal__.state), scope)
171
- el.__internal__.onupdate(data)
172
- el.base.render(data)
173
- })
174
-
175
- node.removeAttribute('scope')
176
- }
177
- }
178
- }
@@ -1,75 +0,0 @@
1
- import templateSystem from '../template-system'
2
-
3
- export const rAF = (fn) => {
4
- (requestAnimationFrame || setTimeout)(fn, 1000 / 60)
5
- }
6
-
7
- export const uuid = () => {
8
- return 'xxxxxxxx'.replace(/[xy]/g, (c) => {
9
- const r = Math.random() * 8 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
10
- return v.toString(8)
11
- })
12
- }
13
-
14
- export const stripTemplateTag = (element) => {
15
- const templates = Array.from(element.querySelectorAll('template'))
16
- // https://gist.github.com/harmenjanssen/07e425248779c65bc5d11b02fb913274
17
- templates.forEach(template => {
18
- template.parentNode.replaceChild(template.content, template)
19
- stripTemplateTag(template.content)
20
- })
21
- }
22
-
23
- export const dup = (o) => {
24
- return JSON.parse(JSON.stringify(o))
25
- }
26
-
27
- export const createTemplate = (html, templates) => {
28
-
29
- const vroot = document.createElement('div')
30
- vroot.innerHTML = html
31
- stripTemplateTag(vroot)
32
-
33
- Array
34
- .from(vroot.querySelectorAll('[data-component]'))
35
- .forEach(c => {
36
- const tplid = c.getAttribute('tplid')
37
- const cache = templates[tplid]
38
- if (cache)
39
- c.outerHTML = cache
40
- })
41
-
42
- return vroot.innerHTML
43
- }
44
-
45
- export const createTemplateId = (element, templates) => {
46
-
47
- const tplid = element.getAttribute('tplid')
48
-
49
- if (!tplid) {
50
- const id = uuid()
51
- element.setAttribute('tplid', id)
52
- templates[id] = templateSystem(element)
53
- return templates[id]
54
- }
55
-
56
- return templates[tplid]
57
- }
58
-
59
- export const buildtemplates = (target, components, templates) => {
60
-
61
- return Array
62
- .from(target.querySelectorAll('*'))
63
- .filter(node => node.tagName.toLocaleLowerCase() in components)
64
- .reverse()
65
- .map(node => {
66
- createTemplateId(node, templates)
67
- return node
68
- })
69
- }
70
-
71
- export const decodeHtmlEntities = (str) => {
72
- const textarea = document.createElement('textarea')
73
- textarea.innerHTML = str
74
- return textarea.value
75
- }
@@ -1,25 +0,0 @@
1
- const topics = {}
2
- const _async = {}
3
-
4
- export const publish = (name, params) => {
5
- _async[name] = Object.assign({}, _async[name], params)
6
- if( topics[name] )
7
- topics[name].forEach(topic => topic(params))
8
- }
9
-
10
- export const subscribe = (name, method) => {
11
- topics[name] = topics[name] || []
12
- topics[name].push(method)
13
- if ( name in _async ) {
14
- method(_async[name])
15
- }
16
- }
17
-
18
- export const unsubscribe = (topic) => {
19
- topics[topic.name] = (topics[topic.name] || [])
20
- .filter(t => t != topic.method)
21
- if (!topics[topic.name].length) {
22
- delete topics[topic.name]
23
- delete _async[topic.name]
24
- }
25
- }