sibujs 1.3.0 → 1.4.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.
@@ -0,0 +1,240 @@
1
+ /**
2
+ * Higher-order component utilities for SibuJS.
3
+ * These functions wrap or compose components to add behavior.
4
+ */
5
+ type Component<P = unknown> = (props: P) => HTMLElement;
6
+ /**
7
+ * Wraps a component with additional behavior that runs before/after rendering.
8
+ *
9
+ * @param WrappedComponent The component to wrap
10
+ * @param wrapper Function that receives the component and its props, returns enhanced element
11
+ * @returns A new component function
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const WithLogging = withWrapper(MyComponent, (Comp, props) => {
16
+ * console.log("Rendering with props:", props);
17
+ * return Comp(props);
18
+ * });
19
+ * ```
20
+ */
21
+ declare function withWrapper<P>(WrappedComponent: Component<P>, wrapper: (component: Component<P>, props: P) => HTMLElement): Component<P>;
22
+ /**
23
+ * Adds default props to a component. Missing props are filled from defaults.
24
+ *
25
+ * @param component The component to wrap
26
+ * @param defaults Default prop values
27
+ * @returns A new component with defaults applied
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const Button = withDefaults(RawButton, { type: "button", disabled: false });
32
+ * Button({ nodes: "Click" }); // type="button", disabled=false automatically
33
+ * ```
34
+ */
35
+ declare function withDefaults<P extends Record<string, unknown>>(component: Component<P>, defaults: Partial<P>): Component<Partial<P>>;
36
+ /**
37
+ * Composes multiple HOC wrappers into a single wrapper.
38
+ * Applied from right to left (like function composition).
39
+ *
40
+ * @param wrappers Array of HOC functions
41
+ * @returns A function that applies all wrappers to a component
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const enhance = compose(withAuth, withLogging, withTheme);
46
+ * const EnhancedPage = enhance(Page);
47
+ * ```
48
+ */
49
+ declare function compose(...wrappers: Array<(component: Component) => Component>): (component: Component) => Component;
50
+
51
+ /**
52
+ * RenderProp implements the render-prop pattern.
53
+ * The render function receives data and returns DOM nodes.
54
+ */
55
+ declare function RenderProp<T>(props: {
56
+ data: () => T;
57
+ render: (data: T) => HTMLElement;
58
+ }): HTMLElement;
59
+ /**
60
+ * withBoundary creates an isolated component boundary for debugging.
61
+ * Wraps component output in a named container with error isolation.
62
+ */
63
+ declare function withBoundary(name: string, component: (props?: unknown) => HTMLElement): (props?: unknown) => HTMLElement;
64
+ /**
65
+ * Slot pattern — provides named slots for component composition.
66
+ */
67
+ declare function createSlots(slots: Record<string, () => HTMLElement | HTMLElement[] | null>): {
68
+ renderSlot: (name: string, fallback?: () => HTMLElement) => HTMLElement | null;
69
+ hasSlot: (name: string) => boolean;
70
+ };
71
+
72
+ /**
73
+ * Functional component props with TypeScript inference for SibuJS.
74
+ *
75
+ * Provides utilities to define typed components with prop defaults,
76
+ * nodes slots, and prop mapping — all with full TypeScript inference.
77
+ */
78
+ /**
79
+ * Extract the props type from a component defined with defineComponent.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const Button = defineComponent<{ label: string }>({
84
+ * setup(props) { ... }
85
+ * });
86
+ * type ButtonProps = ComponentProps<typeof Button>; // { label: string }
87
+ * ```
88
+ */
89
+ type ComponentProps<T> = T extends (props: infer P) => HTMLElement ? P : never;
90
+ /**
91
+ * Props that include an optional nodes slot.
92
+ */
93
+ type WithNodes<Props> = Props & {
94
+ nodes?: Node | Node[];
95
+ };
96
+ /**
97
+ * Define a typed component with props inference, defaults, and a setup function.
98
+ *
99
+ * The `setup` function receives merged props (defaults + provided) and must
100
+ * return an HTMLElement. TypeScript infers the full props type from the generic.
101
+ *
102
+ * @param config Component configuration with optional defaults and a setup function
103
+ * @returns A component function that accepts props and returns an HTMLElement
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const Button = defineComponent<{ label: string; variant?: 'primary' | 'secondary'; disabled?: boolean }>({
108
+ * defaults: { variant: 'primary', disabled: false },
109
+ * setup(props) {
110
+ * return button({
111
+ * class: `btn btn-${props.variant}`,
112
+ * disabled: props.disabled,
113
+ * nodes: props.label
114
+ * });
115
+ * }
116
+ * });
117
+ *
118
+ * // Usage: Button({ label: 'Click me' }) — TypeScript infers props
119
+ * ```
120
+ */
121
+ declare function defineComponent<Props extends Record<string, unknown>>(config: {
122
+ defaults?: Partial<Props>;
123
+ setup: (props: Props) => HTMLElement;
124
+ }): (props: Props) => HTMLElement;
125
+ /**
126
+ * Create a component with nodes slot support.
127
+ *
128
+ * Nodes are passed as a special `nodes` prop alongside the component's
129
+ * own props. This enables composition patterns where a parent component
130
+ * wraps arbitrary child content.
131
+ *
132
+ * @param config Component configuration with optional defaults and a setup function
133
+ * @returns A component function that accepts props (including nodes) and returns an HTMLElement
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * const Card = defineSlottedComponent<{ title: string }>({
138
+ * setup(props) {
139
+ * const el = div({ class: 'card' });
140
+ * el.appendChild(h2({ nodes: props.title }));
141
+ * if (props.nodes) {
142
+ * const nodes = Array.isArray(props.nodes) ? props.nodes : [props.nodes];
143
+ * nodes.forEach(child => el.appendChild(child));
144
+ * }
145
+ * return el;
146
+ * }
147
+ * });
148
+ *
149
+ * // Usage: Card({ title: 'Hello', nodes: p({ nodes: 'World' }) })
150
+ * ```
151
+ */
152
+ declare function defineSlottedComponent<Props extends Record<string, unknown>>(config: {
153
+ defaults?: Partial<Props>;
154
+ setup: (props: WithNodes<Props>) => HTMLElement;
155
+ }): (props: WithNodes<Props>) => HTMLElement;
156
+ /**
157
+ * Higher-order helper to create a component that maps outer props to inner props.
158
+ *
159
+ * Useful for adapting a generic component to a specific use case by transforming
160
+ * the prop interface without modifying the original component.
161
+ *
162
+ * @param component The inner component to forward mapped props to
163
+ * @param mapProps A function that transforms outer props into inner props
164
+ * @returns A new component that accepts outer props
165
+ *
166
+ * @example
167
+ * ```ts
168
+ * const IconButton = defineComponent<{ icon: string; label: string; size: number }>({
169
+ * setup(props) { ... }
170
+ * });
171
+ *
172
+ * const SmallIconButton = withProps(IconButton, (outer: { icon: string; label: string }) => ({
173
+ * icon: outer.icon,
174
+ * label: outer.label,
175
+ * size: 16
176
+ * }));
177
+ *
178
+ * // Usage: SmallIconButton({ icon: 'star', label: 'Favorite' })
179
+ * ```
180
+ */
181
+ declare function withProps<OuterProps extends Record<string, unknown>, InnerProps extends Record<string, unknown>>(component: (props: InnerProps) => HTMLElement, mapProps: (outer: OuterProps) => InnerProps): (props: OuterProps) => HTMLElement;
182
+
183
+ /**
184
+ * Runtime prop validation and strict typing contracts for SibuJS.
185
+ * Provides runtime type checking for component props in development mode.
186
+ */
187
+ /** Validator function: returns true if valid, or an error message string. */
188
+ type Validator<T = unknown> = (value: T, propName: string) => true | string;
189
+ /** Built-in validators */
190
+ declare const validators: {
191
+ string: Validator;
192
+ number: Validator;
193
+ boolean: Validator;
194
+ function: Validator;
195
+ object: Validator;
196
+ array: Validator;
197
+ required: Validator;
198
+ oneOf: <T>(...values: T[]) => Validator<T>;
199
+ instanceOf: <T>(ctor: new (...args: unknown[]) => T) => Validator<T>;
200
+ arrayOf: (itemValidator: Validator) => Validator<unknown[]>;
201
+ shape: (schema: Record<string, Validator>) => Validator<Record<string, unknown>>;
202
+ optional: (validator: Validator) => Validator;
203
+ range: (min: number, max: number) => Validator<number>;
204
+ pattern: (regex: RegExp) => Validator<string>;
205
+ };
206
+ interface PropDef<T = unknown> {
207
+ type?: Validator<T>;
208
+ required?: boolean;
209
+ default?: T | (() => T);
210
+ validator?: Validator<T>;
211
+ }
212
+ type PropSchema<Props> = {
213
+ [K in keyof Props]: PropDef<Props[K]> | Validator<Props[K]>;
214
+ };
215
+ /**
216
+ * Validate props against a schema. Returns validated props with defaults applied.
217
+ * In production mode (process.env.NODE_ENV === 'production'), validation is skipped
218
+ * and only defaults are applied for performance.
219
+ */
220
+ declare function validateProps<Props extends Record<string, unknown>>(props: Partial<Props>, schema: PropSchema<Props>): Props;
221
+ /**
222
+ * Define a component with runtime prop validation.
223
+ * Validates props in development mode, applies defaults, then calls setup.
224
+ */
225
+ declare function defineStrictComponent<Props extends Record<string, unknown>>(config: {
226
+ name: string;
227
+ props: PropSchema<Props>;
228
+ setup: (props: Props) => HTMLElement;
229
+ }): (props: Partial<Props>) => HTMLElement;
230
+ /**
231
+ * Assert that a value satisfies a contract at runtime.
232
+ * No-op in production builds.
233
+ */
234
+ declare function assertType<T>(value: unknown, validator: Validator<T>, label?: string): asserts value is T;
235
+ /**
236
+ * Create a type guard function from a validator.
237
+ */
238
+ declare function createGuard<T>(validator: Validator<T>): (value: unknown) => value is T;
239
+
240
+ export { type ComponentProps as C, type PropDef as P, RenderProp as R, type Validator as V, type PropSchema as a, assertType as b, compose as c, createGuard as d, createSlots as e, defineComponent as f, defineSlottedComponent as g, defineStrictComponent as h, validators as i, withDefaults as j, withProps as k, withWrapper as l, validateProps as v, withBoundary as w };
@@ -6,7 +6,7 @@ interface SignalNodeSnapshot {
6
6
  id: string;
7
7
  /** Debug name, if the caller tagged the signal. */
8
8
  name: string | null;
9
- /** Runtime type tag: `"signal"`, `"derived"`, `"memo"`, `"effect"`. */
9
+ /** Runtime type tag: `"signal"`, `"derived"`, `"effect"`. */
10
10
  kind: string;
11
11
  /** Best-effort preview of the current value. */
12
12
  value: string;
@@ -6,7 +6,7 @@ interface SignalNodeSnapshot {
6
6
  id: string;
7
7
  /** Debug name, if the caller tagged the signal. */
8
8
  name: string | null;
9
- /** Runtime type tag: `"signal"`, `"derived"`, `"memo"`, `"effect"`. */
9
+ /** Runtime type tag: `"signal"`, `"derived"`, `"effect"`. */
10
10
  kind: string;
11
11
  /** Best-effort preview of the current value. */
12
12
  value: string;
package/dist/extras.cjs CHANGED
@@ -64,7 +64,6 @@ __export(extras_exports, {
64
64
  combobox: () => combobox,
65
65
  compareSemVer: () => compareSemVer,
66
66
  componentAdapter: () => componentAdapter,
67
- composable: () => composable,
68
67
  compose: () => compose,
69
68
  composeMiddleware: () => composeMiddleware,
70
69
  conditional: () => conditional,
@@ -74,12 +73,10 @@ __export(extras_exports, {
74
73
  createBundle: () => createBundle,
75
74
  createChunkRegistry: () => createChunkRegistry,
76
75
  createDevtoolsOverlay: () => createDevtoolsOverlay,
77
- createEffect: () => createEffect,
78
76
  createErrorReporter: () => createErrorReporter,
79
77
  createGuard: () => createGuard,
80
78
  createHMRBoundary: () => createHMRBoundary,
81
79
  createISR: () => createISR,
82
- createMemo: () => createMemo,
83
80
  createMicroApp: () => createMicroApp,
84
81
  createMiddlewareChain: () => createMiddlewareChain,
85
82
  createMigrationRunner: () => createMigrationRunner,
@@ -88,7 +85,6 @@ __export(extras_exports, {
88
85
  createProfiler: () => createProfiler,
89
86
  createSSRCache: () => createSSRCache,
90
87
  createSharedScope: () => createSharedScope,
91
- createSignal: () => createSignal,
92
88
  createSlots: () => createSlots,
93
89
  createTestHarness: () => createTestHarness,
94
90
  createTheme: () => createTheme,
@@ -3228,17 +3224,6 @@ function globalStore(config) {
3228
3224
  return { getState, select: select3, dispatch, subscribe, reset };
3229
3225
  }
3230
3226
 
3231
- // src/patterns/primitives.ts
3232
- function createSignal(value) {
3233
- return signal(value);
3234
- }
3235
- function createMemo(fn) {
3236
- return derived(fn);
3237
- }
3238
- function createEffect(fn) {
3239
- return effect(fn);
3240
- }
3241
-
3242
3227
  // src/patterns/hoc.ts
3243
3228
  function withWrapper(WrappedComponent, wrapper) {
3244
3229
  return (props) => wrapper(WrappedComponent, props);
@@ -3251,9 +3236,6 @@ function compose(...wrappers) {
3251
3236
  }
3252
3237
 
3253
3238
  // src/patterns/composable.ts
3254
- function composable(setup) {
3255
- return setup;
3256
- }
3257
3239
  function RenderProp(props) {
3258
3240
  return props.render(props.data());
3259
3241
  }
@@ -7215,7 +7197,7 @@ var bundlerMetadata = {
7215
7197
  sideEffects: false,
7216
7198
  modules: {
7217
7199
  core: ["html", "mount", "each", "slots", "fragment", "catch", "portal", "directives"],
7218
- hooks: ["signal", "effect", "derived", "watch", "store", "ref", "memo", "memoFn", "array", "deepSignal"],
7200
+ hooks: ["signal", "effect", "derived", "watch", "store", "ref", "array", "deepSignal"],
7219
7201
  plugins: ["router", "i18n"],
7220
7202
  components: ["ErrorBoundary", "Loading"],
7221
7203
  ssr: ["ssr"],
@@ -9771,7 +9753,6 @@ var materialAdapter = componentAdapter(materialConfig);
9771
9753
  combobox,
9772
9754
  compareSemVer,
9773
9755
  componentAdapter,
9774
- composable,
9775
9756
  compose,
9776
9757
  composeMiddleware,
9777
9758
  conditional,
@@ -9781,12 +9762,10 @@ var materialAdapter = componentAdapter(materialConfig);
9781
9762
  createBundle,
9782
9763
  createChunkRegistry,
9783
9764
  createDevtoolsOverlay,
9784
- createEffect,
9785
9765
  createErrorReporter,
9786
9766
  createGuard,
9787
9767
  createHMRBoundary,
9788
9768
  createISR,
9789
- createMemo,
9790
9769
  createMicroApp,
9791
9770
  createMiddlewareChain,
9792
9771
  createMigrationRunner,
@@ -9795,7 +9774,6 @@ var materialAdapter = componentAdapter(materialConfig);
9795
9774
  createProfiler,
9796
9775
  createSSRCache,
9797
9776
  createSharedScope,
9798
- createSignal,
9799
9777
  createSlots,
9800
9778
  createTestHarness,
9801
9779
  createTheme,
package/dist/extras.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { InfiniteQueryOptions, InfiniteQueryResult, LoaderRoute, MutationOptions, MutationResult, OfflineStore, OfflineStoreOptions, QueryOptions, QueryResult, Resource, ResourceOptions, RetryOptions, RouteLoaderFn, SyncAdapter, SyncChange, SyncResult, calculateDelay, clearQueryCache, debounce, executeLoader, getQueryData, infiniteQuery, invalidateQueries, loaderData, mutation, offlineStore, preloadRoute, previous, query, resource, setQueryData, socket, stream, syncAdapter, throttle, withRetry } from './data.cjs';
2
2
  export { AnimationFrameOptions, BoundsRect, GamepadSnapshot, ImageLoaderState, KeyboardOptions, MouseOptions, MutationObserverOptions, SpeakOptions, SwipeDirection, SwipeOptions, TextSelectionState, UrlStateOptions, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize } from './browser.cjs';
3
- export { GlobalStore, MachineConfig, MachineReturn, Middleware, OptimisticAction, PersistOptions, Selector, TimeTravelReturn, createEffect, createMemo, createSignal, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.cjs';
4
- export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, b as assertType, c as composable, d as compose, e as createGuard, f as createSlots, g as defineComponent, h as defineSlottedComponent, i as defineStrictComponent, v as validateProps, j as validators, w as withBoundary, k as withDefaults, l as withProps, m as withWrapper } from './contracts-DDrwxvJ-.cjs';
3
+ export { GlobalStore, MachineConfig, MachineReturn, Middleware, OptimisticAction, PersistOptions, Selector, TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.cjs';
4
+ export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, b as assertType, c as compose, d as createGuard, e as createSlots, f as defineComponent, g as defineSlottedComponent, h as defineStrictComponent, v as validateProps, i as validators, w as withBoundary, j as withDefaults, k as withProps, l as withWrapper } from './contracts-xo5ckdRP.cjs';
5
5
  export { AnimationPreset, PresetOptions, SlideDirection, SpringOptions, TransitionGroup, TransitionGroupOptions, TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition } from './motion.cjs';
6
6
  export { B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, a as FocusTrap, b as FormConfig, c as FormField, d as FormReturn, I as IntersectionResult, M as MaskOptions, T as Toast, e as ToastInstance, V as ValidatorFn, f as VirtualList, g as VirtualListProps, h as announce, i as aria, j as bindAttrs, k as bindBoolAttr, l as bindData, m as bindField, n as creditCardMask, o as custom, p as dateMask, q as defineElement, r as dialog, s as email, t as eventBus, u as focus, v as form, w as hotkey, x as infiniteScroll, y as inputMask, z as intersection, A as lazyLoad, D as matchesPattern, E as max, G as maxLength, H as min, J as minLength, K as pagination, L as phoneMask, N as removeScopedStyle, O as required, P as scopedStyle, Q as ssnMask, R as svgElement, S as timeMask, U as toast, W as withScopedStyle, X as zipMask } from './customElement-D2DJp_xn.cjs';
7
7
  export { ChunkConfig, DOMPool, Features, NormalizeResult, NormalizedEntities, NormalizedSchema, NormalizedState, NormalizedStoreActions, Priority, PriorityLevel, block, cloneTemplate, conditional, createChunkRegistry, deferredValue, denormalize, devOnly, domPool, flushScheduler, hoistable, lazyChunk, noSideEffect, normalize, normalizedStore, pendingTasks, precompile, prefetch, preloadImage, preloadModule, preloadModules, preloadResource, processInChunks, pure, resetIdCounter, scheduleUpdate, setIdPrefix, startTransition, staticTemplate, transitionState, uniqueId, yieldToMain } from './performance.cjs';
package/dist/extras.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { InfiniteQueryOptions, InfiniteQueryResult, LoaderRoute, MutationOptions, MutationResult, OfflineStore, OfflineStoreOptions, QueryOptions, QueryResult, Resource, ResourceOptions, RetryOptions, RouteLoaderFn, SyncAdapter, SyncChange, SyncResult, calculateDelay, clearQueryCache, debounce, executeLoader, getQueryData, infiniteQuery, invalidateQueries, loaderData, mutation, offlineStore, preloadRoute, previous, query, resource, setQueryData, socket, stream, syncAdapter, throttle, withRetry } from './data.js';
2
2
  export { AnimationFrameOptions, BoundsRect, GamepadSnapshot, ImageLoaderState, KeyboardOptions, MouseOptions, MutationObserverOptions, SpeakOptions, SwipeDirection, SwipeOptions, TextSelectionState, UrlStateOptions, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize } from './browser.js';
3
- export { GlobalStore, MachineConfig, MachineReturn, Middleware, OptimisticAction, PersistOptions, Selector, TimeTravelReturn, createEffect, createMemo, createSignal, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.js';
4
- export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, b as assertType, c as composable, d as compose, e as createGuard, f as createSlots, g as defineComponent, h as defineSlottedComponent, i as defineStrictComponent, v as validateProps, j as validators, w as withBoundary, k as withDefaults, l as withProps, m as withWrapper } from './contracts-DDrwxvJ-.js';
3
+ export { GlobalStore, MachineConfig, MachineReturn, Middleware, OptimisticAction, PersistOptions, Selector, TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.js';
4
+ export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, b as assertType, c as compose, d as createGuard, e as createSlots, f as defineComponent, g as defineSlottedComponent, h as defineStrictComponent, v as validateProps, i as validators, w as withBoundary, j as withDefaults, k as withProps, l as withWrapper } from './contracts-xo5ckdRP.js';
5
5
  export { AnimationPreset, PresetOptions, SlideDirection, SpringOptions, TransitionGroup, TransitionGroupOptions, TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition } from './motion.js';
6
6
  export { B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, a as FocusTrap, b as FormConfig, c as FormField, d as FormReturn, I as IntersectionResult, M as MaskOptions, T as Toast, e as ToastInstance, V as ValidatorFn, f as VirtualList, g as VirtualListProps, h as announce, i as aria, j as bindAttrs, k as bindBoolAttr, l as bindData, m as bindField, n as creditCardMask, o as custom, p as dateMask, q as defineElement, r as dialog, s as email, t as eventBus, u as focus, v as form, w as hotkey, x as infiniteScroll, y as inputMask, z as intersection, A as lazyLoad, D as matchesPattern, E as max, G as maxLength, H as min, J as minLength, K as pagination, L as phoneMask, N as removeScopedStyle, O as required, P as scopedStyle, Q as ssnMask, R as svgElement, S as timeMask, U as toast, W as withScopedStyle, X as zipMask } from './customElement-D2DJp_xn.js';
7
7
  export { ChunkConfig, DOMPool, Features, NormalizeResult, NormalizedEntities, NormalizedSchema, NormalizedState, NormalizedStoreActions, Priority, PriorityLevel, block, cloneTemplate, conditional, createChunkRegistry, deferredValue, denormalize, devOnly, domPool, flushScheduler, hoistable, lazyChunk, noSideEffect, normalize, normalizedStore, pendingTasks, precompile, prefetch, preloadImage, preloadModule, preloadModules, preloadResource, processInChunks, pure, resetIdCounter, scheduleUpdate, setIdPrefix, startTransition, staticTemplate, transitionState, uniqueId, yieldToMain } from './performance.js';
package/dist/extras.js CHANGED
@@ -1,14 +1,11 @@
1
1
  import {
2
- createEffect,
3
- createMemo,
4
- createSignal,
5
2
  globalStore,
6
3
  machine,
7
4
  optimistic,
8
5
  optimisticList,
9
6
  persisted,
10
7
  timeline
11
- } from "./chunk-DAHRH4ON.js";
8
+ } from "./chunk-ZWKZCBO6.js";
12
9
  import {
13
10
  DOMPool,
14
11
  Features,
@@ -65,7 +62,7 @@ import {
65
62
  preloadCritical,
66
63
  prerenderRoutes,
67
64
  satisfies
68
- } from "./chunk-VRW3FULF.js";
65
+ } from "./chunk-M4NLBH4I.js";
69
66
  import {
70
67
  Head,
71
68
  clearWasmCache,
@@ -134,7 +131,6 @@ import {
134
131
  import {
135
132
  RenderProp,
136
133
  assertType,
137
- composable,
138
134
  compose,
139
135
  createGuard,
140
136
  createSlots,
@@ -147,7 +143,7 @@ import {
147
143
  withDefaults,
148
144
  withProps,
149
145
  withWrapper
150
- } from "./chunk-XYU6TZOW.js";
146
+ } from "./chunk-CNZ35WI2.js";
151
147
  import {
152
148
  accordion,
153
149
  combobox,
@@ -372,7 +368,6 @@ export {
372
368
  combobox,
373
369
  compareSemVer,
374
370
  componentAdapter,
375
- composable,
376
371
  compose,
377
372
  composeMiddleware,
378
373
  conditional,
@@ -382,12 +377,10 @@ export {
382
377
  createBundle,
383
378
  createChunkRegistry,
384
379
  createDevtoolsOverlay,
385
- createEffect,
386
380
  createErrorReporter,
387
381
  createGuard,
388
382
  createHMRBoundary,
389
383
  createISR,
390
- createMemo,
391
384
  createMicroApp,
392
385
  createMiddlewareChain,
393
386
  createMigrationRunner,
@@ -396,7 +389,6 @@ export {
396
389
  createProfiler,
397
390
  createSSRCache,
398
391
  createSharedScope,
399
- createSignal,
400
392
  createSlots,
401
393
  createTestHarness,
402
394
  createTheme,
package/dist/index.cjs CHANGED
@@ -134,8 +134,6 @@ __export(index_exports, {
134
134
  mask: () => mask,
135
135
  match: () => match,
136
136
  math: () => math,
137
- memo: () => memo,
138
- memoFn: () => memoFn,
139
137
  menu: () => menu,
140
138
  meta: () => meta,
141
139
  meter: () => meter,
@@ -2267,16 +2265,6 @@ function ref(initial) {
2267
2265
  };
2268
2266
  }
2269
2267
 
2270
- // src/core/signals/memo.ts
2271
- function memo(factory) {
2272
- return derived(factory);
2273
- }
2274
-
2275
- // src/core/signals/memoFn.ts
2276
- function memoFn(callback) {
2277
- return derived(callback);
2278
- }
2279
-
2280
2268
  // src/core/signals/array.ts
2281
2269
  function array(initial = []) {
2282
2270
  const [arr, setArr] = signal([...initial]);
@@ -3705,8 +3693,6 @@ function Loading(props = {}) {
3705
3693
  mask,
3706
3694
  match,
3707
3695
  math,
3708
- memo,
3709
- memoFn,
3710
3696
  menu,
3711
3697
  meta,
3712
3698
  meter,
package/dist/index.d.cts CHANGED
@@ -675,7 +675,7 @@ declare function checkLeaks(warnThreshold?: number): number;
675
675
 
676
676
  declare const __accessor: unique symbol;
677
677
  /**
678
- * A reactive signal getter returned by signal(), derived(), memo(), and similar primitives.
678
+ * A reactive signal getter returned by signal(), derived(), and similar primitives.
679
679
  *
680
680
  * Pass an Accessor directly into reactive prop positions — never call it there:
681
681
  * ```ts
@@ -828,28 +828,6 @@ interface Ref<T> {
828
828
  declare function ref<T>(initial: T): Ref<T>;
829
829
  declare function ref<T = undefined>(): Ref<T | undefined>;
830
830
 
831
- /**
832
- * memo returns a memoized value that only recomputes when its
833
- * reactive dependencies change. This is semantically identical to
834
- * derived but named for convenience.
835
- *
836
- * Use this to avoid expensive computations on every render cycle.
837
- *
838
- * @param factory Function that computes the memoized value
839
- * @returns Getter function that returns the memoized value
840
- */
841
- declare function memo<T>(factory: () => T): Accessor<T>;
842
-
843
- /**
844
- * memoFn returns a memoized callback function that only updates
845
- * when its reactive dependencies change. This prevents unnecessary
846
- * re-creations of callback functions passed to child components.
847
- *
848
- * @param callback The callback function to memoize
849
- * @returns Getter that returns the current memoized callback
850
- */
851
- declare function memoFn<T extends (...args: any[]) => any>(callback: () => T): Accessor<T>;
852
-
853
831
  /**
854
832
  * Reactive array hook. Provides common array operations that
855
833
  * automatically trigger reactive updates.
@@ -1483,4 +1461,4 @@ interface LoadingProps {
1483
1461
  */
1484
1462
  declare function Loading(props?: LoadingProps): HTMLElement;
1485
1463
 
1486
- export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, memo, memoFn, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
1464
+ export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
package/dist/index.d.ts CHANGED
@@ -675,7 +675,7 @@ declare function checkLeaks(warnThreshold?: number): number;
675
675
 
676
676
  declare const __accessor: unique symbol;
677
677
  /**
678
- * A reactive signal getter returned by signal(), derived(), memo(), and similar primitives.
678
+ * A reactive signal getter returned by signal(), derived(), and similar primitives.
679
679
  *
680
680
  * Pass an Accessor directly into reactive prop positions — never call it there:
681
681
  * ```ts
@@ -828,28 +828,6 @@ interface Ref<T> {
828
828
  declare function ref<T>(initial: T): Ref<T>;
829
829
  declare function ref<T = undefined>(): Ref<T | undefined>;
830
830
 
831
- /**
832
- * memo returns a memoized value that only recomputes when its
833
- * reactive dependencies change. This is semantically identical to
834
- * derived but named for convenience.
835
- *
836
- * Use this to avoid expensive computations on every render cycle.
837
- *
838
- * @param factory Function that computes the memoized value
839
- * @returns Getter function that returns the memoized value
840
- */
841
- declare function memo<T>(factory: () => T): Accessor<T>;
842
-
843
- /**
844
- * memoFn returns a memoized callback function that only updates
845
- * when its reactive dependencies change. This prevents unnecessary
846
- * re-creations of callback functions passed to child components.
847
- *
848
- * @param callback The callback function to memoize
849
- * @returns Getter that returns the current memoized callback
850
- */
851
- declare function memoFn<T extends (...args: any[]) => any>(callback: () => T): Accessor<T>;
852
-
853
831
  /**
854
832
  * Reactive array hook. Provides common array operations that
855
833
  * automatically trigger reactive updates.
@@ -1483,4 +1461,4 @@ interface LoadingProps {
1483
1461
  */
1484
1462
  declare function Loading(props?: LoadingProps): HTMLElement;
1485
1463
 
1486
- export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, memo, memoFn, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
1464
+ export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
package/dist/index.js CHANGED
@@ -24,8 +24,6 @@ import {
24
24
  lazy,
25
25
  longPress,
26
26
  match,
27
- memo,
28
- memoFn,
29
27
  mount,
30
28
  nextTick,
31
29
  onCleanup,
@@ -45,7 +43,7 @@ import {
45
43
  unregisterComponent,
46
44
  when,
47
45
  writable
48
- } from "./chunk-QWZG56ET.js";
46
+ } from "./chunk-UHNL42EF.js";
49
47
  import {
50
48
  __resetIdCounter,
51
49
  createId
@@ -343,8 +341,6 @@ export {
343
341
  mask,
344
342
  match,
345
343
  math,
346
- memo,
347
- memoFn,
348
344
  menu,
349
345
  meta,
350
346
  meter,
package/dist/patterns.cjs CHANGED
@@ -22,12 +22,8 @@ var patterns_exports = {};
22
22
  __export(patterns_exports, {
23
23
  RenderProp: () => RenderProp,
24
24
  assertType: () => assertType,
25
- composable: () => composable,
26
25
  compose: () => compose,
27
- createEffect: () => createEffect,
28
26
  createGuard: () => createGuard,
29
- createMemo: () => createMemo,
30
- createSignal: () => createSignal,
31
27
  createSlots: () => createSlots,
32
28
  defineComponent: () => defineComponent,
33
29
  defineSlottedComponent: () => defineSlottedComponent,
@@ -699,17 +695,6 @@ function globalStore(config) {
699
695
  return { getState, select, dispatch, subscribe, reset };
700
696
  }
701
697
 
702
- // src/patterns/primitives.ts
703
- function createSignal(value) {
704
- return signal(value);
705
- }
706
- function createMemo(fn) {
707
- return derived(fn);
708
- }
709
- function createEffect(fn) {
710
- return effect(fn);
711
- }
712
-
713
698
  // src/patterns/hoc.ts
714
699
  function withWrapper(WrappedComponent, wrapper) {
715
700
  return (props) => wrapper(WrappedComponent, props);
@@ -722,9 +707,6 @@ function compose(...wrappers) {
722
707
  }
723
708
 
724
709
  // src/patterns/composable.ts
725
- function composable(setup) {
726
- return setup;
727
- }
728
710
  function RenderProp(props) {
729
711
  return props.render(props.data());
730
712
  }
@@ -878,12 +860,8 @@ function createGuard(validator) {
878
860
  0 && (module.exports = {
879
861
  RenderProp,
880
862
  assertType,
881
- composable,
882
863
  compose,
883
- createEffect,
884
864
  createGuard,
885
- createMemo,
886
- createSignal,
887
865
  createSlots,
888
866
  defineComponent,
889
867
  defineSlottedComponent,