Skip to content

Commit

Permalink
fix(core): renamed Structure to ContentContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed May 16, 2022
1 parent 294f7c0 commit 88cb0be
Show file tree
Hide file tree
Showing 22 changed files with 82 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
]
}
],
"selector-class-pattern": null,
"block-closing-brace-empty-line-before": null,
"max-empty-lines": null,
"no-descending-specificity": null,
Expand All @@ -41,4 +42,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export default {
}
}
},
data () {
return {
headline: false
};
},
computed: {
debug () {
return 'debug-structure' in this.$route.query;
Expand Down Expand Up @@ -127,9 +131,8 @@ export default {
--tag-color-bg: var(--color-structure-2-bg);
&::after {
top: auto;
top: 0;
right: 0;
bottom: 0;
}
}
Expand All @@ -138,9 +141,9 @@ export default {
--tag-color-bg: var(--color-structure-3-bg);
&::after {
top: auto;
bottom: 0;
left: 0;
top: 0;
left: 50%;
transform: translateX(-50%);
}
}
Expand All @@ -149,7 +152,7 @@ export default {
--tag-color-bg: var(--color-structure-1-bg);
&::after {
top: 0;
bottom: 0;
left: 0;
}
}
Expand Down
12 changes: 12 additions & 0 deletions packages/core/Headline/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export default {
contextLevel () {
return getMax((this.parentLevel - (this.parentLevel % 2)) / 2);
}
},
created () {
const getContentContainer = (component) => {
if (component.tags) {
return component;
}
return (component && getContentContainer(component.$parent)) || null;
};
const contentContainer = getContentContainer(this);
contentContainer && (contentContainer.headline = true);
}
};
Expand Down
19 changes: 19 additions & 0 deletions packages/core/Slider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,22 @@ export default {
};
</script>
<style lang="postcss" scoped>
.splide:not(.is-initialized) {
& .splide__list {
overflow: hidden;
& >>> .splide__slide:not(:first-child) {
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 100%;
height: 100%;
}
}
}
</style>
2 changes: 1 addition & 1 deletion packages/sample/src/components/molecules/Accordeon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import BaseAccordeon from '@foundation/core/CollapsibleContainer/Accordeon';
import TransitionExpand from '@foundation/core/CollapsibleContainer/transition/expand';
import Dataset from '@foundation/core/CollapsibleContainer/classes/Dataset';
import Model from '@foundation/core/CollapsibleContainer/classes/Model';
import LayoutStructure from '@foundation/core/Structure';
import LayoutStructure from '@foundation/core/ContentContainer';
import AtomIcon from '@/components/atoms/Icon';
const CONTENT_COMPONENTS = {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/Accordeon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import AtomHeadline from '@/components/atoms/Headline';
import MoleculeAccordeon from '@/components/molecules/Accordeon';
import LayoutLostContainer from '@/components/layouts/LostContainer';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import AtomHeadline from '@/components/atoms/Headline';
import MoleculeSlider from '@/components/molecules/Slider';
import LayoutLostContainer from '@/components/layouts/LostContainer';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/Infos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import LayoutLostContainer from '@/components/layouts/LostContainer';
import AtomHeadline from '@/components/atoms/Headline';
import AtomRichText from '@/components/atoms/RichText';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/Stage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script>
import SpeedkitPicture from 'nuxt-speedkit/components/SpeedkitPicture';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import Headline from '@/components/atoms/Headline';
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/TeaserWall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</core-structure>
</template>
<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import LayoutLostContainer from '@/components/layouts/LostContainer';
import AtomHeadline from '@/components/atoms/Headline';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import LayoutLostContainer from '@/components/layouts/LostContainer';
import AtomHeadline from '@/components/atoms/Headline';
import AtomRichText from '@/components/atoms/RichText';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/components/organisms/TextImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<script>
import SpeedkitPicture from 'nuxt-speedkit/components/SpeedkitPicture';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import LayoutLostContainer from '@/components/layouts/LostContainer';
import AtomHeadline from '@/components/atoms/Headline';
import AtomRichText from '@/components/atoms/RichText';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Dataset from '@foundation/core/CollapsibleContainer/classes/Dataset';
import Model from '@foundation/core/CollapsibleContainer/classes/Model';
import speedkitHydrate from 'nuxt-speedkit/hydrate';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/content-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script>
import speedkitHydrate from 'nuxt-speedkit/hydrate';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/content-structure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import AtomHeadline from '@/components/atoms/Headline';
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/headline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<script>
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import BaseHeadline from '@foundation/core/Headline';
import DefaultHeadline from '@foundation/core/Headline/default';
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script>
import speedkitHydrate from 'nuxt-speedkit/hydrate';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
Expand Down
37 changes: 20 additions & 17 deletions packages/sample/src/pages/test.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@

<template>
<core-structure id="layout">
<core-structure id="page">
<core-headline>Core Headline</core-headline>
<!-- <core-structure id="page">
<component
:is="component"
v-for="({component, props}, index) in content.slice(0,1)"
:key="index"
v-bind="props"
critical
/>
<core-structure>
<component
:is="component"
v-for="({component, props}, index) in content.slice(0,1)"
v-for="({component, props}, index) in content.slice(1)"
:key="index"
v-bind="props"
critical
:critical="index < 1"
/>
<core-structure>
<component
:is="component"
v-for="({component, props}, index) in content.slice(1)"
:key="index"
v-bind="props"
:critical="index < 1"
/>
</core-structure>
</core-structure>
</core-structure>
</core-structure> -->
</core-structure>
</template>

<script>
/* eslint-disable vue/no-unused-components */
import speedkitHydrate from 'nuxt-speedkit/hydrate';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
import CoreHeadline from '@foundation/core/Headline';
export default {
layout: 'test',
components: {
CoreStructure,
CoreHeadline,
OrganismStage: speedkitHydrate(() => import('@/components/organisms/Stage')),
OrganismText: speedkitHydrate(() => import('@/components/organisms/Text')),
OrganismGallery: speedkitHydrate(() => import('@/components/organisms/Gallery')),
Expand All @@ -47,12 +49,13 @@ export default {
content: [
{
component: 'OrganismGallery',
component: 'OrganismText',
props: {
headline: {
overline: null,
text: 'Gallery'
}
text: 'Text 1'
},
content: '<p>Lorem ipsum dolor sit amet, <strong>consetetur sadipscing elitr</strong>, <em>sed diam nonumy eirmod tempor invidunt</em> <strong><em>ut labore et dolore magna aliquyam erat</em></strong>, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, <strong>consetetur sadipscing elitr</strong>, sed diam</p> <p>Lorem ipsum dolor sit amet, <strong>consetetur sadipscing elitr</strong>, <em>sed diam nonumy eirmod tempor invidunt</em></p> <ul> <li>List Item 1</li> <li>List Item 2</li> <li>List Item 3</li> </ul> <ol> <li>List Item 1</li> <li>List Item 2</li> <li>List Item 3</li> </ol>'
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<script>
import CoreHeadline from '@foundation/core/Headline';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
CoreStructure,
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/src/pages/tests/headline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

<script>
import CoreHeadline from '@foundation/core/Headline';
import CoreStructure from '@foundation/core/Structure';
import CoreStructure from '@foundation/core/ContentContainer';
export default {
components: {
CoreStructure,
Expand Down
7 changes: 3 additions & 4 deletions packages/sample/test/default.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ beforeAll(async () => {

describe('🧐 inspect generated html', () => {
const paths = [
'/structure',
'/content-container',
'/headline'
];

Expand All @@ -37,7 +37,6 @@ describe('🧐 inspect generated html', () => {
data: await promises.readFile(joinURL(process.cwd(), './test/.test/dist', path, 'index.html'), 'utf8')
};
const result = await validator(options);
console.log(`"${result}"`);
if (!result.startsWith('The document validates according to the specified schema(s).')) {
throw new Error(`Url: ${url}\n${result}`);
}
Expand All @@ -49,8 +48,8 @@ describe('🧐 inspect generated html', () => {

function markupTests () {
let html, dom;
it('Test Structure (/structure)', async () => {
html = await getHTML(join(distDir, 'structure'));
it('Test Structure (/content-container)', async () => {
html = await getHTML(join(distDir, '/content-container'));
dom = getDom(html);

// layout
Expand Down

0 comments on commit 88cb0be

Please sign in to comment.