zero-query 1.0.5 → 1.1.1
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 +3 -3
- package/cli/commands/build-api.js +442 -0
- package/cli/commands/build.js +33 -2
- package/cli/commands/bundle.js +174 -8
- package/cli/commands/dev/server.js +57 -3
- package/cli/scaffold/default/app/components/contacts/contacts.css +9 -9
- package/cli/scaffold/default/app/components/playground/playground.css +1 -1
- package/cli/scaffold/default/app/components/playground/playground.html +5 -5
- package/cli/scaffold/default/app/components/playground/playground.js +1 -1
- package/cli/scaffold/default/app/components/toolkit/toolkit.css +1 -1
- package/cli/scaffold/default/app/components/toolkit/toolkit.html +3 -3
- package/cli/scaffold/default/app/components/toolkit/toolkit.js +4 -4
- package/cli/utils.js +16 -7
- package/dist/API.md +6603 -0
- package/dist/zquery.dist.zip +0 -0
- package/dist/zquery.js +387 -25
- package/dist/zquery.min.js +631 -2
- package/index.d.ts +9 -3
- package/index.js +10 -2
- package/package.json +3 -2
- package/src/component.js +243 -6
- package/src/reactive.js +4 -3
- package/src/router.js +79 -9
- package/src/store.js +49 -3
- package/tests/cli.test.js +343 -0
- package/tests/compare.test.js +486 -0
- package/tests/dev-server.test.js +489 -0
- package/tests/docs.test.js +1650 -0
- package/tests/electron-features.test.js +864 -0
- package/types/misc.d.ts +7 -7
- package/types/reactive.d.ts +1 -1
- package/types/store.d.ts +2 -1
package/types/misc.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
56
56
|
// HTML files. All expressions evaluate in the component's state context
|
|
57
57
|
// (bare names resolve to `this.state.*`; `props` and `refs` also available).
|
|
58
58
|
//
|
|
59
|
-
//
|
|
59
|
+
// --- Structural Directives ----------------------------------------------
|
|
60
60
|
//
|
|
61
61
|
// z-if="expression" Conditional rendering - element removed when falsy.
|
|
62
62
|
// z-else-if="expression" Else-if branch (must be immediate sibling of z-if).
|
|
@@ -75,7 +75,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
75
75
|
//
|
|
76
76
|
// z-show="expression" Toggle `display: none` (element stays in DOM).
|
|
77
77
|
//
|
|
78
|
-
//
|
|
78
|
+
// --- Attribute Directives -----------------------------------------------
|
|
79
79
|
//
|
|
80
80
|
// z-bind:attr="expression" Dynamic attribute binding.
|
|
81
81
|
// :attr="expression" Shorthand for z-bind:attr.
|
|
@@ -94,7 +94,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
94
94
|
// z-html="expression" Set innerHTML from expression (use trusted content only).
|
|
95
95
|
// z-text="expression" Set textContent from expression (safe, no HTML).
|
|
96
96
|
//
|
|
97
|
-
//
|
|
97
|
+
// --- Form & Reference Directives ----------------------------------------
|
|
98
98
|
//
|
|
99
99
|
// z-model="stateKey" Two-way binding for form elements.
|
|
100
100
|
// Supports: input, textarea, select, select[multiple], contenteditable.
|
|
@@ -106,7 +106,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
106
106
|
//
|
|
107
107
|
// z-ref="name" Element reference → this.refs.name.
|
|
108
108
|
//
|
|
109
|
-
//
|
|
109
|
+
// --- Event Directives ---------------------------------------------------
|
|
110
110
|
//
|
|
111
111
|
// @event="method" Event binding with delegation (shorthand).
|
|
112
112
|
// z-on:event="method" Event binding with delegation (full syntax).
|
|
@@ -123,7 +123,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
123
123
|
// .debounce.{ms} Debounce: delay until {ms}ms idle (default 250).
|
|
124
124
|
// .throttle.{ms} Throttle: invoke at most once per {ms}ms (default 250).
|
|
125
125
|
//
|
|
126
|
-
//
|
|
126
|
+
// --- Special Directives -------------------------------------------------
|
|
127
127
|
//
|
|
128
128
|
// z-cloak Hidden until rendered (auto-removed after mount).
|
|
129
129
|
// Global CSS: [z-cloak] { display: none !important }.
|
|
@@ -132,7 +132,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
132
132
|
// z-pre Skip all directive processing for this element
|
|
133
133
|
// and its descendants.
|
|
134
134
|
//
|
|
135
|
-
//
|
|
135
|
+
// --- Slot System --------------------------------------------------------
|
|
136
136
|
//
|
|
137
137
|
// <slot> Default slot - replaced with child content
|
|
138
138
|
// passed by the parent component.
|
|
@@ -146,7 +146,7 @@ export function safeEval(expr: string, scope: object[]): any;
|
|
|
146
146
|
// <p>Body text</p> (→ default slot)
|
|
147
147
|
// </my-component>
|
|
148
148
|
//
|
|
149
|
-
//
|
|
149
|
+
// --- Processing Order ---------------------------------------------------
|
|
150
150
|
//
|
|
151
151
|
// 1. z-for (pre-innerHTML expansion)
|
|
152
152
|
// 2. z-if chain (DOM removal)
|
package/types/reactive.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export function effect(fn: () => void): () => void;
|
|
|
87
87
|
* b.value = 2;
|
|
88
88
|
* }); // effects run once with both values updated
|
|
89
89
|
*/
|
|
90
|
-
export function batch(fn: () =>
|
|
90
|
+
export function batch<R = void>(fn: () => R): R;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Execute a function without tracking signal reads as dependencies.
|
package/types/store.d.ts
CHANGED
|
@@ -98,8 +98,9 @@ export interface StoreInstance<
|
|
|
98
98
|
/**
|
|
99
99
|
* Batch multiple state changes - subscribers fire once at the end
|
|
100
100
|
* with only the latest value per key.
|
|
101
|
+
* @returns The callback's return value.
|
|
101
102
|
*/
|
|
102
|
-
batch(fn: (state: S) =>
|
|
103
|
+
batch<R = void>(fn: (state: S) => R): R;
|
|
103
104
|
|
|
104
105
|
/**
|
|
105
106
|
* Save a state snapshot for undo. Call before making changes you want to be undoable.
|