do11y 0.5.10 → 0.5.12
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/docs/html/render.js
CHANGED
|
@@ -4,6 +4,10 @@ import { JSDOM } from "jsdom";
|
|
|
4
4
|
const template = readFileSync(join(import.meta.dirname, "index.html"), "utf-8");
|
|
5
5
|
export const render = (base = "", script, stylesheets = []) => {
|
|
6
6
|
const jsdom = new JSDOM(template);
|
|
7
|
+
const faviconElement = jsdom.window.document.createElement("link");
|
|
8
|
+
faviconElement.setAttribute("rel", "icon");
|
|
9
|
+
faviconElement.setAttribute("href", `${base}favicon.ico`);
|
|
10
|
+
jsdom.window.document.documentElement.appendChild(faviconElement);
|
|
7
11
|
const scriptElement = jsdom.window.document.createElement("script");
|
|
8
12
|
scriptElement.setAttribute("type", "module");
|
|
9
13
|
scriptElement.setAttribute("src", `${base}${script}`);
|
package/dist/docs/vite-config.js
CHANGED
|
@@ -34,18 +34,27 @@ const getPlugin = async (plugin) => {
|
|
|
34
34
|
const getUserPlugins = async (userViteConfig) => {
|
|
35
35
|
const userPlugins = userViteConfig.plugins?.map(async (p) => await getPlugin(p)) ?? [];
|
|
36
36
|
const resolvedUserPlugins = (await Promise.all(userPlugins)).flat();
|
|
37
|
-
const vuePluginApi = resolvedUserPlugins.find((p) => p.name === "vite:vue")?.api;
|
|
37
|
+
const vuePluginApi = resolvedUserPlugins.find((p) => p.name === "vite:vue")?.api ?? {};
|
|
38
38
|
const VuePlugin = (await import("@vitejs/plugin-vue")).default;
|
|
39
|
+
const { include, exclude } = vuePluginApi;
|
|
40
|
+
const mergeInclusion = (rawValues, do11yValues) => {
|
|
41
|
+
const values = Array.isArray(rawValues) ? rawValues : rawValues ? [rawValues] : [];
|
|
42
|
+
return [...new Set([...values, ...do11yValues])];
|
|
43
|
+
};
|
|
39
44
|
return [
|
|
40
45
|
VuePlugin({
|
|
41
46
|
...vuePluginApi?.options,
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
/* prettier-ignore */
|
|
48
|
+
include: mergeInclusion(include, [
|
|
49
|
+
/\.vue$/,
|
|
50
|
+
/\.md$/
|
|
51
|
+
]),
|
|
52
|
+
exclude: mergeInclusion(exclude, [
|
|
44
53
|
/\.vue\?meta$/,
|
|
45
54
|
/\.vue\?highlight$/,
|
|
46
55
|
/\.vue\?highlight&lang=css$/,
|
|
47
56
|
/\.vue\?highlight&styleless$/,
|
|
48
|
-
],
|
|
57
|
+
]),
|
|
49
58
|
}),
|
|
50
59
|
...resolvedUserPlugins.filter((i) => i.name !== "vite:vue"),
|
|
51
60
|
];
|
package/dist/ui/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createApp as e,createBlock as t,defineComponent as n,onBeforeMount as r,openBlock as i,resolveComponent as a,unref as o}from"vue";import{createRouter as s,createWebHistory as c}from"vue-router";import l from"do11y:routes";import u from"do11y:options";import d from"do11y:page-layout";import f from"do11y:css";var p=n({__name:`Page`,setup(e){return r(async()=>{let e=document.createElement(`style`);e.innerHTML=f,document.head.appendChild(e)}),(e,n)=>{let r=a(`RouterView`);return o(d)?(i(),t(o(d),{key:0})):(i(),t(r,{key:1}))}}});(async()=>{let t=s({history:c(import.meta.env.BASE_URL),routes:l,scrollBehavior(e,t,n){if(!e.hash)return;let r=document.querySelector(e.hash);if(!r)return;let i=parseFloat(getComputedStyle(r).scrollMarginTop);return{el:e.hash,top:isNaN(i)?n?.top??0:i}}}),n=e(p);await u?.setup?.(n,t),n.use(t),n.mount(`#app`)})();
|
|
1
|
+
import{createApp as e,createBlock as t,defineComponent as n,onBeforeMount as r,openBlock as i,resolveComponent as a,unref as o}from"vue";import{createRouter as s,createWebHistory as c}from"vue-router";import l from"do11y:routes";import u from"do11y:options";import d from"do11y:page-layout";import f from"do11y:css";var p=n({__name:`Page`,setup(e){return r(async()=>{let e=document.createElement(`style`);e.innerHTML=f,document.head.appendChild(e)}),(e,n)=>{let r=a(`RouterView`);return o(d)?(i(),t(o(d),{key:0})):(i(),t(r,{key:1}))}}});(async()=>{let t=s({history:c(import.meta.env.BASE_URL),routes:l,scrollBehavior(e,t,n){if(!e.hash)return;let r=document.querySelector(e.hash);if(!r)return;let i=parseFloat(getComputedStyle(r).scrollMarginTop);return{el:e.hash,top:isNaN(i)?n?.top??0:i}}}),n=e(p);await u?.setup?.(n,t),n.use(t),await t.isReady(),n.mount(`#app`)})();
|