solid-ui 5.0.2-5 → 5.0.2-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{DialogProvider-CdesAsw-.js → DialogProvider-CcyasSmM.js} +3 -3
- package/dist/chunks/{DialogProvider-CdesAsw-.js.map → DialogProvider-CcyasSmM.js.map} +1 -1
- package/dist/chunks/{ResourceActionsMenu-Bx7YWY3E.js → ResourceActionsMenu-Dm1hvIj5.js} +57 -48
- package/dist/chunks/ResourceActionsMenu-Dm1hvIj5.js.map +1 -0
- package/dist/chunks/{access-control-modal-B1mFFIyz.js → access-control-modal-XJm3Czd5.js} +10 -10
- package/dist/chunks/{access-control-modal-B1mFFIyz.js.map → access-control-modal-XJm3Czd5.js.map} +1 -1
- package/dist/chunks/{account-DWmMJre6.js → account-BqJdA0tO.js} +10 -10
- package/dist/chunks/{account-DWmMJre6.js.map → account-BqJdA0tO.js.map} +1 -1
- package/dist/chunks/{auth-EK-iYNYZ.js → auth-CCrvazv_.js} +9 -9
- package/dist/chunks/{auth-EK-iYNYZ.js.map → auth-CCrvazv_.js.map} +1 -1
- package/dist/chunks/{avatar-BBgvMlqv.js → avatar-DHC_B7vJ.js} +3 -3
- package/dist/chunks/{avatar-BBgvMlqv.js.map → avatar-DHC_B7vJ.js.map} +1 -1
- package/dist/chunks/{button-D6qO2idW.js → button-DFgsOHBh.js} +2 -2
- package/dist/chunks/{button-D6qO2idW.js.map → button-DFgsOHBh.js.map} +1 -1
- package/dist/chunks/{chunk.UEBQI7VV-lcP-fpUk.js → chunk.UEBQI7VV-DVcxHNfV.js} +2 -2
- package/dist/chunks/{chunk.UEBQI7VV-lcP-fpUk.js.map → chunk.UEBQI7VV-DVcxHNfV.js.map} +1 -1
- package/dist/chunks/{combobox-DS6byaf1.js → combobox-CtFy7qwi.js} +3 -3
- package/dist/chunks/{combobox-DS6byaf1.js.map → combobox-CtFy7qwi.js.map} +1 -1
- package/dist/chunks/{combobox-option-DOtGuKel.js → combobox-option-B8b1khQy.js} +2 -2
- package/dist/chunks/{combobox-option-DOtGuKel.js.map → combobox-option-B8b1khQy.js.map} +1 -1
- package/dist/chunks/{components-C8c2Ucm5.js → components-CmnPlcEi.js} +2 -2
- package/dist/chunks/{components-C8c2Ucm5.js.map → components-CmnPlcEi.js.map} +1 -1
- package/dist/chunks/{context-BDrfQ9bN.js → context-Dr-MkMP6.js} +2 -2
- package/dist/chunks/{context-BDrfQ9bN.js.map → context-Dr-MkMP6.js.map} +1 -1
- package/dist/chunks/{dialog-CgYK767T.js → dialog-BY_pM7CM.js} +4 -4
- package/dist/chunks/{dialog-CgYK767T.js.map → dialog-BY_pM7CM.js.map} +1 -1
- package/dist/chunks/{dialog-content-DjwRH1ci.js → dialog-content-DfTs9gaK.js} +2 -2
- package/dist/chunks/{dialog-content-DjwRH1ci.js.map → dialog-content-DfTs9gaK.js.map} +1 -1
- package/dist/chunks/{dialog-footer-GQWi8lfB.js → dialog-footer-oZsrnodi.js} +2 -2
- package/dist/chunks/{dialog-footer-GQWi8lfB.js.map → dialog-footer-oZsrnodi.js.map} +1 -1
- package/dist/chunks/{dialog-header-c3qOMQfb.js → dialog-header-_6It5zCM.js} +2 -2
- package/dist/chunks/{dialog-header-c3qOMQfb.js.map → dialog-header-_6It5zCM.js.map} +1 -1
- package/dist/chunks/{dialogs-BmtLjMzg.js → dialogs-DP4-6e8A.js} +2 -2
- package/dist/chunks/{dialogs-BmtLjMzg.js.map → dialogs-DP4-6e8A.js.map} +1 -1
- package/dist/chunks/{dialogs-root-BNF3_SA8.js → dialogs-root-B-yfITRL.js} +3 -3
- package/dist/chunks/{dialogs-root-BNF3_SA8.js.map → dialogs-root-B-yfITRL.js.map} +1 -1
- package/dist/chunks/{error-state-jV9dlFX2.js → error-state-CaxNmA0L.js} +3 -3
- package/dist/chunks/{error-state-jV9dlFX2.js.map → error-state-CaxNmA0L.js.map} +1 -1
- package/dist/chunks/{file-explorer-header-Djp_eFuT.js → file-explorer-header-Bu06_N7G.js} +163 -135
- package/dist/chunks/file-explorer-header-Bu06_N7G.js.map +1 -0
- package/dist/chunks/{file-explorer-provider-DpjC7uds.js → file-explorer-provider-DqZDDpUX.js} +4 -4
- package/dist/chunks/{file-explorer-provider-DpjC7uds.js.map → file-explorer-provider-DqZDDpUX.js.map} +1 -1
- package/dist/chunks/{guard-SxVT1xr4.js → guard-R26Y08Rq.js} +3 -3
- package/dist/chunks/{guard-SxVT1xr4.js.map → guard-R26Y08Rq.js.map} +1 -1
- package/dist/chunks/{input-Bz3l514j.js → input-BlwhSsYC.js} +2 -2
- package/dist/chunks/{input-Bz3l514j.js.map → input-BlwhSsYC.js.map} +1 -1
- package/dist/chunks/{login-button-Dd0rwZJk.js → login-button-BZH27kcX.js} +4 -4
- package/dist/chunks/{login-button-Dd0rwZJk.js.map → login-button-BZH27kcX.js.map} +1 -1
- package/dist/chunks/{logout-button-Da34Lrnq.js → logout-button-CrTKHw_t.js} +4 -4
- package/dist/chunks/{logout-button-Da34Lrnq.js.map → logout-button-CrTKHw_t.js.map} +1 -1
- package/dist/chunks/{menu-BNJU654v.js → menu-clQ0N3ba.js} +3 -3
- package/dist/chunks/{menu-BNJU654v.js.map → menu-clQ0N3ba.js.map} +1 -1
- package/dist/chunks/{menu-item-nfPpH4dN.js → menu-item-DmQ4ZQQ2.js} +3 -3
- package/dist/chunks/menu-item-DmQ4ZQQ2.js.map +1 -0
- package/dist/chunks/{photo-capture-hJaJm4TM.js → photo-capture-KYEqSWFH.js} +4 -4
- package/dist/chunks/{photo-capture-hJaJm4TM.js.map → photo-capture-KYEqSWFH.js.map} +1 -1
- package/dist/chunks/{photo-capture-modal-BsHv6wmh.js → photo-capture-modal-YmzRHhUg.js} +6 -6
- package/dist/chunks/{photo-capture-modal-BsHv6wmh.js.map → photo-capture-modal-YmzRHhUg.js.map} +1 -1
- package/dist/chunks/{provide-z9U64q4m.js → provide-1sJJkgCO.js} +2 -2
- package/dist/chunks/{provide-z9U64q4m.js.map → provide-1sJJkgCO.js.map} +1 -1
- package/dist/chunks/{provider-B3FoP2qW.js → provider-DC-qEkao.js} +5 -5
- package/dist/chunks/{provider-B3FoP2qW.js.map → provider-DC-qEkao.js.map} +1 -1
- package/dist/chunks/{rdf-form-BkKDmFPD.js → rdf-form-BhevRpHy.js} +3 -3
- package/dist/chunks/{rdf-form-BkKDmFPD.js.map → rdf-form-BhevRpHy.js.map} +1 -1
- package/dist/chunks/{rdf-input-BPePtqfS.js → rdf-input-2s3O54hm.js} +3 -3
- package/dist/chunks/{rdf-input-BPePtqfS.js.map → rdf-input-2s3O54hm.js.map} +1 -1
- package/dist/chunks/{select-ClPkDkGl.js → select-DQtYJhLc.js} +2 -2
- package/dist/chunks/{select-ClPkDkGl.js.map → select-DQtYJhLc.js.map} +1 -1
- package/dist/chunks/{select-option-DQan7rcB.js → select-option-BdE45Q3h.js} +2 -2
- package/dist/chunks/{select-option-DQan7rcB.js.map → select-option-BdE45Q3h.js.map} +1 -1
- package/dist/chunks/{signup-button-DOInssOu.js → signup-button-yONuztWR.js} +4 -4
- package/dist/chunks/{signup-button-DOInssOu.js.map → signup-button-yONuztWR.js.map} +1 -1
- package/dist/chunks/{solid-emblem-DwLdkGuO.js → solid-emblem-Dc1cwhXb.js} +2 -2
- package/dist/chunks/{solid-emblem-DwLdkGuO.js.map → solid-emblem-Dc1cwhXb.js.map} +1 -1
- package/dist/chunks/square-arrow-out-up-right-DaALlpHo.js +9 -0
- package/dist/chunks/square-arrow-out-up-right-DaALlpHo.js.map +1 -0
- package/dist/chunks/{src-akaVfkuf.js → src-BUfVUeNt.js} +2949 -2932
- package/dist/chunks/src-BUfVUeNt.js.map +1 -0
- package/dist/chunks/{widgets-B1hBVhRL.js → widgets-C92ihtlF.js} +483 -487
- package/dist/chunks/widgets-C92ihtlF.js.map +1 -0
- package/dist/components/access-control-modal.js +1 -1
- package/dist/components/account.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/combobox-option.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/dialog-content.js +1 -1
- package/dist/components/dialog-footer.js +1 -1
- package/dist/components/dialog-header.js +1 -1
- package/dist/components/dialog-provider.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialogs-root.js +1 -1
- package/dist/components/error-state.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +3 -2
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +57 -45
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +5 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +12 -10
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +72 -59
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -1
- package/dist/components/file-explorer-header.js +1 -1
- package/dist/components/file-explorer-provider.js +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/login-button.js +1 -1
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button.js +1 -1
- package/dist/components/menu-item/MenuItem.styles.cjs.js +1 -1
- package/dist/components/menu-item/MenuItem.styles.cjs.js.map +1 -1
- package/dist/components/menu-item/MenuItem.styles.esm.js +1 -1
- package/dist/components/menu-item/MenuItem.styles.esm.js.map +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/photo-capture-modal.js +1 -1
- package/dist/components/photo-capture.js +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/rdf-form.js +1 -1
- package/dist/components/rdf-input.js +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +7 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +11 -2
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -1
- package/dist/components/resource-actions-menu.js +1 -1
- package/dist/components/select-option.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components/solid-emblem.js +1 -1
- package/dist/components.js +30 -30
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/lib/components/web-component/WebComponent.styles.cjs.js +1 -1
- package/dist/lib/components/web-component/WebComponent.styles.esm.js +1 -1
- package/dist/lib/file-explorer/compose-explorer.cjs.js +1 -1
- package/dist/lib/file-explorer/compose-explorer.cjs.js.map +1 -1
- package/dist/lib/file-explorer/compose-explorer.d.ts +1 -1
- package/dist/lib/file-explorer/compose-explorer.d.ts.map +1 -1
- package/dist/lib/file-explorer/compose-explorer.esm.js +1 -1
- package/dist/lib/file-explorer/compose-explorer.esm.js.map +1 -1
- package/dist/lib/file-explorer/index.cjs.js +1 -1
- package/dist/lib/file-explorer/index.d.ts +1 -0
- package/dist/lib/file-explorer/index.d.ts.map +1 -1
- package/dist/lib/file-explorer/index.esm.js +2 -1
- package/dist/lib/file-explorer/pane-menu-items.cjs.js +2 -0
- package/dist/lib/file-explorer/pane-menu-items.cjs.js.map +1 -0
- package/dist/lib/file-explorer/pane-menu-items.d.ts +22 -0
- package/dist/lib/file-explorer/pane-menu-items.d.ts.map +1 -0
- package/dist/lib/file-explorer/pane-menu-items.esm.js +20 -0
- package/dist/lib/file-explorer/pane-menu-items.esm.js.map +1 -0
- package/dist/loader.js +7 -7
- package/dist/solid-ui.js +72 -63
- package/dist/solid-ui.min.js +72 -63
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/ResourceActionsMenu-Bx7YWY3E.js.map +0 -1
- package/dist/chunks/file-explorer-header-Djp_eFuT.js.map +0 -1
- package/dist/chunks/menu-item-nfPpH4dN.js.map +0 -1
- package/dist/chunks/src-akaVfkuf.js.map +0 -1
- package/dist/chunks/widgets-B1hBVhRL.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as AccessControlModal, t as default } from "../chunks/access-control-modal-
|
|
1
|
+
export { n as AccessControlModal, t as default } from "../chunks/access-control-modal-XJm3Czd5.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as Account, t as default } from "../chunks/account-
|
|
1
|
+
export { n as Account, t as default } from "../chunks/account-BqJdA0tO.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as Avatar, t as default } from "../chunks/avatar-
|
|
1
|
+
export { n as Avatar, t as default } from "../chunks/avatar-DHC_B7vJ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as BUTTON_VARIANTS, r as Button, t as default } from "../chunks/button-
|
|
1
|
+
export { n as BUTTON_VARIANTS, r as Button, t as default } from "../chunks/button-DFgsOHBh.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as ComboboxOption, t as default } from "../chunks/combobox-option-
|
|
1
|
+
export { n as ComboboxOption, t as default } from "../chunks/combobox-option-B8b1khQy.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as Combobox, t as default, r as defineAsyncComboboxOptionsProvider } from "../chunks/combobox-
|
|
1
|
+
export { n as Combobox, t as default, r as defineAsyncComboboxOptionsProvider } from "../chunks/combobox-CtFy7qwi.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as DialogContent, t as default } from "../chunks/dialog-content-
|
|
1
|
+
export { n as DialogContent, t as default } from "../chunks/dialog-content-DfTs9gaK.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as DialogFooter, t as default } from "../chunks/dialog-footer-
|
|
1
|
+
export { n as DialogFooter, t as default } from "../chunks/dialog-footer-oZsrnodi.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as DialogHeader, t as default } from "../chunks/dialog-header-
|
|
1
|
+
export { n as DialogHeader, t as default } from "../chunks/dialog-header-_6It5zCM.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as Dialog, t as default } from "../chunks/dialog-
|
|
1
|
+
export { n as Dialog, t as default } from "../chunks/dialog-BY_pM7CM.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as DialogsRoot, t as default } from "../chunks/dialogs-root-
|
|
1
|
+
export { n as DialogsRoot, t as default } from "../chunks/dialogs-root-B-yfITRL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as default } from "../chunks/error-state-
|
|
1
|
+
export { t as default } from "../chunks/error-state-CaxNmA0L.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const e=require("../../lib/components/decorators.cjs.js"),t=require("../../lib/components/web-component/WebComponent.cjs.js");require("../../lib/components/index.cjs.js");const n=require("../../lib/file-explorer/context.cjs.js"),r=require("../../lib/file-explorer/events.cjs.js");require("../../_virtual/~icons/lucide/share-2.cjs.js"),require("../../_virtual/~icons/lucide/pencil.cjs.js"),require("../../_virtual/~icons/lucide/ellipsis-vertical.cjs.js");const i=require("./FileExplorerHeader.styles.cjs.js");require("./FileExplorerHeaderSummary.cjs.js"),require("./FileExplorerHeaderControls.cjs.js");let a=require("rdflib"),o=require("solid-logic"),s=require("@lit/context"),c=require("lit"),l=require("lit/decorators.js");var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O;function
|
|
1
|
+
const e=require("../../lib/components/decorators.cjs.js"),t=require("../../lib/components/web-component/WebComponent.cjs.js");require("../../lib/components/index.cjs.js");const n=require("../../lib/file-explorer/context.cjs.js"),r=require("../../lib/file-explorer/events.cjs.js");require("../../_virtual/~icons/lucide/share-2.cjs.js"),require("../../_virtual/~icons/lucide/pencil.cjs.js"),require("../../_virtual/~icons/lucide/ellipsis-vertical.cjs.js");const i=require("./FileExplorerHeader.styles.cjs.js");require("./FileExplorerHeaderSummary.cjs.js"),require("./FileExplorerHeaderControls.cjs.js");let a=require("rdflib"),o=require("solid-logic"),s=require("@lit/context"),c=require("lit"),l=require("lit/decorators.js");var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;function M(e,t,n){N(e,t),t.set(e,n)}function N(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function P(e,t,n){return e.set(I(e,t),n),n}function F(e,t){return e.get(I(e,t))}function I(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function L(e,t,n){return(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:V(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||V(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return H(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:z(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function z(e){var t=B(e,`string`);return typeof t==`symbol`?t:t+``}function B(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function H(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function U(e){return e}y=[e.customElement(`solid-ui-file-explorer-header`)];var W;new(A=(f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,j=(b=(0,s.consume)({context:n.fileExplorerContext,subscribe:!0}),S=(0,l.property)({attribute:!1}),w=(0,l.property)({attribute:!1}),E=(0,l.property)({type:Boolean}),O=(0,l.state)(),`_loadedMetadataForUri`),d=class extends t.default{constructor(...e){super(...e),L(this,j,void _(this)),L(this,`_metadataGeneration`,0),M(this,f,x(this,n.DEFAULT_FILE_EXPLORER_CONTEXT)),M(this,p,C(this,[])),M(this,m,T(this,void 0)),M(this,h,D(this,!0)),M(this,g,k(this,{modified:void 0,isPublic:!1,canEdit:!1,canManageAccess:!1,aclUri:void 0})),L(this,`handleBack`,()=>{this.dispatchEvent(new CustomEvent(r.FILE_EXPLORER_BACK_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:this.fileExplorerContext.subjectUri}}))})}get fileExplorerContext(){return F(f,this)}set fileExplorerContext(e){P(f,this,e)}get menuItems(){return F(p,this)}set menuItems(e){P(p,this,e)}get paneIcon(){return F(m,this)}set paneIcon(e){P(m,this,e)}get showBack(){return F(h,this)}set showBack(e){P(h,this,e)}get responseMetadata(){return F(g,this)}set responseMetadata(e){P(g,this,e)}getDefaultResponseMetadata(){return{modified:void 0,isPublic:!1,canEdit:!1,canManageAccess:!1,aclUri:void 0}}willUpdate(){let e=this.fileExplorerContext?.subjectUri;if(this.fileExplorerContext?.store&&e&&this._loadedMetadataForUri!==e){this._loadedMetadataForUri=e;let t=++this._metadataGeneration;this.responseMetadata=this.getDefaultResponseMetadata(),this.loadResponseMetadata(e,t)}}async loadResponseMetadata(e,t){try{let n=await o.solidLogicSingleton.resource.fetchMetadata((0,a.sym)(e));t===this._metadataGeneration&&this.fileExplorerContext.subjectUri===e&&(this.responseMetadata={modified:n.modified,isPublic:n.access.isPublic,canEdit:n.access.canEdit,canManageAccess:n.access.canManageAccess,aclUri:n.aclUri})}catch(n){t===this._metadataGeneration&&this.fileExplorerContext.subjectUri===e&&(this.responseMetadata=this.getDefaultResponseMetadata(),console.warn(`Failed to load response metadata`,n))}}render(){return c.html`
|
|
2
2
|
<header>
|
|
3
3
|
<solid-ui-file-explorer-header-summary
|
|
4
4
|
.paneIcon=${this.paneIcon}
|
|
5
|
+
.showBack=${this.showBack}
|
|
5
6
|
.onBackClick=${this.handleBack}
|
|
6
7
|
.responseMetadata=${this.responseMetadata}
|
|
7
8
|
></solid-ui-file-explorer-header-summary>
|
|
@@ -11,5 +12,5 @@ const e=require("../../lib/components/decorators.cjs.js"),t=require("../../lib/c
|
|
|
11
12
|
.canManageAccess=${this.responseMetadata.canManageAccess}
|
|
12
13
|
></solid-ui-file-explorer-header-controls>
|
|
13
14
|
</header>
|
|
14
|
-
`}},{e:[
|
|
15
|
+
`}},{e:[x,C,T,D,k,_],c:[W,v]}=R(d,[[b,1,`fileExplorerContext`],[S,1,`menuItems`],[w,1,`paneIcon`],[E,1,`showBack`],[O,1,`responseMetadata`]],y,0,void 0,t.default),d),u=class extends U{constructor(){super(W),L(this,`styles`,i.default),v()}},L(u,A,void 0),u),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return W}});
|
|
15
16
|
//# sourceMappingURL=FileExplorerHeader.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeader.cjs.js","names":["sym","solidLogicSingleton","customElement","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_BACK_EVENT","property","state","consume","html","styles","_classDecs","_FileExplorerHeader","_FileExplorerHeader2","_A","WeakMap","_B","_C","_D","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_paneIconDecs","_responseMetadataDecs","_FileExplorerHeader3","FileExplorerHeader","constructor","args","_defineProperty","_initProto","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_paneIcon","undefined","_init_responseMetadata","modified","isPublic","canEdit","canManageAccess","aclUri","dispatchEvent","CustomEvent","bubbles","composed","detail","subjectUri","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","paneIcon","responseMetadata","getDefaultResponseMetadata","willUpdate","store","_loadedMetadataForUri","generation","_metadataGeneration","loadResponseMetadata","metadata","resource","fetchMetadata","access","error","console","warn","render","handleBack","e","c","_initClass","_applyDecs","_Class","_identity","default","customElement","consume","fileExplorerContext","property","state","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_BACK_EVENT","solidLogicSingleton","sym","styles","require_decorators","require_WebComponent","require_context","require_events","require_FileExplorerHeader_styles","rdflib","solid_logic","_lit_context","lit","lit_decorators_js","_Class","_FileExplorerHeader3","_A","_B","_C","_D","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_paneIconDecs","_init_paneIcon","_responseMetadataDecs","_init_responseMetadata","_FileExplorerHeader2","_ref","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","_identity","_FileExplorerHeader","args","subjectUri","generation","metadata","error"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { customElement, WebComponent } from '@/lib/components'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_BACK_EVENT } from '@/lib/file-explorer/events'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport '~icons/lucide/share-2'\nimport '~icons/lucide/pencil'\nimport '~icons/lucide/ellipsis-vertical'\nimport styles from './FileExplorerHeader.styles.css'\nimport './FileExplorerHeaderSummary'\nimport './FileExplorerHeaderControls'\nimport { PaneIcon } from './types'\nimport { type FileExplorerResourceMetadata } from './types'\n\n@customElement('solid-ui-file-explorer-header')\nexport default class FileExplorerHeader extends WebComponent {\n static styles = styles\n\n private _loadedMetadataForUri: string | undefined\n private _metadataGeneration = 0\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void }> = []\n\n @property({ attribute: false })\n accessor paneIcon: PaneIcon = undefined as unknown as PaneIcon\n\n @state()\n accessor responseMetadata: Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> = {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n\n private handleBack = () => {\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_BACK_EVENT, {\n bubbles: true,\n composed: true,\n detail: {\n subjectUri: this.fileExplorerContext.subjectUri\n }\n }))\n }\n\n private getDefaultResponseMetadata (): Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> {\n return {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n }\n\n protected willUpdate () {\n const subjectUri = this.fileExplorerContext?.subjectUri\n if (this.fileExplorerContext?.store && subjectUri && this._loadedMetadataForUri !== subjectUri) {\n this._loadedMetadataForUri = subjectUri\n const generation = ++this._metadataGeneration\n this.responseMetadata = this.getDefaultResponseMetadata()\n this.loadResponseMetadata(subjectUri, generation)\n }\n }\n\n private async loadResponseMetadata (subjectUri: string, generation: number) {\n try {\n const metadata = await solidLogicSingleton.resource.fetchMetadata(sym(subjectUri))\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = {\n modified: metadata.modified,\n isPublic: metadata.access.isPublic,\n canEdit: metadata.access.canEdit,\n canManageAccess: metadata.access.canManageAccess,\n aclUri: metadata.aclUri\n }\n }\n } catch (error) {\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = this.getDefaultResponseMetadata()\n console.warn('Failed to load response metadata', error)\n }\n }\n }\n\n render () {\n return html`\n <header>\n <solid-ui-file-explorer-header-summary\n .paneIcon=${this.paneIcon}\n .onBackClick=${this.handleBack}\n .responseMetadata=${this.responseMetadata}\n ></solid-ui-file-explorer-header-summary>\n <solid-ui-file-explorer-header-controls\n .menuItems=${this.menuItems}\n .canEdit=${this.responseMetadata.canEdit}\n .canManageAccess=${this.responseMetadata.canManageAccess}\n ></solid-ui-file-explorer-header-controls>\n </header>\n `\n }\n}\n"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"FileExplorerHeader.cjs.js","names":["sym","solidLogicSingleton","customElement","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_BACK_EVENT","property","state","consume","html","styles","_classDecs","_FileExplorerHeader","_FileExplorerHeader2","_A","WeakMap","_B","_C","_D","_E","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_paneIconDecs","_showBackDecs","type","Boolean","_responseMetadataDecs","_FileExplorerHeader3","FileExplorerHeader","constructor","args","_defineProperty","_initProto","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_paneIcon","undefined","_init_showBack","_init_responseMetadata","modified","isPublic","canEdit","canManageAccess","aclUri","dispatchEvent","CustomEvent","bubbles","composed","detail","subjectUri","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","paneIcon","showBack","responseMetadata","getDefaultResponseMetadata","willUpdate","store","_loadedMetadataForUri","generation","_metadataGeneration","loadResponseMetadata","metadata","resource","fetchMetadata","access","error","console","warn","render","handleBack","e","c","_initClass","_applyDecs","_Class","_identity","default","customElement","consume","fileExplorerContext","property","state","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_BACK_EVENT","solidLogicSingleton","sym","styles","require_decorators","require_WebComponent","require_context","require_events","require_FileExplorerHeader_styles","rdflib","solid_logic","_lit_context","lit","lit_decorators_js","_Class","_FileExplorerHeader3","_A","_B","_C","_D","_E","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_paneIconDecs","_init_paneIcon","_showBackDecs","_init_showBack","_responseMetadataDecs","_init_responseMetadata","_FileExplorerHeader2","_ref","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","_identity","_FileExplorerHeader","args","subjectUri","generation","metadata","error"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { customElement, WebComponent } from '@/lib/components'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_BACK_EVENT } from '@/lib/file-explorer/events'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport '~icons/lucide/share-2'\nimport '~icons/lucide/pencil'\nimport '~icons/lucide/ellipsis-vertical'\nimport styles from './FileExplorerHeader.styles.css'\nimport './FileExplorerHeaderSummary'\nimport './FileExplorerHeaderControls'\nimport { PaneIcon } from './types'\nimport { type FileExplorerResourceMetadata } from './types'\n\n@customElement('solid-ui-file-explorer-header')\nexport default class FileExplorerHeader extends WebComponent {\n static styles = styles\n\n private _loadedMetadataForUri: string | undefined\n private _metadataGeneration = 0\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void }> = []\n\n @property({ attribute: false })\n accessor paneIcon: PaneIcon = undefined as unknown as PaneIcon\n\n @property({ type: Boolean })\n accessor showBack = true\n\n @state()\n accessor responseMetadata: Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> = {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n\n private handleBack = () => {\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_BACK_EVENT, {\n bubbles: true,\n composed: true,\n detail: {\n subjectUri: this.fileExplorerContext.subjectUri\n }\n }))\n }\n\n private getDefaultResponseMetadata (): Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> {\n return {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n }\n\n protected willUpdate () {\n const subjectUri = this.fileExplorerContext?.subjectUri\n if (this.fileExplorerContext?.store && subjectUri && this._loadedMetadataForUri !== subjectUri) {\n this._loadedMetadataForUri = subjectUri\n const generation = ++this._metadataGeneration\n this.responseMetadata = this.getDefaultResponseMetadata()\n this.loadResponseMetadata(subjectUri, generation)\n }\n }\n\n private async loadResponseMetadata (subjectUri: string, generation: number) {\n try {\n const metadata = await solidLogicSingleton.resource.fetchMetadata(sym(subjectUri))\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = {\n modified: metadata.modified,\n isPublic: metadata.access.isPublic,\n canEdit: metadata.access.canEdit,\n canManageAccess: metadata.access.canManageAccess,\n aclUri: metadata.aclUri\n }\n }\n } catch (error) {\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = this.getDefaultResponseMetadata()\n console.warn('Failed to load response metadata', error)\n }\n }\n }\n\n render () {\n return html`\n <header>\n <solid-ui-file-explorer-header-summary\n .paneIcon=${this.paneIcon}\n .showBack=${this.showBack}\n .onBackClick=${this.handleBack}\n .responseMetadata=${this.responseMetadata}\n ></solid-ui-file-explorer-header-summary>\n <solid-ui-file-explorer-header-controls\n .menuItems=${this.menuItems}\n .canEdit=${this.responseMetadata.canEdit}\n .canManageAccess=${this.responseMetadata.canManageAccess}\n ></solid-ui-file-explorer-header-controls>\n </header>\n `\n }\n}\n"],"mappings":"A,60JAaqCY,EAAA,CAIpCV,EAAAA,cAAc,+BAA+B,CAAC,EAAA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
accessor paneIcon: PaneIcon;
|
|
13
|
+
accessor showBack: boolean;
|
|
13
14
|
accessor responseMetadata: Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'>;
|
|
14
15
|
private handleBack;
|
|
15
16
|
private getDefaultResponseMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeader.d.ts","sourceRoot":"","sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAM9D,OAAO,uBAAuB,CAAA;AAC9B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,iCAAiC,CAAA;AAExC,OAAO,6BAA6B,CAAA;AACpC,OAAO,8BAA8B,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAG3D,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,MAAM,CAAC,MAAM,0BAAS;IAEtB,OAAO,CAAC,qBAAqB,CAAoB;IACjD,OAAO,CAAC,mBAAmB,CAAI;IAG/B,QAAQ,CAAC,mBAAmB,4DAAgC;IAG5D,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,CAAC,CAAK;IAGjF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAmC;IAG9D,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,4BAA4B,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,CAAC,CAMhI;IAED,OAAO,CAAC,UAAU,CAQjB;IAED,OAAO,CAAC,0BAA0B;IAUlC,SAAS,CAAC,UAAU;YAUN,oBAAoB;IAoBlC,MAAM;
|
|
1
|
+
{"version":3,"file":"FileExplorerHeader.d.ts","sourceRoot":"","sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAM9D,OAAO,uBAAuB,CAAA;AAC9B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,iCAAiC,CAAA;AAExC,OAAO,6BAA6B,CAAA;AACpC,OAAO,8BAA8B,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAG3D,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,MAAM,CAAC,MAAM,0BAAS;IAEtB,OAAO,CAAC,qBAAqB,CAAoB;IACjD,OAAO,CAAC,mBAAmB,CAAI;IAG/B,QAAQ,CAAC,mBAAmB,4DAAgC;IAG5D,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,CAAC,CAAK;IAGjF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAmC;IAG9D,QAAQ,CAAC,QAAQ,UAAO;IAGxB,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,4BAA4B,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,CAAC,CAMhI;IAED,OAAO,CAAC,UAAU,CAQjB;IAED,OAAO,CAAC,0BAA0B;IAUlC,SAAS,CAAC,UAAU;YAUN,oBAAoB;IAoBlC,MAAM;CAiBP"}
|
|
@@ -15,32 +15,32 @@ import { consume as c } from "@lit/context";
|
|
|
15
15
|
import { html as l } from "lit";
|
|
16
16
|
import { property as u, state as d } from "lit/decorators.js";
|
|
17
17
|
// src/components/file-explorer-header/FileExplorerHeader.ts
|
|
18
|
-
var f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A;
|
|
19
|
-
function
|
|
20
|
-
|
|
18
|
+
var f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, M, N;
|
|
19
|
+
function P(e, t, n) {
|
|
20
|
+
F(e, t), t.set(e, n);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function F(e, t) {
|
|
23
23
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return e.set(
|
|
25
|
+
function I(e, t, n) {
|
|
26
|
+
return e.set(R(e, t), n), n;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return e.get(
|
|
28
|
+
function L(e, t) {
|
|
29
|
+
return e.get(R(e, t));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function R(e, t, n) {
|
|
32
32
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
33
33
|
throw TypeError("Private element is not present on this object");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return (t =
|
|
35
|
+
function z(e, t, n) {
|
|
36
|
+
return (t = V(t)) in e ? Object.defineProperty(e, t, {
|
|
37
37
|
value: n,
|
|
38
38
|
enumerable: !0,
|
|
39
39
|
configurable: !0,
|
|
40
40
|
writable: !0
|
|
41
41
|
}) : e[t] = n, e;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function B(e, t, n, r, i, a) {
|
|
44
44
|
function o(e, t, n) {
|
|
45
45
|
return function(r, i) {
|
|
46
46
|
return n && n(r), e[t].call(r, i);
|
|
@@ -63,13 +63,13 @@ function L(e, t, n, r, i, a) {
|
|
|
63
63
|
n || Array.isArray(_) || (_ = [_]);
|
|
64
64
|
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
65
65
|
d ? (f || p ? b = {
|
|
66
|
-
get:
|
|
66
|
+
get: U(function() {
|
|
67
67
|
return v(this);
|
|
68
68
|
}, r, "get"),
|
|
69
69
|
set: function(e) {
|
|
70
70
|
t[4](this, e);
|
|
71
71
|
}
|
|
72
|
-
} : b[S] = v, f ||
|
|
72
|
+
} : b[S] = v, f || U(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
73
73
|
}
|
|
74
74
|
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
75
75
|
var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
|
|
@@ -129,7 +129,7 @@ function L(e, t, n, r, i, a) {
|
|
|
129
129
|
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
130
130
|
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
131
131
|
var i, a, o = [], c = function(t) {
|
|
132
|
-
return
|
|
132
|
+
return W(t) === e;
|
|
133
133
|
}, u = /* @__PURE__ */ new Map();
|
|
134
134
|
function d(e) {
|
|
135
135
|
e && o.push(s.bind(null, e));
|
|
@@ -143,7 +143,7 @@ function L(e, t, n, r, i, a) {
|
|
|
143
143
|
if (!0 === x || x === 3 && m !== 4 || x === 4 && m !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
|
|
144
144
|
u.set(b, !(m > 2) || m);
|
|
145
145
|
}
|
|
146
|
-
l(v ? e : e.prototype, p, _, g ? "#" + h :
|
|
146
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : V(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return d(i), d(a), o;
|
|
@@ -156,11 +156,11 @@ function L(e, t, n, r, i, a) {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
var t =
|
|
159
|
+
function V(e) {
|
|
160
|
+
var t = H(e, "string");
|
|
161
161
|
return typeof t == "symbol" ? t : t + "";
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function H(e, t) {
|
|
164
164
|
if (typeof e != "object" || !e) return e;
|
|
165
165
|
var n;
|
|
166
166
|
if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
|
|
@@ -170,7 +170,7 @@ function z(e, t) {
|
|
|
170
170
|
}
|
|
171
171
|
return (t === "string" ? String : Number)(e);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function U(e, t, n) {
|
|
174
174
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
175
175
|
try {
|
|
176
176
|
Object.defineProperty(e, "name", {
|
|
@@ -180,27 +180,27 @@ function B(e, t, n) {
|
|
|
180
180
|
} catch {}
|
|
181
181
|
return e;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function W(e) {
|
|
184
184
|
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
185
185
|
return e;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function G(e) {
|
|
188
188
|
return e;
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
new (
|
|
190
|
+
x = [e("solid-ui-file-explorer-header")];
|
|
191
|
+
var K;
|
|
192
|
+
new (M = (m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), N = (S = c({
|
|
193
193
|
context: r,
|
|
194
194
|
subscribe: !0
|
|
195
|
-
}),
|
|
195
|
+
}), w = u({ attribute: !1 }), E = u({ attribute: !1 }), O = u({ type: Boolean }), A = d(), "_loadedMetadataForUri"), p = class extends t {
|
|
196
196
|
constructor(...e) {
|
|
197
|
-
super(...e),
|
|
197
|
+
super(...e), z(this, N, void y(this)), z(this, "_metadataGeneration", 0), P(this, m, C(this, n)), P(this, h, T(this, [])), P(this, g, D(this, void 0)), P(this, _, k(this, !0)), P(this, v, j(this, {
|
|
198
198
|
modified: void 0,
|
|
199
199
|
isPublic: !1,
|
|
200
200
|
canEdit: !1,
|
|
201
201
|
canManageAccess: !1,
|
|
202
202
|
aclUri: void 0
|
|
203
|
-
})),
|
|
203
|
+
})), z(this, "handleBack", () => {
|
|
204
204
|
this.dispatchEvent(new CustomEvent(i, {
|
|
205
205
|
bubbles: !0,
|
|
206
206
|
composed: !0,
|
|
@@ -209,28 +209,34 @@ new (k = (m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g =
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
get fileExplorerContext() {
|
|
212
|
-
return
|
|
212
|
+
return L(m, this);
|
|
213
213
|
}
|
|
214
214
|
set fileExplorerContext(e) {
|
|
215
|
-
|
|
215
|
+
I(m, this, e);
|
|
216
216
|
}
|
|
217
217
|
get menuItems() {
|
|
218
|
-
return
|
|
218
|
+
return L(h, this);
|
|
219
219
|
}
|
|
220
220
|
set menuItems(e) {
|
|
221
|
-
|
|
221
|
+
I(h, this, e);
|
|
222
222
|
}
|
|
223
223
|
get paneIcon() {
|
|
224
|
-
return
|
|
224
|
+
return L(g, this);
|
|
225
225
|
}
|
|
226
226
|
set paneIcon(e) {
|
|
227
|
-
|
|
227
|
+
I(g, this, e);
|
|
228
|
+
}
|
|
229
|
+
get showBack() {
|
|
230
|
+
return L(_, this);
|
|
231
|
+
}
|
|
232
|
+
set showBack(e) {
|
|
233
|
+
I(_, this, e);
|
|
228
234
|
}
|
|
229
235
|
get responseMetadata() {
|
|
230
|
-
return
|
|
236
|
+
return L(v, this);
|
|
231
237
|
}
|
|
232
238
|
set responseMetadata(e) {
|
|
233
|
-
|
|
239
|
+
I(v, this, e);
|
|
234
240
|
}
|
|
235
241
|
getDefaultResponseMetadata() {
|
|
236
242
|
return {
|
|
@@ -268,6 +274,7 @@ new (k = (m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g =
|
|
|
268
274
|
<header>
|
|
269
275
|
<solid-ui-file-explorer-header-summary
|
|
270
276
|
.paneIcon=${this.paneIcon}
|
|
277
|
+
.showBack=${this.showBack}
|
|
271
278
|
.onBackClick=${this.handleBack}
|
|
272
279
|
.responseMetadata=${this.responseMetadata}
|
|
273
280
|
></solid-ui-file-explorer-header-summary>
|
|
@@ -279,32 +286,37 @@ new (k = (m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g =
|
|
|
279
286
|
</header>
|
|
280
287
|
`;
|
|
281
288
|
}
|
|
282
|
-
}, {e: [
|
|
289
|
+
}, {e: [C, T, D, k, j, y], c: [K, b]} = B(p, [
|
|
283
290
|
[
|
|
284
|
-
|
|
291
|
+
S,
|
|
285
292
|
1,
|
|
286
293
|
"fileExplorerContext"
|
|
287
294
|
],
|
|
288
295
|
[
|
|
289
|
-
|
|
296
|
+
w,
|
|
290
297
|
1,
|
|
291
298
|
"menuItems"
|
|
292
299
|
],
|
|
293
300
|
[
|
|
294
|
-
|
|
301
|
+
E,
|
|
295
302
|
1,
|
|
296
303
|
"paneIcon"
|
|
297
304
|
],
|
|
298
305
|
[
|
|
299
|
-
|
|
306
|
+
O,
|
|
307
|
+
1,
|
|
308
|
+
"showBack"
|
|
309
|
+
],
|
|
310
|
+
[
|
|
311
|
+
A,
|
|
300
312
|
1,
|
|
301
313
|
"responseMetadata"
|
|
302
314
|
]
|
|
303
|
-
],
|
|
315
|
+
], x, 0, void 0, t), p), f = class extends G {
|
|
304
316
|
constructor() {
|
|
305
|
-
super(
|
|
317
|
+
super(K), z(this, "styles", a), b();
|
|
306
318
|
}
|
|
307
|
-
},
|
|
308
|
-
export {
|
|
319
|
+
}, z(f, M, void 0), f)();
|
|
320
|
+
export { K as default };
|
|
309
321
|
|
|
310
322
|
//# sourceMappingURL=FileExplorerHeader.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeader.esm.js","names":["sym","solidLogicSingleton","customElement","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_BACK_EVENT","property","state","consume","html","styles","_classDecs","_FileExplorerHeader","_FileExplorerHeader2","_A","WeakMap","_B","_C","_D","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_paneIconDecs","_responseMetadataDecs","_FileExplorerHeader3","FileExplorerHeader","constructor","args","_defineProperty","_initProto","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_paneIcon","undefined","_init_responseMetadata","modified","isPublic","canEdit","canManageAccess","aclUri","dispatchEvent","CustomEvent","bubbles","composed","detail","subjectUri","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","paneIcon","responseMetadata","getDefaultResponseMetadata","willUpdate","store","_loadedMetadataForUri","generation","_metadataGeneration","loadResponseMetadata","metadata","resource","fetchMetadata","access","error","console","warn","render","handleBack","e","c","_initClass","_applyDecs","_Class","_identity","default","styles","WebComponent","FileExplorerHeader_styles_default","_Class","_FileExplorerHeader3","_A","_B","_C","_D","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_paneIconDecs","_init_paneIcon","_responseMetadataDecs","_init_responseMetadata","_FileExplorerHeader2","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_identity","customElement","_FileExplorerHeader","consume","fileExplorerContext","property","state","args","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_BACK_EVENT","subjectUri","generation","metadata","solidLogicSingleton","sym","error"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { customElement, WebComponent } from '@/lib/components'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_BACK_EVENT } from '@/lib/file-explorer/events'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport '~icons/lucide/share-2'\nimport '~icons/lucide/pencil'\nimport '~icons/lucide/ellipsis-vertical'\nimport styles from './FileExplorerHeader.styles.css'\nimport './FileExplorerHeaderSummary'\nimport './FileExplorerHeaderControls'\nimport { PaneIcon } from './types'\nimport { type FileExplorerResourceMetadata } from './types'\n\n@customElement('solid-ui-file-explorer-header')\nexport default class FileExplorerHeader extends WebComponent {\n static styles = styles\n\n private _loadedMetadataForUri: string | undefined\n private _metadataGeneration = 0\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void }> = []\n\n @property({ attribute: false })\n accessor paneIcon: PaneIcon = undefined as unknown as PaneIcon\n\n @state()\n accessor responseMetadata: Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> = {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n\n private handleBack = () => {\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_BACK_EVENT, {\n bubbles: true,\n composed: true,\n detail: {\n subjectUri: this.fileExplorerContext.subjectUri\n }\n }))\n }\n\n private getDefaultResponseMetadata (): Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> {\n return {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n }\n\n protected willUpdate () {\n const subjectUri = this.fileExplorerContext?.subjectUri\n if (this.fileExplorerContext?.store && subjectUri && this._loadedMetadataForUri !== subjectUri) {\n this._loadedMetadataForUri = subjectUri\n const generation = ++this._metadataGeneration\n this.responseMetadata = this.getDefaultResponseMetadata()\n this.loadResponseMetadata(subjectUri, generation)\n }\n }\n\n private async loadResponseMetadata (subjectUri: string, generation: number) {\n try {\n const metadata = await solidLogicSingleton.resource.fetchMetadata(sym(subjectUri))\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = {\n modified: metadata.modified,\n isPublic: metadata.access.isPublic,\n canEdit: metadata.access.canEdit,\n canManageAccess: metadata.access.canManageAccess,\n aclUri: metadata.aclUri\n }\n }\n } catch (error) {\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = this.getDefaultResponseMetadata()\n console.warn('Failed to load response metadata', error)\n }\n }\n }\n\n render () {\n return html`\n <header>\n <solid-ui-file-explorer-header-summary\n .paneIcon=${this.paneIcon}\n .onBackClick=${this.handleBack}\n .responseMetadata=${this.responseMetadata}\n ></solid-ui-file-explorer-header-summary>\n <solid-ui-file-explorer-header-controls\n .menuItems=${this.menuItems}\n .canEdit=${this.responseMetadata.canEdit}\n .canManageAccess=${this.responseMetadata.canManageAccess}\n ></solid-ui-file-explorer-header-controls>\n </header>\n `\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaqCY,IAAA,CAIpCV,EAAc,+BAA+B,CAAC;AAAA,IAAAW;AAAA,KAAAC,KAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,KAAAC,
|
|
1
|
+
{"version":3,"file":"FileExplorerHeader.esm.js","names":["sym","solidLogicSingleton","customElement","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_BACK_EVENT","property","state","consume","html","styles","_classDecs","_FileExplorerHeader","_FileExplorerHeader2","_A","WeakMap","_B","_C","_D","_E","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_paneIconDecs","_showBackDecs","type","Boolean","_responseMetadataDecs","_FileExplorerHeader3","FileExplorerHeader","constructor","args","_defineProperty","_initProto","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_paneIcon","undefined","_init_showBack","_init_responseMetadata","modified","isPublic","canEdit","canManageAccess","aclUri","dispatchEvent","CustomEvent","bubbles","composed","detail","subjectUri","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","paneIcon","showBack","responseMetadata","getDefaultResponseMetadata","willUpdate","store","_loadedMetadataForUri","generation","_metadataGeneration","loadResponseMetadata","metadata","resource","fetchMetadata","access","error","console","warn","render","handleBack","e","c","_initClass","_applyDecs","_Class","_identity","default","styles","WebComponent","FileExplorerHeader_styles_default","_Class","_FileExplorerHeader3","_A","_B","_C","_D","_E","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_paneIconDecs","_init_paneIcon","_showBackDecs","_init_showBack","_responseMetadataDecs","_init_responseMetadata","_FileExplorerHeader2","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_identity","customElement","_FileExplorerHeader","consume","fileExplorerContext","property","state","args","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_BACK_EVENT","subjectUri","generation","metadata","solidLogicSingleton","sym","error"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeader.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { customElement, WebComponent } from '@/lib/components'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_BACK_EVENT } from '@/lib/file-explorer/events'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport '~icons/lucide/share-2'\nimport '~icons/lucide/pencil'\nimport '~icons/lucide/ellipsis-vertical'\nimport styles from './FileExplorerHeader.styles.css'\nimport './FileExplorerHeaderSummary'\nimport './FileExplorerHeaderControls'\nimport { PaneIcon } from './types'\nimport { type FileExplorerResourceMetadata } from './types'\n\n@customElement('solid-ui-file-explorer-header')\nexport default class FileExplorerHeader extends WebComponent {\n static styles = styles\n\n private _loadedMetadataForUri: string | undefined\n private _metadataGeneration = 0\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void }> = []\n\n @property({ attribute: false })\n accessor paneIcon: PaneIcon = undefined as unknown as PaneIcon\n\n @property({ type: Boolean })\n accessor showBack = true\n\n @state()\n accessor responseMetadata: Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> = {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n\n private handleBack = () => {\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_BACK_EVENT, {\n bubbles: true,\n composed: true,\n detail: {\n subjectUri: this.fileExplorerContext.subjectUri\n }\n }))\n }\n\n private getDefaultResponseMetadata (): Pick<FileExplorerResourceMetadata, 'modified' | 'isPublic' | 'canEdit' | 'canManageAccess' | 'aclUri'> {\n return {\n modified: undefined,\n isPublic: false,\n canEdit: false,\n canManageAccess: false,\n aclUri: undefined\n }\n }\n\n protected willUpdate () {\n const subjectUri = this.fileExplorerContext?.subjectUri\n if (this.fileExplorerContext?.store && subjectUri && this._loadedMetadataForUri !== subjectUri) {\n this._loadedMetadataForUri = subjectUri\n const generation = ++this._metadataGeneration\n this.responseMetadata = this.getDefaultResponseMetadata()\n this.loadResponseMetadata(subjectUri, generation)\n }\n }\n\n private async loadResponseMetadata (subjectUri: string, generation: number) {\n try {\n const metadata = await solidLogicSingleton.resource.fetchMetadata(sym(subjectUri))\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = {\n modified: metadata.modified,\n isPublic: metadata.access.isPublic,\n canEdit: metadata.access.canEdit,\n canManageAccess: metadata.access.canManageAccess,\n aclUri: metadata.aclUri\n }\n }\n } catch (error) {\n if (generation === this._metadataGeneration && this.fileExplorerContext.subjectUri === subjectUri) {\n this.responseMetadata = this.getDefaultResponseMetadata()\n console.warn('Failed to load response metadata', error)\n }\n }\n }\n\n render () {\n return html`\n <header>\n <solid-ui-file-explorer-header-summary\n .paneIcon=${this.paneIcon}\n .showBack=${this.showBack}\n .onBackClick=${this.handleBack}\n .responseMetadata=${this.responseMetadata}\n ></solid-ui-file-explorer-header-summary>\n <solid-ui-file-explorer-header-controls\n .menuItems=${this.menuItems}\n .canEdit=${this.responseMetadata.canEdit}\n .canManageAccess=${this.responseMetadata.canManageAccess}\n ></solid-ui-file-explorer-header-controls>\n </header>\n `\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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oBkD,eAAeA,MACrF,KAAKO,mBAAmB;IACtBjB,UAAUyB,EAASzB;IACnBC,UAAUwB,EAASG,OAAO3B;IAC1BC,SAASuB,EAASG,OAAO1B;IACzBC,iBAAiBsB,EAASG,OAAOzB;IACjCC,QAAQqB,EAASrB;GACnB;EAEJ,SAASyB,GAAO;GACd,AAAIP,MAAe,KAAKC,uBAAuB,KAAK/D,oBAAoBkD,eAAeA,MACrF,KAAKO,mBAAmB,KAAKC,2BAA2B,GACxDY,QAAQC,KAAK,oCAAoCF,CAAK;EAE1D;CACF;CAEAG,SAAU;EACR,OAAOnE,CAAI;;;sBAGO,KAAKkD,SAAQ;sBACb,KAAKC,SAAQ;yBACV,KAAKiB,WAAU;8BACV,KAAKhB,iBAAgB;;;uBAG5B,KAAKH,UAAS;qBAChB,KAAKG,iBAAiBf,QAAO;6BACrB,KAAKe,iBAAiBd,gBAAe;;;;CAIhE;AACF,GAAC,CAAA+B,GAAA,CAAAxC,GAAAC,GAAAC,GAAAE,GAAAC,GAAAP,IAAA2C,GAAA,CAAAnE,GAAAoE,MAAAC,EAAAlD,GAAA;CAAA;EAAAV;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;AAAA,GAAAnB,GAAA,GAAA,KAAA,GA9F+CT,CAAY,GAAA6B,IAAAmD,IAAA,cAAAC,EAAA;CAAAlD,cAAA;EAAA,MAAArB,CAAA,GAAAuB,EAAA,MAAA,UAC1CzB,CAAM,GAAAsE,EAAA;CAAA;AAAA,GAAA7C,EAAA+C,GAAArE,GAAA,KAAA,CAAA,GAAAqE,GAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("../../lib/components/decorators.cjs.js"),t=require("../../lib/components/web-component/WebComponent.cjs.js");require("../../lib/components/index.cjs.js"),require("../button/index.cjs.js"),require("../../_virtual/~icons/lucide/user-round-cog.cjs.js"),require("../../_virtual/~icons/lucide/pencil.cjs.js");const n=require("./FileExplorerHeaderControls.styles.cjs.js");require("../resource-actions-menu/ResourceActionsMenu.cjs.js");const r=require("../../lib/file-explorer/context.cjs.js"),i=require("../../lib/file-explorer/events.cjs.js"),a=require("../../utils/podUtils.cjs.js");let o=require("@lit/context"),s=require("lit"),c=require("lit/decorators.js");var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;function j(e,t,n){M(e,t),t.set(e,n)}function M(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function N(e,t,n){return e.set(F(e,t),n),n}function P(e,t){return e.get(F(e,t))}function F(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function I(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:B(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||B(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return V(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:R(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function R(e){var t=z(e,`string`);return typeof t==`symbol`?t:t+``}function z(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function V(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function H(e){return e}v=[e.customElement(`solid-ui-file-explorer-header-controls`)];var U;new(k=(d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,A=(y=(0,o.consume)({context:r.fileExplorerContext,subscribe:!0}),x=(0,c.property)({attribute:!1}),C=(0,c.property)({type:Boolean}),T=(0,c.property)({type:Boolean}),D=(0,c.state)(),`mobileMediaQuery`),u=class extends t.default{constructor(...e){super(...e),I(this,A,void g(this)),I(this,`mobileQuery`,`(max-width: 600px)`),I(this,`handleMobileMediaChange`,e=>{this.isMobile=e.matches}),j(this,d,b(this,r.DEFAULT_FILE_EXPLORER_CONTEXT)),j(this,f,S(this,[])),j(this,p,w(this,!1)),j(this,m,E(this,!1)),j(this,h,O(this,typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 600px)`).matches)),I(this,`handleManageAccess`,()=>{let e=this.fileExplorerContext.subjectUri;e&&this.dispatchEvent(new CustomEvent(i.
|
|
1
|
+
const e=require("../../lib/components/decorators.cjs.js"),t=require("../../lib/components/web-component/WebComponent.cjs.js");require("../../lib/components/index.cjs.js"),require("../button/index.cjs.js"),require("../../_virtual/~icons/lucide/user-round-cog.cjs.js"),require("../../_virtual/~icons/lucide/pencil.cjs.js");const n=require("./FileExplorerHeaderControls.styles.cjs.js");require("../resource-actions-menu/ResourceActionsMenu.cjs.js");const r=require("../../lib/file-explorer/context.cjs.js"),i=require("../../lib/file-explorer/events.cjs.js"),a=require("../../utils/podUtils.cjs.js");let o=require("@lit/context"),s=require("lit"),c=require("lit/decorators.js");var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;function j(e,t,n){M(e,t),t.set(e,n)}function M(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function N(e,t,n){return e.set(F(e,t),n),n}function P(e,t){return e.get(F(e,t))}function F(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function I(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:B(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||B(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return V(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:R(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function R(e){var t=z(e,`string`);return typeof t==`symbol`?t:t+``}function z(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function V(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function H(e){return e}v=[e.customElement(`solid-ui-file-explorer-header-controls`)];var U;new(k=(d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,A=(y=(0,o.consume)({context:r.fileExplorerContext,subscribe:!0}),x=(0,c.property)({attribute:!1}),C=(0,c.property)({type:Boolean}),T=(0,c.property)({type:Boolean}),D=(0,c.state)(),`mobileMediaQuery`),u=class extends t.default{constructor(...e){super(...e),I(this,A,void g(this)),I(this,`mobileQuery`,`(max-width: 600px)`),I(this,`handleMobileMediaChange`,e=>{this.isMobile=e.matches}),j(this,d,b(this,r.DEFAULT_FILE_EXPLORER_CONTEXT)),j(this,f,S(this,[])),j(this,p,w(this,!1)),j(this,m,E(this,!1)),j(this,h,O(this,typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 600px)`).matches)),I(this,`handleManageAccess`,()=>{let e=this.fileExplorerContext.subjectUri;e&&this.dispatchEvent(new CustomEvent(i.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e,paneName:`sharing`}}))})}get fileExplorerContext(){return P(d,this)}set fileExplorerContext(e){N(d,this,e)}get menuItems(){return P(f,this)}set menuItems(e){N(f,this,e)}get canEdit(){return P(p,this)}set canEdit(e){N(p,this,e)}get canManageAccess(){return P(m,this)}set canManageAccess(e){N(m,this,e)}get isMobile(){return P(h,this)}set isMobile(e){N(h,this,e)}connectedCallback(){super.connectedCallback(),typeof window<`u`&&typeof window.matchMedia==`function`&&(this.mobileMediaQuery=window.matchMedia(this.mobileQuery),this.isMobile=this.mobileMediaQuery.matches,this.mobileMediaQuery.addEventListener(`change`,this.handleMobileMediaChange))}disconnectedCallback(){this.mobileMediaQuery?.removeEventListener(`change`,this.handleMobileMediaChange),this.mobileMediaQuery=void 0,super.disconnectedCallback()}getEditTooltip(){return this.canEdit?`Edit`:`No Access`}renderDirtyIndicator(){return this.fileExplorerContext.isDirty?s.html`<span class="dirtyIndicator" title="This file has unsaved changes">Unsaved</span>`:s.nothing}render(){let e=a.isContainerSubject(this.fileExplorerContext.store,this.fileExplorerContext.subjectUri),t=this.fileExplorerContext.canEdit;return s.html`
|
|
2
2
|
<div>
|
|
3
3
|
${this.renderDirtyIndicator()}
|
|
4
4
|
${!e&&!this.isMobile&&this.canManageAccess?s.html`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeaderControls.cjs.js","names":["customElement","WebComponent","property","state","consume","html","nothing","styles","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_MANAGE_ACCESS_EVENT","isContainerSubject","_classDecs","_FileExplorerHeaderCo","_FileExplorerHeaderCo2","_A","WeakMap","_B","_C","_D","_E","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_canEditDecs","type","Boolean","_canManageAccessDecs","_isMobileDecs","_FileExplorerHeaderControls","FileExplorerHeaderControls","constructor","args","_defineProperty","_initProto","event","isMobile","matches","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_canEdit","_init_canManageAccess","_init_isMobile","window","matchMedia","subjectUri","dispatchEvent","CustomEvent","bubbles","composed","detail","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","canEdit","canManageAccess","connectedCallback","mobileMediaQuery","mobileQuery","addEventListener","handleMobileMediaChange","disconnectedCallback","removeEventListener","undefined","getEditTooltip","renderDirtyIndicator","isDirty","render","isContainerResource","store","supportsEditing","handleManageAccess","beginEditing","e","c","_initClass","_applyDecs","_Class","_identity","default","customElement","consume","fileExplorerContext","property","state","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_MANAGE_ACCESS_EVENT","nothing","isContainerSubject","styles","require_decorators","require_WebComponent","require_FileExplorerHeaderControls_styles","require_context","require_events","require_podUtils","_lit_context","lit","lit_decorators_js","_Class","_FileExplorerHeaderControls","_A","_B","_C","_D","_E","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_canEditDecs","_init_canEdit","_canManageAccessDecs","_init_canManageAccess","_isMobileDecs","_init_isMobile","_FileExplorerHeaderCo2","_ref","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","_identity","_FileExplorerHeaderCo","args","event","subjectUri","isContainerResource","supportsEditing"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html, nothing } from 'lit'\nimport '@/components/button'\nimport '~icons/lucide/user-round-cog'\nimport '~icons/lucide/pencil'\nimport styles from './FileExplorerHeaderControls.styles.css'\nimport '@/components/resource-actions-menu/ResourceActionsMenu'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_MANAGE_ACCESS_EVENT } from '@/lib/file-explorer/events'\nimport { isContainerSubject } from '@/utils/podUtils'\n\n@customElement('solid-ui-file-explorer-header-controls')\nexport default class FileExplorerHeaderControls extends WebComponent {\n static styles = styles\n\n private mobileMediaQuery: MediaQueryList | undefined\n private readonly mobileQuery = '(max-width: 600px)'\n private readonly handleMobileMediaChange = (event: MediaQueryListEvent) => {\n this.isMobile = event.matches\n }\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void, icon?: HTMLElement }> = []\n\n @property({ type: Boolean })\n accessor canEdit: boolean = false\n\n @property({ type: Boolean })\n accessor canManageAccess = false\n\n @state()\n accessor isMobile = typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(max-width: 600px)').matches\n : false\n\n connectedCallback () {\n super.connectedCallback()\n\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return\n }\n\n this.mobileMediaQuery = window.matchMedia(this.mobileQuery)\n this.isMobile = this.mobileMediaQuery.matches\n this.mobileMediaQuery.addEventListener('change', this.handleMobileMediaChange)\n }\n\n disconnectedCallback () {\n this.mobileMediaQuery?.removeEventListener('change', this.handleMobileMediaChange)\n this.mobileMediaQuery = undefined\n super.disconnectedCallback()\n }\n\n // TODO: Add broken then use this function to set tooltip and disable edit button\n /* private setEditable() {\n const sourcePaneState = this.sourceContext?.sourcePaneState\n const { canEdit } = this.sourceContext?.headerMetadata ?? { canEdit: false }\n const subject = this.sourceContext?.subject\n if (!sourcePaneState || !canEdit || sourcePaneState.broken || (subject && subject.endsWith('/'))) return\n\n this.sourceContext?.setEditing?.()\n } */\n\n private getEditTooltip () {\n if (!this.canEdit) return 'No Access'\n return 'Edit'\n }\n\n private handleManageAccess = () => {\n const subjectUri = this.fileExplorerContext.subjectUri\n if (!subjectUri) return\n\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_MANAGE_ACCESS_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri }\n }))\n }\n\n private renderDirtyIndicator () {\n if (!this.fileExplorerContext.isDirty) return nothing\n\n return html`<span class=\"dirtyIndicator\" title=\"This file has unsaved changes\">Unsaved</span>`\n }\n\n render () {\n const isContainerResource = isContainerSubject(this.fileExplorerContext.store, this.fileExplorerContext.subjectUri)\n const supportsEditing = this.fileExplorerContext.canEdit\n\n return html`\n <div>\n ${this.renderDirtyIndicator()}\n ${!isContainerResource && !this.isMobile && this.canManageAccess\n ? html`\n <solid-ui-button class=\"file-explorer-header-action-button\" variant=\"ghost\" title=\"Manage Access\" @click=${this.handleManageAccess}>\n <icon-lucide-user-round-cog slot=\"icon\"></icon-lucide-user-round-cog>\n <span class=\"sr-only\">Manage access</span>\n </solid-ui-button>\n ${supportsEditing\n ? html`\n <solid-ui-button\n class=\"file-explorer-header-action-button\"\n variant=\"ghost\"\n title=${this.getEditTooltip()}\n ?disabled=${!this.canEdit}\n @click=${this.fileExplorerContext.beginEditing}\n >\n <icon-lucide-pencil slot=\"icon\"></icon-lucide-pencil>\n <span class=\"sr-only\">Edit</span>\n </solid-ui-button>\n `\n : nothing}\n `\n : nothing}\n <solid-ui-resource-actions-menu\n .store=${this.fileExplorerContext.store}\n .handleAccessClick=${this.handleManageAccess}\n .handleEditingClick=${this.fileExplorerContext.beginEditing}\n .paneSupportsEditing=${this.fileExplorerContext.canEdit}\n .canEdit=${this.canEdit}\n .canManageAccess=${this.canManageAccess}\n .subjectUri=${this.fileExplorerContext.subjectUri}\n .menuItems=${this.menuItems}\n .isMobile=${this.isMobile}\n ></solid-ui-resource-actions-menu>\n </div>\n `\n }\n}\n"],"mappings":"A,2xJAWqDY,EAAA,CAEpDZ,EAAAA,cAAc,wCAAwC,CAAC,EA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EAAA5C,EAAA8C,EAAApE,EAAA,IAAA,EAAA,EAAAoE,G"}
|
|
1
|
+
{"version":3,"file":"FileExplorerHeaderControls.cjs.js","names":["customElement","WebComponent","property","state","consume","html","nothing","styles","DEFAULT_FILE_EXPLORER_CONTEXT","fileExplorerContext","FILE_EXPLORER_OPEN_PANE_EVENT","isContainerSubject","_classDecs","_FileExplorerHeaderCo","_FileExplorerHeaderCo2","_A","WeakMap","_B","_C","_D","_E","_ref","_fileExplorerContextDecs","context","subscribe","_menuItemsDecs","attribute","_canEditDecs","type","Boolean","_canManageAccessDecs","_isMobileDecs","_FileExplorerHeaderControls","FileExplorerHeaderControls","constructor","args","_defineProperty","_initProto","event","isMobile","matches","_classPrivateFieldInitSpec","_init_fileExplorerContext","_init_menuItems","_init_canEdit","_init_canManageAccess","_init_isMobile","window","matchMedia","subjectUri","dispatchEvent","CustomEvent","bubbles","composed","detail","paneName","_classPrivateFieldGet","v","_classPrivateFieldSet","menuItems","canEdit","canManageAccess","connectedCallback","mobileMediaQuery","mobileQuery","addEventListener","handleMobileMediaChange","disconnectedCallback","removeEventListener","undefined","getEditTooltip","renderDirtyIndicator","isDirty","render","isContainerResource","store","supportsEditing","handleManageAccess","beginEditing","e","c","_initClass","_applyDecs","_Class","_identity","default","customElement","consume","fileExplorerContext","property","state","WebComponent","DEFAULT_FILE_EXPLORER_CONTEXT","FILE_EXPLORER_OPEN_PANE_EVENT","nothing","isContainerSubject","styles","require_decorators","require_WebComponent","require_FileExplorerHeaderControls_styles","require_context","require_events","require_podUtils","_lit_context","lit","lit_decorators_js","_Class","_FileExplorerHeaderControls","_A","_B","_C","_D","_E","_initProto","_initClass","_classDecs","_fileExplorerContextDecs","_init_fileExplorerContext","_menuItemsDecs","_init_menuItems","_canEditDecs","_init_canEdit","_canManageAccessDecs","_init_canManageAccess","_isMobileDecs","_init_isMobile","_FileExplorerHeaderCo2","_ref","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","_identity","_FileExplorerHeaderCo","args","event","subjectUri","isContainerResource","supportsEditing"],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { html, nothing } from 'lit'\nimport '@/components/button'\nimport '~icons/lucide/user-round-cog'\nimport '~icons/lucide/pencil'\nimport styles from './FileExplorerHeaderControls.styles.css'\nimport '@/components/resource-actions-menu/ResourceActionsMenu'\nimport { DEFAULT_FILE_EXPLORER_CONTEXT, fileExplorerContext } from '@/lib/file-explorer/context'\nimport { FILE_EXPLORER_OPEN_PANE_EVENT } from '@/lib/file-explorer/events'\nimport { isContainerSubject } from '@/utils/podUtils'\n\n@customElement('solid-ui-file-explorer-header-controls')\nexport default class FileExplorerHeaderControls extends WebComponent {\n static styles = styles\n\n private mobileMediaQuery: MediaQueryList | undefined\n private readonly mobileQuery = '(max-width: 600px)'\n private readonly handleMobileMediaChange = (event: MediaQueryListEvent) => {\n this.isMobile = event.matches\n }\n\n @consume({ context: fileExplorerContext, subscribe: true })\n accessor fileExplorerContext = DEFAULT_FILE_EXPLORER_CONTEXT\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, action: (event: Event) => void, icon?: HTMLElement }> = []\n\n @property({ type: Boolean })\n accessor canEdit: boolean = false\n\n @property({ type: Boolean })\n accessor canManageAccess = false\n\n @state()\n accessor isMobile = typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(max-width: 600px)').matches\n : false\n\n connectedCallback () {\n super.connectedCallback()\n\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return\n }\n\n this.mobileMediaQuery = window.matchMedia(this.mobileQuery)\n this.isMobile = this.mobileMediaQuery.matches\n this.mobileMediaQuery.addEventListener('change', this.handleMobileMediaChange)\n }\n\n disconnectedCallback () {\n this.mobileMediaQuery?.removeEventListener('change', this.handleMobileMediaChange)\n this.mobileMediaQuery = undefined\n super.disconnectedCallback()\n }\n\n // TODO: Add broken then use this function to set tooltip and disable edit button\n /* private setEditable() {\n const sourcePaneState = this.sourceContext?.sourcePaneState\n const { canEdit } = this.sourceContext?.headerMetadata ?? { canEdit: false }\n const subject = this.sourceContext?.subject\n if (!sourcePaneState || !canEdit || sourcePaneState.broken || (subject && subject.endsWith('/'))) return\n\n this.sourceContext?.setEditing?.()\n } */\n\n private getEditTooltip () {\n if (!this.canEdit) return 'No Access'\n return 'Edit'\n }\n\n private handleManageAccess = () => {\n const subjectUri = this.fileExplorerContext.subjectUri\n if (!subjectUri) return\n\n this.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri, paneName: 'sharing' }\n }))\n }\n\n private renderDirtyIndicator () {\n if (!this.fileExplorerContext.isDirty) return nothing\n\n return html`<span class=\"dirtyIndicator\" title=\"This file has unsaved changes\">Unsaved</span>`\n }\n\n render () {\n const isContainerResource = isContainerSubject(this.fileExplorerContext.store, this.fileExplorerContext.subjectUri)\n const supportsEditing = this.fileExplorerContext.canEdit\n\n return html`\n <div>\n ${this.renderDirtyIndicator()}\n ${!isContainerResource && !this.isMobile && this.canManageAccess\n ? html`\n <solid-ui-button class=\"file-explorer-header-action-button\" variant=\"ghost\" title=\"Manage Access\" @click=${this.handleManageAccess}>\n <icon-lucide-user-round-cog slot=\"icon\"></icon-lucide-user-round-cog>\n <span class=\"sr-only\">Manage access</span>\n </solid-ui-button>\n ${supportsEditing\n ? html`\n <solid-ui-button\n class=\"file-explorer-header-action-button\"\n variant=\"ghost\"\n title=${this.getEditTooltip()}\n ?disabled=${!this.canEdit}\n @click=${this.fileExplorerContext.beginEditing}\n >\n <icon-lucide-pencil slot=\"icon\"></icon-lucide-pencil>\n <span class=\"sr-only\">Edit</span>\n </solid-ui-button>\n `\n : nothing}\n `\n : nothing}\n <solid-ui-resource-actions-menu\n .store=${this.fileExplorerContext.store}\n .handleAccessClick=${this.handleManageAccess}\n .handleEditingClick=${this.fileExplorerContext.beginEditing}\n .paneSupportsEditing=${this.fileExplorerContext.canEdit}\n .canEdit=${this.canEdit}\n .canManageAccess=${this.canManageAccess}\n .subjectUri=${this.fileExplorerContext.subjectUri}\n .menuItems=${this.menuItems}\n .isMobile=${this.isMobile}\n ></solid-ui-resource-actions-menu>\n </div>\n `\n }\n}\n"],"mappings":"A,2xJAWqDY,EAAA,CAEpDZ,EAAAA,cAAc,wCAAwC,CAAC,EAAA,IAAAa,EAAA,IAAAC,GAAAC,EAAA,IAAAC,QAAAC,EAAA,IAAAD,QAAAE,EAAA,IAAAF,QAAAG,EAAA,IAAAH,QAAAI,EAAA,IAAAJ,QAAAK,GAAAC,GAAAA,EAUrDlB,EAAAA,QAAAA,CAAQ,CAAEmB,QAASd,EAAAA,oBAAqBe,UAAW,EAAK,CAAC,EAACC,GAAAA,EAG1DvB,EAAAA,SAAAA,CAAS,CAAEwB,UAAW,EAAM,CAAC,EAACC,GAAAA,EAG9BzB,EAAAA,SAAAA,CAAS,CAAE0B,KAAMC,OAAQ,CAAC,EAACC,GAAAA,EAG3B5B,EAAAA,SAAAA,CAAS,CAAE0B,KAAMC,OAAQ,CAAC,EAACE,GAAAA,EAG3B5B,EAAAA,MAAAA,CAAM,EAAC,oBAAA6B,EAtBV,cACwD/B,EAAAA,OAAa,CAAAiC,YAAA,GAAAC,EAAA,CAAA,MAAA,GAAAA,CAAA,EAAAC,EAAA,KAAAf,EAAA,KAAAgB,EAAA,IAAA,CAAA,EAAAD,EAAA,KAAA,cAIpC,oBAAoB,EAAAA,EAAA,KAAA,0BACPE,GAA+B,CACzE,KAAKC,SAAWD,EAAME,OACxB,CAAC,EAAAC,EAAA,KAAA1B,EAAA2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