@pod-os/elements 0.36.0 → 0.37.0-rc.0b98c3c.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.
Files changed (140) hide show
  1. package/dist/cjs/{chunk.URTPIBTY-DdK9pL5v.js → chunk.URTPIBTY-FtbhZr1d.js} +2 -2
  2. package/dist/cjs/{chunk.XQ2OKYYA-DEkhm1i7.js → chunk.XQ2OKYYA-BpcNJ_Ey.js} +3 -3
  3. package/dist/cjs/{chunk.ZGGPD2XJ-uKZZdqOH.js → chunk.ZGGPD2XJ-DZsyTFqB.js} +1 -1
  4. package/dist/cjs/{class-map-DAZXfKKA.js → class-map-CF_MMTnq.js} +1 -1
  5. package/dist/cjs/elements.cjs.js +3 -3
  6. package/dist/cjs/{index-DCpu_nnH.js → index-CtUr8eOE.js} +525 -1988
  7. package/dist/cjs/{index-FUnpyb19.js → index-LDTTta4S.js} +863 -551
  8. package/dist/cjs/{jsonld-V2RB47OZ-BerQ9IRa.js → jsonld-V2RB47OZ-BWMHCZBW.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/pos-add-literal-value_3.cjs.entry.js +6 -6
  11. package/dist/cjs/{pos-add-new-thing_31.cjs.entry.js → pos-add-new-thing_32.cjs.entry.js} +109 -61
  12. package/dist/cjs/pos-app-document-viewer.cjs.entry.js +1 -1
  13. package/dist/cjs/pos-app-generic.cjs.entry.js +1 -1
  14. package/dist/cjs/pos-app-image-viewer.cjs.entry.js +1 -1
  15. package/dist/cjs/pos-app-ldp-container.cjs.entry.js +1 -1
  16. package/dist/cjs/pos-app-rdf-document.cjs.entry.js +1 -1
  17. package/dist/cjs/pos-attachments.cjs.entry.js +2 -2
  18. package/dist/cjs/pos-case.cjs.entry.js +24 -0
  19. package/dist/cjs/pos-container-contents.cjs.entry.js +2 -2
  20. package/dist/cjs/pos-container-item_3.cjs.entry.js +4 -4
  21. package/dist/cjs/pos-document.cjs.entry.js +4 -4
  22. package/dist/cjs/pos-list.cjs.entry.js +1 -1
  23. package/dist/cjs/pos-markdown-document.cjs.entry.js +2 -2
  24. package/dist/cjs/pos-relations_2.cjs.entry.js +1 -1
  25. package/dist/cjs/pos-subjects.cjs.entry.js +2 -2
  26. package/dist/cjs/pos-switch.cjs.entry.js +64 -0
  27. package/dist/cjs/pos-tool-attachments.cjs.entry.js +2 -2
  28. package/dist/cjs/pos-value.cjs.entry.js +1 -1
  29. package/dist/collection/collection-manifest.json +4 -1
  30. package/dist/collection/components/pos-app/pos-app.js +2 -1
  31. package/dist/collection/components/pos-attachments/pos-attachments.js +2 -1
  32. package/dist/collection/components/pos-container-contents/pos-create-new-container-item/pos-create-new-container-item.js +4 -2
  33. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +2 -1
  34. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +42 -22
  35. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +3 -2
  36. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  37. package/dist/collection/components/pos-router/pos-router.js +1 -1
  38. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  39. package/dist/collection/components/pos-share/openNewTab.js +3 -0
  40. package/dist/collection/components/pos-share/pos-share.css +36 -0
  41. package/dist/collection/components/pos-share/pos-share.js +100 -0
  42. package/dist/collection/components/pos-switch/pos-case/pos-case.js +88 -0
  43. package/dist/collection/components/pos-switch/pos-switch.js +89 -0
  44. package/dist/collection/components/pos-tool-select/pos-tool-select.js +6 -3
  45. package/dist/collection/components/pos-upload/pos-upload.js +7 -4
  46. package/dist/collection/components/pos-user-menu/pos-user-menu.js +1 -1
  47. package/dist/collection/tools/pos-tool-attachments/pos-tool-attachments.js +1 -1
  48. package/dist/components/chunk.IVVHNXMC.js +20 -0
  49. package/dist/components/index.js +1 -1
  50. package/dist/components/index2.js +2 -2
  51. package/dist/components/pos-add-literal-value2.js +1 -1
  52. package/dist/components/pos-app-browser.js +1 -1
  53. package/dist/components/pos-attachments2.js +1 -1
  54. package/dist/components/pos-case.d.ts +11 -0
  55. package/dist/components/pos-case.js +1 -0
  56. package/dist/components/pos-make-findable2.js +1 -1
  57. package/dist/components/pos-navigation-bar2.js +1 -1
  58. package/dist/components/pos-navigation2.js +1 -1
  59. package/dist/components/pos-new-thing-form2.js +1 -1
  60. package/dist/components/pos-router2.js +1 -1
  61. package/dist/components/pos-select-term2.js +1 -1
  62. package/dist/components/pos-share.d.ts +11 -0
  63. package/dist/components/pos-share.js +1 -0
  64. package/dist/components/pos-share2.js +1 -0
  65. package/dist/components/pos-switch.d.ts +11 -0
  66. package/dist/components/pos-switch.js +1 -0
  67. package/dist/components/pos-tool-attachments.js +1 -1
  68. package/dist/components/pos-tool-select2.js +1 -1
  69. package/dist/components/pos-type-index-entries2.js +1 -1
  70. package/dist/components/pos-upload2.js +1 -1
  71. package/dist/components/pos-user-menu2.js +6 -25
  72. package/dist/elements/elements.esm.js +1 -1
  73. package/dist/elements/{p-9ad80b52.entry.js → p-07347eaf.entry.js} +1 -1
  74. package/dist/elements/{p-a9a18aa8.entry.js → p-23465966.entry.js} +1 -1
  75. package/dist/elements/{p-c8ee910c.entry.js → p-3ab681fe.entry.js} +1 -1
  76. package/dist/elements/{p-dff14248.entry.js → p-43ec0395.entry.js} +1 -1
  77. package/dist/elements/p-48f3b092.entry.js +1 -0
  78. package/dist/elements/{p-fe628201.entry.js → p-5b3f911d.entry.js} +1 -1
  79. package/dist/elements/{p-6561f1b7.entry.js → p-5d3c9c45.entry.js} +1 -1
  80. package/dist/elements/p-76e4882d.entry.js +1 -0
  81. package/dist/elements/{p-701f2c84.entry.js → p-780b0e14.entry.js} +34 -34
  82. package/dist/elements/p-9827b860.entry.js +1 -0
  83. package/dist/elements/p-98f9f7d6.entry.js +1 -0
  84. package/dist/elements/p-BKjkoLi4.js +2 -0
  85. package/dist/elements/{p-BkAnMOpW.js → p-Bc1EKYmT.js} +4 -4
  86. package/dist/elements/{p-Doy_38_j.js → p-CdRXVHZH.js} +1 -1
  87. package/dist/elements/p-CelEckSK.js +11 -0
  88. package/dist/elements/p-DEDHdpnD.js +67 -0
  89. package/dist/elements/{p-CrxYqX8r.js → p-Db6M_T3c.js} +7 -7
  90. package/dist/elements/{p-a20b72d8.entry.js → p-c0a8227e.entry.js} +1 -1
  91. package/dist/elements/{p-0e7413e6.entry.js → p-d56da833.entry.js} +1 -1
  92. package/dist/elements/{p-3e18b5dd.entry.js → p-db535410.entry.js} +1 -1
  93. package/dist/elements/p-df626ff5.entry.js +1 -0
  94. package/dist/elements/{p-b5d64c6f.entry.js → p-e2b0460d.entry.js} +1 -1
  95. package/dist/elements/{p-9b74c400.entry.js → p-e3e41963.entry.js} +1 -1
  96. package/dist/elements/{p-b363349c.entry.js → p-f5eacaa1.entry.js} +1 -1
  97. package/dist/elements/{p-52a612ed.entry.js → p-f61ab5a9.entry.js} +1 -1
  98. package/dist/elements/{p-8q-RA2Uq.js → p-k0sEkqnd.js} +3 -3
  99. package/dist/esm/{chunk.URTPIBTY-CNA3-SLq.js → chunk.URTPIBTY-IRBXSr44.js} +2 -2
  100. package/dist/esm/{chunk.XQ2OKYYA-CXNlpYUG.js → chunk.XQ2OKYYA-DeSebP8q.js} +3 -3
  101. package/dist/esm/{chunk.ZGGPD2XJ-BjT6fS1o.js → chunk.ZGGPD2XJ-DNRLq49v.js} +1 -1
  102. package/dist/esm/{class-map-CUYFUkXU.js → class-map-CdQEGha6.js} +1 -1
  103. package/dist/esm/elements.js +4 -4
  104. package/dist/esm/{index-DFqG64hG.js → index-BF-69-JC.js} +863 -551
  105. package/dist/esm/{index-VMHzF3uY.js → index-BKjkoLi4.js} +525 -1988
  106. package/dist/esm/{jsonld-V2RB47OZ-CaIJ08AA.js → jsonld-V2RB47OZ-CWZbzWzV.js} +1 -1
  107. package/dist/esm/loader.js +3 -3
  108. package/dist/esm/pos-add-literal-value_3.entry.js +6 -6
  109. package/dist/esm/{pos-add-new-thing_31.entry.js → pos-add-new-thing_32.entry.js} +109 -62
  110. package/dist/esm/pos-app-document-viewer.entry.js +1 -1
  111. package/dist/esm/pos-app-generic.entry.js +1 -1
  112. package/dist/esm/pos-app-image-viewer.entry.js +1 -1
  113. package/dist/esm/pos-app-ldp-container.entry.js +1 -1
  114. package/dist/esm/pos-app-rdf-document.entry.js +1 -1
  115. package/dist/esm/pos-attachments.entry.js +2 -2
  116. package/dist/esm/pos-case.entry.js +22 -0
  117. package/dist/esm/pos-container-contents.entry.js +2 -2
  118. package/dist/esm/pos-container-item_3.entry.js +4 -4
  119. package/dist/esm/pos-document.entry.js +4 -4
  120. package/dist/esm/pos-list.entry.js +1 -1
  121. package/dist/esm/pos-markdown-document.entry.js +2 -2
  122. package/dist/esm/pos-relations_2.entry.js +1 -1
  123. package/dist/esm/pos-subjects.entry.js +2 -2
  124. package/dist/esm/pos-switch.entry.js +62 -0
  125. package/dist/esm/pos-tool-attachments.entry.js +2 -2
  126. package/dist/esm/pos-value.entry.js +1 -1
  127. package/dist/jest-setup.js +4 -0
  128. package/dist/types/components/pos-share/openNewTab.d.ts +1 -0
  129. package/dist/types/components/pos-share/pos-share.d.ts +26 -0
  130. package/dist/types/components/pos-switch/pos-case/pos-case.d.ts +22 -0
  131. package/dist/types/components/pos-switch/pos-switch.d.ts +19 -0
  132. package/dist/types/components.d.ts +300 -74
  133. package/dist/types/stencil-public-runtime.d.ts +50 -2
  134. package/package.json +5 -4
  135. package/dist/elements/p-0a087865.entry.js +0 -1
  136. package/dist/elements/p-637a38d9.entry.js +0 -1
  137. package/dist/elements/p-8ggjG2YF.js +0 -11
  138. package/dist/elements/p-LoCE14bN.js +0 -67
  139. package/dist/elements/p-VMHzF3uY.js +0 -2
  140. package/dist/elements/p-ac17ed6a.entry.js +0 -1
@@ -43,7 +43,10 @@
43
43
  "components/pos-rich-link/pos-rich-link.js",
44
44
  "components/pos-router/pos-router.js",
45
45
  "components/pos-select-term/pos-select-term.js",
46
+ "components/pos-share/pos-share.js",
46
47
  "components/pos-subjects/pos-subjects.js",
48
+ "components/pos-switch/pos-switch.js",
49
+ "components/pos-switch/pos-case/pos-case.js",
47
50
  "components/pos-tool-select/pos-tool-select.js",
48
51
  "components/pos-type-badges/pos-type-badges.js",
49
52
  "components/pos-type-index-entries/pos-type-index-entries.js",
@@ -55,7 +58,7 @@
55
58
  ],
