diff --git a/package-lock.json b/package-lock.json index 818a548..3e05c13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -920,9 +920,9 @@ } }, "node_modules/@lightningrodlabs/we-applet": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-applet/-/we-applet-0.12.2.tgz", - "integrity": "sha512-o4q91qgSPvGobZag5l2gaSJECGPVjumBjYAKDZzYwutg2TE4SWbVmZY2LXbmz2h7LBYE9JWsuJIFn/sKZZux+g==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-applet/-/we-applet-0.14.0.tgz", + "integrity": "sha512-J9yvqlh5o8RdaNHDSoij4UJWP87okU7NKggHKKnwG3vA0NLhVY2TnHYYAzvIl5D+sZdRXEedoLqOVmdhkAUoWg==", "dependencies": { "@holochain/client": "0.16.6" } @@ -9768,7 +9768,7 @@ "@holochain-open-dev/stores": "^0.8.3", "@holochain-open-dev/utils": "^0.16.0", "@holochain/client": "0.16", - "@lightningrodlabs/we-applet": "^0.12.2", + "@lightningrodlabs/we-applet": "^0.14.0", "@lit/context": "^1.0.0", "@lit/localize": "^0.12.0", "@open-wc/scoped-elements": "^2.1.4", diff --git a/ui/package.json b/ui/package.json index 52e8f55..7990c97 100644 --- a/ui/package.json +++ b/ui/package.json @@ -21,7 +21,7 @@ "@holochain-open-dev/stores": "^0.8.3", "@holochain-open-dev/utils": "^0.16.0", "@holochain/client": "0.16", - "@lightningrodlabs/we-applet": "^0.12.2", + "@lightningrodlabs/we-applet": "^0.14.0", "@lit/context": "^1.0.0", "@lit/localize": "^0.12.0", "lit": "^3.0.0", diff --git a/ui/src/elements/how-document.ts b/ui/src/elements/how-document.ts index 6dec3de..9f32162 100644 --- a/ui/src/elements/how-document.ts +++ b/ui/src/elements/how-document.ts @@ -14,6 +14,9 @@ import { } from "@scoped-elements/material-web"; import '@holochain-open-dev/profiles/dist/elements/agent-avatar.js'; +import '@shoelace-style/shoelace/dist/components/icon/icon.js'; +import '@shoelace-style/shoelace/dist/components/button/button.js'; + import { HowNewSectionDialog } from "./how-new-section-dialog"; import { HowSection } from "./how-section"; import { HowComment } from "./how-comment"; @@ -538,6 +541,7 @@ import { hrlB64WithContextToRaw, hrlWithContextToB64 } from "../util"; } const docStats: DocumentStats = doc.getStats() let affordancesHTML: Array = [] + let attachmentsHTML: Array = [] if (!this.readOnly) { this.controls.forEach(control=>{ affordancesHTML = affordancesHTML.concat(control.affordances(this._store.myAgentPubKey, doc, this._confirmElem!)) @@ -556,12 +560,9 @@ import { hrlB64WithContextToRaw, hrlWithContextToB64 } from "../util"; if (this._store.weClient) { const isSteward = unit.stewards.includes(this._store.myAgentPubKey) if (isSteward) { - affordancesHTML.push(html` -
+ attachmentsHTML.push(html` { const attachment = { hrl: [this._store.dnaHash, decodeHashFromBase64(this.currentDocumentEh)], context: {} } // @ts-ignore @@ -569,37 +570,35 @@ import { hrlB64WithContextToRaw, hrlWithContextToB64 } from "../util"; }} > this.addAttachment()} > -
`) + `) } for (const mark of doc.marks.filter(m=>m.markType==MarkTypes.Attachment)) { const attachment = JSON.parse(`${mark.mark}`) - affordancesHTML.push(html` -
- ${until(this._store.weClient.entryInfo(hrlB64WithContextToRaw(attachment).hrl) - .then(res=> { - if (res) { - const entryInfo = res.entryInfo - return html` - ${entryInfo.name} - - { + attachmentsHTML.push(html` + `) } @@ -616,6 +615,8 @@ import { hrlB64WithContextToRaw, hrlWithContextToB64 } from "../util"; tasksHTML = tasksHTML.concat(control.tasks(this._store.myAgentPubKey, doc)) }) return html` + ${attachmentsHTML.length>0 ? html`
${attachmentsHTML}
`:''} +