@riebeckite/plugin-share 0.0.14 → 0.0.15

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/README.md CHANGED
@@ -11,9 +11,9 @@ JavaScript; only the copy-link action is a progressive enhancement.
11
11
 
12
12
  `share()` resolves each note's `permalink` to an absolute URL, composes the
13
13
  service URLs from the note title and URL, and inserts the controls near the
14
- article. Both `entry.html` and the cached `PostContent.html` that the content
15
- route renders are updated, so the controls appear on generated pages and in
16
- feeds.
14
+ article. The controls are inserted into the manifest entry's HTML, which Core
15
+ synchronizes with the content the route renders, so they appear on generated
16
+ pages and in feeds.
17
17
 
18
18
  Supported services:
19
19
 
@@ -139,4 +139,5 @@ optional `className` is added to the root without replacing them.
139
139
 
140
140
  ## See also
141
141
 
142
- - [Plugin guide](../../../docs/en/reference/plugin-api.md)
142
+ - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
143
+
package/README_ja.md CHANGED
@@ -11,8 +11,8 @@
11
11
 
12
12
  `share()` は各ノートの `permalink` を絶対 URL に解決し、ノートのタイトルと URL
13
13
  からサービスごとの共有 URL を組み立て、記事の近くにコントロールを挿入します。
14
- `entry.html` と、コンテンツルートが描画するキャッシュ済みの `PostContent.html`
15
- の両方を更新するため、生成ページとフィードの両方に反映されます。
14
+ 挿入先はマニフェストエントリの HTML で、Core がそれをコンテンツルートの描画
15
+ HTML と同期するため、生成ページとフィードの両方に反映されます。
16
16
 
17
17
  対応サービスは次のとおりです。
18
18
 
@@ -139,4 +139,5 @@ import "@riebeckite/plugin-share/style.css";
139
139
 
140
140
  ## 関連
141
141
 
142
- - [プラグインガイド](../../../docs/ja/reference/plugin-api.md)
142
+ - [プラグインガイド](../../../docs/ja/docs/reference/plugin-api.md)
143
+
package/dist/index.d.ts CHANGED
@@ -10,10 +10,9 @@ export declare const SHARE_PLUGIN_NAME = "share";
10
10
  * Per-article share controls.
11
11
  *
12
12
  * For every entry the plugin builds absolute share URLs for the configured
13
- * services and injects the controls into both `entry.html` and the cached
14
- * `PostContent.html` that the content route renders. The links are ordinary
15
- * anchors, so they work without JavaScript; only the copy-link action is
16
- * enhanced at runtime.
13
+ * services and injects the controls into the manifest entry HTML, which is the
14
+ * final rendering source. The links are ordinary anchors, so they work without
15
+ * JavaScript; only the copy-link action is enhanced at runtime.
17
16
  */
18
17
  export declare function share(options?: ShareOptions): import("@riebeckite/core").RiebeckitePlugin<ShareOptions>;
19
18
  /** Alias matching the `*Plugin` suffix used by other plugin factories. */
package/dist/index.js CHANGED
@@ -327,14 +327,14 @@ function copyWithExecCommand(value) {
327
327
  var SHARE_PLUGIN_NAME = "share";
328
328
  function share(options = {}) {
329
329
  const resolved = resolveShareOptions(options);
330
- const processed = /* @__PURE__ */ new Map();
331
330
  return definePlugin({
332
331
  name: SHARE_PLUGIN_NAME,
332
+ processedContentCache: {
333
+ version: "share-v1",
334
+ dependencyMode: "none"
335
+ },
333
336
  options,
334
337
  validateOptions: validateShareOptions,
335
- onPostProcessed: (context) => {
336
- processed.set(context.slug, context.content);
337
- },
338
338
  onManifestCreated: (context) => {
339
339
  const { manifest, config } = context;
340
340
  if (!config) return;
@@ -347,10 +347,7 @@ function share(options = {}) {
347
347
  if (block === "") continue;
348
348
  const html = injectShareControls(entry.html, block, resolved.placement);
349
349
  entry.html = html;
350
- const content = processed.get(entry.slug);
351
- if (content) content.html = html;
352
350
  }
353
- processed.clear();
354
351
  },
355
352
  assets: [createStyleAsset(SHARE_PLUGIN_NAME)],
356
353
  clientEntries: [createClientEntry(SHARE_PLUGIN_NAME, "initShare")]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-share",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "./style.css": "./style.css"
22
22
  },
23
23
  "dependencies": {
24
- "@riebeckite/core": "0.0.14"
24
+ "@riebeckite/core": "0.0.15"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsx": "^4.22.4"