@pod-os/elements 0.26.1-rc.39433d3.0 → 0.26.1-rc.5fcb63b.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 (125) hide show
  1. package/dist/cjs/app-globals-97a7ec18.js +23 -0
  2. package/dist/cjs/app-globals-97a7ec18.js.map +1 -0
  3. package/dist/cjs/elements.cjs.js +2 -2
  4. package/dist/cjs/ion-badge_5.cjs.entry.js +1 -1
  5. package/dist/cjs/ion-icon_32.cjs.entry.js +9150 -0
  6. package/dist/cjs/ion-icon_32.cjs.entry.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/pos-app-generic.cjs.entry.js +1 -1
  9. package/dist/cjs/pos-app-ldp-container.cjs.entry.js +1 -1
  10. package/dist/cjs/pos-app-rdf-document.cjs.entry.js +1 -1
  11. package/dist/collection/apps/pos-app-browser/pos-app-browser.js +2 -1
  12. package/dist/collection/apps/pos-app-browser/pos-app-browser.js.map +1 -1
  13. package/dist/collection/apps/pos-app-dashboard/pos-app-dashboard.js +1 -1
  14. package/dist/collection/apps/pos-app-dashboard/pos-example-resources/pos-example-resources.js +1 -1
  15. package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js +1 -1
  16. package/dist/collection/apps/pos-app-generic/pos-app-generic.js +1 -1
  17. package/dist/collection/apps/pos-app-ldp-container/pos-app-ldp-container.js +1 -1
  18. package/dist/collection/apps/pos-app-rdf-document/pos-app-rdf-document.js +1 -1
  19. package/dist/collection/apps/pos-app-settings/pos-app-settings.js +1 -1
  20. package/dist/collection/apps/pos-app-settings/pos-setting-offline-cache/pos-setting-offline-cache.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -0
  22. package/dist/collection/components/pos-add-new-thing/pos-add-new-thing.js +1 -1
  23. package/dist/collection/components/pos-app/pos-app.js +1 -1
  24. package/dist/collection/components/pos-dialog/pos-dialog.js +1 -1
  25. package/dist/collection/components/pos-error-toast/pos-error-toast.js +1 -1
  26. package/dist/collection/components/pos-literals/pos-literals.js +1 -1
  27. package/dist/collection/components/pos-login/pos-login.js +1 -1
  28. package/dist/collection/components/pos-login-form/pos-login-form.js +1 -1
  29. package/dist/collection/components/pos-make-findable/pos-make-findable.css +2 -55
  30. package/dist/collection/components/pos-make-findable/pos-make-findable.js +15 -26
  31. package/dist/collection/components/pos-make-findable/pos-make-findable.js.map +1 -1
  32. package/dist/collection/components/pos-make-findable/shoelace.js +4 -0
  33. package/dist/collection/components/pos-make-findable/shoelace.js.map +1 -0
  34. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +1 -1
  35. package/dist/collection/components/pos-navigation/pos-navigation.js +1 -1
  36. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  37. package/dist/collection/components/pos-rich-link/pos-rich-link.js +2 -2
  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-user-menu/pos-user-menu.css +23 -0
  41. package/dist/collection/components/pos-user-menu/pos-user-menu.js +102 -0
  42. package/dist/collection/components/pos-user-menu/pos-user-menu.js.map +1 -0
  43. package/dist/collection/components/pos-user-menu/shoelace.js +6 -0
  44. package/dist/collection/components/pos-user-menu/shoelace.js.map +1 -0
  45. package/dist/collection/global.js +6 -0
  46. package/dist/collection/global.js.map +1 -1
  47. package/dist/components/chunk.HVTXQL7M.js +4775 -0
  48. package/dist/components/chunk.HVTXQL7M.js.map +1 -0
  49. package/dist/components/index.js +7 -0
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/pos-add-new-thing2.js +1 -1
  52. package/dist/components/pos-app-browser.js +68 -61
  53. package/dist/components/pos-app-browser.js.map +1 -1
  54. package/dist/components/pos-app-dashboard2.js +1 -1
  55. package/dist/components/pos-app-generic.js +1 -1
  56. package/dist/components/pos-app-ldp-container.js +1 -1
  57. package/dist/components/pos-app-rdf-document.js +1 -1
  58. package/dist/components/pos-app-settings2.js +1 -1
  59. package/dist/components/pos-app2.js +1 -1
  60. package/dist/components/pos-dialog2.js +1 -1
  61. package/dist/components/pos-error-toast2.js +1 -1
  62. package/dist/components/pos-example-resources2.js +1 -1
  63. package/dist/components/pos-getting-started2.js +1 -1
  64. package/dist/components/pos-literals2.js +1 -1
  65. package/dist/components/pos-login-form2.js +1 -1
  66. package/dist/components/pos-login2.js +1 -1
  67. package/dist/components/pos-make-findable2.js +16 -21
  68. package/dist/components/pos-make-findable2.js.map +1 -1
  69. package/dist/components/pos-navigation-bar2.js +1 -1
  70. package/dist/components/pos-navigation2.js +1 -1
  71. package/dist/components/pos-new-thing-form2.js +1 -1
  72. package/dist/components/pos-rich-link2.js +2 -2
  73. package/dist/components/pos-router2.js +1 -1
  74. package/dist/components/pos-select-term2.js +1 -1
  75. package/dist/components/pos-setting-offline-cache2.js +1 -1
  76. package/dist/components/pos-user-menu.d.ts +11 -0
  77. package/dist/components/pos-user-menu.js +8 -0
  78. package/dist/components/pos-user-menu.js.map +1 -0
  79. package/dist/components/pos-user-menu2.js +293 -0
  80. package/dist/components/pos-user-menu2.js.map +1 -0
  81. package/dist/elements/elements.css +8 -2
  82. package/dist/elements/elements.esm.js +1 -1
  83. package/dist/elements/elements.esm.js.map +1 -1
  84. package/dist/elements/p-4e2a2d45.entry.js +652 -0
  85. package/dist/elements/p-4e2a2d45.entry.js.map +1 -0
  86. package/dist/elements/p-61cd1259.js +2 -0
  87. package/dist/elements/p-61cd1259.js.map +1 -0
  88. package/dist/elements/p-b1de75a4.entry.js +2 -0
  89. package/dist/elements/{p-178b3852.entry.js → p-c466d5bf.entry.js} +2 -2
  90. package/dist/elements/{p-2cda3231.entry.js → p-dbb94429.entry.js} +2 -2
  91. package/dist/elements/p-ff684bff.entry.js +2 -0
  92. package/dist/esm/app-globals-fd9221d0.js +21 -0
  93. package/dist/esm/app-globals-fd9221d0.js.map +1 -0
  94. package/dist/esm/elements.js +2 -2
  95. package/dist/esm/ion-badge_5.entry.js +1 -1
  96. package/dist/esm/ion-icon_32.entry.js +9115 -0
  97. package/dist/esm/ion-icon_32.entry.js.map +1 -0
  98. package/dist/esm/loader.js +2 -2
  99. package/dist/esm/pos-app-generic.entry.js +1 -1
  100. package/dist/esm/pos-app-ldp-container.entry.js +1 -1
  101. package/dist/esm/pos-app-rdf-document.entry.js +1 -1
  102. package/dist/types/components/pos-make-findable/pos-make-findable.d.ts +6 -3
  103. package/dist/types/components/pos-make-findable/shoelace.d.ts +3 -0
  104. package/dist/types/components/pos-user-menu/pos-user-menu.d.ts +13 -0
  105. package/dist/types/components/pos-user-menu/shoelace.d.ts +5 -0
  106. package/dist/types/components.d.ts +33 -0
  107. package/package.json +2 -1
  108. package/dist/cjs/app-globals-1c06b5ae.js +0 -16
  109. package/dist/cjs/app-globals-1c06b5ae.js.map +0 -1
  110. package/dist/cjs/ion-icon_31.cjs.entry.js +0 -4156
  111. package/dist/cjs/ion-icon_31.cjs.entry.js.map +0 -1
  112. package/dist/elements/p-b159fffd.entry.js +0 -20
  113. package/dist/elements/p-b159fffd.entry.js.map +0 -1
  114. package/dist/elements/p-c27a94bc.entry.js +0 -2
  115. package/dist/elements/p-e1957ea1.entry.js +0 -2
  116. package/dist/elements/p-ec7a6c44.js +0 -2
  117. package/dist/elements/p-ec7a6c44.js.map +0 -1
  118. package/dist/esm/app-globals-31ecda4c.js +0 -14
  119. package/dist/esm/app-globals-31ecda4c.js.map +0 -1
  120. package/dist/esm/ion-icon_31.entry.js +0 -4122
  121. package/dist/esm/ion-icon_31.entry.js.map +0 -1
  122. /package/dist/elements/{p-e1957ea1.entry.js.map → p-b1de75a4.entry.js.map} +0 -0
  123. /package/dist/elements/{p-178b3852.entry.js.map → p-c466d5bf.entry.js.map} +0 -0
  124. /package/dist/elements/{p-2cda3231.entry.js.map → p-dbb94429.entry.js.map} +0 -0
  125. /package/dist/elements/{p-c27a94bc.entry.js.map → p-ff684bff.entry.js.map} +0 -0
