@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.
- package/.github/workflows/main.yml +3 -3
- package/.github/workflows/node.js.yml +3 -3
- package/.github/workflows/release.js.yml +4 -4
- package/.releaserc.json +2 -2
- package/CHANGELOG.md +262 -11
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/css/leaflet/images/layers.png +0 -0
- package/dist/demo/components.css +46 -1
- package/dist/demo/pb-browse-docs2.html +1 -1
- package/dist/demo/pb-dialog.html +3 -5
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-facsimile.html +2 -2
- package/dist/demo/pb-grid.html +19 -6
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-login.html +0 -2
- package/dist/demo/pb-message.html +1 -2
- package/dist/demo/pb-progress.html +2 -2
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-search.html +7 -4
- package/dist/demo/pb-search3.html +1 -1
- package/dist/demo/pb-search4.html +2 -2
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
- package/dist/paper-checkbox-645e1077.js +200 -0
- package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
- package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
- package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +68 -64
- package/dist/pb-components-bundle.js +1983 -2293
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +176 -120
- package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
- package/dist/pb-leaflet-map.js +23 -23
- package/dist/pb-mei.js +56 -41
- package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
- package/dist/pb-odd-editor.js +1023 -782
- package/dist/pb-tify.js +2 -2
- package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
- package/gh-pages.js +5 -3
- package/i18n/common/en.json +6 -0
- package/i18n/common/pl.json +2 -2
- package/lib/openseadragon.min.js +6 -6
- package/package.json +3 -3
- package/pb-elements.json +176 -120
- package/src/assets/components.css +5 -5
- package/src/authority/airtable.js +20 -21
- package/src/authority/anton.js +129 -129
- package/src/authority/custom.js +23 -21
- package/src/authority/geonames.js +38 -32
- package/src/authority/gnd.js +50 -42
- package/src/authority/kbga.js +137 -134
- package/src/authority/metagrid.js +44 -46
- package/src/authority/reconciliation.js +66 -67
- package/src/authority/registry.js +4 -4
- package/src/docs/pb-component-docs.js +2 -2
- package/src/docs/pb-component-view.js +5 -5
- package/src/docs/pb-components-list.js +2 -2
- package/src/docs/pb-demo-snippet.js +2 -2
- package/src/dts-client.js +299 -297
- package/src/dts-select-endpoint.js +90 -82
- package/src/parse-date-service.js +184 -135
- package/src/pb-ajax.js +158 -171
- package/src/pb-authority-lookup.js +191 -156
- package/src/pb-autocomplete.js +292 -280
- package/src/pb-blacklab-highlight.js +264 -259
- package/src/pb-blacklab-results.js +236 -221
- package/src/pb-browse-docs.js +540 -475
- package/src/pb-browse.js +68 -65
- package/src/pb-clipboard.js +79 -76
- package/src/pb-code-editor.js +110 -102
- package/src/pb-code-highlight.js +209 -204
- package/src/pb-codepen.js +79 -72
- package/src/pb-collapse.js +211 -151
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-components.js +1 -0
- package/src/pb-custom-form.js +173 -153
- package/src/pb-dialog.js +98 -62
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +212 -196
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +100 -97
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +474 -410
- package/src/pb-formula.js +151 -153
- package/src/pb-geolocation.js +129 -131
- package/src/pb-grid-action.js +53 -56
- package/src/pb-grid.js +231 -228
- package/src/pb-highlight.js +140 -140
- package/src/pb-hotkeys.js +40 -42
- package/src/pb-i18n.js +101 -104
- package/src/pb-image-strip.js +84 -78
- package/src/pb-lang.js +142 -57
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -429
- package/src/pb-login.js +299 -244
- package/src/pb-manage-odds.js +352 -336
- package/src/pb-map-icon.js +89 -89
- package/src/pb-map-layer.js +85 -85
- package/src/pb-markdown.js +90 -99
- package/src/pb-media-query.js +74 -72
- package/src/pb-mei.js +306 -295
- package/src/pb-message.js +139 -97
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -95
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1054 -958
- package/src/pb-odd-elementspec-editor.js +349 -298
- package/src/pb-odd-model-editor.js +1075 -909
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +431 -422
- package/src/pb-paginate.js +228 -179
- package/src/pb-panel.js +198 -182
- package/src/pb-popover-themes.js +15 -8
- package/src/pb-popover.js +296 -287
- package/src/pb-print-preview.js +127 -127
- package/src/pb-progress.js +51 -51
- package/src/pb-repeat.js +105 -104
- package/src/pb-restricted.js +84 -77
- package/src/pb-search.js +256 -228
- package/src/pb-select-feature.js +127 -120
- package/src/pb-select-odd.js +132 -124
- package/src/pb-select-template.js +89 -78
- package/src/pb-select.js +251 -227
- package/src/pb-split-list.js +179 -174
- package/src/pb-svg.js +80 -79
- package/src/pb-table-column.js +54 -54
- package/src/pb-table-grid.js +221 -203
- package/src/pb-tabs.js +61 -63
- package/src/pb-tify.js +154 -154
- package/src/pb-timeline.js +382 -249
- package/src/pb-toggle-feature.js +195 -187
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +135 -98
- package/src/pb-view.js +1282 -1270
- package/src/pb-zoom.js +127 -45
- package/src/polymer-hack.js +1 -1
- package/src/search-result-service.js +256 -223
- package/src/seed-element.js +13 -20
- package/src/settings.js +4 -4
- package/src/theming.js +98 -91
- package/src/urls.js +289 -289
- package/src/utils.js +53 -51
- package/css/pb-styles.css +0 -51
- package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
- package/src/assets/pb-styles.css +0 -51
- 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
|
|
11
|
-
|
|
12
|
-
|
|
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(
|
|
21
|
+
getServiceManifest(this.endpoint).then(result => {
|
|
22
22
|
this.ORConfig = result;
|
|
23
23
|
if (this.debug) {
|
|
24
24
|
console.log(
|
|
25
|
-
|
|
26
|
-
this._register,
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
q1: {
|
|
43
|
+
query: key,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
44
46
|
|
|
45
|
-
return new Promise(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.then(
|
|
55
|
-
.then(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 =
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
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);
|