@teipublisher/pb-components 2.25.5 → 2.25.6

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.
Files changed (128) hide show
  1. package/.github/workflows/main.yml +3 -3
  2. package/.github/workflows/node.js.yml +3 -3
  3. package/.github/workflows/release.js.yml +3 -3
  4. package/CHANGELOG.md +8 -0
  5. package/Dockerfile +78 -70
  6. package/css/components.css +5 -5
  7. package/dist/demo/pb-drawer2.html +1 -1
  8. package/dist/demo/pb-leaflet-map.html +1 -1
  9. package/dist/demo/pb-repeat.html +1 -3
  10. package/dist/demo/pb-view3.html +1 -1
  11. package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
  12. package/dist/pb-code-editor.js +25 -20
  13. package/dist/pb-component-docs.js +58 -54
  14. package/dist/pb-components-bundle.js +1827 -1520
  15. package/dist/pb-edit-app.js +167 -107
  16. package/dist/pb-elements.json +54 -54
  17. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  18. package/dist/pb-leaflet-map.js +23 -23
  19. package/dist/pb-mei.js +56 -41
  20. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  21. package/dist/pb-odd-editor.js +925 -758
  22. package/dist/pb-tify.js +2 -2
  23. package/dist/{vaadin-element-mixin-859a0132.js → vaadin-element-mixin-ad07ba25.js} +88 -61
  24. package/gh-pages.js +5 -3
  25. package/package.json +2 -2
  26. package/pb-elements.json +54 -54
  27. package/src/assets/components.css +5 -5
  28. package/src/authority/airtable.js +20 -21
  29. package/src/authority/anton.js +129 -129
  30. package/src/authority/custom.js +23 -21
  31. package/src/authority/geonames.js +38 -32
  32. package/src/authority/gnd.js +47 -42
  33. package/src/authority/kbga.js +137 -134
  34. package/src/authority/metagrid.js +44 -46
  35. package/src/authority/reconciliation.js +66 -67
  36. package/src/authority/registry.js +4 -4
  37. package/src/docs/pb-component-docs.js +2 -2
  38. package/src/docs/pb-component-view.js +5 -5
  39. package/src/docs/pb-components-list.js +2 -2
  40. package/src/docs/pb-demo-snippet.js +2 -2
  41. package/src/dts-client.js +299 -297
  42. package/src/dts-select-endpoint.js +90 -82
  43. package/src/parse-date-service.js +184 -135
  44. package/src/pb-ajax.js +171 -167
  45. package/src/pb-authority-lookup.js +96 -81
  46. package/src/pb-autocomplete.js +292 -280
  47. package/src/pb-blacklab-highlight.js +264 -259
  48. package/src/pb-blacklab-results.js +236 -221
  49. package/src/pb-browse-docs.js +540 -475
  50. package/src/pb-browse.js +68 -65
  51. package/src/pb-clipboard.js +79 -76
  52. package/src/pb-code-editor.js +110 -102
  53. package/src/pb-code-highlight.js +209 -204
  54. package/src/pb-codepen.js +79 -72
  55. package/src/pb-collapse.js +149 -146
  56. package/src/pb-combo-box.js +190 -190
  57. package/src/pb-components-bundle.js +1 -1
  58. package/src/pb-custom-form.js +150 -149
  59. package/src/pb-document.js +89 -90
  60. package/src/pb-download.js +208 -195
  61. package/src/pb-drawer.js +145 -148
  62. package/src/pb-edit-app.js +301 -229
  63. package/src/pb-edit-xml.js +99 -96
  64. package/src/pb-events.js +114 -107
  65. package/src/pb-facs-link.js +104 -102
  66. package/src/pb-facsimile.js +411 -413
  67. package/src/pb-formula.js +151 -153
  68. package/src/pb-geolocation.js +129 -131
  69. package/src/pb-grid-action.js +53 -56
  70. package/src/pb-grid.js +231 -228
  71. package/src/pb-highlight.js +140 -140
  72. package/src/pb-hotkeys.js +40 -42
  73. package/src/pb-i18n.js +101 -104
  74. package/src/pb-image-strip.js +84 -78
  75. package/src/pb-lang.js +83 -70
  76. package/src/pb-leaflet-map.js +488 -485
  77. package/src/pb-link.js +126 -124
  78. package/src/pb-load.js +431 -426
  79. package/src/pb-login.js +275 -254
  80. package/src/pb-manage-odds.js +364 -318
  81. package/src/pb-map-icon.js +89 -89
  82. package/src/pb-map-layer.js +85 -85
  83. package/src/pb-markdown.js +90 -99
  84. package/src/pb-media-query.js +74 -72
  85. package/src/pb-mei.js +306 -295
  86. package/src/pb-message.js +143 -130
  87. package/src/pb-mixin.js +269 -264
  88. package/src/pb-navigation.js +80 -82
  89. package/src/pb-observable.js +38 -38
  90. package/src/pb-odd-editor.js +1056 -958
  91. package/src/pb-odd-elementspec-editor.js +348 -297
  92. package/src/pb-odd-model-editor.js +1058 -898
  93. package/src/pb-odd-parameter-editor.js +200 -178
  94. package/src/pb-odd-rendition-editor.js +136 -124
  95. package/src/pb-page.js +432 -422
  96. package/src/pb-paginate.js +202 -190
  97. package/src/pb-panel.js +191 -179
  98. package/src/pb-popover-themes.js +7 -5
  99. package/src/pb-popover.js +296 -287
  100. package/src/pb-print-preview.js +127 -127
  101. package/src/pb-progress.js +49 -49
  102. package/src/pb-repeat.js +105 -104
  103. package/src/pb-restricted.js +84 -77
  104. package/src/pb-search.js +238 -221
  105. package/src/pb-select-feature.js +127 -120
  106. package/src/pb-select-odd.js +132 -124
  107. package/src/pb-select-template.js +89 -78
  108. package/src/pb-select.js +251 -227
  109. package/src/pb-split-list.js +179 -174
  110. package/src/pb-svg.js +80 -79
  111. package/src/pb-table-column.js +54 -54
  112. package/src/pb-table-grid.js +221 -203
  113. package/src/pb-tabs.js +61 -63
  114. package/src/pb-tify.js +154 -154
  115. package/src/pb-timeline.js +271 -229
  116. package/src/pb-toggle-feature.js +198 -185
  117. package/src/pb-upload.js +184 -174
  118. package/src/pb-version.js +30 -30
  119. package/src/pb-view-annotate.js +132 -98
  120. package/src/pb-view.js +1282 -1263
  121. package/src/pb-zoom.js +40 -40
  122. package/src/polymer-hack.js +1 -1
  123. package/src/search-result-service.js +256 -223
  124. package/src/seed-element.js +13 -20
  125. package/src/settings.js +4 -4
  126. package/src/theming.js +91 -91
  127. package/src/urls.js +289 -289
  128. package/src/utils.js +53 -51
