@teipublisher/pb-components 2.26.0-next-3.11 → 2.26.0-next-3.13

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 (133) 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 +38 -0
  5. package/Dockerfile +78 -70
  6. package/css/components.css +5 -5
  7. package/dist/demo/components.css +2 -8
  8. package/dist/demo/pb-drawer2.html +1 -1
  9. package/dist/demo/pb-leaflet-map.html +1 -1
  10. package/dist/demo/pb-progress.html +2 -2
  11. package/dist/demo/pb-repeat.html +1 -3
  12. package/dist/demo/pb-view3.html +1 -1
  13. package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
  14. package/dist/pb-code-editor.js +25 -20
  15. package/dist/pb-component-docs.js +58 -54
  16. package/dist/pb-components-bundle.js +1937 -1782
  17. package/dist/pb-edit-app.js +167 -107
  18. package/dist/pb-elements.json +45 -45
  19. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  20. package/dist/pb-leaflet-map.js +23 -23
  21. package/dist/pb-mei.js +56 -41
  22. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  23. package/dist/pb-odd-editor.js +923 -756
  24. package/dist/pb-tify.js +2 -2
  25. package/dist/{vaadin-element-mixin-6633322b.js → vaadin-element-mixin-84fb7d82.js} +181 -143
  26. package/gh-pages.js +5 -3
  27. package/i18n/common/pl.json +2 -2
  28. package/lib/openseadragon.min.js +1 -1
  29. package/package.json +2 -2
  30. package/pb-elements.json +45 -45
  31. package/src/assets/components.css +5 -5
  32. package/src/authority/airtable.js +20 -21
  33. package/src/authority/anton.js +129 -129
  34. package/src/authority/custom.js +23 -21
  35. package/src/authority/geonames.js +38 -32
  36. package/src/authority/gnd.js +47 -42
  37. package/src/authority/kbga.js +137 -134
  38. package/src/authority/metagrid.js +44 -46
  39. package/src/authority/reconciliation.js +66 -67
  40. package/src/authority/registry.js +4 -4
  41. package/src/docs/pb-component-docs.js +2 -2
  42. package/src/docs/pb-component-view.js +5 -5
  43. package/src/docs/pb-components-list.js +2 -2
  44. package/src/docs/pb-demo-snippet.js +2 -2
  45. package/src/dts-client.js +299 -297
  46. package/src/dts-select-endpoint.js +90 -82
  47. package/src/parse-date-service.js +184 -135
  48. package/src/pb-ajax.js +150 -146
  49. package/src/pb-authority-lookup.js +183 -146
  50. package/src/pb-autocomplete.js +292 -280
  51. package/src/pb-blacklab-highlight.js +264 -259
  52. package/src/pb-blacklab-results.js +236 -221
  53. package/src/pb-browse-docs.js +540 -475
  54. package/src/pb-browse.js +68 -65
  55. package/src/pb-clipboard.js +79 -76
  56. package/src/pb-code-editor.js +110 -102
  57. package/src/pb-code-highlight.js +209 -204
  58. package/src/pb-codepen.js +79 -72
  59. package/src/pb-collapse.js +212 -207
  60. package/src/pb-combo-box.js +190 -190
  61. package/src/pb-components-bundle.js +1 -1
  62. package/src/pb-custom-form.js +151 -149
  63. package/src/pb-dialog.js +96 -60
  64. package/src/pb-document.js +89 -90
  65. package/src/pb-download.js +210 -198
  66. package/src/pb-drawer.js +145 -148
  67. package/src/pb-edit-app.js +301 -229
  68. package/src/pb-edit-xml.js +98 -96
  69. package/src/pb-events.js +114 -107
  70. package/src/pb-facs-link.js +104 -102
  71. package/src/pb-facsimile.js +411 -413
  72. package/src/pb-formula.js +151 -153
  73. package/src/pb-geolocation.js +129 -131
  74. package/src/pb-grid-action.js +53 -56
  75. package/src/pb-grid.js +231 -228
  76. package/src/pb-highlight.js +140 -140
  77. package/src/pb-hotkeys.js +40 -42
  78. package/src/pb-i18n.js +101 -104
  79. package/src/pb-image-strip.js +84 -78
  80. package/src/pb-lang.js +132 -128
  81. package/src/pb-leaflet-map.js +488 -485
  82. package/src/pb-link.js +126 -124
  83. package/src/pb-load.js +431 -426
  84. package/src/pb-login.js +291 -248
  85. package/src/pb-manage-odds.js +364 -318
  86. package/src/pb-map-icon.js +89 -89
  87. package/src/pb-map-layer.js +85 -85
  88. package/src/pb-markdown.js +90 -99
  89. package/src/pb-media-query.js +74 -72
  90. package/src/pb-mei.js +306 -295
  91. package/src/pb-message.js +144 -144
  92. package/src/pb-mixin.js +269 -264
  93. package/src/pb-navigation.js +80 -82
  94. package/src/pb-observable.js +38 -38
  95. package/src/pb-odd-editor.js +1053 -955
  96. package/src/pb-odd-elementspec-editor.js +348 -297
  97. package/src/pb-odd-model-editor.js +1061 -901
  98. package/src/pb-odd-parameter-editor.js +200 -178
  99. package/src/pb-odd-rendition-editor.js +136 -124
  100. package/src/pb-page.js +431 -421
  101. package/src/pb-paginate.js +202 -190
  102. package/src/pb-panel.js +191 -179
  103. package/src/pb-popover-themes.js +7 -5
  104. package/src/pb-popover.js +296 -287
  105. package/src/pb-print-preview.js +127 -127
  106. package/src/pb-progress.js +51 -51
  107. package/src/pb-repeat.js +105 -104
  108. package/src/pb-restricted.js +84 -77
  109. package/src/pb-search.js +252 -241
  110. package/src/pb-select-feature.js +127 -120
  111. package/src/pb-select-odd.js +132 -124
  112. package/src/pb-select-template.js +89 -78
  113. package/src/pb-select.js +251 -227
  114. package/src/pb-split-list.js +179 -174
  115. package/src/pb-svg.js +80 -79
  116. package/src/pb-table-column.js +54 -54
  117. package/src/pb-table-grid.js +221 -203
  118. package/src/pb-tabs.js +61 -63
  119. package/src/pb-tify.js +154 -154
  120. package/src/pb-timeline.js +271 -229
  121. package/src/pb-toggle-feature.js +182 -175
  122. package/src/pb-upload.js +184 -174
  123. package/src/pb-version.js +30 -30
  124. package/src/pb-view-annotate.js +132 -98
  125. package/src/pb-view.js +1289 -1270
  126. package/src/pb-zoom.js +75 -59
  127. package/src/polymer-hack.js +1 -1
  128. package/src/search-result-service.js +256 -223
  129. package/src/seed-element.js +13 -20
  130. package/src/settings.js +4 -4
  131. package/src/theming.js +96 -96
  132. package/src/urls.js +289 -289
  133. package/src/utils.js +53 -51