56
59
  "compiler": {
57
60
  "name": "@stencil/core",
58
- "version": "4.40.1",
61
+ "version": "4.43.0",
59
62
  "typescriptVersion": "5.8.3"
60
63
  },
61
64
  "collections": [],
@@ -126,7 +126,8 @@ export class PosApp {
126
126
  "PodOS": {
127
127
  "location": "import",
128
128
  "path": "@pod-os/core",
129
- "id": "../core/types/index.d.ts::PodOS"
129
+ "id": "../core/types/index.d.ts::PodOS",
130
+ "referenceLocation": "PodOS"
130
131
  }
131
132
  }
132
133
  }
@@ -63,7 +63,8 @@ export class PosAttachments {
63
63
  "Attachment": {
64
64
  "location": "import",
65
65
  "path": "@pod-os/core",
66
- "id": "../core/types/index.d.ts::Attachment"
66
+ "id": "../core/types/index.d.ts::Attachment",
67
+ "referenceLocation": "Attachment"
67
68
  }
68
69
  },
69
70
  "return": "Promise<void>"
@@ -85,7 +85,8 @@ export class PosCreateNewContainerItem {
85
85
  "LdpContainer": {
86
86
  "location": "import",
87
87
  "path": "@pod-os/core",
88
- "id": "../core/types/index.d.ts::LdpContainer"
88
+ "id": "../core/types/index.d.ts::LdpContainer",
89
+ "referenceLocation": "LdpContainer"
89
90
  }
90
91
  }
