@teipublisher/pb-components 1.28.2 → 1.30.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 +33 -0
- package/dist/demo/demos.json +2 -1
- package/dist/demo/pb-view3.html +90 -0
- package/dist/pb-components-bundle.js +106 -106
- package/dist/pb-elements.json +22 -0
- package/dist/pb-odd-editor.js +29 -19
- package/i18n/common/de.json +3 -1
- package/i18n/common/en.json +2 -1
- package/package.json +1 -1
- package/pb-elements.json +22 -0
- package/src/pb-odd-model-editor.js +26 -15
- package/src/pb-odd-parameter-editor.js +1 -1
- package/src/pb-view-annotate.js +21 -11
- package/src/pb-view.js +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
## [1.30.2](https://github.com/eeditiones/tei-publisher-components/compare/v1.30.1...v1.30.2) (2021-12-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **pb-view-annotate:** do not throw errors when batch-applying annotations ([5432c64](https://github.com/eeditiones/tei-publisher-components/commit/5432c64812276047eabf6fad0d0b96435c10669d))
|
|
7
|
+
|
|
8
|
+
## [1.30.1](https://github.com/eeditiones/tei-publisher-components/compare/v1.30.0...v1.30.1) (2021-12-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **odd editor:** add translations for pb:set-param and [@pb](https://github.com/pb):mode ([1e5422f](https://github.com/eeditiones/tei-publisher-components/commit/1e5422f53d0bbfff12b18f2d66805844b6449ef7))
|
|
14
|
+
|
|
15
|
+
# [1.30.0](https://github.com/eeditiones/tei-publisher-components/compare/v1.29.0...v1.30.0) (2021-12-04)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **pb-view-annotate:** fix range detection bugs ([d1f31b3](https://github.com/eeditiones/tei-publisher-components/commit/d1f31b3687f58d924f76d32e68bd53f0e53d79d2))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **pb-view-annotate:** emit pb-annotation-colors event if annotation color scheme changed ([185b075](https://github.com/eeditiones/tei-publisher-components/commit/185b075fa72191d7fb8753026a38e217b90fd8d9))
|
|
26
|
+
|
|
27
|
+
# [1.29.0](https://github.com/eeditiones/tei-publisher-components/compare/v1.28.2...v1.29.0) (2021-11-26)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **pb-view:** allow custom javascript to intercept updates and modify content before it is shown ([c98035e](https://github.com/eeditiones/tei-publisher-components/commit/c98035e8696cb4e642c6a8396b346ceb29e83595))
|
|
33
|
+
|
|
1
34
|
## [1.28.2](https://github.com/eeditiones/tei-publisher-components/compare/v1.28.1...v1.28.2) (2021-11-23)
|
|
2
35
|
|
|
3
36
|
|
package/dist/demo/demos.json
CHANGED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="utf-8"/>
|
|
4
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
|
|
5
|
+
|
|
6
|
+
<title>pb-view Demo</title>
|
|
7
|
+
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.4.3/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<pb-demo-snippet>
|
|
12
|
+
<template>
|
|
13
|
+
<style type="text/css">
|
|
14
|
+
pb-page {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#view1 {
|
|
19
|
+
height: 70vh;
|
|
20
|
+
overflow: auto;
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
margin-left: auto;
|
|
24
|
+
margin-right: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (min-width: 769px) {
|
|
28
|
+
#view1, footer {
|
|
29
|
+
max-width: 60vw;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
footer {
|
|
34
|
+
position: relative;
|
|
35
|
+
margin-top: 10px;
|
|
36
|
+
bottom: 0;
|
|
37
|
+
background-color: #f2f2f2;
|
|
38
|
+
margin-left: auto;
|
|
39
|
+
margin-right: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
pb-navigation[disabled] {
|
|
43
|
+
display: block;
|
|
44
|
+
visibility: hidden;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
pb-navigation[direction="forward"] {
|
|
48
|
+
float: right;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
51
|
+
<p>Demonstrates how to manipulate pb-view contents via Javascript before they are displayed in a pb-view:</p>
|
|
52
|
+
<pb-page endpoint="https://teipublisher.com/exist/apps/tei-publisher">
|
|
53
|
+
<pb-document id="document1" path="test/graves6.xml"></pb-document>
|
|
54
|
+
|
|
55
|
+
<pb-progress subscribe="transcription"></pb-progress>
|
|
56
|
+
<!-- Output the document title -->
|
|
57
|
+
<pb-view src="document1" xpath="//teiHeader/fileDesc/titleStmt/title"
|
|
58
|
+
subscribe="transcription">
|
|
59
|
+
<pb-param name="header" value="short"/>
|
|
60
|
+
</pb-view>
|
|
61
|
+
<pb-view id="view1" src="document1" view="single" append-footnotes animation
|
|
62
|
+
before-update-event="before-transcription-update"
|
|
63
|
+
subscribe="transcription" emit="transcription"></pb-view>
|
|
64
|
+
</pb-page>
|
|
65
|
+
<script>
|
|
66
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
67
|
+
pbEvents.subscribe('before-transcription-update', 'transcription', (ev) => {
|
|
68
|
+
const root = ev.detail.root;
|
|
69
|
+
// walk through all .tei-name elements and insert a node before each
|
|
70
|
+
root.querySelectorAll('.tei-name').forEach((name) => {
|
|
71
|
+
// create a span with text 'Name' and orange color
|
|
72
|
+
const span = document.createElement('span');
|
|
73
|
+
span.innerHTML = 'Name';
|
|
74
|
+
span.style.backgroundColor = 'orange';
|
|
75
|
+
span.style.padding = '0 4px';
|
|
76
|
+
span.style.fontSize = '.85em';
|
|
77
|
+
// insert the span before the name
|
|
78
|
+
name.parentNode.insertBefore(span, name);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// to actually show the modified content in the pb-view,
|
|
82
|
+
// we need to call the render function passed in the event detail:
|
|
83
|
+
ev.detail.render(root);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
</script>
|
|
87
|
+
</template>
|
|
88
|
+
</pb-demo-snippet>
|
|
89
|
+
</body>
|
|
90
|
+
</html>
|