zero-query 0.9.1 → 0.9.5
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 +10 -7
- package/cli/commands/dev/devtools/js/elements.js +5 -0
- package/cli/scaffold/app/app.js +1 -1
- package/cli/scaffold/global.css +1 -2
- package/cli/scaffold/index.html +2 -1
- package/dist/zquery.dist.zip +0 -0
- package/dist/zquery.js +363 -30
- package/dist/zquery.min.js +2 -2
- package/index.d.ts +46 -2
- package/index.js +32 -4
- package/package.json +1 -1
- package/src/component.js +32 -3
- package/src/core.js +3 -1
- package/src/expression.js +103 -16
- package/src/http.js +6 -2
- package/src/router.js +6 -1
- package/src/utils.js +191 -5
- package/tests/audit.test.js +4030 -0
- package/tests/core.test.js +41 -0
- package/tests/expression.test.js +10 -10
- package/tests/utils.test.js +543 -1
- package/types/utils.d.ts +103 -0
package/README.md
CHANGED
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
| **Router** | History & hash mode, route params (`:id`), wildcards, guards (`beforeEach`/`afterEach`), lazy loading, `z-link` navigation, `z-to-top` scroll modifier (`instant`/`smooth`), sub-route history substates (`pushSubstate`/`onSubstate`) |
|
|
26
26
|
| **Directives** | `z-if`, `z-for`, `z-model`, `z-show`, `z-bind`, `z-class`, `z-style`, `z-text`, `z-html`, `z-ref`, `z-cloak`, `z-pre`, `z-key`, `z-skip` — 17 built-in template directives |
|
|
27
27
|
| **Reactive** | Deep proxy reactivity, Signals (`.value`, `.peek()`), computed values, effects (auto-tracked with dispose) |
|
|
28
|
-
| **Store** | Reactive global state, named actions, computed getters, middleware, subscriptions,
|
|
28
|
+
| **Store** | Reactive global state, named actions, computed getters, middleware, subscriptions, action history, snapshots |
|
|
29
29
|
| **Selectors & DOM** | jQuery-like chainable selectors, traversal, DOM manipulation, events, animation |
|
|
30
30
|
| **HTTP** | Fetch wrapper with auto-JSON, interceptors, timeout/abort, base URL |
|
|
31
|
-
| **Utils** | debounce, throttle, pipe, once, sleep, escapeHtml, uuid, deepClone, deepMerge, storage/session wrappers, event bus |
|
|
31
|
+
| **Utils** | debounce, throttle, pipe, once, sleep, memoize, escapeHtml, stripHtml, uuid, capitalize, truncate, range, chunk, groupBy, unique, pick, omit, getPath/setPath, isEmpty, clamp, retry, timeout, deepClone, deepMerge, storage/session wrappers, event bus |
|
|
32
32
|
| **Dev Tools** | CLI dev server with live-reload, CSS hot-swap, full-screen error overlay, floating toolbar, dark-themed inspector panel (Router view, DOM tree, network log, component viewer, performance dashboard), fetch interceptor, render instrumentation, CLI bundler for single-file production builds |
|
|
33
33
|
|
|
34
34
|
---
|
|
@@ -251,7 +251,7 @@ location / {
|
|
|
251
251
|
| --- | --- |
|
|
252
252
|
| `$()` | Chainable selector → `ZQueryCollection` (CSS selectors, elements, NodeLists, HTML strings) |
|
|
253
253
|
| `$.all()` | Alias for `$()` — identical behavior |
|
|
254
|
-
| `$.id` `$.class` `$.classes` `$.tag` `$.name` `$.children` | Quick DOM refs |
|
|
254
|
+
| `$.id` `$.class` `$.classes` `$.tag` `$.name` `$.children` `$.qs` `$.qsa` | Quick DOM refs |
|
|
255
255
|
| `$.create` | Element factory |
|
|
256
256
|
| `$.ready` `$.on` `$.off` | DOM ready, global event delegation & direct listeners |
|
|
257
257
|
| `$.fn` | Collection prototype (extend it) |
|
|
@@ -263,12 +263,15 @@ location / {
|
|
|
263
263
|
| `$.store` `$.getStore` | State management |
|
|
264
264
|
| `$.http` `$.get` `$.post` `$.put` `$.patch` `$.delete` | HTTP client |
|
|
265
265
|
| `$.reactive` `$.Signal` `$.signal` `$.computed` `$.effect` | Reactive primitives |
|
|
266
|
-
| `$.debounce` `$.throttle` `$.pipe` `$.once` `$.sleep` | Function utils |
|
|
267
|
-
| `$.escapeHtml` `$.html` `$.trust` `$.uuid` `$.camelCase` `$.kebabCase` | String utils |
|
|
268
|
-
| `$.deepClone` `$.deepMerge` `$.isEqual` | Object utils |
|
|
266
|
+
| `$.debounce` `$.throttle` `$.pipe` `$.once` `$.sleep` `$.memoize` | Function utils |
|
|
267
|
+
| `$.escapeHtml` `$.stripHtml` `$.html` `$.trust` `$.TrustedHTML` `$.uuid` `$.camelCase` `$.kebabCase` `$.capitalize` `$.truncate` | String utils |
|
|
268
|
+
| `$.deepClone` `$.deepMerge` `$.isEqual` `$.pick` `$.omit` `$.getPath` `$.setPath` `$.isEmpty` | Object utils |
|
|
269
|
+
| `$.range` `$.unique` `$.chunk` `$.groupBy` | Array utils |
|
|
270
|
+
| `$.clamp` | Number utils |
|
|
271
|
+
| `$.retry` `$.timeout` | Async utils |
|
|
269
272
|
| `$.param` `$.parseQuery` | URL utils |
|
|
270
273
|
| `$.storage` `$.session` | Storage wrappers |
|
|
271
|
-
| `$.bus` | Event bus || `$.onError` `$.ZQueryError` `$.ErrorCode` `$.guardCallback` `$.validate` | Error handling || `$.version` | Library version |\n| `$.libSize` | Minified bundle size string (e.g. `\"~91 KB\"`) |
|
|
274
|
+
| `$.EventBus` `$.bus` | Event bus || `$.onError` `$.ZQueryError` `$.ErrorCode` `$.guardCallback` `$.validate` | Error handling || `$.version` | Library version |\n| `$.libSize` | Minified bundle size string (e.g. `\"~91 KB\"`) |
|
|
272
275
|
| `$.meta` | Build metadata (populated by CLI bundler) |
|
|
273
276
|
| `$.noConflict` | Release `$` global |
|
|
274
277
|
|
|
@@ -220,12 +220,17 @@ function buildNode(node, depth) {
|
|
|
220
220
|
if (level >= maxDepth) return;
|
|
221
221
|
var children = container.children;
|
|
222
222
|
for (var j = 0; j < children.length; j++) {
|
|
223
|
+
var rowEl = children[j].querySelector(':scope > .tree-row');
|
|
223
224
|
var nested = children[j].querySelector(':scope > .tree-children');
|
|
224
225
|
if (nested) {
|
|
225
226
|
if (opening) nested.classList.add('open');
|
|
226
227
|
else nested.classList.remove('open');
|
|
227
228
|
var arrow = nested.previousElementSibling ? nested.previousElementSibling.querySelector('.tree-toggle') : null;
|
|
228
229
|
if (arrow) { if (opening) arrow.classList.add('open'); else arrow.classList.remove('open'); }
|
|
230
|
+
// Persist state so it survives tree rebuilds from live DOM mutations
|
|
231
|
+
if (rowEl && rowEl.__targetNode) {
|
|
232
|
+
expandedPaths[getNodePath(rowEl.__targetNode)] = opening;
|
|
233
|
+
}
|
|
229
234
|
toggleNested(nested, level + 1);
|
|
230
235
|
}
|
|
231
236
|
}
|
package/cli/scaffold/app/app.js
CHANGED
|
@@ -18,7 +18,7 @@ import { routes } from './routes.js';
|
|
|
18
18
|
// Router — SPA navigation with history mode
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
const router = $.router({
|
|
21
|
-
el: '#app',
|
|
21
|
+
el: '#app', //@ Mount point (Set in index.html)
|
|
22
22
|
routes,
|
|
23
23
|
fallback: 'not-found',
|
|
24
24
|
mode: 'history'
|
package/cli/scaffold/global.css
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* global.css — responsive scaffold styles
|
|
2
2
|
*
|
|
3
|
-
* Uses CSS custom properties for easy theming.
|
|
3
|
+
* Uses CSS custom properties for easy theming. Feel free to modify.
|
|
4
4
|
* Dark theme by default, light theme via [data-theme="light"].
|
|
5
|
-
* Mobile-first: sidebar collapses to a hamburger nav below 768px.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
/* -- Theme Variables -- */
|
package/cli/scaffold/index.html
CHANGED
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
<!-- Overlay for mobile menu -->
|
|
54
54
|
<div class="overlay" id="overlay"></div>
|
|
55
55
|
|
|
56
|
-
<!--
|
|
56
|
+
<!-- @ Router Outlet @ -->
|
|
57
57
|
<main class="content" id="app"></main>
|
|
58
|
+
<!-- @ Mount point is set in app/app.js @ -->
|
|
58
59
|
|
|
59
60
|
<!-- Toast container for notifications -->
|
|
60
61
|
<div class="toast-container" id="toasts"></div>
|
package/dist/zquery.dist.zip
CHANGED
|
Binary file
|