diff --git a/dist/esm/src/elements.d.ts b/dist/esm/src/elements.d.ts new file mode 100644 index 000000000..05711fde6 --- /dev/null +++ b/dist/esm/src/elements.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +declare type AttributeValue = any; +export interface Children { + children?: AttributeValue; +} +export interface CustomElementHandler { + (attributes: Attributes & Children, contents: string[]): string; +} +export interface Attributes { + [key: string]: AttributeValue; +} +export declare function createElement(name: string | CustomElementHandler, attributes?: Attributes & Children | undefined, ...contents: string[]): string; +export {}; +//# sourceMappingURL=elements.d.ts.map \ No newline at end of file diff --git a/dist/esm/src/elements.d.ts.map b/dist/esm/src/elements.d.ts.map new file mode 100644 index 000000000..bc57b5822 --- /dev/null +++ b/dist/esm/src/elements.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/elements.tsx"],"names":[],"mappings":";;;AAIA,aAAK,cAAc,GAAG,GAAG,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACjC,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACnE;AAED,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CACjC;AAgGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAC7D,UAAU,GAAE,UAAU,GAAG,QAAQ,GAAG,SAAc,EAClD,GAAG,QAAQ,EAAE,MAAM,EAAE,UAaxB"} \ No newline at end of file diff --git a/dist/esm/src/elements.js b/dist/esm/src/elements.js new file mode 100644 index 000000000..4564d585c --- /dev/null +++ b/dist/esm/src/elements.js @@ -0,0 +1,113 @@ +/// +/// +/// +const capitalACharCode = 'A'.charCodeAt(0); +const capitalZCharCode = 'Z'.charCodeAt(0); +const isUpper = (input, index) => { + const charCode = input.charCodeAt(index); + return capitalACharCode <= charCode && capitalZCharCode >= charCode; +}; +const toKebabCase = (camelCased) => { + let kebabCased = ''; + for (let i = 0; i < camelCased.length; i++) { + const prevUpperCased = i > 0 ? isUpper(camelCased, i - 1) : true; + const currentUpperCased = isUpper(camelCased, i); + const nextUpperCased = i < camelCased.length - 1 ? isUpper(camelCased, i + 1) : true; + if (!prevUpperCased && currentUpperCased || currentUpperCased && !nextUpperCased) { + kebabCased += '-'; + kebabCased += camelCased[i].toLowerCase(); + } + else { + kebabCased += camelCased[i]; + } + } + return kebabCased; +}; +const escapeAttrNodeValue = (value) => { + return value.replace(/(&)|(")|(\u00A0)/g, function (_, amp, quote) { + if (amp) + return '&'; + if (quote) + return '"'; + return ' '; + }); +}; +const attributeToString = (attributes) => (name) => { + const value = attributes[name]; + const formattedName = toKebabCase(name); + const makeAttribute = (value) => `${formattedName}="${value}"`; + if (value instanceof Date) { + return makeAttribute(value.toISOString()); + } + else + switch (typeof value) { + case 'boolean': + // https://www.w3.org/TR/2008/WD-html5-20080610/semantics.html#boolean + if (value) { + return formattedName; + } + else { + return ''; + } + default: + return makeAttribute(escapeAttrNodeValue(value.toString())); + } +}; +const attributesToString = (attributes) => { + if (attributes) { + return ' ' + Object.keys(attributes) + .filter(attribute => attribute !== 'children') // filter out children attributes + .map(attributeToString(attributes)) + .filter(attribute => attribute.length) // filter out negative boolean attributes + .join(' '); + } + else { + return ''; + } +}; +const contentsToString = (contents) => { + if (contents) { + return contents + .map(elements => Array.isArray(elements) ? elements.join('\n') : elements) + .join('\n'); + } + else { + return ''; + } +}; +const isVoidElement = (tagName) => { + return [ + 'area', + 'base', + 'br', + 'col', + 'command', + 'embed', + 'hr', + 'img', + 'input', + 'keygen', + 'link', + 'meta', + 'param', + 'source', + 'track', + 'wbr' + ].indexOf(tagName) > -1; +}; +export function createElement(name, attributes = {}, ...contents) { + const children = attributes && attributes.children || contents; + if (typeof name === 'function') { + return name(children ? { children, ...attributes } : attributes, contents); + } + else { + const tagName = toKebabCase(name); + if (isVoidElement(tagName) && !contents.length) { + return `<${tagName}${attributesToString(attributes)}>`; + } + else { + return `<${tagName}${attributesToString(attributes)}>${contentsToString(contents)}`; + } + } +} +//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/dist/esm/src/elements.js.map b/dist/esm/src/elements.js.map new file mode 100644 index 000000000..8c05f1484 --- /dev/null +++ b/dist/esm/src/elements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/elements.tsx"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0CAA0C;AAC1C,sDAAsD;AAgBtD,MAAM,gBAAgB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC3C,MAAM,gBAAgB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAE3C,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE;IAC7C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,gBAAgB,IAAI,QAAQ,IAAI,gBAAgB,IAAI,QAAQ,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE;IACvC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACjD,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EA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,EAClD,GAAG,QAAkB;IACrB,MAAM,QAAQ,GAAG,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAE/D,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KAC9E;SAAM;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC5C,OAAO,IAAI,OAAO,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC;SAC1D;aAAM;YACH,OAAO,IAAI,OAAO,GAAG,kBAAkB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,OAAO,GAAG,CAAC;SACpG;KACJ;AACL,CAAC"} \ No newline at end of file diff --git a/dist/esm/src/tsconfig.tsbuildinfo b/dist/esm/src/tsconfig.tsbuildinfo new file mode 100644 index 000000000..21732e2d1 --- /dev/null +++ b/dist/esm/src/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../src/jsx/element-types.d.ts","../../../src/jsx/events.d.ts","../../../src/jsx/intrinsic-elements.d.ts","../../../src/elements.tsx"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"cd8a4b93731b5b29232387dd400975f733a9861e3133f6965e38a1e094661f64","affectsGlobalScope":true},{"version":"4104fa2d32fc91cb97b1bea62279fe252715ea5149033eaac7c1baa0669865d2","affectsGlobalScope":true},{"version":"27598174df5043b3e2f86eecbc5df0882e9cb35af8f90aa85486f5cc55cc284a","affectsGlobalScope":true},"7d92b1b3ded9883354ecd0916606dea9e95d780bf8f50aa97897dc48c9d13756"],"options":{"composite":true,"declaration":true,"declarationMap":true,"jsx":2,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"..","rootDir":"../../..","sourceMap":true,"strict":true,"target":99},"fileIdsList":[[13,14,15]],"referencedMap":[[16,1]],"exportedModulesMap":[[16,1]],"semanticDiagnosticsPerFile":[3,5,4,2,6,7,8,9,10,11,12,1,16,13,14,15]},"version":"4.3.5"} \ No newline at end of file diff --git a/dist/src/elements.d.ts b/dist/src/elements.d.ts new file mode 100644 index 000000000..3f9e36588 --- /dev/null +++ b/dist/src/elements.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +declare type AttributeValue = any; +export interface Children { + children?: AttributeValue; +} +export interface CustomElementHandler { + (attributes: Attributes & Children, contents: string[]): string; +} +export interface Attributes { + [key: string]: AttributeValue; +} +export declare function createElement(name: string | CustomElementHandler, attributes?: Attributes & Children | undefined, ...contents: string[]): string; +export {}; +//# sourceMappingURL=elements.d.ts.map \ No newline at end of file diff --git a/dist/src/elements.d.ts.map b/dist/src/elements.d.ts.map new file mode 100644 index 000000000..af5cc8da6 --- /dev/null +++ b/dist/src/elements.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/elements.tsx"],"names":[],"mappings":";;;AAIA,aAAK,cAAc,GAAG,GAAG,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACjC,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACnE;AAED,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CACjC;AAgGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAC7D,UAAU,GAAE,UAAU,GAAG,QAAQ,GAAG,SAAc,EAClD,GAAG,QAAQ,EAAE,MAAM,EAAE,UAaxB"} \ No newline at end of file diff --git a/dist/src/elements.js b/dist/src/elements.js new file mode 100644 index 000000000..bb5ea0639 --- /dev/null +++ b/dist/src/elements.js @@ -0,0 +1,117 @@ +"use strict"; +/// +/// +/// +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createElement = void 0; +const capitalACharCode = 'A'.charCodeAt(0); +const capitalZCharCode = 'Z'.charCodeAt(0); +const isUpper = (input, index) => { + const charCode = input.charCodeAt(index); + return capitalACharCode <= charCode && capitalZCharCode >= charCode; +}; +const toKebabCase = (camelCased) => { + let kebabCased = ''; + for (let i = 0; i < camelCased.length; i++) { + const prevUpperCased = i > 0 ? isUpper(camelCased, i - 1) : true; + const currentUpperCased = isUpper(camelCased, i); + const nextUpperCased = i < camelCased.length - 1 ? isUpper(camelCased, i + 1) : true; + if (!prevUpperCased && currentUpperCased || currentUpperCased && !nextUpperCased) { + kebabCased += '-'; + kebabCased += camelCased[i].toLowerCase(); + } + else { + kebabCased += camelCased[i]; + } + } + return kebabCased; +}; +const escapeAttrNodeValue = (value) => { + return value.replace(/(&)|(")|(\u00A0)/g, function (_, amp, quote) { + if (amp) + return '&'; + if (quote) + return '"'; + return ' '; + }); +}; +const attributeToString = (attributes) => (name) => { + const value = attributes[name]; + const formattedName = toKebabCase(name); + const makeAttribute = (value) => `${formattedName}="${value}"`; + if (value instanceof Date) { + return makeAttribute(value.toISOString()); + } + else + switch (typeof value) { + case 'boolean': + // https://www.w3.org/TR/2008/WD-html5-20080610/semantics.html#boolean + if (value) { + return formattedName; + } + else { + return ''; + } + default: + return makeAttribute(escapeAttrNodeValue(value.toString())); + } +}; +const attributesToString = (attributes) => { + if (attributes) { + return ' ' + Object.keys(attributes) + .filter(attribute => attribute !== 'children') // filter out children attributes + .map(attributeToString(attributes)) + .filter(attribute => attribute.length) // filter out negative boolean attributes + .join(' '); + } + else { + return ''; + } +}; +const contentsToString = (contents) => { + if (contents) { + return contents + .map(elements => Array.isArray(elements) ? elements.join('\n') : elements) + .join('\n'); + } + else { + return ''; + } +}; +const isVoidElement = (tagName) => { + return [ + 'area', + 'base', + 'br', + 'col', + 'command', + 'embed', + 'hr', + 'img', + 'input', + 'keygen', + 'link', + 'meta', + 'param', + 'source', + 'track', + 'wbr' + ].indexOf(tagName) > -1; +}; +function createElement(name, attributes = {}, ...contents) { + const children = attributes && attributes.children || contents; + if (typeof name === 'function') { + return name(children ? { children, ...attributes } : attributes, contents); + } + else { + const tagName = toKebabCase(name); + if (isVoidElement(tagName) && !contents.length) { + return `<${tagName}${attributesToString(attributes)}>`; + } + else { + return `<${tagName}${attributesToString(attributes)}>${contentsToString(contents)}`; + } + } +} +exports.createElement = createElement; +//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/dist/src/elements.js.map b/dist/src/elements.js.map new file mode 100644 index 000000000..503526a96 --- /dev/null +++ b/dist/src/elements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/elements.tsx"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,0CAA0C;AAC1C,sDAAsD;;;AAgBtD,MAAM,gBAAgB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC3C,MAAM,gBAAgB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAE3C,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE;IAC7C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,gBAAgB,IAAI,QAAQ,IAAI,gBAAgB,IAAI,QAAQ,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE;IACvC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;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ACH,MAAM;QACN,MAAM;QACN,IAAI;QACJ,KAAK;QACL,SAAS;QACT,OAAO;QACP,IAAI;QACJ,KAAK;QACL,OAAO;QACP,QAAQ;QACR,MAAM;QACN,MAAM;QACN,OAAO;QACP,QAAQ;QACR,OAAO;QACP,KAAK;KACR,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,SAAgB,aAAa,CAAC,IAAmC,EAC7D,aAAgD,EAAE,EAClD,GAAG,QAAkB;IACrB,MAAM,QAAQ,GAAG,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAE/D,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KAC9E;SAAM;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC5C,OAAO,IAAI,OAAO,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC;SAC1D;aAAM;YACH,OAAO,IAAI,OAAO,GAAG,kBAAkB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,OAAO,GAAG,CAAC;SACpG;KACJ;AACL,CAAC;AAfD,sCAeC"} \ No newline at end of file diff --git a/dist/src/tsconfig.tsbuildinfo b/dist/src/tsconfig.tsbuildinfo new file mode 100644 index 000000000..5ea6565e2 --- /dev/null +++ b/dist/src/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../src/jsx/element-types.d.ts","../../src/jsx/events.d.ts","../../src/jsx/intrinsic-elements.d.ts","../../src/elements.tsx"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"cd8a4b93731b5b29232387dd400975f733a9861e3133f6965e38a1e094661f64","affectsGlobalScope":true},{"version":"4104fa2d32fc91cb97b1bea62279fe252715ea5149033eaac7c1baa0669865d2","affectsGlobalScope":true},{"version":"27598174df5043b3e2f86eecbc5df0882e9cb35af8f90aa85486f5cc55cc284a","affectsGlobalScope":true},"7d92b1b3ded9883354ecd0916606dea9e95d780bf8f50aa97897dc48c9d13756"],"options":{"composite":true,"declaration":true,"declarationMap":true,"jsx":2,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"..","rootDir":"../..","sourceMap":true,"strict":true,"target":5},"fileIdsList":[[13,14,15]],"referencedMap":[[16,1]],"exportedModulesMap":[[16,1]],"semanticDiagnosticsPerFile":[3,5,4,2,6,7,8,9,10,11,12,1,16,13,14,15]},"version":"4.3.5"} \ No newline at end of file diff --git a/src/elements.tsx b/src/elements.tsx index 4a31ee8d3..440bdcd9a 100644 --- a/src/elements.tsx +++ b/src/elements.tsx @@ -2,7 +2,7 @@ /// /// -type AttributeValue = number | string | Date | boolean | string[]; +type AttributeValue = any; export interface Children { children?: AttributeValue; diff --git a/src/jsx/events.d.ts b/src/jsx/events.d.ts index ff44838dc..f454e0626 100644 --- a/src/jsx/events.d.ts +++ b/src/jsx/events.d.ts @@ -19,6 +19,7 @@ declare namespace JSX { onstorage?: string; onundo?: string; onunload?: string; + _?: string; } interface HtmlTag { oncontextmenu?: string; @@ -41,6 +42,7 @@ declare namespace JSX { onmouseup?: string; onmousewheel?: string; onscroll?: string; + _?: string; } interface FormEvents { onblur?: string;