@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
@@ -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);