diff --git a/CHANGELOG.md b/CHANGELOG.md index 44c99ae..481a7ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Project Changelog +## [1.0.4](https://github.com/basics/vue-semantic-structure/compare/v1.0.3...v1.0.4) (2025-03-02) + + +### Bug Fixes + +* **docs:** add Definitions section and update navigation ([70aec3d](https://github.com/basics/vue-semantic-structure/commit/70aec3d0b6e02354136a6391eb223927227338d9)) + ## [1.0.3](https://github.com/basics/vue-semantic-structure/compare/v1.0.2...v1.0.3) (2025-03-01) diff --git a/build.config.js b/build.config.js index a82bb3a..144bd53 100644 --- a/build.config.js +++ b/build.config.js @@ -6,12 +6,19 @@ export default defineBuildConfig({ builder: 'mkdist', input: './src', pattern: ['**/*.ts'], - declaration: false, format: 'cjs', loaders: ['js'], - ext: 'cjs' + ext: 'cjs', + declaration: false }, - { builder: 'mkdist', input: './src', pattern: ['**/*.ts'], format: 'esm', loaders: ['js'], ext: 'js' } + { + builder: 'mkdist', + input: './src', + pattern: ['**/*.ts'], + format: 'esm', + loaders: ['js'], + ext: 'js' + } ], declaration: true, clean: true, diff --git a/docs/.vitepress/navigation.ts b/docs/.vitepress/navigation.ts index 03f1e34..71b8ae2 100644 --- a/docs/.vitepress/navigation.ts +++ b/docs/.vitepress/navigation.ts @@ -11,7 +11,8 @@ export default { items: [ { text: 'Introduction', link: '/introduction' }, { text: 'Setup', link: '/setup' }, - { text: 'Usage', link: '/usage' } + { text: 'Usage', link: '/usage' }, + { text: 'Definitions', link: '/definitions' } ] }, { diff --git a/docs/src/components/content-container.md b/docs/src/components/content-container.md index 16cbcac..82d6b5a 100644 --- a/docs/src/components/content-container.md +++ b/docs/src/components/content-container.md @@ -16,7 +16,7 @@ With each nested `ContentContainer` the element structure becomes one level deep The appropriate HTML element for the page structure is determined based on the `level`. (e.g. `main`, `article`, `section`) -## Type +## Types ```ts diff --git a/docs/src/components/content-headline.md b/docs/src/components/content-headline.md index 4ca99a7..147adf0 100644 --- a/docs/src/components/content-headline.md +++ b/docs/src/components/content-headline.md @@ -18,7 +18,7 @@ The level of the heading is taken from the `ContentContainer`. The deeper the nesting, the smaller the heading. -## Type +## Types ```ts declare interface ContentHeadlineProps { diff --git a/docs/src/composables/use-content-container.md b/docs/src/composables/use-content-container.md index 88dc75b..d93511e 100644 --- a/docs/src/composables/use-content-container.md +++ b/docs/src/composables/use-content-container.md @@ -32,10 +32,10 @@ const { currentTag } = useContentContainer(); ``` -## Type +## Types ```ts -function useContentContainer(options?: ContentContainerOptions): ContentContainerReturn; +declare function useContentContainer(options?: ContentContainerOptions): ContentContainerReturn; declare interface ContentContainerOptions { tag?: string; diff --git a/docs/src/composables/use-content-headline.md b/docs/src/composables/use-content-headline.md index 149b10e..14a53bb 100644 --- a/docs/src/composables/use-content-headline.md +++ b/docs/src/composables/use-content-headline.md @@ -33,10 +33,10 @@ const { currentTag } = useContentHeadline(); ``` -## Type +## Types ```ts -function useContentHeadline(options?: ContentHeadlineOptions): ContentHeadlineReturn; +declare function useContentHeadline(options?: ContentHeadlineOptions): ContentHeadlineReturn; declare interface ContentHeadlineOptions { tag?: string; diff --git a/docs/src/definitions.md b/docs/src/definitions.md new file mode 100644 index 0000000..296c928 --- /dev/null +++ b/docs/src/definitions.md @@ -0,0 +1,95 @@ +--- +title: Definitions +--- + +# {{$frontmatter.title}} + +All listed definitions are available in the `vue-semantic-structure` package. + +### Example + +```ts +import type { ContentContainerProps } from 'vue-semantic-structure'; +``` + +## Interface + +### ContentContainerProps + +```ts +interface ContentContainerProps { + tag?: string; + rootTags?: string[]; + contentTags?: string[]; + level?: number; + debug?: boolean; +} +``` + +### ContentContainerContext + +```ts +interface ContentContainerContext extends ContentContainerProps { + parentLevel: number; + currentLevel: number; + currentTag: string; +} +``` + +### ContentHeadlineProps + +```ts +interface ContentHeadlineProps { + tag: string; + debug: boolean; +} +``` + +### ContentHeadlineContext + +```ts +interface ContentHeadlineContext extends ContentHeadlineProps { + parentLevel: number; + currentLevel: number; + currentTag: string; +} +``` + +### ContentContainerOptions + +```ts +interface ContentContainerOptions { + tag?: string | undefined; + rootTags?: string[]; + contentTags?: string[]; + level?: number; +} +``` + +### ContentContainerReturn + +```ts +interface ContentContainerReturn { + parentLevel: ComputedRef; + currentLevel: ComputedRef; + currentTag: ComputedRef; +} +``` + +### ContentHeadlineOptions + +```ts +interface ContentHeadlineOptions { + tag?: string | undefined; +} +``` + +### ContentHeadlineReturn + +```ts +interface ContentHeadlineReturn { + parentLevel: ComputedRef; + currentLevel: ComputedRef; + currentTag: ComputedRef; +} +``` diff --git a/package-lock.json b/package-lock.json index ee62cde..b67404b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-semantic-structure", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vue-semantic-structure", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "devDependencies": { "@commitlint/config-conventional": "19.7.1", diff --git a/package.json b/package.json index 8f7a3c1..7b266fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-semantic-structure", - "version": "1.0.3", + "version": "1.0.4", "description": "Helper for semantic HTML structure.", "homepage": "https://basics.github.io/vue-semantic-structure", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index efaee2b..da9252e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,11 @@ -export { default as ContentContainer } from './ContentContainer'; -export { default as ContentHeadline } from './ContentHeadline'; +export * from './ContentContainer'; +export * from './ContentHeadline'; -export type { ContentHeadlineProps, ContentHeadlineContext } from './ContentHeadline'; -export type { ContentContainerProps, ContentContainerContext } from './ContentContainer'; +export type * from './ContentHeadline'; +export type * from './ContentContainer'; -export { default as useContentContainer } from './useContentContainer'; -export { default as useContentHeadline } from './useContentHeadline'; +export * from './useContentContainer'; +export * from './useContentHeadline'; -export type { ContentContainerOptions, ContentContainerReturn } from './useContentContainer'; -export type { ContentHeadlineOptions, ContentHeadlineReturn } from './useContentHeadline'; +export type * from './useContentContainer'; +export type * from './useContentHeadline';