@progressive-development/pd-content 1.1.0 → 1.1.1
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/dist/node_modules/.pnpm/@codemirror_autocomplete@6.20.1/node_modules/@codemirror/autocomplete/dist/index.js +550 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +264 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +44 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +346 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +32 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js +492 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js +308 -0
- package/dist/node_modules/.pnpm/@codemirror_language@6.12.3/node_modules/@codemirror/language/dist/index.js +1572 -0
- package/dist/node_modules/.pnpm/@codemirror_state@6.6.0/node_modules/@codemirror/state/dist/index.js +3881 -0
- package/dist/node_modules/.pnpm/@codemirror_view@6.40.0/node_modules/@codemirror/view/dist/index.js +9657 -0
- package/dist/node_modules/.pnpm/@lezer_common@1.5.1/node_modules/@lezer/common/dist/index.js +2196 -0
- package/dist/node_modules/.pnpm/@lezer_css@1.3.3/node_modules/@lezer/css/dist/index.js +147 -0
- package/dist/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +898 -0
- package/dist/node_modules/.pnpm/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js +349 -0
- package/dist/node_modules/.pnpm/@lezer_java@1.1.3/node_modules/@lezer/java/dist/index.js +67 -0
- package/dist/node_modules/.pnpm/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js +192 -0
- package/dist/node_modules/.pnpm/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js +37 -0
- package/dist/node_modules/.pnpm/@lezer_lr@1.4.8/node_modules/@lezer/lr/dist/index.js +1884 -0
- package/dist/node_modules/.pnpm/@lezer_markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js +2335 -0
- package/dist/node_modules/.pnpm/@lezer_python@1.1.18/node_modules/@lezer/python/dist/index.js +326 -0
- package/dist/node_modules/.pnpm/@marijn_find-cluster-break@1.0.2/node_modules/@marijn/find-cluster-break/src/index.js +82 -0
- package/dist/node_modules/.pnpm/style-mod@4.1.3/node_modules/style-mod/src/style-mod.js +174 -0
- package/dist/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js +121 -0
- package/dist/pd-badge-order/PdBadgeItem.d.ts +11 -0
- package/dist/pd-badge-order/PdBadgeItem.d.ts.map +1 -1
- package/dist/pd-badge-order/PdBadgeItem.js +162 -10
- package/dist/pd-badge-order/PdBadgeOrder.d.ts +56 -17
- package/dist/pd-badge-order/PdBadgeOrder.d.ts.map +1 -1
- package/dist/pd-badge-order/PdBadgeOrder.js +308 -153
- package/dist/pd-badge-order/types.js +3 -1
- package/dist/pd-code-snippet/PdCodeSnippet.d.ts +29 -0
- package/dist/pd-code-snippet/PdCodeSnippet.d.ts.map +1 -1
- package/dist/pd-code-snippet/PdCodeSnippet.js +117 -67
- package/dist/pd-code-snippet/codemirror-setup.d.ts +10 -0
- package/dist/pd-code-snippet/codemirror-setup.d.ts.map +1 -0
- package/dist/pd-code-snippet/codemirror-setup.js +101 -0
- package/dist/pd-more-info/PdMoreInfo.d.ts +48 -4
- package/dist/pd-more-info/PdMoreInfo.d.ts.map +1 -1
- package/dist/pd-more-info/PdMoreInfo.js +132 -17
- package/dist/pd-notice-box/PdNoticeBox.js +1 -1
- package/dist/pd-panel-viewer/PdPanel.d.ts +3 -0
- package/dist/pd-panel-viewer/PdPanel.d.ts.map +1 -1
- package/dist/pd-panel-viewer/PdPanel.js +8 -1
- package/dist/pd-panel-viewer/PdPanelViewer.d.ts +1 -0
- package/dist/pd-panel-viewer/PdPanelViewer.d.ts.map +1 -1
- package/dist/pd-panel-viewer/PdPanelViewer.js +44 -28
- package/dist/pd-timeline/PdTimeline.d.ts +2 -0
- package/dist/pd-timeline/PdTimeline.d.ts.map +1 -1
- package/dist/pd-timeline/PdTimeline.js +50 -19
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, LitElement, html } from 'lit';
|
|
1
|
+
import { css, LitElement, nothing, html } from 'lit';
|
|
2
2
|
import { property, state } from 'lit/decorators.js';
|
|
3
3
|
import { localized, msg } from '@lit/localize';
|
|
4
4
|
|
|
@@ -17,34 +17,127 @@ let PdMoreInfo = class extends LitElement {
|
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.noAutoScroll = false;
|
|
19
19
|
this._lessInfo = true;
|
|
20
|
+
this._fullText = "";
|
|
21
|
+
this._isOverflowing = false;
|
|
20
22
|
}
|
|
21
23
|
render() {
|
|
24
|
+
if (this.maxLength) {
|
|
25
|
+
return this._renderMaxLength();
|
|
26
|
+
}
|
|
27
|
+
if (this.maxLines) {
|
|
28
|
+
return this._renderMaxLines();
|
|
29
|
+
}
|
|
30
|
+
return this._renderLegacy();
|
|
31
|
+
}
|
|
32
|
+
updated() {
|
|
33
|
+
if (this.maxLines && this._lessInfo) {
|
|
34
|
+
this._checkOverflow();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// maxLength mode
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
_renderMaxLength() {
|
|
41
|
+
const needsTruncation = this._fullText.length > this.maxLength;
|
|
42
|
+
const collapsed = this._lessInfo && needsTruncation;
|
|
43
|
+
return html`
|
|
44
|
+
<p>
|
|
45
|
+
<span class=${collapsed ? "slot-hidden" : ""}
|
|
46
|
+
><slot @slotchange=${this._onSlotChange}></slot
|
|
47
|
+
></span>
|
|
48
|
+
${collapsed ? html`${this._truncateText(this._fullText, this.maxLength)}
|
|
49
|
+
${this._moreLink()}` : needsTruncation ? this._lessLink() : nothing}
|
|
50
|
+
</p>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
_truncateText(text, max) {
|
|
54
|
+
if (text.length <= max) return text;
|
|
55
|
+
const truncated = text.slice(0, max);
|
|
56
|
+
const lastSpace = truncated.lastIndexOf(" ");
|
|
57
|
+
return (lastSpace > 0 ? truncated.slice(0, lastSpace) : truncated) + "…";
|
|
58
|
+
}
|
|
59
|
+
_onSlotChange(e) {
|
|
60
|
+
const slot = e.target;
|
|
61
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
62
|
+
const raw = nodes.map((n) => n.textContent ?? "").join("");
|
|
63
|
+
const text = raw.replace(/\s+/g, " ").trim();
|
|
64
|
+
if (text !== this._fullText) {
|
|
65
|
+
this._fullText = text;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// maxLines mode
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
_renderMaxLines() {
|
|
72
|
+
return html`
|
|
73
|
+
<p>
|
|
74
|
+
<span
|
|
75
|
+
class=${this._lessInfo ? "content-clamped" : ""}
|
|
76
|
+
style=${this._lessInfo ? `-webkit-line-clamp: ${this.maxLines}` : ""}
|
|
77
|
+
>
|
|
78
|
+
<slot @slotchange=${this._onMaxLinesSlotChange}></slot>
|
|
79
|
+
</span>
|
|
80
|
+
${this._lessInfo && this._isOverflowing ? this._moreLink() : !this._lessInfo ? this._lessLink() : nothing}
|
|
81
|
+
</p>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
_onMaxLinesSlotChange() {
|
|
85
|
+
this.updateComplete.then(() => this._checkOverflow());
|
|
86
|
+
}
|
|
87
|
+
_checkOverflow() {
|
|
88
|
+
const wrapper = this.shadowRoot?.querySelector(
|
|
89
|
+
"p > span"
|
|
90
|
+
);
|
|
91
|
+
if (wrapper) {
|
|
92
|
+
this._isOverflowing = wrapper.scrollHeight > wrapper.clientHeight;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Legacy mode (named slots)
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
_renderLegacy() {
|
|
22
99
|
return html`
|
|
23
100
|
<p>
|
|
24
101
|
${this._lessInfo ? html`
|
|
25
102
|
<slot name="small-view"></slot>
|
|
26
|
-
|
|
27
|
-
role="button"
|
|
28
|
-
tabindex="0"
|
|
29
|
-
@click=${this._showMoreInfo}
|
|
30
|
-
@keydown=${this._onKeyDown}
|
|
31
|
-
>
|
|
32
|
-
${msg("Mehr Informationen", { id: "pd.moreInfo.more" })}
|
|
33
|
-
</a>
|
|
103
|
+
${this._moreLink()}
|
|
34
104
|
` : html`
|
|
35
105
|
<slot name="large-view"></slot>
|
|
36
|
-
|
|
37
|
-
role="button"
|
|
38
|
-
tabindex="0"
|
|
39
|
-
@click=${this._showLessInfo}
|
|
40
|
-
@keydown=${this._onKeyDown}
|
|
41
|
-
>
|
|
42
|
-
${msg("Text ausblenden", { id: "pd.moreInfo.less" })}
|
|
43
|
-
</a>
|
|
106
|
+
${this._lessLink()}
|
|
44
107
|
`}
|
|
45
108
|
</p>
|
|
46
109
|
`;
|
|
47
110
|
}
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Shared toggle links
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
_moreLink() {
|
|
115
|
+
return html`
|
|
116
|
+
<a
|
|
117
|
+
role="button"
|
|
118
|
+
tabindex="0"
|
|
119
|
+
@click=${this._showMoreInfo}
|
|
120
|
+
@keydown=${this._onKeyDown}
|
|
121
|
+
>
|
|
122
|
+
${msg("Mehr Informationen", { id: "pd.moreInfo.more" })}
|
|
123
|
+
</a>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
_lessLink() {
|
|
127
|
+
return html`
|
|
128
|
+
<a
|
|
129
|
+
role="button"
|
|
130
|
+
tabindex="0"
|
|
131
|
+
@click=${this._showLessInfo}
|
|
132
|
+
@keydown=${this._onKeyDown}
|
|
133
|
+
>
|
|
134
|
+
${msg("Text ausblenden", { id: "pd.moreInfo.less" })}
|
|
135
|
+
</a>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
// Event handlers
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
48
141
|
_onKeyDown(e) {
|
|
49
142
|
if (e.key === "Enter" || e.key === " ") {
|
|
50
143
|
e.preventDefault();
|
|
@@ -100,14 +193,36 @@ PdMoreInfo.styles = [
|
|
|
100
193
|
outline-offset: 2px;
|
|
101
194
|
border-radius: 2px;
|
|
102
195
|
}
|
|
196
|
+
|
|
197
|
+
.content-clamped {
|
|
198
|
+
display: -webkit-box;
|
|
199
|
+
-webkit-box-orient: vertical;
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.slot-hidden {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
103
206
|
`
|
|
104
207
|
];
|
|
208
|
+
__decorateClass([
|
|
209
|
+
property({ type: Number, attribute: "max-length" })
|
|
210
|
+
], PdMoreInfo.prototype, "maxLength", 2);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
property({ type: Number, attribute: "max-lines" })
|
|
213
|
+
], PdMoreInfo.prototype, "maxLines", 2);
|
|
105
214
|
__decorateClass([
|
|
106
215
|
property({ type: Boolean, reflect: true })
|
|
107
216
|
], PdMoreInfo.prototype, "noAutoScroll", 2);
|
|
108
217
|
__decorateClass([
|
|
109
218
|
state()
|
|
110
219
|
], PdMoreInfo.prototype, "_lessInfo", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
state()
|
|
222
|
+
], PdMoreInfo.prototype, "_fullText", 2);
|
|
223
|
+
__decorateClass([
|
|
224
|
+
state()
|
|
225
|
+
], PdMoreInfo.prototype, "_isOverflowing", 2);
|
|
111
226
|
PdMoreInfo = __decorateClass([
|
|
112
227
|
localized()
|
|
113
228
|
], PdMoreInfo);
|
|
@@ -34,7 +34,7 @@ class PdNoticeBox extends LitElement {
|
|
|
34
34
|
:host {
|
|
35
35
|
/* Layout */
|
|
36
36
|
--_width: var(--pd-notice-box-width, 100%);
|
|
37
|
-
--_radius: var(--pd-notice-box-border-radius, var(--pd-radius-
|
|
37
|
+
--_radius: var(--pd-notice-box-border-radius, var(--pd-radius-lg, 8px));
|
|
38
38
|
--_padding: var(--pd-notice-box-padding, var(--pd-spacing-sm, 12px));
|
|
39
39
|
--_gap: var(--pd-notice-box-gap, var(--pd-spacing-sm, 12px));
|
|
40
40
|
|
|
@@ -6,6 +6,9 @@ import { LitElement } from 'lit';
|
|
|
6
6
|
*
|
|
7
7
|
* @cssprop --pd-panel-bg - Panel background color. Default: `#afc1d2`.
|
|
8
8
|
* @cssprop --pd-panel-border-radius - Panel border radius. Default: `0.2em`.
|
|
9
|
+
* @cssprop --pd-panel-padding - Content padding. Default: `2rem`.
|
|
10
|
+
*
|
|
11
|
+
* @attr {boolean} no-padding - Remove content padding (useful for full-bleed slides).
|
|
9
12
|
*/
|
|
10
13
|
export declare class PdPanel extends LitElement {
|
|
11
14
|
static styles: import('lit').CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdPanel.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"PdPanel.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,0BA6BX;IAEF,MAAM;CAOP"}
|
|
@@ -5,6 +5,8 @@ class PdPanel extends LitElement {
|
|
|
5
5
|
this.styles = css`
|
|
6
6
|
:host {
|
|
7
7
|
background: var(--pd-panel-bg, #afc1d2);
|
|
8
|
+
background-size: cover;
|
|
9
|
+
background-position: center;
|
|
8
10
|
border-radius: var(--pd-panel-border-radius, 0.2em);
|
|
9
11
|
}
|
|
10
12
|
|
|
@@ -15,12 +17,17 @@ class PdPanel extends LitElement {
|
|
|
15
17
|
right: 0;
|
|
16
18
|
bottom: 0;
|
|
17
19
|
left: 0;
|
|
18
|
-
padding: 2rem;
|
|
20
|
+
padding: var(--pd-panel-padding, 2rem);
|
|
19
21
|
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
21
23
|
align-items: center;
|
|
22
24
|
justify-content: flex-start;
|
|
23
25
|
}
|
|
26
|
+
|
|
27
|
+
:host([no-padding]) #content {
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
#content > slot::slotted(*) {
|
|
25
32
|
margin: 0;
|
|
26
33
|
}
|
|
@@ -9,6 +9,7 @@ import { LitElement } from 'lit';
|
|
|
9
9
|
*
|
|
10
10
|
* @cssprop --pd-panel-viewer-bg-col - Viewer background color. Default: `var(--pd-default-col)`.
|
|
11
11
|
* @cssprop --pd-panel-width - Max width of the panel viewer. Default: `1170px`.
|
|
12
|
+
* @attr {boolean} fill - Fill parent height instead of using --pd-panel-height.
|
|
12
13
|
* @cssprop --pd-panel-height - Height of the panel viewer. Default: `60vh`.
|
|
13
14
|
* @cssprop --pd-panel-overflow - Overflow behavior. Default: `hidden`.
|
|
14
15
|
* @cssprop --pd-panel-nav-top - Top position of navigation arrows. Default: `calc(50% - 25px)`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdPanelViewer.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanelViewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAKrD,OAAO,0CAA0C,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"PdPanelViewer.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanelViewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAKrD,OAAO,0CAA0C,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAE3C,YAAY,UAAS;IAErB,qFAAqF;IAErF,UAAU,UAAQ;IAGlB,SAAS,SAAK;IAEd,cAAc;IAEd,MAAM,SAAK;IAEX,cAAc;IAEd,QAAQ,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAM;IAEtD,cAAc;IAEd,OAAO,KAAM;IAEb,cAAc;IACd,OAAO,CAAC,eAAe,CAA+B;IACtD,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,cAAc;IACd,OAAO,CAAC,aAAa,CAAS;IAC9B,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,iBAAiB,CAAwB;IAEjD,MAAM,CAAC,MAAM,0BAiHX;IAEF,IAAI,KAAK,WAER;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EASd;IAED,MAAM;IAoFN,YAAY;IAQH,oBAAoB;IAS7B,MAAM,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAK9C;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAsCrB,IAAI;IASJ,QAAQ;IAUR,OAAO,CAAC,cAAc,CAQpB;IAEF,OAAO,CAAC,cAAc,CAqCpB;IAEF,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,gBAAgB,CAMtB;IAIF,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,kBAAkB;CAY3B"}
|
|
@@ -93,6 +93,7 @@ class PdPanelViewer extends LitElement {
|
|
|
93
93
|
display: flex;
|
|
94
94
|
flex-direction: column;
|
|
95
95
|
width: 100%;
|
|
96
|
+
height: 100%;
|
|
96
97
|
max-width: var(--pd-panel-width, 1170px);
|
|
97
98
|
overflow: var(--pd-panel-overflow, hidden);
|
|
98
99
|
background-color: var(--pd-panel-viewer-bg-col, var(--pd-default-col));
|
|
@@ -140,6 +141,10 @@ class PdPanelViewer extends LitElement {
|
|
|
140
141
|
right: 0;
|
|
141
142
|
}
|
|
142
143
|
|
|
144
|
+
:host([fill]) .panel-container {
|
|
145
|
+
height: 100%;
|
|
146
|
+
}
|
|
147
|
+
|
|
143
148
|
:host([overlayNav]) .panel-container {
|
|
144
149
|
padding: 0;
|
|
145
150
|
}
|
|
@@ -202,9 +207,14 @@ class PdPanelViewer extends LitElement {
|
|
|
202
207
|
return this._index;
|
|
203
208
|
}
|
|
204
209
|
set index(value) {
|
|
205
|
-
this.
|
|
206
|
-
this.children[value].dispatchEvent(new CustomEvent("entered"));
|
|
210
|
+
const prev = this._index;
|
|
207
211
|
this._index = value;
|
|
212
|
+
this.children[prev].dispatchEvent(
|
|
213
|
+
new CustomEvent("exited", { bubbles: true })
|
|
214
|
+
);
|
|
215
|
+
this.children[value].dispatchEvent(
|
|
216
|
+
new CustomEvent("entered", { bubbles: true })
|
|
217
|
+
);
|
|
208
218
|
}
|
|
209
219
|
render() {
|
|
210
220
|
return html`
|
|
@@ -227,30 +237,36 @@ class PdPanelViewer extends LitElement {
|
|
|
227
237
|
>
|
|
228
238
|
<slot></slot>
|
|
229
239
|
</div>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
240
|
+
${this.children.length > 1 ? html`
|
|
241
|
+
<pd-icon
|
|
242
|
+
id="prev"
|
|
243
|
+
class=${classMap({ round: this.overlayNav })}
|
|
244
|
+
icon="previousArrow"
|
|
245
|
+
?activeIcon="${true}"
|
|
246
|
+
?disabled="${this.index <= 0}"
|
|
247
|
+
aria-label="${msg("Previous panel", {
|
|
248
|
+
id: "pd.panel.viewer.prev"
|
|
249
|
+
})}"
|
|
250
|
+
role="button"
|
|
251
|
+
tabindex="0"
|
|
252
|
+
@click=${this.previous}
|
|
253
|
+
@keydown=${this._onNavKeyDown}
|
|
254
|
+
></pd-icon>
|
|
255
|
+
<pd-icon
|
|
256
|
+
id="next"
|
|
257
|
+
class=${classMap({ round: this.overlayNav })}
|
|
258
|
+
icon="nextArrow"
|
|
259
|
+
?activeIcon="${true}"
|
|
260
|
+
?disabled="${this.index === this.children.length - 1}"
|
|
261
|
+
aria-label="${msg("Next panel", {
|
|
262
|
+
id: "pd.panel.viewer.next"
|
|
263
|
+
})}"
|
|
264
|
+
role="button"
|
|
265
|
+
tabindex="0"
|
|
266
|
+
@click=${this.next}
|
|
267
|
+
@keydown=${this._onNavKeyDown}
|
|
268
|
+
></pd-icon>
|
|
269
|
+
` : nothing}
|
|
254
270
|
</div>
|
|
255
271
|
${this.withProgress ? html` <div
|
|
256
272
|
id="progress"
|
|
@@ -268,7 +284,7 @@ class PdPanelViewer extends LitElement {
|
|
|
268
284
|
id: "pd.panel.viewer.panel"
|
|
269
285
|
})} ${i + 1}"
|
|
270
286
|
@click="${() => {
|
|
271
|
-
this.
|
|
287
|
+
this.index = i;
|
|
272
288
|
}}"
|
|
273
289
|
@keydown="${(e) => this._onProgressKeyDown(e, i)}"
|
|
274
290
|
class=${classMap({ watched: i <= this.index })}
|
|
@@ -354,7 +370,7 @@ class PdPanelViewer extends LitElement {
|
|
|
354
370
|
_onProgressKeyDown(e, index) {
|
|
355
371
|
if (e.key === "Enter" || e.key === " ") {
|
|
356
372
|
e.preventDefault();
|
|
357
|
-
this.
|
|
373
|
+
this.index = index;
|
|
358
374
|
} else if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
359
375
|
e.preventDefault();
|
|
360
376
|
this.next();
|
|
@@ -25,6 +25,8 @@ import { Orientation, PointItem } from '../types';
|
|
|
25
25
|
* @cssprop --pd-timeline-label-max-width - Maximum label width.
|
|
26
26
|
* @cssprop --pd-timeline-vertical-row-gap - Vertical layout row gap.
|
|
27
27
|
* @cssprop --pd-timeline-vertical-block-size - Vertical layout height.
|
|
28
|
+
* @cssprop --pd-timeline-item-color - Per-item accent color (set via PointItem.color, overrides point-bg and point-border-color).
|
|
29
|
+
* @cssprop --pd-timeline-point-max-text-width - Max text width / circle diameter (default: 10ch).
|
|
28
30
|
* @cssprop --pd-timeline-color-active - Active state color.
|
|
29
31
|
* @cssprop --pd-timeline-color-done - Done state color.
|
|
30
32
|
* @cssprop --pd-timeline-color-error - Error state color.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdTimeline.d.ts","sourceRoot":"","sources":["../../src/pd-timeline/PdTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"PdTimeline.d.ts","sourceRoot":"","sources":["../../src/pd-timeline/PdTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAyB,MAAM,UAAU,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,oDAAoD;IAEpD,WAAW,EAAE,WAAW,CAAgB;IAExC,mDAAmD;IAEnD,MAAM,EAAE,SAAS,EAAE,CAAM;IAEzB,0CAA0C;IAE1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,oCAAoC;IAEpC,SAAS,UAAS;IAElB,MAAM,CAAC,MAAM,0BA2NX;IAEF,SAAS,CAAC,OAAO,IAAI,IAAI;IAKzB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,iBAAiB;IAUzB,SAAS,CAAC,MAAM;CAwDjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, css, html, nothing } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
5
|
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -22,22 +23,31 @@ class PdTimeline extends LitElement {
|
|
|
22
23
|
this.styles = css`
|
|
23
24
|
:host {
|
|
24
25
|
display: block;
|
|
26
|
+
|
|
27
|
+
/* Line */
|
|
25
28
|
--pd-timeline-line-color: var(--pd-default-col);
|
|
26
29
|
--pd-timeline-line-width: 2px;
|
|
27
30
|
--pd-timeline-line-style: solid;
|
|
28
31
|
|
|
32
|
+
/* Point (dot) */
|
|
29
33
|
--pd-timeline-point-size: 28px;
|
|
30
34
|
--pd-timeline-point-bg: var(--pd-default-bg-col);
|
|
31
35
|
--pd-timeline-point-color: var(--pd-default-darkest-col);
|
|
32
36
|
--pd-timeline-point-border-color: var(--pd-default-disabled-col);
|
|
33
37
|
--pd-timeline-point-border-width: 2px;
|
|
34
|
-
--pd-timeline-point-font-size:
|
|
38
|
+
--pd-timeline-point-font-size: var(
|
|
39
|
+
--pd-default-font-content-size,
|
|
40
|
+
0.875rem
|
|
41
|
+
);
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
/* Label */
|
|
44
|
+
--pd-timeline-label-gap: var(--pd-spacing-sm, 0.5rem);
|
|
37
45
|
--pd-timeline-label-max-width: 20ch;
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
/* Vertical layout */
|
|
48
|
+
--pd-timeline-vertical-row-gap: var(--pd-spacing-lg, 2rem);
|
|
40
49
|
|
|
50
|
+
/* State colors */
|
|
41
51
|
--pd-timeline-color-active: var(--pd-default-info-col);
|
|
42
52
|
--pd-timeline-color-done: var(--pd-default-success-col);
|
|
43
53
|
--pd-timeline-color-error: var(--pd-default-error-col);
|
|
@@ -87,8 +97,8 @@ class PdTimeline extends LitElement {
|
|
|
87
97
|
row-gap: var(--pd-timeline-vertical-row-gap);
|
|
88
98
|
justify-items: start;
|
|
89
99
|
align-content: space-around;
|
|
90
|
-
padding-inline:
|
|
91
|
-
padding-block:
|
|
100
|
+
padding-inline: var(--pd-spacing-md, 1rem);
|
|
101
|
+
padding-block: var(--pd-spacing-xs, 0.25rem);
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
:host([orientation="vertical"]) .rail::before {
|
|
@@ -96,7 +106,9 @@ class PdTimeline extends LitElement {
|
|
|
96
106
|
position: absolute;
|
|
97
107
|
top: 0;
|
|
98
108
|
bottom: 0;
|
|
99
|
-
left: calc(
|
|
109
|
+
left: calc(
|
|
110
|
+
var(--pd-spacing-md, 1rem) + (var(--pd-timeline-point-size) * 0.5)
|
|
111
|
+
);
|
|
100
112
|
transform: translateX(-50%);
|
|
101
113
|
border-left: var(--pd-timeline-line-width) var(--pd-timeline-line-style)
|
|
102
114
|
var(--pd-timeline-line-color);
|
|
@@ -126,18 +138,39 @@ class PdTimeline extends LitElement {
|
|
|
126
138
|
/* === Dot (point) === */
|
|
127
139
|
.dot {
|
|
128
140
|
box-sizing: border-box;
|
|
129
|
-
|
|
130
|
-
|
|
141
|
+
display: block;
|
|
142
|
+
width: fit-content;
|
|
143
|
+
min-width: var(--pd-timeline-point-size);
|
|
144
|
+
max-width: calc(
|
|
145
|
+
var(--pd-timeline-point-max-text-width, 10ch) + 1em +
|
|
146
|
+
var(--pd-timeline-point-border-width) * 2
|
|
147
|
+
);
|
|
148
|
+
aspect-ratio: 1;
|
|
149
|
+
padding: 0.5em;
|
|
131
150
|
border-radius: 999px;
|
|
132
|
-
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
background: var(--pd-timeline-item-color, var(--pd-timeline-point-bg));
|
|
133
153
|
color: var(--pd-timeline-point-color);
|
|
134
154
|
border: var(--pd-timeline-point-border-width) solid
|
|
135
|
-
var(--pd-timeline-point-border-color);
|
|
136
|
-
|
|
137
|
-
place-items: center;
|
|
155
|
+
var(--pd-timeline-item-color, var(--pd-timeline-point-border-color));
|
|
156
|
+
text-align: center;
|
|
138
157
|
font-size: var(--pd-timeline-point-font-size);
|
|
139
158
|
line-height: 1;
|
|
140
159
|
user-select: none;
|
|
160
|
+
flex-shrink: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.dot-text {
|
|
164
|
+
position: relative;
|
|
165
|
+
top: 50%;
|
|
166
|
+
transform: translateY(-50%);
|
|
167
|
+
max-width: var(--pd-timeline-point-max-text-width, 10ch);
|
|
168
|
+
white-space: normal;
|
|
169
|
+
word-break: break-word;
|
|
170
|
+
display: -webkit-box;
|
|
171
|
+
-webkit-box-orient: vertical;
|
|
172
|
+
-webkit-line-clamp: var(--pd-timeline-point-max-lines, 3);
|
|
173
|
+
overflow: hidden;
|
|
141
174
|
}
|
|
142
175
|
|
|
143
176
|
.dot[aria-current="step"] {
|
|
@@ -181,14 +214,10 @@ class PdTimeline extends LitElement {
|
|
|
181
214
|
|
|
182
215
|
/* Horizontal label placement */
|
|
183
216
|
:host([orientation="horizontal"]) .label.top {
|
|
184
|
-
bottom: calc(
|
|
185
|
-
50% + var(--pd-timeline-point-size) * 0.5 + var(--pd-timeline-label-gap)
|
|
186
|
-
);
|
|
217
|
+
bottom: calc(100% + var(--pd-timeline-label-gap));
|
|
187
218
|
}
|
|
188
219
|
:host([orientation="horizontal"]) .label.back {
|
|
189
|
-
top: calc(
|
|
190
|
-
50% + var(--pd-timeline-point-size) * 0.5 + var(--pd-timeline-label-gap)
|
|
191
|
-
);
|
|
220
|
+
top: calc(100% + var(--pd-timeline-label-gap));
|
|
192
221
|
}
|
|
193
222
|
|
|
194
223
|
/* Vertical label placement */
|
|
@@ -247,7 +276,7 @@ class PdTimeline extends LitElement {
|
|
|
247
276
|
return html`<span aria-hidden="true">${p.icon}</span>`;
|
|
248
277
|
}
|
|
249
278
|
if (p.text) {
|
|
250
|
-
return html
|
|
279
|
+
return html`<span class="dot-text">${p.text}</span>`;
|
|
251
280
|
}
|
|
252
281
|
return nothing;
|
|
253
282
|
}
|
|
@@ -264,9 +293,11 @@ class PdTimeline extends LitElement {
|
|
|
264
293
|
const isActive = this.activeIndex === i;
|
|
265
294
|
const stateClass = this._stateClass(p, i);
|
|
266
295
|
const labelName = `label-${i}`;
|
|
296
|
+
const itemStyles = p.color ? { "--pd-timeline-item-color": p.color } : {};
|
|
267
297
|
return html`
|
|
268
298
|
<div
|
|
269
299
|
class="item"
|
|
300
|
+
style=${styleMap(itemStyles)}
|
|
270
301
|
role="listitem"
|
|
271
302
|
aria-setsize="${this.points.length}"
|
|
272
303
|
aria-posinset="${i + 1}"
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;A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B,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-development/pd-content",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Progressive Development content components. ",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,17 +39,27 @@
|
|
|
39
39
|
"LICENSE"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
43
|
+
"@codemirror/lang-html": "^6.4.11",
|
|
44
|
+
"@codemirror/lang-java": "^6.0.2",
|
|
45
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
46
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
47
|
+
"@codemirror/lang-markdown": "^6.5.0",
|
|
48
|
+
"@codemirror/lang-python": "^6.2.1",
|
|
49
|
+
"@codemirror/language": "^6.12.2",
|
|
50
|
+
"@codemirror/state": "^6.6.0",
|
|
51
|
+
"@codemirror/view": "^6.40.0",
|
|
42
52
|
"@lit/localize": "^0.12.2",
|
|
43
53
|
"@types/prismjs": "^1.26.5",
|
|
44
54
|
"lit": "^3.3.1",
|
|
45
55
|
"prismjs": "^1.30.0",
|
|
46
56
|
"pwa-helpers": "^0.9.1",
|
|
47
57
|
"tslib": "^2.8.1",
|
|
48
|
-
"@progressive-development/pd-dialog": "1.1.
|
|
49
|
-
"@progressive-development/pd-icon": "1.1.
|
|
50
|
-
"@progressive-development/pd-
|
|
51
|
-
"@progressive-development/pd-
|
|
52
|
-
"@progressive-development/pd-
|
|
58
|
+
"@progressive-development/pd-dialog": "1.1.1",
|
|
59
|
+
"@progressive-development/pd-icon": "1.1.1",
|
|
60
|
+
"@progressive-development/pd-forms": "1.1.1",
|
|
61
|
+
"@progressive-development/pd-model": "1.2.1",
|
|
62
|
+
"@progressive-development/pd-shared-styles": "0.4.1"
|
|
53
63
|
},
|
|
54
64
|
"customElements": "custom-elements.json",
|
|
55
65
|
"keywords": [
|