@riebeckite/plugin-ux 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 +2 -1
- package/README_ja.md +3 -2
- package/dist/index.js +6 -9
- package/package.json +2 -2
package/README.md
CHANGED
package/README_ja.md
CHANGED
|
@@ -57,7 +57,7 @@ export default defineConfig({
|
|
|
57
57
|
<script type="application/json" id="rb-ux-config" data-rb-ux-config>{...}</script>
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
`initUx()` はこの要素を読み取って設定を復元します。要素が無い場合は全機能が有効な既定値で動作します。挿入は `onPostProcessed` で行い、`onManifestCreated`
|
|
60
|
+
`initUx()` はこの要素を読み取って設定を復元します。要素が無い場合は全機能が有効な既定値で動作します。挿入は `onPostProcessed` で行い、`onManifestCreated` でも未挿入の記事エントリへ反映します。挿入はページごとに一度だけで、`data-rb-ux-config` を目印に重複挿入を防ぎます。
|
|
61
61
|
|
|
62
62
|
## 出力される HTML / CSS フック
|
|
63
63
|
|
|
@@ -97,4 +97,5 @@ export default defineConfig({
|
|
|
97
97
|
|
|
98
98
|
## 関連資料
|
|
99
99
|
|
|
100
|
-
- [プラグインシステム](../../../docs/ja/reference/plugin-api.md)
|
|
100
|
+
- [プラグインシステム](../../../docs/ja/docs/reference/plugin-api.md)
|
|
101
|
+
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createClientEntry,
|
|
4
4
|
createStyleAsset,
|
|
5
|
-
definePlugin
|
|
6
|
-
isPublished
|
|
5
|
+
definePlugin
|
|
7
6
|
} from "@riebeckite/core";
|
|
8
7
|
|
|
9
8
|
// src/inject.ts
|
|
@@ -55,26 +54,24 @@ function injectUxConfig(html, config) {
|
|
|
55
54
|
// index.ts
|
|
56
55
|
function uxPlugin(options = {}) {
|
|
57
56
|
const config = resolveUxConfig(options);
|
|
58
|
-
const tracked = /* @__PURE__ */ new Map();
|
|
59
57
|
return definePlugin({
|
|
60
58
|
name: "ux",
|
|
59
|
+
processedContentCache: {
|
|
60
|
+
version: "ux-v1",
|
|
61
|
+
dependencyMode: "none"
|
|
62
|
+
},
|
|
61
63
|
options,
|
|
62
64
|
validateOptions: validateUxOptions,
|
|
63
65
|
assets: [createStyleAsset("ux")],
|
|
64
66
|
clientEntries: [createClientEntry("ux", "initUx")],
|
|
65
67
|
onPostProcessed: (context) => {
|
|
66
68
|
context.content.html = injectUxConfig(context.content.html, config);
|
|
67
|
-
tracked.set(context.slug, context.content);
|
|
68
69
|
},
|
|
69
70
|
onManifestCreated: (context) => {
|
|
70
|
-
const
|
|
71
|
-
for (const entry of context.manifest.entries) {
|
|
72
|
-
if (siteConfig && !isPublished(siteConfig, entry.frontmatter)) continue;
|
|
71
|
+
for (const entry of context.manifest.publicEntries) {
|
|
73
72
|
const html = injectUxConfig(entry.html, config);
|
|
74
73
|
if (html === entry.html) continue;
|
|
75
74
|
entry.html = html;
|
|
76
|
-
const content = tracked.get(entry.slug);
|
|
77
|
-
if (content) content.html = html;
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-ux",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
24
|
+
"@riebeckite/core": "0.0.15"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|