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