Skip to content

Commit

Permalink
update to @theweav packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Sep 20, 2024
1 parent 45cb41c commit 0f4ce1f
Show file tree
Hide file tree
Showing 19 changed files with 598 additions and 948 deletions.
887 changes: 250 additions & 637 deletions flake.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
p2p-shipyard.url = "github:darksoil-studio/p2p-shipyard";
versions.url = "github:holochain/holochain?dir=versions/0_3";
versions.url = "github:holochain/holochain?dir=versions/weekly";

holochain-flake.url = "github:holochain/holochain";
holochain-flake.inputs.versions.follows = "versions";
Expand Down
600 changes: 314 additions & 286 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dev": "VITE_ADMIN_PORT=$(port) VITE_APP_PORT=$(port) SIGNAL_PORT=$(port) BOOTSTRAP_PORT=$(port) UI_PORT=8888 npm run x",
"x": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run launch:browser\" \"hc run-local-services -b $BOOTSTRAP_PORT -s $SIGNAL_PORT\"",
"tool-dev": "npm run tool-devy",
"tool-devy": "concurrently \"npm start -w ui\" \"sleep 1 && we-dev-cli --agent-idx 1 --dev-config we_dev/config.ts\" \"sleep 10 && we-dev-cli --agent-idx 2 --dev-config we_dev/config.ts\"",
"tool-devy": "concurrently \"npm start -w ui\" \"sleep 1 && weave --agent-idx 1 --dev-config we_dev/config.ts\" \"sleep 10 && weave --agent-idx 2 --dev-config we_dev/config.ts\"",
"tool-devx": "BPORT=46263 SPORT=46262; concurrently \"hc run-local-services -b $BPORT -s $SPORT\" \"npm start -w ui\" \"./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 1 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\" \"sleep 10 && ./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 2 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\"",
"test": "npm run build:zomes && hc app pack workdir --recursive && npm t -w tests",
"package": "npm run build:happ && npm run package -w ui && hc web-app pack workdir --recursive",
Expand All @@ -32,7 +32,7 @@
"tauri": "tauri"
},
"devDependencies": {
"@lightningrodlabs/we-dev-cli": "^0.12.0-dev.6",
"@theweave/cli": "0.13.0-beta.6",
"@holochain/hc-spin": "^0.300.3",
"@holochain-playground/cli": "^0.1.1",
"@rollup/plugin-typescript": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@holochain-open-dev/utils": "^0.300.2",
"@holochain-syn/core": "^0.300.0",
"@holochain/client": "^0.17.1",
"@lightningrodlabs/we-applet": "^0.17.0-dev.3",
"@lightningrodlabs/we-elements": "^0.6.0-dev.0",
"@theweave/api": "^0.1.0",
"@theweave/elements": "^0.1.0",
"@mdi/js": "^7.1.96",
"@msgpack/msgpack": "^3.0.0-beta2",
"@shoelace-style/shoelace": "^2.13.1",
Expand Down
2 changes: 1 addition & 1 deletion ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
isWeContext,
initializeHotReload,
type WAL,
} from "@lightningrodlabs/we-applet";
} from "@theweave/api";
import "@holochain-open-dev/profiles/dist/elements/profiles-context.js";
import "@holochain-open-dev/profiles/dist/elements/profile-prompt.js";
import "@holochain-open-dev/profiles/dist/elements/create-profile.js";
Expand Down
2 changes: 1 addition & 1 deletion ui/src/AttachmentsDialog.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { isWeContext, type WAL, weaveUrlFromWal } from "@lightningrodlabs/we-applet";
import { isWeContext, type WAL, weaveUrlFromWal } from "@theweave/api";
import { cloneDeep } from "lodash";
import type { Board, Card } from "./board";
import { getContext } from "svelte";
Expand Down
4 changes: 2 additions & 2 deletions ui/src/AttachmentsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { createEventDispatcher, getContext } from "svelte";
import type { KanDoStore } from "./stores/kando";
import type { WALUrl } from "./utils/util";
import { weaveUrlToWAL } from "@lightningrodlabs/we-applet";
import { weaveUrlToWAL } from "@theweave/api";
import SvgIcon from "./SvgIcon.svelte";
import { hrlToString } from "@holochain-open-dev/utils";
import '@lightningrodlabs/we-elements/dist/elements/wal-embed.js';
import '@theweave/elements/dist/elements/wal-embed.js';
const dispatch = createEventDispatcher()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/BoardMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import KDLogoIcon from "./icons/KDLogoIcon.svelte";
import BoardMenuItem from "./BoardMenuItem.svelte";
import { BoardType } from "./boardList";
import { isWeContext } from "@lightningrodlabs/we-applet";
import { isWeContext } from "@theweave/api";
import { UngroupedName } from "./board";
import CloneManagerDialog from "./CloneManagerDialog.svelte";
import CloneManagerShareDialog from "./CloneManagerShareDialog.svelte";
Expand Down
2 changes: 1 addition & 1 deletion ui/src/CardDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import ClickEdit from './ClickEdit.svelte';
import AttachmentsList from './AttachmentsList.svelte';
import AttachmentsDialog from "./AttachmentsDialog.svelte"
import type { WAL } from '@lightningrodlabs/we-applet';
import type { WAL } from '@theweave/api';
const { getStore } :any = getContext("store");
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Folk.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { KanDoStore } from "./stores/kando";
import Avatar from './Avatar.svelte';
import { get } from 'svelte/store';
import { isWeContext } from '@lightningrodlabs/we-applet';
import { isWeContext } from '@theweave/api';
const { getStore } :any = getContext('store');
const store:KanDoStore = getStore();
Expand Down
2 changes: 1 addition & 1 deletion ui/src/KanDoPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import hljs from 'highlight.js';
import AttachmentsList from './AttachmentsList.svelte';
import AttachmentsDialog from "./AttachmentsDialog.svelte"
import type { WAL } from "@lightningrodlabs/we-applet";
import type { WAL } from "@theweave/api";
import DisableForOs from "./DisableForOs.svelte";
import FeedElement from "./FeedElement.svelte";
Expand Down
2 changes: 1 addition & 1 deletion ui/src/SettingsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { deserializeExport, exportBoards } from "./export";
import { DocumentStore, WorkspaceStore } from "@holochain-syn/core";
import { encodeHashToBase64 } from "@holochain/client";
import { isWeContext } from "@lightningrodlabs/we-applet";
import { isWeContext } from "@theweave/api";
import DisableForOs from "./DisableForOs.svelte";
const { getStore } :any = getContext('store');
Expand Down
19 changes: 14 additions & 5 deletions ui/src/boardList.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { LazyHoloHashMap } from "@holochain-open-dev/utils";
import { derived, get, writable, type Readable, type Writable } from "svelte/store";
import { type EntryHash, type EntryHashB64, encodeHashToBase64 } from "@holochain/client";
import { type EntryHash, type EntryHashB64, encodeHashToBase64, decodeHashFromBase64, type DnaHash } from "@holochain/client";
import {toPromise, type AsyncReadable, pipe, joinAsync, asyncDerived, sliceAndJoin, alwaysSubscribed} from '@holochain-open-dev/stores'
import { SynStore, WorkspaceStore, stateFromCommit } from "@holochain-syn/core";
import type { ProfilesStore } from "@holochain-open-dev/profiles";
import { cloneDeep } from "lodash";
import { Board, feedItems, type BoardState, deltaToFeedString, feedItemShouldNotify, MAX_FEED_ITEMS } from "./board";
import { Board, feedItems, type BoardState, deltaToFeedString, feedItemShouldNotify, MAX_FEED_ITEMS, getDeltaCardData } from "./board";
import { hashEqual } from "./utils/util";
import type { WeaveClient } from "@lightningrodlabs/we-applet";
import type { WAL, WeaveClient } from "@theweave/api";
import { NotificationType, SeenType } from "./stores/kando";

