Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
5298f23
feat: add a hero to the DocumentationTopic.vue
Feb 28, 2022
04d6921
Merge branch 'main' into dhristov/add-sidenav-hero-v2
mportiz08 Mar 3, 2022
095ac45
Squashed commit of the following:
hqhhuang Mar 3, 2022
7a629f3
fix issues introduced by merge conflict
hqhhuang Mar 4, 2022
0bedafb
Move sample code download button to hero.
mportiz08 Mar 4, 2022
4b7e22c
Merge pull request #3 from mportiz08/update-download-btn-placement
mportiz08 Mar 4, 2022
844f8a8
Merge branch 'main' into dhristov/add-sidenav-hero-v2
Mar 7, 2022
567286c
Use less badges for availability items.
mportiz08 Mar 9, 2022
846c1cd
left align hero content
hqhhuang Mar 9, 2022
ad47a40
Remove Hero Image from symbol pages
hqhhuang Mar 10, 2022
61355d7
Merge remote-tracking branch 'origin/left-align-hero-content' into re…
hqhhuang Mar 10, 2022
711150a
Merge branch 'main' into dhristov/add-sidenav-hero-v2
Mar 10, 2022
6985a2d
fix padding on small viewport
hqhhuang Mar 10, 2022
016cdf7
Merge pull request #8 from hqhhuang/left-align-hero-content
hqhhuang Mar 10, 2022
08b5dd6
Simplify availability structure and layout styling.
mportiz08 Mar 10, 2022
2137a6f
Remove unecessary changes.
mportiz08 Mar 10, 2022
29067c6
Simplify selectors.
mportiz08 Mar 10, 2022
19b5ba7
Add change classes.
mportiz08 Mar 10, 2022
5536472
Fix title color with hero removed
hqhhuang Mar 10, 2022
70e7dbf
fix tests
hqhhuang Mar 11, 2022
3ca8e2c
Merge remote-tracking branch 'dobri/dhristov/add-sidenav-hero-v2' int…
hqhhuang Mar 11, 2022
ef2fbbc
Add change styles.
mportiz08 Mar 11, 2022
35c2cc3
Add back overwritten `changeFor` method.
mportiz08 Mar 11, 2022
2ff7c9e
Add back `ChangeTypes` import.
mportiz08 Mar 11, 2022
6ca46e2
fix spacing between hero and body
hqhhuang Mar 11, 2022
618a696
Add back test for change classes.
mportiz08 Mar 11, 2022
5050cad
use modifier
hqhhuang Mar 11, 2022
cd223b1
fix title styling
hqhhuang Mar 11, 2022
6be6a85
fix test after var name change
hqhhuang Mar 11, 2022
4aa1f09
remove margin top edit
hqhhuang Mar 11, 2022
e0ac31a
Merge remote-tracking branch 'apple/main' into remove-hero-from-symbol
hqhhuang Mar 11, 2022
d557ab1
Merge remote-tracking branch 'origin/main' into dhristov/add-sidenav-…
mportiz08 Mar 11, 2022
c3ec08b
Merge branch 'dhristov/add-sidenav-hero-v2' into remove-hero-from-symbol
mportiz08 Mar 11, 2022
2e7cce7
Refactor enabling/disabling of primary content border.
mportiz08 Mar 11, 2022
e9dc5c9
Refactor header colors.
mportiz08 Mar 11, 2022
7fdee7f
Disable before/after pseudo elements properly.
mportiz08 Mar 11, 2022
fcf7b70
Remove unecessary change to mixin.
mportiz08 Mar 11, 2022
4e3a9b1
Merge pull request #10 from hqhhuang/remove-hero-from-symbol
mportiz08 Mar 11, 2022
d306598
Merge remote-tracking branch 'dobri/dhristov/add-sidenav-hero-v2' int…
hqhhuang Mar 11, 2022
eefdb03
fix conflict with hero-v2
hqhhuang Mar 11, 2022
9788e7a
Merge remote-tracking branch 'hqhhuang/hqhuang/remove-right-side-bar'…
mportiz08 Mar 11, 2022
cefb727
Center availability at small breakpoint.
mportiz08 Mar 11, 2022
c10280b
Merge pull request #5 from mportiz08/update-availability
hqhhuang Mar 12, 2022
9f28303
Remove unecessary badge-text colors.
mportiz08 Mar 12, 2022
9e25afc
Fix availability badge colors.
mportiz08 Mar 12, 2022
2e6c404
Add test for `DocumentationHero` classes.
mportiz08 Mar 12, 2022
2cadea3
use badge for technology list
hqhhuang Mar 14, 2022
1761fc7
Merge pull request #6 from mportiz08/fix-badge-text-issue
mportiz08 Mar 14, 2022
44e8745
WIP
hqhhuang Mar 14, 2022
3801ece
Merge branch 'hqhuang/remove-right-side-bar' into update-technology-list
hqhhuang Mar 14, 2022
7570ce7
fix badge color/spacing and logic to hide tech list
hqhhuang Mar 14, 2022
e654b0a
Remove`TechnologyList` and fix tests
hqhhuang Mar 14, 2022
a22f2aa
Remove unnecessary styling
hqhhuang Mar 14, 2022
8d50fab
Address PR feedback
hqhhuang Mar 15, 2022
6cab6fa
Move style to `Availability`
hqhhuang Mar 15, 2022
77565e2
Add || [] check for platforms
hqhhuang Mar 15, 2022
ba353dc
Override dark theme rule for tech icon.
mportiz08 Mar 15, 2022
840c395
Merge pull request #8 from hqhhuang/update-technology-list
mportiz08 Mar 15, 2022
46bc771
Merge branch 'main' into dhristov/add-sidenav-hero-v2
mportiz08 Mar 15, 2022
8d0d492
Merge branch 'dhristov/add-sidenav-hero-v2' into hqhuang/remove-right…
mportiz08 Mar 15, 2022
a7e62ac
WIP: Add language switcher for TargetIDE
hqhhuang Mar 16, 2022
1f7bdb5
Simplify logic for showing technology badges.
mportiz08 Mar 16, 2022
e9d32d9
Fix typo.
mportiz08 Mar 16, 2022
7ea4226
Add `LanguageToggle` and test
hqhhuang Mar 17, 2022
86d8e25
fix padding-top
hqhhuang Mar 17, 2022
6954cfc
Fix test and styling feedback
hqhhuang Mar 17, 2022
a64505e
Merge pull request #9 from mportiz08/simplify-conditional-technologie…
mportiz08 Mar 17, 2022
65ad1f6
Merge branch 'hqhuang/remove-right-side-bar' into language-switcher-i…
hqhhuang Mar 17, 2022
6761db9
Add test for `menu-items` slot
hqhhuang Mar 17, 2022
24c5399
Merge pull request #10 from hqhhuang/language-switcher-in-hero
hqhhuang Mar 17, 2022
ff5bc89
Remove 'No Overview` from Description and fix test
hqhhuang Mar 18, 2022
c99399b
remove extra spacing
hqhhuang Mar 18, 2022
ed21b8d
Remove extra divider below hero
hqhhuang Mar 18, 2022
3ef7919
replace `hasOverview` with `hasDescription`
hqhhuang Mar 18, 2022
dbe754f
Remove `Description` component
hqhhuang Mar 18, 2022
01a382b
Move over CSS from `Description` Component
hqhhuang Mar 18, 2022
350ee7a
fix tabbing
hqhhuang Mar 18, 2022
a5b0e03
Merge branch 'remove-no-overview' into remove-extra-spacing-below-hero
hqhhuang Mar 18, 2022
8ba025f
Remove border for first section
hqhhuang Mar 18, 2022
6730067
Remove unnecessary div
hqhhuang Mar 18, 2022
2f4464b
remove comment
hqhhuang Mar 18, 2022
b080772
fix style
hqhhuang Mar 18, 2022
81c9326
Fix whitespace.
mportiz08 Mar 18, 2022
21d1787
Merge pull request #11 from hqhhuang/remove-no-overview
mportiz08 Mar 18, 2022
7a2f2bc
Fix typo.
mportiz08 Mar 18, 2022
2c86d5b
Merge pull request #12 from hqhhuang/remove-extra-spacing-below-hero
mportiz08 Mar 18, 2022
2b9b4fa
Merge branch 'main' into dhristov/add-sidenav-hero-v2
mportiz08 Mar 18, 2022
df2d53a
Merge remote-tracking branch 'dobromir-hristov/dhristov/add-sidenav-h…
mportiz08 Mar 18, 2022
667d5a0
add margin right to language toggle
hqhhuang Mar 22, 2022
2190be7
fix: forgotten code, after fixing a merge conflict
Mar 22, 2022
b4f97c5
Override link color in always-dark hero.
mportiz08 Mar 22, 2022
a5c8aff
Only override link color for dark theme hero.
mportiz08 Mar 23, 2022
9c4fddc
Merge pull request #14 from mportiz08/use-dark-theme-colors-in-hero
mportiz08 Mar 23, 2022
47f2f62
Render "Beta" or "Deprecated" in documentation title.
mportiz08 Mar 24, 2022
5fb5b1c
Move CSS
hqhhuang Mar 24, 2022
861f45f
Apply CSS to correct class
hqhhuang Mar 25, 2022
03d2ca6
Merge pull request #13 from hqhhuang/one-language-toggle-spacing
hqhhuang Mar 25, 2022
ec4e42d
Fix inaccurate comment from copy/paste error.
mportiz08 Mar 25, 2022
729a740
Merge pull request #15 from mportiz08/update-beta-design
mportiz08 Mar 25, 2022
444b48e
Merge branch 'main' into dhristov/add-sidenav-hero-v2
mportiz08 Mar 28, 2022
194b5e2
Merge branch 'dhristov/add-sidenav-hero-v2' into hqhuang/remove-right…
mportiz08 Mar 28, 2022
ffc961e
Add margin to relationship-list
hqhhuang Mar 29, 2022
3c85fd8
Style changes
hqhhuang Mar 29, 2022
2201f46
Merge pull request #16 from hqhhuang/relationship-list-spacing
hqhhuang Mar 30, 2022
1a4f3d3
Edit Header with correct year information
hqhhuang Mar 30, 2022
3065a9b
Merge branch 'main' into dhristov/add-sidenav-hero-v2
mportiz08 Mar 31, 2022
99dbd21
Merge branch 'dhristov/add-sidenav-hero-v2' into hqhuang/remove-right…
mportiz08 Mar 31, 2022
d6f8224
Merge branch 'main' into dhristov/add-sidenav-hero-v2
hqhhuang Apr 1, 2022
8ce3eb9
Merge remote-tracking branch 'dobri/dhristov/add-sidenav-hero-v2' int…
hqhhuang Apr 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/public/theme-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
},
"features": {
"docs": {
"summary": {
"hide": false
},
"navigator": {
"enable": false
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/Badge.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -47,7 +47,7 @@ $badge-border-radius: $border-radius - 1px !default;

@mixin badge-variation($color) {
--badge-color: var(--color-badge-#{$color});
--badge-dark-color: var(--color-badge-dark-#{$color})
--badge-dark-color: var(--color-badge-dark-#{$color});
}

.badge {
Expand All @@ -67,6 +67,7 @@ $badge-border-radius: $border-radius - 1px !default;
--badge-color: var(--badge-dark-color);
}

/* nav bar badge */
&-deprecated {
@include badge-variation(deprecated);
}
Expand Down
140 changes: 73 additions & 67 deletions src/components/DocumentationTopic.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,11 +11,30 @@
<template>
<div class="doc-topic">
<main class="main" id="main" role="main" tabindex="0">
<slot name="above-title" />
<Title :eyebrow="roleHeading">{{ title }}</Title>
<div class="container content-grid" :class="{ 'full-width': hideSummary }">
<Description :hasOverview="hasOverview">
<Abstract v-if="abstract" :content="abstract" />
<DocumentationHero :type="symbolKind || role" :enhanceBackground="enhanceBackground">
<slot name="above-title" />
<LanguageSwitcher
v-if="shouldShowLanguageSwitcher"
:interfaceLanguage="interfaceLanguage"
:objcPath="objcPath"
:swiftPath="swiftPath"
/>
<Title :eyebrow="roleHeading">
{{ title }}
<small v-if="isSymbolDeprecated" slot="after" class="deprecated">Deprecated</small>
<small v-else-if="isSymbolBeta" slot="after" class="beta">Beta</small>
</Title>
<Abstract v-if="abstract" :content="abstract" />
<div v-if="sampleCodeDownload">
<DownloadButton class="sample-download" :action="sampleCodeDownload.action" />
</div>
<Availability
v-if="hasAvailability"
:platforms="platforms" :technologies="technologies"
/>
</DocumentationHero>
<div v-if="showContainer" class="container">
<div class="description">
<RequirementMetadata
v-if="isRequirement"
:defaultImplementationsCount="defaultImplementationsCount"
Expand All @@ -29,27 +48,10 @@
>
<ContentNode :content="downloadNotAvailableSummary" />
</Aside>
<DownloadButton v-if="sampleCodeDownload" :action="sampleCodeDownload.action" />
</Description>
<Summary v-if="!hideSummary">
<LanguageSwitcher
v-if="shouldShowLanguageSwitcher"
:interfaceLanguage="interfaceLanguage"
:objcPath="objcPath"
:swiftPath="swiftPath"
/>
<Availability v-if="platforms" :platforms="platforms" />
<TechnologyList v-if="modules" :technologies="modules" />
<TechnologyList
v-if="extendsTechnology"
class="extends-technology"
title="Extends"
:technologies="[{ name: extendsTechnology }]"
/>
<OnThisPageNav v-if="onThisPageSections.length > 1" :sections="onThisPageSections" />
</Summary>
</div>
<PrimaryContent
v-if="primaryContentSections && primaryContentSections.length"
:class="{ 'with-border': !enhanceBackground }"
:conformance="conformance"
:sections="primaryContentSections"
/>
Expand Down Expand Up @@ -81,24 +83,20 @@
<script>
import Language from 'docc-render/constants/Language';
import metadata from 'docc-render/mixins/metadata';
import { getSetting } from 'docc-render/utils/theme-settings';

import Aside from 'docc-render/components/ContentNode/Aside.vue';
import BetaLegalText from 'theme/components/DocumentationTopic/BetaLegalText.vue';
import LanguageSwitcher from 'theme/components/DocumentationTopic/Summary/LanguageSwitcher.vue';
import DocumentationHero from 'docc-render/components/DocumentationTopic/DocumentationHero.vue';
import Abstract from './DocumentationTopic/Description/Abstract.vue';
import ContentNode from './DocumentationTopic/ContentNode.vue';
import CallToActionButton from './CallToActionButton.vue';
import DefaultImplementations from './DocumentationTopic/DefaultImplementations.vue';
import Description from './DocumentationTopic/Description.vue';
import TechnologyList from './DocumentationTopic/Summary/TechnologyList.vue';
import OnThisPageNav from './DocumentationTopic/Summary/OnThisPageNav.vue';
import PrimaryContent from './DocumentationTopic/PrimaryContent.vue';
import Relationships from './DocumentationTopic/Relationships.vue';
import RequirementMetadata from './DocumentationTopic/Description/RequirementMetadata.vue';
import Availability from './DocumentationTopic/Summary/Availability.vue';
import SeeAlso from './DocumentationTopic/SeeAlso.vue';
import Summary from './DocumentationTopic/Summary.vue';
import Title from './DocumentationTopic/Title.vue';
import Topics from './DocumentationTopic/Topics.vue';

Expand All @@ -121,22 +119,19 @@ export default {
},
},
components: {
DocumentationHero,
Abstract,
Aside,
BetaLegalText,
ContentNode,
DefaultImplementations,
Description,
DownloadButton: CallToActionButton,
TechnologyList,
LanguageSwitcher,
OnThisPageNav,
PrimaryContent,
Relationships,
RequirementMetadata,
Availability,
SeeAlso,
Summary,
Title,
Topics,
},
Expand Down Expand Up @@ -225,9 +220,6 @@ export default {
type: Object,
default: () => ({}),
},
extendsTechnology: {
type: String,
},
tags: {
type: Array,
required: true,
Expand Down Expand Up @@ -280,12 +272,12 @@ export default {
0,
);
},
hasOverview: ({ primaryContentSections = [] }) => primaryContentSections.filter(section => (
section.kind === PrimaryContent.constants.SectionKind.content
)).length > 0,
onThisPageSections() {
return this.topicState.onThisPageSections;
},
hasAvailability: ({ platforms, technologies }) => (
(platforms || []).length || (technologies || []).length
),
hasBetaContent:
({ platforms }) => platforms
&& platforms.length
Expand All @@ -294,8 +286,31 @@ export default {
pageDescription: ({ abstract, extractFirstParagraphText }) => (
abstract ? extractFirstParagraphText(abstract) : null
),
shouldShowLanguageSwitcher: ({ objcPath, swiftPath }) => objcPath && swiftPath,
hideSummary: () => getSetting(['features', 'docs', 'summary', 'hide'], false),
shouldShowLanguageSwitcher: ({ objcPath, swiftPath, isTargetIDE }) => (
objcPath && swiftPath && isTargetIDE
),
enhanceBackground: ({ symbolKind }) => (symbolKind ? (symbolKind === 'module') : true),
technologies({ modules = [] }) {
const technologyList = modules.reduce((list, module) => {
list.push(module.name);
return list.concat(module.relatedModules || []);
}, []);
// only show badges for technologies when there are multiple
return technologyList.length > 1
? technologyList
: [];
},
showContainer: ({
isRequirement,
deprecationSummary,
downloadNotAvailableSummary,
primaryContentSections,
}) => (
isRequirement
|| (deprecationSummary && deprecationSummary.length)
|| (downloadNotAvailableSummary && downloadNotAvailableSummary.length)
|| (primaryContentSections && primaryContentSections.length)
),
},
methods: {
normalizePath(path) {
Expand Down Expand Up @@ -361,44 +376,35 @@ export default {
}

.container {
margin-top: $section-spacing-single-side / 2;
outline-style: none;
@include dynamic-content-container;
}

.content-grid {
display: grid;
grid-template-columns: 75% 25%;
grid-template-rows: auto minmax(0, 1fr);

@include breakpoint(small) {
display: block;
}

&:before, &:after {
.description {
&:empty {
display: none;
}

&.full-width {
grid-template-columns: 100%;
&:not(:empty) {
margin-bottom: $contenttable-spacing-single-side;
}
}

.description {
grid-column: 1;
}

.summary {
grid-column: 2;
grid-row: 1 / -1;
/deep/ .content + * {
margin-top: $stacked-margin-large;
}
}

.primary-content {
grid-column: 1;
// remove border-top for first section of the page
/deep/ {
.documentation-hero + .contenttable {
.container > .title {
border-top: none;
}
}
}

.button-cta {
margin-top: 2em;
.sample-download {
margin-top: 20px;
}

/deep/ {
Expand Down
8 changes: 6 additions & 2 deletions src/components/DocumentationTopic/ContentTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -47,14 +47,18 @@ export default {
@include inTargetIde {
background: var(--color-content-table-content-color);
}
padding: $section-spacing-single-side 0;
}

.container {
@include dynamic-content-container;
padding-bottom: $section-spacing-single-side;
}

.title {
@include font-styles(heading-2-reduced);
padding-top: $section-spacing-single-side;
border-top-color: var(--color-grid);
border-top-style: solid;
border-top-width: 1px;
}
</style>
Loading