Bump @justinribeiro/lite-youtube from 0.9.0 to 0.9.1 in /build/javascript (#273)
* Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript (#265) * Trying a new github workflow to install javascript packages * Bump tailwindcss from 1.9.2 to 1.9.4 in /build/javascript (#266) Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 1.9.2 to 1.9.4. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v1.9.2...v1.9.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript Bumps [preact](https://github.com/preactjs/preact) from 10.5.4 to 10.5.5. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.5.4...10.5.5) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owncast <owncast@owncast.online> * Bump @justinribeiro/lite-youtube in /build/javascript Bumps [@justinribeiro/lite-youtube](https://github.com/justinribeiro/lite-youtube) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/justinribeiro/lite-youtube/releases) - [Commits](https://github.com/justinribeiro/lite-youtube/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Owncast <owncast@owncast.online> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
202
build/javascript/node_modules/htm/LICENSE
generated
vendored
Normal file
202
build/javascript/node_modules/htm/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
279
build/javascript/node_modules/htm/README.md
generated
vendored
Normal file
279
build/javascript/node_modules/htm/README.md
generated
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
|
||||
<h1 align="center">
|
||||
HTM (Hyperscript Tagged Markup)
|
||||
<a href="https://www.npmjs.org/package/htm"><img src="https://img.shields.io/npm/v/htm.svg?style=flat" alt="npm"></a>
|
||||
</h1>
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/0ph8dbS.png" width="572" alt="hyperscript tagged markup demo">
|
||||
</p>
|
||||
|
||||
`htm` is **JSX-like syntax in plain JavaScript** - no transpiler necessary.
|
||||
|
||||
Develop with React/Preact directly in the browser, then compile `htm` away for production.
|
||||
|
||||
It uses standard JavaScript [Tagged Templates] and works in [all modern browsers].
|
||||
|
||||
## `htm` by the numbers:
|
||||
|
||||
🐣 **< 600 bytes** when used directly in the browser
|
||||
|
||||
⚛️ **< 500 bytes** when used with Preact _(thanks gzip 🌈)_
|
||||
|
||||
🥚 **< 450 byte** `htm/mini` version
|
||||
|
||||
🏅 **0 bytes** if compiled using [babel-plugin-htm]
|
||||
|
||||
|
||||
## Syntax: like JSX but also lit
|
||||
|
||||
The syntax you write when using HTM is as close as possible to JSX:
|
||||
|
||||
- Spread props: `<div ...${props}>`
|
||||
- Self-closing tags: `<div />`
|
||||
- Components: `<${Foo}>` _(where `Foo` is a component reference)_
|
||||
- Boolean attributes: `<div draggable />`
|
||||
|
||||
|
||||
## Improvements over JSX
|
||||
|
||||
`htm` actually takes the JSX-style syntax a couple steps further!
|
||||
|
||||
Here's some ergonomic features you get for free that aren't present in JSX:
|
||||
|
||||
- **No transpiler necessary**
|
||||
- HTML's optional quotes: `<div class=foo>`
|
||||
- Component end-tags: `<${Footer}>footer content<//>`
|
||||
- Syntax highlighting and language support via the [lit-html VSCode extension] and [vim-jsx-pretty plugin].
|
||||
- Multiple root element (fragments): `<div /><div />`
|
||||
- Support for HTML-style comments: `<div><!-- comment --></div>`
|
||||
|
||||
## Installation
|
||||
|
||||
`htm` is published to npm, and accessible via the unpkg.com CDN:
|
||||
|
||||
**via npm:**
|
||||
|
||||
```js
|
||||
npm i htm
|
||||
```
|
||||
|
||||
**hotlinking from unpkg:** _(no build tool needed!)_
|
||||
|
||||
```js
|
||||
import htm from 'https://unpkg.com/htm?module'
|
||||
const html = htm.bind(React.createElement);
|
||||
```
|
||||
|
||||
```js
|
||||
// just want htm + preact in a single file? there's a highly-optimized version of that:
|
||||
import { html, render } from 'https://unpkg.com/htm/preact/standalone.module.js'
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
If you're using Preact or React, we've included off-the-shelf bindings to make your life easier.
|
||||
They also have the added benefit of sharing a template cache across all modules.
|
||||
|
||||
```js
|
||||
import { render } from 'preact';
|
||||
import { html } from 'htm/preact';
|
||||
render(html`<a href="/">Hello!</a>`, document.body);
|
||||
```
|
||||
|
||||
Similarly, for React:
|
||||
|
||||
```js
|
||||
import ReactDOM from 'react-dom';
|
||||
import { html } from 'htm/react';
|
||||
ReactDOM.render(html`<a href="/">Hello!</a>`, document.body);
|
||||
```
|
||||
|
||||
### Advanced Usage
|
||||
|
||||
Since `htm` is a generic library, we need to tell it what to "compile" our templates to.
|
||||
You can bind `htm` to any function of the form `h(type, props, ...children)` _([hyperscript])_.
|
||||
This function can return anything - `htm` never looks at the return value.
|
||||
|
||||
Here's an example `h()` function that returns tree nodes:
|
||||
|
||||
```js
|
||||
function h(type, props, ...children) {
|
||||
return { type, props, children };
|
||||
}
|
||||
```
|
||||
|
||||
To use our custom `h()` function, we need to create our own `html` tag function by binding `htm` to our `h()` function:
|
||||
|
||||
```js
|
||||
import htm from 'htm';
|
||||
|
||||
const html = htm.bind(h);
|
||||
```
|
||||
|
||||
Now we have an `html()` template tag that can be used to produce objects in the format we created above.
|
||||
|
||||
Here's the whole thing for clarity:
|
||||
|
||||
```js
|
||||
import htm from 'htm';
|
||||
|
||||
function h(type, props, ...children) {
|
||||
return { type, props, children };
|
||||
}
|
||||
|
||||
const html = htm.bind(h);
|
||||
|
||||
console.log( html`<h1 id=hello>Hello world!</h1>` );
|
||||
// {
|
||||
// type: 'h1',
|
||||
// props: { id: 'hello' },
|
||||
// children: ['Hello world!']
|
||||
// }
|
||||
```
|
||||
|
||||
If the template has multiple element at the root level
|
||||
the output is an array of `h` results:
|
||||
|
||||
```js
|
||||
console.log(html`
|
||||
<h1 id=hello>Hello</h1>
|
||||
<div class=world>World!</div>
|
||||
`);
|
||||
// [
|
||||
// {
|
||||
// type: 'h1',
|
||||
// props: { id: 'hello' },
|
||||
// children: ['Hello']
|
||||
// },
|
||||
// {
|
||||
// type: 'div',
|
||||
// props: { class: 'world' },
|
||||
// children: ['world!']
|
||||
// }
|
||||
// ]
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Curious to see what it all looks like? Here's a working app!
|
||||
|
||||
It's a single HTML file, and there's no build or tooling. You can edit it with nano.
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<title>htm Demo</title>
|
||||
<script type="module">
|
||||
import { html, Component, render } from 'https://unpkg.com/htm/preact/standalone.module.js';
|
||||
|
||||
class App extends Component {
|
||||
addTodo() {
|
||||
const { todos = [] } = this.state;
|
||||
this.setState({ todos: todos.concat(`Item ${todos.length}`) });
|
||||
}
|
||||
render({ page }, { todos = [] }) {
|
||||
return html`
|
||||
<div class="app">
|
||||
<${Header} name="ToDo's (${page})" />
|
||||
<ul>
|
||||
${todos.map(todo => html`
|
||||
<li>${todo}</li>
|
||||
`)}
|
||||
</ul>
|
||||
<button onClick=${() => this.addTodo()}>Add Todo</button>
|
||||
<${Footer}>footer content here<//>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
const Header = ({ name }) => html`<h1>${name} List</h1>`
|
||||
|
||||
const Footer = props => html`<footer ...${props} />`
|
||||
|
||||
render(html`<${App} page="All" />`, document.body);
|
||||
</script>
|
||||
</html>
|
||||
```
|
||||
|
||||
[⚡️ **See live version** ▶](https://htm-demo-preact.glitch.me/)
|
||||
|
||||
[⚡️ **Try this on CodeSandbox** ▶](https://codesandbox.io/s/x7pmq32j6q)
|
||||
|
||||
How nifty is that?
|
||||
|
||||
Notice there's only one import - here we're using the prebuilt Preact integration since it's easier to import and a bit smaller.
|
||||
|
||||
The same example works fine without the prebuilt version, just using two imports:
|
||||
|
||||
```js
|
||||
import { h, Component, render } from 'preact';
|
||||
import htm from 'htm';
|
||||
|
||||
const html = htm.bind(h);
|
||||
|
||||
render(html`<${App} page="All" />`, document.body);
|
||||
```
|
||||
|
||||
## Other Uses
|
||||
|
||||
Since `htm` is designed to meet the same need as JSX, you can use it anywhere you'd use JSX.
|
||||
|
||||
**Generate HTML using [vhtml]:**
|
||||
|
||||
```js
|
||||
import htm from 'htm';
|
||||
import vhtml from 'vhtml';
|
||||
|
||||
const html = htm.bind(vhtml);
|
||||
|
||||
console.log( html`<h1 id=hello>Hello world!</h1>` );
|
||||
// '<h1 id="hello">Hello world!</h1>'
|
||||
```
|
||||
|
||||
**Webpack configuration via [jsxobj]:** ([details here](https://webpack.js.org/configuration/configuration-languages/#babel-and-jsx)) _(never do this)_
|
||||
|
||||
```js
|
||||
import htm from 'htm';
|
||||
import jsxobj from 'jsxobj';
|
||||
|
||||
const html = htm.bind(jsxobj);
|
||||
|
||||
console.log(html`
|
||||
<webpack watch mode=production>
|
||||
<entry path="src/index.js" />
|
||||
</webpack>
|
||||
`);
|
||||
// {
|
||||
// watch: true,
|
||||
// mode: 'production',
|
||||
// entry: {
|
||||
// path: 'src/index.js'
|
||||
// }
|
||||
// }
|
||||
```
|
||||
|
||||
## Demos & Examples
|
||||
|
||||
- [Canadian Holidays](https://github.com/pcraig3/hols): A full app using HTM and Server-Side Rendering
|
||||
- [HTM SSR Example](https://github.com/timarney/htm-ssr-demo): Shows how to do SSR with HTM
|
||||
- [HTM + Preact SSR Demo](https://gist.github.com/developit/699c8d8f180a1e4eed58167f9c6711be)
|
||||
- [HTM + vhtml SSR Demo](https://gist.github.com/developit/ff925c3995b4a129b6b977bf7cd12ebd)
|
||||
|
||||
## Project Status
|
||||
|
||||
The original goal for `htm` was to create a wrapper around Preact that felt natural for use untranspiled in the browser. I wanted to use Virtual DOM, but I wanted to eschew build tooling and use ES Modules directly.
|
||||
|
||||
This meant giving up JSX, and the closest alternative was [Tagged Templates]. So, I wrote this library to patch up the differences between the two as much as possible. The technique turns out to be framework-agnostic, so it should work great with any library or renderer that works with JSX.
|
||||
|
||||
`htm` is stable, fast, well-tested and ready for production use.
|
||||
|
||||
[Tagged Templates]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates
|
||||
[lit-html]: https://github.com/Polymer/lit-html
|
||||
[babel-plugin-htm]: https://github.com/developit/htm/tree/master/packages/babel-plugin-htm
|
||||
[lit-html VSCode extension]: https://marketplace.visualstudio.com/items?itemName=bierner.lit-html
|
||||
[vim-jsx-pretty plugin]: https://github.com/MaxMEllon/vim-jsx-pretty
|
||||
[vhtml]: https://github.com/developit/vhtml
|
||||
[jsxobj]: https://github.com/developit/jsxobj
|
||||
[hyperscript]: https://github.com/hyperhype/hyperscript
|
||||
[all modern browsers]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Browser_compatibility
|
||||
6
build/javascript/node_modules/htm/mini/index.d.ts
generated
vendored
Normal file
6
build/javascript/node_modules/htm/mini/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare const htm: {
|
||||
bind<HResult>(
|
||||
h: (type: any, props: Record<string, any>, ...children: any[]) => HResult
|
||||
): (strings: TemplateStringsArray, ...values: any[]) => HResult | HResult[];
|
||||
};
|
||||
export default htm;
|
||||
1
build/javascript/node_modules/htm/mini/index.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/mini/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){var n=(new Map,function(n){for(var e,l,s=arguments,t=1,u="",r="",o=[0],f=function(n){1===t&&(n||(u=u.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?o.push(n?s[n]:u):3===t&&(n||u)?(o[1]=n?s[n]:u,t=2):2===t&&"..."===u&&n?o[2]=Object.assign(o[2]||{},s[n]):2===t&&u&&!n?(o[2]=o[2]||{})[u]=!0:t>=5&&(5===t?((o[2]=o[2]||{})[l]=n?u?u+s[n]:s[n]:u,t=6):(n||u)&&(o[2][l]+=n?u+s[n]:u)),u=""},i=0;i<n.length;i++){i&&(1===t&&f(),f(i));for(var p=0;p<n[i].length;p++)e=n[i][p],1===t?"<"===e?(f(),o=[o,"",null],t=3):u+=e:4===t?"--"===u&&">"===e?(t=1,u=""):u=e+u[0]:r?e===r?r="":u+=e:'"'===e||"'"===e?r=e:">"===e?(f(),t=1):t&&("="===e?(t=5,l=u,u=""):"/"===e&&(t<5||">"===n[i][p+1])?(f(),3===t&&(o=o[0]),t=o,(o=o[0]).push(this.apply(null,t.slice(1))),t=0):" "===e||"\t"===e||"\n"===e||"\r"===e?(f(),t=2):u+=e),3===t&&"!--"===u&&(t=4,o=o[0])}return f(),o.length>2?o.slice(1):o[1]});"undefined"!=typeof module?module.exports=n:self.htm=n}();
|
||||
1
build/javascript/node_modules/htm/mini/index.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/mini/index.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function(n){for(var l,e,s=arguments,t=1,r="",u="",a=[0],c=function(n){1===t&&(n||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(n?s[n]:r):3===t&&(n||r)?(a[1]=n?s[n]:r,t=2):2===t&&"..."===r&&n?a[2]=Object.assign(a[2]||{},s[n]):2===t&&r&&!n?(a[2]=a[2]||{})[r]=!0:t>=5&&(5===t?((a[2]=a[2]||{})[e]=n?r?r+s[n]:s[n]:r,t=6):(n||r)&&(a[2][e]+=n?r+s[n]:r)),r=""},h=0;h<n.length;h++){h&&(1===t&&c(),c(h));for(var i=0;i<n[h].length;i++)l=n[h][i],1===t?"<"===l?(c(),a=[a,"",null],t=3):r+=l:4===t?"--"===r&&">"===l?(t=1,r=""):r=l+r[0]:u?l===u?u="":r+=l:'"'===l||"'"===l?u=l:">"===l?(c(),t=1):t&&("="===l?(t=5,e=r,r=""):"/"===l&&(t<5||">"===n[h][i+1])?(c(),3===t&&(a=a[0]),t=a,(a=a[0]).push(this.apply(null,t.slice(1))),t=0):" "===l||"\t"===l||"\n"===l||"\r"===l?(c(),t=2):r+=l),3===t&&"!--"===r&&(t=4,a=a[0])}return c(),a.length>2?a.slice(1):a[1]}
|
||||
1
build/javascript/node_modules/htm/mini/index.module.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/mini/index.module.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function(n){for(var l,e,s=arguments,t=1,r="",u="",a=[0],c=function(n){1===t&&(n||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(n?s[n]:r):3===t&&(n||r)?(a[1]=n?s[n]:r,t=2):2===t&&"..."===r&&n?a[2]=Object.assign(a[2]||{},s[n]):2===t&&r&&!n?(a[2]=a[2]||{})[r]=!0:t>=5&&(5===t?((a[2]=a[2]||{})[e]=n?r?r+s[n]:s[n]:r,t=6):(n||r)&&(a[2][e]+=n?r+s[n]:r)),r=""},h=0;h<n.length;h++){h&&(1===t&&c(),c(h));for(var i=0;i<n[h].length;i++)l=n[h][i],1===t?"<"===l?(c(),a=[a,"",null],t=3):r+=l:4===t?"--"===r&&">"===l?(t=1,r=""):r=l+r[0]:u?l===u?u="":r+=l:'"'===l||"'"===l?u=l:">"===l?(c(),t=1):t&&("="===l?(t=5,e=r,r=""):"/"===l&&(t<5||">"===n[h][i+1])?(c(),3===t&&(a=a[0]),t=a,(a=a[0]).push(this.apply(null,t.slice(1))),t=0):" "===l||"\t"===l||"\n"===l||"\r"===l?(c(),t=2):r+=l),3===t&&"!--"===r&&(t=4,a=a[0])}return c(),a.length>2?a.slice(1):a[1]}
|
||||
1
build/javascript/node_modules/htm/mini/index.umd.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/mini/index.umd.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.htm=n()}(this,function(){return function(e){for(var n,t,o=arguments,f=1,i="",s="",u=[0],l=function(e){1===f&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?u.push(e?o[e]:i):3===f&&(e||i)?(u[1]=e?o[e]:i,f=2):2===f&&"..."===i&&e?u[2]=Object.assign(u[2]||{},o[e]):2===f&&i&&!e?(u[2]=u[2]||{})[i]=!0:f>=5&&(5===f?((u[2]=u[2]||{})[t]=e?i?i+o[e]:o[e]:i,f=6):(e||i)&&(u[2][t]+=e?i+o[e]:i)),i=""},r=0;r<e.length;r++){r&&(1===f&&l(),l(r));for(var c=0;c<e[r].length;c++)n=e[r][c],1===f?"<"===n?(l(),u=[u,"",null],f=3):i+=n:4===f?"--"===i&&">"===n?(f=1,i=""):i=n+i[0]:s?n===s?s="":i+=n:'"'===n||"'"===n?s=n:">"===n?(l(),f=1):f&&("="===n?(f=5,t=i,i=""):"/"===n&&(f<5||">"===e[r][c+1])?(l(),3===f&&(u=u[0]),f=u,(u=u[0]).push(this.apply(null,f.slice(1))),f=0):" "===n||"\t"===n||"\n"===n||"\r"===n?(l(),f=2):i+=n),3===f&&"!--"===i&&(f=4,u=u[0])}return l(),u.length>2?u.slice(1):u[1]}});
|
||||
121
build/javascript/node_modules/htm/package.json
generated
vendored
Normal file
121
build/javascript/node_modules/htm/package.json
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"htm@3.0.4",
|
||||
"/home/runner/work/owncast/owncast/build/javascript"
|
||||
]
|
||||
],
|
||||
"_from": "htm@3.0.4",
|
||||
"_id": "htm@3.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VRdvxX3tmrXuT/Ovt59NMp/ORMFi4bceFMDjos1PV4E0mV+5votuID8R60egR9A4U8nLt238R/snlJGz3UYiTQ==",
|
||||
"_location": "/htm",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "htm@3.0.4",
|
||||
"name": "htm",
|
||||
"escapedName": "htm",
|
||||
"rawSpec": "3.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/htm/-/htm-3.0.4.tgz",
|
||||
"_spec": "3.0.4",
|
||||
"_where": "/home/runner/work/owncast/owncast/build/javascript",
|
||||
"author": {
|
||||
"name": "Jason Miller",
|
||||
"email": "jason@developit.ca"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/developit/htm/issues"
|
||||
},
|
||||
"description": "The Tagged Template syntax for Virtual DOM. Only browser-compatible syntax.",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.2",
|
||||
"@babel/preset-env": "^7.1.6",
|
||||
"babel-jest": "^24.1.0",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"eslint": "^5.2.0",
|
||||
"eslint-config-developit": "^1.1.1",
|
||||
"jest": "^24.1.0",
|
||||
"microbundle": "^0.10.1",
|
||||
"preact": "^10.0.0",
|
||||
"react": "^16.8.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "developit",
|
||||
"rules": {
|
||||
"prefer-const": 0,
|
||||
"prefer-spread": 0,
|
||||
"prefer-rest-params": 0,
|
||||
"func-style": 0
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"mini",
|
||||
"preact",
|
||||
"react",
|
||||
"src"
|
||||
],
|
||||
"homepage": "https://github.com/developit/htm",
|
||||
"jest": {
|
||||
"testURL": "http://localhost",
|
||||
"testMatch": [
|
||||
"**/__tests__/**/*.?(m)js?(x)",
|
||||
"**/?(*.)(spec|test).?(m)js?(x)"
|
||||
],
|
||||
"transform": {
|
||||
"\\.m?js$": "babel-jest"
|
||||
},
|
||||
"moduleFileExtensions": [
|
||||
"mjs",
|
||||
"js"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^babel-plugin-transform-jsx-to-htm$": "<rootDir>/packages/babel-plugin-transform-jsx-to-htm/index.mjs",
|
||||
"^babel-plugin-htm$": "<rootDir>/packages/babel-plugin-htm/index.mjs",
|
||||
"^htm$": "<rootDir>/src/index.mjs",
|
||||
"^htm/preact$": "<rootDir>/src/integrations/preact/index.mjs"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"Hyperscript Tagged Markup",
|
||||
"tagged template",
|
||||
"template literals",
|
||||
"html",
|
||||
"htm",
|
||||
"jsx",
|
||||
"virtual dom",
|
||||
"hyperscript"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/htm.js",
|
||||
"module": "dist/htm.module.js",
|
||||
"name": "htm",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/developit/htm.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run -s build:main && npm run -s build:mini && npm run -s build:preact && npm run -s build:react && npm run -s build:babel && npm run -s build:babel-transform-jsx && npm run -s build:mjsalias",
|
||||
"build:babel": "cd packages/babel-plugin-htm && npm run build",
|
||||
"build:babel-transform-jsx": "cd packages/babel-plugin-transform-jsx-to-htm && npm run build",
|
||||
"build:main": "microbundle src/index.mjs -f es,umd --no-sourcemap --target web && microbundle src/cjs.mjs -f iife --no-sourcemap --target web && cp src/index.d.ts dist/htm.d.ts",
|
||||
"build:mini": "microbundle src/index.mjs -o ./mini/index.js -f es,umd --no-sourcemap --target web --alias ./constants.mjs=./constants-mini.mjs && microbundle src/cjs.mjs -o ./mini/index.js -f iife --no-sourcemap --target web --alias ./constants.mjs=./constants-mini.mjs && cp src/index.d.ts mini",
|
||||
"build:mjsalias": "cp dist/htm.module.js dist/htm.mjs && cp mini/index.module.js mini/index.mjs && cp preact/index.module.js preact/index.mjs && cp preact/standalone.module.js preact/standalone.mjs && cp react/index.module.js react/index.mjs",
|
||||
"build:preact": "cd src/integrations/preact && npm run build",
|
||||
"build:react": "cd src/integrations/react && npm run build",
|
||||
"release": "npm t && git commit -am \"$npm_package_version\" && git tag $npm_package_version && git push && git push --tags && npm publish",
|
||||
"test": "eslint src/**/*.mjs test/**/*.mjs && npm run build && jest test",
|
||||
"test:perf": "v8 test/__perftest.mjs"
|
||||
},
|
||||
"types": "dist/htm.d.ts",
|
||||
"umd:main": "dist/htm.umd.js",
|
||||
"version": "3.0.4"
|
||||
}
|
||||
5
build/javascript/node_modules/htm/preact/index.d.ts
generated
vendored
Normal file
5
build/javascript/node_modules/htm/preact/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { h, VNode, Component } from 'preact';
|
||||
export * from 'preact/hooks';
|
||||
declare function render(tree: VNode, parent: HTMLElement): void;
|
||||
declare const html: (strings: TemplateStringsArray, ...values: any[]) => VNode;
|
||||
export { h, html, render, Component };
|
||||
1
build/javascript/node_modules/htm/preact/index.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var e,r=require("preact"),t=((e=require("htm"))&&"object"==typeof e&&"default"in e?e.default:e).bind(r.h);exports.h=r.h,exports.render=r.render,exports.Component=r.Component,exports.html=t;
|
||||
1
build/javascript/node_modules/htm/preact/index.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/index.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{h as r,Component as o,render as t}from"preact";export{h,render,Component}from"preact";import e from"htm";var m=e.bind(r);export{m as html};
|
||||
1
build/javascript/node_modules/htm/preact/index.module.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/index.module.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{h as r,Component as o,render as t}from"preact";export{h,render,Component}from"preact";import e from"htm";var m=e.bind(r);export{m as html};
|
||||
1
build/javascript/node_modules/htm/preact/index.umd.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/index.umd.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact"),require("htm")):"function"==typeof define&&define.amd?define(["exports","preact","htm"],t):t(e.htmPreact={},e.preact,e.htm)}(this,function(e,t,n){var r=(n=n&&n.hasOwnProperty("default")?n.default:n).bind(t.h);e.h=t.h,e.render=t.render,e.Component=t.Component,e.html=r});
|
||||
13
build/javascript/node_modules/htm/preact/package.json
generated
vendored
Normal file
13
build/javascript/node_modules/htm/preact/package.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "htm_preact",
|
||||
"module": "index.module.js",
|
||||
"main": "index.js",
|
||||
"umd:main": "index.umd.js",
|
||||
"unpkg": "standalone.js",
|
||||
"scripts": {
|
||||
"build": "npm run -s build:main && npm run -s build:standalone && npm run -s build:static",
|
||||
"build:main": "microbundle index.mjs -o ../../../preact/index.js --external preact,htm --no-sourcemap --target web",
|
||||
"build:static": "cp index.d.ts package.json ../../../preact/",
|
||||
"build:standalone": "microbundle standalone.mjs -o ../../../preact/standalone.js -f es,umd --no-sourcemap --target web"
|
||||
}
|
||||
}
|
||||
1
build/javascript/node_modules/htm/preact/standalone.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/standalone.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
build/javascript/node_modules/htm/preact/standalone.module.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/standalone.module.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
build/javascript/node_modules/htm/preact/standalone.umd.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/preact/standalone.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
build/javascript/node_modules/htm/react/index.d.ts
generated
vendored
Normal file
2
build/javascript/node_modules/htm/react/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
declare const html: (strings: TemplateStringsArray, ...values: any[]) => React.ReactElement;
|
||||
1
build/javascript/node_modules/htm/react/index.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/react/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var e,t=require("react"),r=((e=require("htm"))&&"object"==typeof e&&"default"in e?e.default:e).bind(t.createElement);exports.html=r;
|
||||
1
build/javascript/node_modules/htm/react/index.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/react/index.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{createElement as r}from"react";import m from"htm";var o=m.bind(r);export{o as html};
|
||||
1
build/javascript/node_modules/htm/react/index.module.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/react/index.module.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{createElement as r}from"react";import m from"htm";var o=m.bind(r);export{o as html};
|
||||
1
build/javascript/node_modules/htm/react/index.umd.js
generated
vendored
Normal file
1
build/javascript/node_modules/htm/react/index.umd.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("htm")):"function"==typeof define&&define.amd?define(["exports","react","htm"],t):t(e.htmReact={},e.react,e.htm)}(this,function(e,t,n){var r=(n=n&&n.hasOwnProperty("default")?n.default:n).bind(t.createElement);e.html=r});
|
||||
12
build/javascript/node_modules/htm/react/package.json
generated
vendored
Normal file
12
build/javascript/node_modules/htm/react/package.json
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "htm_react",
|
||||
"module": "index.module.js",
|
||||
"main": "index.js",
|
||||
"umd:main": "index.umd.js",
|
||||
"unpkg": "index.js",
|
||||
"scripts": {
|
||||
"build": "npm run -s build:main && npm run -s build:static",
|
||||
"build:main": "microbundle index.mjs -o ../../../react/index.js --external react,htm --no-sourcemap --target web",
|
||||
"build:static": "cp index.d.ts package.json ../../../react/"
|
||||
}
|
||||
}
|
||||
292
build/javascript/node_modules/htm/src/build.mjs
generated
vendored
Normal file
292
build/javascript/node_modules/htm/src/build.mjs
generated
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
import { MINI } from './constants.mjs';
|
||||
|
||||
const MODE_SLASH = 0;
|
||||
const MODE_TEXT = 1;
|
||||
const MODE_WHITESPACE = 2;
|
||||
const MODE_TAGNAME = 3;
|
||||
const MODE_COMMENT = 4;
|
||||
const MODE_PROP_SET = 5;
|
||||
const MODE_PROP_APPEND = 6;
|
||||
|
||||
const CHILD_APPEND = 0;
|
||||
const CHILD_RECURSE = 2;
|
||||
const TAG_SET = 3;
|
||||
const PROPS_ASSIGN = 4;
|
||||
const PROP_SET = MODE_PROP_SET;
|
||||
const PROP_APPEND = MODE_PROP_APPEND;
|
||||
|
||||
// Turn a result of a build(...) call into a tree that is more
|
||||
// convenient to analyze and transform (e.g. Babel plugins).
|
||||
// For example:
|
||||
// treeify(
|
||||
// build'<div href="1${a}" ...${b}><${x} /></div>`,
|
||||
// [X, Y, Z]
|
||||
// )
|
||||
// returns:
|
||||
// {
|
||||
// tag: 'div',
|
||||
// props: [ { href: ["1", X] }, Y ],
|
||||
// children: [ { tag: Z, props: [], children: [] } ]
|
||||
// }
|
||||
export const treeify = (built, fields) => {
|
||||
const _treeify = built => {
|
||||
let tag = '';
|
||||
let currentProps = null;
|
||||
const props = [];
|
||||
const children = [];
|
||||
|
||||
for (let i = 1; i < built.length; i++) {
|
||||
const type = built[i++];
|
||||
const value = built[i] ? fields[built[i++]-1] : built[++i];
|
||||
|
||||
if (type === TAG_SET) {
|
||||
tag = value;
|
||||
}
|
||||
else if (type === PROPS_ASSIGN) {
|
||||
props.push(value);
|
||||
currentProps = null;
|
||||
}
|
||||
else if (type === PROP_SET) {
|
||||
if (!currentProps) {
|
||||
currentProps = Object.create(null);
|
||||
props.push(currentProps);
|
||||
}
|
||||
currentProps[built[++i]] = [value];
|
||||
}
|
||||
else if (type === PROP_APPEND) {
|
||||
currentProps[built[++i]].push(value);
|
||||
}
|
||||
else if (type === CHILD_RECURSE) {
|
||||
children.push(_treeify(value));
|
||||
}
|
||||
else if (type === CHILD_APPEND) {
|
||||
children.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
return { tag, props, children };
|
||||
};
|
||||
const { children } = _treeify(built);
|
||||
return children.length > 1 ? children : children[0];
|
||||
};
|
||||
|
||||
export const evaluate = (h, built, fields, args) => {
|
||||
let tmp;
|
||||
|
||||
// `build()` used the first element of the operation list as
|
||||
// temporary workspace. Now that `build()` is done we can use
|
||||
// that space to track whether the current element is "dynamic"
|
||||
// (i.e. it or any of its descendants depend on dynamic values).
|
||||
built[0] = 0;
|
||||
|
||||
for (let i = 1; i < built.length; i++) {
|
||||
const type = built[i++];
|
||||
|
||||
// Set `built[0]`'s appropriate bits if this element depends on a dynamic value.
|
||||
const value = built[i] ? ((built[0] |= type ? 1 : 2), fields[built[i++]]) : built[++i];
|
||||
|
||||
if (type === TAG_SET) {
|
||||
args[0] = value;
|
||||
}
|
||||
else if (type === PROPS_ASSIGN) {
|
||||
args[1] = Object.assign(args[1] || {}, value);
|
||||
}
|
||||
else if (type === PROP_SET) {
|
||||
(args[1] = args[1] || {})[built[++i]] = value;
|
||||
}
|
||||
else if (type === PROP_APPEND) {
|
||||
args[1][built[++i]] += (value + '');
|
||||
}
|
||||
else if (type) { // type === CHILD_RECURSE
|
||||
// Set the operation list (including the staticness bits) as
|
||||
// `this` for the `h` call.
|
||||
tmp = h.apply(value, evaluate(h, value, fields, ['', null]));
|
||||
args.push(tmp);
|
||||
|
||||
if (value[0]) {
|
||||
// Set the 2nd lowest bit it the child element is dynamic.
|
||||
built[0] |= 2;
|
||||
}
|
||||
else {
|
||||
// Rewrite the operation list in-place if the child element is static.
|
||||
// The currently evaluated piece `CHILD_RECURSE, 0, [...]` becomes
|
||||
// `CHILD_APPEND, 0, tmp`.
|
||||
// Essentially the operation list gets optimized for potential future
|
||||
// re-evaluations.
|
||||
built[i-2] = CHILD_APPEND;
|
||||
built[i] = tmp;
|
||||
}
|
||||
}
|
||||
else { // type === CHILD_APPEND
|
||||
args.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
return args;
|
||||
};
|
||||
|
||||
export const build = function(statics) {
|
||||
const fields = arguments;
|
||||
const h = this;
|
||||
|
||||
let mode = MODE_TEXT;
|
||||
let buffer = '';
|
||||
let quote = '';
|
||||
let current = [0];
|
||||
let char, propName;
|
||||
|
||||
const commit = field => {
|
||||
if (mode === MODE_TEXT && (field || (buffer = buffer.replace(/^\s*\n\s*|\s*\n\s*$/g,'')))) {
|
||||
if (MINI) {
|
||||
current.push(field ? fields[field] : buffer);
|
||||
}
|
||||
else {
|
||||
current.push(CHILD_APPEND, field, buffer);
|
||||
}
|
||||
}
|
||||
else if (mode === MODE_TAGNAME && (field || buffer)) {
|
||||
if (MINI) {
|
||||
current[1] = field ? fields[field] : buffer;
|
||||
}
|
||||
else {
|
||||
current.push(TAG_SET, field, buffer);
|
||||
}
|
||||
mode = MODE_WHITESPACE;
|
||||
}
|
||||
else if (mode === MODE_WHITESPACE && buffer === '...' && field) {
|
||||
if (MINI) {
|
||||
current[2] = Object.assign(current[2] || {}, fields[field]);
|
||||
}
|
||||
else {
|
||||
current.push(PROPS_ASSIGN, field, 0);
|
||||
}
|
||||
}
|
||||
else if (mode === MODE_WHITESPACE && buffer && !field) {
|
||||
if (MINI) {
|
||||
(current[2] = current[2] || {})[buffer] = true;
|
||||
}
|
||||
else {
|
||||
current.push(PROP_SET, 0, true, buffer);
|
||||
}
|
||||
}
|
||||
else if (mode >= MODE_PROP_SET) {
|
||||
if (MINI) {
|
||||
if (mode === MODE_PROP_SET) {
|
||||
(current[2] = current[2] || {})[propName] = field ? buffer ? (buffer + fields[field]) : fields[field] : buffer;
|
||||
mode = MODE_PROP_APPEND;
|
||||
}
|
||||
else if (field || buffer) {
|
||||
current[2][propName] += field ? buffer + fields[field] : buffer;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (buffer || (!field && mode === MODE_PROP_SET)) {
|
||||
current.push(mode, 0, buffer, propName);
|
||||
mode = MODE_PROP_APPEND;
|
||||
}
|
||||
if (field) {
|
||||
current.push(mode, field, 0, propName);
|
||||
mode = MODE_PROP_APPEND;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buffer = '';
|
||||
};
|
||||
|
||||
for (let i=0; i<statics.length; i++) {
|
||||
if (i) {
|
||||
if (mode === MODE_TEXT) {
|
||||
commit();
|
||||
}
|
||||
commit(i);
|
||||
}
|
||||
|
||||
for (let j=0; j<statics[i].length;j++) {
|
||||
char = statics[i][j];
|
||||
|
||||
if (mode === MODE_TEXT) {
|
||||
if (char === '<') {
|
||||
// commit buffer
|
||||
commit();
|
||||
if (MINI) {
|
||||
current = [current, '', null];
|
||||
}
|
||||
else {
|
||||
current = [current];
|
||||
}
|
||||
mode = MODE_TAGNAME;
|
||||
}
|
||||
else {
|
||||
buffer += char;
|
||||
}
|
||||
}
|
||||
else if (mode === MODE_COMMENT) {
|
||||
// Ignore everything until the last three characters are '-', '-' and '>'
|
||||
if (buffer === '--' && char === '>') {
|
||||
mode = MODE_TEXT;
|
||||
buffer = '';
|
||||
}
|
||||
else {
|
||||
buffer = char + buffer[0];
|
||||
}
|
||||
}
|
||||
else if (quote) {
|
||||
if (char === quote) {
|
||||
quote = '';
|
||||
}
|
||||
else {
|
||||
buffer += char;
|
||||
}
|
||||
}
|
||||
else if (char === '"' || char === "'") {
|
||||
quote = char;
|
||||
}
|
||||
else if (char === '>') {
|
||||
commit();
|
||||
mode = MODE_TEXT;
|
||||
}
|
||||
else if (!mode) {
|
||||
// Ignore everything until the tag ends
|
||||
}
|
||||
else if (char === '=') {
|
||||
mode = MODE_PROP_SET;
|
||||
propName = buffer;
|
||||
buffer = '';
|
||||
}
|
||||
else if (char === '/' && (mode < MODE_PROP_SET || statics[i][j+1] === '>')) {
|
||||
commit();
|
||||
if (mode === MODE_TAGNAME) {
|
||||
current = current[0];
|
||||
}
|
||||
mode = current;
|
||||
if (MINI) {
|
||||
(current = current[0]).push(h.apply(null, mode.slice(1)));
|
||||
}
|
||||
else {
|
||||
(current = current[0]).push(CHILD_RECURSE, 0, mode);
|
||||
}
|
||||
mode = MODE_SLASH;
|
||||
}
|
||||
else if (char === ' ' || char === '\t' || char === '\n' || char === '\r') {
|
||||
// <a disabled>
|
||||
commit();
|
||||
mode = MODE_WHITESPACE;
|
||||
}
|
||||
else {
|
||||
buffer += char;
|
||||
}
|
||||
|
||||
if (mode === MODE_TAGNAME && buffer === '!--') {
|
||||
mode = MODE_COMMENT;
|
||||
current = current[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
commit();
|
||||
|
||||
if (MINI) {
|
||||
return current.length > 2 ? current.slice(1) : current[1];
|
||||
}
|
||||
return current;
|
||||
};
|
||||
3
build/javascript/node_modules/htm/src/cjs.mjs
generated
vendored
Normal file
3
build/javascript/node_modules/htm/src/cjs.mjs
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import htm from './index.mjs';
|
||||
if (typeof module != 'undefined') module.exports = htm;
|
||||
else self.htm = htm;
|
||||
1
build/javascript/node_modules/htm/src/constants-mini.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/src/constants-mini.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const MINI = true;
|
||||
1
build/javascript/node_modules/htm/src/constants.mjs
generated
vendored
Normal file
1
build/javascript/node_modules/htm/src/constants.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const MINI = false;
|
||||
6
build/javascript/node_modules/htm/src/index.d.ts
generated
vendored
Normal file
6
build/javascript/node_modules/htm/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare const htm: {
|
||||
bind<HResult>(
|
||||
h: (type: any, props: Record<string, any>, ...children: any[]) => HResult
|
||||
): (strings: TemplateStringsArray, ...values: any[]) => HResult | HResult[];
|
||||
};
|
||||
export default htm;
|
||||
29
build/javascript/node_modules/htm/src/index.mjs
generated
vendored
Normal file
29
build/javascript/node_modules/htm/src/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MINI } from './constants.mjs';
|
||||
import { build, evaluate } from './build.mjs';
|
||||
|
||||
const CACHES = new Map();
|
||||
|
||||
const regular = function(statics) {
|
||||
let tmp = CACHES.get(this);
|
||||
if (!tmp) {
|
||||
tmp = new Map();
|
||||
CACHES.set(this, tmp);
|
||||
}
|
||||
tmp = evaluate(this, tmp.get(statics) || (tmp.set(statics, tmp = build(statics)), tmp), arguments, []);
|
||||
return tmp.length > 1 ? tmp : tmp[0];
|
||||
};
|
||||
|
||||
export default MINI ? build : regular;
|
||||
5
build/javascript/node_modules/htm/src/integrations/preact/index.d.ts
generated
vendored
Normal file
5
build/javascript/node_modules/htm/src/integrations/preact/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { h, VNode, Component } from 'preact';
|
||||
export * from 'preact/hooks';
|
||||
declare function render(tree: VNode, parent: HTMLElement): void;
|
||||
declare const html: (strings: TemplateStringsArray, ...values: any[]) => VNode;
|
||||
export { h, html, render, Component };
|
||||
19
build/javascript/node_modules/htm/src/integrations/preact/index.mjs
generated
vendored
Normal file
19
build/javascript/node_modules/htm/src/integrations/preact/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { h, Component, render } from 'preact';
|
||||
import htm from 'htm';
|
||||
|
||||
const html = htm.bind(h);
|
||||
|
||||
export { h, html, render, Component };
|
||||
13
build/javascript/node_modules/htm/src/integrations/preact/package.json
generated
vendored
Normal file
13
build/javascript/node_modules/htm/src/integrations/preact/package.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "htm_preact",
|
||||
"module": "index.module.js",
|
||||
"main": "index.js",
|
||||
"umd:main": "index.umd.js",
|
||||
"unpkg": "standalone.js",
|
||||
"scripts": {
|
||||
"build": "npm run -s build:main && npm run -s build:standalone && npm run -s build:static",
|
||||
"build:main": "microbundle index.mjs -o ../../../preact/index.js --external preact,htm --no-sourcemap --target web",
|
||||
"build:static": "cp index.d.ts package.json ../../../preact/",
|
||||
"build:standalone": "microbundle standalone.mjs -o ../../../preact/standalone.js -f es,umd --no-sourcemap --target web"
|
||||
}
|
||||
}
|
||||
20
build/javascript/node_modules/htm/src/integrations/preact/standalone.mjs
generated
vendored
Normal file
20
build/javascript/node_modules/htm/src/integrations/preact/standalone.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { h, Component, createContext, render } from 'preact';
|
||||
import { useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue } from 'preact/hooks';
|
||||
import htm from '../../index.mjs';
|
||||
|
||||
const html = htm.bind(h);
|
||||
|
||||
export { h, html, render, Component, createContext, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue };
|
||||
2
build/javascript/node_modules/htm/src/integrations/react/index.d.ts
generated
vendored
Normal file
2
build/javascript/node_modules/htm/src/integrations/react/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
declare const html: (strings: TemplateStringsArray, ...values: any[]) => React.ReactElement;
|
||||
16
build/javascript/node_modules/htm/src/integrations/react/index.mjs
generated
vendored
Normal file
16
build/javascript/node_modules/htm/src/integrations/react/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createElement } from 'react';
|
||||
import htm from 'htm';
|
||||
export const html = htm.bind(createElement);
|
||||
12
build/javascript/node_modules/htm/src/integrations/react/package.json
generated
vendored
Normal file
12
build/javascript/node_modules/htm/src/integrations/react/package.json
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "htm_react",
|
||||
"module": "index.module.js",
|
||||
"main": "index.js",
|
||||
"umd:main": "index.umd.js",
|
||||
"unpkg": "index.js",
|
||||
"scripts": {
|
||||
"build": "npm run -s build:main && npm run -s build:static",
|
||||
"build:main": "microbundle index.mjs -o ../../../react/index.js --external react,htm --no-sourcemap --target web",
|
||||
"build:static": "cp index.d.ts package.json ../../../react/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user