Skip to content

Commit 377b4d6

Browse files
committed
Merge of Insiders features tied to 'Caribbean Red' funding goal
1 parent 62742b4 commit 377b4d6

File tree

32 files changed

+228
-198
lines changed

32 files changed

+228
-198
lines changed

material/assets/javascripts/bundle.48dfec6c.min.js

-29
This file was deleted.

material/assets/javascripts/bundle.48dfec6c.min.js.map

-7
This file was deleted.

material/assets/javascripts/workers/search.94ec81fe.min.js

-48
This file was deleted.

material/assets/javascripts/workers/search.94ec81fe.min.js.map

-7
This file was deleted.

material/assets/stylesheets/main.92558b1b.min.css

-2
This file was deleted.

material/assets/stylesheets/main.92558b1b.min.css.map

-1
This file was deleted.

material/base.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{% endif %}
4040
{% endblock %}
4141
{% block styles %}
42-
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.92558b1b.min.css' | url }}">
42+
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.8b42a75e.min.css' | url }}">
4343
{% if config.theme.palette %}
4444
{% set palette = config.theme.palette %}
4545
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.3f5d1f46.min.css' | url }}">
@@ -119,8 +119,10 @@
119119
<div class="md-container" data-md-component="container">
120120
{% block hero %}{% endblock %}
121121
{% block tabs %}
122-
{% if "navigation.tabs" in features %}
123-
{% include "partials/tabs.html" %}
122+
{% if not "navigation.tabs.sticky" in features %}
123+
{% if "navigation.tabs" in features %}
124+
{% include "partials/tabs.html" %}
125+
{% endif %}
124126
{% endif %}
125127
{% endblock %}
126128
<main class="md-main" data-md-component="main">
@@ -196,7 +198,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
196198
"base": base_url,
197199
"features": features,
198200
"translations": {},
199-
"search": "assets/javascripts/workers/search.94ec81fe.min.js" | url,
201+
"search": "assets/javascripts/workers/search.f8263e09.min.js" | url,
200202
"version": config.extra.version or None
201203
} -%}
202204
{%- set translations = app.translations -%}
@@ -223,7 +225,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
223225
</script>
224226
{% endblock %}
225227
{% block scripts %}
226-
<script src="{{ 'assets/javascripts/bundle.48dfec6c.min.js' | url }}"></script>
228+
<script src="{{ 'assets/javascripts/bundle.4fc53ad4.min.js' | url }}"></script>
227229
{% for path in config["extra_javascript"] %}
228230
<script src="{{ path | url }}"></script>
229231
{% endfor %}

material/overrides/assets/javascripts/bundle.f9a9c765.min.js

-18
This file was deleted.

material/overrides/assets/javascripts/bundle.f9a9c765.min.js.map

-7
This file was deleted.

material/overrides/main.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
{% endblock %}
1717
{% block scripts %}
1818
{{ super() }}
19-
<script src="{{ 'overrides/assets/javascripts/bundle.f9a9c765.min.js' | url }}"></script>
19+
<script src="{{ 'overrides/assets/javascripts/bundle.5c8bd0f7.min.js' | url }}"></script>
2020
{% endblock %}

material/partials/footer.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747
{{ config.copyright }}
4848
</div>
4949
{% endif %}
50-
Made with
51-
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
52-
Material for MkDocs
53-
</a>
50+
{% if not config.extra.generator == false %}
51+
Made with
52+
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
53+
Material for MkDocs
54+
</a>
55+
{% endif %}
5456
{{ extracopyright }}
5557
</div>
5658
{% include "partials/social.html" %}

