@teipublisher/pb-components 2.26.1-next.3 → 3.0.0

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 (154) 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 +4 -4
  4. package/.releaserc.json +2 -2
  5. package/CHANGELOG.md +262 -11
  6. package/Dockerfile +78 -70
  7. package/css/components.css +5 -5
  8. package/css/leaflet/images/layers.png +0 -0
  9. package/dist/demo/components.css +46 -1
  10. package/dist/demo/pb-browse-docs2.html +1 -1
  11. package/dist/demo/pb-dialog.html +3 -5
  12. package/dist/demo/pb-drawer2.html +1 -1
  13. package/dist/demo/pb-facsimile.html +2 -2
  14. package/dist/demo/pb-grid.html +19 -6
  15. package/dist/demo/pb-leaflet-map.html +1 -1
  16. package/dist/demo/pb-login.html +0 -2
  17. package/dist/demo/pb-message.html +1 -2
  18. package/dist/demo/pb-progress.html +2 -2
  19. package/dist/demo/pb-repeat.html +1 -3
  20. package/dist/demo/pb-search.html +7 -4
  21. package/dist/demo/pb-search3.html +1 -1
  22. package/dist/demo/pb-search4.html +2 -2
  23. package/dist/demo/pb-view3.html +1 -1
  24. package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
  25. package/dist/paper-checkbox-645e1077.js +200 -0
  26. package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
  27. package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
  28. package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
  29. package/dist/pb-code-editor.js +25 -20
  30. package/dist/pb-component-docs.js +68 -64
  31. package/dist/pb-components-bundle.js +1983 -2293
  32. package/dist/pb-edit-app.js +167 -107
  33. package/dist/pb-elements.json +176 -120
  34. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  35. package/dist/pb-leaflet-map.js +23 -23
  36. package/dist/pb-mei.js +56 -41
  37. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  38. package/dist/pb-odd-editor.js +1023 -782
  39. package/dist/pb-tify.js +2 -2
  40. package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
  41. package/gh-pages.js +5 -3
  42. package/i18n/common/en.json +6 -0
  43. package/i18n/common/pl.json +2 -2
  44. package/lib/openseadragon.min.js +6 -6
  45. package/package.json +3 -3
  46. package/pb-elements.json +176 -120
  47. package/src/assets/components.css +5 -5
  48. package/src/authority/airtable.js +20 -21
  49. package/src/authority/anton.js +129 -129
  50. package/src/authority/custom.js +23 -21
  51. package/src/authority/geonames.js +38 -32
  52. package/src/authority/gnd.js +50 -42
  53. package/src/authority/kbga.js +137 -134
  54. package/src/authority/metagrid.js +44 -46
  55. package/src/authority/reconciliation.js +66 -67
  56. package/src/authority/registry.js +4 -4
  57. package/src/docs/pb-component-docs.js +2 -2
  58. package/src/docs/pb-component-view.js +5 -5
  59. package/src/docs/pb-components-list.js +2 -2
  60. package/src/docs/pb-demo-snippet.js +2 -2
  61. package/src/dts-client.js +299 -297
  62. package/src/dts-select-endpoint.js +90 -82
  63. package/src/parse-date-service.js +184 -135
  64. package/src/pb-ajax.js +158 -171
  65. package/src/pb-authority-lookup.js +191 -156
  66. package/src/pb-autocomplete.js +292 -280
  67. package/src/pb-blacklab-highlight.js +264 -259
  68. package/src/pb-blacklab-results.js +236 -221
  69. package/src/pb-browse-docs.js +540 -475
  70. package/src/pb-browse.js +68 -65
  71. package/src/pb-clipboard.js +79 -76
  72. package/src/pb-code-editor.js +110 -102
  73. package/src/pb-code-highlight.js +209 -204
  74. package/src/pb-codepen.js +79 -72
  75. package/src/pb-collapse.js +211 -151
  76. package/src/pb-combo-box.js +190 -190
  77. package/src/pb-components-bundle.js +1 -1
  78. package/src/pb-components.js +1 -0
  79. package/src/pb-custom-form.js +173 -153
  80. package/src/pb-dialog.js +98 -62
  81. package/src/pb-document.js +89 -90
  82. package/src/pb-download.js +212 -196
  83. package/src/pb-drawer.js +145 -148
  84. package/src/pb-edit-app.js +301 -229
  85. package/src/pb-edit-xml.js +100 -97
  86. package/src/pb-events.js +114 -107
  87. package/src/pb-facs-link.js +104 -102
  88. package/src/pb-facsimile.js +474 -410
  89. package/src/pb-formula.js +151 -153
  90. package/src/pb-geolocation.js +129 -131
  91. package/src/pb-grid-action.js +53 -56
  92. package/src/pb-grid.js +231 -228
  93. package/src/pb-highlight.js +140 -140
  94. package/src/pb-hotkeys.js +40 -42
  95. package/src/pb-i18n.js +101 -104
  96. package/src/pb-image-strip.js +84 -78
  97. package/src/pb-lang.js +142 -57
  98. package/src/pb-leaflet-map.js +488 -485
  99. package/src/pb-link.js +126 -124
  100. package/src/pb-load.js +431 -429
  101. package/src/pb-login.js +299 -244
  102. package/src/pb-manage-odds.js +352 -336
  103. package/src/pb-map-icon.js +89 -89
  104. package/src/pb-map-layer.js +85 -85
  105. package/src/pb-markdown.js +90 -99
  106. package/src/pb-media-query.js +74 -72
  107. package/src/pb-mei.js +306 -295
  108. package/src/pb-message.js +139 -97
  109. package/src/pb-mixin.js +269 -264
  110. package/src/pb-navigation.js +80 -95
  111. package/src/pb-observable.js +38 -38
  112. package/src/pb-odd-editor.js +1054 -958
  113. package/src/pb-odd-elementspec-editor.js +349 -298
  114. package/src/pb-odd-model-editor.js +1075 -909
  115. package/src/pb-odd-parameter-editor.js +200 -178
  116. package/src/pb-odd-rendition-editor.js +136 -124
  117. package/src/pb-page.js +431 -422
  118. package/src/pb-paginate.js +228 -179
  119. package/src/pb-panel.js +198 -182
  120. package/src/pb-popover-themes.js +15 -8
  121. package/src/pb-popover.js +296 -287
  122. package/src/pb-print-preview.js +127 -127
  123. package/src/pb-progress.js +51 -51
  124. package/src/pb-repeat.js +105 -104
  125. package/src/pb-restricted.js +84 -77
  126. package/src/pb-search.js +256 -228
  127. package/src/pb-select-feature.js +127 -120
  128. package/src/pb-select-odd.js +132 -124
  129. package/src/pb-select-template.js +89 -78
  130. package/src/pb-select.js +251 -227
  131. package/src/pb-split-list.js +179 -174
  132. package/src/pb-svg.js +80 -79
  133. package/src/pb-table-column.js +54 -54
  134. package/src/pb-table-grid.js +221 -203
  135. package/src/pb-tabs.js +61 -63
  136. package/src/pb-tify.js +154 -154
  137. package/src/pb-timeline.js +382 -249
  138. package/src/pb-toggle-feature.js +195 -187
  139. package/src/pb-upload.js +184 -174
  140. package/src/pb-version.js +30 -30
  141. package/src/pb-view-annotate.js +135 -98
  142. package/src/pb-view.js +1282 -1270
  143. package/src/pb-zoom.js +127 -45
  144. package/src/polymer-hack.js +1 -1
  145. package/src/search-result-service.js +256 -223
  146. package/src/seed-element.js +13 -20
  147. package/src/settings.js +4 -4
  148. package/src/theming.js +98 -91
  149. package/src/urls.js +289 -289
  150. package/src/utils.js +53 -51
  151. package/css/pb-styles.css +0 -51
  152. package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
  153. package/src/assets/pb-styles.css +0 -51
  154. package/src/pb-light-dom.js +0 -41
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable class-methods-use-this */
2
- import { Registry } from './registry.js'
2
+ import { Registry } from './registry.js';
3
3
 
