From 28380314724c54e8e6a4751759cb6eb95b19d206 Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Fri, 27 Sep 2024 11:51:36 +0200 Subject: [PATCH] =?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}`);