material/partials/header.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{#-
22
This file was automatically generated - do not edit
33
-#}
4-
<header class="md-header" data-md-component="header">
4+
{% set class = "md-header" %}
5+
{% if "navigation.tabs.sticky" in features %}
6+
{% set class = class ~ " md-header--lifted" %}
7+
{% endif %}
8+
<header class="{{ class }}" data-md-component="header">
59
<nav class="md-header__inner md-grid" aria-label="{{ lang.t('header.title') }}">
610
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" title="{{ config.site_name | e }}" class="md-header__button md-logo" aria-label="{{ config.site_name }}" data-md-component="logo">
711
{% include "partials/logo.html" %}
@@ -74,4 +78,9 @@
7478
</div>
7579
{% endif %}
7680
</nav>
81+
{% if "navigation.tabs.sticky" in features %}
82+
{% if "navigation.tabs" in features %}
83+
{% include "partials/tabs.html" %}
84+
{% endif %}
85+
{% endif %}
7786
</header>

material/partials/nav-item.html

+27-5
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,40 @@
1919
{% else %}
2020
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
2121
{% endif %}
22-
<label class="md-nav__link" for="{{ path }}">
23-
{{ nav_item.title }}
24-
<span class="md-nav__icon md-icon"></span>
25-
</label>
22+
{% set indexes = [] %}
23+
{% if "navigation.indexes" in features %}
24+
{% for item in nav_item.children %}
25+
{% if item.is_index and not index is defined %}
26+
{% set _ = indexes.append(item) %}
27+
{% endif %}
28+
{% endfor %}
29+
{% endif %}
30+
{% if not indexes %}
31+
<label class="md-nav__link" for="{{ path }}">
32+
{{ nav_item.title }}
33+
<span class="md-nav__icon md-icon"></span>
34+
</label>
35+
{% else %}
36+
{% set index = indexes | first %}
37+
{% set class = "md-nav__link--active" if index == page %}
38+
<div class="md-nav__link md-nav__link--container {{ class }}">
39+
<a href="{{ index.url | url }}">{{ nav_item.title }}</a>
40+
<label for="{{ path }}">
41+
<span class="md-nav__icon md-icon"></span>
42+
</label>
43+
</div>
44+
{% endif %}
2645
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
2746
<label class="md-nav__title" for="{{ path }}">
2847
<span class="md-nav__icon md-icon"></span>
2948
{{ nav_item.title }}
3049
</label>
3150
<ul class="md-nav__list" data-md-scrollfix>
3251
{% for nav_item in nav_item.children %}
33-
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
52+
{% if "navigation.indexes" in features and nav_item.is_index %}
53+
{% else %}
54+
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
55+
{% endif %}
3456
{% endfor %}
3557
</ul>
3658
</nav>

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ nav:
212212
- Meta tags: reference/meta-tags.md
213213
- Variables: reference/variables.md
214214
- Insiders:
215-
- Sponsorship: insiders/index.md
215+
- insiders/index.md
216216
- Getting started:
217217
- Installation: insiders/getting-started.md
218218
- Changelog: insiders/changelog.md

src/assets/javascripts/_/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ export type Flag =
3333
| "header.autohide" /* Hide header */
3434
| "navigation.expand" /* Automatic expansion */
3535
| "navigation.instant" /* Instant loading */
36-
| "navigation.sections" /* Sections navigation */
36+
| "navigation.indexes" /* Section pages */
37+
| "navigation.sections" /* Section navigation */
3738
| "navigation.tabs" /* Tabs navigation */
39+
| "navigation.tabs.sticky" /* Tabs navigation (sticky) */
3840
| "navigation.top" /* Back-to-top button */
3941
| "search.highlight" /* Search highlighting */
4042
| "search.share" /* Search sharing */

src/assets/javascripts/browser/element/_/index.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*/
3737
export function getElement<T extends keyof HTMLElementTagNameMap>(
3838
selector: T, node?: ParentNode
39-
): HTMLElementTagNameMap[T]
39+
): HTMLElementTagNameMap[T] | undefined
4040

