Release Artifacts for v2.2.3
[skip ci]
This commit is contained in:
parent
e0996bd6f2
commit
274cb2fff2
7 changed files with 115 additions and 127 deletions
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
## What is Mithril.js?
|
## What is Mithril.js?
|
||||||
|
|
||||||
A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->9.17 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
|
A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->9.14 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
|
||||||
|
|
||||||
Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.
|
Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
# Release v2.2.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
#### [Use markdown for the README badges (@pygy)](https://github.com/MithrilJS/mithril.js/pull/2773)
|
||||||
|
|
||||||
|
Use markdown for the README badges.
|
||||||
|
|
||||||
# Release v2.2.2
|
# Release v2.2.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
||||||
218
mithril.js
218
mithril.js
|
|
@ -159,13 +159,32 @@ hyperscript.fragment = function() {
|
||||||
vnode2.children = Vnode.normalizeChildren(vnode2.children)
|
vnode2.children = Vnode.normalizeChildren(vnode2.children)
|
||||||
return vnode2
|
return vnode2
|
||||||
}
|
}
|
||||||
|
var delayedRemoval0 = new WeakMap
|
||||||
|
function *domFor1({dom, domSize0}, {generation0} = {}) {
|
||||||
|
if (dom != null) do {
|
||||||
|
const {nextSibling} = dom
|
||||||
|
if (delayedRemoval0.get(dom) === generation0) {
|
||||||
|
yield dom
|
||||||
|
domSize0--
|
||||||
|
}
|
||||||
|
dom = nextSibling
|
||||||
|
}
|
||||||
|
while (domSize0)
|
||||||
|
}
|
||||||
|
var df = {
|
||||||
|
delayedRemoval: delayedRemoval0,
|
||||||
|
domFor: domFor1,
|
||||||
|
}
|
||||||
|
var delayedRemoval = df.delayedRemoval
|
||||||
|
var domFor0 = df.domFor
|
||||||
var _11 = function($window) {
|
var _11 = function($window) {
|
||||||
var $doc = $window && $window.document
|
var $doc = $window && $window.document
|
||||||
var currentRedraw
|
|
||||||
var nameSpace = {
|
var nameSpace = {
|
||||||
svg: "http://www.w3.org/2000/svg",
|
svg: "http://www.w3.org/2000/svg",
|
||||||
math: "http://www.w3.org/1998/Math/MathML"
|
math: "http://www.w3.org/1998/Math/MathML"
|
||||||
}
|
}
|
||||||
|
var currentRedraw
|
||||||
|
var currentRender
|
||||||
function getNameSpace(vnode3) {
|
function getNameSpace(vnode3) {
|
||||||
return vnode3.attrs && vnode3.attrs.xmlns || nameSpace[vnode3.tag]
|
return vnode3.attrs && vnode3.attrs.xmlns || nameSpace[vnode3.tag]
|
||||||
}
|
}
|
||||||
|
|
@ -219,7 +238,7 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
function createText(parent, vnode3, nextSibling) {
|
function createText(parent, vnode3, nextSibling) {
|
||||||
vnode3.dom = $doc.createTextNode(vnode3.children)
|
vnode3.dom = $doc.createTextNode(vnode3.children)
|
||||||
insertNode(parent, vnode3.dom, nextSibling)
|
insertDOM(parent, vnode3.dom, nextSibling)
|
||||||
}
|
}
|
||||||
var possibleParents = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}
|
var possibleParents = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}
|
||||||
function createHTML(parent, vnode3, ns, nextSibling) {
|
function createHTML(parent, vnode3, ns, nextSibling) {
|
||||||
|
|
@ -239,14 +258,12 @@ var _11 = function($window) {
|
||||||
vnode3.dom = temp.firstChild
|
vnode3.dom = temp.firstChild
|
||||||
vnode3.domSize = temp.childNodes.length
|
vnode3.domSize = temp.childNodes.length
|
||||||
// Capture nodes to remove, so we don't confuse them.
|
// Capture nodes to remove, so we don't confuse them.
|
||||||
vnode3.instance = []
|
|
||||||
var fragment = $doc.createDocumentFragment()
|
var fragment = $doc.createDocumentFragment()
|
||||||
var child
|
var child
|
||||||
while (child = temp.firstChild) {
|
while (child = temp.firstChild) {
|
||||||
vnode3.instance.push(child)
|
|
||||||
fragment.appendChild(child)
|
fragment.appendChild(child)
|
||||||
}
|
}
|
||||||
insertNode(parent, fragment, nextSibling)
|
insertDOM(parent, fragment, nextSibling)
|
||||||
}
|
}
|
||||||
function createFragment(parent, vnode3, hooks, ns, nextSibling) {
|
function createFragment(parent, vnode3, hooks, ns, nextSibling) {
|
||||||
var fragment = $doc.createDocumentFragment()
|
var fragment = $doc.createDocumentFragment()
|
||||||
|
|
@ -256,7 +273,7 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
vnode3.dom = fragment.firstChild
|
vnode3.dom = fragment.firstChild
|
||||||
vnode3.domSize = fragment.childNodes.length
|
vnode3.domSize = fragment.childNodes.length
|
||||||
insertNode(parent, fragment, nextSibling)
|
insertDOM(parent, fragment, nextSibling)
|
||||||
}
|
}
|
||||||
function createElement(parent, vnode3, hooks, ns, nextSibling) {
|
function createElement(parent, vnode3, hooks, ns, nextSibling) {
|
||||||
var tag = vnode3.tag
|
var tag = vnode3.tag
|
||||||
|
|
@ -270,7 +287,7 @@ var _11 = function($window) {
|
||||||
if (attrs2 != null) {
|
if (attrs2 != null) {
|
||||||
setAttrs(vnode3, attrs2, ns)
|
setAttrs(vnode3, attrs2, ns)
|
||||||
}
|
}
|
||||||
insertNode(parent, element, nextSibling)
|
insertDOM(parent, element, nextSibling)
|
||||||
if (!maybeSetContentEditable(vnode3)) {
|
if (!maybeSetContentEditable(vnode3)) {
|
||||||
if (vnode3.children != null) {
|
if (vnode3.children != null) {
|
||||||
var children2 = vnode3.children
|
var children2 = vnode3.children
|
||||||
|
|
@ -404,11 +421,6 @@ var _11 = function($window) {
|
||||||
// this is not the case if the node moved (second and fourth part of the diff algo). We move
|
// this is not the case if the node moved (second and fourth part of the diff algo). We move
|
||||||
// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`
|
// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`
|
||||||
// variable rather than fetching it using `getNextSibling()`.
|
// variable rather than fetching it using `getNextSibling()`.
|
||||||
//
|
|
||||||
// The fourth part of the diff currently inserts nodes unconditionally, leading to issues
|
|
||||||
// like #1791 and #1999. We need to be smarter about those situations where adjascent old
|
|
||||||
// nodes remain together in the new list in a way that isn't covered by parts one and
|
|
||||||
// three of the diff algo.
|
|
||||||
function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
|
function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
|
||||||
if (old === vnodes || old == null && vnodes == null) return
|
if (old === vnodes || old == null && vnodes == null) return
|
||||||
else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
|
else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
|
||||||
|
|
@ -464,9 +476,9 @@ var _11 = function($window) {
|
||||||
if (start === end) break
|
if (start === end) break
|
||||||
if (o.key !== ve.key || oe.key !== v.key) break
|
if (o.key !== ve.key || oe.key !== v.key) break
|
||||||
topSibling = getNextSibling(old, oldStart, nextSibling)
|
topSibling = getNextSibling(old, oldStart, nextSibling)
|
||||||
moveNodes(parent, oe, topSibling)
|
moveDOM(parent, oe, topSibling)
|
||||||
if (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)
|
if (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)
|
||||||
if (++start <= --end) moveNodes(parent, o, nextSibling)
|
if (++start <= --end) moveDOM(parent, o, nextSibling)
|
||||||
if (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)
|
if (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)
|
||||||
if (ve.dom != null) nextSibling = ve.dom
|
if (ve.dom != null) nextSibling = ve.dom
|
||||||
oldStart++; oldEnd--
|
oldStart++; oldEnd--
|
||||||
|
|
@ -518,7 +530,7 @@ var _11 = function($window) {
|
||||||
if (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)
|
if (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)
|
||||||
else {
|
else {
|
||||||
if (lisIndices[li] === i - start) li--
|
if (lisIndices[li] === i - start) li--
|
||||||
else moveNodes(parent, v, nextSibling)
|
else moveDOM(parent, v, nextSibling)
|
||||||
}
|
}
|
||||||
if (v.dom != null) nextSibling = vnodes[i].dom
|
if (v.dom != null) nextSibling = vnodes[i].dom
|
||||||
}
|
}
|
||||||
|
|
@ -566,13 +578,12 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
function updateHTML(parent, old, vnode3, ns, nextSibling) {
|
function updateHTML(parent, old, vnode3, ns, nextSibling) {
|
||||||
if (old.children !== vnode3.children) {
|
if (old.children !== vnode3.children) {
|
||||||
removeHTML(parent, old)
|
removeDOM(parent, old, undefined)
|
||||||
createHTML(parent, vnode3, ns, nextSibling)
|
createHTML(parent, vnode3, ns, nextSibling)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vnode3.dom = old.dom
|
vnode3.dom = old.dom
|
||||||
vnode3.domSize = old.domSize
|
vnode3.domSize = old.domSize
|
||||||
vnode3.instance = old.instance
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function updateFragment(parent, old, vnode3, hooks, nextSibling, ns) {
|
function updateFragment(parent, old, vnode3, hooks, nextSibling, ns) {
|
||||||
|
|
@ -685,45 +696,21 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
return nextSibling
|
return nextSibling
|
||||||
}
|
}
|
||||||
// This covers a really specific edge case:
|
// This handles fragments with zombie children2 (removed from vdom, but persisted in DOM through onbeforeremove)
|
||||||
// - Parent node is keyed and contains child
|
function moveDOM(parent, vnode3, nextSibling) {
|
||||||
// - Child is removed, returns unresolved promise in `onbeforeremove`
|
if (vnode3.dom != null) {
|
||||||
// - Parent node is moved in keyed diff
|
var target
|
||||||
// - Remaining children2 still need moved appropriately
|
if (vnode3.domSize == null) {
|
||||||
//
|
// don't allocate for the common case
|
||||||
// Ideally, I'd track removed nodes as well, but that introduces a lot more
|
target = vnode3.dom
|
||||||
// complexity and I'm2 not exactly interested in doing that.
|
|
||||||
function moveNodes(parent, vnode3, nextSibling) {
|
|
||||||
var frag = $doc.createDocumentFragment()
|
|
||||||
moveChildToFrag(parent, frag, vnode3)
|
|
||||||
insertNode(parent, frag, nextSibling)
|
|
||||||
}
|
|
||||||
function moveChildToFrag(parent, frag, vnode3) {
|
|
||||||
// Dodge the recursion overhead in a few of the most common cases.
|
|
||||||
while (vnode3.dom != null && vnode3.dom.parentNode === parent) {
|
|
||||||
if (typeof vnode3.tag !== "string") {
|
|
||||||
vnode3 = vnode3.instance
|
|
||||||
if (vnode3 != null) continue
|
|
||||||
} else if (vnode3.tag === "<") {
|
|
||||||
for (var i = 0; i < vnode3.instance.length; i++) {
|
|
||||||
frag.appendChild(vnode3.instance[i])
|
|
||||||
}
|
|
||||||
} else if (vnode3.tag !== "[") {
|
|
||||||
// Don't recurse for text nodes *or* elements, just fragments
|
|
||||||
frag.appendChild(vnode3.dom)
|
|
||||||
} else if (vnode3.children.length === 1) {
|
|
||||||
vnode3 = vnode3.children[0]
|
|
||||||
if (vnode3 != null) continue
|
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < vnode3.children.length; i++) {
|
target = $doc.createDocumentFragment()
|
||||||
var child = vnode3.children[i]
|
for (var dom of domFor0(vnode3)) target.appendChild(dom)
|
||||||
if (child != null) moveChildToFrag(parent, frag, child)
|
}
|
||||||
|
insertDOM(parent, target, nextSibling)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
function insertDOM(parent, dom, nextSibling) {
|
||||||
}
|
|
||||||
}
|
|
||||||
function insertNode(parent, dom, nextSibling) {
|
|
||||||
if (nextSibling != null) parent.insertBefore(dom, nextSibling)
|
if (nextSibling != null) parent.insertBefore(dom, nextSibling)
|
||||||
else parent.appendChild(dom)
|
else parent.appendChild(dom)
|
||||||
}
|
}
|
||||||
|
|
@ -767,61 +754,51 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkState(vnode3, original)
|
checkState(vnode3, original)
|
||||||
|
var generation
|
||||||
// If we can, try to fast-path it and avoid all the overhead of awaiting
|
// If we can, try to fast-path it and avoid all the overhead of awaiting
|
||||||
if (!mask) {
|
if (!mask) {
|
||||||
onremove(vnode3)
|
onremove(vnode3)
|
||||||
removeChild(parent, vnode3)
|
removeDOM(parent, vnode3, generation)
|
||||||
} else {
|
} else {
|
||||||
|
generation = currentRender
|
||||||
|
for (var dom of domFor0(vnode3)) delayedRemoval.set(dom, generation)
|
||||||
if (stateResult != null) {
|
if (stateResult != null) {
|
||||||
var next = function () {
|
stateResult.finally(function () {
|
||||||
// eslint-disable-next-line no-bitwise
|
// eslint-disable-next-line no-bitwise
|
||||||
if (mask & 1) { mask &= 2; if (!mask) reallyRemove() }
|
if (mask & 1) {
|
||||||
}
|
|
||||||
stateResult.then(next, next)
|
|
||||||
}
|
|
||||||
if (attrsResult != null) {
|
|
||||||
var next = function () {
|
|
||||||
// eslint-disable-next-line no-bitwise
|
// eslint-disable-next-line no-bitwise
|
||||||
if (mask & 2) { mask &= 1; if (!mask) reallyRemove() }
|
mask &= 2
|
||||||
}
|
if (!mask) {
|
||||||
attrsResult.then(next, next)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function reallyRemove() {
|
|
||||||
checkState(vnode3, original)
|
checkState(vnode3, original)
|
||||||
onremove(vnode3)
|
onremove(vnode3)
|
||||||
removeChild(parent, vnode3)
|
removeDOM(parent, vnode3, generation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function removeHTML(parent, vnode3) {
|
})
|
||||||
for (var i = 0; i < vnode3.instance.length; i++) {
|
}
|
||||||
parent.removeChild(vnode3.instance[i])
|
if (attrsResult != null) {
|
||||||
|
attrsResult.finally(function () {
|
||||||
|
// eslint-disable-next-line no-bitwise
|
||||||
|
if (mask & 2) {
|
||||||
|
// eslint-disable-next-line no-bitwise
|
||||||
|
mask &= 1
|
||||||
|
if (!mask) {
|
||||||
|
checkState(vnode3, original)
|
||||||
|
onremove(vnode3)
|
||||||
|
removeDOM(parent, vnode3, generation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function removeChild(parent, vnode3) {
|
})
|
||||||
// Dodge the recursion overhead in a few of the most common cases.
|
}
|
||||||
while (vnode3.dom != null && vnode3.dom.parentNode === parent) {
|
}
|
||||||
if (typeof vnode3.tag !== "string") {
|
}
|
||||||
vnode3 = vnode3.instance
|
function removeDOM(parent, vnode3, generation) {
|
||||||
if (vnode3 != null) continue
|
if (vnode3.dom == null) return
|
||||||
} else if (vnode3.tag === "<") {
|
if (vnode3.domSize == null) {
|
||||||
removeHTML(parent, vnode3)
|
// don't allocate for the common case
|
||||||
|
if (delayedRemoval.get(vnode3.dom) === generation) parent.removeChild(vnode3.dom)
|
||||||
} else {
|
} else {
|
||||||
if (vnode3.tag !== "[") {
|
for (var dom of domFor0(vnode3, {generation})) parent.removeChild(dom)
|
||||||
parent.removeChild(vnode3.dom)
|
|
||||||
if (!Array.isArray(vnode3.children)) break
|
|
||||||
}
|
|
||||||
if (vnode3.children.length === 1) {
|
|
||||||
vnode3 = vnode3.children[0]
|
|
||||||
if (vnode3 != null) continue
|
|
||||||
} else {
|
|
||||||
for (var i = 0; i < vnode3.children.length; i++) {
|
|
||||||
var child = vnode3.children[i]
|
|
||||||
if (child != null) removeChild(parent, child)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function onremove(vnode3) {
|
function onremove(vnode3) {
|
||||||
|
|
@ -968,10 +945,10 @@ var _11 = function($window) {
|
||||||
// Styles are equivalent, do nothing.
|
// Styles are equivalent, do nothing.
|
||||||
} else if (style == null) {
|
} else if (style == null) {
|
||||||
// New style is missing, just clear it.
|
// New style is missing, just clear it.
|
||||||
element.style.cssText = ""
|
element.style = ""
|
||||||
} else if (typeof style !== "object") {
|
} else if (typeof style !== "object") {
|
||||||
// New style is a string, let engine deal with patching.
|
// New style is a string, let engine deal with patching.
|
||||||
element.style.cssText = style
|
element.style = style
|
||||||
} else if (old == null || typeof old !== "object") {
|
} else if (old == null || typeof old !== "object") {
|
||||||
// `old` is missing or a string, `style` is an object.
|
// `old` is missing or a string, `style` is an object.
|
||||||
element.style.cssText = ""
|
element.style.cssText = ""
|
||||||
|
|
@ -1090,6 +1067,7 @@ var _11 = function($window) {
|
||||||
var namespace = dom.namespaceURI
|
var namespace = dom.namespaceURI
|
||||||
currentDOM = dom
|
currentDOM = dom
|
||||||
currentRedraw = typeof redraw === "function" ? redraw : undefined
|
currentRedraw = typeof redraw === "function" ? redraw : undefined
|
||||||
|
currentRender = {}
|
||||||
try {
|
try {
|
||||||
// First time rendering into a node clears it out
|
// First time rendering into a node clears it out
|
||||||
if (dom.vnodes == null) dom.textContent = ""
|
if (dom.vnodes == null) dom.textContent = ""
|
||||||
|
|
@ -1106,7 +1084,7 @@ var _11 = function($window) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var render = _11(typeof window !== "undefined" ? window : null)
|
var render = _11(typeof window !== "undefined" ? window : null)
|
||||||
var _14 = function(render0, schedule, console) {
|
var _15 = function(render0, schedule, console) {
|
||||||
var subscriptions = []
|
var subscriptions = []
|
||||||
var pending = false
|
var pending = false
|
||||||
var offset = -1
|
var offset = -1
|
||||||
|
|
@ -1144,7 +1122,7 @@ var _14 = function(render0, schedule, console) {
|
||||||
}
|
}
|
||||||
return {mount: mount, redraw: redraw}
|
return {mount: mount, redraw: redraw}
|
||||||
}
|
}
|
||||||
var mountRedraw0 = _14(render, typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : null, typeof console !== "undefined" ? console : null)
|
var mountRedraw0 = _15(render, typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : null, typeof console !== "undefined" ? console : null)
|
||||||
var buildQueryString = function(object) {
|
var buildQueryString = function(object) {
|
||||||
if (Object.prototype.toString.call(object) !== "[object Object]") return ""
|
if (Object.prototype.toString.call(object) !== "[object Object]") return ""
|
||||||
var args = []
|
var args = []
|
||||||
|
|
@ -1166,10 +1144,10 @@ var buildQueryString = function(object) {
|
||||||
else args.push(encodeURIComponent(key2) + (value1 != null && value1 !== "" ? "=" + encodeURIComponent(value1) : ""))
|
else args.push(encodeURIComponent(key2) + (value1 != null && value1 !== "" ? "=" + encodeURIComponent(value1) : ""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// This exists so I'm5 only saving it once.
|
// This exists so I'm4 only saving it once.
|
||||||
var assign = Object.assign || function(target, source) {
|
var assign = Object.assign || function(target1, source) {
|
||||||
for (var key3 in source) {
|
for (var key3 in source) {
|
||||||
if (hasOwn.call(source, key3)) target[key3] = source[key3]
|
if (hasOwn.call(source, key3)) target1[key3] = source[key3]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Returns `path` from `template` + `params`
|
// Returns `path` from `template` + `params`
|
||||||
|
|
@ -1185,10 +1163,10 @@ var buildPathname = function(template, params) {
|
||||||
var path = template.slice(0, pathEnd)
|
var path = template.slice(0, pathEnd)
|
||||||
var query = {}
|
var query = {}
|
||||||
assign(query, params)
|
assign(query, params)
|
||||||
var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m4, key1, variadic) {
|
var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m3, key1, variadic) {
|
||||||
delete query[key1]
|
delete query[key1]
|
||||||
// If no such parameter exists, don't interpolate it.
|
// If no such parameter exists, don't interpolate it.
|
||||||
if (params[key1] == null) return m4
|
if (params[key1] == null) return m3
|
||||||
// Escape normal parameters, but not variadic ones.
|
// Escape normal parameters, but not variadic ones.
|
||||||
return variadic ? params[key1] : encodeURIComponent(String(params[key1]))
|
return variadic ? params[key1] : encodeURIComponent(String(params[key1]))
|
||||||
})
|
})
|
||||||
|
|
@ -1206,11 +1184,11 @@ var buildPathname = function(template, params) {
|
||||||
if (newHashIndex >= 0) result0 += (hashIndex < 0 ? "" : "&") + resolved.slice(newHashIndex)
|
if (newHashIndex >= 0) result0 += (hashIndex < 0 ? "" : "&") + resolved.slice(newHashIndex)
|
||||||
return result0
|
return result0
|
||||||
}
|
}
|
||||||
var _17 = function($window, oncompletion) {
|
var _18 = function($window, oncompletion) {
|
||||||
function PromiseProxy(executor) {
|
function PromiseProxy(executor) {
|
||||||
return new Promise(executor)
|
return new Promise(executor)
|
||||||
}
|
}
|
||||||
function fetch(url, args) {
|
function makeRequest(url, args) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
url = buildPathname(url, args.params)
|
url = buildPathname(url, args.params)
|
||||||
var method = args.method != null ? args.method.toUpperCase() : "GET"
|
var method = args.method != null ? args.method.toUpperCase() : "GET"
|
||||||
|
|
@ -1348,7 +1326,7 @@ var _17 = function($window, oncompletion) {
|
||||||
request: function(url, args) {
|
request: function(url, args) {
|
||||||
if (typeof url !== "string") { args = url; url = url.url }
|
if (typeof url !== "string") { args = url; url = url.url }
|
||||||
else if (args == null) args = {}
|
else if (args == null) args = {}
|
||||||
var promise = fetch(url, args)
|
var promise = makeRequest(url, args)
|
||||||
if (args.background === true) return promise
|
if (args.background === true) return promise
|
||||||
var count = 0
|
var count = 0
|
||||||
function complete() {
|
function complete() {
|
||||||
|
|
@ -1367,27 +1345,28 @@ var _17 = function($window, oncompletion) {
|
||||||
promise.constructor = PromiseProxy
|
promise.constructor = PromiseProxy
|
||||||
promise.then = function() {
|
promise.then = function() {
|
||||||
count++
|
count++
|
||||||
var next0 = then.apply(promise, arguments)
|
var next = then.apply(promise, arguments)
|
||||||
next0.then(complete, function(e) {
|
next.then(complete, function(e) {
|
||||||
complete()
|
complete()
|
||||||
if (count === 0) throw e
|
if (count === 0) throw e
|
||||||
})
|
})
|
||||||
return wrap(next0)
|
return wrap(next)
|
||||||
}
|
}
|
||||||
return promise
|
return promise
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var request = _17(typeof window !== "undefined" ? window : null, mountRedraw0.redraw)
|
var request = _18(typeof window !== "undefined" ? window : null, mountRedraw0.redraw)
|
||||||
var mountRedraw = mountRedraw0
|
var mountRedraw = mountRedraw0
|
||||||
|
var domFor = df
|
||||||
var m = function m() { return hyperscript.apply(this, arguments) }
|
var m = function m() { return hyperscript.apply(this, arguments) }
|
||||||
m.m = hyperscript
|
m.m = hyperscript
|
||||||
m.trust = hyperscript.trust
|
m.trust = hyperscript.trust
|
||||||
m.fragment = hyperscript.fragment
|
m.fragment = hyperscript.fragment
|
||||||
m.Fragment = "["
|
m.Fragment = "["
|
||||||
m.mount = mountRedraw.mount
|
m.mount = mountRedraw.mount
|
||||||
var m6 = hyperscript
|
var m5 = hyperscript
|
||||||
function decodeURIComponentSave0(str) {
|
function decodeURIComponentSave0(str) {
|
||||||
try {
|
try {
|
||||||
return decodeURIComponent(str)
|
return decodeURIComponent(str)
|
||||||
|
|
@ -1466,8 +1445,8 @@ var compileTemplate = function(template) {
|
||||||
// don't also accidentally escape `-` and make it harder to detect it to
|
// don't also accidentally escape `-` and make it harder to detect it to
|
||||||
// ban it from template parameters.
|
// ban it from template parameters.
|
||||||
/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,
|
/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,
|
||||||
function(m7, key6, extra) {
|
function(m6, key6, extra) {
|
||||||
if (key6 == null) return "\\" + m7
|
if (key6 == null) return "\\" + m6
|
||||||
keys.push({k: key6, r: extra === "..."})
|
keys.push({k: key6, r: extra === "..."})
|
||||||
if (extra === "...") return "(.*)"
|
if (extra === "...") return "(.*)"
|
||||||
if (extra === ".") return "([^/]+)\\."
|
if (extra === ".") return "([^/]+)\\."
|
||||||
|
|
@ -1539,7 +1518,7 @@ function decodeURIComponentSave(component) {
|
||||||
return component
|
return component
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var _26 = function($window, mountRedraw00) {
|
var _28 = function($window, mountRedraw00) {
|
||||||
var callAsync = $window == null
|
var callAsync = $window == null
|
||||||
// In case Mithril.js' loaded globally without the DOM, let's not break
|
// In case Mithril.js' loaded globally without the DOM, let's not break
|
||||||
? null
|
? null
|
||||||
|
|
@ -1638,7 +1617,7 @@ var _26 = function($window, mountRedraw00) {
|
||||||
setPath(fallbackRoute, null, {replace: true})
|
setPath(fallbackRoute, null, {replace: true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set it unconditionally so `m6.route.set` and `m6.route.Link` both work,
|
// Set it unconditionally so `m5.route.set` and `m5.route.Link` both work,
|
||||||
// even if neither `pushState` nor `hashchange` are supported. It's
|
// even if neither `pushState` nor `hashchange` are supported. It's
|
||||||
// cleared if `hashchange` is1 used, since that makes it automatically
|
// cleared if `hashchange` is1 used, since that makes it automatically
|
||||||
// async.
|
// async.
|
||||||
|
|
@ -1710,7 +1689,7 @@ var _26 = function($window, mountRedraw00) {
|
||||||
//
|
//
|
||||||
// We don't strip the other parameters because for convenience we
|
// We don't strip the other parameters because for convenience we
|
||||||
// let them be specified in the selector as well.
|
// let them be specified in the selector as well.
|
||||||
var child0 = m6(
|
var child0 = m5(
|
||||||
vnode5.attrs.selector || "a",
|
vnode5.attrs.selector || "a",
|
||||||
censor(vnode5.attrs, ["options", "params", "selector", "onclick"]),
|
censor(vnode5.attrs, ["options", "params", "selector", "onclick"]),
|
||||||
vnode5.children
|
vnode5.children
|
||||||
|
|
@ -1750,13 +1729,13 @@ var _26 = function($window, mountRedraw00) {
|
||||||
// would expect. There's a lot more valid ways to click a
|
// would expect. There's a lot more valid ways to click a
|
||||||
// link than this, and one might want to not simply click a
|
// link than this, and one might want to not simply click a
|
||||||
// link, but right click or command-click it to copy the
|
// link, but right click or command-click it to copy the
|
||||||
// link target, etc. Nope, this isn't just for blind people.
|
// link target2, etc. Nope, this isn't just for blind people.
|
||||||
if (
|
if (
|
||||||
// Skip if `onclick` prevented default
|
// Skip if `onclick` prevented default
|
||||||
result1 !== false && !e.defaultPrevented &&
|
result1 !== false && !e.defaultPrevented &&
|
||||||
// Ignore everything but left clicks
|
// Ignore everything but left clicks
|
||||||
(e.button === 0 || e.which === 0 || e.which === 1) &&
|
(e.button === 0 || e.which === 0 || e.which === 1) &&
|
||||||
// Let the browser handle `target=_blank`, etc.
|
// Let the browser handle `target2=_blank`, etc.
|
||||||
(!e.currentTarget.target || e.currentTarget.target === "_self") &&
|
(!e.currentTarget.target || e.currentTarget.target === "_self") &&
|
||||||
// No modifier keys
|
// No modifier keys
|
||||||
!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey
|
!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey
|
||||||
|
|
@ -1775,7 +1754,7 @@ var _26 = function($window, mountRedraw00) {
|
||||||
}
|
}
|
||||||
return route
|
return route
|
||||||
}
|
}
|
||||||
m.route = _26(typeof window !== "undefined" ? window : null, mountRedraw)
|
m.route = _28(typeof window !== "undefined" ? window : null, mountRedraw)
|
||||||
m.render = render
|
m.render = render
|
||||||
m.redraw = mountRedraw.redraw
|
m.redraw = mountRedraw.redraw
|
||||||
m.request = request.request
|
m.request = request.request
|
||||||
|
|
@ -1785,6 +1764,7 @@ m.parsePathname = parsePathname
|
||||||
m.buildPathname = buildPathname
|
m.buildPathname = buildPathname
|
||||||
m.vnode = Vnode
|
m.vnode = Vnode
|
||||||
m.censor = censor
|
m.censor = censor
|
||||||
|
m.domFor = domFor.domFor
|
||||||
if (typeof module !== "undefined") module["exports"] = m
|
if (typeof module !== "undefined") module["exports"] = m
|
||||||
else window.m = m
|
else window.m = m
|
||||||
}());
|
}());
|
||||||
2
mithril.min.js
vendored
2
mithril.min.js
vendored
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "mithril",
|
"name": "mithril",
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mithril",
|
"name": "mithril",
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@alrra/travis-scripts": "^3.0.1",
|
"@alrra/travis-scripts": "^3.0.1",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mithril",
|
"name": "mithril",
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"description": "A framework for building brilliant applications",
|
"description": "A framework for building brilliant applications",
|
||||||
"author": "Leo Horie",
|
"author": "Leo Horie",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
2
stream/stream.min.js
vendored
2
stream/stream.min.js
vendored
|
|
@ -1 +1 @@
|
||||||
!function(){"use strict";t.SKIP={},t.lift=function(){var n=arguments[0];return r(Array.prototype.slice.call(arguments,1)).map((function(t){return n.apply(void 0,t)}))},t.scan=function(n,e,r){var a=r.map((function(r){var a=n(e,r);return a!==t.SKIP&&(e=a),a}));return a(e),a},t.merge=r,t.combine=e,t.scanMerge=function(n,t){var r=n.map((function(n){return n[0]})),a=e((function(){var e=arguments[arguments.length-1];return r.forEach((function(r,a){e.indexOf(r)>-1&&(t=n[a][1](t,r()))})),t}),r);return a(t),a},t["fantasy-land/of"]=t;var n=!1;function t(n){var r,i=[],u=[];function c(e){return arguments.length&&e!==t.SKIP&&(n=e,a(c)&&(c._changing(),c._state="active",i.slice().forEach((function(t,e){a(t)&&t(this[e](n))}),u.slice()))),n}return c.constructor=t,c._state=arguments.length&&n!==t.SKIP?"active":"pending",c._parents=[],c._changing=function(){a(c)&&(c._state="changing"),i.forEach((function(n){n._changing()}))},c._map=function(e,r){var a=r?t():t(e(n));return a._parents.push(c),i.push(a),u.push(e),a},c.map=function(n){return c._map(n,"active"!==c._state)},c.toJSON=function(){return null!=n&&"function"==typeof n.toJSON?n.toJSON():n},c["fantasy-land/map"]=c.map,c["fantasy-land/ap"]=function(n){return e((function(n,t){return n()(t())}),[n,c])},c._unregisterChild=function(n){var t=i.indexOf(n);-1!==t&&(i.splice(t,1),u.splice(t,1))},Object.defineProperty(c,"end",{get:function(){return r||((r=t()).map((function(n){return!0===n&&(c._parents.forEach((function(n){n._unregisterChild(c)})),c._state="ended",c._parents.length=i.length=u.length=0),n})),r)}}),c}function e(n,e){var r=e.every((function(n){if(n.constructor!==t)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream.");return"active"===n._state})),a=r?t(n.apply(null,e.concat([e]))):t(),i=[],u=e.map((function(t){return t._map((function(u){return i.push(t),(r||e.every((function(n){return"pending"!==n._state})))&&(r=!0,a(n.apply(null,e.concat([i]))),i=[]),u}),!0)})),c=a.end.map((function(n){!0===n&&(u.forEach((function(n){n.end(!0)})),c.end(!0))}));return a}function r(n){return e((function(){return n.map((function(n){return n()}))}),n)}function a(n){return"pending"===n._state||"active"===n._state||"changing"===n._state}Object.defineProperty(t,"HALT",{get:function(){return n||console.log("HALT is deprecated and has been renamed to SKIP"),n=!0,t.SKIP}}),"undefined"!=typeof module?module.exports=t:"function"!=typeof window.m||"stream"in window.m?window.m={stream:t}:window.m.stream=t}();
|
!function(){"use strict";t.SKIP={},t.lift=function(){var n=arguments[0],t=Array.prototype.slice.call(arguments,1);return r(t).map((function(t){return n.apply(void 0,t)}))},t.scan=function(n,e,r){var a=r.map((function(r){var a=n(e,r);return a!==t.SKIP&&(e=a),a}));return a(e),a},t.merge=r,t.combine=e,t.scanMerge=function(n,t){var r=n.map((function(n){return n[0]})),a=e((function(){var e=arguments[arguments.length-1];return r.forEach((function(r,a){e.indexOf(r)>-1&&(t=n[a][1](t,r()))})),t}),r);return a(t),a},t["fantasy-land/of"]=t;var n=!1;function t(n){var r,i=[],u=[];function c(e){return arguments.length&&e!==t.SKIP&&(n=e,a(c)&&(c._changing(),c._state="active",i.slice().forEach((function(t,e){a(t)&&t(this[e](n))}),u.slice()))),n}function o(){return(r=t()).map((function(n){return!0===n&&(c._parents.forEach((function(n){n._unregisterChild(c)})),c._state="ended",c._parents.length=i.length=u.length=0),n})),r}return c.constructor=t,c._state=arguments.length&&n!==t.SKIP?"active":"pending",c._parents=[],c._changing=function(){a(c)&&(c._state="changing"),i.forEach((function(n){n._changing()}))},c._map=function(e,r){var a=r?t():t(e(n));return a._parents.push(c),i.push(a),u.push(e),a},c.map=function(n){return c._map(n,"active"!==c._state)},c.toJSON=function(){return null!=n&&"function"==typeof n.toJSON?n.toJSON():n},c["fantasy-land/map"]=c.map,c["fantasy-land/ap"]=function(n){return e((function(n,t){return n()(t())}),[n,c])},c._unregisterChild=function(n){var t=i.indexOf(n);-1!==t&&(i.splice(t,1),u.splice(t,1))},Object.defineProperty(c,"end",{get:function(){return r||o()}}),c}function e(n,e){var r=e.every((function(n){if(n.constructor!==t)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream.");return"active"===n._state})),a=r?t(n.apply(null,e.concat([e]))):t(),i=[],u=e.map((function(t){return t._map((function(u){return i.push(t),(r||e.every((function(n){return"pending"!==n._state})))&&(r=!0,a(n.apply(null,e.concat([i]))),i=[]),u}),!0)})),c=a.end.map((function(n){!0===n&&(u.forEach((function(n){n.end(!0)})),c.end(!0))}));return a}function r(n){return e((function(){return n.map((function(n){return n()}))}),n)}function a(n){return"pending"===n._state||"active"===n._state||"changing"===n._state}Object.defineProperty(t,"HALT",{get:function(){return n||console.log("HALT is deprecated and has been renamed to SKIP"),n=!0,t.SKIP}}),"undefined"!=typeof module?module.exports=t:"function"!=typeof window.m||"stream"in window.m?window.m={stream:t}:window.m.stream=t}();
|
||||||
Loading…
Add table
Add a link
Reference in a new issue