From 03877a526ce76a9097f4e623b5a19bc27b7cc621 Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Fri, 27 Sep 2024 11:19:15 +0200 Subject: [PATCH 1/3] test(clean): removed unused `else` --- test/useContentHeadline.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/useContentHeadline.test.js b/test/useContentHeadline.test.js index efc7401..20652dd 100644 --- a/test/useContentHeadline.test.js +++ b/test/useContentHeadline.test.js @@ -129,8 +129,7 @@ describe('useContentHeadline (rootTags)', () => { describe('useContentHeadline (contentTags)', () => { test('Structure Value Check', () => { const ContentContainer = defineComponent({ - template: ` - `, + template: ``, setup() { const { currentTag, currentLevel, parentLevel } = useContentContainer({ rootTags: ['ul'], From 28380314724c54e8e6a4751759cb6eb95b19d206 Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Fri, 27 Sep 2024 11:51:36 +0200 Subject: [PATCH 2/3] =?UTF-8?q?fix(naming):=20fix=20naming=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/src/components/content-container.md | 6 +++--- docs/src/components/content-headline.md | 2 +- docs/src/composables/use-content-container.md | 4 ++-- src/ContentContainer.js | 8 ++++---- src/ContentHeadline.js | 2 +- src/useContentContainer.js | 14 +++++++------- src/useContentHeadline.js | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/src/components/content-container.md b/docs/src/components/content-container.md index 7a00b36..21f1d62 100644 --- a/docs/src/components/content-container.md +++ b/docs/src/components/content-container.md @@ -28,7 +28,7 @@ Tag for the element. ### rootTags - Type: `Array` -- Default: `inject('semanticRelease_rootTags', ['main'])` +- Default: `inject('semanticStructure_rootTags', ['main'])` Available tags for the root structure. @@ -37,7 +37,7 @@ Available tags for the root structure. ### contentTags - Type: `Array` -- Default: `inject('semanticRelease_contentTags', ['article', 'section'])` +- Default: `inject('semanticStructure_contentTags', ['article', 'section'])` Available tags for the content structure. @@ -53,7 +53,7 @@ Can be used to overwrite the level. ### debug - Type: `Boolean` -- Default: `inject('semanticRelease_debug', false)` +- Default: `inject('semanticStructure_debug', false)` If set, the following attributes are set on the element: `data-current-tag`, `data-current-level` and `data-parent-level`. diff --git a/docs/src/components/content-headline.md b/docs/src/components/content-headline.md index d5ac9ce..61d7ced 100644 --- a/docs/src/components/content-headline.md +++ b/docs/src/components/content-headline.md @@ -30,7 +30,7 @@ Tag for the element. ### debug - Type: `Boolean` -- Default: `inject('semanticRelease_debug', false)` +- Default: `inject('semanticStructure_debug', false)` If set, the following attributes are set on the element: `data-current-tag`, `data-current-level` and `data-parent-level`. diff --git a/docs/src/composables/use-content-container.md b/docs/src/composables/use-content-container.md index e9d1773..5ac13ef 100644 --- a/docs/src/composables/use-content-container.md +++ b/docs/src/composables/use-content-container.md @@ -37,8 +37,8 @@ const { currentTag } = useContentContainer() | Property | Type | Description | Default Value | | ------------- | -------- | ----------------------------------------- | --------------------------------------------------------------- | | `tag` | `String` | Can be used to overwrite the tag. | `undefined` | -| `contentTags` | `Array` | Available tags for the content structure. | `inject('semanticRelease_contentTags', ['article', 'section'])` | -| `rootTags` | `Array` | Available tags for the root structure. | `inject('semanticRelease_rootTags', ['main'])` | +| `contentTags` | `Array` | Available tags for the content structure. | `inject('semanticStructure_contentTags', ['article', 'section'])` | +| `rootTags` | `Array` | Available tags for the root structure. | `inject('semanticStructure_rootTags', ['main'])` | | `level` | `Number` | Can be used to overwrite the level. | `undefined` | ## Return diff --git a/src/ContentContainer.js b/src/ContentContainer.js index 9867303..350ebfd 100644 --- a/src/ContentContainer.js +++ b/src/ContentContainer.js @@ -11,13 +11,13 @@ const ContentContainer = { rootTags: { type: Array, default() { - return inject('semanticRelease_rootTags', ['main']); + return inject('semanticStructure_rootTags', ['main']); } }, contentTags: { type: Array, default() { - return inject('semanticRelease_contentTags', ['article', 'section']); + return inject('semanticStructure_contentTags', ['article', 'section']); } }, level: { @@ -27,14 +27,14 @@ const ContentContainer = { debug: { type: Boolean, default() { - return inject('semanticRelease_debug', false); + return inject('semanticStructure_debug', false); } } }, setup(props) { const { parentLevel, currentLevel, currentTag } = useContentContainer(props); - provide('semanticRelease_debug', props.debug); + provide('semanticStructure_debug', props.debug); return { parentLevel, currentLevel, currentTag }; }, diff --git a/src/ContentHeadline.js b/src/ContentHeadline.js index 08c43a6..e3765b7 100644 --- a/src/ContentHeadline.js +++ b/src/ContentHeadline.js @@ -11,7 +11,7 @@ const ContentHeadline = { debug: { type: Boolean, default() { - return inject('semanticRelease_debug', false); + return inject('semanticStructure_debug', false); } } }, diff --git a/src/useContentContainer.js b/src/useContentContainer.js index 9cb78fe..d5fb6b4 100644 --- a/src/useContentContainer.js +++ b/src/useContentContainer.js @@ -2,14 +2,14 @@ import { provide, inject, computed } from 'vue'; export default function useContentContainer({ tag, contentTags, rootTags, level } = {}) { tag = tag || null; - rootTags = rootTags || inject('semanticRelease_rootTags', ['main']); - contentTags = contentTags || inject('semanticRelease_contentTags', ['article', 'section']); + rootTags = rootTags || inject('semanticStructure_rootTags', ['main']); + contentTags = contentTags || inject('semanticStructure_contentTags', ['article', 'section']); level = level || undefined; - provide('semanticRelease_rootTags', rootTags); - provide('semanticRelease_contentTags', contentTags); + provide('semanticStructure_rootTags', rootTags); + provide('semanticStructure_contentTags', contentTags); - const parentLevel = inject('semanticRelease_parentLevel', 0); + const parentLevel = inject('semanticStructure_parentLevel', 0); const currentLevel = computed(() => (level !== undefined ? level : parentLevel + 1)); const currentTag = computed(() => { if (tag) { @@ -21,8 +21,8 @@ export default function useContentContainer({ tag, contentTags, rootTags, level return contentTags[currentLevel.value % contentTags.length]; }); - provide('semanticRelease_rootLevel', rootTags.length); - provide('semanticRelease_parentLevel', currentLevel.value); + provide('semanticStructure_rootLevel', rootTags.length); + provide('semanticStructure_parentLevel', currentLevel.value); return { parentLevel, diff --git a/src/useContentHeadline.js b/src/useContentHeadline.js index fa1cbf3..e112fbf 100644 --- a/src/useContentHeadline.js +++ b/src/useContentHeadline.js @@ -1,8 +1,8 @@ import { inject, computed } from 'vue'; export default function useContentHeadline({ tag } = {}) { - const parentLevel = inject('semanticRelease_parentLevel', 1) + 1; - const rootLevel = inject('semanticRelease_rootLevel', 1); + const parentLevel = inject('semanticStructure_parentLevel', 1) + 1; + const rootLevel = inject('semanticStructure_rootLevel', 1); const currentLevel = computed(() => getMax(parentLevel - rootLevel)); const currentTag = computed(() => tag || `h${currentLevel.value}`); From 6efaccd03d781ef4ca1cf0df980459c1bd44e181 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 27 Sep 2024 09:52:31 +0000 Subject: [PATCH 3/3] chore(release): 1.0.0-next.12 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [1.0.0-next.12](https://github.com/basics/vue-semantic-structure/compare/v1.0.0-next.11...v1.0.0-next.12) (2024-09-27) ### Bug Fixes * **naming:** fix naming… ([2838031](https://github.com/basics/vue-semantic-structure/commit/28380314724c54e8e6a4751759cb6eb95b19d206)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be964f..891e2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Project Changelog +# [1.0.0-next.12](https://github.com/basics/vue-semantic-structure/compare/v1.0.0-next.11...v1.0.0-next.12) (2024-09-27) + + +### Bug Fixes + +* **naming:** fix naming… ([2838031](https://github.com/basics/vue-semantic-structure/commit/28380314724c54e8e6a4751759cb6eb95b19d206)) + # [1.0.0-next.11](https://github.com/basics/vue-semantic-structure/compare/v1.0.0-next.10...v1.0.0-next.11) (2024-09-27) diff --git a/package-lock.json b/package-lock.json index 53ff889..9d6f009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-semantic-structure", - "version": "1.0.0-next.11", + "version": "1.0.0-next.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vue-semantic-structure", - "version": "1.0.0-next.11", + "version": "1.0.0-next.12", "license": "MIT", "devDependencies": { "@commitlint/config-conventional": "19.5.0", diff --git a/package.json b/package.json index c623868..2692822 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-semantic-structure", - "version": "1.0.0-next.11", + "version": "1.0.0-next.12", "description": "Helper for semantic HTML structure.", "license": "MIT", "author": {