package/src/pb-mei.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LitElement, html, css } from 'lit-element';
2
2
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
3
- import "@lrnwebcomponents/es-global-bridge";
3
+ import '@lrnwebcomponents/es-global-bridge';
4
4
  import createVerovioModule from 'verovio/dist/verovio-module.mjs';
5
5
  import { VerovioToolkit } from 'verovio/dist/verovio.mjs';
6
6
  import { pbMixin, waitOnce } from './pb-mixin.js';
@@ -15,34 +15,30 @@ let _verovio = null;
15
15
 
16
16
  /** Import external script dynamically */
17
17
  function _import(name, location) {
18
- window.ESGlobalBridge.requestAvailability();
19
- return new Promise(resolve => {
20
- window.ESGlobalBridge.instance.load(name, location);
21
- window.addEventListener(
22
- `es-bridge-${name}-loaded`,
23
- () => resolve(),
24
- { once: true }
25
- );
26
- });
18
+ window.ESGlobalBridge.requestAvailability();
19
+ return new Promise(resolve => {
20
+ window.ESGlobalBridge.instance.load(name, location);
21
+ window.addEventListener(`es-bridge-${name}-loaded`, () => resolve(), { once: true });
22
+ });
27
23
  }
28
24
 
29
25
  /**
30
26
  * A viewer and player for MEI musical notation based on [Verovio](https://www.verovio.org/).
31
27
  * Supports optional MIDI playback using [web-midi-player](https://midi.yvesgurcan.com/).
32
28
  * Both libraries are loaded dynamically when the component is used the first time.
33
- *
29
+ *
34
30
  * Viewing options to be selected by the user can be defined via nested `pb-option` elements:
35
- *
31
+ *
36
32
  * ```html
37
- * <pb-mei id="viewer" player url="http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei"
33
+ * <pb-mei id="viewer" player url="http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei"
38
34
  * footer="none">
39
35
  * <pb-option name="appXPath" on="./rdg[contains(@label, 'original')]" off="">Original Clefs</pb-option>
40
36
  * </pb-mei>
41
37
  * ```
42
- *
38
+ *
43
39
  * The MEI document to display can either be given directly in the `data` property or loaded from an URL
44
40
  * specified in `url`.
45
- *
41
+ *
46
42
  * @prop {"auto" | "encoded" | "none" | "always"} footer - Control footer layout
47
43
  * @prop {"auto" | "encoded" | "none"} header - Control footer layout
48
44
  * @prop {"auto" | "none" | "line" | "encoded" | "smart"} breaks - Define page and system breaks layout (default: "auto")
@@ -51,323 +47,338 @@ function _import(name, location) {
51
47
  * @csspart music - the music output area
52
48
  */
