do11y 0.3.0 → 0.4.0

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
@@ -49,9 +49,9 @@ Document components through meta imports (`Button.vue?meta`) which give a simpli
49
49
 
50
50
  Expected as the default export in `docs/do11y/do11y.ts`.
51
51
 
52
- You can specify a layout for each page by adding a `docs/do11y/Layout.vue` file with a `<RouterView />` in it.
52
+ You can specify a layout for each page by adding a `docs/do11y/layout/Page.vue` file with a `<RouterView />` in it.
53
53
 
54
- And you can set the home page by adding `docs/do11y/Home.vue`.
54
+ And you can set the home page by adding `docs/do11y/pages/Home.vue`.
55
55
 
56
56
  ```ts
57
57
  interface Options {
@@ -78,7 +78,7 @@ export interface ResolvedOptions extends Omit<Options, "highlighter"> {
78
78
  /**
79
79
  * Add ability to access options (`docs/do11y/do11y.ts`)
80
80
  * through `do11y:options`, the home component through `do11y:home`,
81
- * and the layout component through `do11y:layout`.
81
+ * and the layout component through `do11y:page-layout`.
82
82
  */
83
83
  declare const _default: () => Plugin;
84
84
  export default _default;
@@ -4,7 +4,7 @@ import { do11y } from "../files.js";
4
4
  /**
5
5
  * Add ability to access options (`docs/do11y/do11y.ts`)
6
6
  * through `do11y:options`, the home component through `do11y:home`,
7
- * and the layout component through `do11y:layout`.
7
+ * and the layout component through `do11y:page-layout`.
8
8
  */
9
9
  export default () => ({
10
10
  name: "do11y:options",
@@ -19,16 +19,16 @@ export default () => ({
19
19
  ? this.resolve(homeFile, importer)
20
20
  : `\0do11y:home`;
21
21
  }
22
- if (id === "do11y:layout") {
23
- const layoutFile = join(do11y, "Layout.vue");
22
+ if (id === "do11y:page-layout") {
23
+ const pageLayoutFile = join(do11y, "layout", "Page.vue");
24
24
  /* prettier-ignore */
25
- return existsSync(layoutFile)
26
- ? this.resolve(layoutFile, importer)
27
- : `\0do11y:layout`;
25
+ return existsSync(pageLayoutFile)
26
+ ? this.resolve(pageLayoutFile, importer)
27
+ : `\0do11y:page-layout`;
28
28
  }
29
29
  },
30
30
  async load(id) {
31
- if (id === `\0do11y:home` || id === `\0do11y:layout`) {
31
+ if (id === `\0do11y:home` || id === `\0do11y:page-layout`) {
32
32
  return {
33
33
  code: "export default undefined",
34
34
  moduleType: "js",
package/dist/ui/index.js CHANGED
@@ -1 +1 @@
1
- import{createApp as e,createBlock as t,createCommentVNode as n,defineComponent as r,onBeforeMount as i,openBlock as a,resolveComponent as o,unref as s}from"vue";import c from"do11y:options";import{createRouter as l,createWebHistory as u}from"vue-router";import d from"do11y:routes";import f from"do11y:layout";import p from"do11y:css";var m=r({__name:`Page`,setup(e){return i(async()=>{let e=document.createElement(`style`);e.innerHTML=p,document.head.appendChild(e)}),(e,n)=>{let r=o(`RouterView`);return s(f)?(a(),t(s(f),{key:0})):(a(),t(r,{key:1}))}}});(async()=>{let t=l({history:u(`/`),routes:d}),n=e(m);await c.setup?.(n,t),n.use(t),n.mount(`#app`)})();
1
+ import{createApp as e,createBlock as t,createCommentVNode as n,defineComponent as r,onBeforeMount as i,openBlock as a,resolveComponent as o,unref as s}from"vue";import c from"do11y:options";import{createRouter as l,createWebHistory as u}from"vue-router";import d from"do11y:routes";import f from"do11y:page-layout";import p from"do11y:css";var m=r({__name:`Page`,setup(e){return i(async()=>{let e=document.createElement(`style`);e.innerHTML=p,document.head.appendChild(e)}),(e,n)=>{let r=o(`RouterView`);return s(f)?(a(),t(s(f),{key:0})):(a(),t(r,{key:1}))}}});(async()=>{let t=l({history:u(`/`),routes:d,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(m);await c.setup?.(n,t),n.use(t),n.mount(`#app`)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "do11y",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A bare-bones tool to document Vue components.",
5
5
  "keywords": [
6
6
  "docs-generator",
package/src/types.d.ts CHANGED
@@ -31,7 +31,7 @@ declare module "do11y:home" {
31
31
  export default home;
32
32
  }
33
33
 
34
- declare module "do11y:layout" {
34
+ declare module "do11y:page-layout" {
35
35
  import type { Component } from "vue";
36
36
  const layout: Component | undefined;
37
37
  export default layout;