creo 0.2.6 → 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.
@@ -14,7 +14,7 @@ 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, Api>>;
17
+ body: Maybe<ViewBody<Props>>;
18
18
  sc: Maybe<ViewRecord[]>;
19
19
  renderRef: Maybe<RenderRef>;
20
20
  flags: BitFlags;
@@ -28,6 +28,11 @@ export type ViewRecord<Props = Wildcard, Api = Wildcard, RenderRef = Wildcard> =
28
28
  parent: Maybe<ViewRecord>;
29
29
  /** The primitive whose .children contains the live sc items after reconcile. */
30
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>;
31
36
  };
32
37
  /** Structural change: viewFn, key, or count differs. Does NOT check props. */
33
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* event handler props + optional key.
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 & EventHandlerProps<Events> & {
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, void>;
19
+ }): ViewBody<Props>;