53
49
  export class PbMei extends pbMixin(LitElement) {
50
+ static get properties() {
51
+ return {
52
+ /**
53
+ * MEI data to display specified as a string. This should represent a complete
54
+ * MEI document.
55
+ */
56
+ data: {
57
+ type: String,
58
+ },
59
+ /**
60
+ * URL of the MEI file to load. Will be used if no `data` property is present.
61
+ * A relative URL would be resolved relative to the TEI Publisher endpoint.
62
+ */
63
+ url: {
64
+ type: String,
65
+ },
66
+ /**
67
+ * Set to enable MIDI player
68
+ */
69
+ player: {
70
+ type: Boolean,
71
+ },
72
+ header: {
73
+ type: String,
74
+ },
75
+ footer: {
76
+ type: String,
77
+ },
78
+ breaks: {
79
+ type: String,
80
+ },
81
+ /**
82
+ * Set the XPath query for selecting <app> child elements, for example: "./rdg[contains(@source, 'source-id')]";
83
+ * by default the <lem> or the first <rdg> is selected
84
+ */
85
+ appXPath: {
86
+ type: String,
87
+ attribute: 'app-xpath',
88
+ },
89
+ /**
90
+ * Set the xPath query for selecting <choice> child elements, for example: "./orig"; by default the first child is selected
91
+ */
92
+ choiceXPath: {
93
+ type: String,
94
+ attribute: 'choice-xpath',
95
+ },
96
+ /**
97
+ * Set the xPath query for selecting the <mdiv> to be rendered; only one <mdiv> can be rendered (default: "")
98
+ */
99
+ mdivXPath: {
100
+ type: String,
101
+ attribute: 'mdiv-xpath',
102
+ },
103
+ /**
104
+ * Set the xPath query for selecting <subst> child elements, for example: "./del"; by default the first child is selected
105
+ */
106
+ substXPath: {
107
+ type: String,
108
+ attribute: 'subst-xpath',
109
+ },
110
+ _svg: {
111
+ type: String,
112
+ },
113
+ ...super.properties,
114
+ };
115
+ }
54
116
 
55
- static get properties() {
56
- return {
57
- /**
58
- * MEI data to display specified as a string. This should represent a complete
59
- * MEI document.
60
- */
61
- data: {
62
- type: String
63
- },
64
- /**
65
- * URL of the MEI file to load. Will be used if no `data` property is present.
66
- * A relative URL would be resolved relative to the TEI Publisher endpoint.
67
- */
68
- url: {
69
- type: String,
70
- },
71
- /**
72
- * Set to enable MIDI player
73
- */
74
- player: {
75
- type: Boolean,
76
- },
77
- header: {
78
- type: String,
79
- },
80
- footer: {
81
- type: String,
82
- },
83
- breaks: {
84
- type: String,
85
- },
86
- /**
87
- * Set the XPath query for selecting <app> child elements, for example: "./rdg[contains(@source, 'source-id')]";
88
- * by default the <lem> or the first <rdg> is selected
89
- */
90
- appXPath: {
91
- type: String,
92
- attribute: 'app-xpath',
93
- },
94
- /**
95
- * Set the xPath query for selecting <choice> child elements, for example: "./orig"; by default the first child is selected
96
- */
97
- choiceXPath: {
98
- type: String,
99
- attribute: 'choice-xpath',
100
- },
101
- /**
102
- * Set the xPath query for selecting the <mdiv> to be rendered; only one <mdiv> can be rendered (default: "")
103
- */
104
- mdivXPath: {
105
- type: String,
106
- attribute: 'mdiv-xpath',
107
- },
108
- /**
109
- * Set the xPath query for selecting <subst> child elements, for example: "./del"; by default the first child is selected
110
- */
111
- substXPath: {
112
- type: String,
113
- attribute: 'subst-xpath',
114
- },
115
- _svg: {
116
- type: String,
117
- },
118
- ...super.properties,
119
- };
120
- }
117
+ constructor() {
118
+ super();
119
+ this._data = null;
120
+ this._svg = null;
121
+ this._pages = 0;
122
+ this._page = 0;
123
+ this._midiPlayer = null;
124
+ this.footer = 'auto';
125
+ this.header = 'auto';
126
+ this.breaks = 'auto';
127
+ this.appXPath = null;
128
+ this.choiceXPath = null;
129
+ this.mdivXPath = null;
130
+ this.substXPath = null;
131
+ this._options = [];
132
+ }
121
133
 
122
- constructor() {
123
- super();
124
- this._data = null;
125
- this._svg = null;
126
- this._pages = 0;
127
- this._page = 0;
128
- this._midiPlayer = null;
129
- this.footer = 'auto';
130
- this.header = 'auto';
131
- this.breaks = 'auto';
132
- this.appXPath = null;
133
- this.choiceXPath = null;
134
- this.mdivXPath = null;
135
- this.substXPath = null;
136
- this._options = [];
137
- }
134
+ connectedCallback() {
135
+ super.connectedCallback();
138
136
 
139
- connectedCallback() {
140
- super.connectedCallback();
137
+ this.querySelectorAll('pb-option').forEach(option => {
138
+ this._options.push({
139
+ name: option.getAttribute('name'),
140
+ on: option.getAttribute('on'),
141
+ off: option.getAttribute('off'),
142
+ label: option.innerHTML,
143
+ });
144
+ });
145
+ }
141
146
 
142
- this.querySelectorAll('pb-option').forEach((option) => {
143
- this._options.push({
144
- name: option.getAttribute('name'),
145
- on: option.getAttribute('on'),
146
- off: option.getAttribute('off'),
147
- label: option.innerHTML
148
- })
149
- });
147
+ firstUpdated() {
148
+ super.firstUpdated();
149
+
150
+ if (this.player) {
151
+ _import('midiPlayer', resolveURL('../lib/web-midi-player/index.js')).then(() => {
152
+ const {
153
+ 'web-midi-player': { default: MidiPlayer },
154
+ } = window;
155
+ this._midiPlayer = new MidiPlayer();
156
+ });
150
157
  }
151
158
 
152
- firstUpdated() {
153
- super.firstUpdated();
159
+ if (!_verovio) {
160
+ createVerovioModule().then(VerovioModule => {
161
+ _verovio = new VerovioToolkit(VerovioModule);
154
162
 
155
- if (this.player) {
156
- _import("midiPlayer", resolveURL('../lib/web-midi-player/index.js'))
157
- .then(() => {
158
- const { 'web-midi-player': { default: MidiPlayer } } = window;
159
- this._midiPlayer = new MidiPlayer();
160
- });
161
- }
162
-
163
- if (!_verovio) {
164
- createVerovioModule().then(VerovioModule => {
165
- _verovio = new VerovioToolkit(VerovioModule);
166
-
167
- waitOnce('pb-page-ready', () => {
168
- this.load();
169
- });
170
- });
171
- } else {
172
- waitOnce('pb-page-ready', () => {
173
- this.load();
174
- });
175
- }
163
+ waitOnce('pb-page-ready', () => {
164
+ this.load();
165
+ });
166
+ });
167
+ } else {
168
+ waitOnce('pb-page-ready', () => {
169
+ this.load();
170
+ });
176
171
  }
172
+ }
177
173
 
178
- update(changedProps) {
179
- super.update(changedProps);
180
- if (changedProps.get('url') || changedProps.get('data')) {
181
- this.load();
182
- } else if (
183
- (changedProps.has('appXPath') ||
184
- changedProps.has('choiceXPath') ||
185
- changedProps.has('mdivXPath') ||
186
- changedProps.has('substXPath')) &&
187
- _verovio
188
- ) {
189
- _verovio.setOptions(this._getOptions());
190
- _verovio.loadData(this._data);
191
- this.showPage();
192
- }
174
+ update(changedProps) {
175
+ super.update(changedProps);
176
+ if (changedProps.get('url') || changedProps.get('data')) {
177
+ this.load();
178
+ } else if (
179
+ (changedProps.has('appXPath') ||
180
+ changedProps.has('choiceXPath') ||
181
+ changedProps.has('mdivXPath') ||
182
+ changedProps.has('substXPath')) &&
183
+ _verovio
184
+ ) {
185
+ _verovio.setOptions(this._getOptions());
186
+ _verovio.loadData(this._data);
187
+ this.showPage();
193
188
  }
189
+ }
194
190
 
195
- load() {
196
- if (this.data) {
197
- console.log('<pb-mei> Rendering data');
198
- this.show(this.data);
199
- } else if (this.url) {
200
- const link = this.toAbsoluteURL(this.url);
191
+ load() {
192
+ if (this.data) {
193
+ console.log('<pb-mei> Rendering data');
194
+ this.show(this.data);
195
+ } else if (this.url) {
196
+ const link = this.toAbsoluteURL(this.url);
201
197
 
202
- fetch(link)
203
- .then(response => response.text())
204
- .then(async str => {
205
- this.show(str);
206
- });
207
- }
198
+ fetch(link)
199
+ .then(response => response.text())
200
+ .then(async str => {
201
+ this.show(str);
202
+ });
208
203
  }
204
+ }
209
205
 
210
- show(str) {
211
- this._data = str;
212
- _verovio.setOptions(this._getOptions());
213
- _verovio.loadData(this._data);
214
- this._pages = _verovio.getPageCount();
215
- this._page = 1;
216
- console.log('<pb-mei> Loaded %d pages', this._pages);
217
- this.showPage();
218
- }
206
+ show(str) {
207
+ this._data = str;
208
+ _verovio.setOptions(this._getOptions());
209
+ _verovio.loadData(this._data);
210
+ this._pages = _verovio.getPageCount();
211
+ this._page = 1;
212
+ console.log('<pb-mei> Loaded %d pages', this._pages);
213
+ this.showPage();
214
+ }
219
215
 
220
- showPage() {
221
- this._svg = _verovio.renderToSVG(this._page, {});
222
- }
216
+ showPage() {
217
+ this._svg = _verovio.renderToSVG(this._page, {});
218
+ }
223
219
 
224
- async play() {
225
- const button = this.shadowRoot.getElementById('play');
226
- if (!button.active) {
227
- this._midiPlayer.stop();
228
- button.icon = 'av:play-arrow';
229
- } else {
230
- button.icon = 'av:stop';
231
- if (this._midiPaused) {
232
- this._midiPaused = false;
233
- this._midiPlayer.resume();
234
- } else {
235
- _verovio.loadData(this._data);
236
- const mdata = _verovio.renderToMIDI();
237
- const raw = window.atob(mdata);
238
- const rawLength = raw.length;
239
- const array = new Uint8Array(new ArrayBuffer(rawLength));
220
+ async play() {
221
+ const button = this.shadowRoot.getElementById('play');
222
+ if (!button.active) {
223
+ this._midiPlayer.stop();
224
+ button.icon = 'av:play-arrow';
225
+ } else {
226
+ button.icon = 'av:stop';
227
+ if (this._midiPaused) {
228
+ this._midiPaused = false;
229
+ this._midiPlayer.resume();
230
+ } else {
231
+ _verovio.loadData(this._data);
232
+ const mdata = _verovio.renderToMIDI();
233
+ const raw = window.atob(mdata);
234
+ const rawLength = raw.length;
235
+ const array = new Uint8Array(new ArrayBuffer(rawLength));
240
236
 
241
- for (let i = 0; i < rawLength; i += 1) {
242
- array[i] = raw.charCodeAt(i);
243
- }
244
- this._midiPlayer.play({ arrayBuffer: array });
245
- }
237
+ for (let i = 0; i < rawLength; i += 1) {
238
+ array[i] = raw.charCodeAt(i);
246
239
  }
240
+ this._midiPlayer.play({ arrayBuffer: array });
241
+ }
247
242
  }
243
+ }
248
244
 
249
- pause() {
250
- const button = this.shadowRoot.getElementById('play');
251
- if (button.active) {
252
- this._midiPaused = this._midiPlayer.pause();
253
- if (this._midiPaused) {
254
- button.icon = 'av:play-arrow';
255
- button.active = false;
256
- }
257
- }
245
+ pause() {
246
+ const button = this.shadowRoot.getElementById('play');
247
+ if (button.active) {
248
+ this._midiPaused = this._midiPlayer.pause();
249
+ if (this._midiPaused) {
250
+ button.icon = 'av:play-arrow';
251
+ button.active = false;
252
+ }
258
253
  }
254
+ }
259
255
 
260
- render() {
261
- return html`
262
- <div id="toolbar" part="toolbar">
263
- <div class="${this._pages === 1 ? 'hidden' : ''}">
264
- <paper-icon-button id="pageLeft" icon="icons:chevron-left" @click="${this._previousPage}"
265
- ?disabled="${this._page === 1}"></paper-icon-button>
266
- <paper-icon-button id="pageRight" icon="icons:chevron-right" @click="${this._nextPage}"
267
- ?disabled="${this._page === this._pages}"></paper-icon-button>
268
- </div>
269
- ${ this._renderPlayer() }
270
- <div>${ this._renderOptions() }</div>
271
- </div>
272
- ${ this._svg ?
273
- html`<div id="output" part="music">${unsafeHTML(this._svg)}</div>` :
274
- html`<div id="output" part="music">${translate('dialogs.loading')}</div>`
275
- }
276
- `;
277
- }
256
+ render() {
257
+ return html`
258
+ <div id="toolbar" part="toolbar">
259
+ <div class="${this._pages === 1 ? 'hidden' : ''}">
260
+ <paper-icon-button
261
+ id="pageLeft"
262
+ icon="icons:chevron-left"
263
+ @click="${this._previousPage}"
264
+ ?disabled="${this._page === 1}"
265
+ ></paper-icon-button>
266
+ <paper-icon-button
267
+ id="pageRight"
268
+ icon="icons:chevron-right"
269
+ @click="${this._nextPage}"
270
+ ?disabled="${this._page === this._pages}"
271
+ ></paper-icon-button>
272
+ </div>
273
+ ${this._renderPlayer()}
274
+ <div>${this._renderOptions()}</div>
275
+ </div>
276
+ ${this._svg
277
+ ? html`<div id="output" part="music">${unsafeHTML(this._svg)}</div>`
278
+ : html`<div id="output" part="music">${translate('dialogs.loading')}</div>`}
279
+ `;
280
+ }
278
281
 
279
- _renderPlayer() {
280
- if (this.player) {
281
- return html`
282
- <div id="player">
283
- <paper-icon-button id="play" icon="av:play-arrow" toggles @click="${this.play}"></paper-icon-button>
284
- <paper-icon-button icon="av:pause" @click="${this.pause}"></paper-icon-button>
285
- </div>
286
- `;
287
- }
288
- return null;
282
+ _renderPlayer() {
283
+ if (this.player) {
284
+ return html`
285
+ <div id="player">
286
+ <paper-icon-button
287
+ id="play"
288
+ icon="av:play-arrow"
289
+ toggles
290
+ @click="${this.play}"
291
+ ></paper-icon-button>
292
+ <paper-icon-button icon="av:pause" @click="${this.pause}"></paper-icon-button>
293
+ </div>
294
+ `;
289
295
  }
296
+ return null;
297
+ }
290
298
 
291
- _renderOptions() {
292
- return this._options.map(option =>
293
- html`<paper-checkbox @change="${(ev) => this._setOption(option, ev.target.checked)}">${option.label}</paper-checkbox>`
294
- );
295
- }
299
+ _renderOptions() {
300
+ return this._options.map(
301
+ option =>
302
+ html`<paper-checkbox @change="${ev => this._setOption(option, ev.target.checked)}"
303
+ >${option.label}</paper-checkbox
304
+ >`,
305
+ );
306
+ }
296
307
 
297
- _setOption(option, checked) {
298
- let value;
299
- if (checked) {
300
- value = option.on && option.on.length > 0 ? option.on : null;
301
- } else {
302
- value = option.off && option.off.length > 0 ? option.off : null;
303
- }
304
- this[option.name] = value;
308
+ _setOption(option, checked) {
309
+ let value;
310
+ if (checked) {
311
+ value = option.on && option.on.length > 0 ? option.on : null;
312
+ } else {
313
+ value = option.off && option.off.length > 0 ? option.off : null;
305
314
  }
315
+ this[option.name] = value;
316
+ }
306
317
 
307
- _nextPage(ev) {
308
- ev.preventDefault();
309
- if (this._page < this._pages) {
310
- this._page += 1;
311
- this.showPage();
312
- }
318
+ _nextPage(ev) {
319
+ ev.preventDefault();
320
+ if (this._page < this._pages) {
321
+ this._page += 1;
322
+ this.showPage();
313
323
  }
324
+ }
314
325
 
315
- _previousPage(ev) {
316
- ev.preventDefault();
317
- if (this._page > 1) {
318
- this._page -= 1;
319
- this.showPage();
320
- }
326
+ _previousPage(ev) {
327
+ ev.preventDefault();
328
+ if (this._page > 1) {
329
+ this._page -= 1;
330
+ this.showPage();
321
331
  }
332
+ }
322
333
 
323
- _getOptions() {
324
- const options = {
325
- // svg content should scale with the width of the component
326
- svgViewBox: true,
327
- adjustPageHeight: true,
328
- footer: this.footer,
329
- header: this.header,
330
- breaks: this.breaks,
331
- appXPathQuery: [this.appXPath],
332
- substXPathQuery: [this.substXPath],
333
- choiceXPathQuery: [this.choiceXPath]
334
- };
335
- if (this.mdivXPath) {
336
- options.mdivXPathQuery = this.mdivXPath;
337
- }
338
- return options;
334
+ _getOptions() {
335
+ const options = {
336
+ // svg content should scale with the width of the component
337
+ svgViewBox: true,
338
+ adjustPageHeight: true,
339
+ footer: this.footer,
340
+ header: this.header,
341
+ breaks: this.breaks,
342
+ appXPathQuery: [this.appXPath],
343
+ substXPathQuery: [this.substXPath],
344
+ choiceXPathQuery: [this.choiceXPath],
345
+ };
346
+ if (this.mdivXPath) {
347
+ options.mdivXPathQuery = this.mdivXPath;
339
348
  }
349
+ return options;
350
+ }
340
351
 
341
- static get styles() {
342
- return css`
343
- :host {
344
- display: grid;
345
- grid-template-rows: auto 1fr;
346
- min-width: var(--pb-mei-min-width, auto);
347
- }
352
+ static get styles() {
353
+ return css`
354
+ :host {
355
+ display: grid;
356
+ grid-template-rows: auto 1fr;
357
+ min-width: var(--pb-mei-min-width, auto);
358
+ }
348
359
 
349
- #toolbar {
350
- display: flex;
351
- align-items: center;
352
- }
360
+ #toolbar {
361
+ display: flex;
362
+ align-items: center;
363
+ }
353
364
 
354
- #toolbar div {
355
- margin-right: 1rem;
356
- }
365
+ #toolbar div {
366
+ margin-right: 1rem;
367
+ }
357
368
 
358
- #toolbar div:last-child {
359
- margin-right: 0;
360
- }
369
+ #toolbar div:last-child {
370
+ margin-right: 0;
371
+ }
361
372
 
362
- #output {
363
- width: 100%;
364
- overflow: auto;
365
- }
373
+ #output {
374
+ width: 100%;
375
+ overflow: auto;
376
+ }
366
377
 
367
- .hidden {
368
- display: none;
369
- }
370
- `;
371
- }
378
+ .hidden {
379
+ display: none;
380
+ }
381
+ `;
382
+ }
372
383
  }
373
- customElements.define('pb-mei', PbMei);
384
+ customElements.define('pb-mei', PbMei);