@automerge/automerge-repo-solid-primitives 2.2.0

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.
Binary file
Binary file
@@ -0,0 +1,28 @@
1
+ name: run our tests
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [22.x]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Install pnpm
20
+ uses: pnpm/action-setup@v4
21
+ - name: Use Node.js ${{ matrix.node-version }}
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: ${{ matrix.node-version }}
25
+ cache: "pnpm"
26
+ - run: pnpm install
27
+ - run: pnpm mk
28
+ - run: pnpm t
@@ -0,0 +1,53 @@
1
+ name: Deploy typedoc to pages
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: "pages"
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ name: Build
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+ - name: Install pnpm
25
+ uses: pnpm/action-setup@v4
26
+ - name: Setup Node
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: "22"
30
+ cache: "pnpm"
31
+ - name: Setup Pages
32
+ id: pages
33
+ uses: actions/configure-pages@v5
34
+ - name: Install dependencies
35
+ run: pnpm install
36
+ - name: Build
37
+ run: pnpm typedoc
38
+ - name: Upload artifact
39
+ uses: actions/upload-pages-artifact@v3
40
+ with:
41
+ path: docs
42
+
43
+ deploy:
44
+ environment:
45
+ name: github-pages
46
+ url: ${{ steps.deployment.outputs.page_url }}
47
+ needs: build
48
+ runs-on: ubuntu-latest
49
+ name: Deploy
50
+ steps:
51
+ - name: Deploy to GitHub Pages
52
+ id: deployment
53
+ uses: actions/deploy-pages@v4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2025, Ink & Switch LLC
2
+ Copyright (c) 2024, chee
3
+ Copyright (c) 2019-2023, Ink & Switch LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ import { DocHandleChangePayload } from '@automerge/automerge-repo/slim';
2
+
3
+ /**
4
+ * convert automerge patches to solid producer operations
5
+ * @param payload the
6
+ * [DocHandleChangePayload](https://automerge.org/automerge-repo/interfaces/_automerge_automerge_repo.DocHandleChangePayload.html)
7
+ * from the handle.on("change
8
+ * @returns a callback for an immer-like function. e.g.
9
+ * [produce](https://docs.solidjs.com/reference/store-utilities/produce) for
10
+ * [Solid
11
+ * Stores](https://docs.solidjs.com/reference/store-utilities/create-store)
12
+ */
13
+ export default function autoproduce<T>(payload: DocHandleChangePayload<T>): (doc: T) => void;
@@ -0,0 +1,9 @@
1
+ import { Repo } from '@automerge/automerge-repo/slim';
2
+ import { Context } from 'solid-js';
3
+
4
+ /**
5
+ * a [context](https://docs.solidjs.com/concepts/context) that provides access
6
+ * to an Automerge Repo. you don't need this, you can pass the repo in the
7
+ * second arg to the functions that need it.
8
+ */
9
+ export declare const RepoContext: Context<Repo | null>;
@@ -0,0 +1,10 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { DocHandle, Doc } from '@automerge/automerge-repo/slim';
3
+
4
+ /**
5
+ * get a fine-grained live view of a document from a handle. works with
6
+ * {@link useDocHandle}.
7
+ * @param handle an accessor (signal/resource) of a
8
+ * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)
9
+ */
10
+ export default function createDocumentProjection<T extends object>(handle: Accessor<DocHandle<T> | undefined>): Accessor<Doc<T> | undefined>;
@@ -0,0 +1,7 @@
1
+ export { default as autoproduce } from './autoproduce.js';
2
+ export { default as useDocument } from './useDocument.js';
3
+ export { default as useDocHandle } from './useDocHandle.js';
4
+ export { default as makeDocumentProjection } from './makeDocumentProjection.js';
5
+ export { default as createDocumentProjection } from './createDocumentProjection.js';
6
+ export { default as useRepo } from './useRepo.js';
7
+ export { RepoContext } from './context.js';