@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
|
@@ -6,11 +6,10 @@ import '@polymer/paper-icon-button/paper-icon-button.js';
|
|
|
6
6
|
import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
|
|
7
7
|
import '@polymer/paper-listbox/paper-listbox.js';
|
|
8
8
|
import '@polymer/paper-item/paper-item.js';
|
|
9
|
-
import '@
|
|
10
|
-
import "@jinntec/jinn-codemirror/dist/src/jinn-codemirror";
|
|
9
|
+
import '@jinntec/jinn-codemirror/dist/src/jinn-codemirror';
|
|
11
10
|
|
|
12
11
|
import { cmpVersion } from './utils.js';
|
|
13
|
-
import { get as i18n, translate } from
|
|
12
|
+
import { get as i18n, translate } from './pb-i18n.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* represents an odd parameter element for editing
|
|
@@ -20,176 +19,195 @@ import { get as i18n, translate } from "./pb-i18n.js";
|
|
|
20
19
|
* @polymer
|
|
21
20
|
*/
|
|
22
21
|
export class PbOddParameterEditor extends LitElement {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
22
|
+
static get styles() {
|
|
23
|
+
return css`
|
|
24
|
+
:host {
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
.wrapper {
|
|
28
|
+
display: grid;
|
|
29
|
+
grid-template-columns: 150px auto 50px 50px;
|
|
30
|
+
grid-column-gap: 20px;
|
|
31
|
+
grid-row-gap: 20px;
|
|
32
|
+
margin-bottom: 10px;
|
|
33
|
+
}
|
|
34
|
+
paper-dropdown-menu {
|
|
35
|
+
align-self: start;
|
|
36
|
+
}
|
|
37
|
+
paper-icon-button,
|
|
38
|
+
paper-checkbox {
|
|
39
|
+
align-self: center;
|
|
40
|
+
margin-top: 16px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.editor label {
|
|
44
|
+
margin-bottom: 5px;
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
color: var(--paper-grey-500);
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
render() {
|
|
53
|
+
return html`
|
|
54
|
+
<div class="wrapper">
|
|
55
|
+
<paper-autocomplete
|
|
56
|
+
id="combo"
|
|
57
|
+
text="${this.name}"
|
|
58
|
+
placeholder="${translate('odd.editor.model.param-name-placeholder')}"
|
|
59
|
+
label="Name"
|
|
60
|
+
.source="${this._currentParameters}"
|
|
61
|
+
></paper-autocomplete>
|
|
62
|
+
|
|
63
|
+
<div class="editor">
|
|
64
|
+
<label>Parameter</label>
|
|
65
|
+
<jinn-codemirror
|
|
66
|
+
id="editor"
|
|
67
|
+
mode="xquery"
|
|
68
|
+
code="${this.value}"
|
|
69
|
+
linter="${this.endpoint}/${cmpVersion(this.apiVersion, '1.0.0')
|
|
70
|
+
? 'modules/editor.xql'
|
|
71
|
+
: 'api/lint'}"
|
|
72
|
+
></jinn-codemirror>
|
|
69
73
|
</div>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
74
|
+
<paper-checkbox id="set" ?checked="${this.setParam}" @change="${this._handleCodeChange}"
|
|
75
|
+
>${translate('odd.editor.model.set-param')}</paper-checkbox
|
|
76
|
+
>
|
|
77
|
+
<paper-icon-button
|
|
78
|
+
@click="${this._delete}"
|
|
79
|
+
icon="delete"
|
|
80
|
+
title="delete this parameter"
|
|
81
|
+
></paper-icon-button>
|
|
82
|
+
</div>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static get properties() {
|
|
87
|
+
return {
|
|
88
|
+
/**
|
|
89
|
+
* the parameter name
|
|
90
|
+
*/
|
|
91
|
+
name: {
|
|
92
|
+
type: String,
|
|
93
|
+
reflect: true,
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* the parameter value
|
|
97
|
+
*/
|
|
98
|
+
value: {
|
|
99
|
+
type: String,
|
|
100
|
+
reflect: true,
|
|
101
|
+
},
|
|
102
|
+
behaviour: {
|
|
103
|
+
type: String,
|
|
104
|
+
},
|
|
105
|
+
parameters: {
|
|
106
|
+
type: Object,
|
|
107
|
+
},
|
|
108
|
+
setParam: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
attribute: 'set',
|
|
111
|
+
},
|
|
112
|
+
_currentParameters: {
|
|
113
|
+
type: Array,
|
|
114
|
+
},
|
|
115
|
+
endpoint: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
apiVersion: {
|
|
119
|
+
type: String,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
constructor() {
|
|
125
|
+
super();
|
|
126
|
+
this.name = '';
|
|
127
|
+
this.value = '';
|
|
128
|
+
this.setParam = false;
|
|
129
|
+
this.behaviour = '';
|
|
130
|
+
this.currentParameters = [];
|
|
131
|
+
this.parameters = {
|
|
132
|
+
'': [],
|
|
133
|
+
alternate: ['default', 'alternate', 'persistent'],
|
|
134
|
+
anchor: ['content', 'id'],
|
|
135
|
+
block: ['content'],
|
|
136
|
+
body: ['content'],
|
|
137
|
+
break: ['content', 'type', 'label'],
|
|
138
|
+
cell: ['content'],
|
|
139
|
+
cit: ['content', 'source'],
|
|
140
|
+
document: ['content'],
|
|
141
|
+
figure: ['content', 'title'],
|
|
142
|
+
graphic: ['content', 'url', 'width', 'height', 'scale', 'title'],
|
|
143
|
+
heading: ['content', 'level'],
|
|
144
|
+
inline: ['content'],
|
|
145
|
+
link: ['content', 'uri', 'target'],
|
|
146
|
+
list: ['content', 'type'],
|
|
147
|
+
listItem: ['content', 'n'],
|
|
148
|
+
metadata: ['content'],
|
|
149
|
+
note: ['content', 'place', 'label'],
|
|
150
|
+
omit: [],
|
|
151
|
+
paragraph: ['content'],
|
|
152
|
+
row: ['content'],
|
|
153
|
+
section: ['content'],
|
|
154
|
+
table: ['content'],
|
|
155
|
+
text: ['content'],
|
|
156
|
+
title: ['content'],
|
|
157
|
+
webcomponent: ['content', 'name'],
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
this.selected = '';
|
|
161
|
+
this.endpoint = '';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
super.connectedCallback();
|
|
166
|
+
this.value = this.value.trim();
|
|
167
|
+
this.dispatchEvent(
|
|
168
|
+
new CustomEvent('parameter-connected', {
|
|
169
|
+
composed: true,
|
|
170
|
+
bubbles: true,
|
|
171
|
+
detail: { target: this },
|
|
172
|
+
}),
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
attributeChangedCallback(name, old, value) {
|
|
177
|
+
super.attributeChangedCallback(name, old, value);
|
|
178
|
+
if (name === 'behaviour') {
|
|
179
|
+
this._currentParameters = this.parameters[value];
|
|
160
180
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const editor = this.shadowRoot.getElementById('editor');
|
|
181
|
-
if (!editor) { return; }
|
|
182
|
-
// editor.refresh();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
firstUpdated(changedProperties) {
|
|
184
|
+
// console.log('parameters firstupdated ', changedProperties);
|
|
185
|
+
this.selected = this.parameters[this.behaviour] || [];
|
|
186
|
+
this.requestUpdate();
|
|
187
|
+
|
|
188
|
+
this.shadowRoot
|
|
189
|
+
.getElementById('combo')
|
|
190
|
+
.addEventListener('focused-changed', this._handleCodeChange.bind(this));
|
|
191
|
+
this.shadowRoot
|
|
192
|
+
.getElementById('editor')
|
|
193
|
+
.addEventListener('update', this._handleCodeChange.bind(this));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
refreshEditor() {
|
|
197
|
+
// console.log('parameters refresh');
|
|
198
|
+
const editor = this.shadowRoot.getElementById('editor');
|
|
199
|
+
if (!editor) {
|
|
183
200
|
}
|
|
201
|
+
// editor.refresh();
|
|
202
|
+
}
|
|
184
203
|
|
|
204
|
+
_delete(ev) {
|
|
205
|
+
console.log('parameter delete ', ev);
|
|
206
|
+
ev.preventDefault();
|
|
207
|
+
this.dispatchEvent(new CustomEvent('parameter-remove', {}));
|
|
208
|
+
}
|
|
185
209
|
|
|
186
|
-
|
|
187
|
-
console.log('parameter delete ', ev);
|
|
188
|
-
ev.preventDefault();
|
|
189
|
-
this.dispatchEvent(new CustomEvent('parameter-remove', {}));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/*
|
|
210
|
+
/*
|
|
193
211
|
_handleChange(e) {
|
|
194
212
|
console.log('_handleChange ', e);
|
|
195
213
|
this.value = this.shadowRoot.getElementById('editor').getSource();
|
|
@@ -198,15 +216,19 @@ export class PbOddParameterEditor extends LitElement {
|
|
|
198
216
|
}
|
|
199
217
|
*/
|
|
200
218
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
_handleCodeChange(e) {
|
|
220
|
+
console.log('_handleCodeChange ', e);
|
|
221
|
+
this.value = this.shadowRoot.getElementById('editor').content || '';
|
|
222
|
+
console.log('value %s', this.value);
|
|
223
|
+
this.name = this.shadowRoot.getElementById('combo').text;
|
|
224
|
+
this.setParam = this.shadowRoot.getElementById('set').checked;
|
|
225
|
+
this.dispatchEvent(
|
|
226
|
+
new CustomEvent('parameter-changed', {
|
|
227
|
+
composed: true,
|
|
228
|
+
bubbles: true,
|
|
229
|
+
detail: { name: this.name, value: this.value, set: this.setParam },
|
|
230
|
+
}),
|
|
231
|
+
);
|
|
232
|
+
}
|
|
211
233
|
}
|
|
212
234
|
customElements.define('pb-odd-parameter-editor', PbOddParameterEditor);
|