From cdac64cc1b92d61b5899b58e87d2545fa7187798 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Sat, 12 Oct 2024 09:27:54 +0200 Subject: [PATCH] allow turboStream on anchors too and convenience for replaceComponent --- .../WAAnchorTag.extension/instance/turboStreamCallback..st | 5 +++++ .../instance/replaceComponent.with..st | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 repository/Seaside-HotwireTurbo-Core.package/WAAnchorTag.extension/instance/turboStreamCallback..st create mode 100644 repository/Seaside-HotwireTurbo-Core.package/WATurboStreamBuilder.class/instance/replaceComponent.with..st diff --git a/repository/Seaside-HotwireTurbo-Core.package/WAAnchorTag.extension/instance/turboStreamCallback..st b/repository/Seaside-HotwireTurbo-Core.package/WAAnchorTag.extension/instance/turboStreamCallback..st new file mode 100644 index 000000000..5295fbd6a --- /dev/null +++ b/repository/Seaside-HotwireTurbo-Core.package/WAAnchorTag.extension/instance/turboStreamCallback..st @@ -0,0 +1,5 @@ +*Seaside-HotwireTurbo-Core +turboStreamCallback: aValuable + + self dataAttributeAt: 'turbo-stream' put: true. + self url addField: (self storeCallback: ((WATurboStreamCallback on: aValuable) context: canvas context)) \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo-Core.package/WATurboStreamBuilder.class/instance/replaceComponent.with..st b/repository/Seaside-HotwireTurbo-Core.package/WATurboStreamBuilder.class/instance/replaceComponent.with..st new file mode 100644 index 000000000..369b87bda --- /dev/null +++ b/repository/Seaside-HotwireTurbo-Core.package/WATurboStreamBuilder.class/instance/replaceComponent.with..st @@ -0,0 +1,4 @@ +convenience +replaceComponent: aComponent with: aRenderable + + self replace: aComponent turboframeDecoration id with: aRenderable \ No newline at end of file