lightview 2.4.4 → 2.4.7

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/AI-GUIDANCE.md CHANGED
@@ -151,8 +151,23 @@ Lightview X allows embedded `${}` expressions in attributes for simple reactivit
151
151
 
152
152
  **cDOM (Computed DOM)** and **JPRX (JSON Reactive Expressions)** allow you to build fully reactive UIs using **only JSON**.
153
153
 
154
- ### JPRX Helper Reference
155
- JPRX supports a wide range of helpers. AI agents should use these instead of trying to write JS when builing streaming UIs at runtime.
154
+ ### Syntax Prefixes
155
+ * **`=` (JPRX)**: Navigates **reactive state** (Signals/States). Starts with `=/` for absolute paths.
156
+ * **`#` (cDOM XPath)**: Navigates the **DOM tree** during construction. Use `#../../@id` to skip the text node parent and reach an ancestor's attribute.
157
+
158
+ ### Name Resolution & Scoping
159
+ JPRX uses an **up-tree search** to find signals or states:
160
+ 1. **Search starts** at the element where the expression is defined.
161
+ 2. **Bubbles up** through parent elements looking for a registered name.
162
+ 3. **Falls back** to the global registry.
163
+
164
+ **The `$this` Placeholder**:
165
+ Use `{ scope: $this }` in `=state` or `=signal` to register data specifically at the current element's level. This is essential for creating multiple independent instances of a component.
166
+
167
+ ### The `...` (Explosion) Operator
168
+ * **Infix Mapping (`/path...property`)**: Extracts `property` from every object in the `/path` array. **Inside a function call, it automatically explodes** the results into separate arguments.
169
+ * **Trailing Spread (`/path...`)**: Spreads a direct array reference into individual arguments.
170
+ * **Warning**: Never write `/path...property...`. The trailing dots will be incorrectly included in the property name lookup.
156
171
 
157
172
  | Category | Helpers |
158
173
  | :--- | :--- |
@@ -163,7 +178,7 @@ JPRX supports a wide range of helpers. AI agents should use these instead of try
163
178
  | **Stats** | `sum`, `avg`, `min`, `max`, `median`, `stdev`, `variance` |
164
179
  | **Data** | `lookup(val, searchArr, resultArr)` (VLOOKUP-style) |
165
180
  | **State** | `state(val, opts)`, `set(path, val)`, `bind(path)`, `increment`, `decrement`, `toggle` |
166
- | **DOM** | `xpath(expr)` (Backward-looking only), `move(target, loc)` |
181
+ | **DOM** | `#path` (XPath Navigation), `move(target, loc)` |
167
182
  | **Net** | `fetchHelper(url, opts)`, `mount(url, opts)` |
168
183
 
169
184
  ### The "Decentralized Layout" Pattern (AI Strategy)
@@ -247,13 +262,13 @@ router.use(
247
262
  <a name="deep-links"></a>
248
263
  ## 8. Deep Links & Resources
249
264
 
250
- * **Documentation Home**: [/docs/index.html](file:///c:/Users/Owner/AntigravityProjects/lightview/docs/index.html)
251
- * **Core Logic**: [/lightview.js](file:///c:/Users/Owner/AntigravityProjects/lightview/lightview.js)
252
- * **Extension (Hypermedia)**: [/lightview-x.js](file:///c:/Users/Owner/AntigravityProjects/lightview/lightview-x.js)
253
- * **Router**: [/lightview-router.js](file:///c:/Users/Owner/AntigravityProjects/lightview/lightview-router.js)
254
- * **CDOM/JPRX Parser**: [/lightview-cdom.js](file:///c:/Users/Owner/AntigravityProjects/lightview/lightview-cdom.js)
255
- * **Component Index**: [/components/index.js](file:///c:/Users/Owner/AntigravityProjects/lightview/components/index.js)
256
- * **JPRX Helpers**: [/jprx/helpers/](file:///c:/Users/Owner/AntigravityProjects/lightview/jprx/helpers/)
265
+ * **Documentation Home**: [docs/index.html](docs/index.html)
266
+ * **Core Logic**: [lightview.js](lightview.js) and [docs/api/index.html](docs/api/index.html)
267
+ * **Extension (Hypermedia)**: [lightview-x.js](lightview-x.js) and [docs/api/hypermedia.html](docs/api/hypermedia.html)
268
+ * **Router**: [lightview-router.js](lightview-router.js) and [docs/router.html](docs/router.html)
269
+ * **CDOM/JPRX Parser**: [lightview-cdom.js](lightview-cdom.js) and [docs/cdom.html](docs/cdom.html)
270
+ * **Component Index**: [components/index.js](components/index.js) and [docs/components/index.html](docs/components/index.html)
271
+ * **JPRX Helpers**: [jprx/helpers/](jprx/helpers/) and [docs/cdom#helpers](docs/cdom.html#helpers)
257
272
 
258
273
  ---
259
274
  © 2026 AnyWhichWay LLC.