Skip to content

Commit bac1301

Browse files
committed
Restructured content observables
1 parent 86a25e8 commit bac1301

File tree

24 files changed

+263
-289
lines changed

24 files changed

+263
-289
lines changed

material/assets/javascripts/bundle.7ca7dfaa.min.js renamed to material/assets/javascripts/bundle.195ba817.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/bundle.7ca7dfaa.min.js.map renamed to material/assets/javascripts/bundle.195ba817.min.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.c31396f4.min.css renamed to material/assets/stylesheets/main.9f2461a2.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.9f2461a2.min.css.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.c31396f4.min.css.map

-1
This file was deleted.

material/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{% endif %}
3535
{% endblock %}
3636
{% block styles %}
37-
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.c31396f4.min.css' | url }}">
37+
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.9f2461a2.min.css' | url }}">
3838
{% if config.theme.palette %}
3939
{% set palette = config.theme.palette %}
4040
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.9204c3b2.min.css' | url }}">
@@ -213,7 +213,7 @@
213213
</script>
214214
{% endblock %}
215215
{% block scripts %}
216-
<script src="{{ 'assets/javascripts/bundle.7ca7dfaa.min.js' | url }}"></script>
216+
<script src="{{ 'assets/javascripts/bundle.195ba817.min.js' | url }}"></script>
217217
{% for path in config["extra_javascript"] %}
218218
<script src="{{ path | url }}"></script>
219219
{% endfor %}

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ import { Observable, merge } from "rxjs"
2525
import { getElements } from "~/browser"
2626

2727
import { Component } from "../../_"
28-
import {
29-
Annotation,
30-
CodeBlock,
31-
mountCodeBlock
32-
} from "../code"
28+
import { Annotation } from "../annotation"
29+
import { CodeBlock, mountCodeBlock } from "../code"
3330
import { Details, mountDetails } from "../details"
3431
import { DataTable, mountDataTable } from "../table"
3532
import { ContentTabs, mountContentTabs } from "../tabs"

src/assets/javascripts/components/content/code/annotation/_/index.ts renamed to src/assets/javascripts/components/content/annotation/_/index.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,31 @@ import {
4545
watchElementOffset
4646
} from "~/browser"
4747

48-
import { Component } from "../../../../_"
48+
import { Component } from "../../../_"
4949

5050
/* ----------------------------------------------------------------------------
5151
* Types
5252
* ------------------------------------------------------------------------- */
5353

5454
/**
55-
* Code annotation
55+
* Annotation
5656
*/
5757
export interface Annotation {
58-
active: boolean /* Code annotation is visible */
59-
offset: ElementOffset /* Code annotation offset */
58+
active: boolean /* Annotation is active */
59+
offset: ElementOffset /* Annotation offset */
6060
}
6161

6262
/* ----------------------------------------------------------------------------
6363
* Functions
6464
* ------------------------------------------------------------------------- */
6565

6666
/**
67-
* Watch code annotation
67+
* Watch annotation
6868
*
69-
* @param el - Code annotation element
70-
* @param container - Containing code block element
69+
* @param el - Annotation element
70+
* @param container - Containing element
7171
*
72-
* @returns Code annotation observable
72+
* @returns Annotation observable
7373
*/
7474
export function watchAnnotation(
7575
el: HTMLElement, container: HTMLElement
@@ -88,7 +88,7 @@ export function watchAnnotation(
8888
})
8989
)
9090

91-
/* Actively watch code annotation on focus */
91+
/* Actively watch annotation on focus */
9292
return watchElementFocus(el)
9393
.pipe(
9494
switchMap(active => offset$
@@ -101,12 +101,12 @@ export function watchAnnotation(
101101
}
102102

103103
/**
104-
* Mount code annotation
104+
* Mount annotation
105105
*
106-
* @param el - Code annotation element
107-
* @param container - Containing code block element
106+
* @param el - Annotation element
107+
* @param container - Containing element
108108
*
109-
* @returns Code annotation component observable
109+
* @returns Annotation component observable
110110
*/
111111
export function mountAnnotation(
112112
el: HTMLElement, container: HTMLElement

src/assets/javascripts/components/content/code/annotation/list/index.ts renamed to src/assets/javascripts/components/content/annotation/list/index.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
} from "~/browser"
3939
import { renderAnnotation } from "~/templates"
4040

41-
import { Component } from "../../../../_"
41+
import { Component } from "../../../_"
4242
import {
4343
Annotation,
4444
mountAnnotation
@@ -60,11 +60,11 @@ interface MountOptions {
6060
* ------------------------------------------------------------------------- */
6161

6262
/**
63-
* Find all code annotation markers in the given code block
63+
* Find all annotation markers in the given code block
6464
*
65-
* @param container - Containing code block element
65+
* @param container - Containing element
6666
*
67-
* @returns Code annotation markers
67+
* @returns Annotation markers
6868
*/
6969
function findAnnotationMarkers(container: HTMLElement): Text[] {
7070
const markers: Text[] = []
@@ -97,18 +97,18 @@ function swap(source: HTMLElement, target: HTMLElement): void {
9797
* ------------------------------------------------------------------------- */
9898

9999
/**
100-
* Mount code annotation list
100+
* Mount annotation list
101101
*
102-
* This function analyzes the given container code block and checks for markers
103-
* referring to elements in the given code annotation list. If no markers are
104-
* found, the list is left untouched. Otherwise, list elements are rendered as
105-
* code annotations inside the code block.
102+
* This function analyzes the containing code block and checks for markers
103+
* referring to elements in the given annotation list. If no markers are found,
104+
* the list is left untouched. Otherwise, list elements are rendered as
105+
* annotations inside the code block.
106106
*
107-
* @param el - Code annotation list element
108-
* @param container - Containing code block element
107+
* @param el - Annotation list element
108+
* @param container - Containing element
109109
* @param options - Options
110110
*
111-
* @returns Code annotation list component observable
111+
* @returns Annotation component observable
112112
*/
113113
export function mountAnnotationList(
114114
el: HTMLElement, container: HTMLElement, { print$ }: MountOptions
@@ -138,7 +138,7 @@ export function mountAnnotationList(
138138
.subscribe(active => {
139139
el.hidden = !active
140140

141-
/* Move annotation contents back into list */
141+
/* Show annotations in code block or list (print) */
142142
for (const [id, annotation] of annotations) {
143143
const inner = getElement(".md-typeset", annotation)
144144
const child = getElement(`li:nth-child(${id})`, el)

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

-216
This file was deleted.

0 commit comments

Comments
 (0)