@@ -40,51 +40,6 @@ button.main {
40
40
  }
41
41
  }
42
42
 
43
- .options {
44
- position: absolute;
45
- animation: fadeIn 300ms;
46
- padding: 0;
47
- margin-top: var(--size-1);
48
- z-index: var(--layer-top);
49
-
50
- ol {
51
- display: flex;
52
- flex-direction: column;
53
- box-shadow: var(--shadow-md);
54
- backdrop-filter: var(--blur-md);
55
- border-radius: var(--radius-xs);
56
- overflow: hidden;
57
- color: var(--color-grey-900);
58
- background-color: var(--color-grey-200);
59
- padding: 0;
60
- margin: 0;
61
- list-style: none;
62
- label {
63
- display: flex;
64
- justify-content: flex-start;
65
- align-items: center;
66
- transition: all 300ms var(--ease-in-out-sine);
67
- margin: 0;
68
- border: none;
69
- outline: none;
70
- padding: var(--size-2);
71
- width: var(--size-full);
72
-
73
- &:hover,
74
- &:focus {
75
- filter: brightness(80%);
76
- }
77
-
78
- &:active {
79
- filter: brightness(90%);
80
- }
81
- }
82
- }
83
- label:has(input:checked) {
84
- background-color: var(--color-green-100);
85
- }
86
- }
87
-
88
43
  svg {
89
44
  display: inline-block;
90
45
  height: var(--size-6);
@@ -94,9 +49,10 @@ svg {
94
49
  }
95
50
 
96
51
  button.main:hover,
97
- button.open {
52
+ sl-dropdown[open] button {
98
53
  &.success {
99
54
  background: var(--color-green-200);
55
+ color: var(--color-green-700);
100
56
  }
101
57
  width: var(--size-full);
102
58
  height: var(--pos-navigation-bar-height);
@@ -107,12 +63,3 @@ button.open {
107
63
  display: inline-block;
108
64
  }
109
65
  }
110
-
111
- @keyframes fadeIn {
112
- 0% {
113
- opacity: 0;
114
- }
115
- 100% {
116
- opacity: 1;
117
- }
118
- }
@@ -2,6 +2,7 @@ import { h, Host } from "@stencil/core";
2
2
  import { LabelIndex } from "@pod-os/core";
3
3
  import { subscribePodOs } from "../events/PodOsAware";
4
4
  import session from "../../store/session";
5
+ import "./shoelace";
5
6
  export class PosMakeFindable {
6
7
  constructor() {
7
8
  this.indexes = [];
@@ -22,17 +23,6 @@ export class PosMakeFindable {
22
23
  disconnectedCallback() {
23
24
  this.unsubscribeSessionChange && this.unsubscribeSessionChange();
24
25
  }
25
- hideOptions(event) {
26
- // @ts-ignore
27
- if (!this.el.contains(event.target)) {
28
- this.showOptions = false;
29
- }
30
- }
31
- handleKeyDown(ev) {
32
- if (ev.key === 'Escape') {
33
- this.showOptions = false;
34
- }
35
- }
36
26
  updateUri(uri) {
37
27
  this.thing = this.os.store.get(uri);
38
28
  this.isIndexed = this.checkIfIndexed(uri);
@@ -43,6 +33,7 @@ export class PosMakeFindable {
43
33
  getLabelIndexes(profile) {
44
34
  if (profile) {
45
35
  this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));
36
+ this.showOptions = this.indexes.length > 1;
46
37
  this.isIndexed = this.checkIfIndexed(this.uri);
47
38
  }
48
39
  }
@@ -53,10 +44,7 @@ export class PosMakeFindable {
53
44
  await this.addToLabelIndex(index);
54
45
  this.indexUpdatedEmitter.emit(index);
55
46
  }
56
- else if (this.indexes.length > 1) {
57
- this.showOptions = !this.showOptions;
58
- }
59
- else {
47
+ else if (this.indexes.length === 0) {
60
48
  const index = await this.createDefaultLabelIndex();
61
49
  await this.addToLabelIndex(index);
62
50
  this.indexCreatedEmitter.emit(index);
@@ -70,7 +58,6 @@ export class PosMakeFindable {
70
58
  catch (e) {
71
59
  this.errorEmitter.emit(e);
72
60
  }
73
- this.showOptions = false;
74
61
  }
75
62
  async createDefaultLabelIndex() {
76
63
  try {
@@ -85,14 +72,22 @@ export class PosMakeFindable {
85
72
  return null;
86
73
  }
87
74
  const label = 'Make this findable';
88
- return (h(Host, null, h("button", { type: "button", "aria-label": label, class: { main: true, open: this.showOptions, success: this.isIndexed }, onClick: e => this.onClick(e), title: "" }, this.isIndexed ? h(IconSuccess, null) : h(IconMakeFindable, null), h("p", null, label)), this.showOptions && (h("div", { class: "options" }, h("ol", { role: "listbox" }, this.indexes.map((index) => (h("li", { role: "option" }, h("label", null, h("input", { type: "checkbox", checked: index.contains(this.uri), onChange: e => this.chooseOption(e, index) }), h("pos-resource", { uri: index.uri, lazy: true }, h("pos-label", null)))))))))));
75
+ const button = (h("button", { type: "button", slot: "trigger", "aria-label": label, class: { main: true, success: this.isIndexed }, onClick: e => this.onClick(e), title: "" }, this.isIndexed ? h(IconSuccess, null) : h(IconMakeFindable, null), h("p", null, label)));
76
+ if (this.showOptions) {
77
+ return (h(Host, null, h("sl-dropdown", null, button, h("sl-menu", { role: "listbox" }, this.indexes.map((index) => (h("sl-menu-item", { role: "option", value: index, type: "checkbox", checked: index.contains(this.uri) }, h("pos-resource", { uri: index.uri, lazy: true }, h("pos-label", null)))))))));
78
+ }
79
+ else {
80
+ return button;
81
+ }
89
82
  }
90
- async chooseOption(e, index) {
83
+ async onSelect(e) {
84
+ const index = e.detail.item.value;
91
85
  e.preventDefault();
92
86
  await this.addToLabelIndex(index);
93
87
  this.indexUpdatedEmitter.emit(index);
94
88
  }
95
89
  static get is() { return "pos-make-findable"; }
90
+ static get encapsulation() { return "shadow"; }
96
91
  static get originalStyleUrls() {
97
92
  return {
98
93
  "$": ["pos-make-findable.css"]
@@ -208,14 +203,8 @@ export class PosMakeFindable {
208
203
  }
209
204
  static get listeners() {
210
205
  return [{
211
- "name": "click",
212
- "method": "hideOptions",
213
- "target": "document",
214
- "capture": false,
215
- "passive": false
216
- }, {
217
- "name": "keydown",
218
- "method": "handleKeyDown",
206
+ "name": "sl-select",
207
+ "method": "onSelect",
219
208
  "target": undefined,
220
209
  "capture": false,
221
210
  "passive": false
@@ -1 +1 @@
1
- {"version":3,"file":"pos-make-findable.js","sourceRoot":"","sources":["../../../../src/components/pos-make-findable/pos-make-findable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,UAAU,EAA8B,MAAM,cAAc,CAAC;A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,CAAC,EAAC,wVAAwV,GAC1V,CACE,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,WACE,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc;IAErB,8BACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,gSAAgS,GAClS,CACE,CACP,CAAC","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\nimport { LabelIndex, PodOS, Thing, WebIdProfile } from '@pod-os/core';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\nimport session from '../../store/session';\n\n@Component({\n tag: 'pos-make-findable',\n styleUrl: 'pos-make-findable.css',\n})\nexport class PosMakeFindable implements PodOsAware {\n @Prop() uri!: string;\n\n @State() os: PodOS;\n @State() thing: Thing;\n @State() indexes: LabelIndex[] = [];\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n @State() unsubscribeSessionChange: undefined | (() => void);\n\n @State() showOptions = false;\n @State() isIndexed = false;\n\n @Event({ eventName: 'pod-os:error' }) errorEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-updated' }) indexUpdatedEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-created' }) indexCreatedEmitter: EventEmitter;\n\n @Element() el: HTMLElement;\n\n componentWillLoad() {\n subscribePodOs(this);\n }\n\n disconnectedCallback() {\n this.unsubscribeSessionChange && this.unsubscribeSessionChange();\n }\n\n @Listen('click', { target: 'document' })\n hideOptions(event: MouseEvent) {\n // @ts-ignore\n if (!this.el.contains(event.target)) {\n this.showOptions = false;\n }\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.showOptions = false;\n }\n }\n\n @Watch('uri')\n updateUri(uri: string) {\n this.thing = this.os.store.get(uri);\n this.isIndexed = this.checkIfIndexed(uri);\n }\n\n private checkIfIndexed(uri: string) {\n return this.indexes.some(it => it.contains(uri));\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n this.thing = this.os.store.get(this.uri);\n this.getLabelIndexes(session.state.profile);\n this.unsubscribeSessionChange = session.onChange('profile', profile => {\n this.getLabelIndexes(profile);\n });\n };\n\n private getLabelIndexes(profile: WebIdProfile) {\n if (profile) {\n this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));\n this.isIndexed = this.checkIfIndexed(this.uri);\n }\n }\n\n private async onClick(e: MouseEvent) {\n e.preventDefault();\n if (this.indexes.length === 1) {\n const index = this.indexes[0];\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n } else if (this.indexes.length > 1) {\n this.showOptions = !this.showOptions;\n } else {\n const index = await this.createDefaultLabelIndex();\n await this.addToLabelIndex(index);\n this.indexCreatedEmitter.emit(index);\n }\n }\n\n private async addToLabelIndex(index: LabelIndex) {\n try {\n await this.os.addToLabelIndex(this.thing, index);\n this.isIndexed = true;\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n\n this.showOptions = false;\n }\n\n private async createDefaultLabelIndex(): Promise<LabelIndex> {\n try {\n return await this.os.createDefaultLabelIndex(session.state.profile);\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n }\n\n render() {\n if (!session.state.isLoggedIn || !this.uri) {\n return null;\n }\n\n const label = 'Make this findable';\n return (\n <Host>\n <button\n type=\"button\"\n aria-label={label}\n class={{ main: true, open: this.showOptions, success: this.isIndexed }}\n onClick={e => this.onClick(e)}\n title=\"\"\n >\n {this.isIndexed ? <IconSuccess /> : <IconMakeFindable />}\n <p>{label}</p>\n </button>\n {this.showOptions && (\n <div class=\"options\">\n <ol role=\"listbox\">\n {this.indexes.map((index: LabelIndex) => (\n <li role=\"option\">\n <label>\n <input\n type=\"checkbox\"\n checked={index.contains(this.uri)}\n onChange={e => this.chooseOption(e, index)}\n />\n <pos-resource uri={index.uri} lazy={true}>\n <pos-label></pos-label>\n </pos-resource>\n </label>\n </li>\n ))}\n </ol>\n </div>\n )}\n </Host>\n );\n }\n\n private async chooseOption(e: Event, index: LabelIndex) {\n e.preventDefault();\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n }\n}\n\nconst IconMakeFindable = () => (\n <svg\n role=\"presentation\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\"\n />\n </svg>\n);\n\nconst IconSuccess = () => (\n <svg\n role=\"presentation\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12\"\n />\n </svg>\n);\n"]}
1
+ {"version":3,"file":"pos-make-findable.js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AW,GAAG,GAAG,EAAE,CAAC,CACxB,WACE,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc;IAErB,8BACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,gSAAgS,GAClS,CACE,CACP,CAAC","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\nimport { LabelIndex, PodOS, Thing, WebIdProfile } from '@pod-os/core';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\nimport session from '../../store/session';\n\nimport './shoelace';\n\n@Component({\n tag: 'pos-make-findable',\n styleUrl: 'pos-make-findable.css',\n shadow: true,\n})\nexport class PosMakeFindable implements PodOsAware {\n @Prop() uri!: string;\n\n @State() os: PodOS;\n @State() thing: Thing;\n @State() indexes: LabelIndex[] = [];\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n @State() unsubscribeSessionChange: undefined | (() => void);\n\n @State() showOptions = false;\n @State() isIndexed = false;\n\n @Event({ eventName: 'pod-os:error' }) errorEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-updated' }) indexUpdatedEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-created' }) indexCreatedEmitter: EventEmitter;\n\n @Element() el: HTMLElement;\n\n componentWillLoad() {\n subscribePodOs(this);\n }\n\n disconnectedCallback() {\n this.unsubscribeSessionChange && this.unsubscribeSessionChange();\n }\n\n @Watch('uri')\n updateUri(uri: string) {\n this.thing = this.os.store.get(uri);\n this.isIndexed = this.checkIfIndexed(uri);\n }\n\n private checkIfIndexed(uri: string) {\n return this.indexes.some(it => it.contains(uri));\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n this.thing = this.os.store.get(this.uri);\n this.getLabelIndexes(session.state.profile);\n this.unsubscribeSessionChange = session.onChange('profile', profile => {\n this.getLabelIndexes(profile);\n });\n };\n\n private getLabelIndexes(profile: WebIdProfile) {\n if (profile) {\n this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));\n this.showOptions = this.indexes.length > 1;\n this.isIndexed = this.checkIfIndexed(this.uri);\n }\n }\n\n private async onClick(e: MouseEvent) {\n e.preventDefault();\n if (this.indexes.length === 1) {\n const index = this.indexes[0];\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n } else if (this.indexes.length === 0) {\n const index = await this.createDefaultLabelIndex();\n await this.addToLabelIndex(index);\n this.indexCreatedEmitter.emit(index);\n }\n }\n\n private async addToLabelIndex(index: LabelIndex) {\n try {\n await this.os.addToLabelIndex(this.thing, index);\n this.isIndexed = true;\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n }\n\n private async createDefaultLabelIndex(): Promise<LabelIndex> {\n try {\n return await this.os.createDefaultLabelIndex(session.state.profile);\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n }\n\n render() {\n if (!session.state.isLoggedIn || !this.uri) {\n return null;\n }\n\n const label = 'Make this findable';\n const button = (\n <button\n type=\"button\"\n slot=\"trigger\"\n aria-label={label}\n class={{ main: true, success: this.isIndexed }}\n onClick={e => this.onClick(e)}\n title=\"\"\n >\n {this.isIndexed ? <IconSuccess /> : <IconMakeFindable />}\n <p>{label}</p>\n </button>\n );\n if (this.showOptions) {\n return (\n <Host>\n <sl-dropdown>\n {button}\n <sl-menu role=\"listbox\">\n {this.indexes.map((index: LabelIndex) => (\n <sl-menu-item role=\"option\" value={index} type=\"checkbox\" checked={index.contains(this.uri)}>\n <pos-resource uri={index.uri} lazy={true}>\n <pos-label></pos-label>\n </pos-resource>\n </sl-menu-item>\n ))}\n </sl-menu>\n </sl-dropdown>\n </Host>\n );\n } else {\n return button;\n }\n }\n\n @Listen('sl-select')\n async onSelect(e: CustomEvent<{ item: { value: LabelIndex } }>) {\n const index = e.detail.item.value;\n e.preventDefault();\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n }\n}\n\nconst IconMakeFindable = () => (\n <svg\n role=\"presentation\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\"\n />\n </svg>\n);\n\nconst IconSuccess = () => (\n <svg\n role=\"presentation\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12\"\n />\n </svg>\n);\n"]}
@@ -0,0 +1,4 @@
1
+ import "@shoelace-style/shoelace/dist/components/dropdown/dropdown.js";
2
+ import "@shoelace-style/shoelace/dist/components/menu/menu.js";
3
+ import "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js";
4
+ //# sourceMappingURL=shoelace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shoelace.js","sourceRoot":"","sources":["../../../../src/components/pos-make-findable/shoelace.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iEAAiE,CAAC","sourcesContent":["import '@shoelace-style/shoelace/dist/components/dropdown/dropdown.js';\nimport '@shoelace-style/shoelace/dist/components/menu/menu.js';\nimport '@shoelace-style/shoelace/dist/components/menu-item/menu-item.js';\n"]}
@@ -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: '1b507d50bd24f257023fe980f1ffdb3abe903577', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: 'e96559f40418154a26350705ae6e3dbf8057a424', uri: this.current.uri }), h("button", { key: '2ac476bd89918e71ca10cc945952f8c9905865df', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: 'd34b73e2090f08cab8533d03a7b206d420bfa8c2' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon())));
14
+ return (h("section", { key: '4b942ac9ddb8c7ec9325197dc0906c8e236586d9', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: '4202379b075353cf6c0214fbc5a00b892ad948e1', uri: this.current.uri }), h("button", { key: 'e59f5644299d8eee98d3fd179a1796aa837bb0cc', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: '4a4df2d898be9c916b3fa31b00bd9bf2b3beabd1' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon())));
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" })));
@@ -113,7 +113,7 @@ export class PosNavigation {
113
113
  }
114
114
  }
115
115
  render() {
116
- return (h("nav", { key: '5c6c07b6b2f9ccb0e45bd59b5e477d8ed3d52c2d' }, h("search", { key: '19997ad34212d679547ad5e1bb2f5ea53e576361' }, h("pos-navigation-bar", { key: '2d1c073b2c53ba8cd5afbb595cc95015e5a50e5b', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: '55de5a58604feaf54426b643b434560dbc55a9a1', ref: el => (this.dialogRef = el) }, h("form", { key: '50c064938ec275b53bde81d9bb6c86e0c708a625', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: 'ca06fd69e8346cb8bb0868560f39987b4545c8f5', ref: el => (this.inputRef = el), enterkeyhint: "search", "aria-label": "Search or enter URI", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e), role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.suggestions.length > 0, "aria-controls": "suggestions-list", "aria-activedescendant": this.selectedIndex >= 0 ? `option-${this.selectedIndex}` : null }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", { id: "suggestions-list", role: "listbox", "aria-label": "Search results" }, this.suggestions.map((it, index) => (h("li", { id: `option-${index}`, role: "option", "aria-selected": index === this.selectedIndex ? 'true' : 'false' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
116
+ return (h("nav", { key: 'c6f9915d7778a332aa0e2f3b19b733da63b55d3a' }, h("search", { key: '2911efe53775a82d6c87ba823adfd2f37d196994' }, h("pos-navigation-bar", { key: 'ce9d62d0fdc81df2f6c7f7750b5c4fc98e2b0240', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: 'cab1f4261e43e8318582d6b37096301a7ef987cc', ref: el => (this.dialogRef = el) }, h("form", { key: '3caed872d467ef70c3b097da4f337f492bafdc9f', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: '72ba8d15816608dab944f7d8541713bbf177c1c2', ref: el => (this.inputRef = el), enterkeyhint: "search", "aria-label": "Search or enter URI", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e), role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.suggestions.length > 0, "aria-controls": "suggestions-list", "aria-activedescendant": this.selectedIndex >= 0 ? `option-${this.selectedIndex}` : null }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", { id: "suggestions-list", role: "listbox", "aria-label": "Search results" }, this.suggestions.map((it, index) => (h("li", { id: `option-${index}`, role: "option", "aria-selected": index === this.selectedIndex ? 'true' : 'false' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
117
117
  }
118
118
  static get is() { return "pos-navigation"; }
119
119
  static get encapsulation() { return "shadow"; }
@@ -14,7 +14,7 @@ export class PosNewThingForm {
14
14
  subscribePodOs(this);
15
15
  }
16
16
  render() {
17
- return (h("form", { key: '6d8a76b95abc98ab382b425b2dd8894983bb9522', method: "dialog", onSubmit: e => this.handleSubmit(e) }, h("label", { key: '6fe391ac186c0b0a8e6bb3265e66469dac3ab187', htmlFor: "type" }, "Type"), h("pos-select-term", { key: '33b50596c8cd22d8ce2b1af114277fa9bfd80355', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), h("label", { key: '8681f29f0c20d59c2be10a1f49cc38dea6abd19d', htmlFor: "name" }, "Name"), h("input", { key: 'f5905d871b55821f7019134d972e1f156c55f49e', 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: 'dade4834abecd9bf2fc8eb5bca0b1f60784287a4', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
17
+ return (h("form", { key: '947421a1e826b4cc59a5d92cf83d25726257c871', method: "dialog", onSubmit: e => this.handleSubmit(e) }, h("label", { key: 'fd239a8b7c9d7b6f833acc794c4ce44d884d240f', htmlFor: "type" }, "Type"), h("pos-select-term", { key: '04b2e4bfdb8590bcb4bc4c822780bffd126488fa', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), h("label", { key: 'fa363e0adf2d73c0f22ce90588504ec3b8b6cb6f', htmlFor: "name" }, "Name"), h("input", { key: 'b3c9ff73ea9b1e1e1c059287f3876935fc845699', 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: 'a804450dd5c59ee847f736861e0eeb6616476081', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
18
18
  }
19
19
  handleChange(event) {
20
20
  this.name = event.target.value;
@@ -1,10 +1,10 @@
1
1
  import { h } from "@stencil/core";
2
2
  export class PosRichLink {
3
3
  render() {
4
- return (h("pos-resource", { key: '389fb8817f5a7ff77965a8bb9924f48af15c528c', lazy: true, uri: this.uri }, h("p", { key: '1946deeff38a510800ef1558fd6374f65d72cd7f', class: "content" }, h("a", { key: '776c99ca32c7cd7fac30ab1f18b1c024b234d85f', href: this.uri, onClick: e => {
4
+ return (h("pos-resource", { key: 'f41ba8c5430e96e47d176b4e85633bad4ee9b0a7', lazy: true, uri: this.uri }, h("p", { key: '0a92fa1df51d78c0e8d1f6d47af078cb0cbe264a', class: "content" }, h("a", { key: '27c623707a5cbc6618d5a70e0eacc2fd5552d7dd', href: this.uri, onClick: e => {
5
5
  e.preventDefault();
6
6
  this.linkEmitter.emit(this.uri);
7
- } }, h("pos-label", { key: '0ddb22c414f2e4d61cf1beabb301b723b78235e1' })), h("span", { key: 'd2730c1fcc1c1521a7527bdb7a63c091ff49746c', class: "url" }, new URL(this.uri).host), h("pos-description", { key: '53867e57b7403aed46e94a5f3df0b8389bc68244' }))));
7
+ } }, h("pos-label", { key: 'e8cb96334502e2f2fad85c35096baa3a6cc890cb' })), h("span", { key: '0f0feeee5e65f982d54cd474c42ed14759d2e834', class: "url" }, new URL(this.uri).host), h("pos-description", { key: '87a7cdf2c0e1f523ecdbed2e786d948f267ad303' }))));
8
8
  }
9
9
  static get is() { return "pos-rich-link"; }
10
10
  static get encapsulation() { return "shadow"; }
@@ -38,7 +38,7 @@ export class PosRouter {
38
38
  this.routeChanged.emit(this.uri);
39
39
  }
40
40
  render() {
41
- return h("slot", { key: 'a5a451a8ddf4a30c6e5cbb2faf61d44f5a286df9' });
41
+ return h("slot", { key: 'e3d70ed25e70d8273a2c820bb92fec69b7f70f25' });
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: '7f7d48443893800bb818e67865fccdbe1d10d44a' }, h("input", { key: 'ee24690418d5a4d6e357154e12685fa9975754f9', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: '78fde7ccb4e0750e902da139b02810c15c21db3e', part: "terms", id: "terms" }, this.terms.map(term => (h("option", { value: term.uri }, term.shorthand))))));
22
+ return (h(Host, { key: 'c9529ceaf82d8aa1a3f73532e8ca0f99aa3fc4e6' }, h("input", { key: '2de0e74b99ae5dd7aa6d7bdea4289b9e25b7629e', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: '92e240a12c0d733c15b8daf971e3026a1d535561', 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,23 @@
1
+ button {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ padding: 0;
6
+ margin: 0;
7
+ border: none;
8
+ background: none;
9
+ cursor: pointer;
10
+ border-radius: 50%;
11
+ pos-picture {
12
+ --width: 40px;
13
+ --height: 40px;
14
+ --border-radius: 50%;
15
+ }
16
+ sl-avatar {
17
+ --size: 40px;
18
+ }
19
+ }
20
+
21
+ sl-dropdown {
22
+ display: block;
23
+ }
@@ -0,0 +1,102 @@
1
+ import { h } from "@stencil/core";
2
+ import "./shoelace";
3
+ export class PosUserMenu {
4
+ onSelect(e) {
5
+ const { value } = e.detail.item;
6
+ if (value === 'logout') {
7
+ this.logout.emit();
8
+ }
9
+ else if (value === 'profile') {
10
+ this.link.emit(this.webId);
11
+ }
12
+ else if (value === 'dashboard') {
13
+ this.link.emit('pod-os:dashboard');
14
+ }
15
+ else if (value === 'settings') {
16
+ this.link.emit('pod-os:settings');
17
+ }
18
+ }
19
+ render() {
20
+ if (!this.webId)
21
+ return null; //?
22
+ return (h("pos-resource", { uri: this.webId }, h("sl-dropdown", null, h("button", { slot: "trigger", "aria-label": "User menu" }, h("pos-picture", null, 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
+ }
24
+ static get is() { return "pos-user-menu"; }
25
+ static get encapsulation() { return "shadow"; }
26
+ static get originalStyleUrls() {
27
+ return {
28
+ "$": ["pos-user-menu.css"]
29
+ };
30
+ }
31
+ static get styleUrls() {
32
+ return {
33
+ "$": ["pos-user-menu.css"]
34
+ };
35
+ }
36
+ static get properties() {
37
+ return {
38
+ "webId": {
39
+ "type": "string",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "string",
43
+ "resolved": "string",
44
+ "references": {}
45
+ },
46
+ "required": true,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "getter": false,
53
+ "setter": false,
54
+ "attribute": "web-id",
55
+ "reflect": false
56
+ }
57
+ };
58
+ }
59
+ static get events() {
60
+ return [{
61
+ "method": "logout",
62
+ "name": "pod-os:logout",
63
+ "bubbles": true,
64
+ "cancelable": true,
65
+ "composed": true,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "complexType": {
71
+ "original": "any",
72
+ "resolved": "any",
73
+ "references": {}
74
+ }
75
+ }, {
76
+ "method": "link",
77
+ "name": "pod-os:link",
78
+ "bubbles": true,
79
+ "cancelable": true,
80
+ "composed": true,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ },
85
+ "complexType": {
86
+ "original": "any",
87
+ "resolved": "any",
88
+ "references": {}
89
+ }
90
+ }];
91
+ }
92
+ static get listeners() {
93
+ return [{
94
+ "name": "sl-select",
95
+ "method": "onSelect",
96
+ "target": undefined,
97
+ "capture": false,
98
+ "passive": false
99
+ }];
100
+ }
101
+ }
102
+ //# sourceMappingURL=pos-user-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pos-user-menu.js","sourceRoot":"","sources":["../../../../src/components/pos-user-menu/pos-user-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,YAAY,CAAC;AAOpB,MAAM,OAAO,WAAW;IAWtB,QAAQ,CAAC,CAAuE;QAC9E,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QAChC,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,CAAC,GAAG;QACjC,OAAO,CACL,oBAAc,GAAG,EAAE,IAAI,CAAC,KAAK;YAC3B;gBACE,cAAQ,IAAI,EAAC,SAAS,gBAAY,WAAW;oBAC3C;wBACE,oBAAuB,CACX,CACP;gBACT;oBACE,oBAAc,KAAK,EAAC,WAAW,gBAAyB;oBACxD,oBAAc,KAAK,EAAC,SAAS;wBAC3B,oBAAuB,CACV;oBACf,oBAAc,KAAK,EAAC,UAAU,eAAwB;oBACtD,qBAAyB;oBACzB,oBAAc,KAAK,EAAC,QAAQ,aAAsB,CAC1C,CACE,CACD,CAChB,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Prop } from '@stencil/core';\n\nimport './shoelace';\n\n@Component({\n tag: 'pos-user-menu',\n shadow: true,\n styleUrl: 'pos-user-menu.css',\n})\nexport class PosUserMenu {\n @Prop()\n webId!: string;\n\n @Event({ eventName: 'pod-os:logout' })\n logout: EventEmitter;\n\n @Event({ eventName: 'pod-os:link' })\n link: EventEmitter;\n\n @Listen('sl-select')\n onSelect(e: CustomEvent<{ item: { value: 'profile' | 'logout' | 'dashboard' } }>) {\n const { value } = e.detail.item;\n if (value === 'logout') {\n this.logout.emit();\n } else if (value === 'profile') {\n this.link.emit(this.webId);\n } else if (value === 'dashboard') {\n this.link.emit('pod-os:dashboard');\n } else if (value === 'settings') {\n this.link.emit('pod-os:settings');\n }\n }\n\n render() {\n if (!this.webId) return null; //?\n return (\n <pos-resource uri={this.webId}>\n <sl-dropdown>\n <button slot=\"trigger\" aria-label=\"User menu\">\n <pos-picture>\n <sl-avatar></sl-avatar>\n </pos-picture>\n </button>\n <sl-menu>\n <sl-menu-item value=\"dashboard\">Dashboard</sl-menu-item>\n <sl-menu-item value=\"profile\">\n <pos-label></pos-label>\n </sl-menu-item>\n <sl-menu-item value=\"settings\">Settings</sl-menu-item>\n <sl-divider></sl-divider>\n <sl-menu-item value=\"logout\">Logout</sl-menu-item>\n </sl-menu>\n </sl-dropdown>\n </pos-resource>\n );\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import "@shoelace-style/shoelace/dist/components/dropdown/dropdown.js";
2
+ import "@shoelace-style/shoelace/dist/components/menu/menu.js";
3
+ import "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js";
4
+ import "@shoelace-style/shoelace/dist/components/avatar/avatar.js";
5
+ import "@shoelace-style/shoelace/dist/components/divider/divider.js";
6
+ //# sourceMappingURL=shoelace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shoelace.js","sourceRoot":"","sources":["../../../../src/components/pos-user-menu/shoelace.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AACnE,OAAO,6DAA6D,CAAC","sourcesContent":["import '@shoelace-style/shoelace/dist/components/dropdown/dropdown.js';\nimport '@shoelace-style/shoelace/dist/components/menu/menu.js';\nimport '@shoelace-style/shoelace/dist/components/menu-item/menu-item.js';\nimport '@shoelace-style/shoelace/dist/components/avatar/avatar.js';\nimport '@shoelace-style/shoelace/dist/components/divider/divider.js';\n"]}
@@ -1,2 +1,8 @@
1
1
  import "@ionic/core";
2
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
3
+ function updateTheme(e) {
4
+ document.documentElement.classList.toggle('sl-theme-dark', e.matches);
5
+ }
6
+ updateTheme(mediaQuery);
7
+ mediaQuery.addEventListener('change', updateTheme);
2
8
  //# sourceMappingURL=global.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC","sourcesContent":["import '@ionic/core';\n"]}
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAErE,SAAS,WAAW,CAAC,CAAC;IACpB,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC;AAED,WAAW,CAAC,UAAU,CAAC,CAAC;AAExB,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import '@ionic/core';\n\nconst mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\nfunction updateTheme(e) {\n document.documentElement.classList.toggle('sl-theme-dark', e.matches);\n}\n\nupdateTheme(mediaQuery);\n\nmediaQuery.addEventListener('change', updateTheme);\n"]}