caspian-utils 0.0.16 → 0.0.17

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: PulsePoint Runtime Guide
3
- description: Use this page when the task mentions PulsePoint, `pp.state`, `pp.effect`, `pp-ref`, `pp-for`, portals, SPA navigation, or `public/js/pp-reactive-v2.js`.
3
+ description: Use this page when the task mentions PulsePoint, `pp.state`, `pp.effect`, `pp-ref`, `pp-style`, `pp-for`, portals, SPA navigation, or `public/js/pp-reactive-v2.js`.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Read the components, routing, data-fetching, and project-structure docs alongside the PulsePoint runtime contract.
@@ -16,7 +16,7 @@ related:
16
16
 
17
17
  This file documents the PulsePoint contract for the shipped Caspian browser runtime. Treat it as the AI-facing source of truth when generating or reviewing interactive Caspian UI.
18
18
 
19
- If a task involves `pp.state`, `pp.effect`, `pp.layoutEffect`, `pp-ref`, `pp-spread`, `pp-for`, context, portals, SPA navigation, or component boundary behavior, read this page first and keep generated code aligned with the runtime implemented in this repo.
19
+ If a task involves `pp.state`, `pp.effect`, `pp.layoutEffect`, `pp-ref`, `pp-style`, `pp-spread`, `pp-for`, context, portals, SPA navigation, or component boundary behavior, read this page first and keep generated code aligned with the runtime implemented in this repo.
20
20
 
21
21
  Use `components.md` for authoring Python `@component` files and same-name HTML templates. Use this page for the browser-side PulsePoint contract, the authoring rules that feed it, and the React-style mental model used by the shipped runtime.
22
22
 
@@ -262,6 +262,9 @@ Nested components:
262
262
 
263
263
  - Use `{expression}` in text nodes and attribute values.
264
264
  - Pure bindings like `value="{count}"` are evaluated as expressions.
265
+ - For dynamic inline styles in authored templates, prefer `pp-style="{styleText}"` over `style="{styleText}"` so HTML/CSS tooling does not parse the brace expression as raw CSS.
266
+ - `pp-style` is an authoring alias. The compiler rewrites it to a native `style` attribute in rendered output.
267
+ - If the same element already has a static `style` attribute, `pp-style` is merged into that `style` value during compilation.
265
268
  - Mixed text like `class="card {isActive ? 'active' : ''}"` is supported.
266
269
  - Arrays in template expressions are joined without commas.
267
270
  - `null`, `undefined`, and boolean expression results render as an empty string in text output.
@@ -275,9 +278,12 @@ Example:
275
278
 
276
279
  ```html
277
280
  <div>
281
+ <p pp-style="{noticeStyle}">Notice</p>
278
282
  <button pp-spread="{...buttonAttrs}" hidden="{isLoading}">Save</button>
279
283
 
280
284
  <script>
285
+ const noticeStyle = "color: red;";
286
+
281
287
  const buttonAttrs = {
282
288
  class: "btn btn-primary",
283
289
  "aria-label": "save",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caspian-utils",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Caspian tooling",
5
5
  "main": "index.js",
6
6
  "scripts": {