-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
973d89d
commit 7512151
Showing
20 changed files
with
179 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { h, inject, provide } from 'vue'; | ||
import useContentContainer from './useContentContainer'; | ||
|
||
const ContentContainer = { | ||
name: 'ContentContainer', | ||
props: { | ||
tag: { | ||
type: String, | ||
default: null | ||
}, | ||
rootTags: { | ||
type: Array, | ||
default() { | ||
return inject('semanticRelease_rootTags', ['main']); | ||
} | ||
}, | ||
contentTags: { | ||
type: Array, | ||
default() { | ||
return inject('semanticRelease_contentTags', ['article', 'section']); | ||
} | ||
}, | ||
level: { | ||
type: Number, | ||
default: undefined | ||
}, | ||
debug: { | ||
type: Boolean, | ||
default() { | ||
return inject('semanticRelease_debug', false); | ||
} | ||
} | ||
}, | ||
|
||
setup(props) { | ||
const { parentLevel, currentLevel, currentTag } = useContentContainer(props); | ||
provide('semanticRelease_debug', props.debug); | ||
return { parentLevel, currentLevel, currentTag }; | ||
}, | ||
|
||
render() { | ||
const { currentTag, parentLevel, currentLevel } = this; | ||
return h( | ||
currentTag, | ||
{ | ||
...this.$attrs, | ||
...getDebugAttrs(this) | ||
}, | ||
{ | ||
default: () => | ||
this.$slots.default({ | ||
currentTag, | ||
parentLevel, | ||
currentLevel | ||
}) | ||
} | ||
); | ||
} | ||
}; | ||
|
||
const getDebugAttrs = context => { | ||
if (context.debug) { | ||
return { | ||
'data-current-tag': context.currentTag, | ||
'data-current-level': context.currentLevel, | ||
'data-parent-level': context.parentLevel | ||
}; | ||
} | ||
return {}; | ||
}; | ||
|
||
export default ContentContainer; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { h, inject } from 'vue'; | ||
import useContentHeadline from './useContentHeadline'; | ||
|
||
const ContentHeadline = { | ||
name: 'ContentHeadline', | ||
props: { | ||
tag: { | ||
type: String, | ||
default: null | ||
}, | ||
debug: { | ||
type: Boolean, | ||
default() { | ||
return inject('semanticRelease_debug', false); | ||
} | ||
} | ||
}, | ||
|
||
setup() { | ||
const { parentLevel, currentLevel, currentTag } = useContentHeadline(); | ||
return { parentLevel, currentLevel, currentTag }; | ||
}, | ||
|
||
render() { | ||
const { currentTag, currentLevel } = this; | ||
return h( | ||
currentTag, | ||
{ | ||
...this.$attrs, | ||
...getDebugAttrs(this) | ||
}, | ||
{ | ||
default: () => | ||
this.$slots.default({ | ||
currentTag, | ||
currentLevel | ||
}) | ||
} | ||
); | ||
} | ||
}; | ||
|
||
const getDebugAttrs = context => { | ||
if (context.debug) { | ||
return { | ||
'data-current-tag': context.currentTag, | ||
'data-current-level': context.currentLevel | ||
}; | ||
} | ||
return {}; | ||
}; | ||
|
||
export default ContentHeadline; |
Oops, something went wrong.