quilt-react 0.2.0 → 0.2.1

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 +3 -4
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -27,8 +27,7 @@ const store = new LayoutStore(
27
27
  );
28
28
  const data = { text: 'Hello' };
29
29
  const getPaneState = () => data;
30
- function Notes({ state }: PaneProps) {
31
- const model = state as typeof data;
30
+ function Notes({ state: model }: PaneProps<typeof data>) {
32
31
  return (
33
32
  <textarea
34
33
  defaultValue={model.text}
@@ -41,7 +40,7 @@ function Notes({ state }: PaneProps) {
41
40
  const components = { notes: Notes };
42
41
  const root = createRoot(document.getElementById('app')!);
43
42
  root.render(
44
- <Layout
43
+ <Layout<typeof data>
45
44
  store={store}
46
45
  components={components}
47
46
  getPaneState={getPaneState}
@@ -58,6 +57,6 @@ function disposeWorkspace() {
58
57
 
59
58
  Keep the store stable. Component maps and adapter callbacks can change identity without rebuilding the workspace. Declarative panes inherit application providers through portals. `useLayoutSnapshot(store)` observes layout changes. The model type is `LayoutSnapshot`; `Layout` is the component. `MountedLayout`, `TabRegistry`, theme presets, and DOM configuration types are available here too. Attach a `MountedLayout` ref to call `popout` from a user gesture; before mounting completes, popout/requestClose resolve false; workspace configuration methods throw a clear not-mounted error.
60
59
 
61
- Declarative panes inherit your app's context providers. Only standalone `reactRenderer` creates separate roots requiring explicit provider wrappers. React-local state does not survive crossing documents: retain data in an application-owned store, and subscribe inside each view when live synchronization is needed. Companion windows are same-origin and depend on the main session.
60
+ Only standalone `reactRenderer` creates separate roots requiring explicit provider wrappers. React-local state does not survive crossing documents: retain data in an application-owned store, and subscribe inside each view when live synchronization is needed. Companion windows are same-origin and depend on the main session.
62
61
 
63
62
  The stylesheet is identical to `quilt-vanilla/styles.css`; import either once. See [API](https://github.com/niko-dellic/quilt/blob/main/docs/api.md), [lifecycle](https://github.com/niko-dellic/quilt/blob/main/docs/lifecycle.md), and [migration](https://github.com/niko-dellic/quilt/blob/main/docs/migration.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quilt-react",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "React split panes and tabs with shared DOM chrome and browser window popouts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,8 +30,8 @@
30
30
  "prepack": "node ../../scripts/build-package.mjs react --dependencies"
31
31
  },
32
32
  "dependencies": {
33
- "quilt-core": "0.2.0",
34
- "quilt-vanilla": "0.2.0"
33
+ "quilt-core": "0.2.1",
34
+ "quilt-vanilla": "0.2.1"
35
35
  },
36
36
  "sideEffects": [
37
37
  "**/*.css"