@aegis-framework/pandora 0.6.3 → 0.7.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,29 @@
1
+ /**
2
+ * What a string render keeps from the markup it replaces: the element that
3
+ * had focus and the scroll positions of the elements inside the component.
4
+ *
5
+ * A string render rebuilds the component's content, so every element in it
6
+ * is new and the browser forgets which one had focus and how far each was
7
+ * scrolled. Before the render, Pandora notes how to find each of them again;
8
+ * after it, it finds the new element in the same place and gives it back its
9
+ * focus, text selection and scroll position. lit-html renders update the
10
+ * elements they already have, so they don't need this.
11
+ *
12
+ * An element is found again by its `data-key` attribute, then its `id`, then
13
+ * its position among its parent's children (checked against its tag name).
14
+ * Give elements whose position can change a `data-key`.
15
+ */
16
+ /**
17
+ * Notes the focused element and the scroll positions inside `root`, and
18
+ * returns a function that restores them once the render has replaced the
19
+ * markup. Focus is only given back when the render took it away, so a render
20
+ * never steals focus from elsewhere on the page.
21
+ *
22
+ * @param root - Where the component renders: the element itself, or its shadow root.
23
+ * @param scrolled - The elements inside `root` that have been scrolled.
24
+ * @returns A function to call right after the render.
25
+ *
26
+ * @internal
27
+ */
28
+ export declare const keepFocusAndScroll: (root: ParentNode, scrolled: Set<Element>) => (() => void);
29
+ //# sourceMappingURL=RenderState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderState.d.ts","sourceRoot":"","sources":["../../src/RenderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4GH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,SAAU,UAAU,YAAY,GAAG,CAAC,OAAO,CAAC,KAAG,CAAC,MAAM,IAAI,CAmDxF,CAAC"}
@@ -1,6 +1,6 @@
1
- import { TemplateResult, nothing } from 'lit-html';
2
- import Component from './Component';
3
- import { Style } from './Types';
1
+ import { nothing, type TemplateResult } from 'lit-html';
2
+ import Component from './Component.js';
3
+ import type { Style } from './Types.js';
4
4
  /**
5
5
  * Component subclass that renders into an open shadow root instead of the host
6
6
  * element. Pick it when you need style isolation or slot composition;
@@ -85,6 +85,11 @@ declare class ShadowComponent extends Component {
85
85
  * }
86
86
  */
87
87
  setStyle(style: Style | string, reset?: boolean): Style;
88
+ /**
89
+ * @internal
90
+ * Where a shadow component renders: its shadow root.
91
+ */
92
+ protected _renderRoot(): ParentNode;
88
93
  /**
89
94
  * @internal
90
95
  * Shadow-root variant of the lit-html render hook. Scopes the render target
@@ -1 +1 @@
1
- {"version":3,"file":"ShadowComponent.d.ts","sourceRoot":"","sources":["../../src/ShadowComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,cAAM,eAAgB,SAAQ,SAAS;IACrC;;;;OAIG;IACH,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC;;;;;OAKG;IACH,iBAA0B,WAAW,EAAE,aAAa,GAAG,IAAI,CAAQ;IAEnE;;;OAGG;IACH,iBAA0B,YAAY,EAAE,KAAK,CAAM;IAEnD;;;;;;OAMG;;IAMH;;;;;;;;;;;;;;;;;;;;OAoBG;IACM,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,KAAK;IA2CvE;;;;;OAKG;cACgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,OAAO,GAAG,IAAI;IAIjF;;;;;OAKG;cACgB,gBAAgB,IAAI,IAAI;IAQ3C;;;;;OAKG;cACgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAezD;;;;;;;;;;;;;OAaG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAA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AAE,MAAM,GAAG,IAAI,CAaxD;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,UAAU,EAEhC;IAED;;;;;;;;;;;;;;;;OAgBG;IACM,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAEtE;IAED;;;;;;;;;;;;;;OAcG;IACM,QAAQ,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAE9E;CACF;eAEc,eAAe"}
@@ -7,7 +7,7 @@
7
7
  * against stable DOM: wait for microtask renders to flush, mount a tag into
8
8
  * the document, and reset global Registry state between cases.
9
9
  */
10
- import Component from './Component';
10
+ import Component from './Component.js';
11
11
  /**
12
12
  * Flush pending microtask renders.
13
13
  *
@@ -24,7 +24,7 @@ import Component from './Component';
24
24
  * await flush();
25
25
  * expect(el.textContent).toContain('3');
26
26
  */
