Comparing version 5.0.0-alpha.10 to 5.0.0-alpha.11
@@ -13,6 +13,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
opts = _extends({}, defs, opts); | ||
var e = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
var e = void 0; | ||
if ('composed' in CustomEvent.prototype) { | ||
e = new CustomEvent(name, opts); | ||
} else { | ||
e = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
} | ||
return elem.dispatchEvent(e); | ||
} |
@@ -62,5 +62,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
export function keys() { | ||
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
export function keys(obj) { | ||
obj = obj || {}; | ||
var names = Object.getOwnPropertyNames(obj); | ||
@@ -67,0 +66,0 @@ return Object.getOwnPropertySymbols ? names.concat(Object.getOwnPropertySymbols(obj)) : names; |
@@ -5,34 +5,5 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import { dashCase, keys, sym } from '.'; | ||
import { dashCase } from '.'; | ||
export function defineProps(Ctor) { | ||
if (Ctor._definedProps) return; | ||
Ctor._definedProps = true; | ||
var props = normPropDefs(Ctor); | ||
Object.defineProperties(Ctor.prototype, keys(props).reduce(function (prev, curr) { | ||
var _props$curr = props[curr], | ||
target = _props$curr.attribute.target, | ||
coerce = _props$curr.coerce, | ||
def = _props$curr.default, | ||
serialize = _props$curr.serialize; | ||
var _value = sym(curr); | ||
prev[curr] = { | ||
configurable: true, | ||
get: function get() { | ||
var val = this[_value]; | ||
return val == null ? def : val; | ||
}, | ||
set: function set(val) { | ||
this[_value] = coerce(val); | ||
syncPropertyToAttribute(this, target, serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}; | ||
return prev; | ||
}, {})); | ||
} | ||
export function normAttribute(name, prop) { | ||
export function normaliseAttributeDefinition(name, prop) { | ||
var attribute = prop.attribute; | ||
@@ -53,3 +24,3 @@ | ||
export function normPropDef(name, prop) { | ||
export function normalisePropertyDefinition(name, prop) { | ||
var coerce = prop.coerce, | ||
@@ -61,3 +32,3 @@ def = prop.default, | ||
return { | ||
attribute: normAttribute(name, prop), | ||
attribute: normaliseAttributeDefinition(name, prop), | ||
coerce: coerce || function (v) { | ||
@@ -76,9 +47,2 @@ return v; | ||
export function normPropDefs(Ctor) { | ||
return Ctor._normalizedProps || (Ctor._normalizedProps = keys(Ctor.props).reduce(function (prev, curr) { | ||
prev[curr] = normPropDef(curr, Ctor.props[curr] || {}); | ||
return prev; | ||
}, {})); | ||
} | ||
export function syncAttributeToProperty(elem, name, value) { | ||
@@ -88,3 +52,3 @@ if (elem._syncingPropertyToAttribute) { | ||
} | ||
var propDefs = normPropDefs(elem.constructor); | ||
var propDefs = elem.constructor.props; | ||
for (var propName in propDefs) { | ||
@@ -91,0 +55,0 @@ var _propDefs$propName = propDefs[propName], |
@@ -24,3 +24,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_class.prototype.rendererCallback = function rendererCallback(shadowRoot, renderCallback) { | ||
this._preactDom = render(renderCallback(), shadowRoot, this._preactDom); | ||
this._preactDom = render(renderCallback(), shadowRoot, this._preactDom || shadowRoot.children[0]); | ||
}; | ||
@@ -27,0 +27,0 @@ |
@@ -1,3 +0,1 @@ | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -11,12 +9,53 @@ | ||
import { debounce, empty, keys } from './util'; | ||
import { debounce, empty, keys, sym } from './util'; | ||
import { defineProps, normPropDefs, syncAttributeToProperty } from './util/with-props'; | ||
import { normalisePropertyDefinition, syncAttributeToProperty, syncPropertyToAttribute } from './util/with-props'; | ||
export function prop(definition) { | ||
var propertyDefinition = definition || {}; | ||
// Allows decorators, or imperative definitions. | ||
var func = function func(_ref, name) { | ||
var constructor = _ref.constructor; | ||
var normalised = normalisePropertyDefinition(name, propertyDefinition); | ||
var _value = sym(name); | ||
// Cache the value so we can reference when syncing the attribute to the property. | ||
constructor._props[name] = normalised; | ||
if (normalised.attribute.source) { | ||
constructor.observedAttributes = normalised.attribute.source; | ||
} | ||
Object.defineProperty(constructor.prototype, name, { | ||
configurable: true, | ||
get: function get() { | ||
var val = this[_value]; | ||
return val == null ? normalised.default : val; | ||
}, | ||
set: function set(val) { | ||
this[_value] = normalised.coerce(val); | ||
syncPropertyToAttribute(this, normalised.attribute.target, normalised.serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}); | ||
}; | ||
// Allows easy extension of pre-defined props { ...prop(), ...{} }. | ||
Object.keys(propertyDefinition).forEach(function (key) { | ||
return func[key] = propertyDefinition[key]; | ||
}); | ||
return func; | ||
} | ||
export var withProps = function withProps() { | ||
var _class, _temp; | ||
var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : HTMLElement; | ||
return function (_Base) { | ||
_inherits(_class2, _Base); | ||
return _temp = _class = function (_Base) { | ||
_inherits(_class, _Base); | ||
_createClass(_class2, [{ | ||
_createClass(_class, [{ | ||
key: 'props', | ||
@@ -42,18 +81,25 @@ get: function get() { | ||
get: function get() { | ||
var props = normPropDefs(this); | ||
return keys(props).map(function (k) { | ||
return props[k].attribute; | ||
}).filter(Boolean) | ||
// $FlowFixMe - find out how to do a.source while accepting non-object primitives. | ||
.map(function (a) { | ||
return a.source; | ||
}).concat(this._observedAttributes || []); | ||
return this._observedAttributes; | ||
}, | ||
set: function set(attrs) { | ||
this._observedAttributes = attrs; | ||
this._observedAttributes = this.observedAttributes.concat(attrs); | ||
} | ||
}, { | ||
key: 'props', | ||
get: function get() { | ||
return this._props; | ||
}, | ||
set: function set(props) { | ||
var _this4 = this; | ||
keys(props).forEach(function (name) { | ||
var func = props[name]; | ||
if (typeof func !== 'function') func = prop(func); | ||
func({ constructor: _this4 }, name); | ||
}); | ||
} | ||
}]); | ||
function _class2() { | ||
_classCallCheck(this, _class2); | ||
function _class() { | ||
_classCallCheck(this, _class); | ||
@@ -86,3 +132,2 @@ var _this = _possibleConstructorReturn(this, _Base.call(this)); | ||
_this._constructed = true; | ||
defineProps(_this.constructor); | ||
_this._updateDebounced = debounce(_this._updateCallback); | ||
@@ -92,3 +137,3 @@ return _this; | ||
_class2.prototype.connectedCallback = function connectedCallback() { | ||
_class.prototype.connectedCallback = function connectedCallback() { | ||
if (this._connected) return; | ||
@@ -101,6 +146,6 @@ this._connected = true; | ||
_class2.prototype.disconnectedCallback = function disconnectedCallback() { | ||
_class.prototype.disconnectedCallback = function disconnectedCallback() { | ||
if (!this._connected) return; | ||
this._connected = false; | ||
// $FlowFixMe - HTMLElement doesn't implement disConnectedCallback. | ||
// $FlowFixMe - HTMLElement doesn't implement disconnectedCallback. | ||
if (_Base.prototype.disconnectedCallback) _Base.prototype.disconnectedCallback.call(this); | ||
@@ -112,3 +157,3 @@ }; | ||
_class2.prototype.propsChangedCallback = function propsChangedCallback() {}; | ||
_class.prototype.propsChangedCallback = function propsChangedCallback() {}; | ||
@@ -118,3 +163,3 @@ // Called whenever props are set, even if they don't change. | ||
_class2.prototype.propsSetCallback = function propsSetCallback() {}; | ||
_class.prototype.propsSetCallback = function propsSetCallback() {}; | ||
@@ -124,3 +169,3 @@ // Called to see if the props changed. | ||
_class2.prototype.propsUpdatedCallback = function propsUpdatedCallback(next, prev) { | ||
_class.prototype.propsUpdatedCallback = function propsUpdatedCallback(next, prev) { | ||
return !prev || keys(prev).some(function (k) { | ||
@@ -131,3 +176,3 @@ return prev[k] !== next[k]; | ||
_class2.prototype.attributeChangedCallback = function attributeChangedCallback(name, oldValue, newValue) { | ||
_class.prototype.attributeChangedCallback = function attributeChangedCallback(name, oldValue, newValue) { | ||
// $FlowFixMe - HTMLElement doesn't implement attributeChangedCallback. | ||
@@ -141,4 +186,4 @@ if (_Base.prototype.attributeChangedCallback) _Base.prototype.attributeChangedCallback.call(this, name, oldValue, newValue); | ||
return _class2; | ||
}(Base); | ||
return _class; | ||
}(Base), _class._observedAttributes = [], _class._props = {}, _temp; | ||
}; | ||
@@ -150,5 +195,2 @@ | ||
var attribute = Object.freeze({ source: true }); | ||
var createProp = function createProp(obj) { | ||
return Object.freeze(_extends({ attribute: attribute }, obj)); | ||
}; | ||
var zeroOrNumber = function zeroOrNumber(val) { | ||
@@ -158,3 +200,8 @@ return empty(val) ? 0 : Number(val); | ||
var array = createProp({ | ||
var any = prop({ | ||
attribute: attribute | ||
}); | ||
var array = prop({ | ||
attribute: attribute, | ||
coerce: function coerce(val) { | ||
@@ -168,3 +215,4 @@ return Array.isArray(val) ? val : empty(val) ? null : [val]; | ||
var boolean = createProp({ | ||
var boolean = prop({ | ||
attribute: attribute, | ||
coerce: Boolean, | ||
@@ -180,3 +228,4 @@ default: false, | ||
var number = createProp({ | ||
var number = prop({ | ||
attribute: attribute, | ||
default: 0, | ||
@@ -190,3 +239,4 @@ coerce: zeroOrNumber, | ||
var object = createProp({ | ||
var object = prop({ | ||
attribute: attribute, | ||
default: Object.freeze({}), | ||
@@ -197,3 +247,4 @@ deserialize: parse, | ||
var string = createProp({ | ||
var string = prop({ | ||
attribute: attribute, | ||
default: '', | ||
@@ -207,2 +258,3 @@ coerce: String, | ||
export var props = { | ||
any: any, | ||
array: array, | ||
@@ -209,0 +261,0 @@ boolean: boolean, |
{ | ||
"name": "skatejs", | ||
"version": "5.0.0-alpha.10", | ||
"version": "5.0.0-alpha.11", | ||
"description": "Skate is a library built on top of the W3C web component specs that enables you to write functional and performant web components with a very small footprint.", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"module": "es/index.js", | ||
"es2015": "es-latest/index.js", | ||
"esnext": "esnext/index.js", | ||
"types": "src/index.d.ts", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"files": [ | ||
"es-latest", | ||
"esnext", | ||
"es", | ||
@@ -66,7 +66,7 @@ "src", | ||
"scripts": { | ||
"commitmsg": "validate-commit-msg", | ||
"docs:build": "gitbook install && gitbook build", | ||
"docs:watch": "gitbook install && gitbook serve", | ||
"precommit": "semistandard", | ||
"commitmsg": "validate-commit-msg", | ||
"prepublish": "nwb build && babel src --out-dir es-latest --presets=stage-0,es2017,es2016,react", | ||
"prepublish": "nwb build && babel src --out-dir esnext --presets=stage-0,es2017,es2016,react", | ||
"release": "git push && git push --tags && npm publish", | ||
@@ -73,0 +73,0 @@ "test": "semistandard && npm run prepublish && npm run test:ts && node umd/skatejs.js && jest", |
@@ -9,3 +9,3 @@ # [Skate][gitbook] | ||
[![Semantic Release](https://img.shields.io/badge/semantic--release-%F0%9F%9A%80-ffffff.svg)](https://github.com/semantic-release/semantic-release) | ||
[![OpenCollective](https://opencollective.com/skatejs/backers/badge.svg)](#backers) | ||
[![OpenCollective](https://opencollective.com/skatejs/backers/badge.svg)](#backers) | ||
[![OpenCollective](https://opencollective.com/skatejs/sponsors/badge.svg)](#sponsors) | ||
@@ -113,7 +113,7 @@ [![Follow @skate_js on Twitter](https://img.shields.io/twitter/follow/skate_js.svg?style=social&label=@skate_js)](https://twitter.com/skate_js) | ||
Native custom element support requires that you load a shim if you're not delivering native ES2015 classes to the browser. If you're transpiling to ES5, you must - at the very least - load the [native shim](https://github.com/webcomponents/custom-elements/blob/master/src/native-shim.js): | ||
Native custom element support requires that you load a shim if you're not delivering native ES2015 classes to the browser. If you're transpiling to ES5, you must - at the very least - load the [native shim](https://github.com/webcomponents/custom-elements/blob/master/src/native-shim.js). More information can be found in the [webcomponents/custom-elements](https://github.com/webcomponents/custom-elements#known-issues) repo. | ||
When you load Skate by module name (`import { ... } from 'skatejs';` or `require('skatejs');`), you'll be getting the transpiled source. Thus even if you author your components in ES2015, you'll still be getting ES5 base-classes and the native custom elements implementation will complain. If you want to deliever native classes you have to point to the non-transpiled Skate source: `import { ... } from 'skatejs/src';`. Currently this is not supported by our API versioning but we have an [issue](#992) to work around this. | ||
When you load Skate by module name (`import { ... } from 'skatejs';` or `require('skatejs');`), you'll be getting the transpiled source. Thus, even if you author your components in ES2015, you'll still be getting ES5 base-classes and the native custom elements implementation will complain. | ||
More information can be found in the [webcomponents/custom-elements](https://github.com/webcomponents/custom-elements#known-issues) repo. | ||
If you want to deliver native classes, you can configure Webpack to pull in a version of Skate that's been transpiled to the latest ES specification. More about this approach is detailed in [this blog post](http://2ality.com/2017/06/pkg-esnext.html). | ||
@@ -120,0 +120,0 @@ ## Browser Support |
@@ -13,6 +13,11 @@ // @flow | ||
opts = { ...defs, ...opts }; | ||
const e: ComposedCustomEvent = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
let e: ComposedCustomEvent; | ||
if ('composed' in CustomEvent.prototype) { | ||
e = new CustomEvent(name, opts); | ||
} else { | ||
e = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
} | ||
return elem.dispatchEvent(e); | ||
} |
@@ -49,4 +49,2 @@ // @flow | ||
export type PropDefinitions = { [string]: PropOptions }; | ||
export type PropOptionsNormalized = { | ||
@@ -60,2 +58,5 @@ attribute: { source: string, target: string}, | ||
export type PropsOptions = { [string]: PropOptions }; | ||
export type PropsOptionsNormalized = { [string]: PropOptionsNormalized }; | ||
export type WithLink = EventTarget & { | ||
@@ -67,1 +68,5 @@ checked?: boolean; | ||
}; | ||
export type HasConstructor = { | ||
constructor: Function | ||
}; |
@@ -53,3 +53,4 @@ // @flow | ||
export function keys (obj: Object = {}): Array<any> { | ||
export function keys (obj: Object | void): Array<any> { | ||
obj = obj || {}; | ||
const names = Object.getOwnPropertyNames(obj); | ||
@@ -56,0 +57,0 @@ return Object.getOwnPropertySymbols ? names.concat(Object.getOwnPropertySymbols(obj)) : names; |
// @flow | ||
import type { PropDefinitions, PropOptions, PropOptionsNormalized } from '../types'; | ||
import type { | ||
PropOptions, | ||
PropsOptionsNormalized | ||
} from '../types'; | ||
import { dashCase, keys, sym } from '.'; | ||
import { dashCase } from '.'; | ||
interface CanDefineProps extends HTMLElement { | ||
static _definedProps: boolean; | ||
static _normalizedProps: PropOptions; | ||
static prototype: Object; | ||
static props: PropDefinitions; | ||
static props: PropsOptionsNormalized; | ||
@@ -17,27 +18,3 @@ _syncingAttributeToProperty: string | null; | ||
export function defineProps (Ctor: Class<CanDefineProps>): void { | ||
if (Ctor._definedProps) return; | ||
Ctor._definedProps = true; | ||
const props: PropOptionsNormalized = normPropDefs(Ctor); | ||
Object.defineProperties(Ctor.prototype, keys(props).reduce((prev: PropDefinitions, curr: string): Object => { | ||
const { attribute: { target }, coerce, default: def, serialize } = props[curr]; | ||
const _value = sym(curr); | ||
prev[curr] = { | ||
configurable: true, | ||
get () { | ||
const val = this[_value]; | ||
return val == null ? def : val; | ||
}, | ||
set (val) { | ||
this[_value] = coerce(val); | ||
syncPropertyToAttribute(this, target, serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}; | ||
return prev; | ||
}, {})); | ||
} | ||
export function normAttribute (name: string, prop: PropOptions): Object { | ||
export function normaliseAttributeDefinition (name: string, prop: PropOptions): Object { | ||
const { attribute } = prop; | ||
@@ -57,6 +34,6 @@ const obj = typeof attribute === 'object' ? { ...attribute } : { | ||
export function normPropDef (name: string, prop: PropOptions): Object { | ||
export function normalisePropertyDefinition (name: string, prop: PropOptions): Object { | ||
const { coerce, default: def, deserialize, serialize } = prop; | ||
return { | ||
attribute: normAttribute(name, prop), | ||
attribute: normaliseAttributeDefinition(name, prop), | ||
coerce: coerce || ((v: mixed) => v), | ||
@@ -69,12 +46,2 @@ default: def, | ||
export function normPropDefs (Ctor: Class<CanDefineProps>): Object { | ||
return Ctor._normalizedProps || ( | ||
Ctor._normalizedProps = keys(Ctor.props) | ||
.reduce((prev: Object, curr: string) => { | ||
prev[curr] = normPropDef(curr, Ctor.props[curr] || {}); | ||
return prev; | ||
}, {}) | ||
); | ||
} | ||
export function syncAttributeToProperty (elem: CanDefineProps, name: string, value: mixed): void { | ||
@@ -84,3 +51,3 @@ if (elem._syncingPropertyToAttribute) { | ||
} | ||
const propDefs: { [string]: PropOptionsNormalized } = normPropDefs(elem.constructor); | ||
const propDefs: PropsOptionsNormalized = elem.constructor.props; | ||
for (let propName in propDefs) { | ||
@@ -87,0 +54,0 @@ const { attribute: { source }, deserialize } = propDefs[propName]; |
@@ -12,3 +12,3 @@ // @flow | ||
rendererCallback (shadowRoot: Node, renderCallback: () => Object) { | ||
this._preactDom = render(renderCallback(), shadowRoot, this._preactDom); | ||
this._preactDom = render(renderCallback(), shadowRoot, this._preactDom || shadowRoot.children[0]); | ||
} | ||
@@ -15,0 +15,0 @@ }; |
// @flow | ||
import type { | ||
HasConstructor, | ||
PropOptions, | ||
PropOptionsAttribute | ||
PropsOptionsNormalized | ||
} from './types'; | ||
@@ -11,19 +12,52 @@ | ||
empty, | ||
keys | ||
keys, | ||
sym | ||
} from './util'; | ||
import { | ||
defineProps, | ||
normPropDefs, | ||
syncAttributeToProperty | ||
normalisePropertyDefinition, | ||
syncAttributeToProperty, | ||
syncPropertyToAttribute | ||
} from './util/with-props'; | ||
export function prop (definition: PropOptions | void): Function { | ||
const propertyDefinition: PropOptions = definition || {}; | ||
// Allows decorators, or imperative definitions. | ||
const func = function ({ constructor }: HasConstructor, name: string): void { | ||
const normalised = normalisePropertyDefinition(name, propertyDefinition); | ||
const _value = sym(name); | ||
// Cache the value so we can reference when syncing the attribute to the property. | ||
constructor._props[name] = normalised; | ||
if (normalised.attribute.source) { | ||
constructor.observedAttributes = normalised.attribute.source; | ||
} | ||
Object.defineProperty(constructor.prototype, name, { | ||
configurable: true, | ||
get () { | ||
const val = this[_value]; | ||
return val == null ? normalised.default : val; | ||
}, | ||
set (val) { | ||
this[_value] = normalised.coerce(val); | ||
syncPropertyToAttribute(this, normalised.attribute.target, normalised.serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}); | ||
}; | ||
// Allows easy extension of pre-defined props { ...prop(), ...{} }. | ||
Object.keys(propertyDefinition).forEach(key => (func[key] = propertyDefinition[key])); | ||
return func; | ||
} | ||
export const withProps = (Base?: Class<HTMLElement> = HTMLElement): Class<HTMLElement> => | ||
class extends Base { | ||
static _definedProps: boolean; | ||
static _normalizedProps: { [string]: PropOptions }; | ||
static _observedAttributes: Array<string>; | ||
static _observedAttributes: Array<string> = []; | ||
static _props: PropsOptionsNormalized = {}; | ||
static props: { [string]: PropOptions }; | ||
_connected: boolean; | ||
@@ -38,15 +72,21 @@ _constructed: boolean; | ||
static get observedAttributes (): Array<string> { | ||
const props: { [string]: PropOptions } = normPropDefs(this); | ||
return keys(props) | ||
.map((k: string): ?PropOptionsAttribute => props[k].attribute) | ||
.filter(Boolean) | ||
// $FlowFixMe - find out how to do a.source while accepting non-object primitives. | ||
.map((a: PropOptionsAttribute) => a.source) | ||
.concat(this._observedAttributes || []); | ||
return this._observedAttributes; | ||
} | ||
static set observedAttributes (attrs: Array<string>) { | ||
this._observedAttributes = attrs; | ||
static set observedAttributes (attrs: string | Array<string>) { | ||
this._observedAttributes = this.observedAttributes.concat(attrs); | ||
} | ||
static get props (): PropsOptionsNormalized { | ||
return this._props; | ||
} | ||
static set props (props: PropOptions): void { | ||
keys(props).forEach(name => { | ||
let func = props[name]; | ||
if (typeof func !== 'function') func = prop(func); | ||
func({ constructor: this }, name); | ||
}); | ||
} | ||
get props (): Object { | ||
@@ -68,3 +108,2 @@ return keys(this.constructor.props).reduce((prev: Object, curr: string) => { | ||
this._constructed = true; | ||
defineProps(this.constructor); | ||
this._updateDebounced = debounce(this._updateCallback); | ||
@@ -84,3 +123,3 @@ } | ||
this._connected = false; | ||
// $FlowFixMe - HTMLElement doesn't implement disConnectedCallback. | ||
// $FlowFixMe - HTMLElement doesn't implement disconnectedCallback. | ||
if (super.disconnectedCallback) super.disconnectedCallback(); | ||
@@ -132,6 +171,10 @@ } | ||
const attribute = Object.freeze({ source: true }); | ||
const createProp = (obj: PropOptions): PropOptions => Object.freeze({ ...{ attribute }, ...obj }); | ||
const zeroOrNumber = (val: string): number => (empty(val) ? 0 : Number(val)); | ||
const array: PropOptions = createProp({ | ||
const any: Function = prop({ | ||
attribute | ||
}); | ||
const array: Function = prop({ | ||
attribute, | ||
coerce: <T>(val: Array<T> | T): Array<T> | null => Array.isArray(val) ? val : (empty(val) ? null : [val]), | ||
@@ -143,3 +186,4 @@ default: Object.freeze([]), | ||
const boolean: PropOptions = createProp({ | ||
const boolean: Function = prop({ | ||
attribute, | ||
coerce: Boolean, | ||
@@ -151,3 +195,4 @@ default: false, | ||
const number: PropOptions = createProp({ | ||
const number: Function = prop({ | ||
attribute, | ||
default: 0, | ||
@@ -159,3 +204,4 @@ coerce: zeroOrNumber, | ||
const object: PropOptions = createProp({ | ||
const object: Function = prop({ | ||
attribute, | ||
default: Object.freeze({}), | ||
@@ -166,3 +212,4 @@ deserialize: parse, | ||
const string: PropOptions = createProp({ | ||
const string: Function = prop({ | ||
attribute, | ||
default: '', | ||
@@ -174,2 +221,3 @@ coerce: String, | ||
export const props = { | ||
any, | ||
array, | ||
@@ -176,0 +224,0 @@ boolean, |
/*! | ||
* skatejs v5.0.0-alpha.10 | ||
* skatejs v5.0.0-alpha.11 | ||
* MIT Licensed | ||
@@ -89,6 +89,6 @@ */ | ||
/* harmony export (immutable) */ __webpack_exports__["a"] = dashCase; | ||
/* harmony export (immutable) */ __webpack_exports__["c"] = debounce; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return empty; }); | ||
/* harmony export (immutable) */ __webpack_exports__["b"] = keys; | ||
/* harmony export (immutable) */ __webpack_exports__["e"] = sym; | ||
/* harmony export (immutable) */ __webpack_exports__["d"] = debounce; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return empty; }); | ||
/* harmony export (immutable) */ __webpack_exports__["c"] = keys; | ||
/* harmony export (immutable) */ __webpack_exports__["b"] = sym; | ||
/* unused harmony export uniqueId */ | ||
@@ -156,5 +156,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function keys() { | ||
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
function keys(obj) { | ||
obj = obj || {}; | ||
var names = Object.getOwnPropertyNames(obj); | ||
@@ -183,6 +182,5 @@ return Object.getOwnPropertySymbols ? names.concat(Object.getOwnPropertySymbols(obj)) : names; | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_with_props__ = __webpack_require__(9); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return withProps; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return props; }); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
/* harmony export (immutable) */ __webpack_exports__["a"] = prop; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return withProps; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return props; }); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -200,8 +198,49 @@ | ||
function prop(definition) { | ||
var propertyDefinition = definition || {}; | ||
// Allows decorators, or imperative definitions. | ||
var func = function func(_ref, name) { | ||
var constructor = _ref.constructor; | ||
var normalised = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_with_props__["a" /* normalisePropertyDefinition */])(name, propertyDefinition); | ||
var _value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* sym */])(name); | ||
// Cache the value so we can reference when syncing the attribute to the property. | ||
constructor._props[name] = normalised; | ||
if (normalised.attribute.source) { | ||
constructor.observedAttributes = normalised.attribute.source; | ||
} | ||
Object.defineProperty(constructor.prototype, name, { | ||
configurable: true, | ||
get: function get() { | ||
var val = this[_value]; | ||
return val == null ? normalised.default : val; | ||
}, | ||
set: function set(val) { | ||
this[_value] = normalised.coerce(val); | ||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_with_props__["b" /* syncPropertyToAttribute */])(this, normalised.attribute.target, normalised.serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}); | ||
}; | ||
// Allows easy extension of pre-defined props { ...prop(), ...{} }. | ||
Object.keys(propertyDefinition).forEach(function (key) { | ||
return func[key] = propertyDefinition[key]; | ||
}); | ||
return func; | ||
} | ||
var withProps = function withProps() { | ||
var _class, _temp; | ||
var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : HTMLElement; | ||
return function (_Base) { | ||
_inherits(_class2, _Base); | ||
return _temp = _class = function (_Base) { | ||
_inherits(_class, _Base); | ||
_createClass(_class2, [{ | ||
_createClass(_class, [{ | ||
key: 'props', | ||
@@ -211,3 +250,3 @@ get: function get() { | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* keys */])(this.constructor.props).reduce(function (prev, curr) { | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* keys */])(this.constructor.props).reduce(function (prev, curr) { | ||
prev[curr] = _this2[curr]; | ||
@@ -221,3 +260,3 @@ return prev; | ||
var ctorProps = this.constructor.props; | ||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* keys */])(props).forEach(function (k) { | ||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* keys */])(props).forEach(function (k) { | ||
return k in ctorProps && (_this3[k] = props[k]); | ||
@@ -229,18 +268,25 @@ }); | ||
get: function get() { | ||
var props = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_with_props__["a" /* normPropDefs */])(this); | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* keys */])(props).map(function (k) { | ||
return props[k].attribute; | ||
}).filter(Boolean) | ||
// $FlowFixMe - find out how to do a.source while accepting non-object primitives. | ||
.map(function (a) { | ||
return a.source; | ||
}).concat(this._observedAttributes || []); | ||
return this._observedAttributes; | ||
}, | ||
set: function set(attrs) { | ||
this._observedAttributes = attrs; | ||
this._observedAttributes = this.observedAttributes.concat(attrs); | ||
} | ||
}, { | ||
key: 'props', | ||
get: function get() { | ||
return this._props; | ||
}, | ||
set: function set(props) { | ||
var _this4 = this; | ||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* keys */])(props).forEach(function (name) { | ||
var func = props[name]; | ||
if (typeof func !== 'function') func = prop(func); | ||
func({ constructor: _this4 }, name); | ||
}); | ||
} | ||
}]); | ||
function _class2() { | ||
_classCallCheck(this, _class2); | ||
function _class() { | ||
_classCallCheck(this, _class); | ||
@@ -273,8 +319,7 @@ var _this = _possibleConstructorReturn(this, _Base.call(this)); | ||
_this._constructed = true; | ||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_with_props__["b" /* defineProps */])(_this.constructor); | ||
_this._updateDebounced = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* debounce */])(_this._updateCallback); | ||
_this._updateDebounced = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* debounce */])(_this._updateCallback); | ||
return _this; | ||
} | ||
_class2.prototype.connectedCallback = function connectedCallback() { | ||
_class.prototype.connectedCallback = function connectedCallback() { | ||
if (this._connected) return; | ||
@@ -287,6 +332,6 @@ this._connected = true; | ||
_class2.prototype.disconnectedCallback = function disconnectedCallback() { | ||
_class.prototype.disconnectedCallback = function disconnectedCallback() { | ||
if (!this._connected) return; | ||
this._connected = false; | ||
// $FlowFixMe - HTMLElement doesn't implement disConnectedCallback. | ||
// $FlowFixMe - HTMLElement doesn't implement disconnectedCallback. | ||
if (_Base.prototype.disconnectedCallback) _Base.prototype.disconnectedCallback.call(this); | ||
@@ -298,3 +343,3 @@ }; | ||
_class2.prototype.propsChangedCallback = function propsChangedCallback() {}; | ||
_class.prototype.propsChangedCallback = function propsChangedCallback() {}; | ||
@@ -304,3 +349,3 @@ // Called whenever props are set, even if they don't change. | ||
_class2.prototype.propsSetCallback = function propsSetCallback() {}; | ||
_class.prototype.propsSetCallback = function propsSetCallback() {}; | ||
@@ -310,4 +355,4 @@ // Called to see if the props changed. | ||
_class2.prototype.propsUpdatedCallback = function propsUpdatedCallback(next, prev) { | ||
return !prev || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* keys */])(prev).some(function (k) { | ||
_class.prototype.propsUpdatedCallback = function propsUpdatedCallback(next, prev) { | ||
return !prev || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* keys */])(prev).some(function (k) { | ||
return prev[k] !== next[k]; | ||
@@ -317,3 +362,3 @@ }); | ||
_class2.prototype.attributeChangedCallback = function attributeChangedCallback(name, oldValue, newValue) { | ||
_class.prototype.attributeChangedCallback = function attributeChangedCallback(name, oldValue, newValue) { | ||
// $FlowFixMe - HTMLElement doesn't implement attributeChangedCallback. | ||
@@ -327,4 +372,4 @@ if (_Base.prototype.attributeChangedCallback) _Base.prototype.attributeChangedCallback.call(this, name, oldValue, newValue); | ||
return _class2; | ||
}(Base); | ||
return _class; | ||
}(Base), _class._observedAttributes = [], _class._props = {}, _temp; | ||
}; | ||
@@ -336,12 +381,14 @@ | ||
var attribute = Object.freeze({ source: true }); | ||
var createProp = function createProp(obj) { | ||
return Object.freeze(_extends({ attribute: attribute }, obj)); | ||
}; | ||
var zeroOrNumber = function zeroOrNumber(val) { | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* empty */])(val) ? 0 : Number(val); | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* empty */])(val) ? 0 : Number(val); | ||
}; | ||
var array = createProp({ | ||
var any = prop({ | ||
attribute: attribute | ||
}); | ||
var array = prop({ | ||
attribute: attribute, | ||
coerce: function coerce(val) { | ||
return Array.isArray(val) ? val : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* empty */])(val) ? null : [val]; | ||
return Array.isArray(val) ? val : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* empty */])(val) ? null : [val]; | ||
}, | ||
@@ -353,7 +400,8 @@ default: Object.freeze([]), | ||
var boolean = createProp({ | ||
var boolean = prop({ | ||
attribute: attribute, | ||
coerce: Boolean, | ||
default: false, | ||
deserialize: function deserialize(val) { | ||
return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* empty */])(val); | ||
return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* empty */])(val); | ||
}, | ||
@@ -365,3 +413,4 @@ serialize: function serialize(val) { | ||
var number = createProp({ | ||
var number = prop({ | ||
attribute: attribute, | ||
default: 0, | ||
@@ -371,7 +420,8 @@ coerce: zeroOrNumber, | ||
serialize: function serialize(val) { | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* empty */])(val) ? null : String(Number(val)); | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* empty */])(val) ? null : String(Number(val)); | ||
} | ||
}); | ||
var object = createProp({ | ||
var object = prop({ | ||
attribute: attribute, | ||
default: Object.freeze({}), | ||
@@ -382,7 +432,8 @@ deserialize: parse, | ||
var string = createProp({ | ||
var string = prop({ | ||
attribute: attribute, | ||
default: '', | ||
coerce: String, | ||
serialize: function serialize(val) { | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* empty */])(val) ? null : String(val); | ||
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* empty */])(val) ? null : String(val); | ||
} | ||
@@ -392,2 +443,3 @@ }); | ||
var props = { | ||
any: any, | ||
array: array, | ||
@@ -517,4 +569,5 @@ boolean: boolean, | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__with_props__ = __webpack_require__(1); | ||
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "withProps", function() { return __WEBPACK_IMPORTED_MODULE_4__with_props__["a"]; }); | ||
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "props", function() { return __WEBPACK_IMPORTED_MODULE_4__with_props__["b"]; }); | ||
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "prop", function() { return __WEBPACK_IMPORTED_MODULE_4__with_props__["a"]; }); | ||
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "withProps", function() { return __WEBPACK_IMPORTED_MODULE_4__with_props__["b"]; }); | ||
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "props", function() { return __WEBPACK_IMPORTED_MODULE_4__with_props__["c"]; }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__with_render__ = __webpack_require__(2); | ||
@@ -569,5 +622,10 @@ /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "withRender", function() { return __WEBPACK_IMPORTED_MODULE_5__with_render__["a"]; }); | ||
opts = _extends({}, defs, opts); | ||
var e = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
var e = void 0; | ||
if ('composed' in CustomEvent.prototype) { | ||
e = new CustomEvent(name, opts); | ||
} else { | ||
e = document.createEvent('CustomEvent'); | ||
e.initCustomEvent(name, opts.bubbles, opts.cancelable, opts.detail); | ||
Object.defineProperty(e, 'composed', { value: opts.composed }); | ||
} | ||
return elem.dispatchEvent(e); | ||
@@ -634,8 +692,6 @@ } | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0____ = __webpack_require__(0); | ||
/* harmony export (immutable) */ __webpack_exports__["b"] = defineProps; | ||
/* unused harmony export normAttribute */ | ||
/* unused harmony export normPropDef */ | ||
/* harmony export (immutable) */ __webpack_exports__["a"] = normPropDefs; | ||
/* unused harmony export normaliseAttributeDefinition */ | ||
/* harmony export (immutable) */ __webpack_exports__["a"] = normalisePropertyDefinition; | ||
/* harmony export (immutable) */ __webpack_exports__["c"] = syncAttributeToProperty; | ||
/* unused harmony export syncPropertyToAttribute */ | ||
/* harmony export (immutable) */ __webpack_exports__["b"] = syncPropertyToAttribute; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -647,32 +703,3 @@ | ||
function defineProps(Ctor) { | ||
if (Ctor._definedProps) return; | ||
Ctor._definedProps = true; | ||
var props = normPropDefs(Ctor); | ||
Object.defineProperties(Ctor.prototype, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0____["b" /* keys */])(props).reduce(function (prev, curr) { | ||
var _props$curr = props[curr], | ||
target = _props$curr.attribute.target, | ||
coerce = _props$curr.coerce, | ||
def = _props$curr.default, | ||
serialize = _props$curr.serialize; | ||
var _value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0____["e" /* sym */])(curr); | ||
prev[curr] = { | ||
configurable: true, | ||
get: function get() { | ||
var val = this[_value]; | ||
return val == null ? def : val; | ||
}, | ||
set: function set(val) { | ||
this[_value] = coerce(val); | ||
syncPropertyToAttribute(this, target, serialize, val); | ||
this._updateDebounced(); | ||
} | ||
}; | ||
return prev; | ||
}, {})); | ||
} | ||
function normAttribute(name, prop) { | ||
function normaliseAttributeDefinition(name, prop) { | ||
var attribute = prop.attribute; | ||
@@ -693,3 +720,3 @@ | ||
function normPropDef(name, prop) { | ||
function normalisePropertyDefinition(name, prop) { | ||
var coerce = prop.coerce, | ||
@@ -701,3 +728,3 @@ def = prop.default, | ||
return { | ||
attribute: normAttribute(name, prop), | ||
attribute: normaliseAttributeDefinition(name, prop), | ||
coerce: coerce || function (v) { | ||
@@ -716,9 +743,2 @@ return v; | ||
function normPropDefs(Ctor) { | ||
return Ctor._normalizedProps || (Ctor._normalizedProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0____["b" /* keys */])(Ctor.props).reduce(function (prev, curr) { | ||
prev[curr] = normPropDef(curr, Ctor.props[curr] || {}); | ||
return prev; | ||
}, {})); | ||
} | ||
function syncAttributeToProperty(elem, name, value) { | ||
@@ -728,3 +748,3 @@ if (elem._syncingPropertyToAttribute) { | ||
} | ||
var propDefs = normPropDefs(elem.constructor); | ||
var propDefs = elem.constructor.props; | ||
for (var propName in propDefs) { | ||
@@ -820,7 +840,7 @@ var _propDefs$propName = propDefs[propName], | ||
_class.prototype.rendererCallback = function rendererCallback(shadowRoot, renderCallback) { | ||
this._preactDom = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_preact__["render"])(renderCallback(), shadowRoot, this._preactDom); | ||
this._preactDom = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_preact__["render"])(renderCallback(), shadowRoot, this._preactDom || shadowRoot.children[0]); | ||
}; | ||
return _class; | ||
}(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__with_render__["a" /* withRender */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__with_unique__["a" /* withUnique */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__with_props__["a" /* withProps */])(Base)))); | ||
}(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__with_render__["a" /* withRender */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__with_unique__["a" /* withUnique */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__with_props__["b" /* withProps */])(Base)))); | ||
}; | ||
@@ -827,0 +847,0 @@ |
/*! | ||
* skatejs v5.0.0-alpha.10 | ||
* skatejs v5.0.0-alpha.11 | ||
* MIT Licensed | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("preact")):"function"==typeof define&&define.amd?define(["preact"],e):"object"==typeof exports?exports.skate=e(require("preact")):t.skate=e(t.preact)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=13)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return t.split(/([_A-Z])/).reduce(function(t,e,n){var r=t&&n%2!=0?"-":"";return e="_"===e?"":e,""+t+r+e.toLowerCase()})}function i(t){var e=!1,n=0,r=document.createElement("span");return new f(function(){t(),e=!1}).observe(r,{childList:!0}),function(){e||(e=!0,r.textContent=""+n,n+=1)}}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e}function c(t){return"function"==typeof Symbol?Symbol(t?String(t):void 0):a(t)}function a(t){return(t?String(t):"")+"xxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}e.a=o,e.c=i,n.d(e,"d",function(){return s}),e.b=u,e.e=c;var f="function"==typeof MutationObserver?MutationObserver:function(){function t(e){r(this,t),this.func=e}return t.prototype.observe=function(t){var e=this.func,n={set:function(){"undefined"==typeof Promise?setTimeout(e):new Promise(function(t){return t()}).then(e)}};Object.defineProperty(t,"textContent",n)},t}(),s=function(t){return null==t}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(0),c=n(9);n.d(e,"a",function(){return s}),n.d(e,"b",function(){return w});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){r(this,e);var i=o(this,t.call(this));return i._updateCallback=function(){if(!i._updating&&i._connected){i._updating=!0;var t=i._prevProps,e=i._prevProps=i.props;i.propsSetCallback(e,t),i.propsUpdatedCallback(e,t)&&i.propsChangedCallback(e,t),i._updating=!1}},i._constructed?o(i):(i._constructed=!0,n.i(c.b)(i.constructor),i._updateDebounced=n.i(u.c)(i._updateCallback),i)}return i(e,t),f(e,[{key:"props",get:function(){var t=this;return n.i(u.b)(this.constructor.props).reduce(function(e,n){return e[n]=t[n],e},{})},set:function(t){var e=this,r=this.constructor.props;n.i(u.b)(t).forEach(function(n){return n in r&&(e[n]=t[n])})}}],[{key:"observedAttributes",get:function(){var t=n.i(c.a)(this);return n.i(u.b)(t).map(function(e){return t[e].attribute}).filter(Boolean).map(function(t){return t.source}).concat(this._observedAttributes||[])},set:function(t){this._observedAttributes=t}}]),e.prototype.connectedCallback=function(){this._connected||(this._connected=!0,t.prototype.connectedCallback&&t.prototype.connectedCallback.call(this),this._updateDebounced())},e.prototype.disconnectedCallback=function(){this._connected&&(this._connected=!1,t.prototype.disconnectedCallback&&t.prototype.disconnectedCallback.call(this))},e.prototype.propsChangedCallback=function(){},e.prototype.propsSetCallback=function(){},e.prototype.propsUpdatedCallback=function(t,e){return!e||n.i(u.b)(e).some(function(n){return e[n]!==t[n]})},e.prototype.attributeChangedCallback=function(e,r,o){t.prototype.attributeChangedCallback&&t.prototype.attributeChangedCallback.call(this,e,r,o),n.i(c.c)(this,e,o)},e}(t)},l=JSON.parse,p=JSON.stringify,b=Object.freeze({source:!0}),d=function(t){return Object.freeze(a({attribute:b},t))},y=function(t){return n.i(u.d)(t)?0:Number(t)},h=d({coerce:function(t){return Array.isArray(t)?t:n.i(u.d)(t)?null:[t]},default:Object.freeze([]),deserialize:l,serialize:p}),v=d({coerce:Boolean,default:!1,deserialize:function(t){return!n.i(u.d)(t)},serialize:function(t){return t?"":null}}),m=d({default:0,coerce:y,deserialize:y,serialize:function(t){return n.i(u.d)(t)?null:String(Number(t))}}),g=d({default:Object.freeze({}),deserialize:l,serialize:p}),_=d({default:"",coerce:String,serialize:function(t){return n.i(u.d)(t)?null:String(t)}}),w={array:h,boolean:v,number:m,object:g,string:_}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return t.attachShadow?t.attachShadow(a):t}n.d(e,"a",function(){return f});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a={mode:"open"},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.propsChangedCallback=function(){var t=this;this.rendererCallback(this.renderRoot,function(){return t.renderCallback(t)}),this.renderedCallback()},e.prototype.renderCallback=function(){},e.prototype.renderedCallback=function(){},e.prototype.rendererCallback=function(){},c(e,[{key:"renderRoot",get:function(){return this._shadowRoot=this._shadowRoot||(this._shadowRoot=this.shadowRoot||u(this)),this._shadowRoot}}]),e}(t)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(10);n.d(e,"a",function(){return a});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),c(e,null,[{key:"is",get:function(){return this._is||(this._is=n.i(u.a)(this))},set:function(t){this._is=t}}]),e}(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5);n.d(e,"define",function(){return r.a});var o=n(6);n.d(e,"emit",function(){return o.a});var i=n(7);n.d(e,"link",function(){return i.a});var u=n(11);n.d(e,"withComponent",function(){return u.a}),n.d(e,"Component",function(){return u.b}),n.d(e,"h",function(){return u.c});var c=n(1);n.d(e,"withProps",function(){return c.a}),n.d(e,"props",function(){return c.b});var a=n(2);n.d(e,"withRender",function(){return a.a});var f=n(3);n.d(e,"withUnique",function(){return f.a})},function(t,e,n){"use strict";function r(t){var e=customElements,n=t.is;return e.get(n)||e.define(n,t),t}e.a=r},function(t,e,n){"use strict";function r(t,e,n){n=i({},u,n);var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),Object.defineProperty(r,"composed",{value:n.composed}),t.dispatchEvent(r)}var o=n(8);n.n(o);e.a=r;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u={bubbles:!0,cancelable:!0,composed:!1}},function(t,e,n){"use strict";function r(t){var e=t.checked,n=t.type,r=t.value;return"checkbox"===n||"radio"===n?!!e&&(r||!0):r}function o(t,e){return function(n){var o=n.target||n.composedPath&&n.composedPath()[0],i=r(o),u=e||o.name||"value";if(u.indexOf(".")>-1){var c=u.split("."),a=c[0],f=c.pop();c.reduce(function(t,e){return t[e]},t)[f||o.name]=i,t[a]=t[a]}else t[u]=i}}e.a=o},function(t,e){},function(t,e,n){"use strict";function r(t){if(!t._definedProps){t._definedProps=!0;var e=u(t);Object.defineProperties(t.prototype,n.i(f.b)(e).reduce(function(t,r){var o=e[r],i=o.attribute.target,u=o.coerce,c=o.default,s=o.serialize,l=n.i(f.e)(r);return t[r]={configurable:!0,get:function(){var t=this[l];return null==t?c:t},set:function(t){this[l]=u(t),a(this,i,s,t),this._updateDebounced()}},t},{}))}}function o(t,e){var r=e.attribute,o="object"===(void 0===r?"undefined":l(r))?s({},r):{source:r,target:r};return!0===o.source&&(o.source=n.i(f.a)(t)),!0===o.target&&(o.target=n.i(f.a)(t)),o}function i(t,e){var n=e.coerce,r=e.default,i=e.deserialize,u=e.serialize;return{attribute:o(t,e),coerce:n||function(t){return t},default:r,deserialize:i||function(t){return t},serialize:u||function(t){return t}}}function u(t){return t._normalizedProps||(t._normalizedProps=n.i(f.b)(t.props).reduce(function(e,n){return e[n]=i(n,t.props[n]||{}),e},{}))}function c(t,e,n){if(!t._syncingPropertyToAttribute){var r=u(t.constructor);for(var o in r){var i=r[o],c=i.attribute.source,a=i.deserialize;c===e&&(t._syncingAttributeToProperty=o,t[o]=null==n?n:a(n),t._syncingAttributeToProperty=null)}}}function a(t,e,n,r){if(e&&t._syncingAttributeToProperty!==e){var o=n(r);t._syncingPropertyToAttribute=!0,null==o?t.removeAttribute(e):t.setAttribute(e,o),t._syncingPropertyToAttribute=!1}}var f=n(0);e.b=r,e.a=u,e.c=c;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}},function(t,e,n){"use strict";function r(t,e){return t=t||"element",(-1===t.indexOf("-")?"x-"+t:t)+(e?"-"+e:"")}function o(t){for(var e=customElements,o=n.i(i.a)(t.name);e.get(r(o,u));)u++;return r(o,u++)}var i=n(0);e.a=o;var u=0},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(12),c=(n.n(u),n(1)),a=n(2),f=n(3);n.o(u,"h")&&n.d(e,"c",function(){return u.h}),n.d(e,"a",function(){return s}),n.d(e,"b",function(){return l});var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.rendererCallback=function(t,e){this._preactDom=n.i(u.render)(e(),t,this._preactDom)},e}(n.i(a.a)(n.i(f.a)(n.i(c.a)(t))))},l=s("undefined"==typeof window?function(){function t(){r(this,t)}return t}():HTMLElement)},function(t,e){t.exports=require("preact")},function(t,e,n){t.exports=n(4)}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("preact")):"function"==typeof define&&define.amd?define(["preact"],e):"object"==typeof exports?exports.skate=e(require("preact")):t.skate=e(t.preact)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=13)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return t.split(/([_A-Z])/).reduce(function(t,e,n){var r=t&&n%2!=0?"-":"";return e="_"===e?"":e,""+t+r+e.toLowerCase()})}function i(t){var e=!1,n=0,r=document.createElement("span");return new f(function(){t(),e=!1}).observe(r,{childList:!0}),function(){e||(e=!0,r.textContent=""+n,n+=1)}}function u(t){t=t||{};var e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e}function c(t){return"function"==typeof Symbol?Symbol(t?String(t):void 0):a(t)}function a(t){return(t?String(t):"")+"xxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}e.a=o,e.d=i,n.d(e,"e",function(){return s}),e.c=u,e.b=c;var f="function"==typeof MutationObserver?MutationObserver:function(){function t(e){r(this,t),this.func=e}return t.prototype.observe=function(t){var e=this.func,n={set:function(){"undefined"==typeof Promise?setTimeout(e):new Promise(function(t){return t()}).then(e)}};Object.defineProperty(t,"textContent",n)},t}(),s=function(t){return null==t}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){var e=t||{},r=function(t,r){var o=t.constructor,i=n.i(a.a)(r,e),u=n.i(c.b)(r);o._props[r]=i,i.attribute.source&&(o.observedAttributes=i.attribute.source),Object.defineProperty(o.prototype,r,{configurable:!0,get:function(){var t=this[u];return null==t?i.default:t},set:function(t){this[u]=i.coerce(t),n.i(a.b)(this,i.attribute.target,i.serialize,t),this._updateDebounced()}})};return Object.keys(e).forEach(function(t){return r[t]=e[t]}),r}var c=n(0),a=n(9);e.a=u,n.d(e,"b",function(){return s}),n.d(e,"c",function(){return w});var f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(){var t,e,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return e=t=function(t){function e(){r(this,e);var i=o(this,t.call(this));return i._updateCallback=function(){if(!i._updating&&i._connected){i._updating=!0;var t=i._prevProps,e=i._prevProps=i.props;i.propsSetCallback(e,t),i.propsUpdatedCallback(e,t)&&i.propsChangedCallback(e,t),i._updating=!1}},i._constructed?o(i):(i._constructed=!0,i._updateDebounced=n.i(c.d)(i._updateCallback),i)}return i(e,t),f(e,[{key:"props",get:function(){var t=this;return n.i(c.c)(this.constructor.props).reduce(function(e,n){return e[n]=t[n],e},{})},set:function(t){var e=this,r=this.constructor.props;n.i(c.c)(t).forEach(function(n){return n in r&&(e[n]=t[n])})}}],[{key:"observedAttributes",get:function(){return this._observedAttributes},set:function(t){this._observedAttributes=this.observedAttributes.concat(t)}},{key:"props",get:function(){return this._props},set:function(t){var e=this;n.i(c.c)(t).forEach(function(n){var r=t[n];"function"!=typeof r&&(r=u(r)),r({constructor:e},n)})}}]),e.prototype.connectedCallback=function(){this._connected||(this._connected=!0,t.prototype.connectedCallback&&t.prototype.connectedCallback.call(this),this._updateDebounced())},e.prototype.disconnectedCallback=function(){this._connected&&(this._connected=!1,t.prototype.disconnectedCallback&&t.prototype.disconnectedCallback.call(this))},e.prototype.propsChangedCallback=function(){},e.prototype.propsSetCallback=function(){},e.prototype.propsUpdatedCallback=function(t,e){return!e||n.i(c.c)(e).some(function(n){return e[n]!==t[n]})},e.prototype.attributeChangedCallback=function(e,r,o){t.prototype.attributeChangedCallback&&t.prototype.attributeChangedCallback.call(this,e,r,o),n.i(a.c)(this,e,o)},e}(s),t._observedAttributes=[],t._props={},e},p=JSON.parse,l=JSON.stringify,b=Object.freeze({source:!0}),d=function(t){return n.i(c.e)(t)?0:Number(t)},y=u({attribute:b}),h=u({attribute:b,coerce:function(t){return Array.isArray(t)?t:n.i(c.e)(t)?null:[t]},default:Object.freeze([]),deserialize:p,serialize:l}),v=u({attribute:b,coerce:Boolean,default:!1,deserialize:function(t){return!n.i(c.e)(t)},serialize:function(t){return t?"":null}}),m=u({attribute:b,default:0,coerce:d,deserialize:d,serialize:function(t){return n.i(c.e)(t)?null:String(Number(t))}}),g=u({attribute:b,default:Object.freeze({}),deserialize:p,serialize:l}),_=u({attribute:b,default:"",coerce:String,serialize:function(t){return n.i(c.e)(t)?null:String(t)}}),w={any:y,array:h,boolean:v,number:m,object:g,string:_}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return t.attachShadow?t.attachShadow(a):t}n.d(e,"a",function(){return f});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a={mode:"open"},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.propsChangedCallback=function(){var t=this;this.rendererCallback(this.renderRoot,function(){return t.renderCallback(t)}),this.renderedCallback()},e.prototype.renderCallback=function(){},e.prototype.renderedCallback=function(){},e.prototype.rendererCallback=function(){},c(e,[{key:"renderRoot",get:function(){return this._shadowRoot=this._shadowRoot||(this._shadowRoot=this.shadowRoot||u(this)),this._shadowRoot}}]),e}(t)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(10);n.d(e,"a",function(){return a});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),c(e,null,[{key:"is",get:function(){return this._is||(this._is=n.i(u.a)(this))},set:function(t){this._is=t}}]),e}(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5);n.d(e,"define",function(){return r.a});var o=n(6);n.d(e,"emit",function(){return o.a});var i=n(7);n.d(e,"link",function(){return i.a});var u=n(11);n.d(e,"withComponent",function(){return u.a}),n.d(e,"Component",function(){return u.b}),n.d(e,"h",function(){return u.c});var c=n(1);n.d(e,"prop",function(){return c.a}),n.d(e,"withProps",function(){return c.b}),n.d(e,"props",function(){return c.c});var a=n(2);n.d(e,"withRender",function(){return a.a});var f=n(3);n.d(e,"withUnique",function(){return f.a})},function(t,e,n){"use strict";function r(t){var e=customElements,n=t.is;return e.get(n)||e.define(n,t),t}e.a=r},function(t,e,n){"use strict";function r(t,e,n){n=i({},u,n);var r=void 0;return"composed"in CustomEvent.prototype?r=new CustomEvent(e,n):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),Object.defineProperty(r,"composed",{value:n.composed})),t.dispatchEvent(r)}var o=n(8);n.n(o);e.a=r;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u={bubbles:!0,cancelable:!0,composed:!1}},function(t,e,n){"use strict";function r(t){var e=t.checked,n=t.type,r=t.value;return"checkbox"===n||"radio"===n?!!e&&(r||!0):r}function o(t,e){return function(n){var o=n.target||n.composedPath&&n.composedPath()[0],i=r(o),u=e||o.name||"value";if(u.indexOf(".")>-1){var c=u.split("."),a=c[0],f=c.pop();c.reduce(function(t,e){return t[e]},t)[f||o.name]=i,t[a]=t[a]}else t[u]=i}}e.a=o},function(t,e){},function(t,e,n){"use strict";function r(t,e){var r=e.attribute,o="object"===(void 0===r?"undefined":f(r))?a({},r):{source:r,target:r};return!0===o.source&&(o.source=n.i(c.a)(t)),!0===o.target&&(o.target=n.i(c.a)(t)),o}function o(t,e){var n=e.coerce,o=e.default,i=e.deserialize,u=e.serialize;return{attribute:r(t,e),coerce:n||function(t){return t},default:o,deserialize:i||function(t){return t},serialize:u||function(t){return t}}}function i(t,e,n){if(!t._syncingPropertyToAttribute){var r=t.constructor.props;for(var o in r){var i=r[o],u=i.attribute.source,c=i.deserialize;u===e&&(t._syncingAttributeToProperty=o,t[o]=null==n?n:c(n),t._syncingAttributeToProperty=null)}}}function u(t,e,n,r){if(e&&t._syncingAttributeToProperty!==e){var o=n(r);t._syncingPropertyToAttribute=!0,null==o?t.removeAttribute(e):t.setAttribute(e,o),t._syncingPropertyToAttribute=!1}}var c=n(0);e.a=o,e.c=i,e.b=u;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}},function(t,e,n){"use strict";function r(t,e){return t=t||"element",(-1===t.indexOf("-")?"x-"+t:t)+(e?"-"+e:"")}function o(t){for(var e=customElements,o=n.i(i.a)(t.name);e.get(r(o,u));)u++;return r(o,u++)}var i=n(0);e.a=o;var u=0},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(12),c=(n.n(u),n(1)),a=n(2),f=n(3);n.o(u,"h")&&n.d(e,"c",function(){return u.h}),n.d(e,"a",function(){return s}),n.d(e,"b",function(){return p});var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HTMLElement;return function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.rendererCallback=function(t,e){this._preactDom=n.i(u.render)(e(),t,this._preactDom||t.children[0])},e}(n.i(a.a)(n.i(f.a)(n.i(c.b)(t))))},p=s("undefined"==typeof window?function(){function t(){r(this,t)}return t}():HTMLElement)},function(t,e){t.exports=require("preact")},function(t,e,n){t.exports=n(4)}])}); | ||
//# sourceMappingURL=skatejs.min.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197047
2331
45