@pod-os/elements 0.37.0-rc.c8b54d1.0 → 0.37.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 (144) hide show
  1. package/dist/cjs/{chunk.URTPIBTY-DdK9pL5v.js → chunk.URTPIBTY-DcQsb_nW.js} +2 -2
  2. package/dist/cjs/{chunk.XQ2OKYYA-DEkhm1i7.js → chunk.XQ2OKYYA-D224sdKt.js} +3 -3
  3. package/dist/cjs/{chunk.ZGGPD2XJ-uKZZdqOH.js → chunk.ZGGPD2XJ-Cj6xUx2M.js} +1 -1
  4. package/dist/cjs/{class-map-DAZXfKKA.js → class-map-Nx8L8ElN.js} +1 -1
  5. package/dist/cjs/elements.cjs.js +3 -3
  6. package/dist/cjs/{index-DCpu_nnH.js → index-Be_lnf0w.js} +547 -2001
  7. package/dist/cjs/{index-FUnpyb19.js → index-OR1wNkjG.js} +1052 -489
  8. package/dist/cjs/{jsonld-V2RB47OZ-BerQ9IRa.js → jsonld-V2RB47OZ-B82QNsYZ.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} +411 -227
  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 +13 -4
  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 +442 -2327
  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 +5 -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-container-contents.js +10 -1
  33. package/dist/collection/components/pos-container-contents/pos-create-new-container-item/pos-create-new-container-item.js +4 -2
  34. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +2 -1
  35. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +42 -22
  36. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +3 -2
  37. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  38. package/dist/collection/components/pos-router/pos-router.js +1 -1
  39. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  40. package/dist/collection/components/pos-share/openNewTab.js +3 -0
  41. package/dist/collection/components/pos-share/pos-share.css +36 -0
  42. package/dist/collection/components/pos-share/pos-share.js +111 -0
  43. package/dist/collection/components/pos-switch/pos-case/pos-case.js +88 -0
  44. package/dist/collection/components/pos-switch/pos-switch.js +89 -0
  45. package/dist/collection/components/pos-tool-select/pos-tool-select.js +6 -3
  46. package/dist/collection/components/pos-upload/pos-upload.js +7 -4
  47. package/dist/collection/components/pos-user-menu/pos-user-menu.js +1 -1
  48. package/dist/collection/tools/pos-tool-attachments/pos-tool-attachments.js +1 -1
  49. package/dist/components/chunk.IVVHNXMC.js +20 -0
  50. package/dist/components/index.js +1 -1
  51. package/dist/components/index2.js +2 -2
  52. package/dist/components/pos-add-literal-value2.js +1 -1
  53. package/dist/components/pos-app-browser.js +1 -1
  54. package/dist/components/pos-attachments2.js +1 -1
  55. package/dist/components/pos-case.d.ts +11 -0
  56. package/dist/components/pos-case.js +1 -0
  57. package/dist/components/pos-container-contents2.js +1 -1
  58. package/dist/components/pos-make-findable2.js +1 -1
  59. package/dist/components/pos-markdown-document2.js +1 -1
  60. package/dist/components/pos-navigation-bar2.js +1 -1
  61. package/dist/components/pos-navigation2.js +1 -1
  62. package/dist/components/pos-new-thing-form2.js +1 -1
  63. package/dist/components/pos-router2.js +1 -1
  64. package/dist/components/pos-select-term2.js +1 -1
  65. package/dist/components/pos-share.d.ts +11 -0
  66. package/dist/components/pos-share.js +1 -0
  67. package/dist/components/pos-share2.js +1 -0
  68. package/dist/components/pos-switch.d.ts +11 -0
  69. package/dist/components/pos-switch.js +1 -0
  70. package/dist/components/pos-tool-attachments.js +1 -1
  71. package/dist/components/pos-tool-select2.js +1 -1
  72. package/dist/components/pos-type-index-entries2.js +1 -1
  73. package/dist/components/pos-upload2.js +12 -3
  74. package/dist/components/pos-user-menu2.js +6 -25
  75. package/dist/elements/elements.esm.js +1 -1
  76. package/dist/elements/{p-6561f1b7.entry.js → p-03464a71.entry.js} +1 -1
  77. package/dist/elements/{p-52a612ed.entry.js → p-272209e3.entry.js} +1 -1
  78. package/dist/elements/{p-a9a18aa8.entry.js → p-38aa17bc.entry.js} +1 -1
  79. package/dist/elements/p-3a890f5f.entry.js +1 -0
  80. package/dist/elements/{p-9ad80b52.entry.js → p-4cd2f9da.entry.js} +1 -1
  81. package/dist/elements/{p-0e7413e6.entry.js → p-5126fb6e.entry.js} +1 -1
  82. package/dist/elements/p-53610ccd.entry.js +1 -0
  83. package/dist/elements/{p-b5d64c6f.entry.js → p-631976a8.entry.js} +1 -1
  84. package/dist/elements/{p-fe628201.entry.js → p-6d628d74.entry.js} +1 -1
  85. package/dist/elements/{p-b363349c.entry.js → p-7c3785d8.entry.js} +1 -1
  86. package/dist/elements/p-8934c5ea.entry.js +1 -0
  87. package/dist/elements/p-8e76e9dc.entry.js +1 -0
  88. package/dist/elements/{p-3e18b5dd.entry.js → p-9bf6c310.entry.js} +1 -1
  89. package/dist/elements/{p-Doy_38_j.js → p-BLUiM5OK.js} +1 -1
  90. package/dist/elements/{p-BkAnMOpW.js → p-CSTMd_cW.js} +2 -2
  91. package/dist/elements/{p-CrxYqX8r.js → p-CVwgVrbO.js} +7 -7
  92. package/dist/elements/{p-8ggjG2YF.js → p-CnIOZlf7.js} +1 -1
  93. package/dist/elements/p-DHl0QGLf.js +67 -0
  94. package/dist/elements/p-DzbCx-pP.js +2 -0
  95. package/dist/elements/{p-c8ee910c.entry.js → p-a1dd6b42.entry.js} +1 -1
  96. package/dist/elements/p-ab4eba43.entry.js +859 -0
  97. package/dist/elements/{p-dff14248.entry.js → p-c7032012.entry.js} +1 -1
  98. package/dist/elements/{p-a20b72d8.entry.js → p-d396cc56.entry.js} +1 -1
  99. package/dist/elements/p-dc4c38c8.entry.js +1 -0
  100. package/dist/elements/{p-0a087865.entry.js → p-e0660718.entry.js} +1 -1
  101. package/dist/elements/{p-8q-RA2Uq.js → p-mIPOXLnA.js} +3 -3
  102. package/dist/esm/{chunk.URTPIBTY-CNA3-SLq.js → chunk.URTPIBTY-yxgfEQ1K.js} +2 -2
  103. package/dist/esm/{chunk.XQ2OKYYA-CXNlpYUG.js → chunk.XQ2OKYYA-Cr3bMzqn.js} +3 -3
  104. package/dist/esm/{chunk.ZGGPD2XJ-BjT6fS1o.js → chunk.ZGGPD2XJ-SJISSXOc.js} +1 -1
  105. package/dist/esm/{class-map-CUYFUkXU.js → class-map-DEweE_Cr.js} +1 -1
  106. package/dist/esm/elements.js +4 -4
  107. package/dist/esm/{index-DFqG64hG.js → index-CXK32bJz.js} +1052 -489
  108. package/dist/esm/{index-VMHzF3uY.js → index-DzbCx-pP.js} +547 -2001
  109. package/dist/esm/{jsonld-V2RB47OZ-CaIJ08AA.js → jsonld-V2RB47OZ-BbN7F0s8.js} +1 -1
  110. package/dist/esm/loader.js +3 -3
  111. package/dist/esm/pos-add-literal-value_3.entry.js +6 -6
  112. package/dist/esm/{pos-add-new-thing_31.entry.js → pos-add-new-thing_32.entry.js} +411 -228
  113. package/dist/esm/pos-app-document-viewer.entry.js +1 -1
  114. package/dist/esm/pos-app-generic.entry.js +1 -1
  115. package/dist/esm/pos-app-image-viewer.entry.js +1 -1
  116. package/dist/esm/pos-app-ldp-container.entry.js +1 -1
  117. package/dist/esm/pos-app-rdf-document.entry.js +1 -1
  118. package/dist/esm/pos-attachments.entry.js +2 -2
  119. package/dist/esm/pos-case.entry.js +22 -0
  120. package/dist/esm/pos-container-contents.entry.js +12 -3
  121. package/dist/esm/pos-container-item_3.entry.js +4 -4
  122. package/dist/esm/pos-document.entry.js +4 -4
  123. package/dist/esm/pos-list.entry.js +1 -1
  124. package/dist/esm/pos-markdown-document.entry.js +442 -2327
  125. package/dist/esm/pos-relations_2.entry.js +1 -1
  126. package/dist/esm/pos-subjects.entry.js +2 -2
  127. package/dist/esm/pos-switch.entry.js +62 -0
  128. package/dist/esm/pos-tool-attachments.entry.js +2 -2
  129. package/dist/esm/pos-value.entry.js +1 -1
  130. package/dist/jest-setup.js +4 -0
  131. package/dist/types/components/pos-container-contents/pos-container-contents.d.ts +2 -0
  132. package/dist/types/components/pos-share/openNewTab.d.ts +1 -0
  133. package/dist/types/components/pos-share/pos-share.d.ts +28 -0
  134. package/dist/types/components/pos-switch/pos-case/pos-case.d.ts +22 -0
  135. package/dist/types/components/pos-switch/pos-switch.d.ts +19 -0
  136. package/dist/types/components.d.ts +300 -74
  137. package/dist/types/stencil-public-runtime.d.ts +52 -2
  138. package/package.json +13 -12
  139. package/dist/elements/p-637a38d9.entry.js +0 -1
  140. package/dist/elements/p-701f2c84.entry.js +0 -850
  141. package/dist/elements/p-9b74c400.entry.js +0 -1
  142. package/dist/elements/p-LoCE14bN.js +0 -67
  143. package/dist/elements/p-VMHzF3uY.js +0 -2
  144. package/dist/elements/p-ac17ed6a.entry.js +0 -1
@@ -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)}||(()=>{}))();