From 193eb4e3d20e7b88676c7f8b44f83e283a68fc87 Mon Sep 17 00:00:00 2001 From: hanfel-dovned Date: Wed, 5 Jun 2024 16:07:23 -0700 Subject: [PATCH] dm-htmx progress, doesn't display kids correctly --- pkg/arvo/neo/cod/std/src/con/dm-htmx.hoon | 19 +++++++ pkg/arvo/neo/cod/std/src/con/node-txt.hoon | 3 +- pkg/arvo/neo/cod/std/src/lib/messages.hoon | 61 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 pkg/arvo/neo/cod/std/src/con/dm-htmx.hoon create mode 100644 pkg/arvo/neo/cod/std/src/lib/messages.hoon diff --git a/pkg/arvo/neo/cod/std/src/con/dm-htmx.hoon b/pkg/arvo/neo/cod/std/src/con/dm-htmx.hoon new file mode 100644 index 0000000000..d0cbd83fba --- /dev/null +++ b/pkg/arvo/neo/cod/std/src/con/dm-htmx.hoon @@ -0,0 +1,19 @@ +/@ message +/- feather-icons +/- messages +:- [%ship %$ %htmx] +|= =ship +|= =bowl:neo +^- manx +::~& > bowl :: this sigpam results in endless http spinning +;div.p2 + =label "Chat" + ;div.ma.fc.g2 + =style "max-width: 650px;" + ;div.fc.g2 + =id "children" + ;+ (render-messages:messages bowl) + == + ;+ (render-sender:messages [bowl /pub]) + == +== \ No newline at end of file diff --git a/pkg/arvo/neo/cod/std/src/con/node-txt.hoon b/pkg/arvo/neo/cod/std/src/con/node-txt.hoon index 2346a11799..1aa293c5ad 100644 --- a/pkg/arvo/neo/cod/std/src/con/node-txt.hoon +++ b/pkg/arvo/neo/cod/std/src/con/node-txt.hoon @@ -4,5 +4,4 @@ :- [%node %$ %txt] |= nod=node ^- txt -(~(vol manx-utils nod) "text") - +(~(vol manx-utils nod) "text") \ No newline at end of file diff --git a/pkg/arvo/neo/cod/std/src/lib/messages.hoon b/pkg/arvo/neo/cod/std/src/lib/messages.hoon new file mode 100644 index 0000000000..a664328524 --- /dev/null +++ b/pkg/arvo/neo/cod/std/src/lib/messages.hoon @@ -0,0 +1,61 @@ +/@ message +|% +++ render-messages + |= =bowl:neo + ^- manx + ;div + =label "Messages" + ;* + %+ turn + %+ sort + %+ murn + ~(tap of:neo kids.bowl) + |= [=pith =idea:neo] + ?~ pith ~ + ?@ -.pith ~ + ?. =(-<.pith %da) ~ + `[pith idea] + |= [a=[=pith *] b=[=pith *]] + (lth ->.pith.a ->.pith.b) + render-message + == +:: +++ render-message + |= [pax=pith =idea:neo] + =/ msg !<(message q.pail.idea) + ^- manx + ;div.fc.g2.border.p3.br1 + ;div.fr.ac.jb + ;p.s-2.f3: {(scow %p from.msg)} + ;p.s-2.f3: {(scow %da now.msg)} + == + ;p: {(trip contents.msg)} + == +:: +++ render-sender + |= [=bowl:neo location=pith] + ^- manx + ;form.fc.g2 + =hx-post "{(en-tape:pith:neo :(welp /neo/hawk here.bowl location))}?stud=txt" + =hx-on-submit "this.reset()" + =hx-target "find button .loading" + =hx-swap "outerHTML" + =head "msg" + ;textarea.p2.border.br1 + =name "text" + =placeholder ". . ." + =oninput "this.setAttribute('value', this.value)" + =rows "4" + =required "" + =autocomplete "off" + ; + == + ;button.p2.b1.br1.bd1.wfc.hover.loader + ;span.loaded.s2: create + ;span.loading + ;+ loading.feather-icons + == + == + == + :: +-- \ No newline at end of file