@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
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-VMHzF3uY.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-DzbCx-pP.js';
2
2
  import { s as subscribeResource } from './ResourceAware-BW_CkW1K.js';
3
3
 
4
4
  const posRelationsCss = () => `:host{--background-base-color:color-mix(in srgb, var(--pos-background-color), var(--color-grey-800) 10%);--background-color-even:hsl(from var(--background-base-color) h s calc(l + 7));--background-color-odd:hsl(from var(--background-base-color) h s calc(l + 10));--border-color:var(--background-base-color)}dd{padding:0;margin:0}dl{display:flex;flex-direction:column;gap:var(--size-1);padding:0;margin:0}dt{margin-bottom:var(--size-1)}.predicate-values:nth-child(odd){background-color:var(--background-color-odd)}.predicate-values:nth-child(even){background-color:var(--background-color-even)}.predicate-values{display:flex;flex-direction:column;border:var(--size-px) solid var(--border-color);padding:var(--size-2);gap:var(--size-1);.values{display:flex;flex-direction:column;gap:var(--size-3)}}pos-rich-link{--background-color:inherit}`;
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-VMHzF3uY.js';
2
- import { R as RdfDocument } from './index-DFqG64hG.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-DzbCx-pP.js';
2
+ import { R as RdfDocument } from './index-CXK32bJz.js';
3
3
  import { s as subscribeResource } from './ResourceAware-BW_CkW1K.js';
4
4
 
5
5
  const posSubjectsCss = () => `:host{--background-base-color:color-mix(in srgb, var(--pos-background-color), var(--color-grey-800) 10%);--background-color-even:hsl(from var(--background-base-color) h s calc(l + 7));--background-color-odd:hsl(from var(--background-base-color) h s calc(l + 10));--border-color:var(--background-base-color)}ul{display:flex;flex-direction:column;gap:var(--size-2);margin:0;padding:0;li{border:var(--size-px) solid var(--border-color);padding:var(--size-4);list-style-type:none;&:nth-child(even){background-color:var(--background-color-even)}&:nth-child(odd){background-color:var(--background-color-odd)}}}`;
@@ -0,0 +1,62 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DzbCx-pP.js';
2
+ import { s as subscribeResource } from './ResourceAware-BW_CkW1K.js';
3
+
4
+ const PosSwitch = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ this.subscribeResource = createEvent(this, "pod-os:resource", 7);
8
+ this.error = null;
9
+ this.receiveResource = (resource) => {
10
+ this.resource = resource;
11
+ };
12
+ }
13
+ componentWillLoad() {
14
+ subscribeResource(this);
15
+ const caseElements = this.host.querySelectorAll('pos-case');
16
+ if (caseElements.length == 0) {
17
+ this.error = 'No pos-case elements found';
18
+ }
19
+ else {
20
+ this.caseElements = caseElements;
21
+ }
22
+ }
23
+ test(caseElement) {
24
+ let state = null;
25
+ if (caseElement.getAttribute('if-typeof') !== null) {
26
+ state = this.resource
27
+ .types()
28
+ .map(x => x.uri)
29
+ .includes(caseElement.getAttribute('if-typeof'));
30
+ }
31
+ if (caseElement.getAttribute('not') != null) {
32
+ state = !state;
33
+ }
34
+ return state;
35
+ }
36
+ render() {
37
+ if (this.error) {
38
+ return this.error;
39
+ }
40
+ if (!this.resource) {
41
+ return null;
42
+ }
43
+ let state = null;
44
+ let activeElements = [];
45
+ this.caseElements.forEach(el => {
46
+ const elemState = this.test(el);
47
+ const includeCondition = state !== true || el.getAttribute('else') === null;
48
+ if (elemState && includeCondition) {
49
+ state = elemState;
50
+ activeElements.push(el);
51
+ }
52
+ if (elemState === null && includeCondition) {
53
+ activeElements.push(el);
54
+ }
55
+ });
56
+ const activeElementsContent = activeElements.map(el => el.querySelector('template').innerHTML).join('\n');
57
+ return h(Host, { innerHTML: activeElementsContent });
58
+ }
59
+ get host() { return getElement(this); }
60
+ };
61
+
62
+ export { PosSwitch as pos_switch };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, e as Host, a as getElement } from './index-VMHzF3uY.js';
1
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DzbCx-pP.js';
2
2
  import { u as usePodOS } from './usePodOS-D0uCfr1-.js';
3
3
  import { u as useResource } from './useResource-yVO4JQ9P.js';
4
4
 
@@ -18,7 +18,7 @@ const PosToolAttachments = class {
18
18
  }
