solid-ui 5.0.2-4 → 5.0.2-6
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/acl/access-controller.cjs.js +1 -1
- package/dist/acl/access-controller.cjs.js.map +1 -1
- package/dist/acl/access-controller.esm.js +37 -37
- package/dist/acl/access-groups.cjs.js +2 -2
- package/dist/acl/access-groups.cjs.js.map +1 -1
- package/dist/acl/access-groups.esm.js +78 -78
- package/dist/acl/acl-control.cjs.js +1 -1
- package/dist/acl/acl-control.cjs.js.map +1 -1
- package/dist/acl/acl-control.esm.js +19 -19
- package/dist/acl/add-agent-buttons.cjs.js +1 -1
- package/dist/acl/add-agent-buttons.cjs.js.map +1 -1
- package/dist/acl/add-agent-buttons.esm.js +51 -51
- package/dist/chat/bookmarks.cjs.js +1 -1
- package/dist/chat/bookmarks.cjs.js.map +1 -1
- package/dist/chat/bookmarks.esm.js +44 -44
- package/dist/chat/bookmarks.esm.js.map +1 -1
- package/dist/chat/chatLogic.cjs.js +2 -2
- package/dist/chat/chatLogic.cjs.js.map +1 -1
- package/dist/chat/chatLogic.esm.js +54 -54
- package/dist/chat/dateFolder.cjs.js +1 -1
- package/dist/chat/dateFolder.cjs.js.map +1 -1
- package/dist/chat/dateFolder.esm.js +30 -30
- package/dist/chat/infinite.cjs.js +1 -1
- package/dist/chat/infinite.cjs.js.map +1 -1
- package/dist/chat/infinite.esm.js +49 -49
- package/dist/chat/keys.cjs.js +2 -2
- package/dist/chat/keys.cjs.js.map +1 -1
- package/dist/chat/keys.esm.js +17 -17
- package/dist/chat/message.cjs.js +4 -4
- package/dist/chat/message.cjs.js.map +1 -1
- package/dist/chat/message.esm.js +114 -114
- package/dist/chat/message.esm.js.map +1 -1
- package/dist/chat/messageTools.cjs.js +1 -1
- package/dist/chat/messageTools.cjs.js.map +1 -1
- package/dist/chat/messageTools.esm.js +51 -51
- package/dist/chunks/{ResourceActionsMenu-Bllpr4M5.js → ResourceActionsMenu-KFMLta44.js} +78 -69
- package/dist/chunks/ResourceActionsMenu-KFMLta44.js.map +1 -0
- package/dist/chunks/{access-control-modal-CwmY_Dod.js → access-control-modal-BZdBv6VD.js} +165 -165
- package/dist/chunks/{access-control-modal-CwmY_Dod.js.map → access-control-modal-BZdBv6VD.js.map} +1 -1
- package/dist/chunks/{account-CoHPKKDu.js → account-DWmMJre6.js} +22 -22
- package/dist/chunks/{account-CoHPKKDu.js.map → account-DWmMJre6.js.map} +1 -1
- package/dist/chunks/{auth-CocCqS1p.js → auth-EK-iYNYZ.js} +37 -37
- package/dist/chunks/{auth-CocCqS1p.js.map → auth-EK-iYNYZ.js.map} +1 -1
- package/dist/chunks/{avatar-sNdKdWVO.js → avatar-BBgvMlqv.js} +13 -13
- package/dist/chunks/{avatar-sNdKdWVO.js.map → avatar-BBgvMlqv.js.map} +1 -1
- package/dist/chunks/{combobox-fSTp9qoT.js → combobox-DS6byaf1.js} +3 -3
- package/dist/chunks/{combobox-fSTp9qoT.js.map → combobox-DS6byaf1.js.map} +1 -1
- package/dist/chunks/{error-state-BD4_Wrkz.js → error-state-jV9dlFX2.js} +2 -2
- package/dist/chunks/{error-state-BD4_Wrkz.js.map → error-state-jV9dlFX2.js.map} +1 -1
- package/dist/chunks/{file-explorer-header-D0TebSYR.js → file-explorer-header-BJzo6xDU.js} +50 -50
- package/dist/chunks/{file-explorer-header-D0TebSYR.js.map → file-explorer-header-BJzo6xDU.js.map} +1 -1
- package/dist/chunks/{guard-BOicu9dt.js → guard-SxVT1xr4.js} +13 -13
- package/dist/chunks/{guard-BOicu9dt.js.map → guard-SxVT1xr4.js.map} +1 -1
- package/dist/chunks/{index.esm-C9oV3H3X.js → index.esm-BQrkxchZ.js} +2 -2
- package/dist/chunks/{index.esm-C9oV3H3X.js.map → index.esm-BQrkxchZ.js.map} +1 -1
- package/dist/chunks/{jsonld-D-TE94B0.js → jsonld-C6IOQ1Tg.js} +2 -2
- package/dist/chunks/{jsonld-D-TE94B0.js.map → jsonld-C6IOQ1Tg.js.map} +1 -1
- package/dist/chunks/{login-button-clTw_9tX.js → login-button-Dd0rwZJk.js} +11 -11
- package/dist/chunks/{login-button-clTw_9tX.js.map → login-button-Dd0rwZJk.js.map} +1 -1
- package/dist/chunks/{logout-button-CP-Pz70O.js → logout-button-Da34Lrnq.js} +11 -11
- package/dist/chunks/{logout-button-CP-Pz70O.js.map → logout-button-Da34Lrnq.js.map} +1 -1
- package/dist/chunks/{menu-D0k2fkiE.js → menu-BNJU654v.js} +2 -2
- package/dist/chunks/{menu-D0k2fkiE.js.map → menu-BNJU654v.js.map} +1 -1
- package/dist/chunks/{provider-Cuv3Kp6G.js → provider-B3FoP2qW.js} +11 -11
- package/dist/chunks/{provider-Cuv3Kp6G.js.map → provider-B3FoP2qW.js.map} +1 -1
- package/dist/chunks/{rdf-form-DVmTw3RG.js → rdf-form-BkKDmFPD.js} +36 -36
- package/dist/chunks/{rdf-form-DVmTw3RG.js.map → rdf-form-BkKDmFPD.js.map} +1 -1
- package/dist/chunks/{rdf-input-CRYLK-27.js → rdf-input-BPePtqfS.js} +61 -61
- package/dist/chunks/{rdf-input-CRYLK-27.js.map → rdf-input-BPePtqfS.js.map} +1 -1
- package/dist/chunks/{signup-button-CexdMWj6.js → signup-button-DOInssOu.js} +11 -11
- package/dist/chunks/{signup-button-CexdMWj6.js.map → signup-button-DOInssOu.js.map} +1 -1
- package/dist/chunks/{solidLogicSingleton.esm-BXyHD7mn.js → solidLogicSingleton.esm-Bvt7E7Vl.js} +50 -29
- package/dist/chunks/solidLogicSingleton.esm-Bvt7E7Vl.js.map +1 -0
- 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-DQgHAH3d.js → src-Cv9Lm1V-.js} +3009 -2980
- package/dist/chunks/src-Cv9Lm1V-.js.map +1 -0
- package/dist/chunks/{style-CXaw5EYi.js → style-Dlw9-wPn.js} +3 -3
- package/dist/chunks/{style-CXaw5EYi.js.map → style-Dlw9-wPn.js.map} +1 -1
- package/dist/chunks/{widgets-BBEQu0CS.js → widgets-C92ihtlF.js} +733 -737
- package/dist/chunks/widgets-C92ihtlF.js.map +1 -0
- package/dist/components/access-control-modal/AccessControlAddAccess.cjs.js +1 -1
- package/dist/components/access-control-modal/AccessControlAddAccess.esm.js +5 -5
- package/dist/components/access-control-modal/AccessControlGeneralAccess.cjs.js +2 -2
- package/dist/components/access-control-modal/AccessControlGeneralAccess.cjs.js.map +1 -1
- package/dist/components/access-control-modal/AccessControlGeneralAccess.esm.js +12 -12
- package/dist/components/access-control-modal/AccessControlModal.cjs.js +2 -2
- package/dist/components/access-control-modal/AccessControlModal.cjs.js.map +1 -1
- package/dist/components/access-control-modal/AccessControlModal.esm.js +35 -35
- package/dist/components/access-control-modal/AccessControlModal.esm.js.map +1 -1
- package/dist/components/access-control-modal/AccessControlSharedAccess.cjs.js +1 -1
- package/dist/components/access-control-modal/AccessControlSharedAccess.esm.js +2 -2
- package/dist/components/access-control-modal/accessTargetResolver.cjs.js +1 -1
- package/dist/components/access-control-modal/accessTargetResolver.cjs.js.map +1 -1
- package/dist/components/access-control-modal/accessTargetResolver.esm.js +21 -21
- package/dist/components/access-control-modal.js +1 -1
- package/dist/components/account/Account.cjs.js +1 -1
- package/dist/components/account/Account.esm.js +3 -3
- package/dist/components/account.js +1 -1
- package/dist/components/all.cjs.js +1 -1
- package/dist/components/all.esm.js +16 -16
- package/dist/components/avatar.js +1 -1
- package/dist/components/combobox/Combobox.cjs.js +1 -1
- package/dist/components/combobox/Combobox.esm.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/dialog/Dialog.cjs.js +2 -2
- package/dist/components/dialog/Dialog.cjs.js.map +1 -1
- package/dist/components/dialog/Dialog.esm.js +9 -9
- package/dist/components/dialog/Dialog.esm.js.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.cjs.js +1 -1
- package/dist/components/dialog-provider/DialogProvider.cjs.js.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.esm.js +6 -6
- package/dist/components/dialogs-root/DialogsRoot.cjs.js +2 -2
- package/dist/components/dialogs-root/DialogsRoot.cjs.js.map +1 -1
- package/dist/components/dialogs-root/DialogsRoot.esm.js +7 -7
- package/dist/components/error-state/ErrorState.cjs.js +1 -1
- package/dist/components/error-state/ErrorState.esm.js +1 -1
- package/dist/components/error-state.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +10 -10
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +5 -5
- package/dist/components/file-explorer-header.js +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/login-button/LoginButton.cjs.js +1 -1
- package/dist/components/login-button/LoginButton.esm.js +1 -1
- package/dist/components/login-button.js +1 -1
- package/dist/components/login-modal/LoginModal.cjs.js +1 -1
- package/dist/components/login-modal/LoginModal.esm.js +2 -2
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button/LogoutButton.cjs.js +1 -1
- package/dist/components/logout-button/LogoutButton.esm.js +1 -1
- package/dist/components/logout-button.js +1 -1
- package/dist/components/menu/Menu.cjs.js +1 -1
- package/dist/components/menu/Menu.cjs.js.map +1 -1
- package/dist/components/menu/Menu.esm.js +1 -1
- package/dist/components/menu/Menu.esm.js.map +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/rdf-form/RDFForm.cjs.js +3 -3
- package/dist/components/rdf-form/RDFForm.cjs.js.map +1 -1
- package/dist/components/rdf-form/RDFForm.esm.js +13 -13
- package/dist/components/rdf-form/RDFForm.esm.js.map +1 -1
- package/dist/components/rdf-form.js +1 -1
- package/dist/components/rdf-input/RDFInput.cjs.js +2 -2
- package/dist/components/rdf-input/RDFInput.cjs.js.map +1 -1
- package/dist/components/rdf-input/RDFInput.esm.js +4 -4
- package/dist/components/rdf-input/RDFInput.esm.js.map +1 -1
- package/dist/components/rdf-input.js +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +9 -3
- 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 +18 -9
- 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/Select.cjs.js +1 -1
- package/dist/components/select/Select.cjs.js.map +1 -1
- package/dist/components/select/Select.esm.js +1 -1
- package/dist/components/signup-button/SignupButton.cjs.js +1 -1
- package/dist/components/signup-button/SignupButton.esm.js +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components.js +21 -21
- package/dist/create/create.cjs.js +1 -1
- package/dist/create/create.cjs.js.map +1 -1
- package/dist/create/create.esm.js +23 -23
- package/dist/header/index.cjs.js +1 -1
- package/dist/header/index.cjs.js.map +1 -1
- package/dist/header/index.esm.js +53 -53
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -11
- package/dist/lib/auth/SolidAuth.cjs.js +1 -1
- package/dist/lib/auth/SolidAuth.cjs.js.map +1 -1
- package/dist/lib/auth/SolidAuth.esm.js +8 -8
- package/dist/lib/auth/SolidAuth.esm.js.map +1 -1
- package/dist/lib/code-editor/CodeEditor.cjs.js +1 -1
- package/dist/lib/code-editor/CodeEditor.cjs.js.map +1 -1
- package/dist/lib/code-editor/CodeEditor.d.ts.map +1 -1
- package/dist/lib/code-editor/CodeEditor.esm.js +34 -30
- package/dist/lib/code-editor/CodeEditor.esm.js.map +1 -1
- package/dist/lib/components/dialog-component/DialogComponent.cjs.js +1 -1
- package/dist/lib/components/dialog-component/DialogComponent.cjs.js.map +1 -1
- package/dist/lib/components/dialog-component/DialogComponent.esm.js +4 -4
- package/dist/lib/components/index.cjs.js +1 -1
- package/dist/lib/components/index.esm.js +3 -3
- package/dist/lib/dialogs/helpers.cjs.js +1 -1
- package/dist/lib/dialogs/helpers.cjs.js.map +1 -1
- package/dist/lib/dialogs/helpers.esm.js +4 -4
- 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/lib/file-explorer/relevant-panes.cjs.js +1 -1
- package/dist/lib/file-explorer/relevant-panes.cjs.js.map +1 -1
- package/dist/lib/file-explorer/relevant-panes.esm.js +8 -8
- package/dist/lib/messageArea.cjs.js +1 -1
- package/dist/lib/messageArea.cjs.js.map +1 -1
- package/dist/lib/messageArea.esm.js +27 -27
- package/dist/lib/pad.cjs.js +1 -1
- package/dist/lib/pad.cjs.js.map +1 -1
- package/dist/lib/pad.esm.js +15 -15
- package/dist/lib/participation.cjs.js +1 -1
- package/dist/lib/participation.cjs.js.map +1 -1
- package/dist/lib/participation.esm.js +59 -59
- package/dist/lib/preferences.cjs.js +1 -1
- package/dist/lib/preferences.cjs.js.map +1 -1
- package/dist/lib/preferences.esm.js +28 -28
- package/dist/lib/table.cjs.js +3 -3
- package/dist/lib/table.cjs.js.map +1 -1
- package/dist/lib/table.esm.js +123 -123
- package/dist/lib/table.esm.js.map +1 -1
- package/dist/lib/tabs.cjs.js +1 -1
- package/dist/lib/tabs.cjs.js.map +1 -1
- package/dist/lib/tabs.esm.js +16 -16
- package/dist/loader.js +11 -11
- package/dist/login/login.cjs.js +6 -6
- package/dist/login/login.cjs.js.map +1 -1
- package/dist/login/login.esm.js +142 -142
- package/dist/media/media-capture.cjs.js +1 -1
- package/dist/media/media-capture.cjs.js.map +1 -1
- package/dist/media/media-capture.esm.js +6 -6
- package/dist/solid-ui.js +34 -28
- package/dist/solid-ui.min.js +34 -28
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.cjs.js.map +1 -1
- package/dist/utils/index.esm.js +4 -4
- package/dist/utils/keyHelpers/accessData.cjs.js +1 -1
- package/dist/utils/keyHelpers/accessData.cjs.js.map +1 -1
- package/dist/utils/keyHelpers/accessData.esm.js +15 -15
- package/dist/utils/label.cjs.js +1 -1
- package/dist/utils/label.cjs.js.map +1 -1
- package/dist/utils/label.esm.js +4 -4
- package/dist/widgets/buttons.cjs.js +12 -12
- package/dist/widgets/buttons.cjs.js.map +1 -1
- package/dist/widgets/buttons.esm.js +179 -179
- package/dist/widgets/error.cjs.js +1 -1
- package/dist/widgets/error.cjs.js.map +1 -1
- package/dist/widgets/error.esm.js +5 -5
- package/dist/widgets/forms/autocomplete/autocompleteBar.cjs.js +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteBar.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteBar.esm.js +17 -17
- package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteField.esm.js +23 -23
- package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js +1 -1
- package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompletePicker.esm.js +26 -26
- package/dist/widgets/forms/autocomplete/language.cjs.js +1 -1
- package/dist/widgets/forms/autocomplete/language.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/language.esm.js +9 -9
- package/dist/widgets/forms/autocomplete/publicData.cjs.js +5 -5
- package/dist/widgets/forms/autocomplete/publicData.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/publicData.esm.js +67 -67
- package/dist/widgets/forms/basic.cjs.js +1 -1
- package/dist/widgets/forms/basic.cjs.js.map +1 -1
- package/dist/widgets/forms/basic.esm.js +11 -11
- package/dist/widgets/forms.cjs.js +4 -4
- package/dist/widgets/forms.cjs.js.map +1 -1
- package/dist/widgets/forms.esm.js +561 -561
- package/dist/widgets/forms.esm.js.map +1 -1
- package/dist/widgets/index.cjs.js +1 -1
- package/dist/widgets/index.cjs.js.map +1 -1
- package/dist/widgets/index.esm.js +82 -82
- package/dist/widgets/peoplePicker.cjs.js +2 -2
- package/dist/widgets/peoplePicker.cjs.js.map +1 -1
- package/dist/widgets/peoplePicker.esm.js +82 -82
- package/package.json +3 -3
- package/dist/chunks/ResourceActionsMenu-Bllpr4M5.js.map +0 -1
- package/dist/chunks/solidLogicSingleton.esm-BXyHD7mn.js.map +0 -1
- package/dist/chunks/src-DQgHAH3d.js.map +0 -1
- package/dist/chunks/widgets-BBEQu0CS.js.map +0 -1
package/dist/header/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/
|
|
1
|
+
const e=require("../lib/iconBase.cjs.js"),t=require("../login/login.cjs.js"),n=require("../widgets/buttons.cjs.js");require("../widgets/index.cjs.js");const r=require("../lib/style.cjs.js"),i=require("./empty-profile.cjs.js"),a=require("../utils/headerFooterHelpers.cjs.js");let o=require("solid-logic");var s=e.icons.iconBase+`noun_help.svg`,c=`https://solidproject.org/assets/img/solid-emblem.svg`;async function l(e,t,n){let r=document.getElementById(`PageHeader`);if(!r)return;let i=a.getPod();u(r,e,i,t,n)(),o.authSession.events.on(`logout`,u(r,e,i,t,n)),o.authSession.events.on(`login`,u(r,e,i,t,n))}function u(e,t,n,r,i){return async()=>{let a=o.authn.currentUser();e.innerHTML=``,e.appendChild(await d(t,n,a,r,i))}}async function d(e,t,n,i,a){let o=document.createElement(`a`);o.href=t.uri,o.setAttribute(`style`,r.style.headerBannerLink);let s=document.createElement(`img`);a&&(s.src=a.logo?a.logo:c),s.setAttribute(`style`,r.style.headerBannerIcon),o.appendChild(s);let l=n?await g(e,n,i):p(),u=document.createElement(`div`);u.setAttribute(`style`,r.style.headerBanner),u.appendChild(o);let d=document.createElement(`div`);if(d.setAttribute(`style`,r.style.headerBannerRightMenu),d.appendChild(l),a&&a.helpMenuList){let e=f(a,a.helpMenuList);d.appendChild(e)}return u.appendChild(d),u}function f(t,n){if(!n)return;let i=document.createElement(`ul`);i.setAttribute(`style`,r.style.headerUserMenuList),n.forEach(function(e){(e.url?`url`:`onclick`)==`url`?i.appendChild(_(h(e.label,e.url,e.target))):i.appendChild(_(m(e.label,e.onclick)))});let o=document.createElement(`nav`);o.setAttribute(`style`,r.style.headerUserMenuNavigationMenuNotDisplayed),o.setAttribute(`aria-hidden`,`true`),o.setAttribute(`id`,`helperNav`),o.appendChild(i);let c=document.createElement(`div`);c.setAttribute(`style`,r.style.headerBannerUserMenu),c.appendChild(o);let l=document.createElement(`button`);l.setAttribute(`style`,r.style.headerUserMenuTrigger),l.type=`button`;let u=document.createElement(`img`);u.src=t&&t.helpIcon?t.helpIcon:e.icons.iconBase+s,u.setAttribute(`style`,r.style.headerUserMenuTriggerImg),c.appendChild(l),l.appendChild(u);let d=a.throttle(e=>y(e,l,o),50);l.addEventListener(`click`,d);let f=setTimeout(()=>null,0);return c.addEventListener(`mouseover`,e=>{clearTimeout(f),d(e),document.getElementById(`helperNav`)?.setAttribute(`style`,r.style.headerUserMenuNavigationMenu)}),c.addEventListener(`mouseout`,e=>{f=setTimeout(()=>d(e),200),document.getElementById(`helperNav`)?.setAttribute(`style`,r.style.headerUserMenuNavigationMenuNotDisplayed)}),c}function p(){let e=document.createElement(`div`);return e.setAttribute(`style`,r.style.headerBannerLogin),e.appendChild(t.loginStatusBox(document,null,{})),e}function m(e,t){let n=document.createElement(`button`);return n.setAttribute(`style`,r.style.headerUserMenuButton),n.onmouseover=function(){n.setAttribute(`style`,r.style.headerUserMenuButtonHover)},n.onmouseout=function(){n.setAttribute(`style`,r.style.headerUserMenuButton)},n.addEventListener(`click`,t),n.innerText=e,n}function h(e,t,n){let i=document.createElement(`a`);return i.setAttribute(`style`,r.style.headerUserMenuLink),i.onmouseover=function(){i.setAttribute(`style`,r.style.headerUserMenuLinkHover)},i.onmouseout=function(){i.setAttribute(`style`,r.style.headerUserMenuLink)},i.href=t,i.innerText=e,n&&(i.target=n),i}async function g(e,t,n){let i=e.fetcher;i&&await i.load(t);let o=document.createElement(`ul`);o.setAttribute(`style`,r.style.headerUserMenuList),n&&n.forEach(function(e){(e.url?`url`:`onclick`)==`url`?o.appendChild(_(h(e.label,e.url,e.target))):o.appendChild(_(m(e.label,e.onclick)))});let s=document.createElement(`nav`);s.setAttribute(`style`,r.style.headerUserMenuNavigationMenuNotDisplayed),s.setAttribute(`aria-hidden`,`true`),s.setAttribute(`id`,`loggedInNav`),s.appendChild(o);let c=document.createElement(`button`);c.setAttribute(`style`,r.style.headerUserMenuTrigger),c.type=`button`;let l=v(e,t);typeof l==`string`?c.innerHTML=l:c.appendChild(l);let u=document.createElement(`div`);u.setAttribute(`style`,r.style.headerBannerUserMenuNotDisplayed),u.appendChild(c),u.appendChild(s);let d=a.throttle(e=>y(e,c,s),50);c.addEventListener(`click`,d);let f=setTimeout(()=>null,0);return u.addEventListener(`mouseover`,e=>{clearTimeout(f),d(e),document.getElementById(`loggedInNav`)?.setAttribute(`style`,r.style.headerUserMenuNavigationMenu)}),u.addEventListener(`mouseout`,e=>{f=setTimeout(()=>d(e),200),document.getElementById(`loggedInNav`)?.setAttribute(`style`,r.style.headerUserMenuNavigationMenuNotDisplayed)}),u}function _(e){let t=document.createElement(`li`);return t.setAttribute(`style`,r.style.headerUserMenuListItem),t.appendChild(e),t}function v(e,t){let a=null;try{if(a=n.findImage(t),!a)return i.emptyProfile}catch{return i.emptyProfile}let o=document.createElement(`div`);return o.setAttribute(`style`,r.style.headerUserMenuPhoto),o.style.backgroundImage=`url(${a})`,o}function y(e,t,n){let r=t.getAttribute(`aria-expanded`)===`true`,i=e.type===`mouseover`,a=e.type===`mouseout`;r&&i||!r&&a||(t.setAttribute(`aria-expanded`,(!r).toString()),n.setAttribute(`aria-hidden`,r.toString()))}exports.createBanner=d,exports.createHelpMenu=f,exports.createLoginSignUpButtons=p,exports.createUserMenu=g,exports.createUserMenuButton=m,exports.createUserMenuItem=_,exports.createUserMenuLink=h,exports.getProfileImg=v,exports.initHeader=l,exports.rebuildHeader=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":["icons","getPod","authn","style","throttle","loginStatusBox","emptyProfile","require_style","require_iconBase","require_buttons","require_login","require_empty_profile","require_headerFooterHelpers","solid_logic","DEFAULT_HELP_MENU_ICON","DEFAUL_SOLID_ICON_URL","initHeader","header","pod","rebuildHeader","store","userMenuList","options","user","createBanner","podLink","image","userMenu","createUserMenu","createLoginSignUpButtons","banner","leftSideOfHeader","helpMenu","createHelpMenu","helpMenuItems","helpMenuList","menuItem","createUserMenuItem","createUserMenuLink","createUserMenuButton","helpMenuContainer","helpMenuTrigger","helpMenuIcon","throttledMenuToggle","toggleMenu","event","timer","profileLoginButtonPre","button","onClick","label","link","href","target","fetcher","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","getProfileImg","loggedInMenuContainer","menuProfileItem","child","profileUrl","profileImage","isExpanded","trigger","expand","close","menu"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../lib/iconBase'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport { style } from '../lib/style'\nimport { emptyProfile } from './empty-profile'\nimport { getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.events.on('logout', rebuildHeader(header, store, pod, userMenuList, options))\n authSession.events.on('login', rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n helpMenuList.setAttribute('style', style.headerUserMenuList)\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n loggedInMenuList.setAttribute('style', style.headerUserMenuList)\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":"A,gTAkBA,IAAMc,EAAyBd,EAAAA,MAAM,SAAW,gBAC1Ce,EAAwB,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AAY,SAAS,CAAC,EAC9DI,EAAK,aAAa,cAAeJ,EAAW,SAAS,CAAC,EACxD,C"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["icons","getPod","authn","style","throttle","loginStatusBox","emptyProfile","require_iconBase","require_login","require_buttons","require_style","require_empty_profile","require_headerFooterHelpers","solid_logic","DEFAULT_HELP_MENU_ICON","DEFAUL_SOLID_ICON_URL","initHeader","header","pod","rebuildHeader","store","userMenuList","options","user","createBanner","podLink","image","userMenu","createUserMenu","createLoginSignUpButtons","banner","leftSideOfHeader","helpMenu","createHelpMenu","helpMenuItems","helpMenuList","menuItem","createUserMenuItem","createUserMenuLink","createUserMenuButton","helpMenuContainer","helpMenuTrigger","helpMenuIcon","throttledMenuToggle","toggleMenu","event","timer","profileLoginButtonPre","button","onClick","label","link","href","target","fetcher","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","getProfileImg","loggedInMenuContainer","menuProfileItem","child","profileUrl","profileImage","isExpanded","trigger","expand","close","menu"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../lib/iconBase'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport { style } from '../lib/style'\nimport { emptyProfile } from './empty-profile'\nimport { getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.events.on('logout', rebuildHeader(header, store, pod, userMenuList, options))\n authSession.events.on('login', rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n helpMenuList.setAttribute('style', style.headerUserMenuList)\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n loggedInMenuList.setAttribute('style', style.headerUserMenuList)\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":"A,gTAkBA,IAAMc,EAAyBd,EAAAA,MAAM,SAAW,gBAC1Ce,EAAwB,uDAgC9B,eAAsBC,EAAY,EAAuB,EAA2B,EAAyB,CAC3G,IAAMC,EAAS,SAAS,eAAe,YAAY,EACnD,GAAI,CAACA,EACH,OAGF,IAAMC,EAAMjB,EAAAA,OAAO,EACnBkB,EAAcF,EAAQG,EAAOF,EAAKG,EAAcC,CAAO,CAAC,CAAC,EACzDT,EAAA,YAAY,OAAO,GAAG,SAAUM,EAAcF,EAAQG,EAAOF,EAAKG,EAAcC,CAAO,CAAC,EACxFT,EAAA,YAAY,OAAO,GAAG,QAASM,EAAcF,EAAQG,EAAOF,EAAKG,EAAcC,CAAO,CAAC,CACzF,CAIA,SAAgBH,EAAe,EAAqB,EAAuB,EAAgB,EAA2B,EAAyB,CAC7I,OAAO,SAAY,CACjB,IAAMI,EAAOrB,EAAAA,MAAM,YAAY,EAC/B,EAAO,UAAY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A,SAAgBvB,EAAoB,EAAiC,CACnE,IAAMwB,EAAkB,SAAS,cAAc,IAAI,EAGnD,OAFAA,EAAgB,aAAa,QAAS1D,EAAAA,MAAM,sBAAsB,EAClE0D,EAAgB,YAAYC,CAAK,EAC1BD,CACT,CAIA,SAAgBF,EAAe,EAAuB,EAAuC,CAC3F,IAAII,EAAa,KACjB,GAAI,CAEF,GADA,EAAAtD,EAAA,UAA+Bc,CAAI,EAC/B,CAACwC,EACH,OAAOzD,EAAAA,YAEX,MAAQ,CACN,OAAOA,EAAAA,YACT,CAEA,IAAM0D,EAAe,SAAS,cAAc,KAAK,EAGjD,OAFAA,EAAa,aAAa,QAAS7D,EAAAA,MAAM,mBAAmB,EAC5D,EAAa,MAAM,gBAAkB,OAAO4D,EAAW,GAChDC,CACT,CAKA,SAASpB,EAAY,EAAc,EAA4B,EAAyB,CACtF,IAAMqB,EAAaC,EAAQ,aAAa,eAAe,IAAM,OACvDC,EAAStB,EAAM,OAAS,YACxBuB,EAAQvB,EAAM,OAAS,WACxBoB,GAAcE,GAAY,CAACF,GAAcG,IAG9CF,EAAQ,aAAa,iBAAkB,CAACD,EAAA,CAAY,SAAS,CAAC,EAC9DI,EAAK,aAAa,cAAeJ,EAAW,SAAS,CAAC,EACxD,C"}
|
package/dist/header/index.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { icons as e } from "../lib/iconBase.esm.js";
|
|
2
|
+
import { loginStatusBox as t } from "../login/login.esm.js";
|
|
3
3
|
import { findImage as n } from "../widgets/buttons.esm.js";
|
|
4
4
|
import "../widgets/index.esm.js";
|
|
5
|
-
import {
|
|
5
|
+
import { style as r } from "../lib/style.esm.js";
|
|
6
6
|
import { emptyProfile as i } from "./empty-profile.esm.js";
|
|
7
7
|
import { getPod as a, throttle as o } from "../utils/headerFooterHelpers.esm.js";
|
|
8
8
|
import { authSession as s, authn as c } from "solid-logic";
|
|
9
9
|
// src/header/index.ts
|
|
10
|
-
var l =
|
|
10
|
+
var l = e.iconBase + "noun_help.svg", u = "https://solidproject.org/assets/img/solid-emblem.svg";
|
|
11
11
|
async function d(e, t, n) {
|
|
12
12
|
let r = document.getElementById("PageHeader");
|
|
13
13
|
if (!r) return;
|
|
@@ -20,100 +20,100 @@ function f(e, t, n, r, i) {
|
|
|
20
20
|
e.innerHTML = "", e.appendChild(await p(t, n, a, r, i));
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
async function p(t, n,
|
|
23
|
+
async function p(e, t, n, i, a) {
|
|
24
24
|
let o = document.createElement("a");
|
|
25
|
-
o.href =
|
|
25
|
+
o.href = t.uri, o.setAttribute("style", r.headerBannerLink);
|
|
26
26
|
let s = document.createElement("img");
|
|
27
|
-
a && (s.src = a.logo ? a.logo : u), s.setAttribute("style",
|
|
28
|
-
let c =
|
|
29
|
-
l.setAttribute("style",
|
|
27
|
+
a && (s.src = a.logo ? a.logo : u), s.setAttribute("style", r.headerBannerIcon), o.appendChild(s);
|
|
28
|
+
let c = n ? await v(e, n, i) : h(), l = document.createElement("div");
|
|
29
|
+
l.setAttribute("style", r.headerBanner), l.appendChild(o);
|
|
30
30
|
let d = document.createElement("div");
|
|
31
|
-
if (d.setAttribute("style",
|
|
31
|
+
if (d.setAttribute("style", r.headerBannerRightMenu), d.appendChild(c), a && a.helpMenuList) {
|
|
32
32
|
let e = m(a, a.helpMenuList);
|
|
33
33
|
d.appendChild(e);
|
|
34
34
|
}
|
|
35
35
|
return l.appendChild(d), l;
|
|
36
36
|
}
|
|
37
|
-
function m(
|
|
38
|
-
if (!
|
|
37
|
+
function m(t, n) {
|
|
38
|
+
if (!n) return;
|
|
39
39
|
let i = document.createElement("ul");
|
|
40
|
-
i.setAttribute("style",
|
|
40
|
+
i.setAttribute("style", r.headerUserMenuList), n.forEach(function(e) {
|
|
41
41
|
(e.url ? "url" : "onclick") == "url" ? i.appendChild(y(_(e.label, e.url, e.target))) : i.appendChild(y(g(e.label, e.onclick)));
|
|
42
42
|
});
|
|
43
43
|
let a = document.createElement("nav");
|
|
44
|
-
a.setAttribute("style",
|
|
44
|
+
a.setAttribute("style", r.headerUserMenuNavigationMenuNotDisplayed), a.setAttribute("aria-hidden", "true"), a.setAttribute("id", "helperNav"), a.appendChild(i);
|
|
45
45
|
let s = document.createElement("div");
|
|
46
|
-
s.setAttribute("style",
|
|
46
|
+
s.setAttribute("style", r.headerBannerUserMenu), s.appendChild(a);
|
|
47
47
|
let c = document.createElement("button");
|
|
48
|
-
c.setAttribute("style",
|
|
48
|
+
c.setAttribute("style", r.headerUserMenuTrigger), c.type = "button";
|
|
49
49
|
let u = document.createElement("img");
|
|
50
|
-
u.src =
|
|
50
|
+
u.src = t && t.helpIcon ? t.helpIcon : e.iconBase + l, u.setAttribute("style", r.headerUserMenuTriggerImg), s.appendChild(c), c.appendChild(u);
|
|
51
51
|
let d = o((e) => x(e, c, a), 50);
|
|
52
52
|
c.addEventListener("click", d);
|
|
53
53
|
let f = setTimeout(() => null, 0);
|
|
54
|
-
return s.addEventListener("mouseover", (
|
|
55
|
-
clearTimeout(f), d(
|
|
56
|
-
}), s.addEventListener("mouseout", (
|
|
57
|
-
f = setTimeout(() => d(
|
|
54
|
+
return s.addEventListener("mouseover", (e) => {
|
|
55
|
+
clearTimeout(f), d(e), document.getElementById("helperNav")?.setAttribute("style", r.headerUserMenuNavigationMenu);
|
|
56
|
+
}), s.addEventListener("mouseout", (e) => {
|
|
57
|
+
f = setTimeout(() => d(e), 200), document.getElementById("helperNav")?.setAttribute("style", r.headerUserMenuNavigationMenuNotDisplayed);
|
|
58
58
|
}), s;
|
|
59
59
|
}
|
|
60
60
|
function h() {
|
|
61
|
-
let
|
|
62
|
-
return
|
|
61
|
+
let e = document.createElement("div");
|
|
62
|
+
return e.setAttribute("style", r.headerBannerLogin), e.appendChild(t(document, null, {})), e;
|
|
63
63
|
}
|
|
64
|
-
function g(
|
|
65
|
-
let
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
64
|
+
function g(e, t) {
|
|
65
|
+
let n = document.createElement("button");
|
|
66
|
+
return n.setAttribute("style", r.headerUserMenuButton), n.onmouseover = function() {
|
|
67
|
+
n.setAttribute("style", r.headerUserMenuButtonHover);
|
|
68
|
+
}, n.onmouseout = function() {
|
|
69
|
+
n.setAttribute("style", r.headerUserMenuButton);
|
|
70
|
+
}, n.addEventListener("click", t), n.innerText = e, n;
|
|
71
71
|
}
|
|
72
|
-
function _(t, n
|
|
72
|
+
function _(e, t, n) {
|
|
73
73
|
let i = document.createElement("a");
|
|
74
|
-
return i.setAttribute("style",
|
|
75
|
-
i.setAttribute("style",
|
|
74
|
+
return i.setAttribute("style", r.headerUserMenuLink), i.onmouseover = function() {
|
|
75
|
+
i.setAttribute("style", r.headerUserMenuLinkHover);
|
|
76
76
|
}, i.onmouseout = function() {
|
|
77
|
-
i.setAttribute("style",
|
|
78
|
-
}, i.href =
|
|
77
|
+
i.setAttribute("style", r.headerUserMenuLink);
|
|
78
|
+
}, i.href = t, i.innerText = e, n && (i.target = n), i;
|
|
79
79
|
}
|
|
80
|
-
async function v(t, n
|
|
81
|
-
let i =
|
|
82
|
-
i && await i.load(
|
|
80
|
+
async function v(e, t, n) {
|
|
81
|
+
let i = e.fetcher;
|
|
82
|
+
i && await i.load(t);
|
|
83
83
|
let a = document.createElement("ul");
|
|
84
|
-
a.setAttribute("style",
|
|
84
|
+
a.setAttribute("style", r.headerUserMenuList), n && n.forEach(function(e) {
|
|
85
85
|
(e.url ? "url" : "onclick") == "url" ? a.appendChild(y(_(e.label, e.url, e.target))) : a.appendChild(y(g(e.label, e.onclick)));
|
|
86
86
|
});
|
|
87
87
|
let s = document.createElement("nav");
|
|
88
|
-
s.setAttribute("style",
|
|
88
|
+
s.setAttribute("style", r.headerUserMenuNavigationMenuNotDisplayed), s.setAttribute("aria-hidden", "true"), s.setAttribute("id", "loggedInNav"), s.appendChild(a);
|
|
89
89
|
let c = document.createElement("button");
|
|
90
|
-
c.setAttribute("style",
|
|
91
|
-
let l = b(
|
|
90
|
+
c.setAttribute("style", r.headerUserMenuTrigger), c.type = "button";
|
|
91
|
+
let l = b(e, t);
|
|
92
92
|
typeof l == "string" ? c.innerHTML = l : c.appendChild(l);
|
|
93
93
|
let u = document.createElement("div");
|
|
94
|
-
u.setAttribute("style",
|
|
94
|
+
u.setAttribute("style", r.headerBannerUserMenuNotDisplayed), u.appendChild(c), u.appendChild(s);
|
|
95
95
|
let d = o((e) => x(e, c, s), 50);
|
|
96
96
|
c.addEventListener("click", d);
|
|
97
97
|
let f = setTimeout(() => null, 0);
|
|
98
|
-
return u.addEventListener("mouseover", (
|
|
99
|
-
clearTimeout(f), d(
|
|
100
|
-
}), u.addEventListener("mouseout", (
|
|
101
|
-
f = setTimeout(() => d(
|
|
98
|
+
return u.addEventListener("mouseover", (e) => {
|
|
99
|
+
clearTimeout(f), d(e), document.getElementById("loggedInNav")?.setAttribute("style", r.headerUserMenuNavigationMenu);
|
|
100
|
+
}), u.addEventListener("mouseout", (e) => {
|
|
101
|
+
f = setTimeout(() => d(e), 200), document.getElementById("loggedInNav")?.setAttribute("style", r.headerUserMenuNavigationMenuNotDisplayed);
|
|
102
102
|
}), u;
|
|
103
103
|
}
|
|
104
|
-
function y(
|
|
105
|
-
let
|
|
106
|
-
return
|
|
104
|
+
function y(e) {
|
|
105
|
+
let t = document.createElement("li");
|
|
106
|
+
return t.setAttribute("style", r.headerUserMenuListItem), t.appendChild(e), t;
|
|
107
107
|
}
|
|
108
|
-
function b(
|
|
108
|
+
function b(e, t) {
|
|
109
109
|
let a = null;
|
|
110
110
|
try {
|
|
111
|
-
if (a = n(
|
|
111
|
+
if (a = n(t), !a) return i;
|
|
112
112
|
} catch {
|
|
113
113
|
return i;
|
|
114
114
|
}
|
|
115
115
|
let o = document.createElement("div");
|
|
116
|
-
return o.setAttribute("style",
|
|
116
|
+
return o.setAttribute("style", r.headerUserMenuPhoto), o.style.backgroundImage = `url(${a})`, o;
|
|
117
117
|
}
|
|
118
118
|
function x(e, t, n) {
|
|
119
119
|
let r = t.getAttribute("aria-expanded") === "true", i = e.type === "mouseover", a = e.type === "mouseout";
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ns.cjs.js"),t=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ns.cjs.js"),t=require("./acl/index.cjs.js"),n=require("./create/index.cjs.js"),r=require("./lib/iconBase.cjs.js"),i=require("./widgets/forms/autocomplete/language.cjs.js"),a=require("./lib/log.cjs.js"),o=require("./matrix/index.cjs.js"),s=require("./media/index.cjs.js"),c=require("./lib/messageArea.cjs.js"),l=require("./chat/infinite.cjs.js"),u=require("./lib/pad.cjs.js"),d=require("./lib/participation.cjs.js"),f=require("./lib/preferences.cjs.js"),p=require("./lib/style.cjs.js"),m=require("./lib/table.cjs.js"),h=require("./lib/tabs.cjs.js"),g=require("./utils/index.cjs.js"),_=require("./login/login.cjs.js"),v=require("./widgets/index.cjs.js"),y=require("./header/index.cjs.js"),b=require("./footer/index.cjs.js"),x=require("./create/types.cjs.js"),S=require("./lib/auth/Account.cjs.js"),C=require("./lib/auth/NoopAuth.cjs.js"),w=require("./lib/auth/context.cjs.js"),T=require("./lib/components/ids.cjs.js"),E=require("./lib/dialogs/context.cjs.js"),D=require("./lib/components/decorators.cjs.js"),O=require("./lib/dialogs/events/close-dialog.cjs.js"),k=require("./lib/components/traits/DialogTrait.cjs.js"),A=require("./lib/components/web-component/WebComponent.cjs.js"),j=require("./lib/components/dialog-component/DialogComponent.cjs.js"),M=require("./lib/components/traits/FormControlTrait.cjs.js"),N=require("./lib/components/form-control-component/FormControlComponent.cjs.js");require("./lib/auth/index.cjs.js");const P=require("./lib/dialogs/Dialog.cjs.js"),F=require("./lib/dialogs/events/show-dialog.cjs.js"),I=require("./lib/dialogs/helpers.cjs.js");require("./lib/components/index.cjs.js");const L=require("./lib/auth/SolidAuth.cjs.js");require("./lib/dialogs/index.cjs.js");const R=require("./lib/file-explorer/context.cjs.js"),z=require("./lib/file-explorer/events.cjs.js"),B=require("./lib/file-explorer/relevant-panes.cjs.js"),V=require("./lib/file-explorer/compose-explorer.cjs.js"),H=require("./lib/file-explorer/pane-menu-items.cjs.js");require("./lib/file-explorer/index.cjs.js");const U=require("./lib/code-editor/CodeEditor.cjs.js");require("./lib/code-editor/index.cjs.js");var W=typeof window<`u`?window.document:null;exports.Account=S.default,exports.CloseDialogEvent=O.CloseDialogEvent,exports.CodeEditor=U.CodeEditor,exports.DEFAULT_AUTH_CONTEXT=w.DEFAULT_AUTH_CONTEXT,exports.DEFAULT_DIALOG_CONTEXT=E.DEFAULT_DIALOG_CONTEXT,exports.DEFAULT_FILE_EXPLORER_CONTEXT=R.DEFAULT_FILE_EXPLORER_CONTEXT,exports.DEFAULT_SIGNUP_URL=L.DEFAULT_SIGNUP_URL,exports.Dialog=P.default,exports.DialogComponent=j.default,exports.DialogTrait=k.default,exports.FILE_EXPLORER_BACK_EVENT=z.FILE_EXPLORER_BACK_EVENT,exports.FILE_EXPLORER_MANAGE_ACCESS_EVENT=z.FILE_EXPLORER_MANAGE_ACCESS_EVENT,exports.FILE_EXPLORER_OPEN_PANE_EVENT=z.FILE_EXPLORER_OPEN_PANE_EVENT,exports.FormControlComponent=N.default,exports.FormControlTrait=M.default,exports.NoopAuth=C.default,exports.ShowDialogEvent=F.ShowDialogEvent,exports.SolidAuth=L.default,exports.WebComponent=A.default,exports.acl=t.acl,exports.aclControl=t.aclControl,exports.authContext=w.authContext,exports.composeExplorer=V.composeExplorer,exports.create=n.create,Object.defineProperty(exports,"createTypes",{enumerable:!0,get:function(){return x.types_exports}}),exports.customElement=D.customElement,exports.dialogContext=E.dialogContext,exports.dom=W,exports.fileExplorerContext=R.fileExplorerContext,exports.generateId=T.generateId,exports.getPreferredPane=B.getPreferredPane,exports.getRelevantPanes=B.getRelevantPanes,exports.icons=r.icons,exports.infiniteMessageArea=l.infiniteMessageArea,exports.initFooter=b.initFooter,exports.initHeader=y.initHeader,exports.isExplorerEvent=z.isExplorerEvent,Object.defineProperty(exports,"language",{enumerable:!0,get:function(){return i.language_exports}}),Object.defineProperty(exports,"log",{enumerable:!0,get:function(){return a.log_exports}}),Object.defineProperty(exports,"login",{enumerable:!0,get:function(){return _.login_exports}}),exports.matrix=o.matrix,exports.media=s.media,exports.messageArea=c.messageArea,exports.ns=e.default,Object.defineProperty(exports,"pad",{enumerable:!0,get:function(){return u.pad_exports}}),Object.defineProperty(exports,"participation",{enumerable:!0,get:function(){return d.participation_exports}}),Object.defineProperty(exports,"preferences",{enumerable:!0,get:function(){return f.preferences_exports}}),exports.preparePaneMenuItems=H.preparePaneMenuItems,exports.showDialog=I.showDialog,exports.style=p.style,exports.table=m.renderTableViewPane,Object.defineProperty(exports,"tabs",{enumerable:!0,get:function(){return h.tabs_exports}}),Object.defineProperty(exports,"utils",{enumerable:!0,get:function(){return g.utils_exports}}),Object.defineProperty(exports,"widgets",{enumerable:!0,get:function(){return v.widgets_exports}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":["require_ns","
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["require_ns","require_index","require_index$1","require_iconBase","require_language","require_log","require_index$2","require_index$3","require_messageArea","require_infinite","require_pad","require_participation","require_preferences","require_style","require_table","require_tabs","require_index$4","require_login","require_index$5","require_index$6","require_index$7","require_types","require_Account","require_NoopAuth","require_context","require_ids","require_context$1","require_decorators","require_close_dialog","require_DialogTrait","require_WebComponent","require_DialogComponent","require_FormControlTrait","require_FormControlComponent","require_Dialog","require_show_dialog","require_helpers","require_SolidAuth","require_context$2","require_events","require_relevant_panes","require_compose_explorer","require_pane_menu_items","require_CodeEditor","dom"],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer'\nexport * from './lib/code-editor'\n"],"mappings":"A,mpEAkCA,IAAa4C,EAAM,OAAO,OAAW,IAAc,OAAO,SAAW,K"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e from "./lib/ns.esm.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { style as r } from "./lib/style.esm.js";
|
|
2
|
+
import { acl as t, aclControl as n } from "./acl/index.esm.js";
|
|
3
|
+
import { create as r } from "./create/index.esm.js";
|
|
5
4
|
import { icons as i } from "./lib/iconBase.esm.js";
|
|
6
5
|
import { language_exports as a } from "./widgets/forms/autocomplete/language.esm.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
6
|
+
import { log_exports as o } from "./lib/log.esm.js";
|
|
7
|
+
import { matrix as s } from "./matrix/index.esm.js";
|
|
8
|
+
import { media as c } from "./media/index.esm.js";
|
|
9
|
+
import { messageArea as l } from "./lib/messageArea.esm.js";
|
|
10
|
+
import { infiniteMessageArea as u } from "./chat/infinite.esm.js";
|
|
11
|
+
import { pad_exports as d } from "./lib/pad.esm.js";
|
|
12
|
+
import { participation_exports as f } from "./lib/participation.esm.js";
|
|
13
|
+
import { preferences_exports as p } from "./lib/preferences.esm.js";
|
|
14
|
+
import { style as m } from "./lib/style.esm.js";
|
|
15
|
+
import { renderTableViewPane as h } from "./lib/table.esm.js";
|
|
16
|
+
import { tabs_exports as g } from "./lib/tabs.esm.js";
|
|
17
|
+
import { utils_exports as _ } from "./utils/index.esm.js";
|
|
18
|
+
import { login_exports as v } from "./login/login.esm.js";
|
|
19
|
+
import { widgets_exports as y } from "./widgets/index.esm.js";
|
|
20
20
|
import { initHeader as b } from "./header/index.esm.js";
|
|
21
21
|
import { initFooter as x } from "./footer/index.esm.js";
|
|
22
22
|
import { types_exports as S } from "./create/types.esm.js";
|
|
@@ -32,22 +32,23 @@ import N from "./lib/components/web-component/WebComponent.esm.js";
|
|
|
32
32
|
import P from "./lib/components/dialog-component/DialogComponent.esm.js";
|
|
33
33
|
import F from "./lib/components/traits/FormControlTrait.esm.js";
|
|
34
34
|
import I from "./lib/components/form-control-component/FormControlComponent.esm.js";
|
|
35
|
-
import "./lib/
|
|
35
|
+
import "./lib/auth/index.esm.js";
|
|
36
36
|
import L from "./lib/dialogs/Dialog.esm.js";
|
|
37
37
|
import { ShowDialogEvent as R } from "./lib/dialogs/events/show-dialog.esm.js";
|
|
38
38
|
import { showDialog as z } from "./lib/dialogs/helpers.esm.js";
|
|
39
|
-
import "./lib/
|
|
39
|
+
import "./lib/components/index.esm.js";
|
|
40
40
|
import B, { DEFAULT_SIGNUP_URL as V } from "./lib/auth/SolidAuth.esm.js";
|
|
41
|
-
import "./lib/
|
|
41
|
+
import "./lib/dialogs/index.esm.js";
|
|
42
42
|
import { DEFAULT_FILE_EXPLORER_CONTEXT as H, fileExplorerContext as U } from "./lib/file-explorer/context.esm.js";
|
|
43
43
|
import { FILE_EXPLORER_BACK_EVENT as W, FILE_EXPLORER_MANAGE_ACCESS_EVENT as G, FILE_EXPLORER_OPEN_PANE_EVENT as K, isExplorerEvent as q } from "./lib/file-explorer/events.esm.js";
|
|
44
44
|
import { getPreferredPane as J, getRelevantPanes as Y } from "./lib/file-explorer/relevant-panes.esm.js";
|
|
45
45
|
import { composeExplorer as X } from "./lib/file-explorer/compose-explorer.esm.js";
|
|
46
|
+
import { preparePaneMenuItems as Z } from "./lib/file-explorer/pane-menu-items.esm.js";
|
|
46
47
|
import "./lib/file-explorer/index.esm.js";
|
|
47
|
-
import { CodeEditor as
|
|
48
|
+
import { CodeEditor as Q } from "./lib/code-editor/CodeEditor.esm.js";
|
|
48
49
|
import "./lib/code-editor/index.esm.js";
|
|
49
50
|
// src/index.ts
|
|
50
|
-
var
|
|
51
|
-
export { C as Account, j as CloseDialogEvent,
|
|
51
|
+
var $ = typeof window < "u" ? window.document : null;
|
|
52
|
+
export { C as Account, j as CloseDialogEvent, Q as CodeEditor, T as DEFAULT_AUTH_CONTEXT, O as DEFAULT_DIALOG_CONTEXT, H as DEFAULT_FILE_EXPLORER_CONTEXT, V as DEFAULT_SIGNUP_URL, L as Dialog, P as DialogComponent, M as DialogTrait, W as FILE_EXPLORER_BACK_EVENT, G as FILE_EXPLORER_MANAGE_ACCESS_EVENT, K as FILE_EXPLORER_OPEN_PANE_EVENT, I as FormControlComponent, F as FormControlTrait, w as NoopAuth, R as ShowDialogEvent, B as SolidAuth, N as WebComponent, t as acl, n as aclControl, E as authContext, X as composeExplorer, r as create, S as createTypes, A as customElement, k as dialogContext, $ as dom, U as fileExplorerContext, D as generateId, J as getPreferredPane, Y as getRelevantPanes, i as icons, u as infiniteMessageArea, x as initFooter, b as initHeader, q as isExplorerEvent, a as language, o as log, v as login, s as matrix, c as media, l as messageArea, e as ns, d as pad, f as participation, p as preferences, Z as preparePaneMenuItems, z as showDialog, m as style, h as table, g as tabs, _ as utils, y as widgets };
|
|
52
53
|
|
|
53
54
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":["ns_default","Account","NoopAuth","DialogTrait","WebComponent","DialogComponent","FormControlTrait","FormControlComponent","Dialog","SolidAuth","dom","CloseDialogEvent","CodeEditor","DEFAULT_AUTH_CONTEXT","DEFAULT_DIALOG_CONTEXT","DEFAULT_FILE_EXPLORER_CONTEXT","DEFAULT_SIGNUP_URL","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_MANAGE_ACCESS_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","ShowDialogEvent","acl","aclControl","authContext","composeExplorer","create","types_exports","customElement","dialogContext","fileExplorerContext","generateId","getPreferredPane","getRelevantPanes","icons","infiniteMessageArea","initFooter","initHeader","isExplorerEvent","language_exports","log_exports","login_exports","matrix","media","messageArea","pad_exports","participation_exports","preferences_exports","showDialog","style","renderTableViewPane","tabs_exports","utils_exports","widgets_exports"],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer'\nexport * from './lib/code-editor'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["ns_default","Account","NoopAuth","DialogTrait","WebComponent","DialogComponent","FormControlTrait","FormControlComponent","Dialog","SolidAuth","dom","CloseDialogEvent","CodeEditor","DEFAULT_AUTH_CONTEXT","DEFAULT_DIALOG_CONTEXT","DEFAULT_FILE_EXPLORER_CONTEXT","DEFAULT_SIGNUP_URL","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_MANAGE_ACCESS_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","ShowDialogEvent","acl","aclControl","authContext","composeExplorer","create","types_exports","customElement","dialogContext","fileExplorerContext","generateId","getPreferredPane","getRelevantPanes","icons","infiniteMessageArea","initFooter","initHeader","isExplorerEvent","language_exports","log_exports","login_exports","matrix","media","messageArea","pad_exports","participation_exports","preferences_exports","preparePaneMenuItems","showDialog","style","renderTableViewPane","tabs_exports","utils_exports","widgets_exports"],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer'\nexport * from './lib/code-editor'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAaU,IAAM,OAAO,SAAW,MAAc,OAAO,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { y as e } from "./chunks/solidLogicSingleton.esm-
|
|
2
|
-
import { a as t, c as n, n as r, o as i, s as a, t as o } from "./chunks/auth-
|
|
3
|
-
import { l as s, m as c, t as l } from "./chunks/style-
|
|
4
|
-
import { a as u, b as d, t as f } from "./chunks/widgets-
|
|
5
|
-
import {
|
|
6
|
-
import { _ as
|
|
7
|
-
import { n as
|
|
8
|
-
import { t as
|
|
9
|
-
import { n as
|
|
10
|
-
import { i as
|
|
11
|
-
export { n as Account,
|
|
1
|
+
import { y as e } from "./chunks/solidLogicSingleton.esm-Bvt7E7Vl.js";
|
|
2
|
+
import { a as t, c as n, n as r, o as i, s as a, t as o } from "./chunks/auth-EK-iYNYZ.js";
|
|
3
|
+
import { l as s, m as c, t as l } from "./chunks/style-Dlw9-wPn.js";
|
|
4
|
+
import { a as u, b as d, t as f } from "./chunks/widgets-C92ihtlF.js";
|
|
5
|
+
import { S as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, l as C, m as w, n as T, o as E, p as D, r as O, s as k, t as A, u as j, v as M, x as N, y as P } from "./chunks/src-Cv9Lm1V-.js";
|
|
6
|
+
import { _ as F, a as I, g as L, h as R, m as z, n as B, o as V, t as H, v as U, y as W } from "./chunks/components-C8c2Ucm5.js";
|
|
7
|
+
import { n as G, t as K } from "./chunks/dialogs-BmtLjMzg.js";
|
|
8
|
+
import { t as q } from "./chunks/show-dialog-DAmFslrf.js";
|
|
9
|
+
import { n as J, t as Y } from "./chunks/context-BDrfQ9bN.js";
|
|
10
|
+
import { i as X, n as Z, r as Q, t as $ } from "./chunks/events-CXQHDCs2.js";
|
|
11
|
+
export { n as Account, R as CloseDialogEvent, T as CodeEditor, t as DEFAULT_AUTH_CONTEXT, F as DEFAULT_DIALOG_CONTEXT, Y as DEFAULT_FILE_EXPLORER_CONTEXT, o as DEFAULT_SIGNUP_URL, G as Dialog, I as DialogComponent, z as DialogTrait, $ as FILE_EXPLORER_BACK_EVENT, Z as FILE_EXPLORER_MANAGE_ACCESS_EVENT, Q as FILE_EXPLORER_OPEN_PANE_EVENT, H as FormControlComponent, B as FormControlTrait, a as NoopAuth, q as ShowDialogEvent, r as SolidAuth, V as WebComponent, g as acl, N as aclControl, i as authContext, S as composeExplorer, P as create, k as createTypes, L as customElement, U as dialogContext, A as dom, J as fileExplorerContext, W as generateId, h as getPreferredPane, E as getRelevantPanes, d as icons, D as infiniteMessageArea, _ as initFooter, C as initHeader, X as isExplorerEvent, u as language, c as log, p as login, M as matrix, m as media, b as messageArea, e as ns, w as pad, x as participation, y as preferences, O as preparePaneMenuItems, K as showDialog, l as style, v as table, j as tabs, s as utils, f as widgets };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("
|
|
1
|
+
const e=require("./Account.cjs.js"),t=require("../ns.cjs.js"),n=require("../dialogs/helpers.cjs.js");require("../dialogs/index.cjs.js");const r=require("../../components/login-modal/index.cjs.js");let i=require("solid-logic");var a=`https://solidproject.org/get_a_pod`;function o(e){let n=i.solidLogicSingleton.store,r=n.sym(e),a=n.any(r,t.default.sioc(`avatar`))||n.any(r,t.default.foaf(`img`))||n.any(r,t.default.vcard(`logo`))||n.any(r,t.default.vcard(`hasPhoto`))||n.any(r,t.default.vcard(`photo`))||n.any(r,t.default.foaf(`depiction`));return a?a.value:void 0}var s=class{signupUrl;_initialized=!1;profileLoaded=!1;listeners=[];constructor(e=a){this.signupUrl=e}async initialize(){i.authSession.events.on(`sessionRestore`,()=>{i.solidLogicSingleton.store.updater.flagAuthorizationMetadata()}),(0,i.reloadOnIdentityReplaced)(i.authSession.events,()=>{i.authSession.info?.isLoggedIn&&window.location.reload()}),await i.authn.checkUser(),this._initialized=!0,this.listeners.forEach(e=>e())}async loadProfile(){!this.profileLoaded&&this.account&&(this.profileLoaded=!0,await i.solidLogicSingleton.profile.loadMe(),this.listeners.forEach(e=>e()))}get initialized(){return this._initialized}get account(){let t=i.authSession.webId??i.authSession.info?.webId;if(!(i.authSession.isActive??i.authSession.info?.isLoggedIn??!!t)||!t)return null;let n=o(t);return new e.default(t,n)}async login(e){if(!e){n.showDialog(r.default);return}i.solidLogicSingleton.store.updater.flagAuthorizationMetadata();let t=new URL(window.location.href).hash;t&&window.localStorage.setItem(`preLoginRedirectHash`,t),window.localStorage.setItem(`loginIssuer`,e);let a=new URL(window.location.href);a.hash=``,await i.authSession.login(e,a.href)}async signup(){window.open(this.signupUrl,`_blank`,`noopener,noreferrer`)}async logout(){await i.authSession.logout()}onSessionUpdated(e){let t=i.authSession,n=()=>{e()};return this.listeners.push(n),typeof t.addEventListener==`function`?t.addEventListener(`sessionStateChange`,n):(i.authSession.events.on(`login`,n),i.authSession.events.on(`logout`,n),i.authSession.events.on(`sessionRestore`,n)),()=>{this.listeners=this.listeners.filter(e=>e!==n),typeof t.removeEventListener==`function`?t.removeEventListener(`sessionStateChange`,n):(i.authSession.events.off(`login`,n),i.authSession.events.off(`logout`,n),i.authSession.events.off(`sessionRestore`,n))}}};exports.DEFAULT_SIGNUP_URL=a,exports.default=s;
|
|
2
2
|
//# sourceMappingURL=SolidAuth.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuth.cjs.js","names":["solidLogicSingleton","ns","authSession","authn","Account","LoginModal","
|
|
1
|
+
{"version":3,"file":"SolidAuth.cjs.js","names":["solidLogicSingleton","ns","authSession","authn","Account","LoginModal","require_Account","require_ns","require_helpers","require_components_login_modal_index","solid_logic","DEFAULT_SIGNUP_URL","findAccountImage","store","me","webId","image","SolidAuth","signupUrl","listener","avatarUrl","loginUrl","preLoginRedirectHash","locationUrl","sessionEventTarget","callback","_listener"],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import Account from '@/lib/auth/Account'\nimport ns from '@/lib/ns'\nimport { authn, authSession, reloadOnIdentityReplaced, solidLogicSingleton } from 'solid-logic'\nimport { AuthContext } from '@/lib/auth'\nimport { showDialog } from '@/lib/dialogs'\n\nimport LoginModal from '@/components/login-modal'\n\nexport const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'\n\nfunction findAccountImage (webId: string): string | undefined {\n const store = solidLogicSingleton.store\n const me = store.sym(webId)\n const image =\n store.any(me, ns.sioc('avatar')) ||\n store.any(me, ns.foaf('img')) ||\n store.any(me, ns.vcard('logo')) ||\n store.any(me, ns.vcard('hasPhoto')) ||\n store.any(me, ns.vcard('photo')) ||\n store.any(me, ns.foaf('depiction'))\n\n return image ? (image as any).value : undefined\n}\n\nexport default class SolidAuth implements AuthContext {\n private _initialized = false\n private profileLoaded = false\n private listeners: (() => unknown)[] = []\n\n constructor (public signupUrl: string = DEFAULT_SIGNUP_URL) {}\n\n async initialize () {\n authSession.events.on('sessionRestore', () => {\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n })\n\n // An identity that was actively established was replaced while the session\n // stayed active (A -> B, e.g. from another tab): everything fetched under\n // the previous identity is stale, so the app reloads. A logout is not a\n // reload case here — the derived info already reports logged out and the\n // logout path runs its own cleanup and navigation.\n reloadOnIdentityReplaced(authSession.events, () => {\n if (authSession.info?.isLoggedIn) window.location.reload()\n })\n\n await authn.checkUser()\n\n this._initialized = true\n this.listeners.forEach(listener => listener())\n }\n\n async loadProfile () {\n if (this.profileLoaded || !this.account) {\n return\n }\n\n this.profileLoaded = true\n\n await solidLogicSingleton.profile.loadMe()\n\n this.listeners.forEach(listener => listener())\n }\n\n get initialized (): boolean {\n return this._initialized\n }\n\n get account (): Account | null {\n const webId: string | undefined = authSession.webId ?? authSession.info?.webId\n const isActive: boolean = authSession.isActive ?? authSession.info?.isLoggedIn ?? Boolean(webId)\n\n if (!isActive || !webId) {\n return null\n }\n\n const avatarUrl = findAccountImage(webId)\n\n return new Account(webId, avatarUrl)\n }\n\n async login (loginUrl?: string) {\n if (!loginUrl) {\n showDialog(LoginModal)\n\n return\n }\n\n // clear authorization metadata from store\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', loginUrl)\n\n const locationUrl = new URL(window.location.href)\n\n locationUrl.hash = ''\n\n await authSession.login(loginUrl, locationUrl.href)\n }\n\n async signup () {\n window.open(this.signupUrl, '_blank', 'noopener,noreferrer')\n }\n\n async logout () {\n await authSession.logout()\n }\n\n onSessionUpdated (callback: () => unknown) {\n const sessionEventTarget = authSession as unknown as EventTarget\n const listener = () => {\n callback()\n }\n\n this.listeners.push(listener)\n\n if (typeof sessionEventTarget.addEventListener === 'function') {\n sessionEventTarget.addEventListener('sessionStateChange', listener)\n } else {\n authSession.events.on('login', listener)\n authSession.events.on('logout', listener)\n authSession.events.on('sessionRestore', listener)\n }\n\n return () => {\n this.listeners = this.listeners.filter(_listener => _listener !== listener)\n\n if (typeof sessionEventTarget.removeEventListener === 'function') {\n sessionEventTarget.removeEventListener('sessionStateChange', listener)\n } else {\n authSession.events.off('login', listener)\n authSession.events.off('logout', listener)\n authSession.events.off('sessionRestore', listener)\n }\n }\n }\n}\n"],"mappings":"A,kOAQA,IAAaW,EAAqB,qCAElC,SAASC,EAAkB,EAAmC,CAC5D,IAAMC,EAAQb,EAAAA,oBAAoB,MAC5Bc,EAAKD,EAAM,IAAIE,CAAK,EACpBC,EACJH,EAAM,IAAIC,EAAIb,EAAAA,QAAG,KAAK,QAAQ,CAAC,GAC/BY,EAAM,IAAIC,EAAIb,EAAAA,QAAG,KAAK,KAAK,CAAC,GAC5BY,EAAM,IAAIC,EAAIb,EAAAA,QAAG,MAAM,MAAM,CAAC,GAC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
3
3
|
import { showDialog as n } from "../dialogs/helpers.esm.js";
|
|
4
4
|
import "../dialogs/index.esm.js";
|
|
5
5
|
import r from "../../components/login-modal/index.esm.js";
|
|
6
6
|
import { authSession as i, authn as a, reloadOnIdentityReplaced as o, solidLogicSingleton as s } from "solid-logic";
|
|
7
7
|
// src/lib/auth/SolidAuth.ts
|
|
8
8
|
var c = "https://solidproject.org/get_a_pod";
|
|
9
|
-
function l(
|
|
10
|
-
let n = s.store, r = n.sym(
|
|
9
|
+
function l(e) {
|
|
10
|
+
let n = s.store, r = n.sym(e), i = n.any(r, t.sioc("avatar")) || n.any(r, t.foaf("img")) || n.any(r, t.vcard("logo")) || n.any(r, t.vcard("hasPhoto")) || n.any(r, t.vcard("photo")) || n.any(r, t.foaf("depiction"));
|
|
11
11
|
return i ? i.value : void 0;
|
|
12
12
|
}
|
|
13
13
|
var u = class {
|
|
@@ -32,10 +32,10 @@ var u = class {
|
|
|
32
32
|
return this._initialized;
|
|
33
33
|
}
|
|
34
34
|
get account() {
|
|
35
|
-
let
|
|
36
|
-
if (!(i.isActive ?? i.info?.isLoggedIn ?? !!
|
|
37
|
-
let n = l(
|
|
38
|
-
return new t
|
|
35
|
+
let t = i.webId ?? i.info?.webId;
|
|
36
|
+
if (!(i.isActive ?? i.info?.isLoggedIn ?? !!t) || !t) return null;
|
|
37
|
+
let n = l(t);
|
|
38
|
+
return new e(t, n);
|
|
39
39
|
}
|
|
40
40
|
async login(e) {
|
|
41
41
|
if (!e) {
|