4
4
  // Todo:
5
5
  // - strings <- types
@@ -7,26 +7,28 @@ import { Registry } from './registry.js'
7
7
  // - test with other providers, inside custom connector
8
8
  // - documentation
9
9
 
10
- async function getServiceManifest (endpoint) {
11
- const response = await fetch(endpoint);
12
- const data = await response.json();
10
+ async function getServiceManifest(endpoint) {
11
+ const response = await fetch(endpoint);
12
+ const data = await response.json();
13
13
  return data;
14
14
  }
15
15
 
16
16
  export class ReconciliationService extends Registry {
17
17
  constructor(configElem) {
18
- super(configElem)
18
+ super(configElem);
19
19
  this.endpoint = configElem.getAttribute('endpoint');
20
20
  this.debug = configElem.getAttribute('debug');
21
- getServiceManifest(this.endpoint).then((result) => {
21
+ getServiceManifest(this.endpoint).then(result => {
22
22
  this.ORConfig = result;
23
23
  if (this.debug) {
24
24
  console.log(
25
- 'OpenReconcile connector for register \'%s\' at endpoint <%s>. Using config: %o',
26
- this._register, this.endpoint, this.ORConfig
25
+ "OpenReconcile connector for register '%s' at endpoint <%s>. Using config: %o",
26
+ this._register,
27
+ this.endpoint,
28
+ this.ORConfig,
27
29
  );
28
30
  }
29
- })
31
+ });
30
32
  }
31
33
 
32
34
  /**
@@ -37,57 +39,54 @@ export class ReconciliationService extends Registry {
37
39
  async query(key) {
38
40
  const results = [];
39
41
  const paramsObj = {
40
- q1: {
41
- query: key
42
- }
43
- };
42
+ q1: {
43
+ query: key,
44
+ },
45
+ };
44
46
 
45
- return new Promise((resolve) => {
46
- fetch(this.endpoint, {
47
- method: 'POST',
48
- headers: {
49
- 'Accept': 'application/json',
50
- 'Content-Type': 'application/x-www-form-urlencoded'
51
- },
52
- body: "queries=".concat(JSON.stringify(paramsObj))
53
- })
54
- .then((response) => response.json())
55
- .then((json) => {
56
- json.q1.result.forEach((item) => {
57
- if (this.ORConfig.view) {
58
- this.view = this.ORConfig.view.url.replace('{{id}}', item.id);
59
- } else {
60
- this.view = item.id;
61
- }
62
- if (item.description) {
63
- this.description = item.description;
64
- } else if (item.type) {
65
- this.description = item.type.map(t => t.name.toString() ).join(', ')
66
- } else {
67
- this.description = ""
68
- }
69
- const result = {
70
- register: this._register,
71
- id: (this._prefix ? `${this._prefix}-${item.id}` : item.id),
72
- label: item.name,
73
- link: this.view,
74
- details: this.description,
75
- provider: 'OpenReconcile'
76
- };
77
- results.push(result);
78
- });
79
- if (this.debug) {
80
- console.log(
81
- 'OpenReconcile results: %o',
82
- results
83
- );
47
+ return new Promise(resolve => {
48
+ fetch(this.endpoint, {
49
+ method: 'POST',
50
+ headers: {
51
+ Accept: 'application/json',
52
+ 'Content-Type': 'application/x-www-form-urlencoded',
53
+ },
54
+ body: 'queries='.concat(JSON.stringify(paramsObj)),
55
+ })
56
+ .then(response => response.json())
57
+ .then(json => {
58
+ json.q1.result.forEach(item => {
59
+ if (this.ORConfig.view) {
60
+ this.view = this.ORConfig.view.url.replace('{{id}}', item.id);
61
+ } else {
62
+ this.view = item.id;
84
63
  }
85
- resolve({
86
- totalItems: json.q1.result.length,
87
- items: results,
88
- });
89
- })
90
- })
64
+ if (item.description) {
65
+ this.description = item.description;
66
+ } else if (item.type) {
67
+ this.description = item.type.map(t => t.name.toString()).join(', ');
68
+ } else {
69
+ this.description = '';
70
+ }
71
+ const result = {
72
+ register: this._register,
73
+ id: this._prefix ? `${this._prefix}-${item.id}` : item.id,
74
+ label: item.name,
75
+ link: this.view,
76
+ details: this.description,
77
+ provider: 'OpenReconcile',
78
+ };
79
+ results.push(result);
80
+ });
81
+ if (this.debug) {
82
+ console.log('OpenReconcile results: %o', results);
83
+ }
84
+ resolve({
85
+ totalItems: json.q1.result.length,
86
+ items: results,
87
+ });
88
+ });
89
+ });
91
90
  }
92
91
 
93
92
  /**
@@ -103,7 +102,7 @@ export class ReconciliationService extends Registry {
103
102
  return Promise.resolve({});
104
103
  }
105
104
  if (!this.ORConfig.preview) {
106
- container.innerHTML = 'no \'preview\' information in endpoint\'s manifest';
105
+ container.innerHTML = "no 'preview' information in endpoint's manifest";
107
106
  return Promise.resolve();
108
107
  }
109
108
 
@@ -111,14 +110,14 @@ export class ReconciliationService extends Registry {
111
110
  const rawid = this._prefix ? id.substring(this._prefix.length + 1) : id;
112
111
  const url = this.ORConfig.preview.url.replace('{{id}}', encodeURIComponent(rawid));
113
112
  fetch(url)
114
- .then(response => response.text())
115
- .then((output) => {
116
- container.innerHTML = output;
117
- resolve({
118
- id: this._prefix ? `${this._prefix}-${rawid}` : rawid
119
- });
120
- })
121
- .catch(() => reject());
113
+ .then(response => response.text())
114
+ .then(output => {
115
+ container.innerHTML = output;
116
+ resolve({
117
+ id: this._prefix ? `${this._prefix}-${rawid}` : rawid,
118
+ });
119
+ })
120
+ .catch(() => reject());
122
121
  });
123
122
  }
124
123
  }
@@ -29,11 +29,11 @@ export class Registry {
29
29
  set name(name) {
30
30
  this._register = name;
31
31
  }
32
-
32
+
33
33
  get editable() {
34
34
  return false;
35
35
  }
36
-
36
+
37
37
  /**
38
38
  * Query the authority and return a RegistryResult.
39
39
  *
@@ -69,11 +69,11 @@ export class Registry {
69
69
 
70
70
  /**
71
71
  * Retrieve a raw JSON record for the given key as returned by the endpoint.
72
- *
72
+ *
73
73
  * @param {string} key the key to look up
74
74
  * @returns {Promise<any>} promise resolving to the JSON record returned by the endpoint
75
75
  */
76
76
  async getRecord(key) {
77
- return Promise.reject();
77
+ return Promise.reject();
78
78
  }
79
79
  }
@@ -8,7 +8,7 @@ import { PbComponentView } from './pb-component-view.js';
8
8
  /**
9
9
  * An API viewer for webcomponents based on the JSON format produced
10
10
  * by web-component-analyzer.
11
- *
11
+ *
12
12
  * @slot logo - HTML to show as logo on top of the drawer
13
13
  * @listens pb-api-component if another webcomponent should be shown
14
14
  */
@@ -171,4 +171,4 @@ export class PbComponentDocs extends LitElement {
171
171
  `;
172
172
  }
173
173
  }
174
- customElements.define('pb-component-docs', PbComponentDocs);
174
+ customElements.define('pb-component-docs', PbComponentDocs);
@@ -57,7 +57,7 @@ function _renderSection(title, data, hasDefaults = false) {
57
57
 
58
58
  /**
59
59
  * Core viewer showing the element documentation and demos.
60
- *
60
+ *
61
61
  * @cssprop --pb-header-background-color - Background color of the header
62
62
  * @cssprop --pb-header-color - Color of header text
63
63
  */
@@ -235,7 +235,7 @@ export class PbComponentView extends LitElement {
235
235
  }
236
236
 
237
237
  h1, h2 {
238
- font-family: "Oswald",Verdana,"Helvetica", sans-serif;
238
+ font-family: "Oswald",Verdana,"Helvetica", sans-serif;
239
239
  font-weight: 400;
240
240
  line-height: 1.2;
241
241
  }
@@ -266,7 +266,7 @@ export class PbComponentView extends LitElement {
266
266
  margin-left: 10px;
267
267
  margin-right: 20px;
268
268
  }
269
-
269
+
270
270
  iframe {
271
271
  border: 0;
272
272
  width: 100%;
@@ -284,7 +284,7 @@ export class PbComponentView extends LitElement {
284
284
  padding-bottom: 8px;
285
285
  border-bottom: 1px solid #a0a0a0;
286
286
  }
287
-
287
+
288
288
  td {
289
289
  padding: 8px 4px;
290
290
  width: 25%;
@@ -307,4 +307,4 @@ export class PbComponentView extends LitElement {
307
307
  `;
308
308
  }
309
309
  }
