zero-query 0.9.1 → 0.9.6

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 CHANGED
@@ -21,14 +21,14 @@
21
21
 
22
22
  | Module | Highlights |
23
23
  | --- | --- |
24
- | **Components** | Reactive state, template literals, `@event` delegation (8 modifiers), `z-model` two-way binding, computed properties, watch callbacks, slot-based content projection, directives (`z-if`/`z-else-if`/`z-else`, `z-for`, `z-show`, `z-bind`/`:attr`, `z-class`, `z-style`, `z-text`, `z-html`, `z-ref`, `z-cloak`, `z-pre`, `z-key`, `z-skip`), DOM morphing engine with LIS-based keyed reconciliation (no innerHTML rebuild), CSP-safe expression evaluation with AST caching, scoped styles, external templates (`templateUrl` / `styleUrl`), lifecycle hooks, auto-injected base styles |
24
+ | **Components** | Reactive state, template literals, `@event` delegation (22 modifiers — key filters, system keys, `.outside`, timing, and more), `z-model` two-way binding (with `z-trim`, `z-number`, `z-lazy`, `z-debounce`, `z-uppercase`, `z-lowercase`), computed properties, watch callbacks, slot-based content projection, directives (`z-if`/`z-else-if`/`z-else`, `z-for`, `z-show`, `z-bind`/`:attr`, `z-class`, `z-style`, `z-text`, `z-html`, `z-ref`, `z-cloak`, `z-pre`, `z-key`, `z-skip`), DOM morphing engine with LIS-based keyed reconciliation (no innerHTML rebuild), CSP-safe expression evaluation with AST caching, scoped styles, external templates (`templateUrl` / `styleUrl`), lifecycle hooks, auto-injected base styles |
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, time-travel (undo/redo/history) |
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
  }
@@ -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'
@@ -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 -- */
@@ -53,8 +53,9 @@
53
53
  <!-- Overlay for mobile menu -->
54
54
  <div class="overlay" id="overlay"></div>
55
55
 
56
- <!-- Main Content -->
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>
Binary file