@mintjamsinc/ichigojs 0.1.66 → 0.1.68
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/ichigo.cjs +260 -17
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +260 -17
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +260 -17
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/dist/types/ichigo/VApplicationOptions.d.ts +7 -0
- package/dist/types/ichigo/VBindings.d.ts +7 -0
- package/dist/types/ichigo/VEmitOptions.d.ts +27 -0
- package/dist/types/ichigo/directives/VOnDirective.d.ts +9 -0
- package/dist/types/ichigo/util/ReactiveProxy.d.ts +47 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -39,6 +39,13 @@ export interface VApplicationOptions {
|
|
|
39
39
|
* and the value is either a callback function or an options object with handler, deep, and immediate properties.
|
|
40
40
|
*/
|
|
41
41
|
watch?: WatcherDictionary;
|
|
42
|
+
/**
|
|
43
|
+
* Optional list of event names this application/component is expected to emit via `$emit`.
|
|
44
|
+
* When declared, emitting an event whose name is not in this list logs a development warning.
|
|
45
|
+
* When omitted, `$emit` accepts any event name without warning. This is documentation/validation
|
|
46
|
+
* only and never blocks dispatch.
|
|
47
|
+
*/
|
|
48
|
+
emits?: string[];
|
|
42
49
|
/**
|
|
43
50
|
* The log level for the application.
|
|
44
51
|
* This property determines the verbosity of logging output.
|
|
@@ -56,6 +56,13 @@ export declare class VBindings {
|
|
|
56
56
|
* @param key The binding name.
|
|
57
57
|
*/
|
|
58
58
|
remove(key: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Releases all external proxy subscriptions held by these bindings.
|
|
61
|
+
* Should be called when the owning application is unmounted so the parent
|
|
62
|
+
* application's reactive objects do not keep references to listener closures
|
|
63
|
+
* (and through them, this bindings instance) alive.
|
|
64
|
+
*/
|
|
65
|
+
destroy(): void;
|
|
59
66
|
/**
|
|
60
67
|
* Sets a binding value without triggering onChange callback.
|
|
61
68
|
* This is useful for internal updates that shouldn't trigger reactivity.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for `$emit`, controlling how the underlying CustomEvent is dispatched.
|
|
3
|
+
*/
|
|
4
|
+
export interface VEmitOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the event bubbles up through the DOM. Default is true.
|
|
7
|
+
* Bubbling lets a parent component listen with `v-on` / `@` on the component tag,
|
|
8
|
+
* because the application root is dispatched from inside the host custom element.
|
|
9
|
+
*/
|
|
10
|
+
bubbles?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the event is cancelable (i.e. `preventDefault()` has an effect).
|
|
13
|
+
* Default is true. `$emit` returns false when a listener called `preventDefault()`.
|
|
14
|
+
*/
|
|
15
|
+
cancelable?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the event propagates across shadow DOM boundaries. Default is false.
|
|
18
|
+
* ichigo.js components use Light DOM, so this is rarely needed.
|
|
19
|
+
*/
|
|
20
|
+
composed?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The target the event is dispatched on. Defaults to the application root element.
|
|
23
|
+
* Set this to `document` or `window` to use a global event bus, or to a specific
|
|
24
|
+
* element for element-scoped dispatch.
|
|
25
|
+
*/
|
|
26
|
+
target?: EventTarget;
|
|
27
|
+
}
|
|
@@ -18,6 +18,15 @@ import { VDOMUpdater } from "../VDOMUpdater";
|
|
|
18
18
|
* Mouse button modifiers (MouseEvent): `.left`, `.middle`, `.right`.
|
|
19
19
|
* System modifiers (KeyboardEvent and MouseEvent): `.shift`, `.ctrl`, `.alt`, `.meta`, plus `.exact` to require that no other system modifiers are held.
|
|
20
20
|
*
|
|
21
|
+
* Listen target and filter modifiers (two orthogonal axes):
|
|
22
|
+
* - Listen target (where the listener is attached): `.window`, `.document`. When omitted the listener
|
|
23
|
+
* is attached to the bound element. This is useful for global / cross-component events, e.g.
|
|
24
|
+
* `@webtop-message.document="onMessage"`, and the listener is removed automatically on unmount.
|
|
25
|
+
* - Filter (whether the handler runs): `.self` fires only when `event.target` is the bound element;
|
|
26
|
+
* `.outside` fires only when `event.target` is outside the bound element (e.g. click-outside to
|
|
27
|
+
* close a popup). `.outside` implies listening on `document` (capture phase) even without `.document`,
|
|
28
|
+
* and `.self` / `.outside` are mutually exclusive.
|
|
29
|
+
*
|
|
21
30
|
* Additionally, this directive supports lifecycle hooks:
|
|
22
31
|
* @mount="onMount" - Called before the VNode is mounted to the DOM element
|
|
23
32
|
* @mounted="onMounted" - Called after the VNode is mounted to the DOM element
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A listener notified when something changes inside a reactive subtree.
|
|
3
|
+
* Receives the full source path of the changed property (e.g. "items[0].name").
|
|
4
|
+
*/
|
|
5
|
+
type ReactiveListener = (changedPath?: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* A dispatcher owns the set of listeners attached to a given proxy subtree.
|
|
8
|
+
* The same dispatcher instance is shared by every nested proxy reached
|
|
9
|
+
* through a single outermost create() call, so changes at any depth fan out
|
|
10
|
+
* to every subscriber once.
|
|
11
|
+
*/
|
|
12
|
+
type ReactiveDispatcher = {
|
|
13
|
+
listeners: Set<ReactiveListener>;
|
|
14
|
+
};
|
|
1
15
|
/**
|
|
2
16
|
* Utility class for creating reactive proxies that automatically track changes.
|
|
3
17
|
*/
|
|
@@ -22,6 +36,13 @@ export declare class ReactiveProxy {
|
|
|
22
36
|
* This allows retrieving the source path of an object for computed property mapping.
|
|
23
37
|
*/
|
|
24
38
|
private static proxyPaths;
|
|
39
|
+
/**
|
|
40
|
+
* Dispatchers per (target, path). Every target reached while walking a proxy
|
|
41
|
+
* subtree registers an entry pointing at the same dispatcher as the outermost
|
|
42
|
+
* proxy of that subtree, so callers can look up the dispatcher from any
|
|
43
|
+
* intermediate proxy when subscribing.
|
|
44
|
+
*/
|
|
45
|
+
private static dispatchers;
|
|
25
46
|
/**
|
|
26
47
|
* A Map to store path aliases.
|
|
27
48
|
* Key: alias path (e.g., "editingNestedStep.steps")
|
|
@@ -36,9 +57,33 @@ export declare class ReactiveProxy {
|
|
|
36
57
|
* @param target The object to make reactive.
|
|
37
58
|
* @param onChange Callback function to call when the object changes. Receives the full path of the changed property.
|
|
38
59
|
* @param path The current path in the object tree (used internally for nested objects).
|
|
60
|
+
* @param inheritedDispatcher Internal: the dispatcher inherited from an enclosing create() call when wrapping a nested target. External callers must omit this.
|
|
39
61
|
* @returns A reactive proxy of the target object.
|
|
40
62
|
*/
|
|
41
|
-
static create<T extends object>(target: T, onChange
|
|
63
|
+
static create<T extends object>(target: T, onChange?: (changedPath?: string) => void, path?: string, inheritedDispatcher?: ReactiveDispatcher): T;
|
|
64
|
+
/**
|
|
65
|
+
* Looks up the dispatcher associated with (target, path), or installs a new one.
|
|
66
|
+
* When called for a nested target during proxy walking, the enclosing dispatcher
|
|
67
|
+
* is reused so a single subtree fans out changes through one notification path.
|
|
68
|
+
*/
|
|
69
|
+
private static resolveDispatcher;
|
|
70
|
+
/**
|
|
71
|
+
* Invokes every listener attached to the dispatcher.
|
|
72
|
+
* Iterates a snapshot of the listener set so unsubscribing during dispatch is safe.
|
|
73
|
+
*/
|
|
74
|
+
private static dispatch;
|
|
75
|
+
/**
|
|
76
|
+
* Subscribes a listener to changes inside the subtree of an existing reactive proxy.
|
|
77
|
+
*
|
|
78
|
+
* The listener is scoped by the proxy's source path: only changes at or below that
|
|
79
|
+
* path are delivered, which lets a child component receive notifications when the
|
|
80
|
+
* nested contents of a prop change even though the prop reference itself is unchanged.
|
|
81
|
+
*
|
|
82
|
+
* @param proxyOrTarget A proxy returned from create(), or the underlying target object.
|
|
83
|
+
* @param listener Called with the full source path of every relevant change.
|
|
84
|
+
* @returns A function that removes the subscription.
|
|
85
|
+
*/
|
|
86
|
+
static subscribe(proxyOrTarget: object, listener: ReactiveListener): () => void;
|
|
42
87
|
/**
|
|
43
88
|
* Checks if the given object is a reactive proxy.
|
|
44
89
|
*
|
|
@@ -118,3 +163,4 @@ export declare class ReactiveProxy {
|
|
|
118
163
|
*/
|
|
119
164
|
static doesChangeMatchIdentifier(changePath: string, identifier: string): boolean;
|
|
120
165
|
}
|
|
166
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export { ExpressionUtils } from './ichigo/util/ExpressionUtils';
|
|
|
6
6
|
export { defineComponent } from './ichigo/components/defineComponent';
|
|
7
7
|
export type { IchigoComponentOptions } from './ichigo/components/IchigoComponentOptions';
|
|
8
8
|
export { IchigoElement } from './ichigo/components/IchigoElement';
|
|
9
|
+
export type { VEmitOptions } from './ichigo/VEmitOptions';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintjamsinc/ichigojs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.68",
|
|
4
4
|
"description": "ichigo.js - Simple and intuitive reactive framework. Lightweight, fast, and user-friendly virtual DOM library",
|
|
5
5
|
"main": "./dist/ichigo.cjs",
|
|
6
6
|
"module": "./dist/ichigo.esm.js",
|