4141
export function getElement<T extends HTMLElement>(
4242
selector: string, node?: ParentNode
@@ -74,6 +74,8 @@ export function getElementOrThrow<T extends HTMLElement>(
7474
throw new ReferenceError(
7575
`Missing element: expected "${selector}" to be present`
7676
)
77+
78+
/* Return element */
7779
return el
7880
}
7981

@@ -114,21 +116,6 @@ export function getElements<T extends HTMLElement>(
114116

115117
/* ------------------------------------------------------------------------- */
116118

117-
/**
118-
* Create an element
119-
*
120-
* @template T - Tag name type
121-
*
122-
* @param tagName - Tag name
123-
*
124-
* @returns Element
125-
*/
126-
export function createElement<T extends keyof HTMLElementTagNameMap>(
127-
tagName: T
128-
): HTMLElementTagNameMap[T] {
129-
return document.createElement(tagName)
130-
}
131-
132119
/**
133120
* Replace an element with the given list of nodes
134121
*

src/assets/javascripts/browser/location/hash/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
startWith
2929
} from "rxjs/operators"
3030

31-
import { createElement, getElement } from "~/browser"
31+
import { getElement } from "~/browser"
32+
import { h } from "~/utilities"
3233

3334
/* ----------------------------------------------------------------------------
3435
* Functions
@@ -54,8 +55,7 @@ export function getLocationHash(): string {
5455
* @param hash - Location hash
5556
*/
5657
export function setLocationHash(hash: string): void {
57-
const el = createElement("a")
58-
el.href = hash
58+
const el = h("a", { href: hash })
5959
el.addEventListener("click", ev => ev.stopPropagation())
6060
el.click()
6161
}

src/assets/javascripts/components/_/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { getElementOrThrow, getElements } from "~/browser"
2727
* ------------------------------------------------------------------------- */
2828

2929
/**
30-
* Component
30+
* Component type
3131
*/
3232
export type ComponentType =
3333
| "announce" /* Announcement bar */
@@ -52,7 +52,7 @@ export type ComponentType =
5252
| "top" /* Back-to-top button */
5353

5454
/**
55-
* A component
55+
* Component
5656
*
5757
* @template T - Component type
5858
* @template U - Reference type

src/assets/javascripts/components/content/table/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
import { Observable, of } from "rxjs"
2424

25-
import { createElement, replaceElement } from "~/browser"
25+
import { replaceElement } from "~/browser"
2626
import { renderTable } from "~/templates"
27+
import { h } from "~/utilities"
2728

2829
import { Component } from "../../_"
2930

@@ -43,7 +44,7 @@ export interface DataTable {}
4344
/**
4445
* Sentinel for replacement
4546
*/
46-
const sentinel = createElement("table")
47+
const sentinel = h("table")
4748

4849
/* ----------------------------------------------------------------------------
4950
* Functions

src/assets/javascripts/components/search/_/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export function mountSearch(
213213

214214
/* Search sharing */
215215
...getComponentElements("search-share", el)
216-
.map(child => mountSearchShare(child, { query$ })),
216+
.map(child => mountSearchShare(child, { query$ })),
217217

218218
/* Search suggestions */
219219
...getComponentElements("search-suggest", el)

src/assets/javascripts/components/tabs/index.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
* IN THE SOFTWARE.
2121
*/
2222

23-
import { Observable, Subject, animationFrameScheduler } from "rxjs"
23+
import {
24+
Observable,
25+
Subject,
26+
animationFrameScheduler,
27+
of
28+
} from "rxjs"
2429
import {
2530
distinctUntilKeyChanged,
2631
finalize,
@@ -30,6 +35,7 @@ import {
3035
tap
3136
} from "rxjs/operators"
3237

38+
import { feature } from "~/_"
3339
import { resetTabsState, setTabsState } from "~/actions"
3440
import {
3541
Viewport,
@@ -134,7 +140,11 @@ export function mountTabs(
134140
})
135141

136142
/* Create and return component */
137-
return watchTabs(el, options)
143+
return (
144+
feature("navigation.tabs.sticky")
145+
? of({ hidden: false })
146+
: watchTabs(el, options)
147+
)
138148
.pipe(
139149
tap(state => internal$.next(state)),
140150
finalize(() => internal$.complete()),

src/assets/javascripts/integrations/instant/index.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ import {
4545
switchMap
4646
} from "rxjs/operators"
4747

48-
import { configuration } from "~/_"
48+
import { configuration, feature } from "~/_"
4949
import {
5050
Viewport,
5151
ViewportOffset,
52-
createElement,
5352
getElement,
5453
getElements,
5554
replaceElement,
@@ -60,6 +59,7 @@ import {
6059
setViewportOffset
6160
} from "~/browser"
6261
import { getComponentElement } from "~/components"
62+
import { h } from "~/utilities"
6363

6464
/* ----------------------------------------------------------------------------
6565
* Types
@@ -283,7 +283,10 @@ export function setupInstantLoading(
283283
"[data-md-component=container]",
284284
"[data-md-component=header-topic]",
285285
"[data-md-component=logo], .md-logo", // compat
286-
"[data-md-component=skip]"
286+
"[data-md-component=skip]",
287+
...feature("navigation.tabs.sticky")
288+
? ["[data-md-component=tabs]"]
289+
: []
287290
]) {
288291
const source = getElement(selector)
289292
const target = getElement(selector, replacement)
@@ -303,7 +306,7 @@ export function setupInstantLoading(
303306
map(() => getComponentElement("container")),
304307
switchMap(el => of(...getElements("script", el))),
305308
concatMap(el => {
306-
const script = createElement("script")
309+
const script = h("script")
307310
if (el.src) {
308311
for (const name of el.getAttributeNames())
309312
script.setAttribute(name, el.getAttribute(name)!)

src/assets/javascripts/integrations/search/worker/message/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,30 @@ export const enum SearchMessageType {
3939
/* ------------------------------------------------------------------------- */
4040

4141
/**
42-
* A message containing the data necessary to setup the search index
42+
* Message containing the data necessary to setup the search index
4343
*/
4444
export interface SearchSetupMessage {
4545
type: SearchMessageType.SETUP /* Message type */
4646
data: SearchIndex /* Message data */
4747
}
4848

4949
/**
50-
* A message indicating the search index is ready
50+
* Message indicating the search index is ready
5151
*/
5252
export interface SearchReadyMessage {
5353
type: SearchMessageType.READY /* Message type */
5454
}
5555

5656
/**
57-
* A message containing a search query
57+
* Message containing a search query
5858
*/
5959
export interface SearchQueryMessage {
6060
type: SearchMessageType.QUERY /* Message type */
6161
data: string /* Message data */
6262
}
6363

6464
/**
65-
* A message containing results for a search query
65+
* Message containing results for a search query
6666
*/
6767
export interface SearchResultMessage {
6868
type: SearchMessageType.RESULT /* Message type */
@@ -72,7 +72,7 @@ export interface SearchResultMessage {
7272
/* ------------------------------------------------------------------------- */
7373

7474
/**
75-
* A message exchanged with the search worker
75+
* Message exchanged with the search worker
7676
*/
7777
export type SearchMessage =
7878
| SearchSetupMessage
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"rules": {
33
"@typescript-eslint/no-explicit-any": "off",
4-
"@typescript-eslint/no-namespace": "off"
4+
"@typescript-eslint/no-namespace": "off",
5+
"jsdoc/require-jsdoc": "off"
56
}
67
}

0 commit comments

Comments
 (0)