@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
package/CHANGELOG.md
CHANGED
package/dist/dev/attributes.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/attributes.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Reports whether writing `value` to the attribute `name` would run script: the URL check that
|
|
4
3
|
* {@link setAttribute}, the head registry and the server renderer share. Use it in a custom renderer
|
|
@@ -86,5 +85,4 @@ export declare function setAttributeNS(el: Element, namespace: string, name: str
|
|
|
86
85
|
* @since 1.0.0
|
|
87
86
|
*/
|
|
88
87
|
export declare function setBoolAttribute(el: Element, name: string, value: unknown): void;
|
|
89
|
-
//#endregion
|
|
90
88
|
//# sourceMappingURL=attributes.d.ts.map
|
package/dist/dev/attributes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { invalidAttributeName, warnOnce } from "./internal/diagnostics.js";
|
|
2
|
-
|
|
2
|
+
// src/attributes.ts
|
|
3
3
|
/** Names that can appear in markup: an XML-name subset without `@` or whitespace. */
|
|
4
4
|
const ATTRIBUTE_NAME = /^[A-Za-z_:][A-Za-z0-9_:.-]*$/;
|
|
5
5
|
/**
|
|
@@ -190,7 +190,6 @@ function setBoolAttribute(el, name, value) {
|
|
|
190
190
|
if (!present) el.setAttribute(name, "");
|
|
191
191
|
} else if (present) el.removeAttribute(name);
|
|
192
192
|
}
|
|
193
|
-
//#endregion
|
|
194
193
|
export { assertAttributeName, isUnsafeUrlAttribute, setAttribute, setAttributeNS, setBoolAttribute };
|
|
195
194
|
|
|
196
195
|
//# sourceMappingURL=attributes.js.map
|
package/dist/dev/autofocus.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/autofocus.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Focuses an element written with `autoFocus` (React parity) once it is inserted into the document
|
|
4
3
|
* by a client render or update. The compiler calls this for an `autoFocus` attribute and for
|
|
@@ -28,5 +27,4 @@
|
|
|
28
27
|
* @since 1.0.0
|
|
29
28
|
*/
|
|
30
29
|
export declare function autoFocus(el: Element, enabled: unknown): void;
|
|
31
|
-
//#endregion
|
|
32
30
|
//# sourceMappingURL=autofocus.d.ts.map
|
package/dist/dev/autofocus.js
CHANGED
|
@@ -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,4 +1,3 @@
|
|
|
1
|
-
//#region src/class-style.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Replaces the whole `class` of an element: the helper compiled templates call for `class` and
|
|
4
3
|
* `className`. HTML elements are written through `className`; SVG and MathML elements (whose
|
|
@@ -85,5 +84,4 @@ export declare function setStyleProperty(el: HTMLElement | SVGElement, name: str
|
|
|
85
84
|
* @since 1.0.0
|
|
86
85
|
*/
|
|
87
86
|
export declare function style(el: HTMLElement | SVGElement, value: unknown, prev?: unknown): unknown;
|
|
88
|
-
//#endregion
|
|
89
87
|
//# sourceMappingURL=class-style.d.ts.map
|
package/dist/dev/class-style.js
CHANGED
|
@@ -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
|
package/dist/dev/component.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/component.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Calls a component untracked, under a new owner that is a child of the current one: cleanups and
|
|
4
3
|
* effects it creates are disposed with the enclosing scope. The name, given in development builds,
|
|
@@ -19,5 +18,4 @@
|
|
|
19
18
|
* @since 1.0.0
|
|
20
19
|
*/
|
|
21
20
|
export declare function createComponent<P>(component: (props: P) => unknown, props: P, name?: string): unknown;
|
|
22
|
-
//#endregion
|
|
23
21
|
//# sourceMappingURL=component.d.ts.map
|
package/dist/dev/component.js
CHANGED
|
@@ -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,5 +1,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/activity.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `visible` shows the children; `hidden` keeps them alive (state, DOM and focus) but out of sight.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -54,5 +53,4 @@ export interface ActivityProps {
|
|
|
54
53
|
* @since 1.0.0
|
|
55
54
|
*/
|
|
56
55
|
export declare function Activity(props: ActivityProps): Accessor<unknown>;
|
|
57
|
-
//#endregion
|
|
58
56
|
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runWithOwner, untrack, useEffect, useRenderEffect, useSignal } from "@shadow-js/core";
|
|
2
2
|
import { createOwner, pauseOwner, resumeOwner } from "@shadow-js/core/extend";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/activity.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hides the nodes between two anchors without removing them. Top-level elements get
|
|
6
6
|
* `display: none` (their own state, subtree and listeners are untouched). Top-level text nodes are
|
|
@@ -130,7 +130,6 @@ function Activity(props) {
|
|
|
130
130
|
end
|
|
131
131
|
];
|
|
132
132
|
}
|
|
133
|
-
//#endregion
|
|
134
133
|
export { Activity };
|
|
135
134
|
|
|
136
135
|
//# sourceMappingURL=activity.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JsxChild } from "../jsx/types.js";
|
|
2
2
|
import { Accessor } from "@shadow-js/core";
|
|
3
|
-
//#region src/control-flow/client-only.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Props of {@link ClientOnly}.
|
|
6
5
|
* @since 1.0.0
|
|
@@ -44,5 +43,4 @@ export interface ClientOnlyProps {
|
|
|
44
43
|
* @since 1.0.0
|
|
45
44
|
*/
|
|
46
45
|
export declare function ClientOnly(props: ClientOnlyProps): Accessor<unknown>;
|
|
47
|
-
//#endregion
|
|
48
46
|
//# sourceMappingURL=client-only.d.ts.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,4 +1,3 @@
|
|
|
1
|
-
//#region src/control-flow/dynamic.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A component function or a tag name, as {@link Dynamic} accepts it. The props of a function are
|
|
4
3
|
* checked by the caller.
|
|
@@ -78,5 +77,4 @@ export declare function Dynamic<C extends DynamicTarget>(props: DynamicProps<C>)
|
|
|
78
77
|
* @since 1.0.0
|
|
79
78
|
*/
|
|
80
79
|
export declare function createDynamic<C extends DynamicTarget>(component: () => C, props?: object): () => unknown;
|
|
81
|
-
//#endregion
|
|
82
80
|
//# sourceMappingURL=dynamic.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { claims } from "../internal/hydration-hooks.js";
|
|
|
5
5
|
import { bindRegion, createRegion } from "../insert.js";
|
|
6
6
|
import { spread } from "../spread.js";
|
|
7
7
|
import { mergeProps, splitProps, untrack, useMemo } from "@shadow-js/core";
|
|
8
|
-
|
|
8
|
+
// src/control-flow/dynamic.ts
|
|
9
9
|
/** Tag names that take the SVG namespace. Anything else is HTML. */
|
|
10
10
|
const SVG_TAGS = /* @__PURE__ */ new Set([
|
|
11
11
|
"svg",
|
|
@@ -128,7 +128,6 @@ function createDynamic(component, props = {}) {
|
|
|
128
128
|
return component();
|
|
129
129
|
} }, props));
|
|
130
130
|
}
|
|
131
|
-
//#endregion
|
|
132
131
|
export { Dynamic, createDynamic };
|
|
133
132
|
|
|
134
133
|
//# sourceMappingURL=dynamic.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JsxChild } from "../jsx/types.js";
|
|
2
2
|
import { Accessor } from "@shadow-js/core";
|
|
3
|
-
//#region src/control-flow/error-boundary.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Props of {@link ErrorBoundary}.
|
|
6
5
|
* @since 1.0.0
|
|
@@ -68,5 +67,4 @@ export interface ErrorBoundaryLooseProps {
|
|
|
68
67
|
*/
|
|
69
68
|
export declare function ErrorBoundary(props: ErrorBoundaryProps): Accessor<unknown>;
|
|
70
69
|
export declare function ErrorBoundary(props: ErrorBoundaryLooseProps): Accessor<unknown>;
|
|
71
|
-
//#endregion
|
|
72
70
|
//# sourceMappingURL=error-boundary.d.ts.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,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/for.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link For} without `key`: rows are matched by item reference.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -76,5 +75,4 @@ export type ForProps<T> = ForUnkeyedProps<T> | ForKeyedProps<T>;
|
|
|
76
75
|
*/
|
|
77
76
|
export declare function For<T>(props: ForKeyedProps<T>): Accessor<unknown[]>;
|
|
78
77
|
export declare function For<T>(props: ForUnkeyedProps<T>): Accessor<unknown[]>;
|
|
79
|
-
//#endregion
|
|
80
78
|
//# sourceMappingURL=for.d.ts.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,3 @@
|
|
|
1
|
-
//#region src/control-flow/fragment.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Props of {@link Fragment}.
|
|
4
3
|
* @since 1.0.0
|
|
@@ -34,5 +33,4 @@ export interface FragmentProps {
|
|
|
34
33
|
* @since 1.0.0
|
|
35
34
|
*/
|
|
36
35
|
export declare function Fragment(props: FragmentProps): unknown;
|
|
37
|
-
//#endregion
|
|
38
36
|
//# sourceMappingURL=fragment.d.ts.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.
|
|
@@ -58,7 +58,6 @@ function createHotLink(onUpdate) {
|
|
|
58
58
|
disarm
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { attachHotModules, createHotLink, hotModulesOf };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=hot-link.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/index-list.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link Index}.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -44,5 +43,4 @@ export interface IndexProps<T> {
|
|
|
44
43
|
* @since 1.0.0
|
|
45
44
|
*/
|
|
46
45
|
export declare function Index<T>(props: IndexProps<T>): Accessor<unknown[]>;
|
|
47
|
-
//#endregion
|
|
48
46
|
//# sourceMappingURL=index-list.d.ts.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,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/lazy.d.ts
|
|
3
2
|
type ComponentFunction<P> = (props: P) => unknown;
|
|
4
3
|
/**
|
|
5
4
|
* A component made by {@link lazy}: call it (or write it in JSX) like any component, and use
|
|
@@ -53,6 +52,5 @@ export interface LazyComponent<P> {
|
|
|
53
52
|
export declare function lazy<P>(loader: () => Promise<{
|
|
54
53
|
default: ComponentFunction<P>;
|
|
55
54
|
}>): LazyComponent<P>;
|
|
56
|
-
//#endregion
|
|
57
55
|
export {};
|
|
58
56
|
//# sourceMappingURL=lazy.d.ts.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,5 +1,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/no-hydration.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link NoHydration}.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -35,5 +34,4 @@ export interface NoHydrationProps {
|
|
|
35
34
|
* @since 1.0.0
|
|
36
35
|
*/
|
|
37
36
|
export declare function NoHydration(props: NoHydrationProps): Accessor<unknown>;
|
|
38
|
-
//#endregion
|
|
39
37
|
//# sourceMappingURL=no-hydration.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nextKey } from "../internal/hydration-scope.js";
|
|
2
2
|
import { claims } from "../internal/hydration-hooks.js";
|
|
3
|
-
|
|
3
|
+
// src/control-flow/no-hydration.ts
|
|
4
4
|
/** The nodes between `<!--nh:KEY-->` and its `<!--/nh-->` in the lifted regions, or undefined when the server sent none. */
|
|
5
5
|
function findStatic(key, regions) {
|
|
6
6
|
if (key === void 0 || regions === void 0) return void 0;
|
|
@@ -52,7 +52,6 @@ function NoHydration(props) {
|
|
|
52
52
|
}
|
|
53
53
|
return () => props.children;
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { NoHydration };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=no-hydration.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/control-flow/portal.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Props of {@link Portal}.
|
|
4
3
|
* @since 1.0.0
|
|
@@ -65,5 +64,4 @@ export interface PortalProps {
|
|
|
65
64
|
* @since 1.0.0
|
|
66
65
|
*/
|
|
67
66
|
export declare function Portal(props: PortalProps): null;
|
|
68
|
-
//#endregion
|
|
69
67
|
//# sourceMappingURL=portal.d.ts.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,4 @@
|
|
|
1
1
|
import { Owner } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/root-errors.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The error reporters a root was rendered or hydrated with (see `RenderOptions` and `HydrateOptions`).
|
|
5
4
|
* @since 1.0.0
|
|
@@ -21,5 +20,4 @@ export interface RootErrorOptions {
|
|
|
21
20
|
*/
|
|
22
21
|
readonly onRecoverableError?: (error: unknown) => void;
|
|
23
22
|
}
|
|
24
|
-
//#endregion
|
|
25
23
|
//# sourceMappingURL=root-errors.d.ts.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,6 +1,5 @@
|
|
|
1
1
|
import { JsxChild } from "../jsx/types.js";
|
|
2
2
|
import { Accessor } from "@shadow-js/core";
|
|
3
|
-
//#region src/control-flow/show.d.ts
|
|
4
3
|
/** What `when` accepts: the value, or any falsy stand-in (`0` and `""` count as falsy). */
|
|
5
4
|
type ShowCondition<T> = T | undefined | null | false | 0 | "";
|
|
6
5
|
/** Props shared by both forms of {@link Show}. */
|
|
@@ -96,6 +95,5 @@ export interface ShowLooseProps<T> extends ShowBaseProps<T> {
|
|
|
96
95
|
*/
|
|
97
96
|
export declare function Show<T>(props: ShowProps<T>): Accessor<unknown>;
|
|
98
97
|
export declare function Show<T>(props: ShowLooseProps<T>): Accessor<unknown>;
|
|
99
|
-
//#endregion
|
|
100
98
|
export {};
|
|
101
99
|
//# sourceMappingURL=show.d.ts.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,5 +1,4 @@
|
|
|
1
1
|
import { Accessor, Context } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/suspense-list.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link SuspenseList}.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -61,5 +60,4 @@ export interface SuspenseListProps {
|
|
|
61
60
|
* @since 1.0.0
|
|
62
61
|
*/
|
|
63
62
|
export declare function SuspenseList(props: SuspenseListProps): Accessor<unknown>;
|
|
64
|
-
//#endregion
|
|
65
63
|
//# sourceMappingURL=suspense-list.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, onCleanup, useContext } 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
|
/**
|
|
@@ -99,7 +99,6 @@ function registerInList(ready) {
|
|
|
99
99
|
const list = useContext(SuspenseListContext);
|
|
100
100
|
return list === null ? null : list.register(ready);
|
|
101
101
|
}
|
|
102
|
-
//#endregion
|
|
103
102
|
export { SuspenseList, SuspenseListContext, registerInList };
|
|
104
103
|
|
|
105
104
|
//# sourceMappingURL=suspense-list.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/suspense.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link Suspense}.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -49,5 +48,4 @@ export interface SuspenseProps {
|
|
|
49
48
|
* @since 1.0.0
|
|
50
49
|
*/
|
|
51
50
|
export declare function Suspense(props: SuspenseProps): Accessor<unknown>;
|
|
52
|
-
//#endregion
|
|
53
51
|
//# sourceMappingURL=suspense.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { childScope, nextKey, withScope } from "../internal/hydration-scope.js";
|
|
|
2
2
|
import { registerInList } from "./suspense-list.js";
|
|
3
3
|
import { SuspenseContext, runWithOwner, useMemo } from "@shadow-js/core";
|
|
4
4
|
import { createOwner, createSignalNode, readSignal, transitionHooks, writeSignal } from "@shadow-js/core/extend";
|
|
5
|
-
|
|
5
|
+
// src/control-flow/suspense.ts
|
|
6
6
|
/**
|
|
7
7
|
* A counter the resources of one boundary report to (see {@link SuspenseTracker}), and the hold a
|
|
8
8
|
* transition takes on the boundary. A transition that reads pending data while the boundary shows
|
|
@@ -96,7 +96,6 @@ function Suspense(props) {
|
|
|
96
96
|
return slot.showFallback() ? withScope(fallbackScope, () => props.fallback) : null;
|
|
97
97
|
}, { allowWrites: true });
|
|
98
98
|
}
|
|
99
|
-
//#endregion
|
|
100
99
|
export { Suspense };
|
|
101
100
|
|
|
102
101
|
//# sourceMappingURL=suspense.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Accessor } from "@shadow-js/core";
|
|
2
|
-
//#region src/control-flow/switch.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props of {@link Match}. A Match descriptor is the props object itself.
|
|
5
4
|
* @since 1.0.0
|
|
@@ -81,5 +80,4 @@ export interface SwitchProps {
|
|
|
81
80
|
* @since 1.0.0
|
|
82
81
|
*/
|
|
83
82
|
export declare function Switch(props: SwitchProps): Accessor<unknown>;
|
|
84
|
-
//#endregion
|
|
85
83
|
//# sourceMappingURL=switch.d.ts.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
|
package/dist/dev/derived.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/derived.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A value the compiler keeps live: the result of `const x = <expression reading signals>` inside a
|
|
4
3
|
* component. Read it as `x.value` or call it as `x()`, so `{double}` and `{double()}` both work in
|
|
@@ -48,5 +47,4 @@ export interface Derived<T> {
|
|
|
48
47
|
* @since 1.0.0
|
|
49
48
|
*/
|
|
50
49
|
export declare function derived<T>(compute: () => T): Derived<T>;
|
|
51
|
-
//#endregion
|
|
52
50
|
//# sourceMappingURL=derived.d.ts.map
|
package/dist/dev/derived.js
CHANGED
|
@@ -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
|
package/dist/dev/element.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/element.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Creates one HTML element from a tag name and a props object, without the generic prop runtime of
|
|
4
3
|
* `spread` and `Dynamic`: for a library that renders one fixed element (a link, a button) and wants
|
|
@@ -36,5 +35,4 @@
|
|
|
36
35
|
* @since 1.0.0
|
|
37
36
|
*/
|
|
38
37
|
export declare function element(tag: string, props: object): unknown;
|
|
39
|
-
//#endregion
|
|
40
38
|
//# sourceMappingURL=element.d.ts.map
|
package/dist/dev/element.js
CHANGED
|
@@ -5,7 +5,7 @@ import { checkClaimedTag } from "./internal/claim.js";
|
|
|
5
5
|
import { claims } from "./internal/hydration-hooks.js";
|
|
6
6
|
import { insert } from "./insert.js";
|
|
7
7
|
import { batch, untrack, useRenderEffect } from "@shadow-js/core";
|
|
8
|
-
|
|
8
|
+
// src/element.ts
|
|
9
9
|
/**
|
|
10
10
|
* The slim element primitive: one HTML element with attributes, event listeners, `ref` and children,
|
|
11
11
|
* and no generic prop runtime. `Dynamic` and `spread` cover every prop shape; this covers the common
|
|
@@ -99,7 +99,6 @@ function element(tag, props) {
|
|
|
99
99
|
insert(el, () => read["children"]);
|
|
100
100
|
return el;
|
|
101
101
|
}
|
|
102
|
-
//#endregion
|
|
103
102
|
export { element };
|
|
104
103
|
|
|
105
104
|
//# sourceMappingURL=element.js.map
|