coldwired 0.18.0
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 +168 -0
- package/dist/actions-CQVSvZlC.d.mts +134 -0
- package/dist/actions-k0j8z15o.mjs +883 -0
- package/dist/actions.d.mts +2 -0
- package/dist/actions.mjs +2 -0
- package/dist/react.d.mts +88 -0
- package/dist/react.mjs +635 -0
- package/dist/turbo-stream.d.mts +7 -0
- package/dist/turbo-stream.mjs +72 -0
- package/dist/utils-C2S0wWJJ.mjs +350 -0
- package/dist/utils.d.mts +80 -0
- package/dist/utils.mjs +2 -0
- package/package.json +72 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { S as Plugin, _ as dispatchAction, a as enable, b as Schema, c as remove, d as update, f as Action, g as MaterializedAction, h as ActionsOptions, i as disable, l as replace, m as Actions, n as append, o as hide, p as ActionName, r as before, s as prepend, t as after, u as show, v as dispatchActions, x as defaultSchema, y as isValidActionName } from "./actions-CQVSvZlC.mjs";
|
|
2
|
+
export { Action, ActionName, Actions, ActionsOptions, MaterializedAction, Plugin, Schema, after, append, before, defaultSchema, disable, dispatchAction, dispatchActions, enable, hide, isValidActionName, prepend, remove, replace, show, update };
|
package/dist/actions.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as enable, c as remove, d as update, f as Actions, g as defaultSchema, h as isValidActionName, i as disable, l as replace, m as dispatchActions, n as append, o as hide, p as dispatchAction, r as before, s as prepend, t as after, u as show } from "./actions-k0j8z15o.mjs";
|
|
2
|
+
export { Actions, after, append, before, defaultSchema, disable, dispatchAction, dispatchActions, enable, hide, isValidActionName, prepend, remove, replace, show, update };
|
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { S as Plugin } from "./actions-CQVSvZlC.mjs";
|
|
2
|
+
import { ComponentType, FunctionComponent, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/react/tree-builder.react.d.ts
|
|
5
|
+
type Child = string | ReactElement | ReactComponent;
|
|
6
|
+
type PrimitiveValue = string | number | boolean | null | undefined;
|
|
7
|
+
type JSONValue = PrimitiveValue | Array<JSONValue> | {
|
|
8
|
+
[key: string]: JSONValue;
|
|
9
|
+
};
|
|
10
|
+
type ReactValue = PrimitiveValue | Date | bigint | Array<ReactValue> | {
|
|
11
|
+
[key: string]: ReactValue;
|
|
12
|
+
};
|
|
13
|
+
type ReactElement = {
|
|
14
|
+
tagName: string;
|
|
15
|
+
attributes: Record<string, string>;
|
|
16
|
+
children?: Child[];
|
|
17
|
+
};
|
|
18
|
+
type ReactComponent = {
|
|
19
|
+
name: string;
|
|
20
|
+
props: Record<string, JSONValue | ReactElement | ReactComponent>;
|
|
21
|
+
children?: Child[];
|
|
22
|
+
};
|
|
23
|
+
type Manifest = Record<string, ComponentType<any>>;
|
|
24
|
+
type DocumentFragmentLike = {
|
|
25
|
+
childNodes: DocumentFragment['childNodes'];
|
|
26
|
+
querySelectorAll: DocumentFragment['querySelectorAll'];
|
|
27
|
+
};
|
|
28
|
+
interface Schema$1 {
|
|
29
|
+
componentTagName: string;
|
|
30
|
+
slotTagName: string;
|
|
31
|
+
nameAttribute: string;
|
|
32
|
+
propsAttribute: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/react/root.d.ts
|
|
36
|
+
type Loader = (name: string) => Promise<ComponentType<any>>;
|
|
37
|
+
interface RenderBatch {
|
|
38
|
+
count: number;
|
|
39
|
+
done: Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
interface Root {
|
|
42
|
+
render(element: Element, fragment?: DocumentFragmentLike | string): RenderBatch;
|
|
43
|
+
remove(element: Element): boolean;
|
|
44
|
+
contains(element: Element): boolean;
|
|
45
|
+
destroy(): void;
|
|
46
|
+
getCache(): Map<Element, ReactNode>;
|
|
47
|
+
}
|
|
48
|
+
interface RootOptions {
|
|
49
|
+
loader: Loader;
|
|
50
|
+
manifest?: Manifest;
|
|
51
|
+
schema?: Partial<Schema>;
|
|
52
|
+
layoutComponentName?: string;
|
|
53
|
+
errorBoundaryFallbackComponentName?: string;
|
|
54
|
+
cache?: boolean;
|
|
55
|
+
}
|
|
56
|
+
interface Schema extends Schema$1 {
|
|
57
|
+
fragmentTagName: string;
|
|
58
|
+
loadingClassName: string;
|
|
59
|
+
}
|
|
60
|
+
declare const defaultSchema: Schema;
|
|
61
|
+
declare function findOrCreateContainerElement(id: string): Element;
|
|
62
|
+
declare function createRoot(container: Element, options: RootOptions): Root;
|
|
63
|
+
declare function createRoot(options: RootOptions): Root;
|
|
64
|
+
declare function resetFragmentCache(): void;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/react/plugin.d.ts
|
|
67
|
+
declare function createReactPlugin(root: Root): Plugin;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/react/preload.d.ts
|
|
70
|
+
declare function preload(documentOrFragment: Document | DocumentFragmentLike, loader: (names: string[]) => Promise<Manifest>, schema?: Partial<Schema$1>): Promise<Manifest>;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region node_modules/react-error-boundary/dist/react-error-boundary.d.ts
|
|
73
|
+
declare type FallbackProps = {
|
|
74
|
+
error: unknown;
|
|
75
|
+
resetErrorBoundary: (...args: unknown[]) => void;
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/react/root.react.d.ts
|
|
79
|
+
type LayoutProps = {
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
};
|
|
82
|
+
type LayoutComponent = FunctionComponent<LayoutProps>;
|
|
83
|
+
type ErrorBoundaryFallbackProps = FallbackProps & {
|
|
84
|
+
element: Element;
|
|
85
|
+
};
|
|
86
|
+
type ErrorBoundaryFallbackComponent = FunctionComponent<ErrorBoundaryFallbackProps>;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { type ErrorBoundaryFallbackComponent, type LayoutComponent, Loader, type Manifest, type ReactComponent, type ReactElement, type ReactValue, RenderBatch, Root, RootOptions, Schema, createReactPlugin, createRoot, defaultSchema, findOrCreateContainerElement, preload, resetFragmentCache };
|