@operato/help 10.29.33 → 10.29.34
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 +9 -0
- package/coverage/lcov-report/index.html +1047 -72
- package/coverage/lcov.info +48067 -5437
- package/dist/src/components/ox-doc.d.ts +2 -0
- package/dist/src/components/ox-doc.js +8 -1
- package/dist/src/components/ox-doc.js.map +1 -1
- package/dist/src/components/ox-help-spot.d.ts +2 -12
- package/dist/src/components/ox-help-spot.js +23 -96
- package/dist/src/components/ox-help-spot.js.map +1 -1
- package/dist/src/controller/help.d.ts +5 -1
- package/dist/src/controller/help.js +7 -2
- package/dist/src/controller/help.js.map +1 -1
- package/dist/src/help-documents.d.ts +6 -0
- package/dist/src/help-documents.js +31 -0
- package/dist/src/help-documents.js.map +1 -0
- package/dist/src/pages/ox-help-home.d.ts +1 -0
- package/dist/src/pages/ox-help-home.js +29 -2
- package/dist/src/pages/ox-help-home.js.map +1 -1
- package/dist/src/viewparts/ox-help-panel.d.ts +1 -0
- package/dist/src/viewparts/ox-help-panel.js +35 -2
- package/dist/src/viewparts/ox-help-panel.js.map +1 -1
- package/dist/test/ox-doc.test.d.ts +1 -0
- package/dist/test/ox-doc.test.js +39 -37
- package/dist/test/ox-doc.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/ox-doc.test.ts +42 -44
- package/translations/en.json +0 -4
- package/translations/es.json +0 -4
- package/translations/ja.json +0 -4
- package/translations/ko.json +0 -4
- package/translations/ms.json +0 -4
- package/translations/zh.json +0 -4
package/test/ox-doc.test.ts
CHANGED
|
@@ -2,7 +2,10 @@ import { expect, fixture, html, waitUntil } from '@open-wc/testing'
|
|
|
2
2
|
|
|
3
3
|
import '../src/components/ox-doc.js'
|
|
4
4
|
import '../src/components/ox-help-spot.js'
|
|
5
|
+
import '../src/viewparts/ox-help-panel.js'
|
|
5
6
|
import type { OxDoc } from '../src/components/ox-doc.js'
|
|
7
|
+
import { appendViewpart, VIEWPART_POSITION } from '@operato/layout'
|
|
8
|
+
import { store } from '@operato/shell'
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* ox-doc reads /helps/{topic}.html and renders it; the products that used to keep their own copy rely on
|
|
@@ -79,54 +82,27 @@ describe('ox-doc', () => {
|
|
|
79
82
|
})
|
|
80
83
|
|
|
81
84
|
describe('ox-help-spot', () => {
|
|
82
|
-
/*
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const bar = el.shadowRoot!.querySelector('.bar')!.textContent!.replace(/\s+/g, ' ')
|
|
92
|
-
expect(bar).to.contain('전체 보기')
|
|
93
|
-
expect(bar).to.contain('닫기')
|
|
94
|
-
expect(bar).not.to.contain('close')
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
it('opens the section in place and closes on Escape', async () => {
|
|
98
|
-
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="part"></ox-help-spot>`)
|
|
99
|
-
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
100
|
-
;(el.shadowRoot!.querySelector('button.q') as HTMLButtonElement).click()
|
|
101
|
-
await waitUntil(() => el.shadowRoot!.querySelector('ox-doc'))
|
|
102
|
-
|
|
103
|
-
/* The dialog says what opened and can take focus (operato-twin's overlay guard asks both). */
|
|
104
|
-
const panel = el.shadowRoot!.querySelector('.panel')!
|
|
105
|
-
expect(panel.getAttribute('aria-label')).to.equal('help')
|
|
106
|
-
expect(panel.getAttribute('tabindex')).to.equal('-1')
|
|
107
|
-
|
|
108
|
-
const doc = el.shadowRoot!.querySelector('ox-doc') as OxDoc
|
|
109
|
-
expect(doc.getAttribute('section')).to.equal('part')
|
|
110
|
-
expect(doc.hasAttribute('compact')).to.equal(true)
|
|
111
|
-
|
|
112
|
-
el.shadowRoot!.querySelector('.panel')!.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, composed: true }))
|
|
113
|
-
await waitUntil(() => !el.shadowRoot!.querySelector('.panel'))
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
/* A `?` in a grid header sits in nowrap, bold, right-aligned text; its panel is a document and must not take those. */
|
|
117
|
-
it('opens a panel that wraps and reads from the start, whatever the text around the ?', async () => {
|
|
85
|
+
/*
|
|
86
|
+
* The `?` opens the app's help overlay at its section and draws no panel of its own: one drawn inside it sat in
|
|
87
|
+
* whatever held the `?` (a card button, a grid header), took that parent's pointer and text settings, and handed
|
|
88
|
+
* its scrolling and presses back to it. The press of the `?` itself is not a press of its parent either.
|
|
89
|
+
*/
|
|
90
|
+
it('opens the help overlay at its section, and its press does not reach what holds it', async () => {
|
|
91
|
+
appendViewpart({ name: 'help', viewpart: { show: false, hovering: 'edge', template: html`<ox-help-panel></ox-help-panel>` }, position: VIEWPART_POSITION.ASIDEBAR })
|
|
92
|
+
let parentPresses = 0
|
|
118
93
|
const host = await fixture<HTMLElement>(
|
|
119
|
-
html`<
|
|
94
|
+
html`<button style="cursor: pointer" @click=${() => parentPresses++} @pointerdown=${() => parentPresses++}><ox-help-spot topic="a/one" section="part"></ox-help-spot></button>`
|
|
120
95
|
)
|
|
121
96
|
const el = host.querySelector('ox-help-spot') as HTMLElement
|
|
122
97
|
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
expect(
|
|
128
|
-
expect(panel
|
|
129
|
-
expect(
|
|
98
|
+
const q = el.shadowRoot!.querySelector('button.q') as HTMLButtonElement
|
|
99
|
+
q.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, composed: true }))
|
|
100
|
+
q.click()
|
|
101
|
+
|
|
102
|
+
expect(parentPresses).to.equal(0)
|
|
103
|
+
expect(el.shadowRoot!.querySelector('.panel, ox-doc')).to.equal(null)
|
|
104
|
+
expect(history.state?.overlay?.name).to.equal('help')
|
|
105
|
+
expect((store.getState() as any).layout.viewparts.help.templateProperties).to.deep.equal({ topic: 'a/one', section: 'part' })
|
|
130
106
|
})
|
|
131
107
|
|
|
132
108
|
/* A `?` is placed before its help is written; it must not open 「Content not found」 or the whole document. */
|
|
@@ -150,3 +126,25 @@ describe('ox-help-spot', () => {
|
|
|
150
126
|
expect(missing.hasAttribute('hidden')).to.equal(true)
|
|
151
127
|
})
|
|
152
128
|
})
|
|
129
|
+
|
|
130
|
+
describe('ox-help-panel', () => {
|
|
131
|
+
/* The overlay shows what a `?` asked about - an html document's section - and the older markdown topics as before. */
|
|
132
|
+
it('shows an html topic through ox-doc at the section, and a markdown topic as markdown', async () => {
|
|
133
|
+
const html1 = await fixture<HTMLElement>(html`<ox-help-panel topic="a/one" section="part"></ox-help-panel>`)
|
|
134
|
+
await waitUntil(() => html1.shadowRoot!.querySelector('ox-doc'))
|
|
135
|
+
const doc = html1.shadowRoot!.querySelector('ox-doc') as OxDoc
|
|
136
|
+
expect([doc.getAttribute('topic'), doc.getAttribute('section'), doc.hasAttribute('compact')]).to.deep.equal(['a/one', 'part', true])
|
|
137
|
+
|
|
138
|
+
const md = await fixture<HTMLElement>(html`<ox-help-panel topic="b/md"></ox-help-panel>`)
|
|
139
|
+
await waitUntil(() => md.shadowRoot!.querySelector('ox-markdown'))
|
|
140
|
+
expect(md.shadowRoot!.querySelector('ox-doc')).to.equal(null)
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
describe('ox-doc anchor', () => {
|
|
145
|
+
/* The help page opens the whole document at the part the overlay showed. */
|
|
146
|
+
it('scrolls its scrolling parent to the anchor once the document is drawn', async () => {
|
|
147
|
+
const box = await fixture<HTMLElement>(html`<div style="height: 40px; overflow: auto"><ox-doc topic="a/one" anchor="next"></ox-doc></div>`)
|
|
148
|
+
await waitUntil(() => box.scrollTop > 0, 'the box scrolls to #next')
|
|
149
|
+
})
|
|
150
|
+
})
|
package/translations/en.json
DELETED
package/translations/es.json
DELETED
package/translations/ja.json
DELETED
package/translations/ko.json
DELETED
package/translations/ms.json
DELETED
package/translations/zh.json
DELETED