dalila 1.8.3 → 1.9.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.
- package/README.md +6 -0
- package/dist/cli/routes-generator.js +1 -2
- package/dist/components/ui/dialog/index.d.ts +0 -8
- package/dist/components/ui/dialog/index.js +2 -41
- package/dist/components/ui/dialog/internal.d.ts +5 -0
- package/dist/{componentes/ui/dialog/index.js → components/ui/dialog/internal.js} +1 -23
- package/dist/components/ui/drawer/index.js +2 -2
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/core/dev.d.ts +11 -2
- package/dist/core/dev.js +26 -2
- package/dist/core/devtools.d.ts +65 -0
- package/dist/core/devtools.js +452 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/query.js +9 -7
- package/dist/core/resource.d.ts +23 -171
- package/dist/core/resource.js +178 -15
- package/dist/core/scope.js +3 -0
- package/dist/core/signal.js +40 -3
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1 -1
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/runtime/bind.d.ts +10 -0
- package/dist/runtime/bind.js +413 -62
- package/package.json +4 -2
- package/dist/componentes/ui/accordion/index.d.ts +0 -2
- package/dist/componentes/ui/accordion/index.js +0 -114
- package/dist/componentes/ui/calendar/index.d.ts +0 -2
- package/dist/componentes/ui/calendar/index.js +0 -132
- package/dist/componentes/ui/combobox/index.d.ts +0 -2
- package/dist/componentes/ui/combobox/index.js +0 -161
- package/dist/componentes/ui/dialog/index.d.ts +0 -10
- package/dist/componentes/ui/drawer/index.d.ts +0 -2
- package/dist/componentes/ui/drawer/index.js +0 -41
- package/dist/componentes/ui/dropdown/index.d.ts +0 -2
- package/dist/componentes/ui/dropdown/index.js +0 -48
- package/dist/componentes/ui/dropzone/index.d.ts +0 -2
- package/dist/componentes/ui/dropzone/index.js +0 -92
- package/dist/componentes/ui/env.d.ts +0 -1
- package/dist/componentes/ui/env.js +0 -2
- package/dist/componentes/ui/index.d.ts +0 -13
- package/dist/componentes/ui/index.js +0 -12
- package/dist/componentes/ui/popover/index.d.ts +0 -2
- package/dist/componentes/ui/popover/index.js +0 -156
- package/dist/componentes/ui/runtime.d.ts +0 -20
- package/dist/componentes/ui/runtime.js +0 -421
- package/dist/componentes/ui/tabs/index.d.ts +0 -3
- package/dist/componentes/ui/tabs/index.js +0 -101
- package/dist/componentes/ui/toast/index.d.ts +0 -3
- package/dist/componentes/ui/toast/index.js +0 -115
- package/dist/componentes/ui/ui-types.d.ts +0 -175
- package/dist/componentes/ui/ui-types.js +0 -1
- package/dist/componentes/ui/validate.d.ts +0 -7
- package/dist/componentes/ui/validate.js +0 -71
- package/dist/core/store.d.ts +0 -130
- package/dist/core/store.js +0 -234
- package/dist/core/virtual.d.ts +0 -26
- package/dist/core/virtual.js +0 -277
- package/dist/core/watch-testing.d.ts +0 -13
- package/dist/core/watch-testing.js +0 -16
- package/dist/router/route.d.ts +0 -23
- package/dist/router/route.js +0 -48
- package/dist/simple.d.ts +0 -11
- package/dist/simple.js +0 -11
- package/dist/ui/accordion.d.ts +0 -2
- package/dist/ui/accordion.js +0 -114
- package/dist/ui/calendar.d.ts +0 -2
- package/dist/ui/calendar.js +0 -132
- package/dist/ui/combobox.d.ts +0 -2
- package/dist/ui/combobox.js +0 -161
- package/dist/ui/dialog.d.ts +0 -10
- package/dist/ui/dialog.js +0 -54
- package/dist/ui/drawer.d.ts +0 -2
- package/dist/ui/drawer.js +0 -41
- package/dist/ui/dropdown.d.ts +0 -2
- package/dist/ui/dropdown.js +0 -48
- package/dist/ui/dropzone.d.ts +0 -2
- package/dist/ui/dropzone.js +0 -92
- package/dist/ui/env.d.ts +0 -1
- package/dist/ui/env.js +0 -2
- package/dist/ui/index.d.ts +0 -13
- package/dist/ui/index.js +0 -12
- package/dist/ui/popover.d.ts +0 -2
- package/dist/ui/popover.js +0 -156
- package/dist/ui/runtime.d.ts +0 -20
- package/dist/ui/runtime.js +0 -421
- package/dist/ui/tabs.d.ts +0 -3
- package/dist/ui/tabs.js +0 -101
- package/dist/ui/toast.d.ts +0 -3
- package/dist/ui/toast.js +0 -115
- package/dist/ui/ui-types.d.ts +0 -175
- package/dist/ui/ui-types.js +0 -1
- package/dist/ui/validate.d.ts +0 -7
- package/dist/ui/validate.js +0 -71
package/README.md
CHANGED
|
@@ -94,6 +94,12 @@ bind(document.getElementById('app')!, ctx);
|
|
|
94
94
|
- [Scheduler](./docs/core/scheduler.md) — Batching and coordination
|
|
95
95
|
- [Keys](./docs/core/key.md) — Cache key encoding
|
|
96
96
|
- [Dev Mode](./docs/core/dev.md) — Warnings and helpers
|
|
97
|
+
- [Devtools Extension](./devtools-extension/README.md) — Browser panel for reactive graph and scopes
|
|
98
|
+
|
|
99
|
+
Firefox extension workflows:
|
|
100
|
+
|
|
101
|
+
- `npm run devtools:firefox:run` — launch Firefox with extension loaded for dev
|
|
102
|
+
- `npm run devtools:firefox:build` — package extension artifact for submission/signing
|
|
97
103
|
|
|
98
104
|
## Features
|
|
99
105
|
|
|
@@ -969,8 +969,7 @@ function generateRouteObject(node, depth = 0) {
|
|
|
969
969
|
export async function generateRoutesFile(routesDir, outputPath) {
|
|
970
970
|
console.log('🔍 Scanning app directory:', routesDir);
|
|
971
971
|
if (!await pathExists(routesDir)) {
|
|
972
|
-
|
|
973
|
-
process.exit(1);
|
|
972
|
+
throw new Error(`Routes directory not found: ${routesDir}`);
|
|
974
973
|
}
|
|
975
974
|
const tree = await buildRouteTree(routesDir, '', '');
|
|
976
975
|
const projectRoot = await findProjectRoot(routesDir) ?? process.cwd();
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import { type Signal } from "../../../core/signal.js";
|
|
2
1
|
import type { Dialog, DialogOptions } from "../ui-types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Shared dialog behavior — used by both createDialog and createDrawer.
|
|
5
|
-
*/
|
|
6
|
-
export declare function _attachDialogBehavior(el: HTMLDialogElement, open: Signal<boolean>, closeFn: () => void, opts: {
|
|
7
|
-
closeOnBackdrop: boolean;
|
|
8
|
-
closeOnEscape: boolean;
|
|
9
|
-
}): void;
|
|
10
2
|
export declare function createDialog(options?: DialogOptions): Dialog;
|
|
@@ -1,45 +1,6 @@
|
|
|
1
1
|
import { signal } from "../../../core/signal.js";
|
|
2
|
-
import { getCurrentScope } from "../../../core/scope.js";
|
|
3
2
|
import { validateDialogOptions } from "../validate.js";
|
|
4
|
-
|
|
5
|
-
* Shared dialog behavior — used by both createDialog and createDrawer.
|
|
6
|
-
*/
|
|
7
|
-
export function _attachDialogBehavior(el, open, closeFn, opts) {
|
|
8
|
-
const scope = getCurrentScope();
|
|
9
|
-
// Sync signal → native dialog
|
|
10
|
-
const unsub = open.on((isOpen) => {
|
|
11
|
-
if (isOpen && !el.open)
|
|
12
|
-
el.showModal();
|
|
13
|
-
else if (!isOpen && el.open)
|
|
14
|
-
el.close();
|
|
15
|
-
});
|
|
16
|
-
// Native close event → sync signal
|
|
17
|
-
const onClose = () => open.set(false);
|
|
18
|
-
el.addEventListener("close", onClose);
|
|
19
|
-
// Backdrop click
|
|
20
|
-
const onBackdropClick = (e) => {
|
|
21
|
-
if (opts.closeOnBackdrop && e.target === el)
|
|
22
|
-
closeFn();
|
|
23
|
-
};
|
|
24
|
-
el.addEventListener("click", onBackdropClick);
|
|
25
|
-
// Escape key
|
|
26
|
-
if (!opts.closeOnEscape) {
|
|
27
|
-
const onCancel = (e) => e.preventDefault();
|
|
28
|
-
el.addEventListener("cancel", onCancel);
|
|
29
|
-
if (scope) {
|
|
30
|
-
scope.onCleanup(() => el.removeEventListener("cancel", onCancel));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// ARIA
|
|
34
|
-
el.setAttribute("aria-modal", "true");
|
|
35
|
-
if (scope) {
|
|
36
|
-
scope.onCleanup(() => {
|
|
37
|
-
unsub();
|
|
38
|
-
el.removeEventListener("close", onClose);
|
|
39
|
-
el.removeEventListener("click", onBackdropClick);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
3
|
+
import { attachDialogBehavior } from "./internal.js";
|
|
43
4
|
export function createDialog(options = {}) {
|
|
44
5
|
validateDialogOptions(options);
|
|
45
6
|
const { closeOnBackdrop = true, closeOnEscape = true } = options;
|
|
@@ -48,7 +9,7 @@ export function createDialog(options = {}) {
|
|
|
48
9
|
const close = () => open.set(false);
|
|
49
10
|
const toggle = () => open.update((v) => !v);
|
|
50
11
|
const _attachTo = (el) => {
|
|
51
|
-
|
|
12
|
+
attachDialogBehavior(el, open, close, { closeOnBackdrop, closeOnEscape });
|
|
52
13
|
};
|
|
53
14
|
return { open, show, close, toggle, _attachTo };
|
|
54
15
|
}
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import { signal } from "../../../core/signal.js";
|
|
2
1
|
import { getCurrentScope } from "../../../core/scope.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Shared dialog behavior — used by both createDialog and createDrawer.
|
|
6
|
-
*/
|
|
7
|
-
export function _attachDialogBehavior(el, open, closeFn, opts) {
|
|
2
|
+
export function attachDialogBehavior(el, open, closeFn, opts) {
|
|
8
3
|
const scope = getCurrentScope();
|
|
9
|
-
// Sync signal → native dialog
|
|
10
4
|
const unsub = open.on((isOpen) => {
|
|
11
5
|
if (isOpen && !el.open)
|
|
12
6
|
el.showModal();
|
|
13
7
|
else if (!isOpen && el.open)
|
|
14
8
|
el.close();
|
|
15
9
|
});
|
|
16
|
-
// Native close event → sync signal
|
|
17
10
|
const onClose = () => open.set(false);
|
|
18
11
|
el.addEventListener("close", onClose);
|
|
19
|
-
// Backdrop click
|
|
20
12
|
const onBackdropClick = (e) => {
|
|
21
13
|
if (opts.closeOnBackdrop && e.target === el)
|
|
22
14
|
closeFn();
|
|
23
15
|
};
|
|
24
16
|
el.addEventListener("click", onBackdropClick);
|
|
25
|
-
// Escape key
|
|
26
17
|
if (!opts.closeOnEscape) {
|
|
27
18
|
const onCancel = (e) => e.preventDefault();
|
|
28
19
|
el.addEventListener("cancel", onCancel);
|
|
@@ -30,7 +21,6 @@ export function _attachDialogBehavior(el, open, closeFn, opts) {
|
|
|
30
21
|
scope.onCleanup(() => el.removeEventListener("cancel", onCancel));
|
|
31
22
|
}
|
|
32
23
|
}
|
|
33
|
-
// ARIA
|
|
34
24
|
el.setAttribute("aria-modal", "true");
|
|
35
25
|
if (scope) {
|
|
36
26
|
scope.onCleanup(() => {
|
|
@@ -40,15 +30,3 @@ export function _attachDialogBehavior(el, open, closeFn, opts) {
|
|
|
40
30
|
});
|
|
41
31
|
}
|
|
42
32
|
}
|
|
43
|
-
export function createDialog(options = {}) {
|
|
44
|
-
validateDialogOptions(options);
|
|
45
|
-
const { closeOnBackdrop = true, closeOnEscape = true } = options;
|
|
46
|
-
const open = signal(false);
|
|
47
|
-
const show = () => open.set(true);
|
|
48
|
-
const close = () => open.set(false);
|
|
49
|
-
const toggle = () => open.update((v) => !v);
|
|
50
|
-
const _attachTo = (el) => {
|
|
51
|
-
_attachDialogBehavior(el, open, close, { closeOnBackdrop, closeOnEscape });
|
|
52
|
-
};
|
|
53
|
-
return { open, show, close, toggle, _attachTo };
|
|
54
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { signal } from "../../../core/signal.js";
|
|
2
2
|
import { getCurrentScope } from "../../../core/scope.js";
|
|
3
|
-
import {
|
|
3
|
+
import { attachDialogBehavior } from "../dialog/internal.js";
|
|
4
4
|
import { validateDrawerOptions } from "../validate.js";
|
|
5
5
|
const SIDE_CLASSES = {
|
|
6
6
|
right: "",
|
|
@@ -18,7 +18,7 @@ export function createDrawer(options = {}) {
|
|
|
18
18
|
const _attachTo = (el) => {
|
|
19
19
|
const scope = getCurrentScope();
|
|
20
20
|
// Shared dialog behavior (open sync, backdrop, escape, ARIA)
|
|
21
|
-
|
|
21
|
+
attachDialogBehavior(el, open, close, { closeOnBackdrop, closeOnEscape });
|
|
22
22
|
// Apply initial side class
|
|
23
23
|
const initial = SIDE_CLASSES[side()];
|
|
24
24
|
if (initial)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./ui-types.js";
|
|
2
|
-
export { createDialog
|
|
2
|
+
export { createDialog } from "./dialog/index.js";
|
|
3
3
|
export { createDrawer } from "./drawer/index.js";
|
|
4
4
|
export { createToast, toastIcon } from "./toast/index.js";
|
|
5
5
|
export { createTabs, tabBindings } from "./tabs/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./ui-types.js";
|
|
2
|
-
export { createDialog
|
|
2
|
+
export { createDialog } from "./dialog/index.js";
|
|
3
3
|
export { createDrawer } from "./drawer/index.js";
|
|
4
4
|
export { createToast, toastIcon } from "./toast/index.js";
|
|
5
5
|
export { createTabs, tabBindings } from "./tabs/index.js";
|
package/dist/core/dev.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { DevtoolsEvent, DevtoolsRuntimeOptions, DevtoolsSnapshot } from "./devtools.js";
|
|
1
2
|
export declare function setDevMode(enabled: boolean): void;
|
|
2
3
|
export declare function isInDevMode(): boolean;
|
|
4
|
+
export interface InitDevToolsOptions extends DevtoolsRuntimeOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare function setDevtoolsEnabled(enabled: boolean, options?: DevtoolsRuntimeOptions): void;
|
|
7
|
+
export declare function isDevtoolsEnabled(): boolean;
|
|
8
|
+
export declare function configureDevtools(options: DevtoolsRuntimeOptions): void;
|
|
9
|
+
export declare function getDevtoolsSnapshot(): DevtoolsSnapshot;
|
|
10
|
+
export declare function onDevtoolsEvent(listener: (event: DevtoolsEvent) => void): () => void;
|
|
11
|
+
export declare function resetDevtools(): void;
|
|
3
12
|
/**
|
|
4
|
-
* Initialize dev tools
|
|
13
|
+
* Initialize dev tools runtime bridge for graph inspection.
|
|
5
14
|
* Returns a promise for future async initialization support.
|
|
6
15
|
*/
|
|
7
|
-
export declare function initDevTools(): Promise<void>;
|
|
16
|
+
export declare function initDevTools(options?: InitDevToolsOptions): Promise<void>;
|
package/dist/core/dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { configure, getSnapshot, isEnabled, reset, setEnabled, subscribe, } from "./devtools.js";
|
|
1
2
|
let isDevMode = true;
|
|
2
3
|
export function setDevMode(enabled) {
|
|
3
4
|
isDevMode = enabled;
|
|
@@ -5,10 +6,33 @@ export function setDevMode(enabled) {
|
|
|
5
6
|
export function isInDevMode() {
|
|
6
7
|
return isDevMode;
|
|
7
8
|
}
|
|
9
|
+
export function setDevtoolsEnabled(enabled, options) {
|
|
10
|
+
setEnabled(enabled, options);
|
|
11
|
+
}
|
|
12
|
+
export function isDevtoolsEnabled() {
|
|
13
|
+
return isEnabled();
|
|
14
|
+
}
|
|
15
|
+
export function configureDevtools(options) {
|
|
16
|
+
configure(options);
|
|
17
|
+
}
|
|
18
|
+
export function getDevtoolsSnapshot() {
|
|
19
|
+
return getSnapshot();
|
|
20
|
+
}
|
|
21
|
+
export function onDevtoolsEvent(listener) {
|
|
22
|
+
return subscribe(listener);
|
|
23
|
+
}
|
|
24
|
+
export function resetDevtools() {
|
|
25
|
+
reset();
|
|
26
|
+
}
|
|
8
27
|
/**
|
|
9
|
-
* Initialize dev tools
|
|
28
|
+
* Initialize dev tools runtime bridge for graph inspection.
|
|
10
29
|
* Returns a promise for future async initialization support.
|
|
11
30
|
*/
|
|
12
|
-
export async function initDevTools() {
|
|
31
|
+
export async function initDevTools(options = {}) {
|
|
13
32
|
setDevMode(true);
|
|
33
|
+
setEnabled(true, {
|
|
34
|
+
exposeGlobalHook: options.exposeGlobalHook ?? true,
|
|
35
|
+
dispatchEvents: options.dispatchEvents ?? true,
|
|
36
|
+
maxEvents: options.maxEvents,
|
|
37
|
+
});
|
|
14
38
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type DevtoolsNodeType = "scope" | "signal" | "computed" | "effect" | "effectAsync";
|
|
2
|
+
export type DevtoolsEdgeKind = "dependency" | "ownership";
|
|
3
|
+
export interface DevtoolsNode {
|
|
4
|
+
id: number;
|
|
5
|
+
type: DevtoolsNodeType;
|
|
6
|
+
label: string;
|
|
7
|
+
disposed: boolean;
|
|
8
|
+
scopeId: number | null;
|
|
9
|
+
parentScopeId: number | null;
|
|
10
|
+
reads: number;
|
|
11
|
+
writes: number;
|
|
12
|
+
runs: number;
|
|
13
|
+
lastValue: string;
|
|
14
|
+
lastRunAt: number;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
}
|
|
17
|
+
export interface DevtoolsEdge {
|
|
18
|
+
from: number;
|
|
19
|
+
to: number;
|
|
20
|
+
kind: DevtoolsEdgeKind;
|
|
21
|
+
}
|
|
22
|
+
export interface DevtoolsEvent {
|
|
23
|
+
type: string;
|
|
24
|
+
at: number;
|
|
25
|
+
payload: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface DevtoolsSnapshot {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
nodes: DevtoolsNode[];
|
|
30
|
+
edges: DevtoolsEdge[];
|
|
31
|
+
events: DevtoolsEvent[];
|
|
32
|
+
}
|
|
33
|
+
export interface DevtoolsRuntimeOptions {
|
|
34
|
+
maxEvents?: number;
|
|
35
|
+
exposeGlobalHook?: boolean;
|
|
36
|
+
dispatchEvents?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface DevtoolsHighlightOptions {
|
|
39
|
+
durationMs?: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function configure(options?: DevtoolsRuntimeOptions): void;
|
|
42
|
+
export declare function setEnabled(next: boolean, options?: DevtoolsRuntimeOptions): void;
|
|
43
|
+
export declare function isEnabled(): boolean;
|
|
44
|
+
export declare function reset(): void;
|
|
45
|
+
export declare function subscribe(listener: (event: DevtoolsEvent) => void): () => void;
|
|
46
|
+
export declare function getSnapshot(): DevtoolsSnapshot;
|
|
47
|
+
export declare function registerScope(scopeRef: object, parentScopeRef: object | null): void;
|
|
48
|
+
export declare function withDevtoolsDomTarget<T>(element: Element | null, fn: () => T): T;
|
|
49
|
+
export declare function linkScopeToDom(scopeRef: object, element: Element, label?: string): void;
|
|
50
|
+
export declare function disposeScope(scopeRef: object): void;
|
|
51
|
+
export declare function registerSignal(signalRef: object, type: "signal" | "computed", options?: {
|
|
52
|
+
scopeRef?: object | null;
|
|
53
|
+
initialValue?: unknown;
|
|
54
|
+
}): void;
|
|
55
|
+
export declare function registerEffect(effectRef: object, type: "effect" | "effectAsync", scopeRef: object | null): void;
|
|
56
|
+
export declare function aliasEffectToNode(effectRef: object, targetRef: object): void;
|
|
57
|
+
export declare function linkSubscriberSetToSignal(subscriberSetRef: object, signalRef: object): void;
|
|
58
|
+
export declare function trackSignalRead(signalRef: object): void;
|
|
59
|
+
export declare function trackSignalWrite(signalRef: object, nextValue: unknown): void;
|
|
60
|
+
export declare function trackEffectRun(effectRef: object): void;
|
|
61
|
+
export declare function trackEffectDispose(effectRef: object): void;
|
|
62
|
+
export declare function trackDependency(signalRef: object, effectRef: object): void;
|
|
63
|
+
export declare function untrackDependencyBySet(subscriberSetRef: object, effectRef: object): void;
|
|
64
|
+
export declare function clearHighlights(): void;
|
|
65
|
+
export declare function highlightNode(nodeId: number, options?: DevtoolsHighlightOptions): boolean;
|