@mindees/core 0.22.0 → 0.22.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.
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","names":[],"sources":["../../src/component/component.ts"],"mappings":";;AAwBA;;;;;;;;;;;;;;AAA8E;AAU9E;AAAA,KAVY,SAAA,KAAc,MAAA,sBAA4B,KAAA,EAAO,CAAA,KAAM,WAAA;;;;;;;;;KAUvD,WAAA,GACR,cAAA,GAKA,WAAA,QACA,YAAA,yDAMO,WAAA,IACP,WAAA;;KAGQ,WAAA,YAAuB,SAAS;;UAG3B,cAAA;EAAA,SACN,QAAA,SAAiB,YAAA;EAAA,SACjB,IAAA,EAAM,WAAA;EAAA,SACN,KAAA,EAAO,QAAA,CAAS,MAAA;EAAA,SAChB,QAAA,WAAmB,WAAA;EAAA,SACnB,GAAA;AAAA;AARiC;AAAA,cAY/B,YAAA;;cAGA,QAAA;;cAGA,YAAA;;;;;;;UAQI,WAAA;EAAA,SACN,OAAA,SAAgB,YAAA;EAtBV;EAAA,SAwBN,IAAA,iBAAqB,CAAA;EAvBd;EAAA,SAyBP,KAAA,GAAQ,IAAA,QAAY,CAAA,EAAG,KAAA,mBAAwB,WAAA;EAxB/C;EAAA,SA0BA,GAAA,IAAO,IAAA,EAAM,CAAA,EAAG,KAAA;EAzBhB;EAAA,SA2BA,QAAA,SAAiB,WAAA;AAAA;AAvB5B;AAAA,UA2BiB,kBAAA;;WAEN,IAAA,WAAe,CAAA,qBAAsB,CAAA;EA7BwB;EAAA,SA+B7D,QAAA,GAAW,IAAA,QAAY,CAAA,EAAG,KAAA,mBAAwB,WAAA;EA5BQ;EAAA,SA8B1D,GAAA,IAAO,IAAA,EAAM,CAAA,EAAG,KAAA;EA9B0C;EAAA,SAgC1D,QAAA,SAAiB,WAAA;AAAA;;iBAIZ,WAAA,IAAe,OAAA,EAAS,kBAAA,CAAmB,CAAA,IAAK,WAAA,CAAY,C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AASnE;;iBAkKgB,eAAA,IACd,SAAA,EAAW,SAAA,CAAU,CAAA,GACrB,KAAA,EAAO,CAAA;EACJ,IAAA,EAAM,WAAA;EAAa,OAAA;AAAA;;iBAqBR,QAAA"}
@@ -63,7 +63,7 @@ function isPortal(value) {
63
63
  */
64
64
  function createElement(type, props, ...children) {
65
65
  const { key = null, children: propsChildren, ...rest } = props ?? {};
66
- const resolved = children.length > 0 ? children : propsChildren !== void 0 ? [propsChildren] : [];
66
+ const resolved = children.length > 0 ? children : propsChildren === void 0 ? [] : Array.isArray(propsChildren) ? propsChildren : [propsChildren];
67
67
  return {
68
68
  $$typeof: ELEMENT_TYPE,
69
69
  type,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","names":[],"sources":["../../src/component/component.ts"],"sourcesContent":["/**\n * MindeesNative component model — a minimal, renderer-agnostic element tree plus\n * **selector-based, re-render-isolated context**.\n *\n * The element tree (`createElement` / `Fragment`) is a plain data structure: a\n * component is a function of `props` returning elements. It carries no rendering\n * logic itself — the Helix renderer (Phase 3) turns this tree into host nodes.\n *\n * The context system is the important primitive: a `createContext` value is read\n * through a **selector**, and a consumer only re-runs when its *selected slice*\n * actually changes — not on every context update. This is the re-render\n * isolation the Quantum Router (Phase 6) builds on. It is implemented on the\n * Phase 1 signals, so selection participates in normal reactivity.\n *\n * @module\n */\n\nimport { computed, createRoot, getOwner, signal } from '../reactive'\n\n// ---------------------------------------------------------------------------\n// Element tree\n// ---------------------------------------------------------------------------\n\n/** A component: a function from props to a renderable node. */\nexport type Component<P = Record<string, unknown>> = (props: P) => MindeesNode\n\n/**\n * Anything that can appear in the tree.\n *\n * Includes an **accessor** form `() => MindeesNode`: a function child (or\n * function prop value) is a *reactive region* — the renderer subscribes to it\n * and patches exactly that region when its signals change (the fine-grained\n * update model, à la SolidJS). Static trees never need it; reactive UIs do.\n */\nexport type MindeesNode =\n | MindeesElement\n // A node may hold a keyed region of ANY item type. KeyedRegion is invariant in T (its\n // mapFn/key take T), so `KeyedRegion<unknown>` would reject `KeyedRegion<Row>`; `any` is\n // the correct \"some item type\" here.\n // biome-ignore lint/suspicious/noExplicitAny: see above — invariant T at a node boundary.\n | KeyedRegion<any>\n | PortalRegion\n | string\n | number\n | boolean\n | null\n | undefined\n | (() => MindeesNode)\n | MindeesNode[]\n\n/** The tag of an element: a host string (e.g. `\"view\"`) or a component function. */\nexport type ElementType = string | Component<never>\n\n/** A virtual element: a tag, its props, and its children. */\nexport interface MindeesElement {\n readonly $$typeof: typeof ELEMENT_TYPE\n readonly type: ElementType\n readonly props: Readonly<Record<string, unknown>>\n readonly children: readonly MindeesNode[]\n readonly key: string | number | null\n}\n\n/** Brand so a renderer can reliably distinguish elements from plain objects. */\nexport const ELEMENT_TYPE: unique symbol = Symbol.for('mindees.element')\n\n/** Marker tag for a fragment (children with no wrapper host node). */\nexport const Fragment: unique symbol = Symbol.for('mindees.fragment')\n\n/** Brand identifying a keyed list region (reconciled by key, not full-rebuilt). */\nexport const KEYED_REGION: unique symbol = Symbol.for('mindees.keyed-region')\n\n/**\n * A keyed list region: a reactive item list + a per-item render function, reconciled by key\n * so rows keep their identity (host node, focus, caret, scroll) across reorders instead of\n * being torn down and rebuilt. This is a serializable *description* (no rendering logic); the\n * renderer materializes it (`bindKeyedChild`). Build one with {@link keyedRegion}.\n */\nexport interface KeyedRegion<T = unknown> {\n readonly $$keyed: typeof KEYED_REGION\n /** The items, as a reactive accessor. */\n readonly each: () => readonly T[]\n /** Render one row from reactive `item`/`index` accessors (consume them lazily to patch in place). */\n readonly mapFn: (item: () => T, index: () => number) => MindeesNode\n /** Stable key per item (when omitted, the row is keyed by item identity). */\n readonly key: ((item: T, index: number) => unknown) | undefined\n /** Rendered when the list is empty. */\n readonly fallback: (() => MindeesNode) | undefined\n}\n\n/** Options for {@link keyedRegion}. */\nexport interface KeyedRegionOptions<T> {\n /** The items, static or reactive. */\n readonly each: readonly T[] | (() => readonly T[])\n /** Render one row from reactive `item`/`index` accessors. */\n readonly children: (item: () => T, index: () => number) => MindeesNode\n /** Stable key per item (defaults to item identity). */\n readonly key?: (item: T, index: number) => unknown\n /** Rendered when the list is empty. */\n readonly fallback?: () => MindeesNode\n}\n\n/** Build a {@link KeyedRegion} — a keyed, identity-preserving list node. */\nexport function keyedRegion<T>(options: KeyedRegionOptions<T>): KeyedRegion<T> {\n const each: () => readonly T[] =\n typeof options.each === 'function' ? options.each : () => options.each as readonly T[]\n return {\n $$keyed: KEYED_REGION,\n each,\n mapFn: options.children,\n key: options.key,\n fallback: options.fallback,\n }\n}\n\n/** Type guard: is `value` a {@link KeyedRegion}? */\nexport function isKeyedRegion(value: unknown): value is KeyedRegion {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$keyed?: unknown }).$$keyed === KEYED_REGION\n )\n}\n\n/** Brand identifying a portal region (children relocated to an overlay target above the tree). */\nexport const PORTAL: unique symbol = Symbol.for('mindees.portal')\n\n/**\n * A portal: its children render into a different host parent (an overlay/root layer) than their\n * position in the tree, while staying owned by the logical owner so reactive disposal + unmount\n * still work. The renderer materializes it (`bindPortalChild`); build one with {@link portal}.\n */\nexport interface PortalRegion {\n readonly $$portal: typeof PORTAL\n /** Children to relocate, normalized to a (reactive) accessor. */\n readonly children: () => MindeesNode\n /** Optional explicit host target (an `N`); else the backend's overlay root; else the local parent. Opaque to core. */\n readonly mount: unknown\n}\n\n/**\n * Build a {@link PortalRegion} — relocate `children` to an overlay target. Pass `opts.mount` to\n * override the target host node; otherwise the renderer uses the backend's overlay root (or, with\n * no overlay, mounts in place — the SSR-correct default).\n */\nexport function portal(\n children: MindeesNode | (() => MindeesNode),\n opts?: { readonly mount?: unknown },\n): PortalRegion {\n return {\n $$portal: PORTAL,\n children: typeof children === 'function' ? (children as () => MindeesNode) : () => children,\n mount: opts?.mount,\n }\n}\n\n/** Type guard: is `value` a {@link PortalRegion}? */\nexport function isPortal(value: unknown): value is PortalRegion {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$portal?: unknown }).$$portal === PORTAL\n )\n}\n\ninterface PropsWithKey {\n key?: string | number | null\n children?: MindeesNode\n}\n\n/**\n * Create a virtual element. `type` is a host-component string or a component\n * function; `Fragment` groups children without a wrapper.\n *\n * @example\n * createElement('view', { id: 'root' }, createElement('text', null, 'hi'))\n */\nexport function createElement(\n type: ElementType | typeof Fragment,\n props?: (Record<string, unknown> & PropsWithKey) | null,\n ...children: MindeesNode[]\n): MindeesElement {\n const { key = null, children: propsChildren, ...rest } = props ?? {}\n // Children passed as args win over a `children` prop; otherwise fall back to it.\n const resolved: MindeesNode[] =\n children.length > 0 ? children : propsChildren !== undefined ? [propsChildren] : []\n return {\n $$typeof: ELEMENT_TYPE,\n type: type as ElementType,\n props: Object.freeze({ ...rest }),\n children: Object.freeze(resolved),\n key,\n }\n}\n\n/** Type guard: is `value` a MindeesElement? */\nexport function isElement(value: unknown): value is MindeesElement {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$typeof?: unknown }).$$typeof === ELEMENT_TYPE\n )\n}\n\n// ---------------------------------------------------------------------------\n// Selector-based, re-render-isolated context\n// ---------------------------------------------------------------------------\n\n/** Equality used by context selectors. Defaults to `Object.is`. */\nexport type SelectorEquals<S> = (a: S, b: S) => boolean\n\n/** A context handle created by {@link createContext}. */\nexport interface Context<T> {\n /** Provide a value to a subtree (conceptually); returns a scoped reader set. */\n readonly id: symbol\n /** The default value used when no provider is present. */\n readonly defaultValue: T\n}\n\n/**\n * A live provider instance: holds the current value and lets consumers subscribe\n * to a derived slice with re-render isolation.\n */\nexport interface ContextProvider<T> {\n /** Replace the provided value (notifies only consumers whose slice changed). */\n set(value: T): void\n /** Read the current value without subscribing. */\n peek(): T\n /**\n * Subscribe to a selected slice. The returned accessor is a memo that only\n * changes — and thus only re-runs its observers — when `selector(value)`\n * changes under `equals` (default `Object.is`).\n */\n select<S>(selector: (value: T) => S, equals?: SelectorEquals<S>): () => S\n}\n\n/** Create a context with a default value. */\nexport function createContext<T>(defaultValue: T): Context<T> {\n return { id: Symbol('mindees.context'), defaultValue }\n}\n\n/**\n * Create a provider instance for `context`. Built on a signal, so selected\n * slices are memos: a consumer that selects `c => c.user.name` does not re-run\n * when an unrelated field changes.\n *\n * @example\n * const Theme = createContext({ mode: 'light', accent: 'blue' })\n * const p = createProvider(Theme, { mode: 'light', accent: 'blue' })\n * const mode = p.select((t) => t.mode) // only re-runs when `mode` changes\n */\nexport function createProvider<T>(context: Context<T>, initial?: T): ContextProvider<T> {\n // equals:false at the root — every set() re-evaluates selectors, but each\n // selector memo applies its own equality to isolate re-renders.\n const source = signal<T>(initial ?? context.defaultValue, { equals: false })\n return {\n set: (value: T) => {\n source.set(value)\n },\n peek: () => source.peek(),\n select<S>(selector: (value: T) => S, equals: SelectorEquals<S> = Object.is): () => S {\n return computed(() => selector(source()), { equals })\n },\n }\n}\n\n// ---------------------------------------------------------------------------\n// Rendering a component subtree under an owner (so it can be disposed)\n// ---------------------------------------------------------------------------\n\n/**\n * Invoke a component within a reactive ownership scope, so every effect, memo,\n * and `onCleanup` it registers is torn down together when `dispose` is called.\n * Returns the produced node and that disposer.\n *\n * Built on the Phase 1 {@link createRoot}, so disposal reuses the same\n * leak-free teardown the reactivity tests cover. This is a renderer building\n * block; it does not touch any host.\n */\nexport function renderComponent<P>(\n component: Component<P>,\n props: P,\n): { node: MindeesNode; dispose: () => void } {\n let node!: MindeesNode\n // Capture the disposer eagerly: createRoot hands it to the callback synchronously\n // *before* the component runs, so if the component throws mid-render we can still\n // tear down anything it registered before the throw (effects, subscriptions,\n // timers). Without this, createRoot re-throws without disposing and the caller\n // never receives a disposer — the partial scope would leak forever.\n let dispose!: () => void\n try {\n createRoot((d) => {\n dispose = d\n node = component(props)\n })\n } catch (error) {\n dispose?.()\n throw error\n }\n return { node, dispose }\n}\n\n/** Whether code is currently running inside a reactive ownership scope. */\nexport function hasOwner(): boolean {\n return getOwner() !== null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+DA,MAAa,eAA8B,OAAO,IAAI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3E,OAAO;EACL,MAAM,UAAa;GACjB,OAAO,IAAI,KAAK;EAClB;EACA,YAAY,OAAO,KAAK;EACxB,OAAU,UAA2B,SAA4B,OAAO,IAAa;GACnF,OAAO,eAAe,SAAS,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;EACtD;CACF;AACF;;;;;;;;;;AAeA,SAAgB,gBACd,WACA,OAC4C;CAC5C,IAAI;CAMJ,IAAI;CACJ,IAAI;EACF,YAAY,MAAM;GAChB,UAAU;GACV,OAAO,UAAU,KAAK;EACxB,CAAC;CACH,SAAS,OAAO;EACd,UAAU;EACV,MAAM;CACR;CACA,OAAO;EAAE;EAAM;CAAQ;AACzB;;AAGA,SAAgB,WAAoB;CAClC,OAAO,SAAS,MAAM;AACxB"}
1
+ {"version":3,"file":"component.js","names":[],"sources":["../../src/component/component.ts"],"sourcesContent":["/**\n * MindeesNative component model — a minimal, renderer-agnostic element tree plus\n * **selector-based, re-render-isolated context**.\n *\n * The element tree (`createElement` / `Fragment`) is a plain data structure: a\n * component is a function of `props` returning elements. It carries no rendering\n * logic itself — the Helix renderer (Phase 3) turns this tree into host nodes.\n *\n * The context system is the important primitive: a `createContext` value is read\n * through a **selector**, and a consumer only re-runs when its *selected slice*\n * actually changes — not on every context update. This is the re-render\n * isolation the Quantum Router (Phase 6) builds on. It is implemented on the\n * Phase 1 signals, so selection participates in normal reactivity.\n *\n * @module\n */\n\nimport { computed, createRoot, getOwner, signal } from '../reactive'\n\n// ---------------------------------------------------------------------------\n// Element tree\n// ---------------------------------------------------------------------------\n\n/** A component: a function from props to a renderable node. */\nexport type Component<P = Record<string, unknown>> = (props: P) => MindeesNode\n\n/**\n * Anything that can appear in the tree.\n *\n * Includes an **accessor** form `() => MindeesNode`: a function child (or\n * function prop value) is a *reactive region* — the renderer subscribes to it\n * and patches exactly that region when its signals change (the fine-grained\n * update model, à la SolidJS). Static trees never need it; reactive UIs do.\n */\nexport type MindeesNode =\n | MindeesElement\n // A node may hold a keyed region of ANY item type. KeyedRegion is invariant in T (its\n // mapFn/key take T), so `KeyedRegion<unknown>` would reject `KeyedRegion<Row>`; `any` is\n // the correct \"some item type\" here.\n // biome-ignore lint/suspicious/noExplicitAny: see above — invariant T at a node boundary.\n | KeyedRegion<any>\n | PortalRegion\n | string\n | number\n | boolean\n | null\n | undefined\n | (() => MindeesNode)\n | MindeesNode[]\n\n/** The tag of an element: a host string (e.g. `\"view\"`) or a component function. */\nexport type ElementType = string | Component<never>\n\n/** A virtual element: a tag, its props, and its children. */\nexport interface MindeesElement {\n readonly $$typeof: typeof ELEMENT_TYPE\n readonly type: ElementType\n readonly props: Readonly<Record<string, unknown>>\n readonly children: readonly MindeesNode[]\n readonly key: string | number | null\n}\n\n/** Brand so a renderer can reliably distinguish elements from plain objects. */\nexport const ELEMENT_TYPE: unique symbol = Symbol.for('mindees.element')\n\n/** Marker tag for a fragment (children with no wrapper host node). */\nexport const Fragment: unique symbol = Symbol.for('mindees.fragment')\n\n/** Brand identifying a keyed list region (reconciled by key, not full-rebuilt). */\nexport const KEYED_REGION: unique symbol = Symbol.for('mindees.keyed-region')\n\n/**\n * A keyed list region: a reactive item list + a per-item render function, reconciled by key\n * so rows keep their identity (host node, focus, caret, scroll) across reorders instead of\n * being torn down and rebuilt. This is a serializable *description* (no rendering logic); the\n * renderer materializes it (`bindKeyedChild`). Build one with {@link keyedRegion}.\n */\nexport interface KeyedRegion<T = unknown> {\n readonly $$keyed: typeof KEYED_REGION\n /** The items, as a reactive accessor. */\n readonly each: () => readonly T[]\n /** Render one row from reactive `item`/`index` accessors (consume them lazily to patch in place). */\n readonly mapFn: (item: () => T, index: () => number) => MindeesNode\n /** Stable key per item (when omitted, the row is keyed by item identity). */\n readonly key: ((item: T, index: number) => unknown) | undefined\n /** Rendered when the list is empty. */\n readonly fallback: (() => MindeesNode) | undefined\n}\n\n/** Options for {@link keyedRegion}. */\nexport interface KeyedRegionOptions<T> {\n /** The items, static or reactive. */\n readonly each: readonly T[] | (() => readonly T[])\n /** Render one row from reactive `item`/`index` accessors. */\n readonly children: (item: () => T, index: () => number) => MindeesNode\n /** Stable key per item (defaults to item identity). */\n readonly key?: (item: T, index: number) => unknown\n /** Rendered when the list is empty. */\n readonly fallback?: () => MindeesNode\n}\n\n/** Build a {@link KeyedRegion} — a keyed, identity-preserving list node. */\nexport function keyedRegion<T>(options: KeyedRegionOptions<T>): KeyedRegion<T> {\n const each: () => readonly T[] =\n typeof options.each === 'function' ? options.each : () => options.each as readonly T[]\n return {\n $$keyed: KEYED_REGION,\n each,\n mapFn: options.children,\n key: options.key,\n fallback: options.fallback,\n }\n}\n\n/** Type guard: is `value` a {@link KeyedRegion}? */\nexport function isKeyedRegion(value: unknown): value is KeyedRegion {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$keyed?: unknown }).$$keyed === KEYED_REGION\n )\n}\n\n/** Brand identifying a portal region (children relocated to an overlay target above the tree). */\nexport const PORTAL: unique symbol = Symbol.for('mindees.portal')\n\n/**\n * A portal: its children render into a different host parent (an overlay/root layer) than their\n * position in the tree, while staying owned by the logical owner so reactive disposal + unmount\n * still work. The renderer materializes it (`bindPortalChild`); build one with {@link portal}.\n */\nexport interface PortalRegion {\n readonly $$portal: typeof PORTAL\n /** Children to relocate, normalized to a (reactive) accessor. */\n readonly children: () => MindeesNode\n /** Optional explicit host target (an `N`); else the backend's overlay root; else the local parent. Opaque to core. */\n readonly mount: unknown\n}\n\n/**\n * Build a {@link PortalRegion} — relocate `children` to an overlay target. Pass `opts.mount` to\n * override the target host node; otherwise the renderer uses the backend's overlay root (or, with\n * no overlay, mounts in place — the SSR-correct default).\n */\nexport function portal(\n children: MindeesNode | (() => MindeesNode),\n opts?: { readonly mount?: unknown },\n): PortalRegion {\n return {\n $$portal: PORTAL,\n children: typeof children === 'function' ? (children as () => MindeesNode) : () => children,\n mount: opts?.mount,\n }\n}\n\n/** Type guard: is `value` a {@link PortalRegion}? */\nexport function isPortal(value: unknown): value is PortalRegion {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$portal?: unknown }).$$portal === PORTAL\n )\n}\n\ninterface PropsWithKey {\n key?: string | number | null\n children?: MindeesNode\n}\n\n/**\n * Create a virtual element. `type` is a host-component string or a component\n * function; `Fragment` groups children without a wrapper.\n *\n * @example\n * createElement('view', { id: 'root' }, createElement('text', null, 'hi'))\n */\nexport function createElement(\n type: ElementType | typeof Fragment,\n props?: (Record<string, unknown> & PropsWithKey) | null,\n ...children: MindeesNode[]\n): MindeesElement {\n const { key = null, children: propsChildren, ...rest } = props ?? {}\n // Children passed as args win over a `children` prop; otherwise fall back to it. An array `children`\n // prop is used as-is (not re-wrapped), so `element.children` has one consistent shape regardless of\n // how children were supplied — matching the JSX runtime's array-spreading normalization.\n const resolved: MindeesNode[] =\n children.length > 0\n ? children\n : propsChildren === undefined\n ? []\n : Array.isArray(propsChildren)\n ? propsChildren\n : [propsChildren]\n return {\n $$typeof: ELEMENT_TYPE,\n type: type as ElementType,\n props: Object.freeze({ ...rest }),\n children: Object.freeze(resolved),\n key,\n }\n}\n\n/** Type guard: is `value` a MindeesElement? */\nexport function isElement(value: unknown): value is MindeesElement {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { $$typeof?: unknown }).$$typeof === ELEMENT_TYPE\n )\n}\n\n// ---------------------------------------------------------------------------\n// Selector-based, re-render-isolated context\n// ---------------------------------------------------------------------------\n\n/** Equality used by context selectors. Defaults to `Object.is`. */\nexport type SelectorEquals<S> = (a: S, b: S) => boolean\n\n/** A context handle created by {@link createContext}. */\nexport interface Context<T> {\n /** Provide a value to a subtree (conceptually); returns a scoped reader set. */\n readonly id: symbol\n /** The default value used when no provider is present. */\n readonly defaultValue: T\n}\n\n/**\n * A live provider instance: holds the current value and lets consumers subscribe\n * to a derived slice with re-render isolation.\n */\nexport interface ContextProvider<T> {\n /** Replace the provided value (notifies only consumers whose slice changed). */\n set(value: T): void\n /** Read the current value without subscribing. */\n peek(): T\n /**\n * Subscribe to a selected slice. The returned accessor is a memo that only\n * changes — and thus only re-runs its observers — when `selector(value)`\n * changes under `equals` (default `Object.is`).\n */\n select<S>(selector: (value: T) => S, equals?: SelectorEquals<S>): () => S\n}\n\n/** Create a context with a default value. */\nexport function createContext<T>(defaultValue: T): Context<T> {\n return { id: Symbol('mindees.context'), defaultValue }\n}\n\n/**\n * Create a provider instance for `context`. Built on a signal, so selected\n * slices are memos: a consumer that selects `c => c.user.name` does not re-run\n * when an unrelated field changes.\n *\n * @example\n * const Theme = createContext({ mode: 'light', accent: 'blue' })\n * const p = createProvider(Theme, { mode: 'light', accent: 'blue' })\n * const mode = p.select((t) => t.mode) // only re-runs when `mode` changes\n */\nexport function createProvider<T>(context: Context<T>, initial?: T): ContextProvider<T> {\n // equals:false at the root — every set() re-evaluates selectors, but each\n // selector memo applies its own equality to isolate re-renders.\n const source = signal<T>(initial ?? context.defaultValue, { equals: false })\n return {\n set: (value: T) => {\n source.set(value)\n },\n peek: () => source.peek(),\n select<S>(selector: (value: T) => S, equals: SelectorEquals<S> = Object.is): () => S {\n return computed(() => selector(source()), { equals })\n },\n }\n}\n\n// ---------------------------------------------------------------------------\n// Rendering a component subtree under an owner (so it can be disposed)\n// ---------------------------------------------------------------------------\n\n/**\n * Invoke a component within a reactive ownership scope, so every effect, memo,\n * and `onCleanup` it registers is torn down together when `dispose` is called.\n * Returns the produced node and that disposer.\n *\n * Built on the Phase 1 {@link createRoot}, so disposal reuses the same\n * leak-free teardown the reactivity tests cover. This is a renderer building\n * block; it does not touch any host.\n */\nexport function renderComponent<P>(\n component: Component<P>,\n props: P,\n): { node: MindeesNode; dispose: () => void } {\n let node!: MindeesNode\n // Capture the disposer eagerly: createRoot hands it to the callback synchronously\n // *before* the component runs, so if the component throws mid-render we can still\n // tear down anything it registered before the throw (effects, subscriptions,\n // timers). Without this, createRoot re-throws without disposing and the caller\n // never receives a disposer — the partial scope would leak forever.\n let dispose!: () => void\n try {\n createRoot((d) => {\n dispose = d\n node = component(props)\n })\n } catch (error) {\n dispose?.()\n throw error\n }\n return { node, dispose }\n}\n\n/** Whether code is currently running inside a reactive ownership scope. */\nexport function hasOwner(): boolean {\n return getOwner() !== null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+DA,MAAa,eAA8B,OAAO,IAAI,iBAAiB;;AAGvE,MAAa,WAA0B,OAAO,IAAI,kBAAkB;;AAGpE,MAAa,eAA8B,OAAO,IAAI,sBAAsB;;AAiC5E,SAAgB,YAAe,SAAgD;CAG7E,OAAO;EACL,SAAS;EACT,MAHA,OAAO,QAAQ,SAAS,aAAa,QAAQ,aAAa,QAAQ;EAIlE,OAAO,QAAQ;EACf,KAAK,QAAQ;EACb,UAAU,QAAQ;CACpB;AACF;;AAGA,SAAgB,cAAc,OAAsC;CAClE,OACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAgC,YAAY;AAEjD;;AAGA,MAAa,SAAwB,OAAO,IAAI,gBAAgB;;;;;;AAoBhE,SAAgB,OACd,UACA,MACc;CACd,OAAO;EACL,UAAU;EACV,UAAU,OAAO,aAAa,aAAc,iBAAuC;EACnF,OAAO,MAAM;CACf;AACF;;AAGA,SAAgB,SAAS,OAAuC;CAC9D,OACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAiC,aAAa;AAEnD;;;;;;;;AAcA,SAAgB,cACd,MACA,OACA,GAAG,UACa;CAChB,MAAM,EAAE,MAAM,MAAM,UAAU,eAAe,GAAG,SAAS,SAAS,CAAC;CAInE,MAAM,WACJ,SAAS,SAAS,IACd,WACA,kBAAkB,KAAA,IAChB,CAAC,IACD,MAAM,QAAQ,aAAa,IACzB,gBACA,CAAC,aAAa;CACxB,OAAO;EACL,UAAU;EACJ;EACN,OAAO,OAAO,OAAO,EAAE,GAAG,KAAK,CAAC;EAChC,UAAU,OAAO,OAAO,QAAQ;EAChC;CACF;AACF;;AAGA,SAAgB,UAAU,OAAyC;CACjE,OACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAiC,aAAa;AAEnD;;AAmCA,SAAgB,cAAiB,cAA6B;CAC5D,OAAO;EAAE,IAAI,OAAO,iBAAiB;EAAG;CAAa;AACvD;;;;;;;;;;;AAYA,SAAgB,eAAkB,SAAqB,SAAiC;CAGtF,MAAM,SAAS,OAAU,WAAW,QAAQ,cAAc,EAAE,QAAQ,MAAM,CAAC;CAC3E,OAAO;EACL,MAAM,UAAa;GACjB,OAAO,IAAI,KAAK;EAClB;EACA,YAAY,OAAO,KAAK;EACxB,OAAU,UAA2B,SAA4B,OAAO,IAAa;GACnF,OAAO,eAAe,SAAS,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;EACtD;CACF;AACF;;;;;;;;;;AAeA,SAAgB,gBACd,WACA,OAC4C;CAC5C,IAAI;CAMJ,IAAI;CACJ,IAAI;EACF,YAAY,MAAM;GAChB,UAAU;GACV,OAAO,UAAU,KAAK;EACxB,CAAC;CACH,SAAS,OAAO;EACd,UAAU;EACV,MAAM;CACR;CACA,OAAO;EAAE;EAAM;CAAQ;AACzB;;AAGA,SAAgB,WAAoB;CAClC,OAAO,SAAS,MAAM;AACxB"}
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import { ThreadPool, WorkerLike, WorkerPoolOptions, createInlineThreadPool, crea
14
14
  /** The npm package name. */
15
15
  declare const name = "@mindees/core";
16
16
  /** The package version. All `@mindees/*` packages share one locked version line. */
17
- declare const VERSION = "0.22.0";
17
+ declare const VERSION = "0.22.1";
18
18
  /**
19
19
  * Current maturity of this package. See the repository `STATUS.md`.
20
20
  *
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import { createInlineThreadPool, createNativeThreadPool, createWorkerPool } from
12
12
  /** The npm package name. */
13
13
  const name = "@mindees/core";
14
14
  /** The package version. All `@mindees/*` packages share one locked version line. */
15
- const VERSION = "0.22.0";
15
+ const VERSION = "0.22.1";
16
16
  /**
17
17
  * Current maturity of this package. See the repository `STATUS.md`.
18
18
  *
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Maturity, PackageInfo } from './types'\n\n/**\n * Animation engine: reactive animated values + timing/spring drivers + interpolate, driven by an\n * injected frame source (RN Animated/Reanimated + Flutter AnimationController parity).\n */\nexport {\n _activeAnimationCount,\n _resetAnimation,\n type AnimatedValue,\n type AnimationHandle,\n animate,\n cubicBezier,\n type Easing,\n easeInOutQuad,\n easeInQuad,\n easeOutCubic,\n easeOutQuad,\n type FrameSource,\n getFrameSource,\n interpolate,\n linear,\n manualFrameSource,\n rafFrameSource,\n setFrameSource,\n spring,\n timing,\n} from './animation'\n/**\n * Component model: a renderer-agnostic element tree plus selector-based,\n * re-render-isolated context. (Phase 2)\n */\nexport {\n type Component,\n type Context,\n type ContextProvider,\n createContext,\n createElement,\n createProvider,\n ELEMENT_TYPE,\n type ElementType,\n Fragment,\n hasOwner,\n isElement,\n isKeyedRegion,\n isPortal,\n KEYED_REGION,\n type KeyedRegion,\n type KeyedRegionOptions,\n keyedRegion,\n type MindeesElement,\n type MindeesNode,\n PORTAL,\n type PortalRegion,\n portal,\n renderComponent,\n type SelectorEquals,\n} from './component'\nexport { NotImplementedError } from './errors'\n/**\n * Gesture recognizers: tap/longPress/pan/pinch/swipe → reactive state that drives styles and the\n * animation engine (RN Gesture Handler / Flutter GestureDetector parity).\n */\nexport {\n _setGestureClock,\n composeGestures,\n type GestureHandlers,\n longPress,\n normalizePointer,\n type PanEvent,\n type PanState,\n type PinchEvent,\n type PinchState,\n type PointerSample,\n pan,\n panAnimated,\n pinch,\n type Recognizer,\n type SwipeDirection,\n type SwipeEvent,\n swipe,\n type TapState,\n tap,\n} from './gesture'\nexport { notImplemented } from './not-implemented'\n/**\n * Fine-grained reactivity: signals, computed values, effects, batching, and\n * disposal scopes. This is the reactive core of MindeesNative.\n */\nexport {\n type Accessor,\n batch,\n type ComputedOptions,\n computed,\n createRoot,\n deferred,\n type EffectOptions,\n type EqualsFn,\n effect,\n getOwner,\n type Memo,\n memo,\n type Owner,\n on,\n onCleanup,\n runWithOwner,\n type Signal,\n type SignalOptions,\n setReactiveScheduler,\n signal,\n startTransition,\n untrack,\n} from './reactive'\n/**\n * Priority scheduler: two-lane (sync/normal), microtask-batched, with\n * cancellable and dedupable tasks. (Phase 2)\n */\nexport {\n createScheduler,\n type Priority,\n type ScheduledTask,\n type ScheduleOptions,\n Scheduler,\n type SchedulerOptions,\n type Task,\n} from './scheduler'\n/**\n * Threading abstraction: a {@link ThreadPool} contract with a working Web Worker\n * backend and an inline fallback. Native multi-threading is a research track. (Phase 2)\n */\nexport {\n createInlineThreadPool,\n createNativeThreadPool,\n createWorkerPool,\n type ThreadPool,\n type WorkerLike,\n type WorkerPoolOptions,\n} from './threading'\nexport type { Maturity, PackageInfo } from './types'\n\n/** The npm package name. */\nexport const name = '@mindees/core'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.22.0'\n\n/**\n * Current maturity of this package. See the repository `STATUS.md`.\n *\n * The reactivity layer (signals/computed/effect/batch), the component model with\n * selector-isolated context, the priority scheduler, and the thread-pool\n * abstraction (Web Worker + inline) are all implemented and tested. Native\n * multi-threading remains a research track (throws `NotImplementedError`).\n */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n"],"mappings":";;;;;;;;;;;;AA6IA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;;AAUvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Maturity, PackageInfo } from './types'\n\n/**\n * Animation engine: reactive animated values + timing/spring drivers + interpolate, driven by an\n * injected frame source (RN Animated/Reanimated + Flutter AnimationController parity).\n */\nexport {\n _activeAnimationCount,\n _resetAnimation,\n type AnimatedValue,\n type AnimationHandle,\n animate,\n cubicBezier,\n type Easing,\n easeInOutQuad,\n easeInQuad,\n easeOutCubic,\n easeOutQuad,\n type FrameSource,\n getFrameSource,\n interpolate,\n linear,\n manualFrameSource,\n rafFrameSource,\n setFrameSource,\n spring,\n timing,\n} from './animation'\n/**\n * Component model: a renderer-agnostic element tree plus selector-based,\n * re-render-isolated context. (Phase 2)\n */\nexport {\n type Component,\n type Context,\n type ContextProvider,\n createContext,\n createElement,\n createProvider,\n ELEMENT_TYPE,\n type ElementType,\n Fragment,\n hasOwner,\n isElement,\n isKeyedRegion,\n isPortal,\n KEYED_REGION,\n type KeyedRegion,\n type KeyedRegionOptions,\n keyedRegion,\n type MindeesElement,\n type MindeesNode,\n PORTAL,\n type PortalRegion,\n portal,\n renderComponent,\n type SelectorEquals,\n} from './component'\nexport { NotImplementedError } from './errors'\n/**\n * Gesture recognizers: tap/longPress/pan/pinch/swipe → reactive state that drives styles and the\n * animation engine (RN Gesture Handler / Flutter GestureDetector parity).\n */\nexport {\n _setGestureClock,\n composeGestures,\n type GestureHandlers,\n longPress,\n normalizePointer,\n type PanEvent,\n type PanState,\n type PinchEvent,\n type PinchState,\n type PointerSample,\n pan,\n panAnimated,\n pinch,\n type Recognizer,\n type SwipeDirection,\n type SwipeEvent,\n swipe,\n type TapState,\n tap,\n} from './gesture'\nexport { notImplemented } from './not-implemented'\n/**\n * Fine-grained reactivity: signals, computed values, effects, batching, and\n * disposal scopes. This is the reactive core of MindeesNative.\n */\nexport {\n type Accessor,\n batch,\n type ComputedOptions,\n computed,\n createRoot,\n deferred,\n type EffectOptions,\n type EqualsFn,\n effect,\n getOwner,\n type Memo,\n memo,\n type Owner,\n on,\n onCleanup,\n runWithOwner,\n type Signal,\n type SignalOptions,\n setReactiveScheduler,\n signal,\n startTransition,\n untrack,\n} from './reactive'\n/**\n * Priority scheduler: two-lane (sync/normal), microtask-batched, with\n * cancellable and dedupable tasks. (Phase 2)\n */\nexport {\n createScheduler,\n type Priority,\n type ScheduledTask,\n type ScheduleOptions,\n Scheduler,\n type SchedulerOptions,\n type Task,\n} from './scheduler'\n/**\n * Threading abstraction: a {@link ThreadPool} contract with a working Web Worker\n * backend and an inline fallback. Native multi-threading is a research track. (Phase 2)\n */\nexport {\n createInlineThreadPool,\n createNativeThreadPool,\n createWorkerPool,\n type ThreadPool,\n type WorkerLike,\n type WorkerPoolOptions,\n} from './threading'\nexport type { Maturity, PackageInfo } from './types'\n\n/** The npm package name. */\nexport const name = '@mindees/core'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.22.1'\n\n/**\n * Current maturity of this package. See the repository `STATUS.md`.\n *\n * The reactivity layer (signals/computed/effect/batch), the component model with\n * selector-isolated context, the priority scheduler, and the thread-pool\n * abstraction (Web Worker + inline) are all implemented and tested. Native\n * multi-threading remains a research track (throws `NotImplementedError`).\n */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n"],"mappings":";;;;;;;;;;;;AA6IA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;;AAUvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindees/core",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "MindeesNative core — fine-grained reactivity (signals/computed/effect/batch), component model with selector-isolated context, priority scheduler, and a thread-pool abstraction (Web Worker + inline; native is a research track).",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",