@teipublisher/pb-components 1.41.0 → 1.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/jinn-codemirror-cc5827eb.js +1 -0
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-components-bundle.js +2 -2
- package/dist/pb-elements.json +11 -0
- package/dist/pb-odd-editor.js +24 -9
- package/package.json +2 -2
- package/pb-elements.json +11 -0
- package/src/pb-link.js +8 -0
- package/src/pb-odd-model-editor.js +37 -2
- package/src/pb-odd-rendition-editor.js +1 -1
- package/dist/jinn-codemirror-c1a4b755.js +0 -1
|
@@ -403,6 +403,26 @@ export class PbOddModelEditor extends LitElement {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
render() {
|
|
406
|
+
let tmplSyntax;
|
|
407
|
+
switch (this.output) {
|
|
408
|
+
case 'web':
|
|
409
|
+
case 'epub':
|
|
410
|
+
tmplSyntax = 'html';
|
|
411
|
+
break;
|
|
412
|
+
case 'latex':
|
|
413
|
+
tmplSyntax = 'tex';
|
|
414
|
+
break;
|
|
415
|
+
case 'plain':
|
|
416
|
+
tmplSyntax = 'default';
|
|
417
|
+
break;
|
|
418
|
+
case 'fo':
|
|
419
|
+
case 'print':
|
|
420
|
+
tmplSyntax = 'xml';
|
|
421
|
+
break;
|
|
422
|
+
default:
|
|
423
|
+
tmplSyntax = 'html';
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
406
426
|
return html`
|
|
407
427
|
<form>
|
|
408
428
|
<header>
|
|
@@ -511,9 +531,24 @@ export class PbOddModelEditor extends LitElement {
|
|
|
511
531
|
<label>Template</label>
|
|
512
532
|
<jinn-codemirror id="template"
|
|
513
533
|
code="${this.template}"
|
|
514
|
-
mode="${
|
|
534
|
+
mode="${tmplSyntax}"
|
|
515
535
|
placeholder="${translate('odd.editor.model.template-placeholder')}"
|
|
516
536
|
@update="${this._updateTemplate}">
|
|
537
|
+
<div slot="toolbar">
|
|
538
|
+
<paper-button data-mode="xml" data-command="selectElement" data-key="mod-e mod-s"
|
|
539
|
+
title="Select element around current cursor position"><|></paper-button>
|
|
540
|
+
<paper-button data-mode="xml" data-command="encloseWith" data-key="mod-e mod-e"
|
|
541
|
+
title="Enclose selection in new element"><...></paper-button>
|
|
542
|
+
<paper-button data-mode="xml" data-command="removeEnclosing" title="Remove enclosing tags"
|
|
543
|
+
data-key="mod-e mod-r" class="sep"><X></paper-button>
|
|
544
|
+
<paper-button data-mode="html" data-command="selectElement" data-key="mod-e mod-s"
|
|
545
|
+
title="Select element around current cursor position"><|></paper-button>
|
|
546
|
+
<paper-button data-mode="html" data-command="encloseWith" data-key="mod-e mod-e"
|
|
547
|
+
title="Enclose selection in new element"><...></paper-button>
|
|
548
|
+
<paper-button data-mode="html" data-command="removeEnclosing" title="Remove enclosing tags"
|
|
549
|
+
data-key="mod-e mod-r" class="sep"><X></paper-button>
|
|
550
|
+
<paper-button data-key="mod-e mod-p" data-command="snippet" data-params="[[\${_}]]" title="Insert template variable">[[...]]</paper-button>
|
|
551
|
+
</div>
|
|
517
552
|
</jinn-codemirror>
|
|
518
553
|
</div>
|
|
519
554
|
</div>
|
|
@@ -874,7 +909,7 @@ export class PbOddModelEditor extends LitElement {
|
|
|
874
909
|
}
|
|
875
910
|
|
|
876
911
|
_updateTemplate(ev) {
|
|
877
|
-
this.template = this.shadowRoot.getElementById('template').
|
|
912
|
+
this.template = this.shadowRoot.getElementById('template').content;
|
|
878
913
|
this._fireModelChanged('template', this.template);
|
|
879
914
|
}
|
|
880
915
|
|