@petit-kit/scoped 0.0.6-beta.1 → 0.0.6

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/dist/index.d.ts DELETED
@@ -1,643 +0,0 @@
1
- export * from './plugins';
2
- /**
3
- * Scope - A lightweight, framework-agnostic library for building web components
4
- *
5
- * @module scope
6
- * @version 0.0.5
7
- * @description Provides a minimal abstraction over Custom Elements API, making it easy
8
- * to create reusable, encapsulated components with reactive state, lifecycle hooks,
9
- * and a simple template-based rendering system.
10
- *
11
- * @example Basic component
12
- * ```javascript
13
- * import { define } from './scope.js';
14
- *
15
- * define("c-slider", {
16
- * props: { value: { type: Number, default: 0 } }
17
- * }, ({ link, emit, actions, host }) => {
18
- * link("value", "value")
19
- *
20
- * actions.handleChange = event => {
21
- * host.updateState({ value: event.target.valueAsNumber })
22
- * emit("on-change", { value: event.target.valueAsNumber })
23
- * }
24
- *
25
- * return () => `
26
- * <div>
27
- * <input
28
- * type="range"
29
- * min="0" max="100" step="1"
30
- * bind:value="value"
31
- * on:input="handleChange"
32
- * />
33
- * <c-number ref="number" bind:value="value"></c-number>
34
- * </div>
35
- * `
36
- * })
37
-
38
- * ```
39
- *
40
- * @example Component with shadow DOM
41
- * ```javascript
42
- * define('styled-button', {
43
- * shadow: true,
44
- * styles: 'button { background: blue; color: white; }'
45
- * }, () => {
46
- * return () => '<button>Click me</button>';
47
- * });
48
- * ```
49
- *
50
- * @see {@link ComponentContext} for available context properties
51
- * @see {@link ComponentOptions} for configuration options
52
- */
53
- /**
54
- * Library version.
55
- *
56
- * @constant {string}
57
- */
58
- declare const SCOPE_VERSION = "0.0.5";
59
- /**
60
- * Logs version and repository info for @petit-kit/scoped.
61
- * Useful for debugging or confirming library presence.
62
- */
63
- export declare const happy: () => void;
64
- /**
65
- * Supported prop types for type checking and parsing
66
- *
67
- * @typedef {StringConstructor|NumberConstructor|BooleanConstructor|ObjectConstructor|ArrayConstructor} PropType
68
- */
69
- export type PropType = StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor | ArrayConstructor;
70
- /**
71
- * Definition for a single prop, including type, default value, and reflection behavior
72
- *
73
- * @template T - The type of the prop value
74
- * @interface PropDefinition
75
- *
76
- * @example
77
- * ```typescript
78
- * const propDef: PropDefinition<number> = {
79
- * type: Number,
80
- * default: 0,
81
- * reflect: true
82
- * };
83
- * ```
84
- */
85
- export interface PropDefinition<T = any> {
86
- /**
87
- * Type constructor for parsing the prop value from attributes
88
- * @type {PropType}
89
- */
90
- type?: PropType;
91
- /**
92
- * Default value if prop is not provided
93
- * @type {T}
94
- */
95
- default?: T;
96
- /**
97
- * Whether to reflect prop changes back to HTML attributes
98
- * @type {boolean}
99
- * @default false
100
- */
101
- reflect?: boolean;
102
- }
103
- /**
104
- * Props definition object mapping prop names to their definitions or default values
105
- *
106
- * @typedef {Record<string, PropDefinition | any>} PropsDefinition
107
- *
108
- * @example
109
- * ```typescript
110
- * const props: PropsDefinition = {
111
- * count: { type: Number, default: 0 },
112
- * name: { type: String, default: 'World' },
113
- * active: { type: Boolean, default: false }
114
- * };
115
- * ```
116
- */
117
- export type PropsDefinition = Record<string, PropDefinition | any>;
118
- /**
119
- * Plugin for extending the component context.
120
- */
121
- export type ComponentPlugin<Ext extends Record<string, any> = {}> = {
122
- /** Optional plugin name for debugging */
123
- name?: string;
124
- /**
125
- * Extend the component context with new capabilities.
126
- */
127
- extend: (context: ComponentContextBase<any, any, any, any>, host: ComponentHost) => Ext;
128
- };
129
- /**
130
- * Options for component definition
131
- *
132
- * @interface ComponentOptions
133
- *
134
- * @example
135
- * ```typescript
136
- * const options: ComponentOptions = {
137
- * props: { count: { type: Number, default: 0 } },
138
- * shadow: true,
139
- * styles: 'div { color: red; }'
140
- * };
141
- * ```
142
- */
143
- export interface ComponentOptions<Plugins extends readonly ComponentPlugin<any>[] = ComponentPlugin<any>[]> {
144
- /**
145
- * Prop definitions for the component
146
- * @type {PropsDefinition}
147
- */
148
- props?: PropsDefinition;
149
- /**
150
- * Whether to use Shadow DOM (default: false, uses light DOM)
151
- * @type {boolean}
152
- * @default false
153
- */
154
- shadow?: boolean;
155
- /**
156
- * CSS styles to inject into document head (for shadow DOM components)
157
- * @type {string}
158
- */
159
- styles?: string;
160
- /**
161
- * Plugins that extend the component context.
162
- * @type {Plugins}
163
- */
164
- plugins?: Plugins;
165
- }
166
- /**
167
- * Methods available on the component host element
168
- *
169
- * @interface ComponentHost
170
- *
171
- * @example
172
- * ```typescript
173
- * define('my-component', {}, ({ host }) => {
174
- * host.setState({ count: 5 });
175
- * host.updateState({ scrollY: 100 });
176
- * host.setProps({ title: 'New Title' });
177
- * });
178
- * ```
179
- */
180
- export interface ComponentHost {
181
- /**
182
- * Update state and trigger full re-render
183
- * @method setState
184
- * @param {Partial<State>} partial - Partial state object to merge
185
- * @template State
186
- *
187
- * @example
188
- * ```typescript
189
- * host.setState({ count: 5, name: 'Updated' });
190
- * ```
191
- */
192
- setState: <State>(partial: Partial<State>) => void;
193
- /**
194
- * Update state without re-render (triggers effects only)
195
- * @method updateState
196
- * @param {Partial<State>} partial - Partial state object to merge
197
- * @template State
198
- *
199
- * @example
200
- * ```typescript
201
- * // Update scroll position without re-rendering
202
- * host.updateState({ scrollY: window.scrollY });
203
- * ```
204
- */
205
- updateState: <State>(partial: Partial<State>) => void;
206
- /**
207
- * Update props programmatically
208
- * @method setProps
209
- * @param {Partial<Props>} partial - Partial props object to merge
210
- * @template Props
211
- *
212
- * @example
213
- * ```typescript
214
- * // Pass large data (recommended for objects/arrays)
215
- * element.setProps({ data: largeArray, config: complexObject });
216
- * ```
217
- */
218
- setProps: <Props>(partial: Partial<Props>) => void;
219
- /**
220
- * Schedule a partial update (effects only)
221
- * @method scheduleUpdate
222
- *
223
- * @example
224
- * ```typescript
225
- * host.scheduleUpdate(); // Runs effects on next animation frame
226
- * ```
227
- */
228
- scheduleUpdate: () => void;
229
- /**
230
- * Force an update (full or partial render)
231
- * @method update
232
- * @param {boolean} fullRender - Whether to perform full render or effects only
233
- *
234
- * @example
235
- * ```typescript
236
- * host.update(true); // Full render
237
- * host.update(false); // Effects only
238
- * ```
239
- */
240
- update: (fullRender: boolean) => void;
241
- /**
242
- * Force a full re-render even if template is unchanged
243
- * @method forceRender
244
- *
245
- * @example
246
- * ```typescript
247
- * host.forceRender(); // Forces DOM update even if template string matches
248
- * ```
249
- */
250
- forceRender: () => void;
251
- /**
252
- * Clean up component and run destroy callbacks
253
- * @method destroy
254
- *
255
- * @example
256
- * ```typescript
257
- * host.destroy(); // Cleans up effects, events, and runs onDestroy hooks
258
- * ```
259
- */
260
- destroy: () => void;
261
- /**
262
- * Remove the component from the DOM
263
- * @method remove
264
- *
265
- * @example
266
- * ```typescript
267
- * host.remove(); // Removes element and triggers cleanup via disconnectedCallback
268
- * ```
269
- */
270
- remove: () => void;
271
- /**
272
- * Select DOM elements within the component.
273
- * Returns a single element, or an array of elements if multiple match.
274
- * @method $
275
- * @param {string} selector - CSS selector to match elements
276
- * @returns {Element | Element[] | null} Single element, array of elements, or null if none match
277
- *
278
- * @example
279
- * ```typescript
280
- * const btn = host.$('button.primary'); // single element or null
281
- * const items = host.$('.list-item'); // array when multiple match
282
- * const first = Array.isArray(items) ? items[0] : items;
283
- * ```
284
- */
285
- $: (selector: string) => Element | Element[] | null;
286
- }
287
- /**
288
- * Context object passed to the setup function, providing access to component APIs
289
- *
290
- * @template Props - Type of component props
291
- * @template State - Type of component state
292
- * @template Actions - Type of action methods
293
- * @template Refs - Type of DOM refs
294
- * @interface ComponentContext
295
- *
296
- * @example Basic usage
297
- * ```typescript
298
- * define('counter', {}, ({ props, state, actions, host }) => {
299
- * state.count = 0;
300
- * actions.increment = () => host.setState({ count: state.count + 1 });
301
- * return () => `<div>${state.count}</div>`;
302
- * });
303
- * ```
304
- *
305
- * @example With lifecycle hooks
306
- * ```typescript
307
- * define('component', {}, ({ onMount, onDestroy, effect }) => {
308
- * onMount(() => console.log('Mounted'));
309
- * onDestroy(() => console.log('Destroyed'));
310
- * effect((deps) => {
311
- * const timer = setInterval(() => {}, 1000);
312
- * return () => clearInterval(timer);
313
- * }, []);
314
- * return () => '<div>Hello</div>';
315
- * });
316
- * ```
317
- *
318
- * @see {@link ComponentHost} for host methods
319
- * @see {@link ComponentOptions} for component configuration
320
- */
321
- export interface ComponentContextBase<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>> {
322
- /**
323
- * Component props (read-only, updated via attributes or setProps)
324
- * @type {Props}
325
- * @readonly
326
- */
327
- props: Props;
328
- /**
329
- * Component state (mutable, updated via setState/updateState)
330
- * @type {State}
331
- */
332
- state: State;
333
- /**
334
- * Action methods that can be called from event handlers
335
- * @type {Actions}
336
- *
337
- * @example
338
- * ```typescript
339
- * actions.handleClick = () => { /* ... *\/ };
340
- * // Use in template: <button on:click="handleClick">
341
- * ```
342
- */
343
- actions: Actions;
344
- /**
345
- * DOM element references (populated after render)
346
- * @type {Refs}
347
- *
348
- * @example
349
- * ```typescript
350
- * // In template: <div ref="myDiv"></div>
351
- * // Access: refs.myDiv
352
- * ```
353
- */
354
- refs: Refs;
355
- /**
356
- * Emit custom events that bubble up the DOM tree
357
- * @method emit
358
- * @param {string} name - Event name
359
- * @param {any} [detail] - Optional event detail data
360
- *
361
- * @example
362
- * ```typescript
363
- * emit('item-clicked', { id: 123, name: 'Item' });
364
- * ```
365
- */
366
- emit: (name: string, detail?: any) => void;
367
- /**
368
- * Listen to a custom event from a given target
369
- * @method listen
370
- * @param {EventTarget} target - Target to attach the listener to
371
- * @param {string} name - Custom event name to listen for
372
- * @param {function(CustomEvent): void} handler - Event handler
373
- * @param {AddEventListenerOptions} [options] - Listener options
374
- * @returns {() => void} Cleanup function to remove the listener
375
- *
376
- * @example
377
- * ```typescript
378
- * const cleanup = listen(window, 'theme-change', (e) => {
379
- * console.log(e.detail);
380
- * });
381
- * ```
382
- */
383
- listen: (target: EventTarget, name: string, handler: (event: CustomEvent<any>) => void, options?: AddEventListenerOptions) => () => void;
384
- /**
385
- * Update state without triggering a re-render (triggers effects only)
386
- * @method updateState
387
- * @param {Partial<State>} partial - Partial state object to merge
388
- *
389
- * @example
390
- * ```typescript
391
- * updateState({ count: 5 }); // Updates state, runs effects, but doesn't re-render
392
- * ```
393
- */
394
- updateState: (partial: Partial<State>) => void;
395
- /**
396
- * Select DOM elements within the component.
397
- * Returns a single element, or an iterable array if multiple match.
398
- * @method $
399
- * @param {string} selector - CSS selector to match elements
400
- * @returns {Element | Element[] | null} Single element, array of elements, or null if none match
401
- *
402
- * @example
403
- * ```typescript
404
- * const btn = $('button.primary'); // single element or null
405
- * const items = $('.list-item'); // array when multiple match
406
- * for (const el of Array.isArray(items) ? items : (items ? [items] : [])) { ... }
407
- * ```
408
- */
409
- $: (selector: string) => Element | Element[] | null;
410
- /**
411
- * The component host element with all host methods
412
- * @type {HTMLElement & ComponentHost}
413
- *
414
- * @see {@link ComponentHost}
415
- */
416
- host: HTMLElement & ComponentHost;
417
- /**
418
- * Register callback to run after component is mounted
419
- * @method onMount
420
- * @param {function(): void} callback - Callback function
421
- */
422
- onMount: (callback: () => void) => void;
423
- /**
424
- * Register callback to run when component is destroyed
425
- * @method onDestroy
426
- * @param {function(): void} callback - Callback function
427
- */
428
- onDestroy: (callback: () => void) => void;
429
- /**
430
- * Register callback to run after each update/re-render
431
- * @method onUpdate
432
- * @param {function(): void} callback - Callback function
433
- */
434
- onUpdate: (callback: () => void) => void;
435
- /**
436
- * Register callback to run before each update/re-render
437
- * @method onBeforeUpdate
438
- * @param {function(): void} callback - Callback function
439
- */
440
- onBeforeUpdate: (callback: () => void) => void;
441
- /**
442
- * Register callback to run only on the first update (after mount)
443
- * @method onFirstUpdate
444
- * @param {function(): void} callback - Callback function
445
- */
446
- onFirstUpdate: (callback: () => void) => void;
447
- /**
448
- * Register callback to run when props change
449
- * @method onPropsChanged
450
- * @param {function(string, any, any): void} callback - Callback function
451
- *
452
- * @example
453
- * ```typescript
454
- * onPropsChanged((propName, oldValue, newValue) => {
455
- * console.log(`${propName} changed from ${oldValue} to ${newValue}`);
456
- * });
457
- * ```
458
- */
459
- onPropsChanged: (callback: (propName: string, oldValue: any, newValue: any) => void) => void;
460
- /**
461
- * Link a prop and a state key (two-way, no extra render)
462
- *
463
- * Updates state when the prop changes, and updates the prop/attribute
464
- * when the state changes without triggering a render. Attribute
465
- * reflection is forced even if the prop is not marked reflect: true.
466
- *
467
- * @method link
468
- * @param {string} propName - Prop name to link
469
- * @param {string} [stateKey] - State key to link (defaults to propName)
470
- *
471
- * @example
472
- * ```typescript
473
- * link('value'); // state.value <-> props.value
474
- * link('title', 'text'); // state.text <-> props.title
475
- * ```
476
- */
477
- link: (propName: string, stateKey?: string) => void;
478
- /**
479
- * Register effect function that runs after renders (with optional cleanup)
480
- * @method effect
481
- * @param {function(any[]): (void|function())} fn - Effect function that can return cleanup
482
- * @param {any[] | (() => any[])} [deps] - Optional dependency array or deps getter
483
- * @returns {() => void} Cleanup function to remove the effect
484
- *
485
- * @example
486
- * ```typescript
487
- * const cleanup = effect((deps) => {
488
- * const timer = setInterval(() => {}, 1000);
489
- * return () => clearInterval(timer); // Cleanup function
490
- * }, []);
491
- * ```
492
- */
493
- effect: (fn: EffectFn, deps?: any[] | (() => any[])) => () => void;
494
- /**
495
- * Register a computed value that updates before renders.
496
- *
497
- * @method computed
498
- * @param {function(any[]): *} getter - Function that returns the computed value
499
- * @param {any[] | (() => any[])} [deps] - Optional dependency array or deps getter
500
- * @returns {() => T} Getter for the current computed value
501
- *
502
- * @example
503
- * ```typescript
504
- * const fullName = computed((deps) => `${props.first} ${state.last}`, () => [props.first, state.last]);
505
- * return () => `<div>${fullName()}</div>`;
506
- * ```
507
- */
508
- computed: <T>(getter: ComputedGetter<T>, deps?: ComputedDeps) => () => T;
509
- /**
510
- * Set up event delegation for dynamic content
511
- * @method delegate
512
- * @param {string} eventType - The event type (e.g., 'click', 'input')
513
- * @param {string} selector - CSS selector to match target elements
514
- * @param {function(Event, Element): void} handler - Handler function
515
- * @returns {() => void} Cleanup function to remove the delegation
516
- *
517
- * @example
518
- * ```typescript
519
- * const cleanup = delegate('click', '.item', (e, target) => {
520
- * console.log('Item clicked:', target);
521
- * });
522
- * ```
523
- */
524
- delegate: (eventType: string, selector: string, handler: (event: Event, target: Element) => void) => () => void;
525
- }
526
- /**
527
- * Component context including plugin-provided extensions.
528
- */
529
- export type ComponentContext<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Ext = {}> = ComponentContextBase<Props, State, Actions, Refs> & Ext;
530
- type UnionToIntersection<U> = (U extends any ? (arg: U) => void : never) extends (arg: infer I) => void ? I : never;
531
- type PluginExtensions<Plugins extends readonly ComponentPlugin<any>[]> = UnionToIntersection<Plugins[number] extends ComponentPlugin<infer Ext> ? Ext : {}>;
532
- /**
533
- * Setup function that receives component context and returns a render function
534
- *
535
- * @template Props - Type of component props
536
- * @template State - Type of component state
537
- * @template Actions - Type of action methods
538
- * @template Refs - Type of DOM refs
539
- * @typedef {function} SetupFunction
540
- * @param {ComponentContext<Props, State, Actions, Refs, Ext>} context - Component context
541
- * @returns {() => string} Render function that returns HTML template string
542
- *
543
- * @example
544
- * ```typescript
545
- * const setup: SetupFunction = ({ props, state, actions }) => {
546
- * state.count = 0;
547
- * actions.increment = () => state.count++;
548
- * return () => `<div>Count: ${state.count}</div>`;
549
- * };
550
- * ```
551
- *
552
- * @see {@link ComponentContext}
553
- */
554
- export type SetupFunction<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Ext = {}> = (context: ComponentContext<Props, State, Actions, Refs, Ext>) => () => string;
555
- /**
556
- * Information about a delegated event handler
557
- */
558
- export type DelegatedEventInfo = {
559
- /** The event type (e.g., 'click', 'input') */
560
- eventType: string;
561
- /** CSS selector to match elements */
562
- selector: string;
563
- /** The actual event listener attached to the root */
564
- listener: (e: Event) => void;
565
- /** Set of handler functions registered for this delegation */
566
- handlers: Set<(e: Event, target: Element) => void>;
567
- };
568
- export type EffectDeps = any[] | (() => any[]);
569
- export type ComputedDeps = any[] | (() => any[]);
570
- export type EffectFn = (deps?: any[]) => void | (() => void);
571
- export type ComputedGetter<T = any> = (deps?: any[]) => T;
572
- export type EffectRecord = {
573
- fn: EffectFn;
574
- deps?: EffectDeps;
575
- prevDeps?: any[];
576
- cleanup?: () => void;
577
- };
578
- export type ComputedRecord<T = any> = {
579
- getter: ComputedGetter<T>;
580
- deps?: ComputedDeps;
581
- prevDeps?: any[];
582
- value: T;
583
- };
584
- /**
585
- * Defines a new custom element component
586
- *
587
- * @function define
588
- * @template Props - Type of component props
589
- * @template State - Type of component state
590
- * @template Actions - Type of action methods
591
- * @template Refs - Type of DOM refs
592
- *
593
- * @param {string} tagName - The custom element tag name (must contain a hyphen, e.g., 'my-component')
594
- * @param {ComponentOptions} [options={}] - Component configuration options
595
- * @param {SetupFunction<Props, State, Actions, Refs, PluginExtensions<Plugins>>} [setup] - Optional setup function that receives context and returns render function
596
- * @returns {Function} The custom element class constructor
597
- *
598
- * @throws {Error} If tagName doesn't contain a hyphen (required by Custom Elements spec)
599
- * @throws {Error} If component is already defined (logs warning instead of throwing)
600
- *
601
- * @example Basic component
602
- * ```javascript
603
- * define('my-counter', {
604
- * props: { initialValue: { type: Number, default: 0 } }
605
- * }, ({ props, state, actions, host }) => {
606
- * state.count = props.initialValue;
607
- * actions.increment = () => host.setState({ count: state.count + 1 });
608
- * return () => `<div>Count: ${state.count}</div>`;
609
- * });
610
- * ```
611
- *
612
- * @example Component with shadow DOM
613
- * ```javascript
614
- * define('styled-button', {
615
- * shadow: true,
616
- * styles: 'button { background: blue; color: white; }'
617
- * }, () => {
618
- * return () => '<button>Click me</button>';
619
- * });
620
- * ```
621
- *
622
- * @example Component with TypeScript types
623
- * ```typescript
624
- * interface MyProps { count: number }
625
- * interface MyState { value: string }
626
- * interface MyActions { handleClick: () => void }
627
- *
628
- * define<MyProps, MyState, MyActions>('typed-component', {
629
- * props: { count: { type: Number, default: 0 } }
630
- * }, ({ props, state, actions }) => {
631
- * state.value = `Count: ${props.count}`;
632
- * actions.handleClick = () => console.log('clicked');
633
- * return () => `<div>${state.value}</div>`;
634
- * });
635
- * ```
636
- *
637
- * @see {@link ComponentContext} for available context properties
638
- * @see {@link ComponentOptions} for configuration options
639
- * @see {@link SetupFunction} for setup function signature
640
- */
641
- declare function define<Props = Record<string, any>, State = Record<string, any>, Actions = Record<string, Function>, Refs = Record<string, HTMLElement | HTMLElement[]>, Plugins extends readonly ComponentPlugin<any>[] = []>(tagName: string, options?: ComponentOptions<Plugins>, setup?: SetupFunction<Props, State, Actions, Refs, PluginExtensions<Plugins>>): typeof HTMLElement;
642
- export { define, SCOPE_VERSION };
643
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;GAIG;AACH,QAAA,MAAM,aAAa,UAAU,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,KAAK,YAKjB,CAAC;AAuCF;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,CAAC;AAErB;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,E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AAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AA2JF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,iBAAS,MAAM,CACb,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAClC,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC,EAClD,OAAO,SAAS,SAAS,eAAe,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAEpD,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,gBAAgB,CAAC,OAAO,CAAM,EACvC,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAC5E,OAAO,WAAW,CAkzDpB;AAED,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/content/index.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { ComponentPlugin } from '../../index';
2
- export type DeviceControls = {
3
- onMediaQuery: (query: string, handler: (matches: boolean, event: MediaQueryListEvent | null) => void, options?: {
4
- immediate?: boolean;
5
- }) => () => void;
6
- };
7
- export declare const devicePlugin: () => ComponentPlugin<DeviceControls>;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG;IAS3B,YAAY,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,EACtE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KAC9B,MAAM,IAAI,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,eAAe,CAAC,cAAc,CA6C5D,CAAC"}
@@ -1,11 +0,0 @@
1
- export { devicePlugin, type DeviceControls } from './device';
2
- export { morphPlugin, type IdiomorphAPI, type IdiomorphGetter, type MorphControls, type MorphOptions, } from './morph';
3
- export { windowPlugin, type WindowControls } from './window';
4
- export { inViewPlugin, type InViewControls, type InViewHandler, type InViewOptions, } from './inview';
5
- export { lenisPlugin, type LenisControls, type LenisGetter, type LenisInstance, type LenisScrollEvent, type LenisScrollHandler, } from './lenis';
6
- export { timerPlugin, type TimerControls, type TimerIntervalHandle, type TimerRafCallback, type TimerRafUnsubscribe, type TimerTimeoutHandle, } from './timer';
7
- export { mousePlugin, type MouseControls, type MouseEventHandler, type MouseUnsubscribe, type MouseWheelHandler, } from './mouse';
8
- export { pointerPlugin, type PointerControls } from './pointer';
9
- export { lerpPlugin, type LerpControls } from './lerp';
10
- export { springPlugin, type SpringControls } from './spring';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC"}