@pod-os/elements 0.8.0 → 0.9.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/dist/cjs/BrokenFile-b01d72da.js +226 -0
- package/dist/cjs/ResourceAware-f1aac952.js +7 -0
- package/dist/cjs/elements.cjs.js +1 -1
- package/dist/{esm/ion-app_48.entry.js → cjs/index-74c56a41.js} +8 -4122
- package/dist/cjs/ion-app_25.cjs.entry.js +3043 -0
- package/dist/cjs/ion-badge_7.cjs.entry.js +258 -0
- package/dist/cjs/ion-item-divider_3.cjs.entry.js +109 -0
- package/dist/cjs/ion-item_3.cjs.entry.js +367 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pos-app-document-viewer.cjs.entry.js +28 -0
- package/dist/cjs/pos-app-generic.cjs.entry.js +16 -0
- package/dist/cjs/pos-app-image-viewer.cjs.entry.js +29 -0
- package/dist/cjs/pos-app-rdf-document.cjs.entry.js +16 -0
- package/dist/cjs/pos-description_2.cjs.entry.js +40 -0
- package/dist/cjs/pos-document.cjs.entry.js +67 -0
- package/dist/cjs/pos-relations_2.cjs.entry.js +45 -0
- package/dist/cjs/pos-subjects.cjs.entry.js +28 -0
- package/dist/collection/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.js → pos-app-document-viewer/pos-app-document-viewer.js} +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/{pos-pdf/pos-pdf.css → pos-document/pos-document.css} +0 -0
- package/dist/collection/components/{pos-pdf/pos-pdf.js → pos-document/pos-document.js} +4 -4
- package/dist/collection/components/pos-type-router/pos-type-router.js +3 -12
- package/dist/collection/components/pos-type-router/selectAppForTypes.js +24 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/pos-app-browser.js +46 -184
- package/dist/components/pos-app-document-viewer.d.ts +11 -0
- package/dist/components/{pos-app-pdf-viewer2.js → pos-app-document-viewer.js} +50 -47
- package/dist/components/pos-app-generic.js +192 -1
- package/dist/components/pos-app-image-viewer.js +160 -1
- package/dist/components/pos-app-rdf-document.js +168 -1
- package/dist/components/{pos-pdf.d.ts → pos-document.d.ts} +4 -4
- package/dist/components/pos-document.js +6 -0
- package/dist/components/{pos-pdf2.js → pos-document2.js} +8 -8
- package/dist/components/pos-router2.js +18 -180
- package/dist/components/pos-type-router2.js +28 -217
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/{p-145ab600.entry.js → p-0ed0e3ba.entry.js} +1 -1
- package/dist/elements/{p-5808c505.js → p-12407693.js} +1 -1
- package/dist/elements/p-1688668c.entry.js +1 -0
- package/dist/elements/{p-85d6f579.entry.js → p-16afe2d7.entry.js} +1 -1
- package/dist/elements/{p-f4b358b2.entry.js → p-1a9cdd0b.entry.js} +1 -1
- package/dist/elements/{p-8ed61030.entry.js → p-21a6c0d5.entry.js} +1 -1
- package/dist/elements/{p-1e3bbab1.entry.js → p-24fffcb6.entry.js} +1 -1
- package/dist/elements/p-2ca5f7f2.entry.js +5 -0
- package/dist/elements/{p-7fc32e8d.entry.js → p-2eced374.entry.js} +1 -1
- package/dist/elements/p-301096a8.entry.js +1 -0
- package/dist/elements/{p-2a9a9bb1.entry.js → p-35faa0fa.entry.js} +1 -1
- package/dist/elements/{p-f851b91a.js → p-37c43290.js} +2 -2
- package/dist/elements/p-3f0dec28.entry.js +1 -0
- package/dist/elements/p-410c567f.entry.js +1 -0
- package/dist/elements/p-417ecc9e.js +1 -0
- package/dist/elements/p-43717c61.js +1 -0
- package/dist/elements/{p-b57b6dfe.entry.js → p-573e7d6e.entry.js} +1 -1
- package/dist/elements/{p-ec8c13e0.entry.js → p-59680588.entry.js} +1 -1
- package/dist/elements/p-5fe41c08.entry.js +1 -0
- package/dist/elements/p-68110709.entry.js +1 -0
- package/dist/elements/{p-29c0f03f.js → p-6ed079a5.js} +2 -2
- package/dist/elements/p-709fd743.entry.js +1 -0
- package/dist/elements/p-73648481.entry.js +1 -0
- package/dist/elements/p-784b06b3.entry.js +1 -0
- package/dist/elements/p-84cc1417.entry.js +1 -0
- package/dist/elements/p-8596ddbc.js +4 -0
- package/dist/elements/{p-b0d8c4f0.entry.js → p-8c0124df.entry.js} +1 -1
- package/dist/elements/{p-020dee35.entry.js → p-a48e16ba.entry.js} +1 -1
- package/dist/elements/p-ab11bb11.js +4 -0
- package/dist/elements/{p-8a24508e.entry.js → p-ae87571c.entry.js} +1 -1
- package/dist/elements/p-b2acbe46.entry.js +1 -0
- package/dist/elements/p-babdb154.entry.js +9 -0
- package/dist/elements/{p-9c719139.js → p-bb128f00.js} +1 -1
- package/dist/elements/{p-fe753f07.entry.js → p-c442a411.entry.js} +1 -1
- package/dist/elements/{p-b36873af.entry.js → p-c4d119d2.entry.js} +1 -1
- package/dist/elements/p-eea7ce93.js +116 -0
- package/dist/elements/p-f72edc68.entry.js +1 -0
- package/dist/elements/{p-6987a85b.entry.js → p-ffb33569.entry.js} +1 -1
- package/dist/esm/BrokenFile-e1e68cb6.js +223 -0
- package/dist/esm/ResourceAware-845001bb.js +5 -0
- package/dist/esm/{data-62c81c24.js → data-2c0eab05.js} +1 -1
- package/dist/esm/elements.js +1 -1
- package/dist/esm/{index-ebf7f059.js → index-38d8370e.js} +1 -1
- package/dist/esm/{index-1f3d8582.js → index-47f5cd9a.js} +1 -1
- package/dist/{cjs/ion-app_48.cjs.entry.js → esm/index-5c6f4d9d.js} +6 -4174
- package/dist/esm/{index-65ecd543.js → index-753825bf.js} +1 -1
- package/dist/esm/{input-shims-8a389148.js → input-shims-167ef062.js} +2 -2
- package/dist/esm/ion-accordion.entry.js +1 -1
- package/dist/esm/ion-app_25.entry.js +3015 -0
- package/dist/esm/ion-back-button.entry.js +1 -1
- package/dist/esm/ion-badge_7.entry.js +248 -0
- package/dist/esm/ion-breadcrumb.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +2 -2
- package/dist/esm/ion-datetime.entry.js +3 -3
- package/dist/esm/ion-fab-button.entry.js +1 -1
- package/dist/esm/ion-infinite-scroll.entry.js +2 -2
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-item-divider_3.entry.js +103 -0
- package/dist/esm/ion-item-sliding.entry.js +2 -2
- package/dist/esm/ion-item_3.entry.js +361 -0
- package/dist/esm/ion-menu-button.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +2 -2
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-refresher-content.entry.js +1 -1
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +2 -2
- package/dist/esm/ion-reorder.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pos-app-document-viewer.entry.js +24 -0
- package/dist/esm/pos-app-generic.entry.js +12 -0
- package/dist/esm/pos-app-image-viewer.entry.js +25 -0
- package/dist/esm/pos-app-rdf-document.entry.js +12 -0
- package/dist/esm/pos-description_2.entry.js +35 -0
- package/dist/esm/pos-document.entry.js +63 -0
- package/dist/esm/pos-relations_2.entry.js +40 -0
- package/dist/esm/pos-subjects.entry.js +24 -0
- package/dist/esm/{status-tap-33623c88.js → status-tap-ce25f9e5.js} +2 -2
- package/dist/types/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.d.ts → pos-app-document-viewer/pos-app-document-viewer.d.ts} +1 -1
- package/dist/types/components/{pos-pdf/pos-pdf.d.ts → pos-document/pos-document.d.ts} +1 -1
- package/dist/types/components/pos-type-router/selectAppForTypes.d.ts +8 -0
- package/dist/types/components.d.ts +40 -40
- package/package.json +1 -1
- package/dist/components/pos-app-generic2.js +0 -194
- package/dist/components/pos-app-image-viewer2.js +0 -162
- package/dist/components/pos-app-pdf-viewer.d.ts +0 -11
- package/dist/components/pos-app-pdf-viewer.js +0 -6
- package/dist/components/pos-app-rdf-document2.js +0 -170
- package/dist/components/pos-pdf.js +0 -6
- package/dist/elements/p-10cae467.js +0 -4
- package/dist/elements/p-19e4a688.js +0 -4
- package/dist/elements/p-5f811ad7.entry.js +0 -1
- package/dist/elements/p-7a79a3cd.entry.js +0 -128
- package/dist/elements/p-b9a87655.entry.js +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const ResourceAware = require('./ResourceAware-f1aac952.js');
|
|
7
|
+
|
|
8
|
+
const PosAppDocumentViewer = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
12
|
+
this.receiveResource = (resource) => {
|
|
13
|
+
this.resource = resource;
|
|
14
|
+
};
|
|
15
|
+
this.resource = undefined;
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
ResourceAware.subscribeResource(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
if (!this.resource) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return (index.h("ion-grid", null, index.h("ion-row", null, index.h("ion-col", { size: "12", "size-sm": true }, index.h("pos-document", { src: this.resource.uri })), index.h("ion-col", { size: "12", "size-sm": true }, index.h("ion-card", null, index.h("ion-card-header", null, index.h("ion-card-title", null, index.h("pos-label", null), index.h("pos-type-badges", null)), index.h("pos-literals", null)))))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.pos_app_document_viewer = PosAppDocumentViewer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
|
|
7
|
+
const PosAppGeneric = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h("ion-grid", null, index.h("ion-row", null, index.h("ion-col", { size: "12", "size-sm": true }, index.h("ion-card", null, index.h("ion-card-header", null, index.h("pos-type-badges", null), index.h("pos-picture", null), index.h("ion-card-title", null, index.h("pos-label", null))), index.h("ion-card-content", null, index.h("pos-description", null)))), index.h("ion-col", { size: "12", "size-sm": true }, index.h("pos-literals", null)), index.h("ion-col", { size: "12", "size-sm": true }, index.h("pos-relations", null), index.h("pos-reverse-relations", null)))));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.pos_app_generic = PosAppGeneric;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const ResourceAware = require('./ResourceAware-f1aac952.js');
|
|
7
|
+
|
|
8
|
+
const PosAppImageViewer = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
12
|
+
this.receiveResource = (resource) => {
|
|
13
|
+
this.resource = resource;
|
|
14
|
+
};
|
|
15
|
+
this.resource = undefined;
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
ResourceAware.subscribeResource(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
if (!this.resource) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return (index.h("ion-grid", null, index.h("ion-row", null, index.h("ion-col", { size: "12", "size-sm": true }, index.h("pos-image", { src: this.resource.uri })), index.h("ion-col", { size: "12", "size-sm": true }, index.h("ion-card", null, index.h("ion-card-header", null, index.h("ion-card-title", null, index.h("pos-label", null), index.h("pos-type-badges", null)), index.h("pos-literals", null)))))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
PosAppImageViewer.style = "pos-image {\n --max-width: 100%;\n }";
|
|
28
|
+
|
|
29
|
+
exports.pos_app_image_viewer = PosAppImageViewer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
|
|
7
|
+
const PosAppRdfDocument = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h("ion-grid", null, index.h("ion-row", null, index.h("ion-col", { size: "12", "size-sm": true }, index.h("pos-subjects", null)), index.h("ion-col", { size: "12", "size-sm": true }, index.h("ion-card", null, index.h("ion-card-header", null, index.h("ion-card-title", null, index.h("pos-label", null), index.h("pos-type-badges", null)), index.h("pos-literals", null)))))));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.pos_app_rdf_document = PosAppRdfDocument;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const ResourceAware = require('./ResourceAware-f1aac952.js');
|
|
7
|
+
|
|
8
|
+
const PosDescription = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
12
|
+
this.receiveResource = (resource) => {
|
|
13
|
+
this.resource = resource;
|
|
14
|
+
};
|
|
15
|
+
this.resource = undefined;
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
ResourceAware.subscribeResource(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return this.resource ? this.resource.description() : null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const PosRichLink = class {
|
|
26
|
+
constructor(hostRef) {
|
|
27
|
+
index.registerInstance(this, hostRef);
|
|
28
|
+
this.linkEmitter = index.createEvent(this, "pod-os:link", 7);
|
|
29
|
+
this.uri = undefined;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (index.h("pos-resource", { lazy: true, uri: this.uri }, index.h("ion-item", { href: this.uri, onClick: e => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
this.linkEmitter.emit(this.uri);
|
|
35
|
+
} }, index.h("ion-label", null, index.h("pos-label", null), index.h("p", null, index.h("ion-label", { style: { maxWidth: '50rem' } }, index.h("pos-description", null))), index.h("p", null, index.h("a", { href: this.uri }, this.uri))))));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.pos_description = PosDescription;
|
|
40
|
+
exports.pos_rich_link = PosRichLink;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const BrokenFile = require('./BrokenFile-b01d72da.js');
|
|
7
|
+
|
|
8
|
+
const posDocumentCss = "iframe{width:100%;height:100vh}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";
|
|
9
|
+
|
|
10
|
+
const PosDocument = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.initializeOsEmitter = index.createEvent(this, "pod-os:init", 7);
|
|
14
|
+
this.setOs = async (os) => {
|
|
15
|
+
this.os = os;
|
|
16
|
+
};
|
|
17
|
+
this.src = undefined;
|
|
18
|
+
this.alt = undefined;
|
|
19
|
+
this.os = undefined;
|
|
20
|
+
this.dataUri = undefined;
|
|
21
|
+
this.brokenFile = undefined;
|
|
22
|
+
this.error = undefined;
|
|
23
|
+
this.loading = true;
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
BrokenFile.store.onChange('isLoggedIn', () => this.fetchBlob());
|
|
27
|
+
this.initializeOsEmitter.emit(this.setOs);
|
|
28
|
+
}
|
|
29
|
+
async fetchBlob() {
|
|
30
|
+
try {
|
|
31
|
+
this.loading = true;
|
|
32
|
+
const file = await this.os.fetchFile(this.src);
|
|
33
|
+
if (file.blob()) {
|
|
34
|
+
this.dataUri = URL.createObjectURL(file.blob());
|
|
35
|
+
this.error = null;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.brokenFile = file;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
this.error = err;
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
this.loading = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
if (this.loading) {
|
|
50
|
+
return index.h("ion-skeleton-text", { animated: true });
|
|
51
|
+
}
|
|
52
|
+
if (this.error) {
|
|
53
|
+
return index.h("div", { class: "error" }, this.error.message);
|
|
54
|
+
}
|
|
55
|
+
if (this.brokenFile) {
|
|
56
|
+
return index.h(BrokenFile.BrokenFile, { file: this.brokenFile });
|
|
57
|
+
}
|
|
58
|
+
return index.h("iframe", { src: this.dataUri });
|
|
59
|
+
}
|
|
60
|
+
static get watchers() { return {
|
|
61
|
+
"os": ["fetchBlob"],
|
|
62
|
+
"src": ["fetchBlob"]
|
|
63
|
+
}; }
|
|
64
|
+
};
|
|
65
|
+
PosDocument.style = posDocumentCss;
|
|
66
|
+
|
|
67
|
+
exports.pos_document = PosDocument;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const ResourceAware = require('./ResourceAware-f1aac952.js');
|
|
7
|
+
|
|
8
|
+
const PosRelations = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
12
|
+
this.receiveResource = (resource) => {
|
|
13
|
+
this.data = resource.relations();
|
|
14
|
+
};
|
|
15
|
+
this.data = [];
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
ResourceAware.subscribeResource(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const items = this.data.map(it => (index.h("ion-item-group", null, index.h("ion-item-divider", null, index.h("ion-label", null, it.predicate)), it.uris.map(uri => (index.h("pos-rich-link", { uri: uri }))))));
|
|
22
|
+
return this.data.length > 0 ? index.h("ion-list", null, items) : null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const PosReverseRelations = class {
|
|
27
|
+
constructor(hostRef) {
|
|
28
|
+
index.registerInstance(this, hostRef);
|
|
29
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
30
|
+
this.receiveResource = (resource) => {
|
|
31
|
+
this.data = resource.reverseRelations();
|
|
32
|
+
};
|
|
33
|
+
this.data = [];
|
|
34
|
+
}
|
|
35
|
+
componentWillLoad() {
|
|
36
|
+
ResourceAware.subscribeResource(this);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const items = this.data.map(it => (index.h("ion-item-group", null, index.h("ion-item-divider", null, index.h("ion-label", null, "is ", it.predicate, " of")), it.uris.map(uri => (index.h("pos-rich-link", { uri: uri }))))));
|
|
40
|
+
return this.data.length > 0 ? index.h("ion-list", null, items) : null;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.pos_relations = PosRelations;
|
|
45
|
+
exports.pos_reverse_relations = PosReverseRelations;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4018a65a.js');
|
|
6
|
+
const index$1 = require('./index-74c56a41.js');
|
|
7
|
+
const ResourceAware = require('./ResourceAware-f1aac952.js');
|
|
8
|
+
|
|
9
|
+
const PosSubjects = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
|
|
13
|
+
this.receiveResource = (resource) => {
|
|
14
|
+
const doc = resource.assume(index$1.RdfDocument);
|
|
15
|
+
this.data = doc.subjects();
|
|
16
|
+
};
|
|
17
|
+
this.data = [];
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
ResourceAware.subscribeResource(this);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const items = this.data.map(it => index.h("pos-rich-link", { uri: it.uri }));
|
|
24
|
+
return this.data.length > 0 ? index.h("ion-list", null, items) : null;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.pos_subjects = PosSubjects;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { subscribeResource } from '../../components/events/ResourceAware';
|
|
3
|
-
export class
|
|
3
|
+
export class PosAppDocumentViewer {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.receiveResource = (resource) => {
|
|
6
6
|
this.resource = resource;
|
|
@@ -14,9 +14,9 @@ export class PosAppPdfViewer {
|
|
|
14
14
|
if (!this.resource) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
return (h("ion-grid", null, h("ion-row", null, h("ion-col", { size: "12", "size-sm": true }, h("pos-
|
|
17
|
+
return (h("ion-grid", null, h("ion-row", null, h("ion-col", { size: "12", "size-sm": true }, h("pos-document", { src: this.resource.uri })), h("ion-col", { size: "12", "size-sm": true }, h("ion-card", null, h("ion-card-header", null, h("ion-card-title", null, h("pos-label", null), h("pos-type-badges", null)), h("pos-literals", null)))))));
|
|
18
18
|
}
|
|
19
|
-
static get is() { return "pos-app-
|
|
19
|
+
static get is() { return "pos-app-document-viewer"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|
|
21
21
|
static get states() {
|
|
22
22
|
return {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
3
|
"./apps/pos-app-browser/pos-app-browser.js",
|
|
4
|
+
"./apps/pos-app-document-viewer/pos-app-document-viewer.js",
|
|
4
5
|
"./apps/pos-app-generic/pos-app-generic.js",
|
|
5
6
|
"./apps/pos-app-image-viewer/pos-app-image-viewer.js",
|
|
6
|
-
"./apps/pos-app-pdf-viewer/pos-app-pdf-viewer.js",
|
|
7
7
|
"./apps/pos-app-rdf-document/pos-app-rdf-document.js",
|
|
8
8
|
"./components/pos-app/pos-app.js",
|
|
9
9
|
"./components/pos-description/pos-description.js",
|
|
10
|
+
"./components/pos-document/pos-document.js",
|
|
10
11
|
"./components/pos-image/pos-image.js",
|
|
11
12
|
"./components/pos-label/pos-label.js",
|
|
12
13
|
"./components/pos-literals/pos-literals.js",
|
|
13
14
|
"./components/pos-login/pos-login.js",
|
|
14
15
|
"./components/pos-navigation-bar/pos-navigation-bar.js",
|
|
15
|
-
"./components/pos-pdf/pos-pdf.js",
|
|
16
16
|
"./components/pos-picture/pos-picture.js",
|
|
17
17
|
"./components/pos-relations/pos-relations.js",
|
|
18
18
|
"./components/pos-resource/pos-resource.js",
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import session from '../../store/session';
|
|
3
3
|
import { BrokenFile } from '../broken-file/BrokenFile';
|
|
4
|
-
export class
|
|
4
|
+
export class PosDocument {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.setOs = async (os) => {
|
|
7
7
|
this.os = os;
|
|
@@ -49,16 +49,16 @@ export class PosPdf {
|
|
|
49
49
|
}
|
|
50
50
|
return h("iframe", { src: this.dataUri });
|
|
51
51
|
}
|
|
52
|
-
static get is() { return "pos-
|
|
52
|
+
static get is() { return "pos-document"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
54
54
|
static get originalStyleUrls() {
|
|
55
55
|
return {
|
|
56
|
-
"$": ["pos-
|
|
56
|
+
"$": ["pos-document.css"]
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
static get styleUrls() {
|
|
60
60
|
return {
|
|
61
|
-
"$": ["pos-
|
|
61
|
+
"$": ["pos-document.css"]
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
static get properties() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { subscribeResource } from '../events/ResourceAware';
|
|
3
|
+
import { selectAppForTypes } from './selectAppForTypes';
|
|
3
4
|
export class PosTypeRouter {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.receiveResource = (resource) => {
|
|
@@ -14,18 +15,8 @@ export class PosTypeRouter {
|
|
|
14
15
|
return this.types ? this.renderApp() : null;
|
|
15
16
|
}
|
|
16
17
|
renderApp() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
else if (this.types.some(type => type.uri === 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource')) {
|
|
21
|
-
return h("pos-app-pdf-viewer", null);
|
|
22
|
-
}
|
|
23
|
-
else if (this.types.some(type => type.uri === 'http://purl.org/dc/terms/Image')) {
|
|
24
|
-
return h("pos-app-image-viewer", null);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return h("pos-app-generic", null);
|
|
28
|
-
}
|
|
18
|
+
const App = selectAppForTypes(this.types);
|
|
19
|
+
return h(App, null);
|
|
29
20
|
}
|
|
30
21
|
static get is() { return "pos-type-router"; }
|
|
31
22
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var AvailableApps;
|
|
2
|
+
(function (AvailableApps) {
|
|
3
|
+
AvailableApps["Generic"] = "pos-app-generic";
|
|
4
|
+
AvailableApps["RdfDocument"] = "pos-app-rdf-document";
|
|
5
|
+
AvailableApps["DocumentViewer"] = "pos-app-document-viewer";
|
|
6
|
+
AvailableApps["ImageViewer"] = "pos-app-image-viewer";
|
|
7
|
+
})(AvailableApps || (AvailableApps = {}));
|
|
8
|
+
export function selectAppForTypes(types) {
|
|
9
|
+
if (types.some(type => type.uri === 'http://www.w3.org/2007/ont/link#RDFDocument')) {
|
|
10
|
+
return AvailableApps.RdfDocument;
|
|
11
|
+
}
|
|
12
|
+
else if (types.some(type => type.uri === 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource')) {
|
|
13
|
+
return AvailableApps.DocumentViewer;
|
|
14
|
+
}
|
|
15
|
+
else if (types.some(type => type.uri === 'http://purl.org/dc/terms/Image')) {
|
|
16
|
+
return AvailableApps.ImageViewer;
|
|
17
|
+
}
|
|
18
|
+
else if (types.some(type => type.uri === 'http://www.w3.org/2007/ont/link#Document')) {
|
|
19
|
+
return AvailableApps.DocumentViewer;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return AvailableApps.Generic;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* elements custom elements */
|
|
2
2
|
export { PosApp as PosApp } from '../types/components/pos-app/pos-app';
|
|
3
3
|
export { PosAppBrowser as PosAppBrowser } from '../types/apps/pos-app-browser/pos-app-browser';
|
|
4
|
+
export { PosAppDocumentViewer as PosAppDocumentViewer } from '../types/apps/pos-app-document-viewer/pos-app-document-viewer';
|
|
4
5
|
export { PosAppGeneric as PosAppGeneric } from '../types/apps/pos-app-generic/pos-app-generic';
|
|
5
6
|
export { PosAppImageViewer as PosAppImageViewer } from '../types/apps/pos-app-image-viewer/pos-app-image-viewer';
|
|
6
|
-
export { PosAppPdfViewer as PosAppPdfViewer } from '../types/apps/pos-app-pdf-viewer/pos-app-pdf-viewer';
|
|
7
7
|
export { PosAppRdfDocument as PosAppRdfDocument } from '../types/apps/pos-app-rdf-document/pos-app-rdf-document';
|
|
8
8
|
export { PosDescription as PosDescription } from '../types/components/pos-description/pos-description';
|
|
9
|
+
export { PosDocument as PosDocument } from '../types/components/pos-document/pos-document';
|
|
9
10
|
export { PosImage as PosImage } from '../types/components/pos-image/pos-image';
|
|
10
11
|
export { PosLabel as PosLabel } from '../types/components/pos-label/pos-label';
|
|
11
12
|
export { PosLiterals as PosLiterals } from '../types/components/pos-literals/pos-literals';
|
|
12
13
|
export { PosLogin as PosLogin } from '../types/components/pos-login/pos-login';
|
|
13
14
|
export { PosNavigationBar as PosNavigationBar } from '../types/components/pos-navigation-bar/pos-navigation-bar';
|
|
14
|
-
export { PosPdf as PosPdf } from '../types/components/pos-pdf/pos-pdf';
|
|
15
15
|
export { PosPicture as PosPicture } from '../types/components/pos-picture/pos-picture';
|
|
16
16
|
export { PosRelations as PosRelations } from '../types/components/pos-relations/pos-relations';
|
|
17
17
|
export { PosResource as PosResource } from '../types/components/pos-resource/pos-resource';
|
package/dist/components/index.js
CHANGED
|
@@ -97,17 +97,17 @@ export { IonToolbar, defineCustomElement as defineCustomElementIonToolbar } from
|
|
|
97
97
|
export { IonVirtualScroll, defineCustomElement as defineCustomElementIonVirtualScroll } from './ion-virtual-scroll.js';
|
|
98
98
|
export { PosApp, defineCustomElement as defineCustomElementPosApp } from './pos-app.js';
|
|
99
99
|
export { PosAppBrowser, defineCustomElement as defineCustomElementPosAppBrowser } from './pos-app-browser.js';
|
|
100
|
+
export { PosAppDocumentViewer, defineCustomElement as defineCustomElementPosAppDocumentViewer } from './pos-app-document-viewer.js';
|
|
100
101
|
export { PosAppGeneric, defineCustomElement as defineCustomElementPosAppGeneric } from './pos-app-generic.js';
|
|
101
102
|
export { PosAppImageViewer, defineCustomElement as defineCustomElementPosAppImageViewer } from './pos-app-image-viewer.js';
|
|
102
|
-
export { PosAppPdfViewer, defineCustomElement as defineCustomElementPosAppPdfViewer } from './pos-app-pdf-viewer.js';
|
|
103
103
|
export { PosAppRdfDocument, defineCustomElement as defineCustomElementPosAppRdfDocument } from './pos-app-rdf-document.js';
|
|
104
104
|
export { PosDescription, defineCustomElement as defineCustomElementPosDescription } from './pos-description.js';
|
|
105
|
+
export { PosDocument, defineCustomElement as defineCustomElementPosDocument } from './pos-document.js';
|
|
105
106
|
export { PosImage, defineCustomElement as defineCustomElementPosImage } from './pos-image.js';
|
|
106
107
|
export { PosLabel, defineCustomElement as defineCustomElementPosLabel } from './pos-label.js';
|
|
107
108
|
export { PosLiterals, defineCustomElement as defineCustomElementPosLiterals } from './pos-literals.js';
|
|
108
109
|
export { PosLogin, defineCustomElement as defineCustomElementPosLogin } from './pos-login.js';
|
|
109
110
|
export { PosNavigationBar, defineCustomElement as defineCustomElementPosNavigationBar } from './pos-navigation-bar.js';
|
|
110
|
-
export { PosPdf, defineCustomElement as defineCustomElementPosPdf } from './pos-pdf.js';
|
|
111
111
|
export { PosPicture, defineCustomElement as defineCustomElementPosPicture } from './pos-picture.js';
|
|
112
112
|
export { PosRelations, defineCustomElement as defineCustomElementPosRelations } from './pos-relations.js';
|
|
113
113
|
export { PosResource, defineCustomElement as defineCustomElementPosResource } from './pos-resource.js';
|