19
19
  render() {
20
20
  var _a;
21
- 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 => {
21
+ 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 => {
22
22
  const result = this.os.attachments().uploadAndAddAttachment(this.resource, file);
23
23
  result.map(it => {
24
24
  this.attachmentsElement.addToList({
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent } from './index-VMHzF3uY.js';
1
+ import { r as registerInstance, c as createEvent } from './index-DzbCx-pP.js';
2
2
  import { s as subscribeResource } from './ResourceAware-BW_CkW1K.js';
3
3
 
4
4
  const PosValue = class {
@@ -3,3 +3,7 @@ jest.mock('@shoelace-style/shoelace/dist/components/icon/icon.js', () => ({}));
3
3
  jest.mock('@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.js', () => ({}));
4
4
  jest.mock('@shoelace-style/shoelace/dist/components/skeleton/skeleton.js', () => ({}));
5
5
  jest.mock('@shoelace-style/shoelace/dist/components/tooltip/tooltip.js', () => ({}));
6
+ jest.mock('@shoelace-style/shoelace/dist/components/menu/menu.js', () => ({}));
7
+ jest.mock('@shoelace-style/shoelace/dist/components/menu-item/menu-item.js', () => ({}));
8
+ jest.mock('@shoelace-style/shoelace/dist/components/divider/divider.js', () => ({}));
9
+ jest.mock('@shoelace-style/shoelace/dist/components/dropdown/dropdown.js', () => ({}));
@@ -7,10 +7,12 @@ export declare class PosContainerContents implements ResourceAware {
7
7
  loading: boolean;
8
8
  subscribeResource: EventEmitter;
9
9
  private createNewItem;
10
+ private readonly disconnected$;
10
11
  onCreateNewFile(): void;
11
12
  onCreateNewFolder(): void;
12
13
  componentWillLoad(): void;
13
14
  handleKeyDown(ev: KeyboardEvent): void;
14
15
  receiveResource: (resource: Thing) => void;
15
16
  render(): any;
17
+ disconnectedCallback(): void;
16
18
  }
@@ -0,0 +1 @@
1
+ export declare function openNewTab(url: string): void;
@@ -0,0 +1,28 @@
1
+ import '@shoelace-style/shoelace/dist/components/icon/icon.js';
2
+ import '@shoelace-style/shoelace/dist/components/menu/menu.js';
3
+ import '@shoelace-style/shoelace/dist/components/dropdown/dropdown.js';
4
+ import '@shoelace-style/shoelace/dist/components/menu-item/menu-item.js';
5
+ import '@shoelace-style/shoelace/dist/components/divider/divider.js';
6
+ import { OpenWithApp, PodOS } from '@pod-os/core';
7
+ import { PosResourceCustomEvent } from '../../components';
8
+ /**
9
+ * Allows sharing a resource with other apps, people, etc.
10
+ */
11
+ export declare class PosShare {
12
+ /**
13
+ * URI of the resource to share.
14
+ */
15
+ uri: string;
16
+ el: HTMLElement;
17
+ apps: OpenWithApp[];
18
+ os: PodOS;
19
+ resourceLoaded(e: PosResourceCustomEvent<string>): Promise<void>;
20
+ componentWillLoad(): Promise<void>;
21
+ updateApps(): Promise<void>;
22
+ onSelect(e: CustomEvent<{
23
+ item: {
24
+ value: 'copy-uri' | OpenWithApp;
25
+ };
26
+ }>): void;
27
+ render(): any;
28
+ }
@@ -0,0 +1,22 @@
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 declare class PosCase {
6
+ host: HTMLElement;
7
+ error: string;
8
+ /**
9
+ * Test if the resource is of the specified type
10
+ */
11
+ ifTypeof?: string;
12
+ /**
13
+ * Negates the result of the test
14
+ */
15
+ not?: boolean;
16
+ /**
17
+ * The test only evaluates to true if tests for preceding cases have failed
18
+ */
19
+ else?: boolean;
20
+ componentWillLoad(): void;
21
+ render(): string;
22
+ }
@@ -0,0 +1,19 @@
1
+ import { Thing } from '@pod-os/core';
2
+ import { ResourceAware, ResourceEventEmitter } 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 declare class PosSwitch implements ResourceAware {
9
+ host: HTMLElement;
10
+ error: string;
11
+ resource: Thing;
12
+ caseElements: NodeListOf<HTMLPosCaseElement>;
13
+ templateString: string;
14
+ subscribeResource: ResourceEventEmitter;
15
+ componentWillLoad(): void;
16
+ test(caseElement: any): boolean;
17
+ receiveResource: (resource: Thing) => void;
18
+ render(): any;
19
+ }