310
- customElements.define('pb-component-view', PbComponentView);
310
+ customElements.define('pb-component-view', PbComponentView);
@@ -3,7 +3,7 @@ import '@polymer/paper-item';
3
3
 
4
4
  /**
5
5
  * Displays a list of components to view.
6
- *
6
+ *
7
7
  * @fires pb-api-component if a component name is clicked
8
8
  */
9
9
  export class PbComponentsList extends LitElement {
@@ -61,4 +61,4 @@ export class PbComponentsList extends LitElement {
61
61
  }));
62
62
  }
63
63
  }
64
- customElements.define('pb-components-list', PbComponentsList);
64
+ customElements.define('pb-components-list', PbComponentsList);
@@ -6,7 +6,7 @@ const codePenEndpoint = "https://teipublisher.com/exist/apps/tei-publisher";
6
6
 
7
7
  /**
8
8
  * Viewer for demo code.
9
- *
9
+ *
10
10
  * @customElement pb-demo-snippet
11
11
  * @polymer
12
12
  * @appliesMixin pbMixin
@@ -201,4 +201,4 @@ ${PbDemoSnippet.removeIndent(css)}`;
201
201
  `;
202
202
  }
203
203
  }
204
- customElements.define('pb-demo-snippet', PbDemoSnippet);
204
+ customElements.define('pb-demo-snippet', PbDemoSnippet);