@fluid-topics/ft-reader-toc 0.3.12 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-reader-toc.css.d.ts +11 -0
- package/build/ft-reader-toc.css.js +48 -0
- package/build/ft-reader-toc.d.ts +2 -22
- package/build/ft-reader-toc.js +7 -50
- package/build/ft-reader-toc.light.js +469 -469
- package/build/ft-reader-toc.min.js +478 -478
- package/build/ft-reader-toc.properties.d.ts +15 -0
- package/build/ft-reader-toc.properties.js +5 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +7 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const FtReaderTocCssVariables: {
|
|
2
|
+
tabulationSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
verticalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
textColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
highlightedTextColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
highlightedFontWeight: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
highlightedBackgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
8
|
+
iconFontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
9
|
+
};
|
|
10
|
+
export declare const styles: import("lit").CSSResult;
|
|
11
|
+
//# sourceMappingURL=ft-reader-toc.css.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtTypographyCssVariables } from "@fluid-topics/ft-typography/build/ft-typography.css";
|
|
4
|
+
import { FtButtonCssVariables } from "@fluid-topics/ft-button/build/ft-button.css";
|
|
5
|
+
export const FtReaderTocCssVariables = {
|
|
6
|
+
tabulationSize: FtCssVariableFactory.create("--ft-reader-toc-tabulation-size", "SIZE", "16px"),
|
|
7
|
+
verticalSpacing: FtCssVariableFactory.create("--ft-reader-toc-vertical-spacing", "SIZE", "4px"),
|
|
8
|
+
textColor: FtCssVariableFactory.extend("--ft-reader-toc-text-color", designSystemVariables.colorOnSurface),
|
|
9
|
+
highlightedTextColor: FtCssVariableFactory.extend("--ft-reader-toc-highlighted-text-color", designSystemVariables.colorPrimary),
|
|
10
|
+
highlightedFontWeight: FtCssVariableFactory.create("--ft-reader-toc-highlighted-font-weight", "UNKNOWN", "bold"),
|
|
11
|
+
highlightedBackgroundColor: FtCssVariableFactory.create("--ft-reader-toc-highlighted-background-color", "COLOR", "transparent"),
|
|
12
|
+
iconFontSize: FtCssVariableFactory.create("--ft-reader-toc-icon-font-size", "SIZE", "16px"),
|
|
13
|
+
};
|
|
14
|
+
// language=CSS
|
|
15
|
+
export const styles = css `
|
|
16
|
+
.ft-reader-toc {
|
|
17
|
+
color: ${FtReaderTocCssVariables.textColor};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ft-reader-toc--node-highlighted > .ft-reader-toc--link-container {
|
|
21
|
+
background-color: ${FtReaderTocCssVariables.highlightedBackgroundColor};
|
|
22
|
+
color: ${FtReaderTocCssVariables.highlightedTextColor};
|
|
23
|
+
${setVariable(FtTypographyCssVariables.fontWeight, FtReaderTocCssVariables.highlightedFontWeight)}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ft-reader-toc--link-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: 4px;
|
|
29
|
+
padding: ${FtReaderTocCssVariables.verticalSpacing} 4px; /* left padding is override on inline style */
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ft-reader-toc-mobile .ft-reader-toc--toggle-container {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
width: calc(${FtReaderTocCssVariables.iconFontSize} + 12px); /*--ft-button-internal-horizontal-padding: 8px; in ft-button NOT dense*/
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ft-reader-toc-desktop .ft-reader-toc--toggle-container {
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
width: calc(${FtReaderTocCssVariables.iconFontSize} + 4px); /*--ft-button-internal-horizontal-padding: 4px; in ft-button dense*/
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ft-button {
|
|
44
|
+
${setVariable(FtButtonCssVariables.iconSize, FtReaderTocCssVariables.iconFontSize)};
|
|
45
|
+
${setVariable(FtButtonCssVariables.backgroundColor, "transparent")};
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
//# sourceMappingURL=ft-reader-toc.css.js.map
|
package/build/ft-reader-toc.d.ts
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import { PropertyValues, TemplateResult } from "lit";
|
|
2
|
-
import { ElementDefinitionsMap
|
|
2
|
+
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
4
4
|
import { FtIconVariants } from "@fluid-topics/ft-icon";
|
|
5
|
-
|
|
6
|
-
expanded?: boolean;
|
|
7
|
-
iconVariant?: FtIconVariants;
|
|
8
|
-
collapseIcon?: string;
|
|
9
|
-
expandIcon?: string;
|
|
10
|
-
autoCollapse?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface FtReaderTocLabels extends ParametrizedLabels {
|
|
13
|
-
expand?: string;
|
|
14
|
-
collapse?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const DEFAULT_LABELS: FtReaderTocLabels;
|
|
17
|
-
export declare const FtReaderTocCssVariables: {
|
|
18
|
-
tabulationSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
19
|
-
verticalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
20
|
-
textColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
21
|
-
highlightedTextColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
22
|
-
highlightedFontWeight: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
23
|
-
highlightedBackgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
24
|
-
iconFontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
25
|
-
};
|
|
5
|
+
import { FtReaderTocLabels, FtReaderTocProperties } from "./ft-reader-toc.properties";
|
|
26
6
|
export declare class FtReaderToc extends FtReaderComponent implements FtReaderTocProperties {
|
|
27
7
|
static elementDefinitions: ElementDefinitionsMap;
|
|
28
8
|
static styles: import("lit").CSSResult;
|
package/build/ft-reader-toc.js
CHANGED
|
@@ -4,31 +4,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html, nothing } from "lit";
|
|
8
8
|
import { repeat } from "lit/directives/repeat.js";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
10
|
import { styleMap } from "lit/directives/style-map.js";
|
|
11
11
|
import { property, state } from "lit/decorators.js";
|
|
12
|
-
import { deepEqual,
|
|
12
|
+
import { deepEqual, jsonProperty, ParametrizedLabelResolver, redux } from "@fluid-topics/ft-wc-utils";
|
|
13
13
|
import { FtReaderComponent, } from "@fluid-topics/ft-reader-context/build/registration";
|
|
14
|
-
import { FtTypography
|
|
14
|
+
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
15
15
|
import { FtReaderInternalLink } from "@fluid-topics/ft-reader-internal-link";
|
|
16
16
|
import { FtIconVariants } from "@fluid-topics/ft-icon";
|
|
17
|
-
import { FtButton
|
|
17
|
+
import { FtButton } from "@fluid-topics/ft-button";
|
|
18
18
|
import { FtSizeCategory, FtSizeWatcher } from "@fluid-topics/ft-size-watcher";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
collapse: "Collapse {0}",
|
|
22
|
-
};
|
|
23
|
-
export const FtReaderTocCssVariables = {
|
|
24
|
-
tabulationSize: FtCssVariableFactory.create("--ft-reader-toc-tabulation-size", "SIZE", "16px"),
|
|
25
|
-
verticalSpacing: FtCssVariableFactory.create("--ft-reader-toc-vertical-spacing", "SIZE", "4px"),
|
|
26
|
-
textColor: FtCssVariableFactory.extend("--ft-reader-toc-text-color", designSystemVariables.colorOnSurface),
|
|
27
|
-
highlightedTextColor: FtCssVariableFactory.extend("--ft-reader-toc-highlighted-text-color", designSystemVariables.colorPrimary),
|
|
28
|
-
highlightedFontWeight: FtCssVariableFactory.create("--ft-reader-toc-highlighted-font-weight", "UNKNOWN", "bold"),
|
|
29
|
-
highlightedBackgroundColor: FtCssVariableFactory.create("--ft-reader-toc-highlighted-background-color", "COLOR", "transparent"),
|
|
30
|
-
iconFontSize: FtCssVariableFactory.create("--ft-reader-toc-icon-font-size", "SIZE", "16px"),
|
|
31
|
-
};
|
|
19
|
+
import { DEFAULT_LABELS } from "./ft-reader-toc.properties";
|
|
20
|
+
import { FtReaderTocCssVariables, styles } from "./ft-reader-toc.css";
|
|
32
21
|
export class FtReaderToc extends FtReaderComponent {
|
|
33
22
|
constructor() {
|
|
34
23
|
super(...arguments);
|
|
@@ -149,39 +138,7 @@ FtReaderToc.elementDefinitions = {
|
|
|
149
138
|
"ft-typography": FtTypography,
|
|
150
139
|
};
|
|
151
140
|
// language=CSS
|
|
152
|
-
FtReaderToc.styles =
|
|
153
|
-
.ft-reader-toc {
|
|
154
|
-
color: ${FtReaderTocCssVariables.textColor};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.ft-reader-toc--node-highlighted > .ft-reader-toc--link-container {
|
|
158
|
-
background-color: ${FtReaderTocCssVariables.highlightedBackgroundColor};
|
|
159
|
-
color: ${FtReaderTocCssVariables.highlightedTextColor};
|
|
160
|
-
${setVariable(FtTypographyCssVariables.fontWeight, FtReaderTocCssVariables.highlightedFontWeight)}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.ft-reader-toc--link-container {
|
|
164
|
-
display: flex;
|
|
165
|
-
gap: 4px;
|
|
166
|
-
padding: ${FtReaderTocCssVariables.verticalSpacing} 4px; /* left padding is override on inline style */
|
|
167
|
-
align-items: center;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.ft-reader-toc-mobile .ft-reader-toc--toggle-container {
|
|
171
|
-
flex-shrink: 0;
|
|
172
|
-
width: calc(${FtReaderTocCssVariables.iconFontSize} + 12px); /*--ft-button-internal-horizontal-padding: 8px; in ft-button NOT dense*/
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.ft-reader-toc-desktop .ft-reader-toc--toggle-container {
|
|
176
|
-
flex-shrink: 0;
|
|
177
|
-
width: calc(${FtReaderTocCssVariables.iconFontSize} + 4px); /*--ft-button-internal-horizontal-padding: 4px; in ft-button dense*/
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
ft-button {
|
|
181
|
-
${setVariable(FtButtonCssVariables.iconSize, FtReaderTocCssVariables.iconFontSize)};
|
|
182
|
-
${setVariable(FtButtonCssVariables.backgroundColor, "transparent")};
|
|
183
|
-
}
|
|
184
|
-
`;
|
|
141
|
+
FtReaderToc.styles = styles;
|
|
185
142
|
__decorate([
|
|
186
143
|
property({ type: Boolean })
|
|
187
144
|
], FtReaderToc.prototype, "expanded", void 0);
|