Skip to content

Commit

Permalink
fix(naming): fix naming…
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Sep 27, 2024
1 parent 03877a5 commit 2838031
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions docs/src/components/content-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/content-headline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/composables/use-content-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/ContentContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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 };
},

Expand Down
2 changes: 1 addition & 1 deletion src/ContentHeadline.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ContentHeadline = {
debug: {
type: Boolean,
default() {
return inject('semanticRelease_debug', false);
return inject('semanticStructure_debug', false);
}
}
},
Expand Down
14 changes: 7 additions & 7 deletions src/useContentContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/useContentHeadline.js
Original file line number Diff line number Diff line change
@@ -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}`);
Expand Down

0 comments on commit 2838031

Please sign in to comment.