27
- export declare function flush(): Promise<void>;
27
+ export declare const flush: () => Promise<void>;
28
28
  /**
29
29
  * Wait until a component reports that it is ready.
30
30
  *
@@ -43,7 +43,7 @@ export declare function flush(): Promise<void>;
43
43
  * const el = document.querySelector('user-avatar')!;
44
44
  * await whenReady(el);
45
45
  */
46
- export declare function whenReady(element: Element, timeout?: number): Promise<void>;
46
+ export declare const whenReady: (element: Element, timeout?: number) => Promise<void>;
47
47
  /**
48
48
  * Reset Registry state between tests.
49
49
  *
@@ -56,7 +56,7 @@ export declare function whenReady(element: Element, timeout?: number): Promise<v
56
56
  * resetRegistry();
57
57
  * });
58
58
  */
59
- export declare function resetRegistry(): void;
59
+ export declare const resetRegistry: () => void;
60
60
  /**
61
61
  * Create a component, append it to the DOM, and wait for it to be ready.
62
62
  *
@@ -70,8 +70,8 @@ export declare function resetRegistry(): void;
70
70
  * @returns The mounted component once it has finished its first render.
71
71
  *
72
72
  * @example
73
- * const el = await mount('my-greeting', document.body, '<span slot="name">Ada</span>');
73
+ * const el = await mount<MyGreeting>('my-greeting', document.body, '<span slot="name">Ada</span>');
74
74
  * expect(el.textContent).toContain('Ada');
75
75
  */
76
- export declare function mount(tagName: string, container?: Element, innerHTML?: string): Promise<Component>;
76
+ export declare const mount: <T extends Component = Component>(tagName: string, container?: Element, innerHTML?: string) => Promise<T>;
77
77
  //# sourceMappingURL=Testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../../src/Testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAYxG"}
