@teipublisher/pb-components 3.2.1 → 3.2.3

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.
@@ -308,7 +308,27 @@
308
308
  "incomplete": "marked same type but without key",
309
309
  "unmarked": "unmarked occurrence in text",
310
310
  "open-in-tab": "Open document in new tab to review"
311
- }
311
+ },
312
+ "other-occ1": "Found matches in",
313
+ "other-occ2": "other documents",
314
+ "loading": "Loading ",
315
+ "loading-failed": "Failed to load",
316
+ "not-found": "Not found",
317
+ "user": "User",
318
+ "rev-desc": "Revision Description",
319
+ "change-summary": "Change summary",
320
+ "change-placeholder": "Optional short description",
321
+ "status": "Status",
322
+ "enrichment": "Enrichment",
323
+ "details": "Annotation Details",
324
+ "hi-bold": "bold",
325
+ "hi-i": "italic",
326
+ "markup": "Inline text/markup or sequence of paragraphs",
327
+ "select": "Select element around current cursor position",
328
+ "enclose": "Enclose selection in new element",
329
+ "enclose-remove": "Remove enclosing tags",
330
+ "insert-place": "Insert placeName",
331
+ "insert-person": "Insert persName"
312
332
  },
313
333
  "ner": {
314
334
  "title": "Train a Named Entity Recognition Model",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teipublisher/pb-components",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "Collection of webcomponents underlying TEI Publisher",
5
5
  "repository": "https://github.com/eeditiones/tei-publisher-components.git",
6
6
  "main": "index.html",
@@ -111,6 +111,7 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
111
111
  this._columns = [];
112
112
  this._selectedRow = null;
113
113
  this._gridI18nInitialized = false;
114
+ this._visibilityApplyFrame = null;
114
115
  this._onTableClick = this._onTableClick.bind(this);
115
116
  this._onDocumentClick = this._onDocumentClick.bind(this);
116
117
  }
@@ -181,6 +182,10 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
181
182
  }
182
183
 
183
184
  disconnectedCallback() {
185
+ if (this._visibilityApplyFrame !== null) {
186
+ cancelAnimationFrame(this._visibilityApplyFrame);
187
+ this._visibilityApplyFrame = null;
188
+ }
184
189
  document.removeEventListener('click', this._onDocumentClick);
185
190
  super.disconnectedCallback();
186
191
  }
@@ -255,16 +260,16 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
255
260
 
256
261
  this.grid = new Grid(config);
257
262
  this._applyPaginationPosition();
258
- this.grid.on('load', () => {
263
+ this.grid.on('ready', () => {
259
264
  this._clearRowSelection();
260
265
  if (this.paginationTop) {
261
- // `forceRender()` can reset GridJS plugin state; re-apply after each load.
266
+ // `forceRender()` can reset GridJS plugin state; re-apply after each ready event.
262
267
  this.grid.plugin.get('pagination').position = PluginPosition.Header;
263
268
  }
264
269
  this.emitTo('pb-results-received', {
265
270
  params: this._params,
266
271
  });
267
- this._applyColumnVisibilityToDom();
272
+ this._scheduleColumnVisibilityReapply();
268
273
  });
269
274
 
270
275
  this.grid.render(table);
@@ -311,6 +316,16 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
311
316
  });
312
317
  }
313
318
 
319
+ _scheduleColumnVisibilityReapply() {
320
+ if (this._visibilityApplyFrame !== null) {
321
+ cancelAnimationFrame(this._visibilityApplyFrame);
322
+ }
323
+ this._visibilityApplyFrame = requestAnimationFrame(() => {
324
+ this._visibilityApplyFrame = null;
325
+ this._applyColumnVisibilityToDom();
326
+ });
327
+ }
328
+
314
329
  _onTableClick(event) {
315
330
  const row = event.target.closest('tbody tr');
316
331
  if (!row) {