export enum BoardType {
Expand Down Expand Up @@ -91,18 +91,27 @@ export class BoardList {
body=`${body} to:`
feedItem.content.delta.agents.forEach(agent=>body=`${body} ${agent}`)
}
const [cardId, cardTitle] = getDeltaCardData(boardState,feedItem.content.delta)
const aboutWal = { hrl: [this.dnaHash, this.activeBoardHash], context: "" }
if (cardId) {
aboutWal.context = cardId
}

notifications.push({
title: `${boardState.name} updated`,
body,
notification_type: "change",
notification_type: feedItem.content.delta.type,
icon_src: undefined,
urgency: notifyType,
fromAgent: decodeHashFromBase64(feedItem.author),
aboutWal,
timestamp
})
}
this.notifiedItems[key] = timestamp
}
})
console.log("FISH:", notifications)
if (notifications.length > 0) {
this.weaveClient.notifyFrame(notifications)
}
Expand All @@ -127,7 +136,7 @@ export class BoardList {
return {board,latestState, tip: tip ? tip.entryHash: undefined}}))
})

constructor(public profilesStore: ProfilesStore, public synStore: SynStore, public weaveClient : WeaveClient, public notifications: Readable<{[key: string]: NotificationType}>) {
constructor(public profilesStore: ProfilesStore, public dnaHash:DnaHash, public synStore: SynStore, public weaveClient : WeaveClient, public notifications: Readable<{[key: string]: NotificationType}>) {

const boardHashes = asyncDerived(this.synStore.documentsByTag.get(BoardType.active),x=>Array.from(x.keys()))
this.activeBoardHashes = boardHashes
Expand Down
2 changes: 1 addition & 1 deletion ui/src/stores/cloneManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@holochain/client';
import { get, writable, type Writable } from "svelte/store";
import { ProfilesClient, ProfilesStore } from '@holochain-open-dev/profiles';
import type { WeaveClient } from '@lightningrodlabs/we-applet';
import type { WeaveClient } from '@theweave/api';
import { v7 as uuidv7 } from "uuid";
import { asyncDerived, type Loadable } from '@square/svelte-store';
import { hashEqual } from '../utils/util';
Expand Down
4 changes: 2 additions & 2 deletions ui/src/stores/kando.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { v1 as uuidv1 } from "uuid";
import { derived, get, writable, type Unsubscriber, type Writable } from "svelte/store";
import { ProfilesStore } from '@holochain-open-dev/profiles';
import { UngroupedName, type BoardState } from '../board';
import type { WeaveClient } from '@lightningrodlabs/we-applet';
import type { WeaveClient } from '@theweave/api';
import { HoloHashMap } from '@holochain-open-dev/utils';
import { KanDoCloneManagerStore } from './cloneManager';

Expand Down Expand Up @@ -126,7 +126,7 @@ export class KanDoStore {
break;
}
}
this.boardList = new BoardList(this.profilesStore, this.synStore, this.weaveClient, derived(this.uiProps, props=>props.notifications))
this.boardList = new BoardList(this.profilesStore, this.dnaHash, this.synStore, this.weaveClient, derived(this.uiProps, props=>props.notifications))
this.boardList.activeBoard.subscribe((board)=>{
if (this.unsub) {
this.unsub()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/utils/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AppClient, type EntryHash, type DnaHash, CellType } from "@holochain/client";
//import type { HrlB64WithContext, WAL } from "@lightningrodlabs/we-applet";
//import type { HrlB64WithContext, WAL } from "@theweave/api";

export function onVisible(element, callback) {
new IntersectionObserver((entries, observer) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/we.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BoardEphemeralState, BoardState } from './board';
import { asyncDerived, pipe, sliceAndJoin, toPromise } from '@holochain-open-dev/stores';
import { BoardType } from './boardList';
import { LazyHoloHashMap } from '@holochain-open-dev/utils';
import type { AppletHash, AppletServices, AssetInfo, RecordInfo, WAL, WeaveServices } from '@lightningrodlabs/we-applet';
import type { AppletHash, AppletServices, AssetInfo, RecordInfo, WAL, WeaveServices } from '@theweave/api';
import { getMyDna } from './utils/util';
import type { AppClient, RoleName } from '@holochain/client';

Expand Down
2 changes: 1 addition & 1 deletion we_dev/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@lightningrodlabs/we-dev-cli';
import { defineConfig } from '@theweave/cli';

export default defineConfig({
groups: [
Expand Down

0 comments on commit 0f4ce1f

Please sign in to comment.