From bc21948ea6e56435b92c5c5335b43bf76096316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Lehe=C4=8Dka?= Date: Fri, 1 Sep 2023 16:16:32 +0200 Subject: [PATCH 01/40] rendition of disabled navigation control --- src/pb-navigation.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/pb-navigation.js b/src/pb-navigation.js index c1f5f097..6283333b 100644 --- a/src/pb-navigation.js +++ b/src/pb-navigation.js @@ -27,6 +27,16 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) { */ keyboard: { type: String + }, + /** + * Rendition of the navigation element if it's disabled + * Possible values: + * - hidden (default if not set; control is removed from the document layout) + * - invisible (controll is hidden, but keeped in the document layout) + * - visible (control is visible) + */ + rendition : { + type: String } }; } @@ -79,13 +89,20 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) { static get styles() { return css` - :host { - display: inline; - } - :host([disabled]) { - display: none; - } - `; + :host { + display: inline; + } + :host([disabled]):host(:not([rendition])), :host([disabled]):host([rendition="hidden"]) { + display: none; + } + :host([disabled]):host([rendition="invisible"]) { + visibility: hidden; + } + :host([disabled]):host([rendition="visible"]) { + visibility: visible; + cursor: not-allowed; + } + `; } } From 4834fbd3fc8832f6b70cec3b9e69c7221669c4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Lehe=C4=8Dka?= Date: Tue, 19 Sep 2023 23:04:00 +0200 Subject: [PATCH 02/40] change the content if the code property is changed --- src/pb-code-highlight.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pb-code-highlight.js b/src/pb-code-highlight.js index 231aa2d1..967868ae 100644 --- a/src/pb-code-highlight.js +++ b/src/pb-code-highlight.js @@ -51,6 +51,7 @@ export class PbCodeHighlight extends themableMixin(LitElement) { * The code to be highlighted as a string. If not set, * this will be populated from either a template child element * or the element's text content. + * The value of the property can be changed programmatically from JavaScript. */ code: { type: String @@ -118,6 +119,14 @@ export class PbCodeHighlight extends themableMixin(LitElement) { updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('code')) { + //if the code property is changed, the content of the element is replaced + const pre = this.shadowRoot.getElementById("pb-code-highlight"); + if(pre != null) { + const code = document.createElement("code"); + code.textContent = this.code; //textContent property keeps new lines in the code + pre.replaceChildren(code); + + } this.highlight(); } } @@ -130,7 +139,7 @@ export class PbCodeHighlight extends themableMixin(LitElement) { if (this.code) { return html` ${this._themeStyles} -
${this.code}
+
${this.code}
`; } return html`
`; From 73cf4be4171414479534e7c1f3bc56c870abfb17 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Mon, 23 Oct 2023 10:13:48 +0200 Subject: [PATCH 03/40] fix(pb-combo-box): drop change listener as this is leading to display issues --- src/pb-combo-box.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pb-combo-box.js b/src/pb-combo-box.js index d11b4629..895f06f0 100644 --- a/src/pb-combo-box.js +++ b/src/pb-combo-box.js @@ -181,7 +181,7 @@ export class PbComboBox extends pbMixin(LitElement) { options.closeAfterSelect = this.closeAfterSelect; options.onBlur = () => this.emitTo(this.onBlur, { value: this.value }); options.onChange = () => this.emitTo(this.onChange, { value: this.value }); - options.plugins = ['change_listener']; + // options.plugins = ['change_listener']; this._select = new TomSelect(input, options); }); From 01af8b8c1b3595b5e215f9afc7ec7a8010fcb246 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 23 Oct 2023 08:18:21 +0000 Subject: [PATCH 04/40] chore(release): 2.12.9 [skip ci] ## [2.12.9](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.8...v2.12.9) (2023-10-23) ### Bug Fixes * **pb-combo-box:** drop change listener as this is leading to display issues ([73cf4be](https://github.com/eeditiones/tei-publisher-components/commit/73cf4be4171414479534e7c1f3bc56c870abfb17)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1176eeb3..25d464b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.12.9](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.8...v2.12.9) (2023-10-23) + + +### Bug Fixes + +* **pb-combo-box:** drop change listener as this is leading to display issues ([73cf4be](https://github.com/eeditiones/tei-publisher-components/commit/73cf4be4171414479534e7c1f3bc56c870abfb17)) + ## [2.12.8](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.7...v2.12.8) (2023-10-22) diff --git a/package-lock.json b/package-lock.json index 2f3d3d67..9c3fe538 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.8", + "version": "2.12.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.12.8", + "version": "2.12.9", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index b30aa291..759d844d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.8", + "version": "2.12.9", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From a9b7b8f08fa61d55ea61f409ebdd7fbcf93acf40 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Mon, 23 Oct 2023 11:59:38 +0200 Subject: [PATCH 05/40] fix(pb-load): add property 'plain' to prevent pb-load injecting internal parameters like 'start' or 'language' --- src/pb-load.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/pb-load.js b/src/pb-load.js index b618dd64..43e84fb9 100644 --- a/src/pb-load.js +++ b/src/pb-load.js @@ -120,6 +120,13 @@ export class PbLoad extends pbMixin(LitElement) { */ silent: { type: Boolean + }, + /** + * Do not add internal parameters like 'start' or 'language' to the URL + * but leave it untouched. + */ + plain: { + type: Boolean } }; } @@ -300,19 +307,20 @@ export class PbLoad extends pbMixin(LitElement) { } const doc = this.getDocument(); - if (doc) { - params.doc = doc.path; - } + if (!this.plain) { + if (doc) { + params.doc = doc.path; + } - // set start parameter to start property, but only if not provided otherwise already - if (this.start && !params.start) { - params.start = this.start; - } + // set start parameter to start property, but only if not provided otherwise already + if (this.start && !params.start) { + params.start = this.start; + } - if (this.language) { - params.language = this.language; + if (this.language) { + params.language = this.language; + } } - params = this.prepareParameters(params); // filter null values From 34193aed4b3c8a391951cfbe768d2f0e4548e5fc Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 23 Oct 2023 10:05:27 +0000 Subject: [PATCH 06/40] chore(release): 2.12.10 [skip ci] ## [2.12.10](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.9...v2.12.10) (2023-10-23) ### Bug Fixes * **pb-load:** add property 'plain' to prevent pb-load injecting internal parameters like 'start' or 'language' ([a9b7b8f](https://github.com/eeditiones/tei-publisher-components/commit/a9b7b8f08fa61d55ea61f409ebdd7fbcf93acf40)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25d464b9..453969b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.12.10](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.9...v2.12.10) (2023-10-23) + + +### Bug Fixes + +* **pb-load:** add property 'plain' to prevent pb-load injecting internal parameters like 'start' or 'language' ([a9b7b8f](https://github.com/eeditiones/tei-publisher-components/commit/a9b7b8f08fa61d55ea61f409ebdd7fbcf93acf40)) + ## [2.12.9](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.8...v2.12.9) (2023-10-23) diff --git a/package-lock.json b/package-lock.json index 9c3fe538..6e276110 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.9", + "version": "2.12.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.12.9", + "version": "2.12.10", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 759d844d..10c1c664 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.9", + "version": "2.12.10", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From fdd1699a39540d42a793f893cb8fe70757d8e166 Mon Sep 17 00:00:00 2001 From: Joern Turner Date: Tue, 24 Oct 2023 11:47:51 +0200 Subject: [PATCH 07/40] * adding a slot to inject some custom form markup * refactoring table to ul * using link instead of add icon * pb-selection-changed event also gives plain selection string instead of range object --- src/pb-authority-lookup.js | 75 +++++++++++++++++++++++++++----------- src/pb-view-annotate.js | 30 +++++++-------- 2 files changed, 69 insertions(+), 36 deletions(-) diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index fc3e83d8..e9ce399c 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -85,10 +85,11 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { > +
- +
    ${this._results.map(item => this._formatItem(item))} -
+
`; } @@ -112,29 +113,38 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { _formatItem(item) { return html` - - - - - -
+
  • +
    + +
    + + ${item.occurrences > 0 ? html`
    ${item.occurrences}
    ` : null} + ${item.provider ? html`
    ${item.provider}
    ` :null} +
    ${item.register}
    + + +
    + +
    ${item.details ? html`
    ${item.details}
    ` : null} - - ${item.occurrences > 0 ? html`${item.occurrences}` : null} - ${item.provider ? html`
    ${item.provider}
    ` : null} - ${item.register} - + +
  • `; } + _select(item) { const connector = this._authorities[item.register]; if (connector) { @@ -214,6 +224,11 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { :host { display: flex; flex-direction: column; + justify-content: space-between; + } + + .link { + flex-grow: 2; } #output { overflow: auto; @@ -221,13 +236,30 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { scrollbar-width: none; } - #output table { + /* + #output .icons{ + visibility: hidden; + } + #output .icons:hover{ + visibility: visible; + } + */ + + #output ul { width: 100%; + padding: 0; + list-style: none; } - #output td { - vertical-align: top; - padding-bottom: 8px; + #output li { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; + border-bottom: 1px solid #efefef; } + #output li:hover{ + background:#efefef; + } #output td:nth-child(3), #output td:nth-child(4), #output td:nth-child(5) { text-align: right; vertical-align: middle; @@ -235,6 +267,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { .details, .source, .register, .occurrences { font-size: .85rem; + width: 100%; } .source, .register, .occurrences { @@ -255,4 +288,4 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { `; } } -customElements.define('pb-authority-lookup', PbAuthorityLookup); \ No newline at end of file +customElements.define('pb-authority-lookup', PbAuthorityLookup); diff --git a/src/pb-view-annotate.js b/src/pb-view-annotate.js index b0fc89fc..253d4958 100644 --- a/src/pb-view-annotate.js +++ b/src/pb-view-annotate.js @@ -9,7 +9,7 @@ import { get as i18n } from './pb-i18n.js'; /** * Return the first child of ancestor which contains current. * Used to adjust nested anchor points. - * + * * @param {Node} current the anchor node * @param {Node} ancestor the context ancestor node * @returns {Node} first child of ancestor containing current @@ -25,7 +25,7 @@ function extendRange(current, ancestor) { /** * Check if the nodeToCheck should be ignored when computing offsets. * Applies e.g. to footnote markers. - * + * * @param {Node} nodeToCheck the node to check * @returns true if node should be ignored */ @@ -108,7 +108,7 @@ function ancestors(node, selector) { /** * Find the next text node after the current node. * Descends into elements. - * + * * @param {Node} node the current node * @returns next text node or the current node if none is found */ @@ -210,11 +210,11 @@ function clearProperties(teiRange) { * An extended `PbView`, which supports annotations to be added * and edited by the user. Handles mouse selection and keeps track * of the annotations made. - * + * * Interaction with the actual editing form is entirely done via events. * The class itself does not provide any editing facility, except for * handling deletions. - * + * * @fires pb-annotations-loaded - fired after text was loaded and annotations were drawn * @fires pb-selection-changed - fired when user selects text * @fires pb-annotations-changed - fired when an annotation was added or changed @@ -227,7 +227,7 @@ class PbViewAnnotate extends PbView { * Configures the default annotation property containing the key for authority entries. * Default: 'ref', corresponding to TEI attribute @ref. Change to 'corresp' or 'key' when * using those attributes instead. - * + * * You can also define a custom mapping of annotation types to key properties, e.g. if you would * like to use @key for some elements, but @corresp for others. */ @@ -325,7 +325,7 @@ class PbViewAnnotate extends PbView { this._clearMarkers(); this.emitTo('pb-annotations-changed', { ranges: this._ranges, refresh: true }); }); - + this._resizeHandler(); } @@ -385,7 +385,7 @@ class PbViewAnnotate extends PbView { super.zoom(direction); window.requestAnimationFrame(() => this.refreshMarkers()); } - + getKey(type) { return this.keyMap[type] || this.key; } @@ -501,7 +501,7 @@ class PbViewAnnotate extends PbView { } updateAnnotations(silent = false) { - this._ranges.forEach((teiRange) => { + this._ranges.forEach((teiRange) => { let span; switch (teiRange.type) { case 'delete': @@ -522,7 +522,7 @@ class PbViewAnnotate extends PbView { break; default: this._updateAnnotation(teiRange, silent, true); - break; + break; } }); window.requestAnimationFrame(() => this.refreshMarkers()); @@ -563,8 +563,7 @@ class PbViewAnnotate extends PbView { this.inHandler = false; }, 100); } - - this.emitTo('pb-selection-changed', { hasContent: true, range }); + this.emitTo('pb-selection-changed', { hasContent: true, range, selected: selection.toString()}); } else { this.emitTo('pb-selection-changed', { hasContent: false }); } @@ -749,7 +748,8 @@ class PbViewAnnotate extends PbView { editBtn.setAttribute('title', i18n('annotations.edit')); editBtn.addEventListener('click', () => { const data = JSON.parse(span.dataset.annotation); - this.emitTo('pb-annotation-edit', Object.assign({}, { target: span, type: span.dataset.type, properties: data })); + const text = span.textContent; + this.emitTo('pb-annotation-edit', Object.assign({}, { target: span, type: span.dataset.type, properties: data, text })); }); div.appendChild(editBtn); } @@ -794,7 +794,7 @@ class PbViewAnnotate extends PbView { typeInd.style.backgroundColor = `var(--pb-annotation-${type})`; typeInd.style.color = `var(${color && color.isLight ? '--pb-color-primary' : '--pb-color-inverse'})`; if (data[this.getKey(type)]) { - this.emitTo('pb-annotation-detail', { + this.emitTo ('pb-annotation-detail', { type, id: data[this.getKey(type)], container: info, @@ -1136,4 +1136,4 @@ class PbViewAnnotate extends PbView { } }; -customElements.define('pb-view-annotate', PbViewAnnotate); \ No newline at end of file +customElements.define('pb-view-annotate', PbViewAnnotate); From 124017238557f1d6bfe93c6a4da91e6caece6f31 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Tue, 24 Oct 2023 15:32:51 +0200 Subject: [PATCH 08/40] feat(pb-authority-lookup): custom connector can now have an edit button (used by future versions of annotation tool) --- src/authority/custom.js | 5 +++++ src/authority/registry.js | 4 ++++ src/pb-authority-lookup.js | 20 +++++++++++--------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/authority/custom.js b/src/authority/custom.js index ca8cd77d..b7d69c70 100644 --- a/src/authority/custom.js +++ b/src/authority/custom.js @@ -6,6 +6,7 @@ export class Custom extends Registry { constructor(endpoint, configElem) { super(configElem); + this._editable = configElem.hasAttribute('edit'); this._endpoint = endpoint; this._connectors = createConnectors(endpoint, configElem); this._connectors.forEach((connector) => { @@ -18,6 +19,10 @@ export class Custom extends Registry { ); } + get editable() { + return this._editable; + } + async query(key) { return new Promise(resolve => { fetch( diff --git a/src/authority/registry.js b/src/authority/registry.js index 804a410e..d8ab7096 100644 --- a/src/authority/registry.js +++ b/src/authority/registry.js @@ -30,6 +30,10 @@ export class Registry { this._register = name; } + get editable() { + return false; + } + /** * Query the authority and return a RegistryResult. * diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index e9ce399c..07f79224 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -101,7 +101,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { return Promise.resolve(); } const authority = this._authorities[register]; - console.log(' Retrieving info for %s from %s', id, register); + console.log(' Retrieving info for %s from %s using %s', id, register, authority.name); let info = await authority.info(id, container); if (info.strings) { info = Object.assign(info, { @@ -131,14 +131,16 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { ${item.provider ? html`
    ${item.provider}
    ` :null}
    ${item.register}
    - -
    - -
    - ${item.details ? html`
    ${item.details}
    ` : null} + ${ + this._authorities[this.type].editable ? + html`
    + +
    ` : null + } + ${item.details ? html`
    ${item.details}
    ` : null} `; From edb590d6df8e25b4223818c9baadeeb87efaaa60 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 24 Oct 2023 13:37:15 +0000 Subject: [PATCH 09/40] chore(release): 2.13.0 [skip ci] # [2.13.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.10...v2.13.0) (2023-10-24) ### Features * **pb-authority-lookup:** custom connector can now have an edit button (used by future versions of annotation tool) ([1240172](https://github.com/eeditiones/tei-publisher-components/commit/124017238557f1d6bfe93c6a4da91e6caece6f31)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 453969b2..8a8b707e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.13.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.10...v2.13.0) (2023-10-24) + + +### Features + +* **pb-authority-lookup:** custom connector can now have an edit button (used by future versions of annotation tool) ([1240172](https://github.com/eeditiones/tei-publisher-components/commit/124017238557f1d6bfe93c6a4da91e6caece6f31)) + ## [2.12.10](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.9...v2.12.10) (2023-10-23) diff --git a/package-lock.json b/package-lock.json index 6e276110..98923599 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.10", + "version": "2.13.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.12.10", + "version": "2.13.0", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 10c1c664..28032260 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.12.10", + "version": "2.13.0", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 427ac63039cd9b572a0d2a57306964cb02bf7d45 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Tue, 24 Oct 2023 19:15:05 +0200 Subject: [PATCH 10/40] fix(pb-authority-lookup): fix issue with authority entry list display --- src/pb-authority-lookup.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index 07f79224..80815874 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -226,7 +226,6 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { :host { display: flex; flex-direction: column; - justify-content: space-between; } .link { From 7dbe0f249cefb068e3e6756e344628e9a472006e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 24 Oct 2023 17:20:39 +0000 Subject: [PATCH 11/40] chore(release): 2.13.1 [skip ci] ## [2.13.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.0...v2.13.1) (2023-10-24) ### Bug Fixes * **pb-authority-lookup:** fix issue with authority entry list display ([427ac63](https://github.com/eeditiones/tei-publisher-components/commit/427ac63039cd9b572a0d2a57306964cb02bf7d45)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a8b707e..64ced199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.13.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.0...v2.13.1) (2023-10-24) + + +### Bug Fixes + +* **pb-authority-lookup:** fix issue with authority entry list display ([427ac63](https://github.com/eeditiones/tei-publisher-components/commit/427ac63039cd9b572a0d2a57306964cb02bf7d45)) + # [2.13.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.12.10...v2.13.0) (2023-10-24) diff --git a/package-lock.json b/package-lock.json index 98923599..e2336ce5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.0", + "version": "2.13.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.13.0", + "version": "2.13.1", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 28032260..cf76651a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.0", + "version": "2.13.1", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From c4831252602062685b03f3f3fe3f1f51776ddc04 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Thu, 26 Oct 2023 10:56:39 +0200 Subject: [PATCH 12/40] fix(pb-authority-lookup,airtable): avoid javascript console error, report missing record for key --- src/authority/airtable.js | 13 +++---------- src/pb-authority-lookup.js | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/authority/airtable.js b/src/authority/airtable.js index 217c70ff..5e652bdd 100644 --- a/src/authority/airtable.js +++ b/src/authority/airtable.js @@ -115,13 +115,7 @@ export class Airtable extends Registry { info(key, container) { return new Promise((resolve, reject) => { - const options = { - fields: this.fields, - filterByFormula: `RECORD_ID()='${key}'` - }; - this.base(this.table) - .select(options) - .firstPage((err, records) => { + this.base(this.table).find(key, (err, record) => { if (err) { switch (err.statusCode) { case 404: @@ -133,9 +127,8 @@ export class Airtable extends Registry { } return; } - const record = records[0]; if (Object.keys(record.fields).length === 0) { - console.warn(`Retrieved an empty record for %s from table %s`, key, this.table); + reject(`No record found for ${key} in table ${this.table}`); return; } let strings = []; @@ -162,6 +155,6 @@ export class Airtable extends Registry { strings }); }); - }) + }); } } diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index 80815874..9c8287f7 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -101,7 +101,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { return Promise.resolve(); } const authority = this._authorities[register]; - console.log(' Retrieving info for %s from %s using %s', id, register, authority.name); + console.log(' Retrieving info for %s from %s using %s', id, register, authority.constructor.name); let info = await authority.info(id, container); if (info.strings) { info = Object.assign(info, { From 94dd860c2c26d48bd6ea465778e1d0e3ebda3a55 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 26 Oct 2023 09:02:58 +0000 Subject: [PATCH 13/40] chore(release): 2.13.2 [skip ci] ## [2.13.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.1...v2.13.2) (2023-10-26) ### Bug Fixes * **pb-authority-lookup,airtable:** avoid javascript console error, report missing record for key ([c483125](https://github.com/eeditiones/tei-publisher-components/commit/c4831252602062685b03f3f3fe3f1f51776ddc04)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ced199..d29d0f23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.13.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.1...v2.13.2) (2023-10-26) + + +### Bug Fixes + +* **pb-authority-lookup,airtable:** avoid javascript console error, report missing record for key ([c483125](https://github.com/eeditiones/tei-publisher-components/commit/c4831252602062685b03f3f3fe3f1f51776ddc04)) + ## [2.13.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.0...v2.13.1) (2023-10-24) diff --git a/package-lock.json b/package-lock.json index e2336ce5..131a1f9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.1", + "version": "2.13.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.13.1", + "version": "2.13.2", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index cf76651a..18415771 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.1", + "version": "2.13.2", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 4c231ab9dbdfcbed6429480d637dc676cb7b8aa1 Mon Sep 17 00:00:00 2001 From: helenasabel Date: Mon, 30 Oct 2023 16:02:57 +0100 Subject: [PATCH 14/40] feat(i18n): adds missing translations in spanish --- i18n/common/es.json | 73 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/i18n/common/es.json b/i18n/common/es.json index 4f249d22..e0ff23e9 100644 --- a/i18n/common/es.json +++ b/i18n/common/es.json @@ -28,7 +28,7 @@ "no": "No", "serverError": "La solicitud al servidor ha fallado.", "generatingFile": "Generando el archivo...", - "downloadMessage": "Generar el archivo para su descarga puede tardar algunos minutos. Espere, por favor. Este mensaje debería cerrarse automáticamente cuando la descarga esté completa.", + "downloadMessage": "Generar el archivo para su descarga puede tardar algunos minutos. Espera, por favor. Este mensaje debería cerrarse automáticamente cuando la descarga esté completa.", "loading": "Cargando ..." }, "document": { @@ -37,16 +37,19 @@ "selectTemplate": "Seleccionar Plantilla", "selectFeature": "Seleccionar una característica", "normalized": "Vista normalizada", - "plain": "Vista de lectura sencilla", + "plain": "Vista de lectura simple", "view-type": "Ver por páginas", "add-panel": "Añadir Vista", "caveat-heading": "Cuidado", "settings": "Configuración", - "caveat": "Experimenta con diferentes plantillas y ODDs cambiando las opciones aquí. Por favor, ten en cuenta que no todas las combinaciones de configuración tienen sentido para todos los documentos. Por ejemplo, un mapa no puede ser producido sin marcar ni procesar las coordenadas explícitamente, y la vista de página asume que se han marcado los saltos de página. Si ves el mensaje \"el servidor no devolvió ningún contenido\", generalmente es señal de una desalineacion entre los datos codificados, la ODD y la plantilla." + "caveat": "Experimenta con diferentes plantillas y ODDs cambiando las opciones aquí. Por favor, ten en cuenta que no todas las combinaciones de configuración tienen sentido para todos los documentos. Por ejemplo, un mapa no puede ser producido sin marcar ni procesar las coordenadas explícitamente, y la vista de página asume que se han marcado los saltos de página. Si ves el mensaje \"el servidor no devolvió ningún contenido\", generalmente es señal de una desalineación entre los datos codificados, la ODD y la plantilla." }, "browse": { - "description": "Utiliza esta aplicación para experimentar y probar varios ODDs redactados a partir de diferentes instrucciones del modelo de procesamiento. Carga tus propios archivos y crea un ODD personalizado.", + "description": "Utiliza esta aplicación para experimentar y probar varios ODDs creados a partir de diferentes instrucciones del modelo de procesamiento. Carga tus propios archivos y crea un ODD personalizado.", "login": "para subir archivos o ver funciones administrativas (usuario predeterminado: 'tei-demo', contraseña: 'demo').", + "login-1": "Inicia sesión como ", + "login-2": "con contraseña", + "login-3": "para experimentar con tus propios archivos y ODDs", "sort": "Ordenar por", "filter": "Filtrar por", "filterPlaceholder": "Filtro", @@ -60,6 +63,9 @@ "confirmDeletion": "¿Seguro que quieres eliminar el archivo?", "confirmDeletion_plural": "¿Seguro que quieres eliminar {{count}} archivos?", "documents": "Documentos", + "documents-removed":"Documentos eliminados", + "document-not-found":"Documento no encontrado", + "document-remove-failed":"No se ha podido eliminar el documento", "collections": "Colección local", "dts": "Servicios de texto distribuidos (versión experimental)", "test": { @@ -75,9 +81,13 @@ "description": "Documentación (en Docbook XML)." }, "markdown": { - "title": "Muestra en Markdown", + "title": "Ejemplo en Markdown", "description": "Un ejemplo de uso de Markdown para generar contenido estático." }, + "annotate": { + "title": "Ejemplos de anotación", + "description": "Otro espacio de pruebas para anotar documentos." + }, "up": "Ir a la carpeta anterior" }, "upload": { @@ -109,13 +119,14 @@ "search": { "search": "Buscar", "reset": "Reestablecer", - "placeholder": "Escribe el término a buscar", + "placeholder": "Escribe el término de búsqueda", "sections": "Buscar en secciones", "headings": "Buscar en títulos" }, "dts": { "endpoint": "Seleccionar punto final", - "note": "Experimental: acceder a otras ediciones que exponen la API DTS" + "note": "Experimental: acceder a otras ediciones que exponen la API DTS", + "requires-login":"Es necesario iniciar sesión" }, "odd": { "files": "Archivos ODD", @@ -134,6 +145,9 @@ "save": "Guardar", "saving": "Guardando...", "saved": "Guardado", + "unsaved": "Hay cambios no guardados que se incluirán en la exportación. ¿Continuar de todos modos?", + "download": "Descargar ODD", + "save-as": "Guardar ODD en un directorio", "denied": "Permiso denegado", "denied-message": "No tienes permiso para guardar {{odd}}", "reload": "Volver a cargar", @@ -162,7 +176,8 @@ "custom-behaviour-placeholder": "[Behaviour personalizado]", "template-placeholder": "[Definir plantilla de código para aplicar al contenido]", "param-name-placeholder": "[Nombre del parámetro]", - "empty": "[Vacío]" + "empty": "[Vacío]", + "mode-placeholder": "[Modo de procesamiento: se pasa a los modelos siguientes]" }, "css-source": "Abrir fichero CSS" } @@ -186,13 +201,13 @@ "index-text": "Crear por texto" }, "view": { - "help": "Elija lo que se muestra por defecto al navegar por el texto: vista por páginas o por divisiones completas. La vista por página exige que el TEI XML esté correctamente marcado con etiquetas <tei:pb>.", + "help": "Elige lo que se muestra por defecto al navegar por el texto: vista por páginas o por divisiones completas. La vista por página exige que el TEI XML esté correctamente marcado con etiquetas <tei:pb>.", "div": "Por divisiones (capítulo/sección...)", "page": "Por páginas" }, "label": "Vista predeterminada", "template": { - "help": "Elija la plantilla HTML a utilizar por defecto", + "help": "Elige la plantilla HTML que se utilizará por defecto", "label": "Plantilla HTML" }, "title": { @@ -239,11 +254,45 @@ "reload": "Recargar fuente TEI", "preview": "Vista previa de los resultados de la fusión", "confirm-restore-title": "Confirmar restauración", - "restore": "Se han encontrado anotaciones hechas en este documento en una sesión anterior. ¿Quieres recargarlas?", + "restore": "Se han encontrado anotaciones en este documento hechas en una sesión anterior. ¿Quieres recargarlas?", "confirm-reload-title": "Confirmar recarga", "confirm-reload": "¿Descartar las anotaciones actuales y recargar la fuente?", "modify": "Aplicar edición al texto base", "modify-info": "Nota: esto no es una anotación, pero modificará el texto base cuando se fusione.", - "permission": "Permiso denegado: no tiene permiso para guardar anotaciones." + "permission": "Permiso denegado: no tienes permiso para guardar anotaciones.", + "ner": { + "title": "Extracción de entidades nombradas", + "description": "Intenta encontrar automáticamente entidades nombradas en el texto y marcarlas como anotaciones.", + "run": "Ejecutar", + "model": "Selecciona un modelo", + "denied": "Se han encontrado cambios no guardados: por favor, guárdalos o descártalos antes." + }, + "confirm-discard-title": "Descartar", + "confirm-discard": "¿Descartar la lista de ocurrencias?", + "doc-count": "{{count}} de {{total}}" + }, + "ner": { + "title": "Entrena un modelo de reconocimiento de entidades nombradas (NER)", + "not-found": "Esta función requiere que el servicio TEI Publisher NER esté en funcionamiento. No se ha podido contactar con el servicio.", + "found": "Se ha encontrado TEI Publisher NER con la versión spaCy", + "name-placeholder": "Nombre del modelo a crear", + "name": "Nombre", + "path": "Ruta", + "path-placeholder": "Ruta relativa al documento o colección", + "path-info": "Introduce la ruta a un documento o colección que se utilizará como entrada de entrenamiento. Debe ser relativa a la raíz de datos de TEI Publisher.", + "lang-info": "Puedes entrenar un nuevo modelo para una lengua o seleccionar un modelo existente para ampliarlo a continuación. Si no amplías un modelo existente, debes especificar un idioma. En caso contrario, déjalo vacío.", + "language-placeholder": "Lengua para la que se crea el modelo", + "language": "Lengua", + "language-error": "Se requiere una lengua o un modelo base", + "model": "Modelo base", + "model-placeholder": "Modelo base para ampliar o copiar", + "vectors": "Solo copiar vectores del modelo base", + "output": "Resultado del entrenamiento", + "prepare": "Datos de entrenamiento en preparación", + "start": "Ejecutar" + }, + "timeline": { + "unknown": "sin fecha", + "clear": "Borrar selección de fecha" } } From 0f702aeabdd81e152503a410b048e7dc15af3229 Mon Sep 17 00:00:00 2001 From: helenasabel Date: Mon, 30 Oct 2023 16:03:07 +0100 Subject: [PATCH 15/40] fix(i18n): corrects preposition --- i18n/common/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/common/en.json b/i18n/common/en.json index 0c94bab8..2b4d710e 100644 --- a/i18n/common/en.json +++ b/i18n/common/en.json @@ -276,7 +276,7 @@ }, "confirm-discard-title": "Discard", "confirm-discard": "Discard the list of occurrences?", - "doc-count": "{{count}} von {{total}}" + "doc-count": "{{count}} out of {{total}}" }, "ner": { "title": "Train a Named Entity Recognition Model", From 18ee22805550e5f663b89c7a1c4d51442e36cde3 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Fri, 3 Nov 2023 12:04:29 +0100 Subject: [PATCH 16/40] feat(pb-toggle-feature): add attribute "global": if set, toggles any matching selectors below the surrounding pb-page (i.e. not just in connected pb-view/pb-load) --- src/pb-toggle-feature.js | 42 +++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/src/pb-toggle-feature.js b/src/pb-toggle-feature.js index 1a4c98e2..5484098f 100644 --- a/src/pb-toggle-feature.js +++ b/src/pb-toggle-feature.js @@ -1,6 +1,6 @@ import { LitElement, html } from 'lit-element'; import '@polymer/paper-checkbox'; -import { pbMixin } from './pb-mixin.js'; +import { pbMixin, waitOnce } from './pb-mixin.js'; import { registry } from "./urls.js"; /** @@ -85,6 +85,7 @@ import { registry } from "./urls.js"; * ``` * * @fires pb-toggle - Fired when the feature is toggled, it's changing properties between values of its `on` and `off` state + * @fires pb-global-toggle - Fired if property `global` is set. Will be caught by the surrounding `pb-page` * @fires pb-update - When received, sets the features passed from the event */ export class PbToggleFeature extends pbMixin(LitElement) { @@ -160,6 +161,14 @@ export class PbToggleFeature extends pbMixin(LitElement) { initFromView: { type: Boolean, attribute: 'init-from-view' + }, + /** + * If set, toggle the state of elements which reside + * in the surrounding HTML context below `pb-page` + * (means: elements which are not inside a `pb-view` or `pb-load`). + */ + global: { + type: Boolean } }; } @@ -173,6 +182,7 @@ export class PbToggleFeature extends pbMixin(LitElement) { this.propertiesOn = {}; this.propertiesOff = {}; this.initFromView = false; + this.global = false; } render() { @@ -196,7 +206,18 @@ export class PbToggleFeature extends pbMixin(LitElement) { newState[this.name] = this.checked ? this.on : this.off; registry.replace(this, newState); this._saveState(); + this.signalReady(); + + if (this.global) { + waitOnce('pb-page-ready', () => { + this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: { + selector: this.selector, + command: this.action, + state: this.checked + }, bubbles: true, composed: true })); + }); + } } _setChecked(param) { @@ -225,7 +246,13 @@ export class PbToggleFeature extends pbMixin(LitElement) { this.checked = this.shadowRoot.getElementById('checkbox').checked; this._saveState(); - this.emitTo('pb-toggle', {refresh: !this.selector}); + if (!this.global) { + this.emitTo('pb-toggle', {refresh: !this.selector}); + } else { + const state = {}; + state[this.name] = this.checked ? this.on : this.off; + registry.commit(this, state); + } } _saveState() { @@ -233,12 +260,17 @@ export class PbToggleFeature extends pbMixin(LitElement) { state[this.name] = this.checked ? this.on : this.off; Object.assign(state, this.checked ? this.propertiesOn : this.propertiesOff); if (this.selector) { - state.selectors = state.selectors || []; - addSelector({ + const config = { selector: this.selector, command: this.action, state: this.checked - }, state.selectors); + }; + if (this.global) { + this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true })); + } else { + state.selectors = state.selectors || []; + addSelector(config, state.selectors); + } } } } From 811ff02b91aa461d885933fdba66b6f318e575d4 Mon Sep 17 00:00:00 2001 From: helenasabel Date: Fri, 3 Nov 2023 12:37:23 +0100 Subject: [PATCH 17/40] fix(i18n): minor correction in es translation --- i18n/common/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/common/es.json b/i18n/common/es.json index e0ff23e9..3198a094 100644 --- a/i18n/common/es.json +++ b/i18n/common/es.json @@ -173,7 +173,7 @@ "predicate-placeholder": "[Definir otras condiciones que deben cumplirse (en xquery)]", "link-with-or": "o", "css-class-placeholder": "[Definir nombre de clase CSS (para CSS externo)]", - "custom-behaviour-placeholder": "[Behaviour personalizado]", + "custom-behaviour-placeholder": "[Comportamiento personalizado]", "template-placeholder": "[Definir plantilla de código para aplicar al contenido]", "param-name-placeholder": "[Nombre del parámetro]", "empty": "[Vacío]", From 7d3ff9284f2e9afbf7d381654928bd3371f38060 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Fri, 3 Nov 2023 13:00:57 +0100 Subject: [PATCH 18/40] fix(pb-toggle-feature): if selector specified, emit event on load --- src/pb-toggle-feature.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pb-toggle-feature.js b/src/pb-toggle-feature.js index 5484098f..1fe9d26a 100644 --- a/src/pb-toggle-feature.js +++ b/src/pb-toggle-feature.js @@ -209,15 +209,17 @@ export class PbToggleFeature extends pbMixin(LitElement) { this.signalReady(); - if (this.global) { - waitOnce('pb-page-ready', () => { + waitOnce('pb-page-ready', () => { + if (this.global) { this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: { selector: this.selector, command: this.action, state: this.checked }, bubbles: true, composed: true })); + } else if (this.selector) { + this.emitTo('pb-toggle', {refresh: false}); + } }); - } } _setChecked(param) { From 2a80ce0f362025c6c09c205fddfb0e79c7514711 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Fri, 3 Nov 2023 13:01:52 +0100 Subject: [PATCH 19/40] fix(pb-select-feature): determine initial state on load --- src/pb-select-feature.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pb-select-feature.js b/src/pb-select-feature.js index 0911a801..8595e01a 100644 --- a/src/pb-select-feature.js +++ b/src/pb-select-feature.js @@ -81,7 +81,6 @@ export class PbSelectFeature extends pbMixin(LitElement) { connectedCallback() { super.connectedCallback(); - waitOnce('pb-page-ready', () => { registry.subscribe(this, (state) => { const param = state[this.name]; if (typeof param !== 'undefined') { @@ -99,19 +98,17 @@ export class PbSelectFeature extends pbMixin(LitElement) { this.selected = 0; } - this.shadowRoot.getElementById('list').selected = this.selected; - const newState = {}; newState[this.name] = this.selected; registry.replace(this, newState); this.signalReady(); - }); } firstUpdated() { super.firstUpdated(); + this.shadowRoot.getElementById('list').selected = this.selected; this.shadowRoot.getElementById('menu').addEventListener('iron-select', this._selectionChanged.bind(this)); } @@ -136,6 +133,7 @@ export class PbSelectFeature extends pbMixin(LitElement) { } this.items[current].selectors.forEach((config) => { if (config.global) { + registry.commit(this, state); this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true })); } else { addSelector({ From 60c109220037983a4166cb4b14040c55f6759604 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Fri, 3 Nov 2023 13:02:14 +0100 Subject: [PATCH 20/40] demo: add demo for pb-toggle-feature with global attribute --- demo/pb-toggle-feature4.html | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 demo/pb-toggle-feature4.html diff --git a/demo/pb-toggle-feature4.html b/demo/pb-toggle-feature4.html new file mode 100644 index 00000000..6427890e --- /dev/null +++ b/demo/pb-toggle-feature4.html @@ -0,0 +1,68 @@ + + + + + + + pb-toggle-feature Demo + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8d4dc6860d9d5c11e9f8b4c1a062e463be36075f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 3 Nov 2023 12:07:35 +0000 Subject: [PATCH 21/40] chore(release): 2.14.0 [skip ci] # [2.14.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.2...v2.14.0) (2023-11-03) ### Bug Fixes * **pb-select-feature:** determine initial state on load ([2a80ce0](https://github.com/eeditiones/tei-publisher-components/commit/2a80ce0f362025c6c09c205fddfb0e79c7514711)) * **pb-toggle-feature:** if selector specified, emit event on load ([7d3ff92](https://github.com/eeditiones/tei-publisher-components/commit/7d3ff9284f2e9afbf7d381654928bd3371f38060)) ### Features * **pb-toggle-feature:** add attribute "global": if set, toggles any matching selectors below the surrounding pb-page (i.e. not just in connected pb-view/pb-load) ([18ee228](https://github.com/eeditiones/tei-publisher-components/commit/18ee22805550e5f663b89c7a1c4d51442e36cde3)) --- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d29d0f23..31dfb3cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# [2.14.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.2...v2.14.0) (2023-11-03) + + +### Bug Fixes + +* **pb-select-feature:** determine initial state on load ([2a80ce0](https://github.com/eeditiones/tei-publisher-components/commit/2a80ce0f362025c6c09c205fddfb0e79c7514711)) +* **pb-toggle-feature:** if selector specified, emit event on load ([7d3ff92](https://github.com/eeditiones/tei-publisher-components/commit/7d3ff9284f2e9afbf7d381654928bd3371f38060)) + + +### Features + +* **pb-toggle-feature:** add attribute "global": if set, toggles any matching selectors below the surrounding pb-page (i.e. not just in connected pb-view/pb-load) ([18ee228](https://github.com/eeditiones/tei-publisher-components/commit/18ee22805550e5f663b89c7a1c4d51442e36cde3)) + ## [2.13.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.1...v2.13.2) (2023-10-26) diff --git a/package-lock.json b/package-lock.json index 131a1f9a..c9d66adb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.2", + "version": "2.14.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.13.2", + "version": "2.14.0", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 18415771..ae853166 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.13.2", + "version": "2.14.0", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From c0928785ce31db2a95e765fde203e0c1e7443ec5 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Sun, 12 Nov 2023 12:30:17 +0100 Subject: [PATCH 22/40] fix(pb-tify): instead of using a custom property, link to the transcription page is now specified in a "rendering" property on the canvas --- src/pb-tify.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pb-tify.js b/src/pb-tify.js index 33c507e9..1db18101 100644 --- a/src/pb-tify.js +++ b/src/pb-tify.js @@ -99,10 +99,15 @@ export class PbTify extends pbMixin(LitElement) { } _switchPage(canvas) { - const renderLink = canvas['https://teipublisher.com/page']; - if (renderLink) { - console.log(' page changed, emitting refresh with params %o', renderLink); - this.emitTo('pb-refresh', renderLink); + const rendering = canvas.rendering; + if (rendering && rendering.length > 0) { + const url = new URL(rendering[0]['@id']); + const params = {}; + url.searchParams.forEach((value, key) => { + params[key] = value; + }) + console.log(' page changed, emitting refresh with params %o', params); + this.emitTo('pb-refresh', params); } } From b25a2aaff1a38254d09d0a79452b93f6b3050050 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 12 Nov 2023 11:34:46 +0000 Subject: [PATCH 23/40] chore(release): 2.14.1 [skip ci] ## [2.14.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.0...v2.14.1) (2023-11-12) ### Bug Fixes * **pb-tify:** instead of using a custom property, link to the transcription page is now specified in a "rendering" property on the canvas ([c092878](https://github.com/eeditiones/tei-publisher-components/commit/c0928785ce31db2a95e765fde203e0c1e7443ec5)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31dfb3cc..0b9b2a4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.14.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.0...v2.14.1) (2023-11-12) + + +### Bug Fixes + +* **pb-tify:** instead of using a custom property, link to the transcription page is now specified in a "rendering" property on the canvas ([c092878](https://github.com/eeditiones/tei-publisher-components/commit/c0928785ce31db2a95e765fde203e0c1e7443ec5)) + # [2.14.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.13.2...v2.14.0) (2023-11-03) diff --git a/package-lock.json b/package-lock.json index c9d66adb..00e9cbff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.0", + "version": "2.14.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.0", + "version": "2.14.1", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index ae853166..581f7326 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.0", + "version": "2.14.1", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 58e63a47a9c11ca35a6f53620aec5cfc0e52be96 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Wed, 15 Nov 2023 17:34:12 +0100 Subject: [PATCH 24/40] fix(pb-authority-lookup): emit event if user clicks add entity --- src/pb-authority-lookup.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index 9c8287f7..257a0af6 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -8,6 +8,12 @@ import '@polymer/paper-icon-button'; /** * Performs authority lookups via configurable connectors. + * + * @fires pb-authority-select - Fired when user selects an entry from the list + * @fires pb-authority-edit-entity - Fired when user clicks the edit button next to an entry + * @fires pb-authority-new-entity - Fired when user clicks the add new entity button + * @fires pb-authority-lookup - When received, starts a lookup using the passed in query string and + * authority type */ export class PbAuthorityLookup extends pbMixin(LitElement) { static get properties() { @@ -84,6 +90,11 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { @change="${this._queryChanged}" > + ${ + this._authorities[this.type].editable ? + html`` : + null + }
    @@ -136,7 +147,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { html`
    ` : null } @@ -161,6 +172,10 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { this.emitTo('pb-authority-select', options); } + _editEntity(item) { + this.emitTo('pb-authority-edit-entity', {id: item.id}); + } + _queryChanged() { this._results = []; this.query = this.shadowRoot.getElementById('query').value; @@ -179,6 +194,10 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { }); } + _addEntity() { + this.emitTo('pb-authority-new-entity', {query: this.query}); + } + _occurrences(items) { const params = new FormData(); params.append('register', this.type); From 7fb50e74eb12fde6402dd1b503b2d5df250f5d05 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 15 Nov 2023 16:37:41 +0000 Subject: [PATCH 25/40] chore(release): 2.14.2 [skip ci] ## [2.14.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.1...v2.14.2) (2023-11-15) ### Bug Fixes * **pb-authority-lookup:** emit event if user clicks add entity ([58e63a4](https://github.com/eeditiones/tei-publisher-components/commit/58e63a47a9c11ca35a6f53620aec5cfc0e52be96)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b9b2a4a..70f16e31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.14.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.1...v2.14.2) (2023-11-15) + + +### Bug Fixes + +* **pb-authority-lookup:** emit event if user clicks add entity ([58e63a4](https://github.com/eeditiones/tei-publisher-components/commit/58e63a47a9c11ca35a6f53620aec5cfc0e52be96)) + ## [2.14.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.0...v2.14.1) (2023-11-12) diff --git a/package-lock.json b/package-lock.json index 00e9cbff..b21628a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.1", + "version": "2.14.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.1", + "version": "2.14.2", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 581f7326..0184d9bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.1", + "version": "2.14.2", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 66edabc50913c38bcf20a9094d995800f8c17271 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Thu, 16 Nov 2023 09:39:36 +0100 Subject: [PATCH 26/40] fix(pb-authority-lookup,custom): trigger pb-authority-error if saving to local registry fails --- src/authority/custom.js | 9 +++++++-- src/authority/registry.js | 3 ++- src/pb-authority-lookup.js | 21 ++++++++++++++++----- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/authority/custom.js b/src/authority/custom.js index b7d69c70..8b7b19b0 100644 --- a/src/authority/custom.js +++ b/src/authority/custom.js @@ -109,7 +109,7 @@ export class Custom extends Registry { } } if (!entry) { - return Promise.reject(`No record found for ID ${item.id}`); + return Promise.reject(new Error(`No record found for ID ${item.id}`)); } return fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(item.id)}`, { method: 'POST', @@ -120,6 +120,11 @@ export class Custom extends Registry { }, body: JSON.stringify(entry), }) - .then((response) => response.json()); + .then((response) => { + if (response.ok) { + return response.json(); + } + return Promise.reject(Error(response.status.toString())); + }); } } diff --git a/src/authority/registry.js b/src/authority/registry.js index d8ab7096..4615dcec 100644 --- a/src/authority/registry.js +++ b/src/authority/registry.js @@ -62,8 +62,9 @@ export class Registry { * * @param item the item to output */ - select(item) { + async select(item) { /* do nothing by default */ + return Promise.resolve(item); } /** diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index 257a0af6..f1243a40 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -160,20 +160,31 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { _select(item) { const connector = this._authorities[item.register]; - if (connector) { - connector.select(item); - } const options = { strings: item.strings, properties: { ref: item.id, } }; - this.emitTo('pb-authority-select', options); + if (connector) { + connector + .select(item) + .then(() => this.emitTo('pb-authority-select', options)) + .catch((e) => this.emitTo('pb-authority-error', {status: e.message})); + } else { + this.emitTo('pb-authority-select', options); + } } _editEntity(item) { - this.emitTo('pb-authority-edit-entity', {id: item.id}); + const connector = this._authorities[item.register]; + if (connector) { + connector + .select(item) + .then(() => this.emitTo('pb-authority-edit-entity', {id: item.id})); + } else { + this.emitTo('pb-authority-edit-entity', {id: item.id}); + } } _queryChanged() { From 51f1dbff0c741d169626eeaa614230e0b42c40a8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 16 Nov 2023 08:43:10 +0000 Subject: [PATCH 27/40] chore(release): 2.14.3 [skip ci] ## [2.14.3](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.2...v2.14.3) (2023-11-16) ### Bug Fixes * **pb-authority-lookup,custom:** trigger pb-authority-error if saving to local registry fails ([66edabc](https://github.com/eeditiones/tei-publisher-components/commit/66edabc50913c38bcf20a9094d995800f8c17271)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f16e31..6a679308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.14.3](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.2...v2.14.3) (2023-11-16) + + +### Bug Fixes + +* **pb-authority-lookup,custom:** trigger pb-authority-error if saving to local registry fails ([66edabc](https://github.com/eeditiones/tei-publisher-components/commit/66edabc50913c38bcf20a9094d995800f8c17271)) + ## [2.14.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.1...v2.14.2) (2023-11-15) diff --git a/package-lock.json b/package-lock.json index b21628a0..84161184 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.3", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 0184d9bb..12566755 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.3", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From c5cb4d992c1fc9ee34167f3a942715ac55b8232a Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Thu, 16 Nov 2023 15:45:10 +0100 Subject: [PATCH 28/40] fix(pb-view-annotate): suppress pb-selection-changed event if annotation is deleted --- src/pb-view-annotate.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pb-view-annotate.js b/src/pb-view-annotate.js index 253d4958..18802e6f 100644 --- a/src/pb-view-annotate.js +++ b/src/pb-view-annotate.js @@ -278,7 +278,7 @@ class PbViewAnnotate extends PbView { /** @param {Event} event */ this._eventHandler = event => { - if (event.type === 'selectionchange' && this._inHandler) { + if (event.type === 'selectionchange' || this._inHandler) { return; } if (event.type === 'mousedown') { @@ -657,9 +657,16 @@ class PbViewAnnotate extends PbView { window.requestAnimationFrame(() => this.refreshMarkers()); - const selection = this._getSelection(); - selection.removeAllRanges(); - selection.addRange(newRange); + this._inHandler = true; + try { + const selection = this._getSelection(); + selection.removeAllRanges(); + selection.addRange(newRange); + } catch(e) { + console.error(' %s', e.message); + } finally { + this._inHandler = false; + } } editAnnotation(span, properties) { From 951856edceecccdc565f3d1c37635691b79880c8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 16 Nov 2023 14:48:36 +0000 Subject: [PATCH 29/40] chore(release): 2.14.4 [skip ci] ## [2.14.4](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.3...v2.14.4) (2023-11-16) ### Bug Fixes * **pb-view-annotate:** suppress pb-selection-changed event if annotation is deleted ([c5cb4d9](https://github.com/eeditiones/tei-publisher-components/commit/c5cb4d992c1fc9ee34167f3a942715ac55b8232a)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a679308..1a7dfbae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.14.4](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.3...v2.14.4) (2023-11-16) + + +### Bug Fixes + +* **pb-view-annotate:** suppress pb-selection-changed event if annotation is deleted ([c5cb4d9](https://github.com/eeditiones/tei-publisher-components/commit/c5cb4d992c1fc9ee34167f3a942715ac55b8232a)) + ## [2.14.3](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.2...v2.14.3) (2023-11-16) diff --git a/package-lock.json b/package-lock.json index 84161184..b3484dcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.3", + "version": "2.14.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.3", + "version": "2.14.4", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 12566755..58f805fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.3", + "version": "2.14.4", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 2c7ec1efa393084abcae570c790902d6912f26fd Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Fri, 17 Nov 2023 11:28:37 +0100 Subject: [PATCH 30/40] fix(pb-authority,custom): select method should not reject promise if no record is found in external authorities: the entry may only exist in the local register --- src/authority/custom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authority/custom.js b/src/authority/custom.js index 8b7b19b0..68166d32 100644 --- a/src/authority/custom.js +++ b/src/authority/custom.js @@ -103,13 +103,13 @@ export class Custom extends Registry { let entry; for (const connector of this._connectors) { // eslint-disable-next-line no-await-in-loop - entry = await connector.getRecord(item.id); + entry = await connector.getRecord(item.id).catch(() => null); if (entry) { break; } } if (!entry) { - return Promise.reject(new Error(`No record found for ID ${item.id}`)); + return Promise.resolve(item); } return fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(item.id)}`, { method: 'POST', From 4909dab5964d1970c2dec728e55235a96dff90f6 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 17 Nov 2023 10:32:09 +0000 Subject: [PATCH 31/40] chore(release): 2.14.5 [skip ci] ## [2.14.5](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.4...v2.14.5) (2023-11-17) ### Bug Fixes * **pb-authority,custom:** select method should not reject promise if no record is found in external authorities: the entry may only exist in the local register ([2c7ec1e](https://github.com/eeditiones/tei-publisher-components/commit/2c7ec1efa393084abcae570c790902d6912f26fd)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7dfbae..1a0015f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.14.5](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.4...v2.14.5) (2023-11-17) + + +### Bug Fixes + +* **pb-authority,custom:** select method should not reject promise if no record is found in external authorities: the entry may only exist in the local register ([2c7ec1e](https://github.com/eeditiones/tei-publisher-components/commit/2c7ec1efa393084abcae570c790902d6912f26fd)) + ## [2.14.4](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.3...v2.14.4) (2023-11-16) diff --git a/package-lock.json b/package-lock.json index b3484dcf..7d486396 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.4", + "version": "2.14.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.4", + "version": "2.14.5", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 58f805fb..726174f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.4", + "version": "2.14.5", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From fd2e3885402e2cde219be1c3f9db4c162bdfd336 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Tue, 21 Nov 2023 18:46:00 +0100 Subject: [PATCH 32/40] fix(pb-authority-lookup,custom): add property to info event details if authority is editable --- src/authority/custom.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/authority/custom.js b/src/authority/custom.js index 68166d32..4f5f34ad 100644 --- a/src/authority/custom.js +++ b/src/authority/custom.js @@ -73,6 +73,7 @@ export class Custom extends Registry { resolve({ id: json.id, strings: json.strings, + editable: this._editable }); return; } From cdf33cbe6194a4165f308f9e9f94af310def8b7f Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Tue, 21 Nov 2023 18:46:39 +0100 Subject: [PATCH 33/40] fix(pb-authority-lookup): add missing i18n labels --- i18n/common/en.json | 5 ++++- src/pb-authority-lookup.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/i18n/common/en.json b/i18n/common/en.json index 0c94bab8..0f66757c 100644 --- a/i18n/common/en.json +++ b/i18n/common/en.json @@ -276,7 +276,10 @@ }, "confirm-discard-title": "Discard", "confirm-discard": "Discard the list of occurrences?", - "doc-count": "{{count}} von {{total}}" + "doc-count": "{{count}} von {{total}}", + "toggle": "Show/hide preview/control panel", + "add-entity": "Create entity", + "edit-entity": "Edit entity" }, "ner": { "title": "Train a Named Entity Recognition Model", diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index f1243a40..3649cc52 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -92,7 +92,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { ${ this._authorities[this.type].editable ? - html`` : + html`` : null } @@ -148,6 +148,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) {
    ` : null } From d5492091c4b9a02ee6c345e61ad424ee554a70fe Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Tue, 21 Nov 2023 19:01:43 +0100 Subject: [PATCH 34/40] fix(pb-authority-lookup): fix undefined error --- src/pb-authority-lookup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index 3649cc52..fa37c1e6 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -91,7 +91,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { > ${ - this._authorities[this.type].editable ? + this._authorities[this.type] && this._authorities[this.type].editable ? html`` : null } @@ -143,7 +143,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) {
    ${item.register}
    ${ - this._authorities[this.type].editable ? + this._authorities[this.type] && this._authorities[this.type].editable ? html`
    Date: Tue, 21 Nov 2023 19:02:42 +0100 Subject: [PATCH 35/40] fix(pb-view-annotate): add callback function to pb-annotation-detail event; refreshes popover position when called --- src/pb-view-annotate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pb-view-annotate.js b/src/pb-view-annotate.js index 18802e6f..cf63b2da 100644 --- a/src/pb-view-annotate.js +++ b/src/pb-view-annotate.js @@ -801,11 +801,12 @@ class PbViewAnnotate extends PbView { typeInd.style.backgroundColor = `var(--pb-annotation-${type})`; typeInd.style.color = `var(${color && color.isLight ? '--pb-color-primary' : '--pb-color-inverse'})`; if (data[this.getKey(type)]) { - this.emitTo ('pb-annotation-detail', { + this.emitTo('pb-annotation-detail', { type, id: data[this.getKey(type)], container: info, span, + ready: () => instance.setContent(wrapper) }); } else { // show properties as key/value table From b326e94e81a710abedfb4692b29f101bd6058982 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 21 Nov 2023 18:06:22 +0000 Subject: [PATCH 36/40] chore(release): 2.14.6 [skip ci] ## [2.14.6](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.5...v2.14.6) (2023-11-21) ### Bug Fixes * **pb-authority-lookup:** add missing i18n labels ([cdf33cb](https://github.com/eeditiones/tei-publisher-components/commit/cdf33cbe6194a4165f308f9e9f94af310def8b7f)) * **pb-authority-lookup:** fix undefined error ([d549209](https://github.com/eeditiones/tei-publisher-components/commit/d5492091c4b9a02ee6c345e61ad424ee554a70fe)) * **pb-authority-lookup,custom:** add property to info event details if authority is editable ([fd2e388](https://github.com/eeditiones/tei-publisher-components/commit/fd2e3885402e2cde219be1c3f9db4c162bdfd336)) * **pb-view-annotate:** add callback function to pb-annotation-detail event; refreshes popover position when called ([b76bf9f](https://github.com/eeditiones/tei-publisher-components/commit/b76bf9fd0cd7df30d5dc89f180dcb313e7ea836c)) --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0015f2..8e1b9f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [2.14.6](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.5...v2.14.6) (2023-11-21) + + +### Bug Fixes + +* **pb-authority-lookup:** add missing i18n labels ([cdf33cb](https://github.com/eeditiones/tei-publisher-components/commit/cdf33cbe6194a4165f308f9e9f94af310def8b7f)) +* **pb-authority-lookup:** fix undefined error ([d549209](https://github.com/eeditiones/tei-publisher-components/commit/d5492091c4b9a02ee6c345e61ad424ee554a70fe)) +* **pb-authority-lookup,custom:** add property to info event details if authority is editable ([fd2e388](https://github.com/eeditiones/tei-publisher-components/commit/fd2e3885402e2cde219be1c3f9db4c162bdfd336)) +* **pb-view-annotate:** add callback function to pb-annotation-detail event; refreshes popover position when called ([b76bf9f](https://github.com/eeditiones/tei-publisher-components/commit/b76bf9fd0cd7df30d5dc89f180dcb313e7ea836c)) + ## [2.14.5](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.4...v2.14.5) (2023-11-17) diff --git a/package-lock.json b/package-lock.json index 7d486396..b0123a95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.5", + "version": "2.14.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.5", + "version": "2.14.6", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 726174f7..4b6bb371 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.5", + "version": "2.14.6", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From b27fd39d0e4504d1b4ffc569926eceef4ecef230 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Wed, 22 Nov 2023 09:49:11 +0100 Subject: [PATCH 37/40] i18n: update German translations --- i18n/common/de.json | 71 ++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/i18n/common/de.json b/i18n/common/de.json index d5e904b9..d2ff6e37 100644 --- a/i18n/common/de.json +++ b/i18n/common/de.json @@ -46,7 +46,10 @@ }, "browse": { "description": "Diese Anwendung dient vorrangig zum Experimentieren mit verschiedenen Dokumenten und deren Transformationen über das TEI Processing Model. Es können eigene Dateien hochgeladen und neue ODDs erstellt werden.", - "login": "zum Hochladen eigener Dateien oder Zugriff auf administrative Funktionen (Standardnutzer: 'tei-demo', Passwort: 'demo').", + "login": "zum Hochladen eigener Dateien oder Zugriff auf administrative Funktionen (Standardnutzer: 'tei', Passwort: 'simple').", + "login-1": "Anmelden als ", + "login-2": "mit Passwort", + "login-3": "um mit eigenen Dateien und ODDs zu experimentieren", "sort": "Sortiere nach", "filter": "Filtere nach", "filterPlaceholder": "Filter", @@ -60,6 +63,9 @@ "confirmDeletion": "Möchten Sie die Datei wirklich löschen?", "confirmDeletion_plural": "Möchten Sie wirklich {{count}} Dateien löschen?", "documents": "Dokumente", + "documents-removed": "Dokumente gelöscht", + "document-not-found": "Dokument nicht gefunden", + "document-remove-failed": "Löschen des Dokuments fehlgeschlagen", "collections": "Lokale Sammlung", "dts": "Distributed Text Services (experimentell)", "test": { @@ -78,6 +84,10 @@ "title": "Markdown-Beispiel", "description": "Ein Beispiel zur Verwendung von Markdown für statische Inhalte." }, + "annotate": { + "title": "Annotierte Dokumente", + "description": "Beschreibbare Sammlung zum Annotieren von Dokumenten." + }, "up": "Übergeordnetes Verzeichnis" }, "upload": { @@ -111,11 +121,15 @@ "reset": "Zurücksetzen", "placeholder": "Suche nach", "sections": "Abschnitte durchsuchen", - "headings": "Überschriften durchsuchen" + "headings": "Überschriften durchsuchen", + "title": "Titel suchen", + "content": "Inhalte durchsuchen", + "scope": "Suchbereich" }, "dts": { "endpoint": "Server wählen", - "note": "Experimentell: Zugriff auf externe Editionen über DTS API" + "note": "Experimentell: Zugriff auf externe Editionen über DTS API", + "requires-login": "Anmeldung erforderlich" }, "odd": { "files": "ODD Dateien", @@ -175,7 +189,10 @@ "facets": { "show": "Zeige 50 häufigste", "genre": "Genre", - "language": "Sprache" + "language": "Sprache", + "feature": "Feature", + "form": "Art der Quelle", + "period": "Zeitraum" }, "appgen": { "account": { @@ -217,38 +234,38 @@ "success": "Deine App wurde erfolgreich generiert!" }, "annotations": { - "abbreviation": "Abkürzung", - "delete": "Annotation löschen", "edit": "Annotation ändern", + "delete": "Annotation löschen", + "save": "Änderungen ins TEI speichern", "no-properties": "Keine Eigenschaften vorhanden.", - "occurrences": "Vorkommen im Text", - "organisation": "Organisation", "person": "Person", + "organisation": "Organisation", "place": "Ort", - "term": "Term", + "term": "Begriff", "date": "Datum", - "apply": "Anwenden", + "reg": "Regularisierung", + "app": "Apparatus", + "hi": "Hervorhebung", + "ref": "Link (ref)", + "abbreviation": "Abkürzung", + "occurrences": "Vorkommen im Text", "correction": "Korrektur", + "expansion": "Auflösung", "reference": "Referenz", - "expansion": "Erweiterung", + "lookup": "Entität suchen", + "apply": "Anwenden", + "apply-all": "Alle selektieren und anwenden", "changes": "Änderungen", - "reg": "Regularisierung", - "hi": "Hervorhebung", - "app": "Apparatus", - "download": "Ergebnis als lokale Datei speichern", - "restore": "Es wurden Annotationen für dieses Dokument aus einer früheren Sitzung gefunden. Möchtest Du diese wiederherstellen?", "undo": "Letzten Arbeitsschritt rückgängig machen", - "lookup": "Entität suchen", + "download": "Ergebnis als lokale Datei speichern", + "reload": "Quelle neu laden", "preview": "Voransicht erneuern", - "save": "Änderungen ins TEI speichern", + "confirm-restore-title": "Annotationen wiederherstellen", + "restore": "Es wurden Annotationen für dieses Dokument aus einer früheren Sitzung gefunden. Möchtest Du diese wiederherstellen?", + "confirm-reload-title": "Quelle neu laden", "confirm-reload": "Annotationen verwerfen und Quelle neu laden?", - "confirm-reload-title": "Quelle neu laden?", - "confirm-restore-title": "Annotationen wiederherstellen?", - "ref": "Link (ref)", - "reload": "Quelle neu laden", "modify": "Änderung am Text vornehmen", "modify-info": "Achtung: dies ist keine Annotation. Die Änderung wird beim Merge auf den Transkriptionstext angewandt.", - "apply-all": "Alle selektieren und anwenden", "permission": "Zugriff verweigert: keine Berechtigung zum Speichern von Annotationen.", "ner": { "title": "Automatische Entitätenerkennung", @@ -256,7 +273,13 @@ "run": "Ausführen", "model": "Wähle ein Modell", "denied": "Ungespeicherte Änderungen gefunden: bitte zuerst speichern oder verwerfen." - } + }, + "confirm-discard-title": "Verwerfen", + "confirm-discard": "Liste anderer Vorkommen verwerfen?", + "doc-count": "{{count}} von {{total}}", + "toggle": "Ein-/Ausblenden der Vorschau/Kontrollleiste", + "add-entity": "Entität hinzufügen", + "edit-entity": "Entität bearbeiten" }, "ner": { "title": "Trainiere ein Modell zur Entitätenerkennung", From d228a35228a5e0f4ae0fa2a9f86ac869608508f2 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 22 Nov 2023 08:53:41 +0000 Subject: [PATCH 38/40] chore(release): 2.15.0 [skip ci] # [2.15.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.6...v2.15.0) (2023-11-22) ### Bug Fixes * **i18n:** corrects preposition ([0f702ae](https://github.com/eeditiones/tei-publisher-components/commit/0f702aeabdd81e152503a410b048e7dc15af3229)) * **i18n:** minor correction in es translation ([811ff02](https://github.com/eeditiones/tei-publisher-components/commit/811ff02b91aa461d885933fdba66b6f318e575d4)) ### Features * **i18n:** adds missing translations in spanish ([4c231ab](https://github.com/eeditiones/tei-publisher-components/commit/4c231ab9dbdfcbed6429480d637dc676cb7b8aa1)) --- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1b9f48..69b22638 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# [2.15.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.6...v2.15.0) (2023-11-22) + + +### Bug Fixes + +* **i18n:** corrects preposition ([0f702ae](https://github.com/eeditiones/tei-publisher-components/commit/0f702aeabdd81e152503a410b048e7dc15af3229)) +* **i18n:** minor correction in es translation ([811ff02](https://github.com/eeditiones/tei-publisher-components/commit/811ff02b91aa461d885933fdba66b6f318e575d4)) + + +### Features + +* **i18n:** adds missing translations in spanish ([4c231ab](https://github.com/eeditiones/tei-publisher-components/commit/4c231ab9dbdfcbed6429480d637dc676cb7b8aa1)) + ## [2.14.6](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.5...v2.14.6) (2023-11-21) diff --git a/package-lock.json b/package-lock.json index b0123a95..9b5a8c4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.6", + "version": "2.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.6", + "version": "2.15.0", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 4b6bb371..b76c09be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.6", + "version": "2.15.0", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", From 0d26d6ab529378bb4c8f5f0b5278efbc667dca7d Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Wed, 22 Nov 2023 11:38:25 +0100 Subject: [PATCH 39/40] fix(pb-authority-lookup): pass register type in events --- src/pb-authority-lookup.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pb-authority-lookup.js b/src/pb-authority-lookup.js index fa37c1e6..8942b1c6 100644 --- a/src/pb-authority-lookup.js +++ b/src/pb-authority-lookup.js @@ -163,6 +163,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { const connector = this._authorities[item.register]; const options = { strings: item.strings, + type: item.register, properties: { ref: item.id, } @@ -182,9 +183,9 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { if (connector) { connector .select(item) - .then(() => this.emitTo('pb-authority-edit-entity', {id: item.id})); + .then(() => this.emitTo('pb-authority-edit-entity', {id: item.id, type: item.register})); } else { - this.emitTo('pb-authority-edit-entity', {id: item.id}); + this.emitTo('pb-authority-edit-entity', {id: item.id, type: item.register}); } } @@ -207,7 +208,7 @@ export class PbAuthorityLookup extends pbMixin(LitElement) { } _addEntity() { - this.emitTo('pb-authority-new-entity', {query: this.query}); + this.emitTo('pb-authority-new-entity', {query: this.query, type: this.type}); } _occurrences(items) { From 50e9d481e178e5cf53ec993605ba5f7c8f53d350 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 22 Nov 2023 10:41:49 +0000 Subject: [PATCH 40/40] chore(release): 2.15.1 [skip ci] ## [2.15.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.15.0...v2.15.1) (2023-11-22) ### Bug Fixes * **pb-authority-lookup:** pass register type in events ([0d26d6a](https://github.com/eeditiones/tei-publisher-components/commit/0d26d6ab529378bb4c8f5f0b5278efbc667dca7d)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b22638..4aa3b55a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.15.1](https://github.com/eeditiones/tei-publisher-components/compare/v2.15.0...v2.15.1) (2023-11-22) + + +### Bug Fixes + +* **pb-authority-lookup:** pass register type in events ([0d26d6a](https://github.com/eeditiones/tei-publisher-components/commit/0d26d6ab529378bb4c8f5f0b5278efbc667dca7d)) + # [2.15.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.6...v2.15.0) (2023-11-22) diff --git a/package-lock.json b/package-lock.json index 9b5a8c4e..f8d5c767 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.15.0", + "version": "2.15.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.15.0", + "version": "2.15.1", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index b76c09be..4184a1e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.15.0", + "version": "2.15.1", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html",