@fluid-topics/ft-reader-breadcrumbs 1.3.12
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/README.md +19 -0
- package/build/ReaderBreadcrumbsMessage.d.ts +7 -0
- package/build/ReaderBreadcrumbsMessage.js +6 -0
- package/build/ft-reader-breadcrumbs.d.ts +30 -0
- package/build/ft-reader-breadcrumbs.js +171 -0
- package/build/ft-reader-breadcrumbs.light.js +1372 -0
- package/build/ft-reader-breadcrumbs.min.js +1587 -0
- package/build/ft-reader-breadcrumbs.properties.d.ts +9 -0
- package/build/ft-reader-breadcrumbs.properties.js +1 -0
- package/build/ft-reader-breadcrumbs.styles.d.ts +12 -0
- package/build/ft-reader-breadcrumbs.styles.js +94 -0
- package/build/helpers/FtReaderBreadcrumbsMenuHelper.d.ts +7 -0
- package/build/helpers/FtReaderBreadcrumbsMenuHelper.js +23 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +6 -0
- package/package.json +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const FtReaderBreadcrumbsCssVariables: {
|
|
2
|
+
itemColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
itemColorHover: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
itemFontWeight: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
currentItemColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
currentItemFontWeight: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
separatorColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
8
|
+
separatorFontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
9
|
+
separatorFontWeight: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
10
|
+
separatorSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
11
|
+
};
|
|
12
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtTypographyBody2CssVariables } from "@fluid-topics/ft-typography";
|
|
4
|
+
import { foundation } from "@fluid-topics/design-system-variables";
|
|
5
|
+
const itemColor = FtCssVariableFactory.extend("--ft-reader-breadcrumbs-item-color", "", designSystemVariables.colorOnSurface);
|
|
6
|
+
const itemFontWeight = FtCssVariableFactory.create("--ft-reader-breadcrumbs-item-font-weight", "", "UNKNOWN", "normal");
|
|
7
|
+
export const FtReaderBreadcrumbsCssVariables = {
|
|
8
|
+
itemColor: itemColor,
|
|
9
|
+
itemColorHover: FtCssVariableFactory.extend("--ft-reader-breadcrumbs-item-color-hover", "", designSystemVariables.colorPrimary),
|
|
10
|
+
itemFontWeight: itemFontWeight,
|
|
11
|
+
currentItemColor: FtCssVariableFactory.extend("--ft-reader-breadcrumbs-current-item-color", "", itemColor),
|
|
12
|
+
currentItemFontWeight: FtCssVariableFactory.extend("--ft-reader-breadcrumbs-current-item-font-weight", "", itemFontWeight),
|
|
13
|
+
separatorColor: FtCssVariableFactory.extend("--ft-reader-breadcrumbs-separator-color", "", designSystemVariables.colorOnSurface),
|
|
14
|
+
separatorFontSize: FtCssVariableFactory.create("--ft-reader-breadcrumbs-separator-font-size", "", "SIZE", "14px"),
|
|
15
|
+
separatorFontWeight: FtCssVariableFactory.create("--ft-reader-breadcrumbs-separator-font-weight", "", "UNKNOWN", "normal"),
|
|
16
|
+
separatorSpacing: FtCssVariableFactory.create("--ft-reader-breadcrumbs-separator-spacing", "", "SIZE", "8px"),
|
|
17
|
+
};
|
|
18
|
+
// language=CSS
|
|
19
|
+
export const styles = css `
|
|
20
|
+
ol {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: ${FtReaderBreadcrumbsCssVariables.separatorSpacing};
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
li {
|
|
30
|
+
list-style: none;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
li:last-child {
|
|
35
|
+
flex-shrink: 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.multiline ol {
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.multiline li {
|
|
43
|
+
white-space: normal;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
li.separator {
|
|
47
|
+
color: ${FtReaderBreadcrumbsCssVariables.separatorColor};
|
|
48
|
+
${setVariable(FtTypographyBody2CssVariables.fontSize, FtReaderBreadcrumbsCssVariables.separatorFontSize)};
|
|
49
|
+
${setVariable(FtTypographyBody2CssVariables.fontWeight, FtReaderBreadcrumbsCssVariables.separatorFontWeight)};
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
li.separator ft-typography {
|
|
54
|
+
display: flex;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
li.menu {
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.menu-item {
|
|
62
|
+
padding: ${foundation.spacing1};
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.menu-item:hover {
|
|
67
|
+
padding: ${foundation.spacing1};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.menu-item [part=breadcrumb-link-label] {
|
|
71
|
+
padding: ${foundation.spacing3};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[part=breadcrumb-link-label] {
|
|
75
|
+
color: ${FtReaderBreadcrumbsCssVariables.itemColor};
|
|
76
|
+
${setVariable(FtTypographyBody2CssVariables.fontWeight, FtReaderBreadcrumbsCssVariables.itemFontWeight)};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[part=breadcrumb-link-label]:hover {
|
|
80
|
+
color: ${FtReaderBreadcrumbsCssVariables.itemColorHover};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[part=breadcrumb-current-item] {
|
|
84
|
+
color: ${FtReaderBreadcrumbsCssVariables.currentItemColor};
|
|
85
|
+
${setVariable(FtTypographyBody2CssVariables.fontWeight, FtReaderBreadcrumbsCssVariables.currentItemFontWeight)};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[part=breadcrumb-link-label],
|
|
89
|
+
[part=breadcrumb-current-item] {
|
|
90
|
+
display: block;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FtReaderBreadcrumb } from "@fluid-topics/ft-reader-context";
|
|
2
|
+
export interface SplitBreadcrumbs {
|
|
3
|
+
beforeMenu: Array<FtReaderBreadcrumb>;
|
|
4
|
+
inMenu: Array<FtReaderBreadcrumb>;
|
|
5
|
+
afterMenu: Array<FtReaderBreadcrumb>;
|
|
6
|
+
}
|
|
7
|
+
export declare function splitBreadcrumbForMenu(breadcrumbs: Array<FtReaderBreadcrumb>, startOffset?: number, endOffset?: number): SplitBreadcrumbs;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function splitBreadcrumbForMenu(breadcrumbs, startOffset = 0, endOffset = 0) {
|
|
2
|
+
if (breadcrumbs.length === 0) {
|
|
3
|
+
return {
|
|
4
|
+
beforeMenu: [],
|
|
5
|
+
inMenu: [],
|
|
6
|
+
afterMenu: [],
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const actualEndOffset = Math.max(endOffset, 1);
|
|
10
|
+
const afterMenuElements = breadcrumbs.slice(actualEndOffset * -1);
|
|
11
|
+
if (startOffset + actualEndOffset >= breadcrumbs.length) {
|
|
12
|
+
return {
|
|
13
|
+
beforeMenu: [],
|
|
14
|
+
inMenu: [],
|
|
15
|
+
afterMenu: breadcrumbs,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
beforeMenu: breadcrumbs.slice(0, startOffset),
|
|
20
|
+
inMenu: breadcrumbs.slice(startOffset, breadcrumbs.length - afterMenuElements.length),
|
|
21
|
+
afterMenu: afterMenuElements,
|
|
22
|
+
};
|
|
23
|
+
}
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtReaderBreadcrumbs } from "./ft-reader-breadcrumbs";
|
|
3
|
+
export * from "./ft-reader-breadcrumbs.styles";
|
|
4
|
+
export * from "./ft-reader-breadcrumbs.properties";
|
|
5
|
+
export * from "./ft-reader-breadcrumbs";
|
|
6
|
+
customElement("ft-reader-breadcrumbs")(FtReaderBreadcrumbs);
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-topics/ft-reader-breadcrumbs",
|
|
3
|
+
"version": "1.3.12",
|
|
4
|
+
"description": "A component to display current visible topic breadcrumbs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ft-reader-breadcrumbs.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.js",
|
|
15
|
+
"build/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-floating-menu": "1.3.12",
|
|
23
|
+
"@fluid-topics/ft-reader-context": "1.3.12",
|
|
24
|
+
"@fluid-topics/ft-ripple": "1.3.12",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.3.12",
|
|
26
|
+
"@fluid-topics/ft-wc-test-utils": "1.3.12",
|
|
27
|
+
"lit": "3.1.0"
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "c0422158795c14ed01e51d1dc4d948e9b87fd328"
|
|
30
|
+
}
|