@riebeckite/plugin-flashcards 0.0.13 → 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
@@ -117,4 +117,5 @@ untouched. No options are passed from the build to the client; the deck reads
117
117
 
118
118
  ## See also
119
119
 
120
- - [Plugin guide](../../../docs/en/reference/plugin-api.md)
120
+ - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
121
+
package/README_ja.md CHANGED
@@ -90,4 +90,5 @@ payload は実行されない JSON で、`<` `>` `&` はエスケープ済みで
90
90
 
91
91
  ## 関連資料
92
92
 
93
- - [プラグインシステム](../../../docs/ja/reference/plugin-api.md)
93
+ - [プラグインシステム](../../../docs/ja/docs/reference/plugin-api.md)
94
+
package/dist/index.js CHANGED
@@ -158,19 +158,13 @@ function renderFallbackItem(card, className) {
158
158
  // src/runtime.ts
159
159
  function createFlashcardsRuntime(options) {
160
160
  const resolved = resolveFlashcardsOptions(options);
161
- const tracked = /* @__PURE__ */ new Map();
162
161
  return {
163
- track(slug, content) {
164
- tracked.set(slug, content);
165
- },
166
162
  resolve(manifest, diagnostics) {
167
163
  for (const entry of manifest.entries) {
168
164
  if (!entry.html.includes(FLASHCARDS_ATTRIBUTE)) continue;
169
165
  const html = replacePlaceholders(entry, resolved, diagnostics);
170
166
  if (html === entry.html) continue;
171
167
  entry.html = html;
172
- const content = tracked.get(entry.slug);
173
- if (content) content.html = html;
174
168
  }
175
169
  }
176
170
  };
@@ -400,14 +394,15 @@ function flashcards(options = {}) {
400
394
  const runtime = createFlashcardsRuntime(options);
401
395
  return definePlugin({
402
396
  name: "flashcards",
397
+ processedContentCache: {
398
+ version: "flashcards-v1",
399
+ dependencyMode: "none"
400
+ },
403
401
  options,
404
402
  validateOptions: validateFlashcardsOptions,
405
403
  extendMarkdownPipeline: (pipeline) => {
406
404
  pipeline.use(remarkFlashcards, { language: resolved.language });
407
405
  },
408
- onPostProcessed: (context) => {
409
- runtime.track(context.slug, context.content);
410
- },
411
406
  onManifestCreated: (context) => {
412
407
  runtime.resolve(context.manifest, context.diagnostics);
413
408
  },
@@ -1,7 +1,6 @@
1
- import { type ContentManifest, type Diagnostic, type PostContent } from "@riebeckite/core";
1
+ import { type ContentManifest, type Diagnostic } from "@riebeckite/core";
2
2
  import type { FlashcardsOptions } from "./types.js";
3
3
  export type FlashcardsRuntime = {
4
- track(slug: string, content: PostContent): void;
5
4
  resolve(manifest: ContentManifest, diagnostics: Diagnostic[]): void;
6
5
  };
7
6
  export declare function createFlashcardsRuntime(options: FlashcardsOptions): FlashcardsRuntime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-flashcards",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@types/mdast": "^4.0.4",
25
25
  "unist-util-visit": "^5.1.0",
26
- "@riebeckite/core": "0.0.13"
26
+ "@riebeckite/core": "0.0.15"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"