@shadow-js/web 1.0.0 → 1.0.1
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/CHANGELOG.md +6 -0
- package/dist/dev/attributes.d.ts +0 -2
- package/dist/dev/attributes.js +1 -2
- package/dist/dev/autofocus.d.ts +0 -2
- package/dist/dev/autofocus.js +1 -2
- package/dist/dev/class-style.d.ts +0 -2
- package/dist/dev/class-style.js +1 -2
- package/dist/dev/component.d.ts +0 -2
- package/dist/dev/component.js +1 -2
- package/dist/dev/control-flow/activity.d.ts +0 -2
- package/dist/dev/control-flow/activity.js +1 -2
- package/dist/dev/control-flow/branch.js +0 -1
- package/dist/dev/control-flow/client-only.d.ts +0 -2
- package/dist/dev/control-flow/client-only.js +1 -2
- package/dist/dev/control-flow/dynamic.d.ts +0 -2
- package/dist/dev/control-flow/dynamic.js +1 -2
- package/dist/dev/control-flow/error-boundary.d.ts +0 -2
- package/dist/dev/control-flow/error-boundary.js +1 -2
- package/dist/dev/control-flow/for.d.ts +0 -2
- package/dist/dev/control-flow/for.js +1 -2
- package/dist/dev/control-flow/fragment.d.ts +0 -2
- package/dist/dev/control-flow/fragment.js +1 -2
- package/dist/dev/control-flow/hot-link.js +1 -2
- package/dist/dev/control-flow/index-list.d.ts +0 -2
- package/dist/dev/control-flow/index-list.js +1 -2
- package/dist/dev/control-flow/lazy.d.ts +0 -2
- package/dist/dev/control-flow/lazy.js +1 -2
- package/dist/dev/control-flow/no-hydration.d.ts +0 -2
- package/dist/dev/control-flow/no-hydration.js +1 -2
- package/dist/dev/control-flow/portal.d.ts +0 -2
- package/dist/dev/control-flow/portal.js +1 -2
- package/dist/dev/control-flow/root-errors.d.ts +0 -2
- package/dist/dev/control-flow/root-errors.js +1 -2
- package/dist/dev/control-flow/show.d.ts +0 -2
- package/dist/dev/control-flow/show.js +1 -2
- package/dist/dev/control-flow/suspense-list.d.ts +0 -2
- package/dist/dev/control-flow/suspense-list.js +1 -2
- package/dist/dev/control-flow/suspense.d.ts +0 -2
- package/dist/dev/control-flow/suspense.js +1 -2
- package/dist/dev/control-flow/switch.d.ts +0 -2
- package/dist/dev/control-flow/switch.js +1 -2
- package/dist/dev/derived.d.ts +0 -2
- package/dist/dev/derived.js +1 -2
- package/dist/dev/element.d.ts +0 -2
- package/dist/dev/element.js +1 -2
- package/dist/dev/events.d.ts +0 -2
- package/dist/dev/events.js +1 -2
- package/dist/dev/head/components.d.ts +0 -2
- package/dist/dev/head/components.js +1 -2
- package/dist/dev/head/registry.js +1 -2
- package/dist/dev/head/server-head.d.ts +0 -2
- package/dist/dev/head/server-head.js +1 -2
- package/dist/dev/head/sink.js +1 -2
- package/dist/dev/head/use-head.d.ts +0 -2
- package/dist/dev/head/use-head.js +1 -2
- package/dist/dev/head/validate.d.ts +0 -2
- package/dist/dev/head/validate.js +1 -2
- package/dist/dev/hmr.d.ts +0 -2
- package/dist/dev/hmr.js +1 -2
- package/dist/dev/hydration.d.ts +0 -2
- package/dist/dev/hydration.js +1 -2
- package/dist/dev/insert.d.ts +0 -2
- package/dist/dev/insert.js +1 -2
- package/dist/dev/internal/claim.d.ts +0 -2
- package/dist/dev/internal/claim.js +1 -2
- package/dist/dev/internal/css-units.js +1 -2
- package/dist/dev/internal/diagnostics.d.ts +0 -2
- package/dist/dev/internal/diagnostics.js +1 -2
- package/dist/dev/internal/early-events.js +1 -2
- package/dist/dev/internal/hydration-hooks.d.ts +0 -2
- package/dist/dev/internal/hydration-hooks.js +0 -1
- package/dist/dev/internal/hydration-scope.d.ts +0 -2
- package/dist/dev/internal/hydration-scope.js +1 -2
- package/dist/dev/internal/names.d.ts +0 -2
- package/dist/dev/internal/names.js +1 -2
- package/dist/dev/internal/portal-context.d.ts +0 -2
- package/dist/dev/internal/portal-context.js +1 -2
- package/dist/dev/internal/react-names.js +1 -2
- package/dist/dev/internal/reconcile.d.ts +0 -2
- package/dist/dev/internal/reconcile.js +1 -2
- package/dist/dev/internal/stream-context.d.ts +0 -2
- package/dist/dev/internal/stream-context.js +1 -2
- package/dist/dev/jsx/aria.d.ts +0 -2
- package/dist/dev/jsx/component.d.ts +0 -2
- package/dist/dev/jsx/events.d.ts +0 -2
- package/dist/dev/jsx/global.d.ts +0 -2
- package/dist/dev/jsx/html.d.ts +0 -2
- package/dist/dev/jsx/intrinsic.d.ts +0 -2
- package/dist/dev/jsx/mathml.d.ts +0 -2
- package/dist/dev/jsx/svg.d.ts +0 -2
- package/dist/dev/jsx/types.d.ts +0 -2
- package/dist/dev/jsx-runtime.d.ts +0 -2
- package/dist/dev/reactive.d.ts +0 -2
- package/dist/dev/reactive.js +1 -2
- package/dist/dev/render.d.ts +0 -2
- package/dist/dev/render.js +1 -2
- package/dist/dev/resource-hints.d.ts +0 -2
- package/dist/dev/resource-hints.js +1 -2
- package/dist/dev/select-value.d.ts +0 -2
- package/dist/dev/select-value.js +1 -2
- package/dist/dev/server/attributes.d.ts +0 -2
- package/dist/dev/server/attributes.js +1 -2
- package/dist/dev/server/class-style.d.ts +0 -2
- package/dist/dev/server/class-style.js +1 -2
- package/dist/dev/server/component.d.ts +0 -2
- package/dist/dev/server/component.js +1 -2
- package/dist/dev/server/derived.d.ts +0 -2
- package/dist/dev/server/derived.js +1 -2
- package/dist/dev/server/element.d.ts +0 -2
- package/dist/dev/server/element.js +1 -2
- package/dist/dev/server/errors.js +1 -2
- package/dist/dev/server/escape.d.ts +0 -2
- package/dist/dev/server/escape.js +1 -2
- package/dist/dev/server/form-controls.d.ts +0 -2
- package/dist/dev/server/form-controls.js +1 -2
- package/dist/dev/server/hydration-script.d.ts +0 -2
- package/dist/dev/server/hydration-script.js +1 -2
- package/dist/dev/server/node.d.ts +0 -2
- package/dist/dev/server/node.js +1 -2
- package/dist/dev/server/portals.d.ts +0 -2
- package/dist/dev/server/portals.js +0 -1
- package/dist/dev/server/render.d.ts +0 -2
- package/dist/dev/server/render.js +1 -2
- package/dist/dev/server/serialize.d.ts +0 -2
- package/dist/dev/server/serialize.js +1 -2
- package/dist/dev/server/stream.d.ts +0 -2
- package/dist/dev/server/stream.js +1 -2
- package/dist/dev/spread.d.ts +0 -2
- package/dist/dev/spread.js +1 -2
- package/dist/dev/template.d.ts +0 -2
- package/dist/dev/template.js +1 -2
- package/dist/dev/view-transition.d.ts +0 -2
- package/dist/dev/view-transition.js +1 -2
- package/dist/server-dev/attributes.js +1 -2
- package/dist/server-dev/autofocus.js +1 -2
- package/dist/server-dev/class-style.js +1 -2
- package/dist/server-dev/component.js +1 -2
- package/dist/server-dev/control-flow/activity.js +1 -2
- package/dist/server-dev/control-flow/branch.js +0 -1
- package/dist/server-dev/control-flow/client-only.js +1 -2
- package/dist/server-dev/control-flow/dynamic.js +1 -2
- package/dist/server-dev/control-flow/error-boundary.js +1 -2
- package/dist/server-dev/control-flow/for.js +1 -2
- package/dist/server-dev/control-flow/fragment.js +1 -2
- package/dist/server-dev/control-flow/hot-link.js +1 -2
- package/dist/server-dev/control-flow/index-list.js +1 -2
- package/dist/server-dev/control-flow/lazy.js +1 -2
- package/dist/server-dev/control-flow/no-hydration.js +1 -2
- package/dist/server-dev/control-flow/portal.js +1 -2
- package/dist/server-dev/control-flow/root-errors.js +1 -2
- package/dist/server-dev/control-flow/show.js +1 -2
- package/dist/server-dev/control-flow/suspense-list.js +1 -2
- package/dist/server-dev/control-flow/suspense.js +1 -2
- package/dist/server-dev/control-flow/switch.js +1 -2
- package/dist/server-dev/derived.js +1 -2
- package/dist/server-dev/element.js +1 -2
- package/dist/server-dev/events.js +1 -2
- package/dist/server-dev/head/components.js +1 -2
- package/dist/server-dev/head/registry.js +1 -2
- package/dist/server-dev/head/server-head.js +1 -2
- package/dist/server-dev/head/sink.js +1 -2
- package/dist/server-dev/head/use-head.js +1 -2
- package/dist/server-dev/head/validate.js +1 -2
- package/dist/server-dev/hydration.js +1 -2
- package/dist/server-dev/insert.js +1 -2
- package/dist/server-dev/internal/claim.js +1 -2
- package/dist/server-dev/internal/css-units.js +1 -2
- package/dist/server-dev/internal/diagnostics.js +1 -2
- package/dist/server-dev/internal/early-events.js +1 -2
- package/dist/server-dev/internal/hydration-hooks.js +0 -1
- package/dist/server-dev/internal/hydration-scope.js +1 -2
- package/dist/server-dev/internal/names.js +1 -2
- package/dist/server-dev/internal/portal-context.js +1 -2
- package/dist/server-dev/internal/react-names.js +1 -2
- package/dist/server-dev/internal/reconcile.js +1 -2
- package/dist/server-dev/internal/stream-context.js +1 -2
- package/dist/server-dev/reactive.js +1 -2
- package/dist/server-dev/render.js +1 -2
- package/dist/server-dev/resource-hints.js +1 -2
- package/dist/server-dev/select-value.js +1 -2
- package/dist/server-dev/server/attributes.js +1 -2
- package/dist/server-dev/server/class-style.js +1 -2
- package/dist/server-dev/server/component.js +1 -2
- package/dist/server-dev/server/derived.js +1 -2
- package/dist/server-dev/server/element.js +1 -2
- package/dist/server-dev/server/errors.js +1 -2
- package/dist/server-dev/server/escape.js +1 -2
- package/dist/server-dev/server/form-controls.js +1 -2
- package/dist/server-dev/server/hydration-script.js +1 -2
- package/dist/server-dev/server/node.js +1 -2
- package/dist/server-dev/server/portals.js +0 -1
- package/dist/server-dev/server/render.js +1 -2
- package/dist/server-dev/server/serialize.js +1 -2
- package/dist/server-dev/server/stream.js +1 -2
- package/dist/server-dev/spread.js +1 -2
- package/dist/server-dev/template.js +1 -2
- package/dist/server-dev/view-transition.js +1 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onMount } from "@shadow-js/core";
|
|
2
2
|
import { isHydrating } from "@shadow-js/core/extend";
|
|
3
|
-
|
|
3
|
+
// src/autofocus.ts
|
|
4
4
|
/**
|
|
5
5
|
* Focuses an element written with `autoFocus` (React parity) once it is inserted into the document
|
|
6
6
|
* by a client render or update. The compiler calls this for an `autoFocus` attribute and for
|
|
@@ -39,7 +39,6 @@ function autoFocus(el, enabled) {
|
|
|
39
39
|
if (el.isConnected && free && (el instanceof HTMLElement || el instanceof SVGElement)) el.focus();
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { autoFocus };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=autofocus.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cssValueText } from "./internal/css-units.js";
|
|
2
2
|
import { HTML_NS } from "./internal/names.js";
|
|
3
|
-
|
|
3
|
+
// src/class-style.ts
|
|
4
4
|
/** Appends the truthy class names of `value` (strings, numbers, nested arrays, objects) to `parts`. */
|
|
5
5
|
function collectClasses(root, parts) {
|
|
6
6
|
const frames = [[root]];
|
|
@@ -191,7 +191,6 @@ function style(el, value, prev) {
|
|
|
191
191
|
}
|
|
192
192
|
return next;
|
|
193
193
|
}
|
|
194
|
-
//#endregion
|
|
195
194
|
export { applyClass, classList, className, setStyleProperty, style, toCssProperty };
|
|
196
195
|
|
|
197
196
|
//# sourceMappingURL=class-style.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { currentScope, enterComponent } from "./internal/hydration-scope.js";
|
|
2
2
|
import { DEVTOOLS_EVENT, addCleanup, createOwner, devtoolsReport, runInScope } from "@shadow-js/core/extend";
|
|
3
|
-
|
|
3
|
+
// src/component.ts
|
|
4
4
|
/** Dev-only: the name each component was created with, for devtools. Weak, so components are not kept alive. */
|
|
5
5
|
const componentNames = /* @__PURE__ */ new WeakMap();
|
|
6
6
|
/**
|
|
@@ -36,7 +36,6 @@ function createComponent(component, props, name) {
|
|
|
36
36
|
return result;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { createComponent };
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=component.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@shadow-js/core";
|
|
2
2
|
import "@shadow-js/core/extend";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/activity.ts
|
|
4
4
|
/**
|
|
5
5
|
* Keeps its children alive while hidden: `mode="hidden"` removes them from sight but keeps their state,
|
|
6
6
|
* their DOM nodes and their focus and scroll position. Hidden content is paused: its effects run their
|
|
@@ -35,7 +35,6 @@ import "@shadow-js/core/extend";
|
|
|
35
35
|
function Activity(props) {
|
|
36
36
|
return () => props.children;
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { Activity };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=activity.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Show } from "./show.js";
|
|
2
2
|
import { onMount, useSignal } from "@shadow-js/core";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/client-only.ts
|
|
4
4
|
/**
|
|
5
5
|
* Renders `children` in the browser only. The server (and the first client pass, which must match
|
|
6
6
|
* the server's markup) renders `fallback`; once mounted, the children replace it. Use it for
|
|
@@ -44,7 +44,6 @@ function ClientOnly(props) {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
export { ClientOnly };
|
|
49
48
|
|
|
50
49
|
//# sourceMappingURL=client-only.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent } from "../component.js";
|
|
2
2
|
import { ssrElement, ssrRaw } from "../server/element.js";
|
|
3
3
|
import { mergeProps, splitProps, untrack, useMemo } from "@shadow-js/core";
|
|
4
|
-
|
|
4
|
+
// src/control-flow/dynamic.ts
|
|
5
5
|
/** Shape of a tag name: a letter, then letters, digits or dashes. Anything else is refused. */
|
|
6
6
|
const TAG_PATTERN = /^[a-z][a-z0-9-]*$/i;
|
|
7
7
|
/** Tags refused in any letter case: a script would bypass CSP nonces and Trusted Types. */
|
|
@@ -100,7 +100,6 @@ function createDynamic(component, props = {}) {
|
|
|
100
100
|
return component();
|
|
101
101
|
} }, props));
|
|
102
102
|
}
|
|
103
|
-
//#endregion
|
|
104
103
|
export { Dynamic, createDynamic };
|
|
105
104
|
|
|
106
105
|
//# sourceMappingURL=dynamic.js.map
|
|
@@ -3,7 +3,7 @@ import { attachHotModules, createHotLink } from "./hot-link.js";
|
|
|
3
3
|
import { rootErrorsOf } from "./root-errors.js";
|
|
4
4
|
import { catchError, createRoot, getOwner, onCleanup, untrack, useMemo, useSignal } from "@shadow-js/core";
|
|
5
5
|
import { createSignalNode, handleError, readSignal, writeSignal } from "@shadow-js/core/extend";
|
|
6
|
-
|
|
6
|
+
// src/control-flow/error-boundary.ts
|
|
7
7
|
function ErrorBoundary(props) {
|
|
8
8
|
const failureCell = createSignalNode(void 0, Object.is);
|
|
9
9
|
/** Where an error of this boundary's own fallback goes: the boundary that encloses it. */
|
|
@@ -109,7 +109,6 @@ function ErrorBoundary(props) {
|
|
|
109
109
|
});
|
|
110
110
|
return body;
|
|
111
111
|
}
|
|
112
|
-
//#endregion
|
|
113
112
|
export { ErrorBoundary };
|
|
114
113
|
|
|
115
114
|
//# sourceMappingURL=error-boundary.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mapArray, untrack } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/for.ts
|
|
3
3
|
/**
|
|
4
4
|
* Calls the row callback. `props.children` is read untracked, once per row.
|
|
5
5
|
* @internal
|
|
@@ -17,7 +17,6 @@ function For(props) {
|
|
|
17
17
|
fallback
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { For };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=for.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/control-flow/fragment.ts
|
|
2
2
|
/**
|
|
3
3
|
* A no-op wrapper: returns `props.children` untouched, so the children are created by the caller's
|
|
4
4
|
* getter exactly as if no wrapper existed. Use it to group several children under one element.
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
function Fragment(props) {
|
|
26
26
|
return props.children;
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { Fragment };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=fragment.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOwner } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/hot-link.ts
|
|
3
3
|
/**
|
|
4
4
|
* The hot-update link between an error boundary and the modules its children were built from. Dev
|
|
5
5
|
* only: the callers reach this code behind `__DEV__`, so production bundles never include it.
|
|
@@ -51,7 +51,6 @@ function createHotLink(onUpdate) {
|
|
|
51
51
|
disarm
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
//#endregion
|
|
55
54
|
export { attachHotModules, createHotLink };
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=hot-link.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { indexArray, untrack } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/index-list.ts
|
|
3
3
|
/**
|
|
4
4
|
* Renders one row per position. Rows are created and removed only when the length changes; the
|
|
5
5
|
* row at position `i` stays, and its item accessor follows the value at `i`. Use it for
|
|
@@ -25,7 +25,6 @@ import { indexArray, untrack } from "@shadow-js/core";
|
|
|
25
25
|
function Index(props) {
|
|
26
26
|
return indexArray(() => props.each, (item, index) => untrack(() => props.children)(item, index), { fallback: () => props.fallback });
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { Index };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=index-list.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack, useMemo, useResource } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/lazy.ts
|
|
3
3
|
/**
|
|
4
4
|
* Defines a component whose code is loaded on first render. While loading, the nearest
|
|
5
5
|
* `<Suspense>` shows its fallback; a failed load throws to the nearest `<ErrorBoundary>` and the
|
|
@@ -58,7 +58,6 @@ function lazy(loader) {
|
|
|
58
58
|
Lazy.preload = load;
|
|
59
59
|
return Lazy;
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { lazy };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=lazy.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nextKey, withScope } from "../internal/hydration-scope.js";
|
|
2
2
|
import { ssrRaw } from "../server/element.js";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/no-hydration.ts
|
|
4
4
|
/**
|
|
5
5
|
* Content the browser never hydrates: the server renders it without hydration keys, and while the
|
|
6
6
|
* page hydrates the browser leaves that markup exactly as it is (no code runs for it, no event
|
|
@@ -34,7 +34,6 @@ function NoHydration(props) {
|
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { NoHydration };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=no-hydration.js.map
|
|
@@ -4,7 +4,7 @@ import { bindRegion, createRegion, removeRegion } from "../insert.js";
|
|
|
4
4
|
import { PortalContext } from "../internal/portal-context.js";
|
|
5
5
|
import { renderServerPortal } from "../server/portals.js";
|
|
6
6
|
import { createRoot, isServer, onCleanup, useContext, useRenderEffect } from "@shadow-js/core";
|
|
7
|
-
|
|
7
|
+
// src/control-flow/portal.ts
|
|
8
8
|
/** Appends `node` to `target`, moving it in place when the target supports `moveBefore`. */
|
|
9
9
|
function appendMoved(target, node) {
|
|
10
10
|
if (typeof target.moveBefore === "function") target.moveBefore(node, null);
|
|
@@ -128,7 +128,6 @@ function Portal(props) {
|
|
|
128
128
|
onCleanup(unmount);
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
//#endregion
|
|
132
131
|
export { Portal };
|
|
133
132
|
|
|
134
133
|
//# sourceMappingURL=portal.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOwner } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/root-errors.ts
|
|
3
3
|
/**
|
|
4
4
|
* The key the reporters are stored under in an owner's context map. A symbol the context map inherits
|
|
5
5
|
* (as a Provider's value is inherited), so every node below the root sees it, detached roots included.
|
|
@@ -27,7 +27,6 @@ function attachRootErrors(options) {
|
|
|
27
27
|
function rootErrorsOf(owner) {
|
|
28
28
|
return owner?.context?.[ROOT_ERRORS];
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { attachRootErrors, rootErrorsOf };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=root-errors.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBranches } from "./branch.js";
|
|
2
|
-
|
|
2
|
+
// src/control-flow/show.ts
|
|
3
3
|
function Show(props) {
|
|
4
4
|
return createBranches("Show", () => {
|
|
5
5
|
const when = props.when;
|
|
@@ -12,7 +12,6 @@ function Show(props) {
|
|
|
12
12
|
};
|
|
13
13
|
}, () => props.fallback);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { Show };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=show.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, onCleanup } from "@shadow-js/core";
|
|
2
2
|
import { createSignalNode, readSignal, writeSignal } from "@shadow-js/core/extend";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/suspense-list.ts
|
|
4
4
|
/** The enclosing list, or null. @internal */
|
|
5
5
|
const SuspenseListContext = /* @__PURE__ */ createContext(null, { name: "SuspenseList" });
|
|
6
6
|
/**
|
|
@@ -94,7 +94,6 @@ function SuspenseList(props) {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { SuspenseList, SuspenseListContext };
|
|
99
98
|
|
|
100
99
|
//# sourceMappingURL=suspense-list.js.map
|
|
@@ -4,7 +4,7 @@ import { ssrRaw } from "../server/element.js";
|
|
|
4
4
|
import { StreamContext } from "../internal/stream-context.js";
|
|
5
5
|
import { SuspenseContext, getOwner, runWithOwner, useContext } from "@shadow-js/core";
|
|
6
6
|
import { createOwner, createSignalNode, readSignal, transitionHooks, writeSignal } from "@shadow-js/core/extend";
|
|
7
|
-
|
|
7
|
+
// src/control-flow/suspense.ts
|
|
8
8
|
/**
|
|
9
9
|
* A counter the resources of one boundary report to (see {@link SuspenseTracker}), and the hold a
|
|
10
10
|
* transition takes on the boundary. A transition that reads pending data while the boundary shows
|
|
@@ -113,7 +113,6 @@ function suspenseOnServer(props, key, count, content) {
|
|
|
113
113
|
ssrRaw("<!--]-->")
|
|
114
114
|
];
|
|
115
115
|
}
|
|
116
|
-
//#endregion
|
|
117
116
|
export { Suspense };
|
|
118
117
|
|
|
119
118
|
//# sourceMappingURL=suspense.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBranches } from "./branch.js";
|
|
2
2
|
import { children } from "@shadow-js/core";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/switch.ts
|
|
4
4
|
/**
|
|
5
5
|
* Describes one branch of a {@link Switch}. It returns its props unchanged.
|
|
6
6
|
*
|
|
@@ -84,7 +84,6 @@ function Switch(props) {
|
|
|
84
84
|
};
|
|
85
85
|
}, () => props.fallback);
|
|
86
86
|
}
|
|
87
|
-
//#endregion
|
|
88
87
|
export { Match, Switch };
|
|
89
88
|
|
|
90
89
|
//# sourceMappingURL=switch.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/derived.ts
|
|
3
3
|
/**
|
|
4
4
|
* Wraps a computation as a {@link Derived} value that recomputes only when the signals it reads
|
|
5
5
|
* change. The compiler emits it for `const x = <expression reading signals>` inside components; it
|
|
@@ -28,7 +28,6 @@ function derived(compute) {
|
|
|
28
28
|
Object.defineProperty(read, "value", { get: memo });
|
|
29
29
|
return read;
|
|
30
30
|
}
|
|
31
|
-
//#endregion
|
|
32
31
|
export { derived };
|
|
33
32
|
|
|
34
33
|
//# sourceMappingURL=derived.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ssrElement, ssrRaw } from "./server/element.js";
|
|
2
2
|
import "@shadow-js/core";
|
|
3
|
-
|
|
3
|
+
// src/element.ts
|
|
4
4
|
/**
|
|
5
5
|
* The slim element primitive: one HTML element with attributes, event listeners, `ref` and children,
|
|
6
6
|
* and no generic prop runtime. `Dynamic` and `spread` cover every prop shape; this covers the common
|
|
@@ -60,7 +60,6 @@ function element(tag, props) {
|
|
|
60
60
|
];
|
|
61
61
|
}, true);
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { element };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=element.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { batch, getOwner, onCleanup, untrack } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/events.ts
|
|
3
3
|
/**
|
|
4
4
|
* Events that may be delegated: composed events, which leave a shadow root and reach the document.
|
|
5
5
|
* `change` is not composed, so it is bound on its element (see the note on `bindEvent`).
|
|
@@ -259,7 +259,6 @@ function addEventListener(el, name, handler, delegate, capture) {
|
|
|
259
259
|
const unbind = bindEvent(el, name, handler, delegate === true, capture === true);
|
|
260
260
|
if (unbind !== void 0 && getOwner() !== null) onCleanup(unbind);
|
|
261
261
|
}
|
|
262
|
-
//#endregion
|
|
263
262
|
export { addEventListener, bindEvent, chainEvents, clearDelegatedEvents, delegateEvents };
|
|
264
263
|
|
|
265
264
|
//# sourceMappingURL=events.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useHead } from "./use-head.js";
|
|
2
|
-
|
|
2
|
+
// src/head/components.ts
|
|
3
3
|
/** Text of a value that may be an accessor. Anything but text or an array of text throws. */
|
|
4
4
|
function partText(value) {
|
|
5
5
|
if (typeof value === "string") return value;
|
|
@@ -164,7 +164,6 @@ function Base(props) {
|
|
|
164
164
|
useHead(() => attributeTag("base", props, ["children"]));
|
|
165
165
|
return null;
|
|
166
166
|
}
|
|
167
|
-
//#endregion
|
|
168
167
|
export { Base, Link, Meta, Style, Title };
|
|
169
168
|
|
|
170
169
|
//# sourceMappingURL=components.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/head/registry.ts
|
|
2
2
|
const noop = () => void 0;
|
|
3
3
|
/**
|
|
4
4
|
* Creates an empty head registry. `onChange` runs after every effective add or removal, so the
|
|
@@ -62,7 +62,6 @@ function createHeadRegistry(onChange) {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
//#endregion
|
|
66
65
|
export { createHeadRegistry };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=registry.js.map
|
|
@@ -2,7 +2,7 @@ import { escapeHtml } from "../server/escape.js";
|
|
|
2
2
|
import { createHeadRegistry } from "./registry.js";
|
|
3
3
|
import { HEAD_KEY, HEAD_MARKER } from "./validate.js";
|
|
4
4
|
import { createContext } from "@shadow-js/core";
|
|
5
|
-
|
|
5
|
+
// src/head/server-head.ts
|
|
6
6
|
/** Elements that never have content or a closing tag. */
|
|
7
7
|
const VOID_TAGS = /* @__PURE__ */ new Set([
|
|
8
8
|
"meta",
|
|
@@ -70,7 +70,6 @@ function runWithServerHead(head, fn) {
|
|
|
70
70
|
});
|
|
71
71
|
return holder.value;
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { ServerHeadContext, createServerHead, runWithServerHead };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=server-head.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HEAD_KEY, HEAD_MARKER, identityOfElement } from "./validate.js";
|
|
2
|
-
|
|
2
|
+
// src/head/sink.ts
|
|
3
3
|
/** Removes or restores one element the sink owned. Elements already gone are ignored. */
|
|
4
4
|
function release(head, record) {
|
|
5
5
|
const el = record.el;
|
|
@@ -90,7 +90,6 @@ function createDomHeadSink(doc) {
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
export { createDomHeadSink };
|
|
95
94
|
|
|
96
95
|
//# sourceMappingURL=sink.js.map
|
|
@@ -3,7 +3,7 @@ import { normalizeTags } from "./validate.js";
|
|
|
3
3
|
import { ServerHeadContext } from "./server-head.js";
|
|
4
4
|
import { createDomHeadSink } from "./sink.js";
|
|
5
5
|
import { createRoot, getOwner, isServer, untrack, useContext, useEffect, useRenderEffect, useSignal } from "@shadow-js/core";
|
|
6
|
-
|
|
6
|
+
// src/head/use-head.ts
|
|
7
7
|
/** One registry per document, shared by every `useHead` call on it. */
|
|
8
8
|
const registries = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
/**
|
|
@@ -78,7 +78,6 @@ function useHead(input) {
|
|
|
78
78
|
const registry = registryFor(document);
|
|
79
79
|
useRenderEffect(() => normalizeTags(typeof input === "function" ? input() : input), (tags) => registry.add(tags));
|
|
80
80
|
}
|
|
81
|
-
//#endregion
|
|
82
81
|
export { useHead };
|
|
83
82
|
|
|
84
83
|
//# sourceMappingURL=use-head.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { warnOnce } from "../internal/diagnostics.js";
|
|
2
2
|
import { isUnsafeUrlAttribute } from "../attributes.js";
|
|
3
|
-
|
|
3
|
+
// src/head/validate.ts
|
|
4
4
|
/** Marks every element the sink created or adopted. Callers may not supply it. @internal */
|
|
5
5
|
const HEAD_MARKER = "data-shadow-head";
|
|
6
6
|
/** Carries a style's key so a server-rendered style can be adopted. @internal */
|
|
@@ -262,7 +262,6 @@ function identityOfElement(element) {
|
|
|
262
262
|
}
|
|
263
263
|
return identityOf(name, lookup, element.getAttribute("data-shadow-key") ?? void 0);
|
|
264
264
|
}
|
|
265
|
-
//#endregion
|
|
266
265
|
export { HEAD_KEY, HEAD_MARKER, identityOf, identityOfElement, isHeadTagName, normalizeTag, normalizeTags };
|
|
267
266
|
|
|
268
267
|
//# sourceMappingURL=validate.js.map
|
|
@@ -6,7 +6,7 @@ import { attachRootErrors } from "./control-flow/root-errors.js";
|
|
|
6
6
|
import { replayEarlyEvents } from "./internal/early-events.js";
|
|
7
7
|
import { ResourceCacheContext, batch, createRoot, flushSync, runWithOwner, untrack } from "@shadow-js/core";
|
|
8
8
|
import { withHydration } from "@shadow-js/core/extend";
|
|
9
|
-
|
|
9
|
+
// src/hydration.ts
|
|
10
10
|
function dataCache(data) {
|
|
11
11
|
const used = /* @__PURE__ */ new Set();
|
|
12
12
|
return {
|
|
@@ -114,7 +114,6 @@ function hydrate(code, container, options = {}) {
|
|
|
114
114
|
removeRegion(region);
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
//#endregion
|
|
118
117
|
export { hydrate };
|
|
119
118
|
|
|
120
119
|
//# sourceMappingURL=hydration.js.map
|
|
@@ -3,7 +3,7 @@ import { claims } from "./internal/hydration-hooks.js";
|
|
|
3
3
|
import { reconcileNodes } from "./internal/reconcile.js";
|
|
4
4
|
import { useRenderEffect } from "@shadow-js/core";
|
|
5
5
|
import { createComputation, currentOwner, disposeOwner, readComputation } from "@shadow-js/core/extend";
|
|
6
|
-
|
|
6
|
+
// src/insert.ts
|
|
7
7
|
/** Longest chain of accessors a single value may hold (a function returning a function ...). */
|
|
8
8
|
const MAX_ACCESSOR_DEPTH = 1e4;
|
|
9
9
|
/** The document a node belongs to (a Document is its own document). */
|
|
@@ -351,7 +351,6 @@ function insert(parent, value, anchorNode, initial) {
|
|
|
351
351
|
const resolvedAnchor = anchorNode ?? null;
|
|
352
352
|
return bindRegion(createRegion(parent, resolvedAnchor, initial === void 0 ? claims.current.takeRegion(parent, resolvedAnchor) : initial), value);
|
|
353
353
|
}
|
|
354
|
-
//#endregion
|
|
355
354
|
export { anchor, bindRegion, createRegion, insert, removeRegion };
|
|
356
355
|
|
|
357
356
|
//# sourceMappingURL=insert.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEVTOOLS_EVENT, devtoolsReport } from "@shadow-js/core/extend";
|
|
2
|
-
|
|
2
|
+
// src/internal/claim.ts
|
|
3
3
|
let state = null;
|
|
4
4
|
/** Starts a claiming pass over the given server elements. @internal */
|
|
5
5
|
function beginClaiming(registry, recoverable) {
|
|
@@ -351,7 +351,6 @@ function isComment(node, data) {
|
|
|
351
351
|
function isRegionMarker(comment) {
|
|
352
352
|
return comment.data === "[" || comment.data === "]";
|
|
353
353
|
}
|
|
354
|
-
//#endregion
|
|
355
354
|
export { beginClaiming, checkClaimedTag, checkClaimedText, claimElement, claimPortal, endClaiming, isClaiming, liftedRegions, releaseUnclaimedPortals, takeRegion, withoutClaiming };
|
|
356
355
|
|
|
357
356
|
//# sourceMappingURL=claim.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/css-units.ts
|
|
2
2
|
/**
|
|
3
3
|
* React's unitless style properties. A number given to any other property is in pixels (`0` stays
|
|
4
4
|
* `0`); these properties take the bare number. Vendor prefixes do not change the answer.
|
|
@@ -20,7 +20,6 @@ function cssValueText(property, value) {
|
|
|
20
20
|
const bare = property.replace(/^-(?:webkit|moz|ms|o)-/, "");
|
|
21
21
|
return UNITLESS.has(bare) ? String(value) : `${value}px`;
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { cssValueText };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=css-units.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/diagnostics.ts
|
|
2
2
|
const seen = /* @__PURE__ */ new Set();
|
|
3
3
|
/**
|
|
4
4
|
* Prints a development warning as `[shadow CODE] detail`, at most once per code for the life of the
|
|
@@ -32,7 +32,6 @@ function warnOnce(code, detail) {
|
|
|
32
32
|
function invalidAttributeName(name) {
|
|
33
33
|
return /* @__PURE__ */ new TypeError(`[shadow INVALID_ATTRIBUTE_NAME] "${name}" is not a valid attribute name.`);
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { invalidAttributeName, warnOnce };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/early-events.ts
|
|
2
2
|
/**
|
|
3
3
|
* Early event capture (ADR-016): a tiny inline script, placed before the bundle, records the events a
|
|
4
4
|
* user makes before the application has hydrated. `hydrate()` then replays them once its handlers are
|
|
@@ -70,7 +70,6 @@ function replayEarlyEvents() {
|
|
|
70
70
|
if (target instanceof Node) target.dispatchEvent(reissue(event));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { DEFAULT_EARLY_EVENTS, EARLY_CAPTURE_KEY, captureScriptBody, replayEarlyEvents };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=early-events.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/hydration-scope.ts
|
|
2
2
|
let current = null;
|
|
3
3
|
/**
|
|
4
4
|
* Creates the scope a render or a hydration starts from: what `renderToString` and `hydrate()` put in
|
|
@@ -150,7 +150,6 @@ function childScope(key) {
|
|
|
150
150
|
resources: 0
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
//#endregion
|
|
154
153
|
export { childScope, createRootScope, currentScope, enterComponent, nextKey, resourceKey, withScope };
|
|
155
154
|
|
|
156
155
|
//# sourceMappingURL=hydration-scope.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/names.ts
|
|
2
2
|
/**
|
|
3
3
|
* The XHTML namespace URI: the `namespaceURI` of ordinary HTML elements.
|
|
4
4
|
*
|
|
@@ -29,7 +29,6 @@ const SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
29
29
|
* @since 1.0.0
|
|
30
30
|
*/
|
|
31
31
|
const MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
32
|
-
//#endregion
|
|
33
32
|
export { HTML_NS, MATHML_NS, SVG_NS };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=names.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/internal/portal-context.ts
|
|
3
3
|
/**
|
|
4
4
|
* The context through which a server render hands portals their collector: the renderers provide it
|
|
5
5
|
* when they are given a `portals` option (see `createServerPortals`). A custom portal reads it on the
|
|
@@ -22,7 +22,6 @@ import { createContext } from "@shadow-js/core";
|
|
|
22
22
|
* @since 1.0.0
|
|
23
23
|
*/
|
|
24
24
|
const PortalContext = /* @__PURE__ */ createContext(null, { name: "Portal" });
|
|
25
|
-
//#endregion
|
|
26
25
|
export { PortalContext };
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=portal-context.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/react-names.ts
|
|
2
2
|
/**
|
|
3
3
|
* React spellings at run time: the attribute and event names that a props object (a spread) passes
|
|
4
4
|
* through. The compiler resolves the same names at build time (`packages/compiler/src/internal/
|
|
@@ -110,7 +110,6 @@ function eventPlan(attribute, tag, type) {
|
|
|
110
110
|
passive: false
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
//#endregion
|
|
114
113
|
export { IGNORED_KEYS, attributeName, eventPlan };
|
|
115
114
|
|
|
116
115
|
//# sourceMappingURL=react-names.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/reconcile.ts
|
|
2
2
|
/** Removes `node` only when it is still a child of `parent`, so detached nodes are ignored. */
|
|
3
3
|
function removeNode(parent, node) {
|
|
4
4
|
if (node !== void 0 && node.parentNode === parent) parent.removeChild(node);
|
|
@@ -116,7 +116,6 @@ function reconcileNodes(parent, prev, next, end) {
|
|
|
116
116
|
anchorNode = node;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { reconcileNodes };
|
|
121
120
|
|
|
122
121
|
//# sourceMappingURL=reconcile.js.map
|