@teipublisher/pb-components 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # [2.1.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.0.0...v2.1.0) (2023-03-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **pb-facs-link:** wait for pb-facsimile or pb-image-strip to be ready ([93da282](https://github.com/eeditiones/tei-publisher-components/commit/93da282ddcafd9c28bc87bb4efeefd13ecf73a51))
7
+
8
+
9
+ ### Features
10
+
11
+ * **pb-facsimile:** respect facs-link order ([8754768](https://github.com/eeditiones/tei-publisher-components/commit/87547680da8c4a539a13e3283d234d121bec6571))
12
+ * **pb-image-strip:** reverse default order ([ea12409](https://github.com/eeditiones/tei-publisher-components/commit/ea12409fed2051ac2ed9132b81c5644a679e4296))
13
+ * pb-facs-link, pb-image-strip ([f667176](https://github.com/eeditiones/tei-publisher-components/commit/f667176b7561a824c63ecacdb8ee0ed454997907))
14
+ * ** pb-image-strip:** sort items by order ([d0baa51](https://github.com/eeditiones/tei-publisher-components/commit/d0baa5193b6f6cb1ea1abe54a27f811aa272d4cc))
15
+ * **pb-image-strip:** add new component ([9143856](https://github.com/eeditiones/tei-publisher-components/commit/9143856b5877da9d896ca6c4cef8e3f8deff8c97)), closes [#85](https://github.com/eeditiones/tei-publisher-components/issues/85)
16
+
1
17
  # [2.0.0](https://github.com/eeditiones/tei-publisher-components/compare/v1.44.2...v2.0.0) (2023-03-16)
2
18
 
3
19
 
@@ -42,6 +42,10 @@
42
42
  "demo/pb-facsimile.html": "Demo",
43
43
  "demo/pb-facsimile-2.html": "Align text page with facsimile"
44
44
  },
45
+ "pb-image-strip": {
46
+ "demo/pb-image-strip-view.html": "Demo with pb-view",
47
+ "demo/pb-image-strip-standalone.html": "Standalone Demo"
48
+ },
45
49
  "pb-grid": {
46
50
  "demo/pb-grid.html": "Demo"
47
51
  },
@@ -0,0 +1,94 @@
1
+ <html>
2
+
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" />
6
+
7
+ <title>pb-document Demo</title>
8
+ <script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.4.3/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <pb-demo-snippet>
13
+ <template>
14
+ <style type="text/css">
15
+ main {
16
+ display: grid;
17
+ grid-template-columns: 1fr 1fr;
18
+ }
19
+ pb-facsimile {
20
+ min-width: 50px;
21
+ height: 40vh;
22
+ --pb-facsimile-border: 4px solid rgba(0, 128, 90, 0.5);
23
+ display:block;
24
+ }
25
+ pb-image-strip {
26
+ display: flex;
27
+ flex-direction: row;
28
+ }
29
+
30
+ [slot="after"] {
31
+ margin-top: 5px;
32
+ padding-top: 10px;
33
+ border-top: 1px solid #606060;
34
+ }
35
+ [slot="before"] {
36
+ padding-bottom: 10px;
37
+ margin-bottom: 5px;
38
+ border-bottom: 1px solid #606060;
39
+ }
40
+ </style>
41
+ <pb-page endpoint="https://teipublisher.com/exist/apps/tei-publisher">
42
+ <!-- Display facsimile -->
43
+ <main>
44
+ <div>
45
+ <pb-facsimile base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/"
46
+ default-zoom-level="0" show-navigator
47
+ show-navigation-control show-home-control show-rotation-control>
48
+ </pb-facsimile>
49
+ <div>
50
+ <pb-image-strip base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/"></pb-image-strip></h3>
51
+ </div>
52
+ </div>
53
+ <aside>
54
+ <ul>
55
+ <li>
56
+ <pb-facs-link order="3" facs="15929_000_IDL5772_BOss12034_IIIp79.jpg" label="a label">Page 79</pb-facs-link>, first page
57
+ </li>
58
+ <li>
59
+ <pb-facs-link order="2" facs="15929_000_IDL5772_BOss12034_IIIp80.jpg" label="the second">Page 80</pb-facs-link>
60
+ </li>
61
+ <li>
62
+ <pb-facs-link order="1" facs="15929_000_IDL5772_BOss12034_IIIp81.jpg" label="something">Page 81</pb-facs-link>
63
+ </li>
64
+ <li>
65
+ <pb-facs-link order="4" facs="15929_000_IDL5772_BOss12034_IIIp82.jpg" label="completely">Page 82</pb-facs-link>
66
+ </li>
67
+ <li>
68
+ <pb-facs-link order="5" facs="15929_000_IDL5772_BOss12034_IIIp82.jpg"
69
+ coordinates="[59,1796,429,1027]">Fragment on page 82</pb-facs-link>
70
+ </li>
71
+ <li>
72
+ <pb-facs-link facs="does-not-exist.jpg" label="completely">Missing image: hide viewer</pb-facs-link>
73
+ </li>
74
+ </ul>
75
+ </aside>
76
+ </main>
77
+ <script>
78
+ window.addEventListener('load', () => {
79
+ const viewer = document.querySelector('pb-facsimile');
80
+ window.pbEvents.subscribe('pb-facsimile-status', null, (ev) => {
81
+ if (ev.detail.status === 'fail') {
82
+ viewer.style.visibility = 'hidden';
83
+ } else {
84
+ viewer.style.visibility = 'visible';
85
+ }
86
+ });
87
+ });
88
+ </script>
89
+ </pb-page>
90
+ </template>
91
+ </pb-demo-snippet>
92
+ </body>
93
+
94
+ </html>
@@ -0,0 +1,92 @@
1
+ <html>
2
+
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" />
6
+
7
+ <title>pb-document Demo</title>
8
+ <script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.4.3/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <pb-demo-snippet>
13
+ <template>
14
+ <style type="text/css">
15
+ pb-page {
16
+ height: calc(100vh - 180px);
17
+ }
18
+ main {
19
+ display: grid;
20
+ grid-template-columns: auto auto;
21
+ grid-column-gap: 4rem;
22
+ height: calc(100vh - 360px);
23
+ }
24
+ pb-view {
25
+ overflow-y: auto;
26
+ }
27
+ pb-facsimile {
28
+ --pb-facsimile-border: 4px solid rgba(0, 128, 90, 0.5);
29
+ display: block;
30
+ }
31
+ pb-image-strip {
32
+ display: flex;
33
+ flex-direction: row;
34
+ }
35
+
36
+ [slot="after"] {
37
+ margin-top: 5px;
38
+ padding-top: 10px;
39
+ border-top: 1px solid #606060;
40
+ }
41
+ [slot="before"] {
42
+ padding-bottom: 10px;
43
+ margin-bottom: 5px;
44
+ border-bottom: 1px solid #606060;
45
+ }
46
+ </style>
47
+ <pb-page endpoint="https://teipublisher.com/exist/apps/tei-publisher">
48
+ <!-- Display facsimile -->
49
+ <pb-document id="document1" path="test/cortes_to_dantiscus.xml"></pb-document>
50
+ <main>
51
+ <pb-view id="view1" src="document1" view="single"
52
+ load-css="transform/dantiscus.css"
53
+ ></pb-view>
54
+ <pb-facsimile base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/"
55
+ default-zoom-level="0" show-navigator
56
+ show-navigation-control show-home-control show-rotation-control>
57
+ <pb-image-strip slot="before" base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/"></pb-image-strip>
58
+ <div slot="after">Status: <span id="status"></span></div>
59
+ </pb-facsimile>
60
+ </main>
61
+ <script>
62
+ window.addEventListener('load', () => {
63
+ const viewer = document.querySelector('pb-facsimile');
64
+ const status = document.getElementById('status');
65
+ // only for debugging to check
66
+ // if events are fired in document order
67
+ // window.pbEvents.subscribe('pb-load-facsimile', null, (ev) => {
68
+ // const viewShadow = ev.target
69
+ // const links = Array.from(viewShadow.shadowRoot.querySelectorAll('pb-facs-link'))
70
+ // console.log(links)
71
+ // const source = ev.detail._source
72
+ // const facs = source.getAttribute('facs')
73
+ // const index = links.indexOf(source)
74
+ // console.log('pb-load-facsimile', source, index, facs, links)
75
+ // });
76
+
77
+ window.pbEvents.subscribe('pb-facsimile-status', null, (ev) => {
78
+ if (ev.detail.status === 'fail') {
79
+ viewer.style.visibility = 'hidden';
80
+ } else {
81
+ viewer.style.visibility = 'visible';
82
+ status.innerHTML = ev.detail.status;
83
+ }
84
+ });
85
+ });
86
+ </script>
87
+ </pb-page>
88
+ </template>
89
+ </pb-demo-snippet>
90
+ </body>
91
+
92
+ </html>