@ox-content/vite-plugin 2.90.0 → 3.0.0-alpha.10
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/dist/index.cjs +14800 -3855
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3680 -524
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3680 -524
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +15797 -4887
- package/dist/index.mjs.map +1 -1
- package/dist/styles/all.css +10 -0
- package/dist/styles/core.css +2169 -0
- package/dist/styles/github.css +256 -0
- package/dist/styles/magic-links.css +32 -0
- package/dist/styles/mermaid.css +151 -0
- package/dist/styles/not-by-ai.css +43 -0
- package/dist/styles/ogp.css +179 -0
- package/dist/styles/social.css +526 -0
- package/dist/styles/tabs.css +202 -0
- package/dist/styles/twitter-full.css +452 -0
- package/dist/styles/youtube.css +77 -0
- package/dist/vitepress.cjs +707 -15
- package/dist/vitepress.cjs.map +1 -1
- package/dist/vitepress.mjs +657 -15
- package/dist/vitepress.mjs.map +1 -1
- package/package.json +28 -9
- package/dist/interop.cjs +0 -31
- package/dist/interop.cjs.map +0 -1
- package/dist/interop.mjs +0 -26
- package/dist/interop.mjs.map +0 -1
- package/dist/tabs.cjs +0 -98
- package/dist/tabs.cjs.map +0 -1
- package/dist/tabs.mjs +0 -99
- package/dist/tabs.mjs.map +0 -1
package/dist/tabs.cjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
const require_vitepress = require("./vitepress.cjs");
|
|
2
|
-
//#region src/plugins/tabs.ts
|
|
3
|
-
/**
|
|
4
|
-
* Tabs Plugin - Pure CSS implementation
|
|
5
|
-
*
|
|
6
|
-
* Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has()
|
|
7
|
-
* based tab switching (no JavaScript required).
|
|
8
|
-
*
|
|
9
|
-
* The HTML rewrite is performed in Rust (`transformTabsEmbeds` in
|
|
10
|
-
* @ox-content/napi), replacing the previous rehype parse/stringify round-trip.
|
|
11
|
-
* The per-build group counter (consumed by `generateTabsCSS`) stays here and is
|
|
12
|
-
* advanced by the number of groups the Rust transform reports, so CSS
|
|
13
|
-
* generation still covers exactly the groups that were emitted.
|
|
14
|
-
*/
|
|
15
|
-
var tabs_exports = /* @__PURE__ */ require_vitepress.__exportAll({
|
|
16
|
-
generateTabsCSS: () => generateTabsCSS,
|
|
17
|
-
getTabGroupCounter: () => getTabGroupCounter,
|
|
18
|
-
resetTabGroupCounter: () => resetTabGroupCounter,
|
|
19
|
-
setTabGroupCounter: () => setTabGroupCounter,
|
|
20
|
-
transformTabs: () => transformTabs
|
|
21
|
-
});
|
|
22
|
-
let tabGroupCounter = 0;
|
|
23
|
-
/**
|
|
24
|
-
* Reset tab group counter (for testing and per dev-server request).
|
|
25
|
-
*/
|
|
26
|
-
function resetTabGroupCounter() {
|
|
27
|
-
tabGroupCounter = 0;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Read the shared tab group counter. Other tab-like transforms (such as the
|
|
31
|
-
* package-manager tabs) share this counter so `data-group` ids and the CSS
|
|
32
|
-
* generated by {@link generateTabsCSS} stay unique across a page.
|
|
33
|
-
*/
|
|
34
|
-
function getTabGroupCounter() {
|
|
35
|
-
return tabGroupCounter;
|
|
36
|
-
}
|
|
37
|
-
/** Set the shared tab group counter (advanced by other tab-like transforms). */
|
|
38
|
-
function setTabGroupCounter(value) {
|
|
39
|
-
tabGroupCounter = value;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Transform Tabs components in HTML.
|
|
43
|
-
*/
|
|
44
|
-
async function transformTabs(html) {
|
|
45
|
-
if (!/<tabs/i.test(html)) return html;
|
|
46
|
-
const result = (await require_vitepress.importNapiModule()).transformTabsEmbeds(html, tabGroupCounter);
|
|
47
|
-
tabGroupCounter += result.groupCount;
|
|
48
|
-
return result.html;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Generate dynamic CSS for :has() based tab switching.
|
|
52
|
-
* This is needed because :has() selectors need unique IDs.
|
|
53
|
-
*/
|
|
54
|
-
function generateTabsCSS(groupCount) {
|
|
55
|
-
if (groupCount === 0) return "";
|
|
56
|
-
let css = "/* Dynamic Tabs CSS */\n";
|
|
57
|
-
for (let g = 0; g < groupCount; g++) for (let t = 0; t < 8; t++) css += `.ox-tabs[data-group="${g}"]:has(#ox-tab-${g}-${t}:checked) .ox-tab-panel[data-tab="${t}"] { display: block; }\n`;
|
|
58
|
-
return css;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
Object.defineProperty(exports, "generateTabsCSS", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function() {
|
|
64
|
-
return generateTabsCSS;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, "getTabGroupCounter", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function() {
|
|
70
|
-
return getTabGroupCounter;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, "resetTabGroupCounter", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function() {
|
|
76
|
-
return resetTabGroupCounter;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "setTabGroupCounter", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function() {
|
|
82
|
-
return setTabGroupCounter;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "tabs_exports", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function() {
|
|
88
|
-
return tabs_exports;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "transformTabs", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function() {
|
|
94
|
-
return transformTabs;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=tabs.cjs.map
|
package/dist/tabs.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.cjs","names":["importNapiModule"],"sources":["../src/plugins/tabs.ts"],"sourcesContent":["/**\n * Tabs Plugin - Pure CSS implementation\n *\n * Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has()\n * based tab switching (no JavaScript required).\n *\n * The HTML rewrite is performed in Rust (`transformTabsEmbeds` in\n * @ox-content/napi), replacing the previous rehype parse/stringify round-trip.\n * The per-build group counter (consumed by `generateTabsCSS`) stays here and is\n * advanced by the number of groups the Rust transform reports, so CSS\n * generation still covers exactly the groups that were emitted.\n */\n\nimport { importNapiModule } from \"../napi\";\n\nlet tabGroupCounter = 0;\n\n/**\n * Reset tab group counter (for testing and per dev-server request).\n */\nexport function resetTabGroupCounter(): void {\n tabGroupCounter = 0;\n}\n\n/**\n * Read the shared tab group counter. Other tab-like transforms (such as the\n * package-manager tabs) share this counter so `data-group` ids and the CSS\n * generated by {@link generateTabsCSS} stay unique across a page.\n */\nexport function getTabGroupCounter(): number {\n return tabGroupCounter;\n}\n\n/** Set the shared tab group counter (advanced by other tab-like transforms). */\nexport function setTabGroupCounter(value: number): void {\n tabGroupCounter = value;\n}\n\n/**\n * Transform Tabs components in HTML.\n */\nexport async function transformTabs(html: string): Promise<string> {\n // Cheap marker check: skip the NAPI call entirely when there's no `<tabs>`\n // element. The Rust side guards the same way, but short-circuiting here\n // avoids marshalling the whole document across the boundary.\n if (!/<tabs/i.test(html)) {\n return html;\n }\n\n const mod = await importNapiModule();\n const result = mod.transformTabsEmbeds(html, tabGroupCounter);\n tabGroupCounter += result.groupCount;\n return result.html;\n}\n\n/**\n * Generate dynamic CSS for :has() based tab switching.\n * This is needed because :has() selectors need unique IDs.\n */\nexport function generateTabsCSS(groupCount: number): string {\n if (groupCount === 0) return \"\";\n\n let css = \"/* Dynamic Tabs CSS */\\n\";\n\n for (let g = 0; g < groupCount; g++) {\n for (let t = 0; t < 8; t++) {\n css += `.ox-tabs[data-group=\"${g}\"]:has(#ox-tab-${g}-${t}:checked) .ox-tab-panel[data-tab=\"${t}\"] { display: block; }\\n`;\n }\n }\n\n return css;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,IAAI,kBAAkB;;;;AAKtB,SAAgB,uBAA6B;CAC3C,kBAAkB;AACpB;;;;;;AAOA,SAAgB,qBAA6B;CAC3C,OAAO;AACT;;AAGA,SAAgB,mBAAmB,OAAqB;CACtD,kBAAkB;AACpB;;;;AAKA,eAAsB,cAAc,MAA+B;CAIjE,IAAI,CAAC,SAAS,KAAK,IAAI,GACrB,OAAO;CAIT,MAAM,UAAS,MADGA,kBAAAA,iBAAiB,EAAA,CAChB,oBAAoB,MAAM,eAAe;CAC5D,mBAAmB,OAAO;CAC1B,OAAO,OAAO;AAChB;;;;;AAMA,SAAgB,gBAAgB,YAA4B;CAC1D,IAAI,eAAe,GAAG,OAAO;CAE7B,IAAI,MAAM;CAEV,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,KAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KACrB,OAAO,wBAAwB,EAAE,iBAAiB,EAAE,GAAG,EAAE,oCAAoC,EAAE;CAInG,OAAO;AACT"}
|
package/dist/tabs.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { d as importNapiModule } from "./vitepress.mjs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
//#region \0rolldown/runtime.js
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esmMin = (fn, res, err) => () => {
|
|
9
|
-
if (err) throw err[0];
|
|
10
|
-
try {
|
|
11
|
-
return fn && (res = fn(fn = 0)), res;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
throw err = [e], e;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var __exportAll = (all, no_symbols) => {
|
|
17
|
-
let target = {};
|
|
18
|
-
for (var name in all) __defProp(target, name, {
|
|
19
|
-
get: all[name],
|
|
20
|
-
enumerable: true
|
|
21
|
-
});
|
|
22
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
-
return target;
|
|
24
|
-
};
|
|
25
|
-
var __copyProps = (to, from, except, desc) => {
|
|
26
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
-
key = keys[i];
|
|
28
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
29
|
-
get: ((k) => from[k]).bind(null, key),
|
|
30
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return to;
|
|
34
|
-
};
|
|
35
|
-
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
-
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/plugins/tabs.ts
|
|
39
|
-
/**
|
|
40
|
-
* Tabs Plugin - Pure CSS implementation
|
|
41
|
-
*
|
|
42
|
-
* Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has()
|
|
43
|
-
* based tab switching (no JavaScript required).
|
|
44
|
-
*
|
|
45
|
-
* The HTML rewrite is performed in Rust (`transformTabsEmbeds` in
|
|
46
|
-
* @ox-content/napi), replacing the previous rehype parse/stringify round-trip.
|
|
47
|
-
* The per-build group counter (consumed by `generateTabsCSS`) stays here and is
|
|
48
|
-
* advanced by the number of groups the Rust transform reports, so CSS
|
|
49
|
-
* generation still covers exactly the groups that were emitted.
|
|
50
|
-
*/
|
|
51
|
-
var tabs_exports = /* @__PURE__ */ __exportAll({
|
|
52
|
-
generateTabsCSS: () => generateTabsCSS,
|
|
53
|
-
getTabGroupCounter: () => getTabGroupCounter,
|
|
54
|
-
resetTabGroupCounter: () => resetTabGroupCounter,
|
|
55
|
-
setTabGroupCounter: () => setTabGroupCounter,
|
|
56
|
-
transformTabs: () => transformTabs
|
|
57
|
-
});
|
|
58
|
-
let tabGroupCounter = 0;
|
|
59
|
-
/**
|
|
60
|
-
* Reset tab group counter (for testing and per dev-server request).
|
|
61
|
-
*/
|
|
62
|
-
function resetTabGroupCounter() {
|
|
63
|
-
tabGroupCounter = 0;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Read the shared tab group counter. Other tab-like transforms (such as the
|
|
67
|
-
* package-manager tabs) share this counter so `data-group` ids and the CSS
|
|
68
|
-
* generated by {@link generateTabsCSS} stay unique across a page.
|
|
69
|
-
*/
|
|
70
|
-
function getTabGroupCounter() {
|
|
71
|
-
return tabGroupCounter;
|
|
72
|
-
}
|
|
73
|
-
/** Set the shared tab group counter (advanced by other tab-like transforms). */
|
|
74
|
-
function setTabGroupCounter(value) {
|
|
75
|
-
tabGroupCounter = value;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Transform Tabs components in HTML.
|
|
79
|
-
*/
|
|
80
|
-
async function transformTabs(html) {
|
|
81
|
-
if (!/<tabs/i.test(html)) return html;
|
|
82
|
-
const result = (await importNapiModule()).transformTabsEmbeds(html, tabGroupCounter);
|
|
83
|
-
tabGroupCounter += result.groupCount;
|
|
84
|
-
return result.html;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Generate dynamic CSS for :has() based tab switching.
|
|
88
|
-
* This is needed because :has() selectors need unique IDs.
|
|
89
|
-
*/
|
|
90
|
-
function generateTabsCSS(groupCount) {
|
|
91
|
-
if (groupCount === 0) return "";
|
|
92
|
-
let css = "/* Dynamic Tabs CSS */\n";
|
|
93
|
-
for (let g = 0; g < groupCount; g++) for (let t = 0; t < 8; t++) css += `.ox-tabs[data-group="${g}"]:has(#ox-tab-${g}-${t}:checked) .ox-tab-panel[data-tab="${t}"] { display: block; }\n`;
|
|
94
|
-
return css;
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
export { tabs_exports as a, __exportAll as c, setTabGroupCounter as i, __require as l, getTabGroupCounter as n, transformTabs as o, resetTabGroupCounter as r, __esmMin as s, generateTabsCSS as t, __toCommonJS as u };
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=tabs.mjs.map
|
package/dist/tabs.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.mjs","names":[],"sources":["../src/plugins/tabs.ts"],"sourcesContent":["/**\n * Tabs Plugin - Pure CSS implementation\n *\n * Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has()\n * based tab switching (no JavaScript required).\n *\n * The HTML rewrite is performed in Rust (`transformTabsEmbeds` in\n * @ox-content/napi), replacing the previous rehype parse/stringify round-trip.\n * The per-build group counter (consumed by `generateTabsCSS`) stays here and is\n * advanced by the number of groups the Rust transform reports, so CSS\n * generation still covers exactly the groups that were emitted.\n */\n\nimport { importNapiModule } from \"../napi\";\n\nlet tabGroupCounter = 0;\n\n/**\n * Reset tab group counter (for testing and per dev-server request).\n */\nexport function resetTabGroupCounter(): void {\n tabGroupCounter = 0;\n}\n\n/**\n * Read the shared tab group counter. Other tab-like transforms (such as the\n * package-manager tabs) share this counter so `data-group` ids and the CSS\n * generated by {@link generateTabsCSS} stay unique across a page.\n */\nexport function getTabGroupCounter(): number {\n return tabGroupCounter;\n}\n\n/** Set the shared tab group counter (advanced by other tab-like transforms). */\nexport function setTabGroupCounter(value: number): void {\n tabGroupCounter = value;\n}\n\n/**\n * Transform Tabs components in HTML.\n */\nexport async function transformTabs(html: string): Promise<string> {\n // Cheap marker check: skip the NAPI call entirely when there's no `<tabs>`\n // element. The Rust side guards the same way, but short-circuiting here\n // avoids marshalling the whole document across the boundary.\n if (!/<tabs/i.test(html)) {\n return html;\n }\n\n const mod = await importNapiModule();\n const result = mod.transformTabsEmbeds(html, tabGroupCounter);\n tabGroupCounter += result.groupCount;\n return result.html;\n}\n\n/**\n * Generate dynamic CSS for :has() based tab switching.\n * This is needed because :has() selectors need unique IDs.\n */\nexport function generateTabsCSS(groupCount: number): string {\n if (groupCount === 0) return \"\";\n\n let css = \"/* Dynamic Tabs CSS */\\n\";\n\n for (let g = 0; g < groupCount; g++) {\n for (let t = 0; t < 8; t++) {\n css += `.ox-tabs[data-group=\"${g}\"]:has(#ox-tab-${g}-${t}:checked) .ox-tab-panel[data-tab=\"${t}\"] { display: block; }\\n`;\n }\n }\n\n return css;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAI,kBAAkB;;;;AAKtB,SAAgB,uBAA6B;CAC3C,kBAAkB;AACpB;;;;;;AAOA,SAAgB,qBAA6B;CAC3C,OAAO;AACT;;AAGA,SAAgB,mBAAmB,OAAqB;CACtD,kBAAkB;AACpB;;;;AAKA,eAAsB,cAAc,MAA+B;CAIjE,IAAI,CAAC,SAAS,KAAK,IAAI,GACrB,OAAO;CAIT,MAAM,UAAS,MADG,iBAAiB,EAAA,CAChB,oBAAoB,MAAM,eAAe;CAC5D,mBAAmB,OAAO;CAC1B,OAAO,OAAO;AAChB;;;;;AAMA,SAAgB,gBAAgB,YAA4B;CAC1D,IAAI,eAAe,GAAG,OAAO;CAE7B,IAAI,MAAM;CAEV,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,KAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KACrB,OAAO,wBAAwB,EAAE,iBAAiB,EAAE,GAAG,EAAE,oCAAoC,EAAE;CAInG,OAAO;AACT"}
|