@operato/help 2.0.0-alpha.0 → 2.0.0-alpha.100
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/CHANGELOG.md +517 -0
- package/demo/index.html +13 -2
- package/dist/src/components/ox-help-icon.d.ts +2 -2
- package/dist/src/components/ox-help-icon.js +9 -8
- package/dist/src/components/ox-help-icon.js.map +1 -1
- package/dist/src/components/ox-inline-help.d.ts +1 -1
- package/dist/src/components/ox-title-with-help.d.ts +2 -2
- package/dist/src/components/ox-title-with-help.js +10 -8
- package/dist/src/components/ox-title-with-help.js.map +1 -1
- package/dist/src/help-style.js +4 -3
- package/dist/src/help-style.js.map +1 -1
- package/dist/src/pages/ox-help-home.d.ts +1 -1
- package/dist/src/pages/ox-help-home.js +11 -9
- package/dist/src/pages/ox-help-home.js.map +1 -1
- package/dist/src/viewparts/ox-help-panel.d.ts +1 -1
- package/dist/src/viewparts/ox-help-panel.js +18 -21
- package/dist/src/viewparts/ox-help-panel.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/components/ox-help-icon.ts +9 -8
- package/src/components/ox-title-with-help.ts +10 -8
- package/src/help-style.ts +4 -3
- package/src/pages/ox-help-home.ts +14 -17
- package/src/viewparts/ox-help-panel.ts +18 -21
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@operato/help",
|
3
3
|
"description": "Webcomponent help following open-wc recommendations",
|
4
4
|
"author": "heartyoh",
|
5
|
-
"version": "2.0.0-alpha.
|
5
|
+
"version": "2.0.0-alpha.100",
|
6
6
|
"main": "dist/src/index.js",
|
7
7
|
"module": "dist/src/index.js",
|
8
8
|
"exports": {
|
@@ -63,32 +63,32 @@
|
|
63
63
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
64
64
|
},
|
65
65
|
"dependencies": {
|
66
|
-
"@material/
|
67
|
-
"@operato/data-grist": "^2.0.0-alpha.
|
68
|
-
"@operato/layout": "^2.0.0-alpha.
|
69
|
-
"@operato/markdown": "^2.0.0-alpha.
|
70
|
-
"@operato/shell": "^2.0.0-alpha.
|
71
|
-
"@operato/styles": "^2.0.0-alpha.
|
72
|
-
"@operato/utils": "^2.0.0-alpha.
|
73
|
-
"lit": "^
|
66
|
+
"@material/web": "^1.4.0",
|
67
|
+
"@operato/data-grist": "^2.0.0-alpha.100",
|
68
|
+
"@operato/layout": "^2.0.0-alpha.100",
|
69
|
+
"@operato/markdown": "^2.0.0-alpha.100",
|
70
|
+
"@operato/shell": "^2.0.0-alpha.100",
|
71
|
+
"@operato/styles": "^2.0.0-alpha.100",
|
72
|
+
"@operato/utils": "^2.0.0-alpha.68",
|
73
|
+
"lit": "^3.1.2",
|
74
74
|
"pwa-helpers": "^0.9.1"
|
75
75
|
},
|
76
76
|
"devDependencies": {
|
77
|
-
"@custom-elements-manifest/analyzer": "^0.
|
77
|
+
"@custom-elements-manifest/analyzer": "^0.9.2",
|
78
78
|
"@hatiolab/prettier-config": "^1.0.0",
|
79
|
-
"@open-wc/eslint-config": "^
|
79
|
+
"@open-wc/eslint-config": "^12.0.3",
|
80
80
|
"@open-wc/testing": "^3.1.6",
|
81
|
-
"@typescript-eslint/eslint-plugin": "^
|
82
|
-
"@typescript-eslint/parser": "^
|
81
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
82
|
+
"@typescript-eslint/parser": "^7.0.1",
|
83
83
|
"@web/dev-server": "^0.3.0",
|
84
|
-
"@web/dev-server-storybook": "^0.
|
85
|
-
"@web/test-runner": "^0.
|
84
|
+
"@web/dev-server-storybook": "^2.0.1",
|
85
|
+
"@web/test-runner": "^0.18.0",
|
86
86
|
"concurrently": "^8.0.1",
|
87
87
|
"eslint": "^8.39.0",
|
88
|
-
"eslint-config-prettier": "^
|
89
|
-
"husky": "^
|
90
|
-
"lint-staged": "^
|
91
|
-
"prettier": "^2.
|
88
|
+
"eslint-config-prettier": "^9.1.0",
|
89
|
+
"husky": "^9.0.11",
|
90
|
+
"lint-staged": "^15.2.2",
|
91
|
+
"prettier": "^3.2.5",
|
92
92
|
"tslib": "^2.3.1",
|
93
93
|
"typescript": "^5.0.4"
|
94
94
|
},
|
@@ -105,5 +105,5 @@
|
|
105
105
|
"prettier --write"
|
106
106
|
]
|
107
107
|
},
|
108
|
-
"gitHead": "
|
108
|
+
"gitHead": "efe5f575ce5241aeb84a0af45915dca63dcce68e"
|
109
109
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
|
3
3
|
import { css, html, LitElement } from 'lit'
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
@@ -8,19 +8,20 @@ import { openHelp } from '../controller/help.js'
|
|
8
8
|
@customElement('ox-help-icon')
|
9
9
|
export class HelpIcon extends LitElement {
|
10
10
|
static styles = css`
|
11
|
-
|
11
|
+
md-icon {
|
12
12
|
position: relative;
|
13
13
|
top: 4px;
|
14
14
|
cursor: help;
|
15
15
|
opacity: var(--help-icon-opacity);
|
16
16
|
color: var(--help-icon-color);
|
17
|
-
font-size: var(--help-icon-size);
|
18
17
|
line-height: 0;
|
19
|
-
}
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
--md-icon-size: var(--help-icon-size);
|
20
|
+
|
21
|
+
&:hover {
|
22
|
+
opacity: var(--help-icon-hover-opacity);
|
23
|
+
color: var(--help-icon-hover-color);
|
24
|
+
}
|
24
25
|
}
|
25
26
|
`
|
26
27
|
|
@@ -43,6 +44,6 @@ export class HelpIcon extends LitElement {
|
|
43
44
|
render() {
|
44
45
|
const topic = this.topic
|
45
46
|
|
46
|
-
return html`${topic ? html`<
|
47
|
+
return html`${topic ? html`<md-icon>help</md-icon>` : html``}`
|
47
48
|
}
|
48
49
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
|
3
3
|
import { css, html, LitElement } from 'lit'
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
@@ -10,18 +10,20 @@ import { openHelp } from '../controller/help.js'
|
|
10
10
|
@customElement('ox-title-with-help')
|
11
11
|
export class TitleWithHelp extends localize(i18next)(LitElement) {
|
12
12
|
static styles = css`
|
13
|
-
|
13
|
+
md-icon {
|
14
14
|
position: relative;
|
15
15
|
top: 4px;
|
16
16
|
cursor: help;
|
17
17
|
opacity: var(--help-icon-opacity);
|
18
18
|
color: var(--help-icon-color);
|
19
|
-
font-size: var(--help-icon-size);
|
20
19
|
line-height: 0;
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
|
21
|
+
--md-icon-size: var(--help-icon-size);
|
22
|
+
|
23
|
+
&:hover {
|
24
|
+
opacity: var(--help-icon-hover-opacity);
|
25
|
+
color: var(--help-icon-hover-color);
|
26
|
+
}
|
25
27
|
}
|
26
28
|
`
|
27
29
|
|
@@ -32,6 +34,6 @@ export class TitleWithHelp extends localize(i18next)(LitElement) {
|
|
32
34
|
const title = i18next.t(this.msgid)
|
33
35
|
const topic = this.topic
|
34
36
|
|
35
|
-
return html` ${title} ${topic ? html`<
|
37
|
+
return html` ${title} ${topic ? html`<md-icon @click=${() => openHelp(topic)}>help</md-icon>` : html``} `
|
36
38
|
}
|
37
39
|
}
|
package/src/help-style.ts
CHANGED
@@ -22,7 +22,7 @@ export const HelpStyle = css`
|
|
22
22
|
font-size: var(--help-panel-h3-title-font-size);
|
23
23
|
color: var(--help-panel-h3-title-color);
|
24
24
|
}
|
25
|
-
|
25
|
+
md-icon {
|
26
26
|
vertical-align: middle;
|
27
27
|
}
|
28
28
|
|
@@ -92,9 +92,10 @@ export const HelpStyle = css`
|
|
92
92
|
font-size: var(--fontsize-default);
|
93
93
|
text-decoration: underline;
|
94
94
|
}
|
95
|
-
a
|
96
|
-
font-size: var(--help-panel-a-icon-size);
|
95
|
+
a md-icon {
|
97
96
|
margin: 0;
|
97
|
+
|
98
|
+
--md-icon-size: var(--help-panel-a-icon-size);
|
98
99
|
}
|
99
100
|
a:hover {
|
100
101
|
background-color: var(--opacity-light-dark-color);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
|
3
3
|
import { css, html } from 'lit'
|
4
4
|
import { customElement, property, query } from 'lit/decorators.js'
|
@@ -20,6 +20,8 @@ class HelpHome extends connect(store)(localize(i18next)(PageView)) {
|
|
20
20
|
flex-direction: column;
|
21
21
|
overflow: hidden;
|
22
22
|
position: relative;
|
23
|
+
|
24
|
+
--md-icon-size: 24px;
|
23
25
|
}
|
24
26
|
|
25
27
|
#navigation {
|
@@ -31,8 +33,8 @@ class HelpHome extends connect(store)(localize(i18next)(PageView)) {
|
|
31
33
|
background-color: white;
|
32
34
|
}
|
33
35
|
|
34
|
-
#navigation
|
35
|
-
padding: var(--help-navigation-icon-padding);
|
36
|
+
#navigation md-icon {
|
37
|
+
padding: var(--help-navigation-icon-padding, var(--padding-default));
|
36
38
|
border-right: var(--help-navigation-icon-border);
|
37
39
|
cursor: pointer;
|
38
40
|
color: var(--help-icon-color);
|
@@ -47,7 +49,7 @@ class HelpHome extends connect(store)(localize(i18next)(PageView)) {
|
|
47
49
|
}
|
48
50
|
|
49
51
|
#upward {
|
50
|
-
--
|
52
|
+
--md-icon-size: 26px;
|
51
53
|
position: absolute;
|
52
54
|
bottom: var(--data-list-fab-position-vertical);
|
53
55
|
right: var(--data-list-fab-position-horizontal);
|
@@ -81,19 +83,14 @@ class HelpHome extends connect(store)(localize(i18next)(PageView)) {
|
|
81
83
|
<ox-markdown id="content" .src=${src} toc></ox-markdown>
|
82
84
|
|
83
85
|
<div id="navigation">
|
84
|
-
<
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
${
|
93
|
-
this.showGotoTop
|
94
|
-
? html` <mwc-icon id="upward" @click=${(e: Event) => this.gotoTop(e)}>arrow_upward</mwc-icon> `
|
95
|
-
: html``
|
96
|
-
}
|
86
|
+
<md-icon @click=${() => navigate('help')} ?disabled=${this.topic == 'index'}>home</md-icon>
|
87
|
+
<md-icon @click=${() => window.history.back()}>keyboard_arrow_left</md-icon>
|
88
|
+
<md-icon @click=${() => window.history.forward()}>keyboard_arrow_right</md-icon>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
${this.showGotoTop
|
92
|
+
? html` <md-icon id="upward" @click=${(e: Event) => this.gotoTop(e)}>arrow_upward</md-icon> `
|
93
|
+
: html``}
|
97
94
|
`
|
98
95
|
}
|
99
96
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
import '@operato/markdown/ox-markdown.js'
|
3
3
|
|
4
4
|
import { css, html, LitElement, PropertyValues } from 'lit'
|
@@ -31,6 +31,9 @@ class HelpPanel extends connect(store)(LitElement) {
|
|
31
31
|
margin: 4px;
|
32
32
|
|
33
33
|
overflow: hidden;
|
34
|
+
|
35
|
+
--md-icon-size: 24px;
|
36
|
+
font-variation-settings: 'FILL' 1;
|
34
37
|
}
|
35
38
|
|
36
39
|
:host(:focus) {
|
@@ -45,7 +48,9 @@ class HelpPanel extends connect(store)(LitElement) {
|
|
45
48
|
border-bottom: var(--help-navigation-bottom);
|
46
49
|
background-color: white;
|
47
50
|
}
|
48
|
-
|
51
|
+
|
52
|
+
#navigation md-icon {
|
53
|
+
padding: var(--help-navigation-icon-padding, var(--padding-default));
|
49
54
|
border-right: var(--help-navigation-icon-border);
|
50
55
|
cursor: pointer;
|
51
56
|
color: var(--help-icon-color);
|
@@ -64,7 +69,7 @@ class HelpPanel extends connect(store)(LitElement) {
|
|
64
69
|
}
|
65
70
|
|
66
71
|
#upward {
|
67
|
-
--
|
72
|
+
--md-icon-size: 26px;
|
68
73
|
position: absolute;
|
69
74
|
bottom: var(--data-list-fab-position-vertical);
|
70
75
|
right: var(--data-list-fab-position-horizontal);
|
@@ -99,28 +104,20 @@ class HelpPanel extends connect(store)(LitElement) {
|
|
99
104
|
|
100
105
|
return html`
|
101
106
|
<div id="navigation">
|
102
|
-
<
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
></mwc-icon-button>
|
112
|
-
<mwc-icon-button
|
113
|
-
icon="keyboard_arrow_right"
|
114
|
-
@click=${() => this.historyForward()}
|
115
|
-
?disabled=${this.historyIndex >= this.history.length - 1}
|
116
|
-
></mwc-icon-button>
|
117
|
-
<mwc-icon-button icon="open_in_new" @click=${() => navigate(`help?topic=${this.topic}`)}></mwc-icon-button>
|
118
|
-
<mwc-icon-button icon="close" id="close" @click=${() => closeOverlay('help')}></mwc-icon-button>
|
107
|
+
<md-icon @click=${() => this.goHome()} ?disabled=${this.history[0] === this.history[this.historyIndex]}>
|
108
|
+
home
|
109
|
+
</md-icon>
|
110
|
+
<md-icon @click=${() => this.historyBack()} ?disabled=${this.historyIndex < 1}> keyboard_arrow_left </md-icon>
|
111
|
+
<md-icon @click=${() => this.historyForward()} ?disabled=${this.historyIndex >= this.history.length - 1}>
|
112
|
+
keyboard_arrow_right
|
113
|
+
</md-icon>
|
114
|
+
<md-icon @click=${() => navigate(`help?topic=${this.topic}`)}> open_in_new </md-icon>
|
115
|
+
<md-icon id="close" @click=${() => closeOverlay('help')}> close </md-icon>
|
119
116
|
</div>
|
120
117
|
|
121
118
|
${!this.showGotoTop
|
122
119
|
? html``
|
123
|
-
: html` <
|
120
|
+
: html` <md-icon id="upward" @click=${(e: Event) => this.gotoTop(e)}>arrow_upward</md-icon> `}
|
124
121
|
<ox-markdown id="content" .src=${src}></ox-markdown>
|
125
122
|
`
|
126
123
|
}
|