@panyam/tsappkit-solid 0.7.6 → 0.7.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.
Files changed (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @panyam/tsappkit-solid
2
+
3
+ Solid islands for [@panyam/tsappkit](https://www.npmjs.com/package/@panyam/tsappkit). Solid's reactivity stays in this package, so tsappkit and the presenters behind your islands don't depend on a UI framework.
4
+
5
+ ```bash
6
+ npm install @panyam/tsappkit-solid @panyam/tsappkit solid-js
7
+ ```
8
+
9
+ It needs `@panyam/tsappkit` (any 0.x) and `solid-js` 1.9 or a later 1.x. It shares one version with tsappkit and goapplib, so `@panyam/tsappkit-solid@0.7.7` goes with `@panyam/tsappkit@0.7.7` and goapplib `v0.7.7`.
10
+
11
+ ## What's in it
12
+
13
+ - **`SolidIsland`** is a tsappkit component that renders a Solid tree into an island's slot. It renders in `activate`, so the tree can use whatever was injected in `setupDependencies`, and disposes of it in `deactivate`. It replaces the placeholder Go rendered in the slot in the same task, so the slot never shows empty.
14
+ - **`signalView`** makes a signal whose setter is a view method a presenter can call, such as `setPicks`.
15
+ - **`useView`** attaches a view to a presenter's `Port` while the island is active and detaches it when the island goes.
16
+
17
+ An island that shows a presenter's history, mounted from an `IslandPage` registry:
18
+
19
+ ```tsx
20
+ import { SolidIsland, signalView, useView } from "@panyam/tsappkit-solid";
21
+
22
+ export default function history(el: HTMLElement, island: IslandSpec, ctx: { editor: EditorPresenter }, bus: EventBus) {
23
+ return new SolidIsland("history", el, () => {
24
+ const [picks, setPicks] = signalView<readonly Color[]>([]);
25
+ useView(ctx.editor.history, { setPicks });
26
+ return <p>History: {picks().join(", ")}</p>;
27
+ }, bus);
28
+ }
29
+ ```
30
+
31
+ See [One presenter, several islands](https://panyam.github.io/goapplib/guide/islands/#one-presenter-several-islands) for the presenter side, and [Islands](https://panyam.github.io/goapplib/guide/islands/) for island pages.
32
+
33
+ ## License
34
+
35
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panyam/tsappkit-solid",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "Solid adapter for @panyam/tsappkit: mount Solid islands inside the tsappkit component lifecycle. The framework-specific reactivity lives here so tsappkit core stays framework-neutral.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",