From 2e7024886b134d650fce667c791dfb7a9b9aed0e Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sun, 29 Mar 2026 16:14:02 +0200 Subject: [PATCH] fix: correct macro API for textarea, file-input, and tag-input in compose UI - label is a string, not { text: "..." } - EasyMDE editor enabled via field.attributes (editor, editor-endpoint, editor-id, editor-image-upload) - file-input endpoint goes in field.attributes.endpoint - tag-input uses flat opts (label string, hint string) - Bump to 3.11.1 --- package-lock.json | 4 ++-- package.json | 2 +- views/activitypub-compose.njk | 36 +++++++++++++++++++++++------------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index f988de5..07704b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "3.11.0", + "version": "3.11.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "3.11.0", + "version": "3.11.1", "license": "MIT", "dependencies": { "@fedify/debugger": "^2.1.0", diff --git a/package.json b/package.json index 5f057ae..c146009 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "3.11.0", + "version": "3.11.1", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit", diff --git a/views/activitypub-compose.njk b/views/activitypub-compose.njk index a8d4047..fec5b6a 100644 --- a/views/activitypub-compose.njk +++ b/views/activitypub-compose.njk @@ -45,33 +45,45 @@ {# Rich content editor (EasyMDE with media browser) #}
{{ textarea({ - id: "content", name: "content", - label: { text: __("activitypub.compose.contentLabel") if __("activitypub.compose.contentLabel") else "Content" }, - attributes: { - rows: "8", - required: "true" - }, - endpoint: mediaEndpoint + label: "Content", + rows: 8, + field: { + attributes: { + editor: true, + "editor-endpoint": mediaEndpoint, + "editor-id": "ap-compose-content", + "editor-locale": application.locale if application else "en", + "editor-image-upload": true + } + } }) }}
{# Featured image #}
{{ fileInput({ - id: "photo", name: "photo", - label: { text: __("activitypub.compose.photoLabel") if __("activitypub.compose.photoLabel") else "Photo" }, - endpoint: mediaEndpoint + label: "Photo", + field: { + attributes: { + endpoint: mediaEndpoint + } + }, + accept: "image/*", + attributes: { + placeholder: "https://" + } }) }}
{# Tags / categories #}
{{ tagInput({ - id: "category", name: "category", - label: { text: __("activitypub.compose.tagsLabel") if __("activitypub.compose.tagsLabel") else "Tags" } + label: "Tags", + optional: true, + hint: "Separate with commas" }) }}