creo 0.2.5 → 0.2.7
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/AGENTS.md +156 -0
- package/CHANGELOG.md +138 -0
- package/README.md +4 -2
- package/dist/functional/key.d.ts +0 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +293 -146
- package/dist/index.js.map +15 -15
- package/dist/internal/internal_view.d.ts +10 -1
- package/dist/public/primitive.d.ts +9 -10
- package/dist/public/primitives/primitives.d.ts +341 -111
- package/dist/public/state.d.ts +6 -0
- package/dist/public/view.d.ts +27 -12
- package/dist/render/html_render.d.ts +8 -0
- package/dist/render/render_interface.d.ts +14 -0
- package/dist/render/string_render.d.ts +0 -2
- package/docs/create-app.md +110 -0
- package/docs/events.md +236 -0
- package/docs/getting-started.md +201 -0
- package/docs/how-to/data-fetching.md +155 -0
- package/docs/how-to/deploy-vercel.md +130 -0
- package/docs/how-to/router.md +111 -0
- package/docs/how-to/styles.md +124 -0
- package/docs/how-to/suspense.md +116 -0
- package/docs/index.md +66 -0
- package/docs/lifecycle.md +173 -0
- package/docs/primitives.md +195 -0
- package/docs/renderers.md +183 -0
- package/docs/state.md +131 -0
- package/docs/store.md +135 -0
- package/docs/view.md +205 -0
- package/package.json +5 -2
- package/dist/public/event_handle.d.ts +0 -32
- package/dist/render/canvas_render.d.ts +0 -1
- package/dist/render/stream_render.d.ts +0 -1
- package/dist/structures/indexed_list.d.ts +0 -46
- package/dist/structures/list.d.ts +0 -68
|
@@ -14,16 +14,25 @@ export type ViewRecord<Props = Wildcard, Api = Wildcard, RenderRef = Wildcard> =
|
|
|
14
14
|
userKey: Maybe<Key>;
|
|
15
15
|
props: Props;
|
|
16
16
|
slot: Maybe<SlotContent>;
|
|
17
|
-
body: Maybe<ViewBody<Props
|
|
17
|
+
body: Maybe<ViewBody<Props>>;
|
|
18
18
|
sc: Maybe<ViewRecord[]>;
|
|
19
19
|
renderRef: Maybe<RenderRef>;
|
|
20
20
|
flags: BitFlags;
|
|
21
21
|
children: Maybe<ViewRecord[]>;
|
|
22
|
+
/** Position in `parent.children`. Maintained by the reconciler so the
|
|
23
|
+
* renderer can find the next-sibling insertion anchor without an O(n)
|
|
24
|
+
* `indexOf` scan. -1 means "not yet placed by a reconcile pass". */
|
|
25
|
+
pos: number;
|
|
22
26
|
keyToView: Maybe<Map<Key, ViewRecord>>;
|
|
23
27
|
unsubscribe: Maybe<(() => void)[]>;
|
|
24
28
|
parent: Maybe<ViewRecord>;
|
|
25
29
|
/** The primitive whose .children contains the live sc items after reconcile. */
|
|
26
30
|
scHost: Maybe<ViewRecord>;
|
|
31
|
+
/**
|
|
32
|
+
* Last value the viewFn passed to `ctx.ref(...)`. Stored so the engine
|
|
33
|
+
* can re-apply it when the consumer's `ref` prop changes between renders.
|
|
34
|
+
*/
|
|
35
|
+
publicRef: Maybe<unknown>;
|
|
27
36
|
};
|
|
28
37
|
/** Structural change: viewFn, key, or count differs. Does NOT check props. */
|
|
29
38
|
export declare function hasScStructuralChange(prev: Maybe<ViewRecord[]>, next: Maybe<ViewRecord[]>): boolean;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { Key } from "../functional/key";
|
|
2
2
|
import type { Slot, ViewBody } from "./view";
|
|
3
|
-
/**
|
|
4
|
-
* Maps event type { click: (e: X) => void } to
|
|
5
|
-
* handler props { onClick?: (e: X) => void }.
|
|
6
|
-
*/
|
|
7
|
-
export type EventHandlerProps<Events> = {
|
|
8
|
-
[K in keyof Events as `on${Capitalize<string & K>}`]?: Events[K];
|
|
9
|
-
};
|
|
10
3
|
/**
|
|
11
4
|
* Props passed when calling a primitive in the render stream.
|
|
12
|
-
* Attrs + on
|
|
5
|
+
* Attrs + nested `on` event-handler object + optional key.
|
|
6
|
+
*
|
|
7
|
+
* Events are grouped under `on` (e.g. `{ on: { click, input } }`) instead of
|
|
8
|
+
* being mixed into the prop bag as `onClick`, `onInput`, … This keeps the
|
|
9
|
+
* event namespace separate from HTML attrs and lets the renderer skip the
|
|
10
|
+
* per-prop event-detection step on every diff.
|
|
13
11
|
*/
|
|
14
|
-
export type PrimitiveProps<Attrs, Events> = Attrs &
|
|
12
|
+
export type PrimitiveProps<Attrs, Events> = Attrs & {
|
|
13
|
+
on?: Partial<Events>;
|
|
15
14
|
key?: Key;
|
|
16
15
|
};
|
|
17
16
|
export declare const $primitive: unique symbol;
|
|
18
17
|
export declare function primitiveViewFn<Props>({ slot, }: {
|
|
19
18
|
slot: Slot;
|
|
20
|
-
}): ViewBody<Props
|
|
19
|
+
}): ViewBody<Props>;
|