@aurumjs/html 0.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +152 -0
- package/package.json +52 -0
- package/prebuilt/esnext/builtin_components/portal.d.ts +9 -0
- package/prebuilt/esnext/builtin_components/portal.d.ts.map +1 -0
- package/prebuilt/esnext/builtin_components/portal.js +40 -0
- package/prebuilt/esnext/builtin_components/portal.js.map +1 -0
- package/prebuilt/esnext/builtin_components/router_link.d.ts +21 -0
- package/prebuilt/esnext/builtin_components/router_link.d.ts.map +1 -0
- package/prebuilt/esnext/builtin_components/router_link.js +54 -0
- package/prebuilt/esnext/builtin_components/router_link.js.map +1 -0
- package/prebuilt/esnext/index.d.ts +18 -0
- package/prebuilt/esnext/index.d.ts.map +1 -0
- package/prebuilt/esnext/index.js +18 -0
- package/prebuilt/esnext/index.js.map +1 -0
- package/prebuilt/esnext/jsx-dev-runtime.d.ts +2 -0
- package/prebuilt/esnext/jsx-dev-runtime.d.ts.map +1 -0
- package/prebuilt/esnext/jsx-dev-runtime.js +2 -0
- package/prebuilt/esnext/jsx-dev-runtime.js.map +1 -0
- package/prebuilt/esnext/jsx-runtime.d.ts +28 -0
- package/prebuilt/esnext/jsx-runtime.d.ts.map +1 -0
- package/prebuilt/esnext/jsx-runtime.js +26 -0
- package/prebuilt/esnext/jsx-runtime.js.map +1 -0
- package/prebuilt/esnext/nodes/input.d.ts +41 -0
- package/prebuilt/esnext/nodes/input.d.ts.map +1 -0
- package/prebuilt/esnext/nodes/input.js +92 -0
- package/prebuilt/esnext/nodes/input.js.map +1 -0
- package/prebuilt/esnext/nodes/rendering_helpers.d.ts +8 -0
- package/prebuilt/esnext/nodes/rendering_helpers.d.ts.map +1 -0
- package/prebuilt/esnext/nodes/rendering_helpers.js +173 -0
- package/prebuilt/esnext/nodes/rendering_helpers.js.map +1 -0
- package/prebuilt/esnext/nodes/select.d.ts +17 -0
- package/prebuilt/esnext/nodes/select.d.ts.map +1 -0
- package/prebuilt/esnext/nodes/select.js +95 -0
- package/prebuilt/esnext/nodes/select.js.map +1 -0
- package/prebuilt/esnext/nodes/simple_dom_nodes.d.ts +866 -0
- package/prebuilt/esnext/nodes/simple_dom_nodes.d.ts.map +1 -0
- package/prebuilt/esnext/nodes/simple_dom_nodes.js +531 -0
- package/prebuilt/esnext/nodes/simple_dom_nodes.js.map +1 -0
- package/prebuilt/esnext/nodes/textarea.d.ts +34 -0
- package/prebuilt/esnext/nodes/textarea.d.ts.map +1 -0
- package/prebuilt/esnext/nodes/textarea.js +61 -0
- package/prebuilt/esnext/nodes/textarea.js.map +1 -0
- package/prebuilt/esnext/rendering/dom_runtime.d.ts +91 -0
- package/prebuilt/esnext/rendering/dom_runtime.d.ts.map +1 -0
- package/prebuilt/esnext/rendering/dom_runtime.js +970 -0
- package/prebuilt/esnext/rendering/dom_runtime.js.map +1 -0
- package/prebuilt/esnext/rendering/render_batch.d.ts +15 -0
- package/prebuilt/esnext/rendering/render_batch.d.ts.map +1 -0
- package/prebuilt/esnext/rendering/render_batch.js +73 -0
- package/prebuilt/esnext/rendering/render_batch.js.map +1 -0
- package/prebuilt/esnext/rendering/renderers/dom_adapter.d.ts +199 -0
- package/prebuilt/esnext/rendering/renderers/dom_adapter.d.ts.map +1 -0
- package/prebuilt/esnext/rendering/renderers/dom_adapter.js +525 -0
- package/prebuilt/esnext/rendering/renderers/dom_adapter.js.map +1 -0
- package/prebuilt/esnext/rendering/renderers/string_adapter.d.ts +4 -0
- package/prebuilt/esnext/rendering/renderers/string_adapter.d.ts.map +1 -0
- package/prebuilt/esnext/rendering/renderers/string_adapter.js +112 -0
- package/prebuilt/esnext/rendering/renderers/string_adapter.js.map +1 -0
- package/prebuilt/esnext/rendering/renderers/vdom_adapter.d.ts +11 -0
- package/prebuilt/esnext/rendering/renderers/vdom_adapter.d.ts.map +1 -0
- package/prebuilt/esnext/rendering/renderers/vdom_adapter.js +23 -0
- package/prebuilt/esnext/rendering/renderers/vdom_adapter.js.map +1 -0
- package/prebuilt/esnext/utilities/aurum.d.ts +155 -0
- package/prebuilt/esnext/utilities/aurum.d.ts.map +1 -0
- package/prebuilt/esnext/utilities/aurum.js +282 -0
- package/prebuilt/esnext/utilities/aurum.js.map +1 -0
- package/prebuilt/esnext/utilities/sanitize.d.ts +25 -0
- package/prebuilt/esnext/utilities/sanitize.d.ts.map +1 -0
- package/prebuilt/esnext/utilities/sanitize.js +191 -0
- package/prebuilt/esnext/utilities/sanitize.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Joao Santos (Cyberphoenix90)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# @aurumjs/html
|
|
2
|
+
|
|
3
|
+
HTML nodes, DOM rendering, reactive styling, and HTML JSX types for Aurum. Import this package when a JSX module uses HTML or SVG intrinsic tags.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @aurumjs/html
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Configure TypeScript to compile JSX through Aurum:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"jsx": "react",
|
|
17
|
+
"jsxFactory": "Aurum.factory",
|
|
18
|
+
"jsxFragmentFactory": "Aurum.fragment"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then import `Aurum` from the HTML package in files that use intrinsic elements:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Aurum, DataSource } from '@aurumjs/html';
|
|
27
|
+
|
|
28
|
+
const message = new DataSource('Hello Aurum');
|
|
29
|
+
Aurum.attach(<div>{message}</div>, document.body);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Components that do not use HTML or SVG tags can depend on `@aurumjs/rendering`; reactive state without rendering can depend on `@aurumjs/streams` directly.
|
|
33
|
+
|
|
34
|
+
With `@aurumjs/vite-plugin` in debug mode, the browser developer tools can trace
|
|
35
|
+
component instances and reactive HTML content, class, style, and attribute
|
|
36
|
+
bindings back to their source graph. These richer DOM relationships are not
|
|
37
|
+
created in production mode; source topology and subscription information remain
|
|
38
|
+
available there through the lean runtime protocol.
|
|
39
|
+
|
|
40
|
+
`aurumToRenderTree` creates the host-neutral `RenderTree` while applying HTML class and style normalization. The former `aurumToVDOM`, `VDOM`, and `VDOMNode` exports remain as deprecated compatibility aliases.
|
|
41
|
+
|
|
42
|
+
## HTML compatibility and portals
|
|
43
|
+
|
|
44
|
+
Standard HTML tags are available as JSX intrinsics, including `section` and `datalist`. Tags without a specialized Aurum implementation use the generic intrinsic factory automatically; `createGenericIntrinsicFactory(tagName)` exposes the same behavior for components and custom elements. Use the HTML `class` prop—`className` is intentionally not an alias. Standard DOM-style aliases such as `htmlFor`, `readOnly`, `autoFocus`, `autoComplete`, `srcSet`, and `spellCheck` are supported.
|
|
45
|
+
|
|
46
|
+
`Portal` mounts its children into an element, selector, or reactive target while keeping their lifecycle tied to the owner. `RouterLink` and `RouterNavLink` provide History API/hash navigation and reactive active-link state for `AurumRouter`.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
const overlayTarget = new DataSource<HTMLElement | null>(document.body);
|
|
50
|
+
|
|
51
|
+
<Portal target={overlayTarget}><dialog open={true}>Tools</dialog></Portal>
|
|
52
|
+
<RouterNavLink to="/projects" activeClass="selected">Projects</RouterNavLink>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Batched rendering
|
|
56
|
+
|
|
57
|
+
`batchRender` keeps Aurum streams fully synchronous while delaying DOM commits until the synchronous callback finishes. Repeated updates to the same rendered child, collection, attribute, class, style, or form-control property are coalesced to its final value. Nested batches flush once at the end of the outer batch, and the final DOM state is still flushed if the callback throws.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
Aurum.batchRender(() => {
|
|
61
|
+
selectedTool.update('brush');
|
|
62
|
+
selectedTool.update('eraser');
|
|
63
|
+
selectedTool.update('fill');
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Callbacks must be synchronous. Use batching for update bursts that touch the same render bindings; batching independent bindings still performs every DOM write and adds queueing overhead.
|
|
68
|
+
|
|
69
|
+
## Rendering benchmarks
|
|
70
|
+
|
|
71
|
+
The browser benchmark suite covers initial rendering, primitive collections, collections of components, every public `ArrayDataSource` mutation method, and reactive child updates. Render-batching benchmarks compare the unbatched hot path, repeated writes to one binding, component replacement bursts, and updates to independent bindings. Merge benchmarks separately measure identical snapshots, retained-item rotations and reversals, interleaved subsequence filtering and restoration, 10% and 100% churn, collection growth, truncation to empty, and duplicate-heavy primitive and repeated-component-reference collections. A developer-tools matrix measures scalar updates, rendered collection merges, and component mounting in lean production (with the panel closed and open) and rich debug modes (with stack capture off and on), plus topology polling over 1,000 sources.
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npm run benchmark --workspace @aurumjs/html
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Save a local baseline before a rendering change and compare afterward:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
npm run benchmark:save --workspace @aurumjs/html
|
|
81
|
+
npm run benchmark:compare --workspace @aurumjs/html
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Benchmarks run in headless Chromium. The baseline file is intentionally local so results are compared on the same machine and browser installation.
|
|
85
|
+
|
|
86
|
+
### ArrayDataSource DOM fast paths
|
|
87
|
+
|
|
88
|
+
`ArrayAurumElement` updates exact DOM ranges for replacement, prepend, left/middle removal, middle insertion, clear, prefix-only merge growth or truncation, and interleaved ordered-subsequence shrink/growth. Subsequence merges remove only rejected runs or insert only missing gaps, reconstruct the entry array in one pass, and never move retained DOM nodes. Other merge and reorder shapes continue through the identity-aware fallback. Large contiguous removals use a DOM range; small interleaved runs use direct removal because constructing thousands of ranges is slower.
|
|
89
|
+
|
|
90
|
+
The following before/after ratios were measured in headless Chromium with 1,000 rendered entries. Each benchmark performs an operation and restores the original state:
|
|
91
|
+
|
|
92
|
+
| Mutation | Primitive entries | Component entries |
|
|
93
|
+
| --------------------------------------------------- | ----------------: | ----------------: |
|
|
94
|
+
| Replace one middle entry (`set`) | 24.3× | 1.4× |
|
|
95
|
+
| Prepend then shift one entry | 177.9× | 17.5× |
|
|
96
|
+
| Remove and restore 10 left entries | 91.3× | 3.1× |
|
|
97
|
+
| Insert and remove 10 middle entries | 3.0× | 1.5× |
|
|
98
|
+
| Remove and restore 10 middle entries | 2.7× | 1.6× |
|
|
99
|
+
| Remove and restore one middle entry | 2.7× | 2.5× |
|
|
100
|
+
| Remove and restore matching entries (`removeWhere`) | 3.8× | 2.0× |
|
|
101
|
+
|
|
102
|
+
Absolute results vary by machine; use the baseline commands above when changing these paths.
|
|
103
|
+
|
|
104
|
+
Primitive collection entries now create text nodes without allocating lifecycle render sessions that they cannot use. This improved mount/dispose throughput by 1.7× for 100 primitive entries and 1.37× for 1,000 entries. A one-position merge rotation of 1,000 primitive entries uses one DOM move instead of general reconciliation and measured 14.6× faster.
|
|
105
|
+
|
|
106
|
+
The styled TODO comparison's filter-and-restore case improved from about 38 ms to 32 ms at 2,000 rows and from about 296 ms to 180 ms at 10,000 rows. The larger case is a 1.64× Aurum improvement and narrows React's advantage from roughly 2.0× to 1.34×. At 2,000 rows the implementations are within benchmark variance, with Aurum slightly ahead in the focused run.
|
|
107
|
+
|
|
108
|
+
Reactive scalar attributes, classes, and styles subscribe directly to their source and deduplicate the last value locally instead of allocating an internal transformed stream per binding. Intrinsic props are processed in one pass through precomputed attribute and event maps, component APIs use prototype methods instead of per-instance closures, and static props no longer force cleanup-token allocation. Consecutive collection inserts use a `DocumentFragment`, contiguous removals use a native DOM range, and nested entry sessions are deterministically disposed with their owning render range.
|
|
109
|
+
|
|
110
|
+
All regular browser benchmarks compile with production module conditions and `__AURUM_DEVTOOLS_INSTRUMENTATION__` disabled. The developer-tools overhead matrix is intentionally separate because it needs instrumentation present:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
npm run benchmark:devtools --workspace @aurumjs/html
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### React TODO comparison
|
|
117
|
+
|
|
118
|
+
`bench/todo_app_comparison.bench.tsx` implements the same styled, interactive TODO application in React 19 and Aurum. Both expose the same user controls and DOM roles for adding, editing, toggling, deleting, filtering, and clearing tasks. A validation pass exercises those controls before timing begins. The React version uses the production `createRoot` API, `flushSync` measurement boundaries, memoized rows and callbacks, and immutable functional updates. The Aurum version uses granular row data sources, `ArrayDataSource` mutations, and render batching.
|
|
119
|
+
|
|
120
|
+
Every mutation benchmark restores its own state inside the timed operation so every sample performs real equivalent DOM work; no sample relies on a one-time setup hook or degrades into a no-op. Suites are isolated so only the currently measured implementation retains its fixture in the DOM. On this machine, the comparison measured:
|
|
121
|
+
|
|
122
|
+
| TODO workload | Faster implementation | Throughput difference |
|
|
123
|
+
| ------------------------------------------------ | --------------------- | --------------------: |
|
|
124
|
+
| Mount and dispose 1,000 rows | Tie | 1.0× |
|
|
125
|
+
| Append and remove 1,000 rows | Aurum | 1.1× |
|
|
126
|
+
| Delete and restore 250 deterministic random rows | Aurum | 1.2× |
|
|
127
|
+
| Filter 2,000 rows and restore the full list | Tie | 1.2× |
|
|
128
|
+
| Clear and restore completed rows from 2,000 | Tie | 1.0× |
|
|
129
|
+
| Toggle 250 deterministic random rows twice | Aurum | 9.2× |
|
|
130
|
+
| Edit 250 deterministic random rows | Aurum | 12.0× |
|
|
131
|
+
|
|
132
|
+
Compared with the previous renderer and instrumented-production path on this machine, Aurum's 1,000-row mount/dispose time fell from 557 ms to 22 ms (25.7×), append/remove fell from 548 ms to 24 ms (23.2×), random delete/restore fell from 143 ms to 6.3 ms (22.8×), filtering fell from 779 ms to 32 ms (24.3×), and clear/restore fell from 408 ms to 15 ms (28.1×). This measures synchronous operation completion, not animation-frame consistency or input latency under a sustained stream. The retained-row toggle and edit cases are the closest workloads here to a streaming application, and those continue to favor Aurum. Run only this comparison with:
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
npm run benchmark --workspace @aurumjs/html -- todo_app_comparison
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The module also contains a low-sample 10× stress tier. Structural operations are slow enough that it uses three measured samples after one warmup; its ratios are directional and have wider error margins:
|
|
139
|
+
|
|
140
|
+
| 10× TODO workload | React mean | Aurum mean | Faster implementation |
|
|
141
|
+
| -------------------------------------------------- | ---------: | ---------: | --------------------: |
|
|
142
|
+
| Append and remove 10,000 rows | 528 ms | 532 ms | Tie, 1.0× |
|
|
143
|
+
| Delete and restore 2,500 deterministic random rows | 59 ms | 64 ms | Tie, 1.1× |
|
|
144
|
+
| Filter 10,000 rows and restore the full list | 135 ms | 180 ms | React, 1.34× |
|
|
145
|
+
| Toggle 2,500 deterministic random rows twice | 48 ms | 13 ms | Aurum, 3.7× |
|
|
146
|
+
| Edit 2,500 deterministic random rows | 27 ms | 3.8 ms | Aurum, 6.9× |
|
|
147
|
+
|
|
148
|
+
At 10× scale, React retains a smaller structural advantage while Aurum keeps its fine-grained update advantage. Run only the stress tier with:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
npm run benchmark --workspace @aurumjs/html -- todo_app_comparison -t "10× stress"
|
|
152
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aurumjs/html",
|
|
3
|
+
"version": "0.10.12",
|
|
4
|
+
"description": "HTML nodes, DOM rendering, styling, and HTML JSX types for Aurum",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./prebuilt/esnext/index.js",
|
|
7
|
+
"types": "./prebuilt/esnext/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./prebuilt/esnext/index.d.ts",
|
|
11
|
+
"import": "./prebuilt/esnext/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./jsx-runtime": {
|
|
14
|
+
"types": "./prebuilt/esnext/jsx-runtime.d.ts",
|
|
15
|
+
"import": "./prebuilt/esnext/jsx-runtime.js"
|
|
16
|
+
},
|
|
17
|
+
"./jsx-dev-runtime": {
|
|
18
|
+
"types": "./prebuilt/esnext/jsx-dev-runtime.d.ts",
|
|
19
|
+
"import": "./prebuilt/esnext/jsx-dev-runtime.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"prebuilt",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p tsconfig.build.json",
|
|
29
|
+
"test": "tsc -p tsconfig.test.json && vitest run",
|
|
30
|
+
"benchmark": "tsc -p tsconfig.bench.json && vitest bench --config vite.bench.config.ts --run",
|
|
31
|
+
"benchmark:devtools": "tsc -p tsconfig.bench.json && vitest bench --config vite.devtools-bench.config.ts --run",
|
|
32
|
+
"benchmark:save": "npm run benchmark -- --outputJson .benchmark-baseline.json",
|
|
33
|
+
"benchmark:compare": "npm run benchmark -- --compare .benchmark-baseline.json",
|
|
34
|
+
"prepack": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@aurumjs/rendering": "^0.10.0",
|
|
38
|
+
"@aurumjs/streams": "^0.10.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/react": "^19.2.18",
|
|
42
|
+
"@types/react-dom": "^19.2.4",
|
|
43
|
+
"@types/sinon": "^9.0.4",
|
|
44
|
+
"@vitest/browser": "^4.0.16",
|
|
45
|
+
"@vitest/browser-playwright": "^4.0.16",
|
|
46
|
+
"react": "^19.2.8",
|
|
47
|
+
"react-dom": "^19.2.8",
|
|
48
|
+
"sinon": "^9.0.3",
|
|
49
|
+
"vitest": "^4.0.16"
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT"
|
|
52
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AurumComponentAPI, ReadOnlyDataSource, Renderable } from '@aurumjs/rendering';
|
|
2
|
+
export type PortalTarget = HTMLElement | string | null | undefined;
|
|
3
|
+
export interface PortalProps {
|
|
4
|
+
/** Target element, selector, or reactive target. Defaults to document.body. */
|
|
5
|
+
target?: PortalTarget | ReadOnlyDataSource<PortalTarget> | (() => PortalTarget);
|
|
6
|
+
}
|
|
7
|
+
/** Renders children into another DOM container and keeps their lifetime tied to the owning component. */
|
|
8
|
+
export declare function Portal(props: PortalProps, children: Renderable[], api: AurumComponentAPI): undefined;
|
|
9
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/builtin_components/portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIvF,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,WAAW;IACxB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,YAAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC;CACnF;AAED,yGAAyG;AACzG,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,iBAAiB,GAAG,SAAS,CAyBpG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Aurum } from '../utilities/aurum.js';
|
|
2
|
+
/** Renders children into another DOM container and keeps their lifetime tied to the owning component. */
|
|
3
|
+
export function Portal(props, children, api) {
|
|
4
|
+
let mounted;
|
|
5
|
+
const mount = (requestedTarget) => {
|
|
6
|
+
mounted === null || mounted === void 0 ? void 0 : mounted.cancel();
|
|
7
|
+
mounted = undefined;
|
|
8
|
+
const target = resolvePortalTarget(requestedTarget);
|
|
9
|
+
if (target)
|
|
10
|
+
mounted = Aurum.attach(children, target);
|
|
11
|
+
};
|
|
12
|
+
api.onAttach(() => {
|
|
13
|
+
const target = props === null || props === void 0 ? void 0 : props.target;
|
|
14
|
+
if (isReadOnlyDataSource(target)) {
|
|
15
|
+
target.listenAndRepeat(mount, api.cancellationToken);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
mount(typeof target === 'function' ? target() : target);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
api.onDetach(() => {
|
|
22
|
+
mounted === null || mounted === void 0 ? void 0 : mounted.cancel();
|
|
23
|
+
mounted = undefined;
|
|
24
|
+
});
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function resolvePortalTarget(target) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if (target instanceof HTMLElement)
|
|
30
|
+
return target;
|
|
31
|
+
if (typeof target === 'string')
|
|
32
|
+
return (_a = document.querySelector(target)) !== null && _a !== void 0 ? _a : undefined;
|
|
33
|
+
if (target === undefined)
|
|
34
|
+
return (_b = document.body) !== null && _b !== void 0 ? _b : undefined;
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
function isReadOnlyDataSource(value) {
|
|
38
|
+
return typeof value === 'object' && value !== null && 'value' in value && typeof value.listenAndRepeat === 'function';
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../../src/builtin_components/portal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAS9C,yGAAyG;AACzG,MAAM,UAAU,MAAM,CAAC,KAAkB,EAAE,QAAsB,EAAE,GAAsB;IACrF,IAAI,OAAsC,CAAC;IAE3C,MAAM,KAAK,GAAG,CAAC,eAA6B,EAAQ,EAAE;QAClD,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,CAAC;QAClB,OAAO,GAAG,SAAS,CAAC;QAEpB,MAAM,MAAM,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACpD,IAAI,MAAM;YAAE,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;QACd,MAAM,MAAM,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC;QAC7B,IAAI,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC5D,CAAC;IACL,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;QACd,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,CAAC;QAClB,OAAO,GAAG,SAAS,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAoB;;IAC7C,IAAI,MAAM,YAAY,WAAW;QAAE,OAAO,MAAM,CAAC;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAA,QAAQ,CAAC,aAAa,CAAc,MAAM,CAAC,mCAAI,SAAS,CAAC;IAChG,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAA,QAAQ,CAAC,IAAI,mCAAI,SAAS,CAAC;IAC5D,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,oBAAoB,CAAC,KAA4B;IACtD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,UAAU,CAAC;AAC1H,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AurumComponentAPI, Renderable } from '@aurumjs/rendering';
|
|
2
|
+
import { DataWriter, ReadOnlyDataSource } from '@aurumjs/streams';
|
|
3
|
+
import { AProps } from '../nodes/simple_dom_nodes.js';
|
|
4
|
+
export interface RouterLinkProps extends Omit<AProps, 'href'> {
|
|
5
|
+
to: string;
|
|
6
|
+
replace?: boolean;
|
|
7
|
+
state?: unknown;
|
|
8
|
+
hashRouting?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** An anchor that uses the History API for same-document navigation. */
|
|
11
|
+
export declare function RouterLink(props: RouterLinkProps, children: Renderable[]): Renderable;
|
|
12
|
+
export interface RouterNavLinkProps extends RouterLinkProps {
|
|
13
|
+
activeClass?: string;
|
|
14
|
+
exact?: boolean;
|
|
15
|
+
/** Optional route source for server rendering, tests, or routers using a custom URL source. */
|
|
16
|
+
urlProvider?: ReadOnlyDataSource<string>;
|
|
17
|
+
active?: DataWriter<boolean>;
|
|
18
|
+
}
|
|
19
|
+
/** RouterLink variant with reactive active class and aria-current state. */
|
|
20
|
+
export declare function RouterNavLink(props: RouterNavLinkProps, children: Renderable[], api: AurumComponentAPI): Renderable;
|
|
21
|
+
//# sourceMappingURL=router_link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router_link.d.ts","sourceRoot":"","sources":["../../../src/builtin_components/router_link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAA6C,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAoC,UAAU,EAAE,kBAAkB,EAAyD,MAAM,kBAAkB,CAAC;AAC3J,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CA2BrF;AAED,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAChC;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,iBAAiB,GAAG,UAAU,CAyBnH"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRouterHref, isRouteActive, navigate } from '@aurumjs/rendering';
|
|
2
|
+
import { DataSource, combineClass, urlHashEmitter, urlPathEmitter, writeTo } from '@aurumjs/streams';
|
|
3
|
+
import { Aurum } from '../utilities/aurum.js';
|
|
4
|
+
/** An anchor that uses the History API for same-document navigation. */
|
|
5
|
+
export function RouterLink(props, children) {
|
|
6
|
+
const { to, replace, state, hashRouting, onClick, ...anchorProps } = props;
|
|
7
|
+
const href = createRouterHref(to, hashRouting);
|
|
8
|
+
return (Aurum.factory("a", { ...anchorProps, href: href, onClick: (event) => {
|
|
9
|
+
if (onClick)
|
|
10
|
+
writeTo(onClick, event);
|
|
11
|
+
if (event.defaultPrevented ||
|
|
12
|
+
event.button !== 0 ||
|
|
13
|
+
event.metaKey ||
|
|
14
|
+
event.ctrlKey ||
|
|
15
|
+
event.shiftKey ||
|
|
16
|
+
event.altKey ||
|
|
17
|
+
(typeof props.target === 'string' && props.target !== '_self')) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
navigate(to, { replace, state, hashRouting });
|
|
22
|
+
} }, children));
|
|
23
|
+
}
|
|
24
|
+
/** RouterLink variant with reactive active class and aria-current state. */
|
|
25
|
+
export function RouterNavLink(props, children, api) {
|
|
26
|
+
const { activeClass = 'active', exact, urlProvider, active: activeWriter, class: baseClass, ...linkProps } = props;
|
|
27
|
+
const path = new DataSource(currentPath(props.hashRouting), 'RouterNavLink path');
|
|
28
|
+
const activeClassSource = new DataSource('', 'RouterNavLink active class');
|
|
29
|
+
const ariaCurrent = new DataSource(false, 'RouterNavLink aria-current');
|
|
30
|
+
const updateActive = (value) => {
|
|
31
|
+
const next = isRouteActive(value, props.to, exact);
|
|
32
|
+
activeClassSource.updateIfChanged(next ? activeClass : '');
|
|
33
|
+
ariaCurrent.updateIfChanged(next ? 'page' : false);
|
|
34
|
+
activeWriter === null || activeWriter === void 0 ? void 0 : activeWriter.write(next);
|
|
35
|
+
};
|
|
36
|
+
if (urlProvider)
|
|
37
|
+
urlProvider.listenAndRepeat((value) => path.update(value), api.cancellationToken);
|
|
38
|
+
else if (typeof window !== 'undefined') {
|
|
39
|
+
if (props.hashRouting)
|
|
40
|
+
urlHashEmitter(path, true, api.cancellationToken);
|
|
41
|
+
else
|
|
42
|
+
urlPathEmitter(path, api.cancellationToken);
|
|
43
|
+
}
|
|
44
|
+
path.listenAndRepeat(updateActive, api.cancellationToken);
|
|
45
|
+
return (Aurum.factory(RouterLink, { ...linkProps, class: combineClass(api.cancellationToken, baseClass, activeClassSource), "aria-current": ariaCurrent }, children));
|
|
46
|
+
}
|
|
47
|
+
function currentPath(hashRouting) {
|
|
48
|
+
if (typeof window === 'undefined')
|
|
49
|
+
return '/';
|
|
50
|
+
if (!hashRouting)
|
|
51
|
+
return window.location.pathname;
|
|
52
|
+
return window.location.hash.slice(1).split(/[?#]/, 1)[0] || '/';
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=router_link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router_link.js","sourceRoot":"","sources":["../../../src/builtin_components/router_link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,gBAAgB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAwB,UAAU,EAAkC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM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W,IACtI,QAAQ,CACA,CAChB,CAAC;AACN,CAAC;AAED,SAAS,WAAW,CAAC,WAAgC;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,GAAG,CAAC;IAC9C,IAAI,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAClD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from '@aurumjs/rendering';
|
|
2
|
+
export * from './nodes/input.js';
|
|
3
|
+
export * from './nodes/select.js';
|
|
4
|
+
export * from './nodes/simple_dom_nodes.js';
|
|
5
|
+
export * from './nodes/textarea.js';
|
|
6
|
+
export * from './nodes/rendering_helpers.js';
|
|
7
|
+
export * from './rendering/renderers/dom_adapter.js';
|
|
8
|
+
export * from './rendering/renderers/string_adapter.js';
|
|
9
|
+
export * from './rendering/renderers/vdom_adapter.js';
|
|
10
|
+
export * from './rendering/dom_runtime.js';
|
|
11
|
+
export * from './rendering/render_batch.js';
|
|
12
|
+
export * from './builtin_components/portal.js';
|
|
13
|
+
export * from './builtin_components/router_link.js';
|
|
14
|
+
export * from './utilities/sanitize.js';
|
|
15
|
+
export * from './utilities/aurum.js';
|
|
16
|
+
export { Data } from './nodes/simple_dom_nodes.js';
|
|
17
|
+
export { Aurum, AurumDecorator } from './utilities/aurum.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from '@aurumjs/rendering';
|
|
2
|
+
export * from './nodes/input.js';
|
|
3
|
+
export * from './nodes/select.js';
|
|
4
|
+
export * from './nodes/simple_dom_nodes.js';
|
|
5
|
+
export * from './nodes/textarea.js';
|
|
6
|
+
export * from './nodes/rendering_helpers.js';
|
|
7
|
+
export * from './rendering/renderers/dom_adapter.js';
|
|
8
|
+
export * from './rendering/renderers/string_adapter.js';
|
|
9
|
+
export * from './rendering/renderers/vdom_adapter.js';
|
|
10
|
+
export * from './rendering/dom_runtime.js';
|
|
11
|
+
export * from './rendering/render_batch.js';
|
|
12
|
+
export * from './builtin_components/portal.js';
|
|
13
|
+
export * from './builtin_components/router_link.js';
|
|
14
|
+
export * from './utilities/sanitize.js';
|
|
15
|
+
export * from './utilities/aurum.js';
|
|
16
|
+
export { Data } from './nodes/simple_dom_nodes.js';
|
|
17
|
+
export { Aurum } from './utilities/aurum.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAkB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAO,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Renderable } from '@aurumjs/rendering';
|
|
2
|
+
import { Aurum } from './utilities/aurum.js';
|
|
3
|
+
export declare const Fragment: typeof Aurum.fragment;
|
|
4
|
+
type JSXProps = Record<string, unknown> & {
|
|
5
|
+
children?: Renderable | Renderable[];
|
|
6
|
+
};
|
|
7
|
+
/** Automatic JSX production entry point backed directly by Aurum element models. */
|
|
8
|
+
export declare function jsx(type: string | ((props: any, children: Renderable[], api: any) => Renderable), props: JSXProps | null, key?: string | number): Renderable;
|
|
9
|
+
/** Automatic JSX production entry point used for elements with static children. */
|
|
10
|
+
export declare const jsxs: typeof jsx;
|
|
11
|
+
export declare namespace JSX {
|
|
12
|
+
type Element = Renderable;
|
|
13
|
+
type ElementType = keyof IntrinsicElements | ((props: any, children: Renderable[], api: any) => Renderable);
|
|
14
|
+
interface IntrinsicAttributes extends Aurum.JSX.IntrinsicAttributes {
|
|
15
|
+
key?: string | number;
|
|
16
|
+
}
|
|
17
|
+
interface IntrinsicElements extends Aurum.JSX.IntrinsicElements {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
namespace Aurum {
|
|
22
|
+
namespace JSX {
|
|
23
|
+
type Element = Renderable;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,QAAQ,uBAAiB,CAAC;AAEvC,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;CAAE,CAAC;AA0BnF,oFAAoF;AACpF,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAE5J;AAED,mFAAmF;AACnF,eAAO,MAAM,IAAI,YAAM,CAAC;AAExB,yBAAiB,GAAG,CAAC;IACjB,KAAY,OAAO,GAAG,UAAU,CAAC;IACjC,KAAY,WAAW,GAAG,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC,CAAC;IAEnH,UAAiB,mBAAoB,SAAQ,KAAK,CAAC,GAAG,CAAC,mBAAmB;QACtE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB;IAED,UAAiB,iBAAkB,SAAQ,KAAK,CAAC,GAAG,CAAC,iBAAiB;KAAG;CAC5E;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,KAAK,CAAC;QACZ,UAAU,GAAG,CAAC;YACV,KAAK,OAAO,GAAG,UAAU,CAAC;SAC7B;KACJ;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Aurum } from './utilities/aurum.js';
|
|
2
|
+
export const Fragment = Aurum.fragment;
|
|
3
|
+
function normalizeChildren(children) {
|
|
4
|
+
if (children === undefined)
|
|
5
|
+
return [];
|
|
6
|
+
return Array.isArray(children) ? children : [children];
|
|
7
|
+
}
|
|
8
|
+
function createElement(type, inputProps, key) {
|
|
9
|
+
const props = inputProps == null ? {} : { ...inputProps };
|
|
10
|
+
const children = normalizeChildren(props.children);
|
|
11
|
+
delete props.children;
|
|
12
|
+
if (key !== undefined) {
|
|
13
|
+
Object.defineProperty(props, 'key', {
|
|
14
|
+
value: key,
|
|
15
|
+
enumerable: false
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return Aurum.factory(type, props, ...children);
|
|
19
|
+
}
|
|
20
|
+
/** Automatic JSX production entry point backed directly by Aurum element models. */
|
|
21
|
+
export function jsx(type, props, key) {
|
|
22
|
+
return createElement(type, props, key);
|
|
23
|
+
}
|
|
24
|
+
/** Automatic JSX production entry point used for elements with static children. */
|
|
25
|
+
export const jsxs = jsx;
|
|
26
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @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
+
import { DOMEvent, HTMLNodeProps } from '../rendering/renderers/dom_adapter.js';
|
|
2
|
+
import { AttributeValue, DataDrain, ReadOnlyDataSource } from '@aurumjs/streams';
|
|
3
|
+
export interface InputProps extends HTMLNodeProps<HTMLInputElement> {
|
|
4
|
+
placeholder?: AttributeValue;
|
|
5
|
+
readonly?: AttributeValue;
|
|
6
|
+
readOnly?: AttributeValue;
|
|
7
|
+
disabled?: AttributeValue;
|
|
8
|
+
onChange?: DataDrain<DOMEvent<InputEvent, HTMLInputElement>>;
|
|
9
|
+
onInput?: DataDrain<DOMEvent<InputEvent, HTMLInputElement>>;
|
|
10
|
+
value?: ReadOnlyDataSource<string> | ReadOnlyDataSource<number> | string | number;
|
|
11
|
+
defaultValue?: string | number;
|
|
12
|
+
accept?: AttributeValue;
|
|
13
|
+
alt?: AttributeValue;
|
|
14
|
+
autocomplete?: AttributeValue;
|
|
15
|
+
autoComplete?: AttributeValue;
|
|
16
|
+
autofocus?: AttributeValue;
|
|
17
|
+
autoFocus?: AttributeValue;
|
|
18
|
+
checked?: ReadOnlyDataSource<boolean> | boolean;
|
|
19
|
+
formAction?: AttributeValue;
|
|
20
|
+
formEnctype?: AttributeValue;
|
|
21
|
+
formMethod?: AttributeValue;
|
|
22
|
+
formNoValidate?: AttributeValue;
|
|
23
|
+
formTarget?: AttributeValue;
|
|
24
|
+
step?: AttributeValue;
|
|
25
|
+
list?: AttributeValue;
|
|
26
|
+
max?: AttributeValue;
|
|
27
|
+
maxLength?: AttributeValue;
|
|
28
|
+
maxlength?: AttributeValue;
|
|
29
|
+
min?: AttributeValue;
|
|
30
|
+
minLength?: AttributeValue;
|
|
31
|
+
minlength?: AttributeValue;
|
|
32
|
+
pattern?: AttributeValue;
|
|
33
|
+
multiple?: AttributeValue;
|
|
34
|
+
required?: AttributeValue;
|
|
35
|
+
type?: AttributeValue;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare const Input: (props: InputProps, children: import("@aurumjs/rendering").Renderable[], api: import("@aurumjs/rendering").AurumComponentAPI) => HTMLElement;
|
|
41
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/nodes/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAkB,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMjF,MAAM,WAAW,UAAW,SAAQ,aAAa,CAAC,gBAAgB,CAAC;IAC/D,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC5D,KAAK,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAChD,UAAU,CAAC,EAAE,cAA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