@@ -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 '@cwmr/paper-autocomplete/paper-autocomplete';
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 "./pb-i18n.js";
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
- static get styles() {
25
- return css`
26
- :host {
27
- display: block;
28
- }
29
- .wrapper{
30
- display:grid;
31
- grid-template-columns:150px auto 50px 50px;
32
- grid-column-gap:20px;
33
- grid-row-gap:20px;
34
- margin-bottom:10px;
35
- }
36
- paper-dropdown-menu{
37
- align-self:start;
38
- }
39
- paper-icon-button, paper-checkbox {
40
- align-self: center;
41
- margin-top: 16px;
42
- }
43
-
44
- .editor label {
45
- margin-bottom:5px;
46
- font-size: 12px;
47
- font-weight: 400;
48
- color: var(--paper-grey-500);
49
- }
50
- `;
51
- }
52
-
53
- render() {
54
- return html`
55
- <div class="wrapper">
56
-
57
- <paper-autocomplete id="combo" text="${this.name}" placeholder="${translate('odd.editor.model.param-name-placeholder')}" label="Name"
58
- .source="${this._currentParameters}"></paper-autocomplete>
59
-
60
- <div class="editor">
61
- <label>Parameter</label>
62
- <jinn-codemirror id="editor"
63
- mode="xquery"
64
- code="${this.value}"
65
- linter="${this.endpoint}/${cmpVersion(this.apiVersion, '1.0.0') ? 'modules/editor.xql' : 'api/lint'}"></jinn-codemirror>
66
- </div>
67
- <paper-checkbox id="set" ?checked="${this.setParam}" @change="${this._handleCodeChange}">${translate('odd.editor.model.set-param')}</paper-checkbox>
68
- <paper-icon-button @click="${this._delete}" icon="delete" title="delete this parameter"></paper-icon-button>
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
- static get properties() {
77
- return {
78
- /**
79
- * the parameter name
80
- */
81
- name: {
82
- type: String,
83
- reflect: true
84
- },
85
- /**
86
- * the parameter value
87
- */
88
- value: {
89
- type: String,
90
- reflect: true
91
- },
92
- behaviour: {
93
- type: String
94
- },
95
- parameters: {
96
- type: Object
97
- },
98
- setParam: {
99
- type: Boolean,
100
- attribute: 'set'
101
- },
102
- _currentParameters: {
103
- type: Array
104
- },
105
- endpoint: {
106
- type: String
107
- },
108
- apiVersion: {
109
- type: String
110
- }
111
-
112
- };
113
- }
114
-
115
- constructor() {
116
- super();
117
- this.name = '';
118
- this.value = '';
119
- this.setParam = false;
120
- this.behaviour = '';
121
- this.currentParameters = [];
122
- this.parameters = {
123
- '': [],
124
- alternate: ["default", "alternate", "persistent"],
125
- anchor: ["content", "id"],
126
- block: ["content"],
127
- body: ["content"],
128
- break: ["content", "type", "label"],
129
- cell: ["content"],
130
- cit: ["content", "source"],
131
- "document": ["content"],
132
- figure: ["content", "title"],
133
- graphic: ["content", "url", "width", "height", "scale", "title"],
134
- heading: ["content", "level"],
135
- inline: ["content"],
136
- link: ["content", "uri", "target"],
137
- list: ["content", "type"],
138
- listItem: ["content", "n"],
139
- metadata: ["content"],
140
- note: ["content", "place", "label"],
141
- omit: [],
142
- paragraph: ["content"],
143
- row: ["content"],
144
- section: ["content"],
145
- table: ["content"],
146
- text: ["content"],
147
- title: ["content"],
148
- webcomponent: ["content", "name"]
149
- };
150
-
151
- this.selected = '';
152
- this.endpoint = '';
153
-
154
- }
155
-
156
- connectedCallback() {
157
- super.connectedCallback();
158
- this.value = this.value.trim();
159
- this.dispatchEvent(new CustomEvent('parameter-connected', { composed: true, bubbles: true, detail: { target: this } }));
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
- attributeChangedCallback(name, old, value) {
163
- super.attributeChangedCallback(name, old, value);
164
- if (name === 'behaviour') {
165
- this._currentParameters = this.parameters[value];
166
- }
167
- }
168
-
169
- firstUpdated(changedProperties) {
170
- // console.log('parameters firstupdated ', changedProperties);
171
- this.selected = this.parameters[this.behaviour] || [];
172
- this.requestUpdate();
173
-
174
- this.shadowRoot.getElementById('combo').addEventListener('focused-changed', this._handleCodeChange.bind(this));
175
- this.shadowRoot.getElementById('editor').addEventListener('update', this._handleCodeChange.bind(this));
176
- }
177
-
178
- refreshEditor() {
179
- // console.log('parameters refresh');
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
- _delete(ev) {
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
- _handleCodeChange(e) {
202
- console.log('_handleCodeChange ', e);
203
- this.value = this.shadowRoot.getElementById('editor').content || '';
204
- console.log('value %s', this.value);
205
- this.name = this.shadowRoot.getElementById('combo').text;
206
- this.setParam = this.shadowRoot.getElementById('set').checked;
207
- this.dispatchEvent(new CustomEvent('parameter-changed', { composed: true, bubbles: true, detail: { name: this.name, value: this.value, set: this.setParam } }));
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);