1
+ {"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../../src/Testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAGvC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,KAAK,QAAa,OAAO,CAAC,IAAI,CAI1C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO,YAAW,MAAM,KAAU,OAAO,CAAC,IAAI,CAkChF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,QAAO,IAIhC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,KAAK,GAAU,CAAC,SAAS,SAAS,GAAG,SAAS,WAAW,MAAM,cAAc,OAAO,cAAc,MAAM,KAAG,OAAO,CAAC,CAAC,CAYhI,CAAC"}
@@ -47,5 +47,5 @@ export interface TypedState<T> {
47
47
  * state.theme.set('dark');
48
48
  * const unsubscribe = state.user.subscribe(user => console.log(user));
49
49
  */
50
- export declare function createState<T>(key: string, defaultValue?: T): TypedState<T>;
50
+ export declare const createState: <T>(key: string, defaultValue?: T) => TypedState<T>;
51
51
  //# sourceMappingURL=TypedState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypedState.d.ts","sourceRoot":"","sources":["../../src/TypedState.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,gGAAgG;IAChG,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAErB,oFAAoF;IACpF,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAE5F,sEAAsE;IACtE,GAAG,IAAI,OAAO,CAAC;IAEf,qFAAqF;IACrF,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAuB3E"}
1
+ {"version":3,"file":"TypedState.d.ts","sourceRoot":"","sources":["../../src/TypedState.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,gGAAgG;IAChG,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAErB,oFAAoF;IACpF,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAE5F,sEAAsE;IACtE,GAAG,IAAI,OAAO,CAAC;IAEf,qFAAqF;IACrF,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,OAAO,MAAM,iBAAiB,CAAC,KAAG,UAAU,CAAC,CAAC,CAuB1E,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TemplateResult, nothing } from 'lit-html';
1
+ import type { nothing, TemplateResult } from 'lit-html';
2
2
  /**
3
3
  * A single CSS declaration value. Numbers are serialized as-is, so
4
4
  * unitless properties (`zIndex: 2`) and explicit units (`width: '2rem'`)
@@ -48,9 +48,11 @@ export type TemplateFunction = (context: any) => TemplateValue | Promise<Templat
48
48
  * Options accepted by the imperative `reactive()` helper when turning a
49
49
  * plain field into a tracked one.
50
50
  *
51
- * - `initialValue`: seed the field if it has no value yet.
51
+ * - `initialValue`: seed the field if it has no value yet. Without it, the
52
+ * field keeps whatever value it already holds (a class field initializer).
52
53
  * - `render`: set to `false` to opt out of auto-rerender on change.
53
54
  * - `onChange`: callback fired after each write, with new and old values.
55
+ * Unlike `@Watch`, it fires right away even inside `batch()`.
54
56
  * - `equals`: custom equality check; defaults to `===` (strict identity).
55
57
  */
56
58
  export interface Reacti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C;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;CAC9C;AAMD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;CAC7C;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,5 +1,25 @@
1
- import { TemplateResult } from 'lit-html';
2
- import { CSSObject, DecoratorInstance, DecoratorEffect, ReactiveOptions } from './Types';
1
+ import type { TemplateResult } from 'lit-html';
2
+ import type { CSSObject, DecoratorEffect, DecoratorInstance, ReactiveOptions } from './Types.js';
3
+ /** Metadata slot: array of attribute names that `@Attribute` wants observed on the element. @internal */
4
+ export declare const PROP_ATTRIBUTES: unique symbol;
5
+ /** Metadata slot: per-instance effect functions to replay when a class is evolved or lazily registered. @internal */
6
+ export declare const DECORATOR_EFFECTS: unique symbol;
7
+ /** Metadata slot: teardown callbacks attached to an instance so the outgoing class can unwind before an evolve swap. @internal */
8
+ export declare const DECORATOR_TEARDOWNS: unique symbol;
9
+ /** Metadata slot: `@Watch` registrations pairing a watched property name with the handler method name. @internal */
10
+ export declare const WATCH_HANDLERS: unique symbol;
11
+ /** Metadata slot: set of property names declared reactive via `@State`, `@Attribute`, or `@Property` — used to validate `@Watch` targets. @internal */
12
+ export declare const REACTIVE_FIELDS: unique symbol;
13
+ /** Metadata slot: array of `@Listen` registrations describing event name, target resolver, and options. @internal */
14
+ export declare const LISTEN_HANDLERS: unique symbol;
15
+ /** Metadata slot: resolved `@Style` output (stylesheet text and encapsulation hints) attached by the style decorator. @internal */
16
+ export declare const STYLE_METADATA: unique symbol;
17
+ /** Metadata slot: map from observed attribute names to the handlers that sync them into the instance field. @internal */
18
+ export declare const ATTR_HANDLERS: unique symbol;
19
+ /** Metadata slot: per-field `@Subscribe` registrations that wire a store/observable into a property. @internal */
20
+ export declare const SUBSCRIBE_HANDLERS: unique symbol;
21
+ /** Instance slot: attribute writes that wait for the element to connect, keyed by attribute name. @internal */
22
+ export declare const PENDING_ATTRIBUTE_WRITES: unique symbol;
3
23
  /**
4
24
  * Invokes a callback and always returns a Promise, regardless of whether the
5
25
  * callback itself is sync or async. Lets hooks that may or may not be
@@ -7,7 +27,7 @@ import { CSSObject, DecoratorInstance, DecoratorEffect, ReactiveOptions } from '
7
27
  *
8
28
  * @internal
9
29
  */
10
- export declare function callAsync<T>(callable: (...args: any[]) => T, context: any, ...args: any[]): Promise<T>;
30
+ export declare const callAsync: <T>(callable: (...args: any[]) => T, context: any, ...args: any[]) => Promise<T>;
11
31
  /**
12
32
  * Duck-types a value as a lit-html `TemplateResult` by looking for its
13
33
  * `_$litType$` brand. We avoid `instanceof` so the check survives across
@@ -15,7 +35,7 @@ export declare function callAsync<T>(callable: (...args: any[]) => T, context: a
15
35
  *
16
36
  * @internal
17
37
  */
18
- export declare function isTemplateResult(value: unknown): value is TemplateResult;
38
+ export declare const isTemplateResult: (value: unknown) => value is TemplateResult;
19
39
  /**
20
40
  * Flattens a nested `CSSObject` into a CSS string for injection at render
21
41
  * time. When `encapsulation` is a tag selector (light-DOM mode), selectors
@@ -24,46 +44,35 @@ export declare function isTemplateResult(value: unknown): value is TemplateResul
24
44
  *
25
45
  * @internal
26
46
  */
27
- export declare function deserializeCSS(object: CSSObject, encapsulation?: string, level?: number): string;
28
- /** Metadata slot: array of attribute names that `@Attribute` wants observed on the element. @internal */
29
- export declare const PROP_ATTRIBUTES: unique symbol;
30
- /** Metadata slot: per-instance effect functions to replay when a class is evolved or lazily registered. @internal */
31
- export declare const DECORATOR_EFFECTS: unique symbol;
32
- /** Metadata slot: teardown callbacks attached to an instance so the outgoing class can unwind before an evolve swap. @internal */
33
- export declare const DECORATOR_TEARDOWNS: unique symbol;
34
- /** Metadata slot: `@Watch` registrations pairing a watched property name with the handler method name. @internal */
35
- export declare const WATCH_HANDLERS: unique symbol;
36
- /** Metadata slot: set of property names declared reactive via `@State`, `@Attribute`, or `@Property` — used to validate `@Watch` targets. @internal */
37
- export declare const REACTIVE_FIELDS: unique symbol;
38
- /** Metadata slot: array of `@Listen` registrations describing event name, target resolver, and options. @internal */
39
- export declare const LISTEN_HANDLERS: unique symbol;
40
- /** Metadata slot: resolved `@Style` output (stylesheet text and encapsulation hints) attached by the style decorator. @internal */
41
- export declare const STYLE_METADATA: unique symbol;
42
- /** Metadata slot: map from observed attribute names to the handlers that sync them into the instance field. @internal */
43
- export declare const ATTR_HANDLERS: unique symbol;
44
- /** Metadata slot: per-field `@Subscribe` registrations that wire a store/observable into a property. @internal */
45
- export declare const SUBSCRIBE_HANDLERS: unique symbol;
47
+ export declare const deserializeCSS: (object: CSSObject, encapsulation?: string, level?: number) => string;
46
48
  /**
47
- * Register a per-instance effect on a class's metadata.
49
+ * Register a per-instance effect to replay on hot swaps.
48
50
  *
49
- * Custom-decorator authors call this to attach work that should run once
50
- * for each component instance — typically during `connectedCallback`. The
51
- * Registry replays these effects when a class is evolved or lazily
52
- * registered, so your decorator keeps working across hot swaps.
51
+ * The Registry runs these effects on live instances when a class is swapped
52
+ * in with `Registry.evolve()` or a `Registry.lazy()` placeholder loads its
53
+ * real implementation, so a custom decorator keeps working across both.
54
+ * Effects do **not** run when an instance is first constructed: install the
55
+ * same behavior from `context.addInitializer` too, as shown below.
53
56
  *
54
57
  * @param meta - The decorator-context metadata object (`context.metadata`).
55
58
  * @param effect - A function that receives the component instance.
56
59
  *
57
60
  * @example
58
- * function LogMount(): ClassDecorator {
59
- * return (target, context) => {
60
- * addDecoratorEffect(context.metadata, (instance) => {
61
- * console.log(`${instance.tagName} mounted`);
62
- * });
61
+ * function Logged(_target: undefined, context: ClassFieldDecoratorContext) {
62
+ * const propertyKey = String(context.name);
63
+ * const install = (instance: DecoratorInstance) => {
64
+ * reactive(instance, propertyKey, { onChange: (value) => console.log(propertyKey, value) });
63
65
  * };
66
+ *
67
+ * // Replayed by evolve() / lazy() on live instances...
68
+ * addDecoratorEffect(context.metadata, install);
69
+ * // ...and run for every newly constructed instance.
70
+ * context.addInitializer(function () {
71
+ * install(this as DecoratorInstance);
72
+ * });
64
73
  * }
65
74
  */
66
- export declare function addDecoratorEffect(meta: Record<symbol, unknown>, effect: DecoratorEffect): void;
75
+ export declare const addDecoratorEffect: (meta: Record<symbol, unknown>, effect: DecoratorEffect) => void;
67
76
  /**
68
77
  * Register a teardown function for a reactive binding on a component instance.
69
78
  *
@@ -74,53 +83,101 @@ export declare function addDecoratorEffect(meta: Record<symbol, unknown>, effect
74
83
  *
75
84
  * Teardowns registered via this helper do NOT automatically run on
76
85
  * disconnect. If your decorator installs listeners or subscriptions that
77
- * must unwind on disconnect, register them in the decorator effect and
78
- * handle their removal explicitly in that effect's returned cleanup, or
79
- * through the component's own disconnect path.
86
+ * must unwind on disconnect, remove them from the component's own
87
+ * `willUnmount()` / `didUnmount()` path.
80
88
  *
81
89
  * @param instance - The component instance to attach the teardown to.
82
90
  * @param teardown - A function that releases any resources held by the decorator when the class is evolved or replaced.
83
91
  *
84
92
  * @example
85
- * function ResizeAware(): ClassDecorator {
86
- * return (target, context) => {
87
- * addDecoratorEffect(context.metadata, (instance) => {
88
- * const observer = new ResizeObserver(() => {});
89
- * observer.observe(instance);
90
- * // Runs when the class is evolved or lazily replaced, so the
91
- * // incoming implementation can install its own observer cleanly.
92
- * addTeardown(instance, () => observer.disconnect());
93
- * });
94
- * };
93
+ * function applyResizeAware(instance: DecoratorInstance) {
94
+ * const observer = new ResizeObserver(() => {});
95
+ * observer.observe(instance);
96
+ * // Runs when the class is evolved or lazily replaced, so the incoming
97
+ * // implementation can install its own observer cleanly.
98
+ * addTeardown(instance, () => observer.disconnect());
99
+ * }
100
+ */
101
+ export declare const addTeardown: (instance: DecoratorInstance, teardown: () => void) => void;
102
+ /**
103
+ * Writes the attributes an element couldn't have while it was constructed.
104
+ * `document.createElement()` throws when a new element already has
105
+ * attributes, so `@Attribute` and `@Property({ attribute })` defaults wait
106
+ * for `connectedCallback`, which calls this before the first render.
107
+ *
108
+ * @internal
109
+ */
110
+ export declare const writePendingAttributes: (instance: object) => void;
111
+ /**
112
+ * The names of a component class's reactive fields: the ones declared with
113
+ * `@State`, `@Property` or `@Attribute`, inherited ones included. Fields made
114
+ * reactive at runtime with `reactive()` aren't listed, since they belong to
115
+ * an instance, not to the class.
116
+ *
117
+ * Use it to check a class against a contract (does it declare `value`?),
118
+ * to build tooling, or to warn about a name before an instance exists.
119
+ *
120
+ * @param componentClass - A component class, decorated or not.
121
+ * @returns A new set of field names; empty when the class declares none.
122
+ *
123
+ * @example
124
+ * class Counter extends Component {
125
+ * @State() count = 0;
126
+ * @Attribute() step = 1;
95
127
  * }
128
+ *
129
+ * reactiveFields(Counter); // Set { 'count', 'step' }
96
130
  */
97
- export declare function addTeardown(instance: DecoratorInstance, teardown: () => void): void;
131
+ export declare const reactiveFields: (componentClass: abstract new (...args: any[]) => unknown) => Set<string>;
132
+ /**
133
+ * One reactive write recorded while a `batch()` is open.
134
+ *
135
+ * @internal
136
+ */
137
+ export interface BatchedChange {
138
+ property: string;
139
+ oldValue: unknown;
140
+ newValue: unknown;
141
+ shouldRender: boolean;
142
+ source: string;
143
+ }
144
+ /**
145
+ * Records a reactive write made inside `batch()` so its `@Watch` callbacks
146
+ * and `didChange` run once when the batch closes. Repeated writes to the
147
+ * same field collapse into a single first-to-last change. Returns `false`
148
+ * (recording nothing) when the instance isn't batching, so the caller
149
+ * notifies right away instead.
150
+ *
151
+ * @internal
152
+ */
153
+ export declare const recordBatchedChange: (instance: object, change: BatchedChange) => boolean;
98
154
  /**
99
155
  * Make a plain field on a component instance reactive at runtime.
100
156
  *
101
157
  * This is the imperative escape hatch for `@State`: use it when you cannot
102
158
  * reach for decorators (for example, in environments without decorator
103
159
  * support, or when wiring up a field from a constructor or custom
104
- * decorator). The field keeps its current value, but writes now trigger
105
- * `@Watch` handlers, `didChange`, and an auto-rerender unless you opt out.
160
+ * decorator). The field keeps its current value (unless you pass
161
+ * `initialValue`), but writes now trigger `@Watch` handlers, `didChange`,
162
+ * and an auto-rerender unless you opt out. Writes inside `batch()` defer
163
+ * `@Watch` and `didChange` until the batch closes, like decorated fields.
106
164
  *
107
165
  * @param instance - The component instance that owns the field.
108
166
  * @param propertyKey - The field name to make reactive.
109
167
  * @param options - Optional initial value, change callback, equality check, or `render: false` to skip auto-rerender.
110
168
  *
111
169
  * @example
112
- * // A custom field decorator that installs reactivity at runtime, so the
113
- * // author doesn't have to compose it with @State at every call site.
114
- * function Counter(initialValue: number = 0): (target: undefined, context: ClassFieldDecoratorContext) => void {
115
- * return (_target, context) => {
116
- * const propertyKey = String(context.name);
117
- * addDecoratorEffect(context.metadata, (instance) => {
118
- * reactive(instance, propertyKey, { initialValue });
119
- * });
120
- * };
170
+ * // Without decorators: make a plain field reactive from the constructor.
171
+ * class MyCounter extends Component {
172
+ * count = 0;
173
+ *
174
+ * constructor() {
175
+ * super();
176
+ * reactive(this, 'count'); // keeps the initial 0, re-renders on change
177
+ * }
121
178
  * }
122
179
  */
123
- export declare function reactive(instance: DecoratorInstance, propertyKey: string, options?: ReactiveOptions): void;
180
+ export declare const reactive: (instance: DecoratorInstance, propertyKey: string, options?: ReactiveOptions) => void;
124
181
  /**
125
182
  * Coerces a raw attribute string into its JavaScript value: `null` becomes
126
183
  * `undefined`, the empty string and `"true"` become `true`, `"false"` becomes
@@ -129,7 +186,7 @@ export declare function reactive(instance: DecoratorInstance, propertyKey: strin
129
186
  *
130
187
  * @internal
131
188
  */
132
- export declare function parseAttributeValue(value: string | null): unknown;
189
+ export declare const parseAttributeValue: (value: string | null) => unknown;
133
190
  /**
134
191
  * Resolves the `target` option of `@Listen` to an actual `EventTarget`. The
135
192
  * strings `"window"` and `"document"` map to their globals, `"self"` (or an
@@ -140,5 +197,5 @@ export declare function parseAttributeValue(value: string | null): unknown;
140
197
  *
141
198
  * @internal
142
199
  */
143
- export declare function resolveListenerTarget(host: HTMLElement, targetOption?: string, query?: (selector: string) => Element | null): EventTarget | null;
200
+ export declare const resolveListenerTarget: (host: HTMLElement, targetOption?: string, query?: (selector: string) => Element | null) => EventTarget | null;
144
201
  //# sourceMappingURL=Util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/Util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAOtG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,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AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,GAAG,IAAI,KAAG,OAwB1D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,SAC1B,WAAW,iBACF,MAAM,UACb,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,KAC3C,WAAW,GAAG,IAchB,CAAC"}
@@ -12,7 +12,7 @@
12
12
  * bundlers cannot yet expose an ESM module as a browser global on their
13
13
  * own; once/if Bun grows that capability, the file can go away.
14
14
  */
15
- import * as Pandora from './index';
15
+ import * as Pandora from './index.js';
16
16
  declare global {
17
17
  interface Window {
18
18
  Pandora: typeof Pandora;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,OAAO,OAAO,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,OAAO,OAAO,CAAC;KACzB;CACF"}
@@ -1,16 +1,7 @@
1
- import Component from './Component';
2
- import ShadowComponent from './ShadowComponent';
3
- import Registry from './Registry';
4
- import { Register, Subscribe, Attribute, Property, State, Computed, Watch, Query, QueryAll, Slot, Listen, Emitter, Style, ClassList } from './Decorators';
5
- import { reactive, addDecoratorEffect, addTeardown } from './Util';
6
- import { createState } from './TypedState';
7
- import * as testing from './Testing';
8
- import * as Util from './Util';
9
- import * as Types from './Types';
10
- import { html, svg, nothing, noChange, render } from 'lit-html';
11
- import { directive, Directive, PartType } from 'lit-html/directive.js';
1
+ import { html, noChange, nothing, render, svg } from 'lit-html';
12
2
  import { AsyncDirective } from 'lit-html/async-directive.js';
13
- import { isPrimitive, isTemplateResult, isCompiledTemplateResult, isDirectiveResult, getDirectiveClass, isSingleExpression, insertPart, setChildPartValue, setCommittedValue, getCommittedValue, removePart, clearPart, TemplateResultType } from 'lit-html/directive-helpers.js';
3
+ import { clearPart, getCommittedValue, getDirectiveClass, insertPart, isCompiledTemplateResult, isDirectiveResult, isPrimitive, isSingleExpression, isTemplateResult, removePart, setChildPartValue, setCommittedValue, TemplateResultType } from 'lit-html/directive-helpers.js';
4
+ import { Directive, directive, PartType } from 'lit-html/directive.js';
14
5
  import { asyncAppend } from 'lit-html/directives/async-append.js';
15
6
  import { asyncReplace } from 'lit-html/directives/async-replace.js';
16
7
  import { cache } from 'lit-html/directives/cache.js';
@@ -23,20 +14,30 @@ import { keyed } from 'lit-html/directives/keyed.js';
23
14
  import { live } from 'lit-html/directives/live.js';
24
15
  import { map } from 'lit-html/directives/map.js';
25
16
  import { range } from 'lit-html/directives/range.js';
26
- import { ref, createRef } from 'lit-html/directives/ref.js';
17
+ import { createRef, ref } from 'lit-html/directives/ref.js';
27
18
  import { repeat } from 'lit-html/directives/repeat.js';
28
19
  import { styleMap } from 'lit-html/directives/style-map.js';
29
20
  import { templateContent } from 'lit-html/directives/template-content.js';
30
21
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
31
- import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';
32
22
  import { unsafeMathML } from 'lit-html/directives/unsafe-mathml.js';
23
+ import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';
33
24
  import { until } from 'lit-html/directives/until.js';
34
25
  import { when } from 'lit-html/directives/when.js';
26
+ import Component from './Component.js';
27
+ import { Attribute, ClassList, Computed, Emitter, Listen, Property, Query, QueryAll, Register, Slot, State, Style, Subscribe, Watch } from './Decorators.js';
28
+ import Registry, { VERSION } from './Registry.js';
29
+ import ShadowComponent from './ShadowComponent.js';
30
+ import * as testing from './Testing.js';
31
+ import { createState } from './TypedState.js';
32
+ import * as Types from './Types.js';
33
+ import { addDecoratorEffect, addTeardown, reactive, reactiveFields } from './Util.js';
34
+ import * as Util from './Util.js';
35
35
  export { Component, ShadowComponent, Registry };
36
+ export { VERSION };
36
37
  export { Register, Subscribe, Attribute, Property, State, Computed, Watch, Query, QueryAll, Slot, Listen, Emitter, Style, ClassList };
37
- export { reactive, addDecoratorEffect, addTeardown };
38
+ export { reactive, reactiveFields, addDecoratorEffect, addTeardown };
38
39
  export { createState };
39
- export type { TypedState } from './TypedState';
40
+ export type { TypedState } from './TypedState.js';
40
41
  export { testing };
41
42
  export { html, svg, nothing, noChange, render };
42
43
  export { asyncAppend, asyncReplace, cache, choose, classMap, guard, ifDefined, join, keyed, live, map, range, ref, createRef, repeat, styleMap, templateContent, unsafeHTML, unsafeSVG, unsafeMathML, until, when, };
@@ -45,5 +46,7 @@ export { isPrimitive, isTemplateResult, isCompiledTemplateResult, isDirectiveRes
45
46
  export type { TemplateResult, SVGTemplateResult, RenderOptions } from 'lit-html';
46
47
  export type { DirectiveClass, DirectiveResult, DirectiveParameters, PartInfo, ChildPartInfo, AttributePartInfo, ElementPartInfo, Part, ChildPart, AttributePart, BooleanAttributePart, ElementPart, EventPart, PropertyPart, } from 'lit-html/directive.js';
47
48
  export { Util, Types };
48
- export type { Style as StyleObject, CSSValue, CSSProperties, CSSObject, TemplateValue, TemplateFunction, ReactiveOptions, DecoratorInstance, DecoratorEffect, } from './Types';
49
+ export type { Style as StyleObject, CSSValue, CSSProperties, CSSObject, TemplateValue, TemplateFunction, ReactiveOptions, DecoratorInstance, DecoratorEffect, } from './Types.js';
50
+ export type { RegisterOptions, StateOptions, PropertyOptions, AttributeOptions, ListenOptions, ClassListMap, } from './Decorators.js';
51
+ export type { StateSubscriber, LifecycleCallback, ErrorCallback, MiddlewareType, RenderType, Middleware, ComponentLoader, ComponentStats, RegisteredCopy, } from './Registry.js';
49
52
  //# sourceMappingUR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