@rmdes/indiekit-endpoint-webmention-io 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -8,6 +8,7 @@ import { syncController } from "./lib/controllers/sync-controller.js";
8
8
  import { apiController } from "./lib/controllers/api.js";
9
9
  import { startSync, stopSync } from "./lib/sync.js";
10
10
  import { waitForReady } from "@rmdes/indiekit-startup-gate";
11
+ import { WEBMENTION_BLOCKS } from "./lib/blocks.js";
11
12
 
12
13
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
14
 
@@ -44,6 +45,10 @@ export default class WebmentionEndpoint {
44
45
  };
45
46
  }
46
47
 
48
+ get blocks() {
49
+ return WEBMENTION_BLOCKS;
50
+ }
51
+
47
52
  /**
48
53
  * Protected routes (require authentication)
49
54
  * Admin dashboard, moderation, sync controls
package/lib/blocks.js ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Webmention-io v2 block declaration (Phase 7b — plugin block ownership).
3
+ *
4
+ * The `webmentions` sidebar widget was a site-config BUILTIN_BLOCKS seed
5
+ * (requiresPlugin null, gated only by the theme's legacy widgetPluginRequirements
6
+ * render-map). Declaring it here makes site-config's scanPlugins stamp
7
+ * `sourcePlugin` → `requiresPlugin` ("Webmention moderation endpoint"), so the
8
+ * block is properly plugin-gated (theme ENDPOINT_SLUGS maps it to the
9
+ * `webmention-io` loadout slug). scanPlugins precedence is `built-in < plugin
10
+ * blocks`, so this entry OVERWRITES the builtin seed on sites where the plugin is
11
+ * loaded; the seed itself is removed from site-config in Phase 7d alongside the
12
+ * legacy-map bridge.
13
+ *
14
+ * Descriptor is byte-faithful to the BUILTIN_BLOCKS entry. Bespoke template: the
15
+ * theme owns `components/widgets/webmentions.njk` (no generic `render.renderer`);
16
+ * `data.source:"api"` documents the runtime fetch.
17
+ *
18
+ * @module lib/blocks
19
+ */
20
+
21
+ /** @type {Array<object>} */
22
+ export const WEBMENTION_BLOCKS = [
23
+ {
24
+ id: "webmentions",
25
+ version: 1,
26
+ label: "Webmentions",
27
+ description: "Recent inbound/outbound webmentions",
28
+ icon: "message-circle",
29
+ category: "social",
30
+ placement: { regions: ["sidebar"], surfaces: ["homepage", "postType"] },
31
+ multiple: false,
32
+ data: { source: "api" },
33
+ schema: { type: "object", additionalProperties: false, properties: {} },
34
+ },
35
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-webmention-io",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Webmention moderation endpoint for Indiekit. Syncs webmentions from webmention.io into MongoDB with delete, block, and privacy removal capabilities.",
5
5
  "keywords": [
6
6
  "indiekit",