91
92
  },
@@ -139,7 +140,8 @@ export class PosCreateNewContainerItem {
139
140
  "Problem": {
140
141
  "location": "import",
141
142
  "path": "@pod-os/core",
142
- "id": "../core/types/index.d.ts::Problem"
143
+ "id": "../core/types/index.d.ts::Problem",
144
+ "referenceLocation": "Problem"
143
145
  }
144
146
  }
145
147
  }
@@ -92,7 +92,8 @@ export class PosMarkdownDocument {
92
92
  "SolidFile": {
93
93
  "location": "import",
94
94
  "path": "@pod-os/core",
95
- "id": "../core/types/index.d.ts::SolidFile"
95
+ "id": "../core/types/index.d.ts::SolidFile",
96
+ "referenceLocation": "SolidFile"
96
97
  }
97
98
  }
98
99
  },
@@ -1,5 +1,8 @@
1
1
  section.current {
2
2
  display: flex;
3
+ align-items: center;
4
+ box-sizing: border-box;
5
+ padding: 0 var(--size-2);
3
6
  height: var(--pos-navigation-bar-height);
4
7
  flex-grow: 1;
5
8
  gap: 0;
@@ -9,30 +12,47 @@ section.current {
9
12
  &:focus-within {
10
13
  outline: var(--pos-input-focus-outline);
11
14
  }
12
- }
13
15
 
14
- section.current button {
15
- cursor: pointer;
16
- font-size: var(--scale-1);
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- flex-grow: 1;
21
- background: none;
22
- color: var(--pos-normal-text-color);
23
- outline: none;
24
- border: none;
25
- overflow: hidden;
26
- text-overflow: ellipsis;
27
- white-space: nowrap;
28
- &:focus {
29
- text-decoration: underline;
30
- }
31
- :first-child {
16
+ button {
17
+ cursor: pointer;
18
+ font-size: var(--scale-1);
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
32
22
  flex-grow: 1;
23
+ background: none;
24
+ color: var(--pos-normal-text-color);
25
+ outline: none;
26
+ border: none;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ white-space: nowrap;
30
+ &:focus {
31
+ text-decoration: underline;
32
+ }
33
+ :first-child {
34
+ flex-grow: 1;
35
+ }
36
+ svg {
37
+ width: var(--size-6);
38
+ color: var(--pos-subtle-text-color);
39
+ }
33
40
  }
34
- svg {
35
- width: var(--size-6);
36
- color: var(--pos-subtle-text-color);
41
+ pos-share {
42
+ height: 80%;
43
+ &:hover {
44
+ &::part(button) {
45
+ color: var(--pos-primary-color);
46
+ background-color: var(--pos-border-color);
47
+ border-radius: var(--radius-full);
48
+ }
49
+ }
50
+ &::part(button) {
51
+ font-size: var(--size-4);
52
+ background: none;
53
+ outline: none;
54
+ border: none;
55
+ color: var(--pos-subtle-text-color);
56
+ }
37
57
  }
38
58
  }
@@ -11,7 +11,7 @@ export class PosNavigationBar {
11
11
  }
12
12
  render() {
13
13
  const ariaLabel = this.current ? `${this.current.label()} (Click to search or enter URI)` : 'Search or enter URI';
14
- return (h("section", { key: '5f49aa9dad9d07550ee8ffbee90036cbc1efda55', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: '85974a4772aaf8cad3a11cdcd49e6df10141bfe3', uri: this.current.uri }), h("button", { key: '40660a3455b0f3392c68d7aea0075b102a1762a2', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: '9ab8922175d701f714f72aefb95745cf5ae4bb95' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon())));
14
+ return (h("section", { key: '5f49aa9dad9d07550ee8ffbee90036cbc1efda55', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: '85974a4772aaf8cad3a11cdcd49e6df10141bfe3', uri: this.current.uri }), h("button", { key: '40660a3455b0f3392c68d7aea0075b102a1762a2', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: '9ab8922175d701f714f72aefb95745cf5ae4bb95' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon()), this.current && h("pos-share", { key: '3b80c1987f9f5138b11b8a106171fc73a236f426', uri: this.current.uri })));
15
15
  }
16
16
  icon() {
17
17
  return (h("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" })));
@@ -40,7 +40,8 @@ export class PosNavigationBar {
40
40
  "Thing": {
41
41
  "location": "import",
42
42
  "path": "@pod-os/core",
43
- "id": "../core/types/index.d.ts::Thing"
43
+ "id": "../core/types/index.d.ts::Thing",
44
+ "referenceLocation": "Thing"
44
45
  }
45
46
  }
46
47
  },
@@ -14,7 +14,7 @@ export class PosNewThingForm {
14
14
  subscribePodOs(this);
15
15
  }
16
16
  render() {
17
- return (h("form", { key: 'a362c5b749dd744123973987ff8b0291485b465e', method: "dialog", onSubmit: e => this.handleSubmit(e) }, h("label", { key: '45c78b0b48955cc157d04f547285b4ae4c19c38f', htmlFor: "type" }, "Type"), h("pos-select-term", { key: 'e3c3ab9abdbbb585916d95ba1aa14a066dbc5bd0', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), h("label", { key: 'c696f8ed862d40d3c366ef0ede5e88e574928db3', htmlFor: "name" }, "Name"), h("input", { key: '89e6289e24ca9d3969da97c7aeb22224db1c376c', id: "name", type: "text", value: this.name, onInput: e => this.handleChange(e) }), this.newUri ? (h("div", { id: "new-uri", title: "This will be the URI of the new thing" }, this.newUri)) : null, h("input", { key: 'b9520afef34177c6f14ab0798c045536d5661a2a', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
17
+ return (h("form", { key: '64781cfb0e570d2368325d674c6637c581bb87c2', method: "dialog", onSubmit: e => this.handleSubmit(e) }, h("label", { key: '409e04f147430042eb334024fc7061574ab543cf', htmlFor: "type" }, "Type"), h("pos-select-term", { key: '8d5d580ee1f1e2e2c60cac0cc06798e94a0d28c3', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), h("label", { key: 'a45199618751e24b7d4a1bc13ad85c599cc93d1c', htmlFor: "name" }, "Name"), h("input", { key: 'bee3be7a680abbffc08caa5c549b68b1e653872d', id: "name", type: "text", value: this.name, onInput: e => this.handleChange(e) }), this.newUri ? (h("div", { id: "new-uri", title: "This will be the URI of the new thing" }, this.newUri)) : null, h("input", { key: 'e8fab4d442188f7f2f325ff7bde3dce6d3f772f6', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
18
18
  }
19
19
  handleChange(event) {
20
20
  this.name = event.target.value;
@@ -38,7 +38,7 @@ export class PosRouter {
38
38
  this.routeChanged.emit(this.uri);
39
39
  }
40
40
  render() {
41
- return h("slot", { key: '8b09de3dbbd253665cd541b9f264b0dcdc774354' });
41
+ return h("slot", { key: '2775fc2835158ccd8d540e4f27edfd497eafe7a9' });
42
42
  }
43
43
  static get is() { return "pos-router"; }
44
44
  static get originalStyleUrls() {
@@ -19,7 +19,7 @@ export class PosSelectTerm {
19
19
  this.termSelected.emit({ uri: event.target.value });
20
20
  }
21
21
  render() {
22
- return (h(Host, { key: '2e995b15a3b76a13cd7e11d09670121a6191b5ce' }, h("input", { key: 'ad79f1b410312790d4f5cd1f398b2eec3c04aad7', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: 'e3cc9ce85b75033bac29a32ca8e55c57535a9659', part: "terms", id: "terms" }, this.terms.map(term => (h("option", { value: term.uri }, term.shorthand))))));
22
+ return (h(Host, { key: 'a4050d72acd62d907f0fd4c3b90c54194700871c' }, h("input", { key: '99b35c4a14a2623599ba237bb4af0b79c0761196', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: 'd64ad5ea83200014c6de5cd4720f29922494982c', part: "terms", id: "terms" }, this.terms.map(term => (h("option", { value: term.uri }, term.shorthand))))));
23
23
  }
24
24
  static get is() { return "pos-select-term"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,3 @@
1
+ export function openNewTab(url) {
2
+ window.open(url.toString(), '_blank');
3
+ }
@@ -0,0 +1,36 @@
1
+ :host {
2
+ display: flex;
3
+ aspect-ratio: 1/1;
4
+ height: var(--size-8);
5
+ align-items: center;
6
+ justify-content: center;
7
+ }
8
+
9
+ sl-dropdown {
10
+ height: 100%;
11
+ width: 100%;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ &::part(trigger) {
16
+ height: 100%;
17
+ width: 100%;
18
+ }
19
+ button {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ height: 100%;
24
+ width: 100%;
25
+ cursor: pointer;
26
+ padding: 0;
27
+ margin: 0;
28
+ }
29
+ }
30
+
31
+ sl-menu-item[disabled] {
32
+ &::part(base) {
33
+ cursor: default;
34
+ opacity: 1;
35
+ }
36
+ }
@@ -0,0 +1,100 @@
1
+ import { h } from "@stencil/core";
2
+ import "@shoelace-style/shoelace/dist/components/icon/icon.js";
3
+ import "@shoelace-style/shoelace/dist/components/menu/menu.js";
4
+ import "@shoelace-style/shoelace/dist/components/dropdown/dropdown.js";
5
+ import "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js";
6
+ import "@shoelace-style/shoelace/dist/components/divider/divider.js";
7
+ import { usePodOS } from "../events/usePodOS";
8
+ import { openNewTab } from "./openNewTab";
9
+ /**
10
+ * Allows sharing a resource with other apps, people, etc.
11
+ */
12
+ export class PosShare {
13
+ constructor() {
14
+ this.apps = [];
15
+ }
16
+ async componentWillLoad() {
17
+ this.os = await usePodOS(this.el);
18
+ await this.updateApps();
19
+ }
20
+ async updateApps() {
21
+ const thing = this.os.store.get(this.uri);
22
+ this.apps = this.os.proposeAppsFor(thing);
23
+ }
24
+ onSelect(e) {
25
+ const { value } = e.detail.item;
26
+ if (value === 'copy-uri') {
27
+ navigator.clipboard.writeText(this.uri);
28
+ }
29
+ else {
30
+ openNewTab(value.urlTemplate.expand({ uri: this.uri }));
31
+ }
32
+ }
33
+ render() {
34
+ return (h("sl-dropdown", { key: '29aa438dc2598ae0ca874cebbddb56798587d03a' }, h("button", { key: 'e3faedf0eb0613563281634ce597c7c6feaf6eee', slot: "trigger", "aria-label": "Share", part: "button" }, h("sl-icon", { key: '6b932bd7a91f47a6e406e99b074ecb3108a1c611', name: "share" })), h("sl-menu", { key: 'e17beb4fc2709ec701618b26f446964460ffe2e1' }, h("sl-menu-item", { key: '34cef924cd9a503f87214df50cb6ec0ecc6402ed', value: "copy-uri" }, h("sl-icon", { key: 'db7910538c61bf6ad0e9591f77f353ff5209933e', slot: "prefix", name: "copy" }), "Copy URI"), this.apps.length > 0 && h(OpenWithApps, { key: '5ae82ba277c26ce5d99ddb68ff6616c5a3c43d96', apps: this.apps }))));
35
+ }
36
+ static get is() { return "pos-share"; }
37
+ static get encapsulation() { return "shadow"; }
38
+ static get originalStyleUrls() {
39
+ return {
40
+ "$": ["pos-share.css"]
41
+ };
42
+ }
43
+ static get styleUrls() {
44
+ return {
45
+ "$": ["pos-share.css"]
46
+ };
47
+ }
48
+ static get properties() {
49
+ return {
50
+ "uri": {
51
+ "type": "string",
52
+ "mutable": false,
53
+ "complexType": {
54
+ "original": "string",
55
+ "resolved": "string",
56
+ "references": {}
57
+ },
58
+ "required": true,
59
+ "optional": false,
60
+ "docs": {
61
+ "tags": [],
62
+ "text": "URI of the resource to share."
63
+ },
64
+ "getter": false,
65
+ "setter": false,
66
+ "reflect": false,
67
+ "attribute": "uri"
68
+ }
69
+ };
70
+ }
71
+ static get states() {
72
+ return {
73
+ "apps": {},
74
+ "os": {}
75
+ };
76
+ }
77
+ static get elementRef() { return "el"; }
78
+ static get watchers() {
79
+ return [{
80
+ "propName": "uri",
81
+ "methodName": "updateApps"
82
+ }];
83
+ }
84
+ static get listeners() {
85
+ return [{
86
+ "name": "sl-select",
87
+ "method": "onSelect",
88
+ "target": undefined,
89
+ "capture": false,
90
+ "passive": false
91
+ }];
92
+ }
93
+ }
94
+ function OpenWithApps({ apps }) {
95
+ return [
96
+ h("sl-divider", null),
97
+ h("sl-menu-item", { disabled: true }, "Open with..."),
98
+ apps.map(it => h("sl-menu-item", { value: it }, it.name)),
99
+ ];
100
+ }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Defines a template to use if the specified condition is met - to be used with [pos-switch](https://pod-os.org/reference/elements/components/pos-switch/).
3
+ * See [storybook](https://pod-os.github.io/PodOS/storybook/?path=/story/basics--pos-switch) for an example.
4
+ */
5
+ export class PosCase {
6
+ constructor() {
7
+ this.error = null;
8
+ }
9
+ componentWillLoad() {
10
+ const templateElement = this.host.querySelector('template');
11
+ if (templateElement == null) {
12
+ this.error = 'No template element found';
13
+ }
14
+ }
15
+ render() {
16
+ if (this.error)
17
+ return this.error;
18
+ return null;
19
+ }
20
+ static get is() { return "pos-case"; }
21
+ static get properties() {
22
+ return {
23
+ "ifTypeof": {
24
+ "type": "string",
25
+ "mutable": false,
26
+ "complexType": {
27
+ "original": "string",
28
+ "resolved": "string",
29
+ "references": {}
30
+ },
31
+ "required": false,
32
+ "optional": true,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": "Test if the resource is of the specified type"
36
+ },
37
+ "getter": false,
38
+ "setter": false,
39
+ "reflect": false,
40
+ "attribute": "if-typeof"
41
+ },
42
+ "not": {
43
+ "type": "boolean",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "boolean",
47
+ "resolved": "boolean",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": true,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": "Negates the result of the test"
55
+ },
56
+ "getter": false,
57
+ "setter": false,
58
+ "reflect": false,
59
+ "attribute": "not"
60
+ },
61
+ "else": {
62
+ "type": "boolean",
63
+ "mutable": false,
64
+ "complexType": {
65
+ "original": "boolean",
66
+ "resolved": "boolean",
67
+ "references": {}
68
+ },
69
+ "required": false,
70
+ "optional": true,
71
+ "docs": {
72
+ "tags": [],
73
+ "text": "The test only evaluates to true if tests for preceding cases have failed"
74
+ },
75
+ "getter": false,
76
+ "setter": false,
77
+ "reflect": false,
78
+ "attribute": "else"
79
+ }
80
+ };
81
+ }
82
+ static get states() {
83
+ return {
84
+ "error": {}
85
+ };
86
+ }
87
+ static get elementRef() { return "host"; }
88
+ }
@@ -0,0 +1,89 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { subscribeResource } from "../events/ResourceAware";
3
+ /**
4
+ * Selects a child template to render based on properties of the subject resource, usually defined by an ancestor `pos-resource` element.
5
+ * See [storybook](https://pod-os.github.io/PodOS/storybook/?path=/story/basics--pos-switch) for an example.
6
+ * See [pos-case](https://pod-os.org/reference/elements/components/pos-switch/pos-case/) for available filter conditions.
7
+ */
8
+ export class PosSwitch {
9
+ constructor() {
10
+ this.error = null;
11
+ this.receiveResource = (resource) => {
12
+ this.resource = resource;
13
+ };
14
+ }
15
+ componentWillLoad() {
16
+ subscribeResource(this);
17
+ const caseElements = this.host.querySelectorAll('pos-case');
18
+ if (caseElements.length == 0) {
19
+ this.error = 'No pos-case elements found';
20
+ }
21
+ else {
22
+ this.caseElements = caseElements;
23
+ }
24
+ }
25
+ test(caseElement) {
26
+ let state = null;
27
+ if (caseElement.getAttribute('if-typeof') !== null) {
28
+ state = this.resource
29
+ .types()
30
+ .map(x => x.uri)
31
+ .includes(caseElement.getAttribute('if-typeof'));
32
+ }
33
+ if (caseElement.getAttribute('not') != null) {
34
+ state = !state;
35
+ }
36
+ return state;
37
+ }
38
+ render() {
39
+ if (this.error) {
40
+ return this.error;
41
+ }
42
+ if (!this.resource) {
43
+ return null;
44
+ }
45
+ let state = null;
46
+ let activeElements = [];
47
+ this.caseElements.forEach(el => {
48
+ const elemState = this.test(el);
49
+ const includeCondition = state !== true || el.getAttribute('else') === null;
50
+ if (elemState && includeCondition) {
51
+ state = elemState;
52
+ activeElements.push(el);
53
+ }
54
+ if (elemState === null && includeCondition) {
55
+ activeElements.push(el);
56
+ }
57
+ });
58
+ const activeElementsContent = activeElements.map(el => el.querySelector('template').innerHTML).join('\n');
59
+ return h(Host, { innerHTML: activeElementsContent });
60
+ }
61
+ static get is() { return "pos-switch"; }
62
+ static get states() {
63
+ return {
64
+ "error": {},
65
+ "resource": {},
66
+ "caseElements": {},
67
+ "templateString": {}
68
+ };
69
+ }
70
+ static get events() {
71
+ return [{
72
+ "method": "subscribeResource",
73
+ "name": "pod-os:resource",
74
+ "bubbles": true,
75
+ "cancelable": true,
76
+ "composed": true,
77
+ "docs": {
78
+ "tags": [],
79
+ "text": ""
80
+ },
81
+ "complexType": {
82
+ "original": "any",
83
+ "resolved": "any",
84
+ "references": {}
85
+ }
86
+ }];
87
+ }
88
+ static get elementRef() { return "host"; }
89
+ }
@@ -43,7 +43,8 @@ export class PosToolSelect {
43
43
  "ToolConfig": {
44
44
  "location": "import",
45
45
  "path": "../pos-type-router/selectToolsForTypes",
46
- "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig"
46
+ "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig",
47
+ "referenceLocation": "ToolConfig"
47
48
  }
48
49
  }
49
50
  },
@@ -66,7 +67,8 @@ export class PosToolSelect {
66
67
  "ToolConfig": {
67
68
  "location": "import",
68
69
  "path": "../pos-type-router/selectToolsForTypes",
69
- "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig"
70
+ "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig",
71
+ "referenceLocation": "ToolConfig"
70
72
  }
71
73
  }
72
74
  },
@@ -100,7 +102,8 @@ export class PosToolSelect {
100
102
  "ToolConfig": {
101
103
  "location": "import",
102
104
  "path": "../pos-type-router/selectToolsForTypes",
103
- "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig"
105
+ "id": "src/components/pos-type-router/selectToolsForTypes.ts::ToolConfig",
106
+ "referenceLocation": "ToolConfig"
104
107
  }
105
108
  }
106
109
  }
@@ -49,7 +49,7 @@ export class PosUpload {
49
49
  }
50
50
  }
51
51
  render() {
52
- return h("div", { key: '0f77e2cac68f5aaf1d25a429b866015160c5787b', class: "container", ref: el => (this.uppy = el) });
52
+ return h("div", { key: 'bba1889322d2bb688881bcab1797dbc2a325e4e3', class: "container", ref: el => (this.uppy = el) });
53
53
  }
54
54
  static get is() { return "pos-upload"; }
55
55
  static get encapsulation() { return "shadow"; }
@@ -97,17 +97,20 @@ export class PosUpload {
97
97
  "ResultAsync": {
98
98
  "location": "import",
99
99
  "path": "neverthrow",
100
- "id": "../node_modules/neverthrow/dist/index.d.ts::ResultAsync"
100
+ "id": "../node_modules/neverthrow/dist/index.d.ts::ResultAsync",
101
+ "referenceLocation": "ResultAsync"
101
102
  },
102
103
  "HttpProblem": {
103
104
  "location": "import",
104
105
  "path": "@pod-os/core",
105
- "id": "../core/types/index.d.ts::HttpProblem"
106
+ "id": "../core/types/index.d.ts::HttpProblem",
107
+ "referenceLocation": "HttpProblem"
106
108
  },
107
109
  "NetworkProblem": {
108
110
  "location": "import",
109
111
  "path": "@pod-os/core",
110
- "id": "../core/types/index.d.ts::NetworkProblem"
112
+ "id": "../core/types/index.d.ts::NetworkProblem",
113
+ "referenceLocation": "NetworkProblem"
111
114
  }
112
115
  }
113
116
  },
@@ -18,7 +18,7 @@ export class PosUserMenu {
18
18
  }
19
19
  render() {
20
20
  if (!this.webId)
21
- return null; //?
21
+ return null;
22
22
  return (h("pos-resource", { uri: this.webId }, h("sl-dropdown", null, h("button", { slot: "trigger", "aria-label": "User menu" }, h("pos-picture", { "no-upload": true }, h("sl-avatar", null))), h("sl-menu", null, h("sl-menu-item", { value: "dashboard" }, "Dashboard"), h("sl-menu-item", { value: "profile" }, h("pos-label", null)), h("sl-menu-item", { value: "settings" }, "Settings"), h("sl-divider", null), h("sl-menu-item", { value: "logout" }, "Logout")))));
23
23
  }
24
24
  static get is() { return "pos-user-menu"; }
@@ -11,7 +11,7 @@ export class PosToolAttachments {
11
11
  }
12
12
  render() {
13
13
  var _a;
14
- return (h(Host, { key: 'c7670fa2c000099af02d33a702a404e9889d4552' }, h("section", { key: '1b3ce82d5101ec4c0b6e6df26ede473c7287b747' }, h("article", { key: 'b9929952d801ab53a848985af7ed08c18072a662' }, h("h2", { key: 'dc39c20da1730c6ea01b32a99dc8b0680a33b6c2' }, "Attachments"), h("pos-attachments", { key: '65fd33e592be78e1a15ac9c2238321973a3f8612', ref: it => (this.attachmentsElement = it) }))), h("section", { key: '4ebe089659ed2c517440a9ff06141f332e44c56d' }, ((_a = this.resource) === null || _a === void 0 ? void 0 : _a.editable) ? (h("pos-upload", { accept: ['*/*'], uploader: file => {
14
+ return (h(Host, { key: '90a688233dde6bed413d57c11d89833629e1e2c8' }, h("section", { key: 'd47427736806216b35cb5e77bcabf12b82a03b31' }, h("article", { key: 'a77c2f9e41165effdc6e41fed79fa6b48dcc753e' }, h("h2", { key: '5e4d9a23ceb3c88075ef7785ca1b6fba201714ca' }, "Attachments"), h("pos-attachments", { key: '6a1001d633b0cad66178818b7a32c76ebbc4e46c', ref: it => (this.attachmentsElement = it) }))), h("section", { key: 'ea6c933f2a5fb67d6e63ca799c14920361eafe1f' }, ((_a = this.resource) === null || _a === void 0 ? void 0 : _a.editable) ? (h("pos-upload", { accept: ['*/*'], uploader: file => {
15
15
  const result = this.os.attachments().uploadAndAddAttachment(this.resource, file);
16
16
  result.map(it => {
17
17
  this.attachmentsElement.addToList({
@@ -0,0 +1,20 @@
1
+ import{i as r,c as a,_ as i,n as o,S as e}from"./chunk.4TUIT776.js";import{w as l}from"./chunk.YHLNUJ7P.js";var t=r`
2
+ :host {
3
+ --color: var(--sl-panel-border-color);
4
+ --width: var(--sl-panel-border-width);
5
+ --spacing: var(--sl-spacing-medium);
6
+ }
7
+
8
+ :host(:not([vertical])) {
9
+ display: block;
10
+ border-top: solid var(--width) var(--color);
11
+ margin: var(--spacing) 0;
12
+ }
13
+
14
+ :host([vertical]) {
15
+ display: inline-block;
16
+ height: 100%;
17
+ border-left: solid var(--width) var(--color);
18
+ margin: 0 var(--spacing);
19
+ }
20
+ `,s=class extends e{constructor(){super(...arguments),this.vertical=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};s.styles=[a,t],i([o({type:Boolean,reflect:!0})],s.prototype,"vertical",2),i([l("vertical")],s.prototype,"handleVerticalChange",1),s.define("sl-divider");
@@ -1 +1 @@
1
- import{s as e}from"./chunk.3Y6SB6QS.js";export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";function t(e){document.documentElement.classList.toggle("sl-theme-dark",e.matches)}!function(){e(""+new URL("./shoelace",import.meta.url));const n=window.matchMedia("(prefers-color-scheme: dark)");t(n),n.addEventListener("change",t)}();
1
+ import{s as e}from"./chunk.3Y6SB6QS.js";export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";function t(e){document.documentElement.classList.toggle("sl-theme-dark",e.matches)}(function(){e(""+new URL("./shoelace",import.meta.url));const n=window.matchMedia("(prefers-color-scheme: dark)");t(n),n.addEventListener("change",t)}||(()=>{}))();