solid-ui 5.0.0-1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/~icons/app/solid-emblem.cjs.js.map +1 -1
- package/dist/_virtual/~icons/app/solid-emblem.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevron-down.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevron-down.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/circle-user.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/circle-user.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/log-in.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/log-in.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/log-out.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/log-out.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/user.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/user.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -1
- package/dist/_virtual/~icons/svg-spinners/180-ring.cjs.js.map +1 -1
- package/dist/_virtual/~icons/svg-spinners/180-ring.esm.js.map +1 -1
- package/dist/_virtual/~icons/svg-spinners/3-dots-fade.cjs.js.map +1 -1
- package/dist/_virtual/~icons/svg-spinners/3-dots-fade.esm.js.map +1 -1
- package/dist/acl/access-controller.cjs.js.map +1 -1
- package/dist/acl/access-controller.esm.js.map +1 -1
- package/dist/acl/access-groups.cjs.js.map +1 -1
- package/dist/acl/access-groups.esm.js.map +1 -1
- package/dist/acl/acl-control.cjs.js.map +1 -1
- package/dist/acl/acl-control.esm.js.map +1 -1
- package/dist/acl/acl.cjs.js.map +1 -1
- package/dist/acl/acl.esm.js.map +1 -1
- package/dist/acl/add-agent-buttons.cjs.js.map +1 -1
- package/dist/acl/add-agent-buttons.esm.js.map +1 -1
- package/dist/acl/index.cjs.js.map +1 -1
- package/dist/acl/index.esm.js.map +1 -1
- package/dist/chat/bookmarks.cjs.js.map +1 -1
- package/dist/chat/bookmarks.esm.js.map +1 -1
- package/dist/chat/chatLogic.cjs.js.map +1 -1
- package/dist/chat/chatLogic.esm.js.map +1 -1
- package/dist/chat/dateFolder.cjs.js.map +1 -1
- package/dist/chat/dateFolder.esm.js.map +1 -1
- package/dist/chat/infinite.cjs.js.map +1 -1
- package/dist/chat/infinite.esm.js.map +1 -1
- package/dist/chat/keys.cjs.js.map +1 -1
- package/dist/chat/keys.esm.js.map +1 -1
- package/dist/chat/message.cjs.js.map +1 -1
- package/dist/chat/message.esm.js.map +1 -1
- package/dist/chat/messageTools.cjs.js.map +1 -1
- package/dist/chat/messageTools.esm.js.map +1 -1
- package/dist/chat/signature.cjs.js.map +1 -1
- package/dist/chat/signature.esm.js.map +1 -1
- package/dist/chunks/DialogProvider-BFllJFfq.js.map +1 -1
- package/dist/chunks/{account-CSKDoS_I.js → account-BawgTPEQ.js} +7 -7
- package/dist/chunks/account-BawgTPEQ.js.map +1 -0
- package/dist/chunks/{auth-YsyyEh_c.js → auth-DrN7Ex4E.js} +85 -81
- package/dist/chunks/auth-DrN7Ex4E.js.map +1 -0
- package/dist/chunks/{avatar-BXaBs_3q.js → avatar-CoxEa3ul.js} +2 -2
- package/dist/chunks/avatar-CoxEa3ul.js.map +1 -0
- package/dist/chunks/button-CnmrOsEf.js.map +1 -1
- package/dist/chunks/chevron-down-ujxRg3MD.js.map +1 -1
- package/dist/chunks/{chunk.64OG2H45-BFgXEuP7.js → chunk.UEBQI7VV-1WRlPl6u.js} +20 -3
- package/dist/chunks/chunk.UEBQI7VV-1WRlPl6u.js.map +1 -0
- package/dist/chunks/{combobox-D3eGdicW.js → combobox-B0TqOl9L.js} +3 -3
- package/dist/chunks/combobox-B0TqOl9L.js.map +1 -0
- package/dist/chunks/combobox-option-BcXpUnWu.js.map +1 -1
- package/dist/chunks/components-BHoVP7zE.js.map +1 -1
- package/dist/chunks/dialog-D9Ellvjx.js.map +1 -1
- package/dist/chunks/dialog-content-B2FmmQvH.js.map +1 -1
- package/dist/chunks/dialog-footer-CxjoqQJF.js.map +1 -1
- package/dist/chunks/dialog-header-0dobhr5C.js.map +1 -1
- package/dist/chunks/dialogs-D2n-R0lI.js.map +1 -1
- package/dist/chunks/dialogs-root-ngPW2Q6K.js.map +1 -1
- package/dist/chunks/{guard-BTbfcRR6.js → guard-BtHmPAJt.js} +2 -2
- package/dist/chunks/guard-BtHmPAJt.js.map +1 -0
- package/dist/chunks/{index.esm-C63HBmfn.js → index.esm-AZPmKqjU.js} +1535 -1188
- package/dist/chunks/index.esm-AZPmKqjU.js.map +1 -0
- package/dist/chunks/input-BIhn_8nf.js.map +1 -1
- package/dist/chunks/{jsonld-DrQpMD8o.js → jsonld-CDR2WyN_.js} +4 -4
- package/dist/chunks/jsonld-CDR2WyN_.js.map +1 -0
- package/dist/chunks/{login-button-DZb_CXCo.js → login-button-DAzbhvKk.js} +2 -2
- package/dist/chunks/login-button-DAzbhvKk.js.map +1 -0
- package/dist/chunks/{logout-button-CaD4ESfx.js → logout-button-lGJtt7lq.js} +2 -2
- package/dist/chunks/logout-button-lGJtt7lq.js.map +1 -0
- package/dist/chunks/{menu-BiqIAf-j.js → menu-BLZREG4_.js} +21 -13
- package/dist/chunks/menu-BLZREG4_.js.map +1 -0
- package/dist/chunks/menu-item-BdCkmJol.js.map +1 -1
- package/dist/chunks/photo-capture-Bvixtxsq.js.map +1 -1
- package/dist/chunks/photo-capture-modal-BhmL3kYD.js.map +1 -1
- package/dist/chunks/{provider-BZsO0FFR.js → provider-D5r57fK1.js} +2 -2
- package/dist/chunks/provider-D5r57fK1.js.map +1 -0
- package/dist/chunks/query-BYu9q8lA.js.map +1 -1
- package/dist/chunks/{rdf-form-C2zcf1F0.js → rdf-form-B2zTR8Qv.js} +21 -21
- package/dist/chunks/rdf-form-B2zTR8Qv.js.map +1 -0
- package/dist/chunks/{rdf-input-CiQNdkKK.js → rdf-input-DeDhyQ3p.js} +38 -38
- package/dist/chunks/rdf-input-DeDhyQ3p.js.map +1 -0
- package/dist/chunks/select-BcC-ICqO.js.map +1 -1
- package/dist/chunks/select-option-B0uXcj2O.js.map +1 -1
- package/dist/chunks/show-dialog-eEW5yRBv.js.map +1 -1
- package/dist/chunks/{signup-button-DufShSEV.js → signup-button-DnPnUTTm.js} +2 -2
- package/dist/chunks/signup-button-DnPnUTTm.js.map +1 -0
- package/dist/chunks/solid-emblem-CcQOqRX0.js.map +1 -1
- package/dist/chunks/{src-CbkVtLGQ.js → src-BWY65mD0.js} +5757 -5686
- package/dist/chunks/src-BWY65mD0.js.map +1 -0
- package/dist/chunks/{style-DI3buiHt.js → style-Dpwrc8CC.js} +4 -4
- package/dist/chunks/style-Dpwrc8CC.js.map +1 -0
- package/dist/components/account/Account.cjs.js.map +1 -1
- package/dist/components/account/Account.esm.js.map +1 -1
- package/dist/components/account/Account.styles.cjs.js.map +1 -1
- package/dist/components/account/Account.styles.esm.js.map +1 -1
- package/dist/components/account/index.cjs.js.map +1 -1
- package/dist/components/account/index.esm.js.map +1 -1
- package/dist/components/account.js +1 -1
- package/dist/components/avatar/Avatar.cjs.js.map +1 -1
- package/dist/components/avatar/Avatar.esm.js.map +1 -1
- package/dist/components/avatar/Avatar.styles.cjs.js.map +1 -1
- package/dist/components/avatar/Avatar.styles.esm.js.map +1 -1
- package/dist/components/avatar/index.cjs.js.map +1 -1
- package/dist/components/avatar/index.esm.js.map +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/button/Button.cjs.js.map +1 -1
- package/dist/components/button/Button.esm.js.map +1 -1
- package/dist/components/button/Button.styles.cjs.js.map +1 -1
- package/dist/components/button/Button.styles.esm.js.map +1 -1
- package/dist/components/button/index.cjs.js.map +1 -1
- package/dist/components/button/index.esm.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs.js.map +1 -1
- package/dist/components/combobox/Combobox.esm.js.map +1 -1
- package/dist/components/combobox/Combobox.styles.cjs.js +1 -1
- package/dist/components/combobox/Combobox.styles.cjs.js.map +1 -1
- package/dist/components/combobox/Combobox.styles.esm.js +1 -1
- package/dist/components/combobox/Combobox.styles.esm.js.map +1 -1
- package/dist/components/combobox/index.cjs.js.map +1 -1
- package/dist/components/combobox/index.esm.js.map +1 -1
- package/dist/components/combobox-option/ComboboxOption.cjs.js.map +1 -1
- package/dist/components/combobox-option/ComboboxOption.esm.js.map +1 -1
- package/dist/components/combobox-option/index.cjs.js.map +1 -1
- package/dist/components/combobox-option/index.esm.js.map +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/dialog/Dialog.cjs.js.map +1 -1
- package/dist/components/dialog/Dialog.esm.js.map +1 -1
- package/dist/components/dialog/Dialog.styles.cjs.js.map +1 -1
- package/dist/components/dialog/Dialog.styles.esm.js.map +1 -1
- package/dist/components/dialog/index.cjs.js.map +1 -1
- package/dist/components/dialog/index.esm.js.map +1 -1
- package/dist/components/dialog-content/DialogContent.cjs.js.map +1 -1
- package/dist/components/dialog-content/DialogContent.esm.js.map +1 -1
- package/dist/components/dialog-content/DialogContent.styles.cjs.js.map +1 -1
- package/dist/components/dialog-content/DialogContent.styles.esm.js.map +1 -1
- package/dist/components/dialog-content/index.cjs.js.map +1 -1
- package/dist/components/dialog-content/index.esm.js.map +1 -1
- package/dist/components/dialog-footer/DialogFooter.cjs.js.map +1 -1
- package/dist/components/dialog-footer/DialogFooter.esm.js.map +1 -1
- package/dist/components/dialog-footer/DialogFooter.styles.cjs.js.map +1 -1
- package/dist/components/dialog-footer/DialogFooter.styles.esm.js.map +1 -1
- package/dist/components/dialog-footer/index.cjs.js.map +1 -1
- package/dist/components/dialog-footer/index.esm.js.map +1 -1
- package/dist/components/dialog-header/DialogHeader.cjs.js.map +1 -1
- package/dist/components/dialog-header/DialogHeader.esm.js.map +1 -1
- package/dist/components/dialog-header/DialogHeader.styles.cjs.js.map +1 -1
- package/dist/components/dialog-header/DialogHeader.styles.esm.js.map +1 -1
- package/dist/components/dialog-header/index.cjs.js.map +1 -1
- package/dist/components/dialog-header/index.esm.js.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.cjs.js.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.esm.js.map +1 -1
- package/dist/components/dialog-provider/index.cjs.js.map +1 -1
- package/dist/components/dialog-provider/index.esm.js.map +1 -1
- package/dist/components/dialog-provider.js.map +1 -1
- package/dist/components/dialogs-root/DialogsRoot.cjs.js.map +1 -1
- package/dist/components/dialogs-root/DialogsRoot.esm.js.map +1 -1
- package/dist/components/dialogs-root/index.cjs.js.map +1 -1
- package/dist/components/dialogs-root/index.esm.js.map +1 -1
- package/dist/components/guard/Guard.cjs.js.map +1 -1
- package/dist/components/guard/Guard.esm.js.map +1 -1
- package/dist/components/guard/index.cjs.js.map +1 -1
- package/dist/components/guard/index.esm.js.map +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/input/Input.cjs.js.map +1 -1
- package/dist/components/input/Input.esm.js.map +1 -1
- package/dist/components/input/Input.styles.cjs.js.map +1 -1
- package/dist/components/input/Input.styles.esm.js.map +1 -1
- package/dist/components/input/index.cjs.js.map +1 -1
- package/dist/components/input/index.esm.js.map +1 -1
- package/dist/components/login-button/LoginButton.cjs.js.map +1 -1
- package/dist/components/login-button/LoginButton.esm.js.map +1 -1
- package/dist/components/login-button/index.cjs.js.map +1 -1
- package/dist/components/login-button/index.esm.js.map +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.cjs.js.map +1 -1
- package/dist/components/login-modal/LoginModal.d.ts.map +1 -1
- package/dist/components/login-modal/LoginModal.esm.js +1 -1
- package/dist/components/login-modal/LoginModal.esm.js.map +1 -1
- package/dist/components/login-modal/LoginModal.styles.cjs.js.map +1 -1
- package/dist/components/login-modal/LoginModal.styles.esm.js.map +1 -1
- package/dist/components/login-modal/index.cjs.js.map +1 -1
- package/dist/components/login-modal/index.esm.js.map +1 -1
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button/LogoutButton.cjs.js.map +1 -1
- package/dist/components/logout-button/LogoutButton.esm.js.map +1 -1
- package/dist/components/logout-button/index.cjs.js.map +1 -1
- package/dist/components/logout-button/index.esm.js.map +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/Menu.styles.cjs.js.map +1 -1
- package/dist/components/menu/Menu.styles.esm.js.map +1 -1
- package/dist/components/menu/index.cjs.js.map +1 -1
- package/dist/components/menu/index.esm.js.map +1 -1
- package/dist/components/menu-item/MenuItem.cjs.js.map +1 -1
- package/dist/components/menu-item/MenuItem.esm.js.map +1 -1
- package/dist/components/menu-item/MenuItem.styles.cjs.js.map +1 -1
- package/dist/components/menu-item/MenuItem.styles.esm.js.map +1 -1
- package/dist/components/menu-item/index.cjs.js.map +1 -1
- package/dist/components/menu-item/index.esm.js.map +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/photo-capture/PhotoCapture.cjs.js.map +1 -1
- package/dist/components/photo-capture/PhotoCapture.esm.js.map +1 -1
- package/dist/components/photo-capture/index.cjs.js.map +1 -1
- package/dist/components/photo-capture/index.esm.js.map +1 -1
- package/dist/components/photo-capture-modal/PhotoCaptureModal.cjs.js.map +1 -1
- package/dist/components/photo-capture-modal/PhotoCaptureModal.esm.js.map +1 -1
- package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.cjs.js.map +1 -1
- package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.esm.js.map +1 -1
- package/dist/components/photo-capture-modal/index.cjs.js.map +1 -1
- package/dist/components/photo-capture-modal/index.esm.js.map +1 -1
- package/dist/components/provider/Provider.cjs.js.map +1 -1
- package/dist/components/provider/Provider.esm.js.map +1 -1
- package/dist/components/provider/index.cjs.js.map +1 -1
- package/dist/components/provider/index.esm.js.map +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/rdf-form/RDFForm.cjs.js +1 -1
- package/dist/components/rdf-form/RDFForm.cjs.js.map +1 -1
- package/dist/components/rdf-form/RDFForm.esm.js +1 -1
- package/dist/components/rdf-form/RDFForm.esm.js.map +1 -1
- package/dist/components/rdf-form/index.cjs.js.map +1 -1
- package/dist/components/rdf-form/index.esm.js.map +1 -1
- package/dist/components/rdf-form.js +1 -1
- package/dist/components/rdf-input/RDFInput.cjs.js.map +1 -1
- package/dist/components/rdf-input/RDFInput.esm.js.map +1 -1
- package/dist/components/rdf-input/index.cjs.js.map +1 -1
- package/dist/components/rdf-input/index.esm.js.map +1 -1
- package/dist/components/rdf-input.js +1 -1
- package/dist/components/select/Select.cjs.js.map +1 -1
- package/dist/components/select/Select.esm.js.map +1 -1
- package/dist/components/select/Select.styles.cjs.js.map +1 -1
- package/dist/components/select/Select.styles.esm.js.map +1 -1
- package/dist/components/select/index.cjs.js.map +1 -1
- package/dist/components/select/index.esm.js.map +1 -1
- package/dist/components/select-option/SelectOption.cjs.js.map +1 -1
- package/dist/components/select-option/SelectOption.esm.js.map +1 -1
- package/dist/components/select-option/index.cjs.js.map +1 -1
- package/dist/components/select-option/index.esm.js.map +1 -1
- package/dist/components/signup-button/SignupButton.cjs.js.map +1 -1
- package/dist/components/signup-button/SignupButton.esm.js.map +1 -1
- package/dist/components/signup-button/index.cjs.js.map +1 -1
- package/dist/components/signup-button/index.esm.js.map +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components/solid-emblem/SolidEmblem.cjs.js.map +1 -1
- package/dist/components/solid-emblem/SolidEmblem.esm.js.map +1 -1
- package/dist/components/solid-emblem/SolidEmblem.styles.cjs.js.map +1 -1
- package/dist/components/solid-emblem/SolidEmblem.styles.esm.js.map +1 -1
- package/dist/components/solid-emblem/index.cjs.js.map +1 -1
- package/dist/components/solid-emblem/index.esm.js.map +1 -1
- package/dist/components.js +12 -12
- package/dist/create/create.cjs.js.map +1 -1
- package/dist/create/create.esm.js.map +1 -1
- package/dist/create/index.cjs.js.map +1 -1
- package/dist/create/index.esm.js.map +1 -1
- package/dist/create/types.cjs.js.map +1 -1
- package/dist/create/types.esm.js.map +1 -1
- package/dist/footer/index.cjs.js.map +1 -1
- package/dist/footer/index.esm.js.map +1 -1
- package/dist/header/empty-profile.cjs.js.map +1 -1
- package/dist/header/empty-profile.esm.js.map +1 -1
- package/dist/header/index.cjs.js.map +1 -1
- package/dist/header/index.esm.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/auth/Account.cjs.js.map +1 -1
- package/dist/lib/auth/Account.esm.js.map +1 -1
- package/dist/lib/auth/NoopAuth.cjs.js.map +1 -1
- package/dist/lib/auth/NoopAuth.esm.js.map +1 -1
- package/dist/lib/auth/SolidAuth.cjs.js +1 -1
- package/dist/lib/auth/SolidAuth.cjs.js.map +1 -1
- package/dist/lib/auth/SolidAuth.d.ts.map +1 -1
- package/dist/lib/auth/SolidAuth.esm.js +15 -11
- package/dist/lib/auth/SolidAuth.esm.js.map +1 -1
- package/dist/lib/auth/context.cjs.js.map +1 -1
- package/dist/lib/auth/context.esm.js.map +1 -1
- package/dist/lib/code-editor/CodeEditor.cjs.js.map +1 -1
- package/dist/lib/code-editor/CodeEditor.esm.js.map +1 -1
- package/dist/lib/components/decorators.cjs.js.map +1 -1
- package/dist/lib/components/decorators.esm.js.map +1 -1
- package/dist/lib/components/dialog-component/DialogComponent.cjs.js.map +1 -1
- package/dist/lib/components/dialog-component/DialogComponent.esm.js.map +1 -1
- package/dist/lib/components/form-control-component/FormControlComponent.cjs.js.map +1 -1
- package/dist/lib/components/form-control-component/FormControlComponent.esm.js.map +1 -1
- package/dist/lib/components/ids.cjs.js.map +1 -1
- package/dist/lib/components/ids.esm.js.map +1 -1
- package/dist/lib/components/traits/DialogTrait.cjs.js.map +1 -1
- package/dist/lib/components/traits/DialogTrait.esm.js.map +1 -1
- package/dist/lib/components/traits/FormControlTrait.cjs.js.map +1 -1
- package/dist/lib/components/traits/FormControlTrait.esm.js.map +1 -1
- package/dist/lib/components/web-component/WebComponent.cjs.js.map +1 -1
- package/dist/lib/components/web-component/WebComponent.esm.js.map +1 -1
- package/dist/lib/components/web-component/WebComponent.styles.cjs.js.map +1 -1
- package/dist/lib/components/web-component/WebComponent.styles.esm.js.map +1 -1
- package/dist/lib/debug.cjs.js.map +1 -1
- package/dist/lib/debug.esm.js.map +1 -1
- package/dist/lib/dialogs/Dialog.cjs.js.map +1 -1
- package/dist/lib/dialogs/Dialog.esm.js.map +1 -1
- package/dist/lib/dialogs/context.cjs.js.map +1 -1
- package/dist/lib/dialogs/context.esm.js.map +1 -1
- package/dist/lib/dialogs/events/close-dialog.cjs.js.map +1 -1
- package/dist/lib/dialogs/events/close-dialog.esm.js.map +1 -1
- package/dist/lib/dialogs/events/show-dialog.cjs.js.map +1 -1
- package/dist/lib/dialogs/events/show-dialog.esm.js.map +1 -1
- package/dist/lib/dialogs/helpers.cjs.js.map +1 -1
- package/dist/lib/dialogs/helpers.esm.js.map +1 -1
- package/dist/lib/file-explorer/context.cjs.js.map +1 -1
- package/dist/lib/file-explorer/context.esm.js.map +1 -1
- package/dist/lib/forms/fieldParams.cjs.js.map +1 -1
- package/dist/lib/forms/fieldParams.esm.js.map +1 -1
- package/dist/lib/forms/rdfFormsHelper.cjs.js.map +1 -1
- package/dist/lib/forms/rdfFormsHelper.esm.js.map +1 -1
- package/dist/lib/forms/store/NoopStore.cjs.js.map +1 -1
- package/dist/lib/forms/store/NoopStore.esm.js.map +1 -1
- package/dist/lib/forms/store/StoreContext.cjs.js.map +1 -1
- package/dist/lib/forms/store/StoreContext.esm.js.map +1 -1
- package/dist/lib/iconBase.cjs.js.map +1 -1
- package/dist/lib/iconBase.esm.js.map +1 -1
- package/dist/lib/log.cjs.js.map +1 -1
- package/dist/lib/log.esm.js.map +1 -1
- package/dist/lib/messageArea.cjs.js.map +1 -1
- package/dist/lib/messageArea.esm.js.map +1 -1
- package/dist/lib/newperson.cjs.js.map +1 -1
- package/dist/lib/newperson.esm.js.map +1 -1
- package/dist/lib/ns.cjs.js.map +1 -1
- package/dist/lib/ns.esm.js.map +1 -1
- package/dist/lib/pad.cjs.js.map +1 -1
- package/dist/lib/pad.esm.js.map +1 -1
- package/dist/lib/participation.cjs.js.map +1 -1
- package/dist/lib/participation.esm.js.map +1 -1
- package/dist/lib/preferences.cjs.js.map +1 -1
- package/dist/lib/preferences.esm.js.map +1 -1
- package/dist/lib/style.cjs.js.map +1 -1
- package/dist/lib/style.esm.js.map +1 -1
- package/dist/lib/styleConstants.cjs.js.map +1 -1
- package/dist/lib/styleConstants.esm.js.map +1 -1
- package/dist/lib/style_multiSelect.cjs.js.map +1 -1
- package/dist/lib/style_multiSelect.esm.js.map +1 -1
- package/dist/lib/table.cjs.js +1 -1
- package/dist/lib/table.cjs.js.map +1 -1
- package/dist/lib/table.esm.js +2 -2
- 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 +1 -1
- package/dist/lib/tabs.esm.js.map +1 -1
- package/dist/lib/timing.cjs.js.map +1 -1
- package/dist/lib/timing.esm.js.map +1 -1
- package/dist/lib/values.cjs.js.map +1 -1
- package/dist/lib/values.esm.js.map +1 -1
- package/dist/loader.js +4 -4
- package/dist/login/login.cjs.js +1 -1
- package/dist/login/login.cjs.js.map +1 -1
- package/dist/login/login.esm.js +1 -1
- package/dist/login/login.esm.js.map +1 -1
- package/dist/matrix/index.cjs.js.map +1 -1
- package/dist/matrix/index.esm.js.map +1 -1
- package/dist/matrix/matrix.cjs.js.map +1 -1
- package/dist/matrix/matrix.esm.js.map +1 -1
- package/dist/media/index.cjs.js.map +1 -1
- package/dist/media/index.esm.js.map +1 -1
- package/dist/media/media-capture.cjs.js.map +1 -1
- package/dist/media/media-capture.esm.js.map +1 -1
- package/dist/signup/config-default.cjs.js.map +1 -1
- package/dist/signup/config-default.esm.js.map +1 -1
- package/dist/signup/signup.cjs.js.map +1 -1
- package/dist/signup/signup.esm.js.map +1 -1
- package/dist/solid-ui.js +50 -50
- package/dist/solid-ui.min.js +50 -50
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/utils/headerFooterHelpers.cjs.js.map +1 -1
- package/dist/utils/headerFooterHelpers.esm.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 +2 -2
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/keyHelpers/accessData.cjs.js.map +1 -1
- package/dist/utils/keyHelpers/accessData.esm.js.map +1 -1
- package/dist/utils/keyHelpers/acl.cjs.js.map +1 -1
- package/dist/utils/keyHelpers/acl.esm.js.map +1 -1
- package/dist/utils/keyHelpers/otherHelpers.cjs.js.map +1 -1
- package/dist/utils/keyHelpers/otherHelpers.esm.js.map +1 -1
- package/dist/utils/label.cjs.js.map +1 -1
- package/dist/utils/label.esm.js.map +1 -1
- package/dist/v2/components/auth/loginButton/LoginButton.d.ts.map +1 -1
- package/dist/widgets/buttons/iconLinks.cjs.js.map +1 -1
- package/dist/widgets/buttons/iconLinks.esm.js.map +1 -1
- package/dist/widgets/buttons.cjs.js.map +1 -1
- package/dist/widgets/buttons.esm.js.map +1 -1
- package/dist/widgets/dragAndDrop.cjs.js +1 -1
- package/dist/widgets/dragAndDrop.cjs.js.map +1 -1
- package/dist/widgets/dragAndDrop.esm.js +22 -18
- package/dist/widgets/dragAndDrop.esm.js.map +1 -1
- package/dist/widgets/error.cjs.js.map +1 -1
- package/dist/widgets/error.esm.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteBar.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteBar.esm.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompleteField.esm.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/autocompletePicker.esm.js.map +1 -1
- package/dist/widgets/forms/autocomplete/language.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/language.esm.js.map +1 -1
- package/dist/widgets/forms/autocomplete/publicData.cjs.js.map +1 -1
- package/dist/widgets/forms/autocomplete/publicData.esm.js.map +1 -1
- package/dist/widgets/forms/basic.cjs.js.map +1 -1
- package/dist/widgets/forms/basic.esm.js.map +1 -1
- package/dist/widgets/forms/fieldFunction.cjs.js.map +1 -1
- package/dist/widgets/forms/fieldFunction.esm.js.map +1 -1
- package/dist/widgets/forms/fieldParams.cjs.js.map +1 -1
- package/dist/widgets/forms/fieldParams.esm.js.map +1 -1
- package/dist/widgets/forms/formStyle.cjs.js.map +1 -1
- package/dist/widgets/forms/formStyle.esm.js.map +1 -1
- package/dist/widgets/forms.cjs.js +2 -2
- package/dist/widgets/forms.cjs.js.map +1 -1
- package/dist/widgets/forms.esm.js +4 -4
- package/dist/widgets/forms.esm.js.map +1 -1
- package/dist/widgets/index.cjs.js.map +1 -1
- package/dist/widgets/index.esm.js.map +1 -1
- package/dist/widgets/multiSelect.cjs.js.map +1 -1
- package/dist/widgets/multiSelect.esm.js.map +1 -1
- package/dist/widgets/peoplePicker.cjs.js.map +1 -1
- package/dist/widgets/peoplePicker.esm.js.map +1 -1
- package/dist/widgets/widgetHelpers.cjs.js.map +1 -1
- package/dist/widgets/widgetHelpers.esm.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunks/account-CSKDoS_I.js.map +0 -1
- package/dist/chunks/auth-YsyyEh_c.js.map +0 -1
- package/dist/chunks/avatar-BXaBs_3q.js.map +0 -1
- package/dist/chunks/chunk.64OG2H45-BFgXEuP7.js.map +0 -1
- package/dist/chunks/combobox-D3eGdicW.js.map +0 -1
- package/dist/chunks/guard-BTbfcRR6.js.map +0 -1
- package/dist/chunks/index.esm-C63HBmfn.js.map +0 -1
- package/dist/chunks/jsonld-DrQpMD8o.js.map +0 -1
- package/dist/chunks/login-button-DZb_CXCo.js.map +0 -1
- package/dist/chunks/logout-button-CaD4ESfx.js.map +0 -1
- package/dist/chunks/menu-BiqIAf-j.js.map +0 -1
- package/dist/chunks/provider-BZsO0FFR.js.map +0 -1
- package/dist/chunks/rdf-form-C2zcf1F0.js.map +0 -1
- package/dist/chunks/rdf-input-CiQNdkKK.js.map +0 -1
- package/dist/chunks/signup-button-DufShSEV.js.map +0 -1
- package/dist/chunks/src-CbkVtLGQ.js.map +0 -1
- package/dist/chunks/style-DI3buiHt.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.esm.js","names":[],"sources":["../../src/create/create.ts"],"sourcesContent":["/* create.js UI to craete new objects in the solid-app-set world\n **\n */\n\nimport { DataBrowserContext, NewPaneOptions, PaneDefinition } from 'pane-registry'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as debug from '../lib/debug'\nimport { icons } from '../lib/iconBase'\nimport { ensureLoadedProfile, selectWorkspace } from '../login/login'\nimport ns from '../lib/ns'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { CreateContext, NewAppInstanceOptions } from './types'\n\nconst kb = solidLogicSingleton.store\n\n/* newThingUI -- return UI for user to select a new object, folder, etc\n **\n ** context must include: dom, div,\n ** optional: folder: NamedNode -- the folder where the thing is bring put\n ** (suppresses asking for a full URI or workspace)\n **\n */\nexport function newThingUI (\n createContext: CreateContext,\n dataBrowserContext: DataBrowserContext,\n thePanes: Array<PaneDefinition>\n): void {\n const dom = createContext.dom\n const div = createContext.div\n if (createContext.me && !createContext.me.uri) {\n throw new Error('newThingUI: Invalid userid: ' + createContext.me)\n }\n\n const iconStyle = 'padding: 0.7em; width: 2em; height: 2em;' // was: 'padding: 1em; width: 3em; height: 3em;'\n const star = div.appendChild(dom.createElement('img'))\n let visible = false // the inividual tools tools\n // noun_272948.svg = black star\n // noun_34653_green.svg = green plus\n star.setAttribute('src', icons.iconBase + 'noun_34653_green.svg')\n star.setAttribute('style', iconStyle)\n star.setAttribute('title', 'Add another tool')\n\n const complain = function complain (message) {\n const pre = div.appendChild(dom.createElement('pre'))\n pre.setAttribute('style', 'background-color: pink')\n pre.appendChild(dom.createTextNode(message))\n }\n\n function styleTheIcons (style) {\n for (let i = 0; i < iconArray.length; i++) {\n let st = iconStyle + style\n if (iconArray[i].disabled) {\n // @@ unused\n st += 'opacity: 0.3;'\n }\n iconArray[i].setAttribute('style', st) // eg 'background-color: #ccc;'\n }\n }\n\n function selectTool (icon) {\n styleTheIcons('display: none;') // 'background-color: #ccc;'\n icon.setAttribute('style', iconStyle + 'background-color: yellow;')\n }\n\n function selectNewTool (_event?) {\n visible = !visible\n star.setAttribute(\n 'style',\n iconStyle + (visible ? 'background-color: yellow;' : '')\n )\n styleTheIcons(visible ? '' : 'display: none;')\n }\n\n star.addEventListener('click', selectNewTool)\n\n function makeNewAppInstance (options: NewAppInstanceOptions) {\n return new Promise(function (resolve, reject) {\n let selectUI // , selectUIParent\n function callbackWS (ws, newBase) {\n ensureLoadedProfile(createContext).then(\n _context => {\n const newPaneOptions: NewPaneOptions = Object.assign({\n newBase,\n folder: options.folder || undefined,\n workspace: ws\n }, options)\n for (const opt in options) {\n // get div, dom, me, folder, pane, refreshTable\n newPaneOptions[opt] = options[opt]\n }\n debug.log(`newThingUI: Minting new ${newPaneOptions.pane.name} at ${newPaneOptions.newBase}`)\n options.pane\n .mintNew!(dataBrowserContext, newPaneOptions)\n .then(function (newPaneOptions) {\n if (!newPaneOptions || !newPaneOptions.newInstance) {\n throw new Error('Cannot mint new - missing newInstance')\n }\n if (newPaneOptions.folder) {\n const tail = newPaneOptions.newInstance.uri.slice(\n newPaneOptions.folder.uri.length\n )\n const isPackage = tail.includes('/')\n debug.log(' new thing is packge? ' + isPackage)\n if (isPackage) {\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n kb.sym(newPaneOptions.newBase),\n newPaneOptions.folder.doc()\n )\n } else {\n // single file\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n newPaneOptions.newInstance,\n newPaneOptions.folder.doc()\n ) // Ping the patch system?\n }\n // @ts-ignore @@ TODO check whether refresh can exist here. Either fix type or remove unreachable code\n if (newPaneOptions.refreshTarget && newPaneOptions.refreshTarget.refresh) {\n // @@ TODO Remove the need to cast as any\n ;(newPaneOptions.refreshTarget as any).refresh() // Refresh the containing display\n }\n // selectUI.parentNode.removeChild(selectUI) It removes itself\n } else {\n const p = options.div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 120%;')\n // Make link to new thing\n p.innerHTML =\n 'Your <a target=\\'_blank\\' href=\\'' +\n newPaneOptions.newInstance.uri +\n '\\'><b>new ' +\n options.noun +\n '</b></a> is ready to be set up. ' +\n '<br/><br/><a target=\\'_blank\\' href=\\'' +\n newPaneOptions.newInstance.uri +\n '\\'>Go to your new ' +\n options.noun +\n '.</a>'\n // selectUI.parentNode.removeChild(selectUI) // Clean up\n // selectUIParent.removeChild(selectUI) // Clean up\n }\n selectNewTool() // toggle star to plain and menu vanish again\n })\n .catch(function (err) {\n complain(err)\n reject(err)\n })\n },\n err => {\n // login fails\n complain('Error logging on: ' + err)\n }\n )\n } // callbackWS\n\n const pa = options.pane\n // options.appPathSegment = pa.name // was 'edu.mit.solid.pane.'\n options.noun = pa.mintClass ? utils.label(pa.mintClass) : pa.name\n options.appPathSegment = options.noun.slice(0, 1).toUpperCase() + options.noun.slice(1)\n\n if (!options.folder) {\n // No folder given? Ask user for full URI\n selectUI = selectWorkspace(dom, {\n noun: options.noun,\n appPathSegment: options.appPathSegment\n }, callbackWS)\n options.div.appendChild(selectUI)\n // selectUIParent = options.div\n } else {\n const gotName = function (name) {\n if (!name) {\n // selectUIParent.removeChild(selectUI) itremves itself if cancelled\n selectNewTool() // toggle star to plain and menu vanish again\n } else {\n let uri = options.folder!.uri\n if (!uri.endsWith('/')) {\n uri = uri + '/'\n }\n uri = uri + encodeURIComponent(name) + '/'\n callbackWS(null, uri)\n }\n }\n widgets\n .askName(\n dom,\n kb,\n options.div,\n ns.foaf('name'),\n null,\n options.noun\n )\n .then(gotName)\n // selectUI = getNameForm(dom, kb, options.noun, gotName)\n // options.div.appendChild(selectUI)\n // selectUIParent = options.div\n }\n })\n } // makeNewAppInstance\n\n const iconArray: Array<any> = []\n const mintingPanes = Object.values(thePanes).filter(pane => pane.mintNew)\n const mintingClassMap = mintingPanes.reduce((classMap, pane) => {\n if (pane.mintClass) {\n classMap[pane.mintClass.uri] = (classMap[pane.mintClass.uri] || 0) + 1\n }\n return classMap\n }, {})\n mintingPanes.forEach(pane => {\n // @@ TODO Remove the need to cast to any\n const icon: any = createContext.div.appendChild(dom.createElement('img'))\n icon.setAttribute('src', pane.icon)\n const noun = pane.mintClass\n ? mintingClassMap[pane.mintClass.uri] > 1\n ? `${utils.label(pane.mintClass)} (using ${pane.name} pane)`\n : utils.label(pane.mintClass)\n : pane.name + ' @@'\n icon.setAttribute('title', 'Make new ' + noun)\n icon.setAttribute('style', iconStyle + 'display: none;')\n iconArray.push(icon)\n if (!icon.disabled) {\n icon.addEventListener('click', function (e) {\n selectTool(icon)\n makeNewAppInstance({\n event: e,\n folder: createContext.folder || null,\n iconEle: icon,\n pane,\n noun,\n noIndexHTML: true, // do NOT @@ for now write a HTML file\n div: createContext.div,\n me: createContext.me,\n dom: createContext.dom,\n refreshTarget: createContext.refreshTarget\n })\n })\n }\n })\n}\n\n// Form to get the name of a new thing before we create it\n//\n// Used in contacts for new groups, individuals.\n//\n/*\nfunction getNameForm (dom, kb, classLabel, gotNameCallback) {\n const form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error\n form.innerHTML = '<p>Name of new ' + classLabel + ':</p>'\n const namefield = dom.createElement('input')\n namefield.setAttribute('type', 'text')\n namefield.setAttribute('size', '30')\n namefield.setAttribute('style', style.textInputStyle)\n namefield.setAttribute('maxLength', '2048') // No arbitrary limits\n namefield.select() // focus next user input\n\n const gotName = function () {\n namefield.setAttribute('class', 'pendingedit')\n namefield.disabled = true\n continueButton.disabled = true\n cancel.disabled = true\n gotNameCallback(true, namefield.value)\n }\n\n namefield.addEventListener('keyup', function (e) {\n if (e.keyCode === 13) {\n gotName()\n }\n }, false)\n form.appendChild(namefield)\n\n form.appendChild(dom.createElement('br'))\n\n const cancel = form.appendChild(widgets.cancelButton(dom))\n cancel.addEventListener('click', function (e) {\n form.parentNode.removeChild(form)\n gotNameCallback(false)\n }, false)\n\n const continueButton = form.appendChild(widgets.continueButton(dom))\n continueButton.addEventListener('click', function (e) {\n gotName()\n }, false)\n\n return form\n}\n*/\n"],"mappings":";;;;;;;;;;AAcA,IAAM,IAAK,EAAoB;AAS/B,SAAgB,EACd,GACA,GACA,GACM;CACN,IAAM,IAAM,EAAc,KACpB,IAAM,EAAc;CAC1B,IAAI,EAAc,MAAM,CAAC,EAAc,GAAG,KACxC,MAAU,MAAM,kCAAkC,EAAc,EAAE;CAGpE,IAAM,IAAY,4CACZ,IAAO,EAAI,YAAY,EAAI,cAAc,KAAK,CAAC,GACjD,IAAU;CAKd,AAFA,EAAK,aAAa,OAAO,EAAM,WAAW,sBAAsB,GAChE,EAAK,aAAa,SAAS,CAAS,GACpC,EAAK,aAAa,SAAS,kBAAkB;CAE7C,IAAM,IAAW,SAAmB,GAAS;EAC3C,IAAM,IAAM,EAAI,YAAY,EAAI,cAAc,KAAK,CAAC;EAEpD,AADA,EAAI,aAAa,SAAS,wBAAwB,GAClD,EAAI,YAAY,EAAI,eAAe,CAAO,CAAC;CAC7C;CAEA,SAAS,EAAe,GAAO;EAC7B,KAAK,IAAI,IAAI,GAAG,IAAI,EAAU,QAAQ,KAAK;GACzC,IAAI,IAAK,IAAY;GAKrB,AAJI,EAAU,EAAE,CAAC,aAEf,KAAM,kBAER,EAAU,EAAE,CAAC,aAAa,SAAS,CAAE;EACvC;CACF;CAEA,SAAS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B,IAAM,IAAY,EAAc,IAAI,YAAY,EAAI,cAAc,KAAK,CAAC;EACxE,EAAK,aAAa,OAAO,EAAK,IAAI;EAClC,IAAM,IAAO,EAAK,YACd,EAAgB,EAAK,UAAU,OAAO,IACpC,GAAG,EAAY,EAAK,SAAS,EAAE,UAAU,EAAK,KAAK,UACnD,EAAY,EAAK,SAAS,IAC5B,EAAK,OAAO;EAIhB,AAHA,EAAK,aAAa,SAAS,cAAc,CAAI,GAC7C,EAAK,aAAa,SAAS,IAAY,gBAAgB,GACvD,EAAU,KAAK,CAAI,GACd,EAAK,YACR,EAAK,iBAAiB,SAAS,SAAU,GAAG;GAE1C,AADA,EAAW,CAAI,GACf,EAAmB;IACjB,OAAO;IACP,QAAQ,EAAc,UAAU;IAChC,SAAS;IACT;IACA;IACA,aAAa;IACb,KAAK,EAAc;IACnB,IAAI,EAAc;IAClB,KAAK,EAAc;IACnB,eAAe,EAAc;GAC/B,CAAC;EACH,CAAC;CAEL,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"create.esm.js","names":["ns","utils.label","ns_default","kb","solidLogicSingleton","newThingUI","dom","createContext","div","iconStyle","star","visible","icons","complain","pre","message","styleTheIcons","i","iconArray","st","style","selectTool","icon","selectNewTool","makeNewAppInstance","selectUI","callbackWS","newPaneOptions","options","ws","opt","log","dataBrowserContext","isPackage","p","err","reject","pa","label","askName","name","uri","selectWorkspace","mintingPanes","thePanes","pane","mintingClassMap","classMap","noun","e"],"sources":["../../src/create/create.ts"],"sourcesContent":["/* create.js UI to craete new objects in the solid-app-set world\n **\n */\n\nimport { DataBrowserContext, NewPaneOptions, PaneDefinition } from 'pane-registry'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as debug from '../lib/debug'\nimport { icons } from '../lib/iconBase'\nimport { ensureLoadedProfile, selectWorkspace } from '../login/login'\nimport ns from '../lib/ns'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { CreateContext, NewAppInstanceOptions } from './types'\n\nconst kb = solidLogicSingleton.store\n\n/* newThingUI -- return UI for user to select a new object, folder, etc\n **\n ** context must include: dom, div,\n ** optional: folder: NamedNode -- the folder where the thing is bring put\n ** (suppresses asking for a full URI or workspace)\n **\n */\nexport function newThingUI (\n createContext: CreateContext,\n dataBrowserContext: DataBrowserContext,\n thePanes: Array<PaneDefinition>\n): void {\n const dom = createContext.dom\n const div = createContext.div\n if (createContext.me && !createContext.me.uri) {\n throw new Error('newThingUI: Invalid userid: ' + createContext.me)\n }\n\n const iconStyle = 'padding: 0.7em; width: 2em; height: 2em;' // was: 'padding: 1em; width: 3em; height: 3em;'\n const star = div.appendChild(dom.createElement('img'))\n let visible = false // the inividual tools tools\n // noun_272948.svg = black star\n // noun_34653_green.svg = green plus\n star.setAttribute('src', icons.iconBase + 'noun_34653_green.svg')\n star.setAttribute('style', iconStyle)\n star.setAttribute('title', 'Add another tool')\n\n const complain = function complain (message) {\n const pre = div.appendChild(dom.createElement('pre'))\n pre.setAttribute('style', 'background-color: pink')\n pre.appendChild(dom.createTextNode(message))\n }\n\n function styleTheIcons (style) {\n for (let i = 0; i < iconArray.length; i++) {\n let st = iconStyle + style\n if (iconArray[i].disabled) {\n // @@ unused\n st += 'opacity: 0.3;'\n }\n iconArray[i].setAttribute('style', st) // eg 'background-color: #ccc;'\n }\n }\n\n function selectTool (icon) {\n styleTheIcons('display: none;') // 'background-color: #ccc;'\n icon.setAttribute('style', iconStyle + 'background-color: yellow;')\n }\n\n function selectNewTool (_event?) {\n visible = !visible\n star.setAttribute(\n 'style',\n iconStyle + (visible ? 'background-color: yellow;' : '')\n )\n styleTheIcons(visible ? '' : 'display: none;')\n }\n\n star.addEventListener('click', selectNewTool)\n\n function makeNewAppInstance (options: NewAppInstanceOptions) {\n return new Promise(function (resolve, reject) {\n let selectUI // , selectUIParent\n function callbackWS (ws, newBase) {\n ensureLoadedProfile(createContext).then(\n _context => {\n const newPaneOptions: NewPaneOptions = Object.assign({\n newBase,\n folder: options.folder || undefined,\n workspace: ws\n }, options)\n for (const opt in options) {\n // get div, dom, me, folder, pane, refreshTable\n newPaneOptions[opt] = options[opt]\n }\n debug.log(`newThingUI: Minting new ${newPaneOptions.pane.name} at ${newPaneOptions.newBase}`)\n options.pane\n .mintNew!(dataBrowserContext, newPaneOptions)\n .then(function (newPaneOptions) {\n if (!newPaneOptions || !newPaneOptions.newInstance) {\n throw new Error('Cannot mint new - missing newInstance')\n }\n if (newPaneOptions.folder) {\n const tail = newPaneOptions.newInstance.uri.slice(\n newPaneOptions.folder.uri.length\n )\n const isPackage = tail.includes('/')\n debug.log(' new thing is packge? ' + isPackage)\n if (isPackage) {\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n kb.sym(newPaneOptions.newBase),\n newPaneOptions.folder.doc()\n )\n } else {\n // single file\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n newPaneOptions.newInstance,\n newPaneOptions.folder.doc()\n ) // Ping the patch system?\n }\n // @ts-ignore @@ TODO check whether refresh can exist here. Either fix type or remove unreachable code\n if (newPaneOptions.refreshTarget && newPaneOptions.refreshTarget.refresh) {\n // @@ TODO Remove the need to cast as any\n ;(newPaneOptions.refreshTarget as any).refresh() // Refresh the containing display\n }\n // selectUI.parentNode.removeChild(selectUI) It removes itself\n } else {\n const p = options.div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 120%;')\n // Make link to new thing\n p.innerHTML =\n 'Your <a target=\\'_blank\\' href=\\'' +\n newPaneOptions.newInstance.uri +\n '\\'><b>new ' +\n options.noun +\n '</b></a> is ready to be set up. ' +\n '<br/><br/><a target=\\'_blank\\' href=\\'' +\n newPaneOptions.newInstance.uri +\n '\\'>Go to your new ' +\n options.noun +\n '.</a>'\n // selectUI.parentNode.removeChild(selectUI) // Clean up\n // selectUIParent.removeChild(selectUI) // Clean up\n }\n selectNewTool() // toggle star to plain and menu vanish again\n })\n .catch(function (err) {\n complain(err)\n reject(err)\n })\n },\n err => {\n // login fails\n complain('Error logging on: ' + err)\n }\n )\n } // callbackWS\n\n const pa = options.pane\n // options.appPathSegment = pa.name // was 'edu.mit.solid.pane.'\n options.noun = pa.mintClass ? utils.label(pa.mintClass) : pa.name\n options.appPathSegment = options.noun.slice(0, 1).toUpperCase() + options.noun.slice(1)\n\n if (!options.folder) {\n // No folder given? Ask user for full URI\n selectUI = selectWorkspace(dom, {\n noun: options.noun,\n appPathSegment: options.appPathSegment\n }, callbackWS)\n options.div.appendChild(selectUI)\n // selectUIParent = options.div\n } else {\n const gotName = function (name) {\n if (!name) {\n // selectUIParent.removeChild(selectUI) itremves itself if cancelled\n selectNewTool() // toggle star to plain and menu vanish again\n } else {\n let uri = options.folder!.uri\n if (!uri.endsWith('/')) {\n uri = uri + '/'\n }\n uri = uri + encodeURIComponent(name) + '/'\n callbackWS(null, uri)\n }\n }\n widgets\n .askName(\n dom,\n kb,\n options.div,\n ns.foaf('name'),\n null,\n options.noun\n )\n .then(gotName)\n // selectUI = getNameForm(dom, kb, options.noun, gotName)\n // options.div.appendChild(selectUI)\n // selectUIParent = options.div\n }\n })\n } // makeNewAppInstance\n\n const iconArray: Array<any> = []\n const mintingPanes = Object.values(thePanes).filter(pane => pane.mintNew)\n const mintingClassMap = mintingPanes.reduce((classMap, pane) => {\n if (pane.mintClass) {\n classMap[pane.mintClass.uri] = (classMap[pane.mintClass.uri] || 0) + 1\n }\n return classMap\n }, {})\n mintingPanes.forEach(pane => {\n // @@ TODO Remove the need to cast to any\n const icon: any = createContext.div.appendChild(dom.createElement('img'))\n icon.setAttribute('src', pane.icon)\n const noun = pane.mintClass\n ? mintingClassMap[pane.mintClass.uri] > 1\n ? `${utils.label(pane.mintClass)} (using ${pane.name} pane)`\n : utils.label(pane.mintClass)\n : pane.name + ' @@'\n icon.setAttribute('title', 'Make new ' + noun)\n icon.setAttribute('style', iconStyle + 'display: none;')\n iconArray.push(icon)\n if (!icon.disabled) {\n icon.addEventListener('click', function (e) {\n selectTool(icon)\n makeNewAppInstance({\n event: e,\n folder: createContext.folder || null,\n iconEle: icon,\n pane,\n noun,\n noIndexHTML: true, // do NOT @@ for now write a HTML file\n div: createContext.div,\n me: createContext.me,\n dom: createContext.dom,\n refreshTarget: createContext.refreshTarget\n })\n })\n }\n })\n}\n\n// Form to get the name of a new thing before we create it\n//\n// Used in contacts for new groups, individuals.\n//\n/*\nfunction getNameForm (dom, kb, classLabel, gotNameCallback) {\n const form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error\n form.innerHTML = '<p>Name of new ' + classLabel + ':</p>'\n const namefield = dom.createElement('input')\n namefield.setAttribute('type', 'text')\n namefield.setAttribute('size', '30')\n namefield.setAttribute('style', style.textInputStyle)\n namefield.setAttribute('maxLength', '2048') // No arbitrary limits\n namefield.select() // focus next user input\n\n const gotName = function () {\n namefield.setAttribute('class', 'pendingedit')\n namefield.disabled = true\n continueButton.disabled = true\n cancel.disabled = true\n gotNameCallback(true, namefield.value)\n }\n\n namefield.addEventListener('keyup', function (e) {\n if (e.keyCode === 13) {\n gotName()\n }\n }, false)\n form.appendChild(namefield)\n\n form.appendChild(dom.createElement('br'))\n\n const cancel = form.appendChild(widgets.cancelButton(dom))\n cancel.addEventListener('click', function (e) {\n form.parentNode.removeChild(form)\n gotNameCallback(false)\n }, false)\n\n const continueButton = form.appendChild(widgets.continueButton(dom))\n continueButton.addEventListener('click', function (e) {\n gotName()\n }, false)\n\n return form\n}\n*/\n"],"mappings":";;;;;;;;;;AAcA,IAAMG,IAAKC,EAAoB;AAS/B,SAAgBC,EACd,GACA,GACA,GACM;CACN,IAAMC,IAAMC,EAAc,KACpBC,IAAMD,EAAc;CAC1B,IAAIA,EAAc,MAAM,CAACA,EAAc,GAAG,KACxC,MAAU,MAAM,kCAAkCA,EAAc,EAAE;CAGpE,IAAME,IAAY,4CACZC,IAAOF,EAAI,YAAYF,EAAI,cAAc,KAAK,CAAC,GACjDK,IAAU;CAKd,AAFAD,EAAK,aAAa,OAAOE,EAAM,WAAW,sBAAsB,GAChEF,EAAK,aAAa,S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C;CAEL,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../../src/create/index.ts"],"sourcesContent":["import {\n newThingUI\n} from './create'\n\nexport const create = {\n newThingUI\n}\n"],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["create"],"sources":["../../src/create/index.ts"],"sourcesContent":["import {\n newThingUI\n} from './create'\n\nexport const create = {\n newThingUI\n}\n"],"mappings":"AAIA,IAAaA,EAAS,CACpB,oCAAA,CAAA,CAAA,UACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":[],"sources":["../../src/create/index.ts"],"sourcesContent":["import {\n newThingUI\n} from './create'\n\nexport const create = {\n newThingUI\n}\n"],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["create"],"sources":["../../src/create/index.ts"],"sourcesContent":["import {\n newThingUI\n} from './create'\n\nexport const create = {\n newThingUI\n}\n"],"mappings":";;AAIA,IAAaA,IAAS,EACpB,cACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs.js","names":[],"sources":["../../src/create/types.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\n\nexport type CreateContext = {\n div: HTMLElement\n dom: HTMLDocument\n folder?: NamedNode\n me: NamedNode\n refreshTarget?: HTMLTableElement\n statusArea: HTMLElement\n}\n\nexport interface NewAppInstanceOptions {\n appPathSegment?: string\n event: any\n folder: NamedNode | null\n iconEle: HTMLImageElement\n pane: PaneDefinition\n noun: string\n noIndexHTML: boolean\n div: HTMLElement,\n me: NamedNode,\n dom: HTMLDocument,\n refreshTarget?: HTMLTableElement\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.cjs.js","names":["types_exports"],"sources":["../../src/create/types.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\n\nexport type CreateContext = {\n div: HTMLElement\n dom: HTMLDocument\n folder?: NamedNode\n me: NamedNode\n refreshTarget?: HTMLTableElement\n statusArea: HTMLElement\n}\n\nexport interface NewAppInstanceOptions {\n appPathSegment?: string\n event: any\n folder: NamedNode | null\n iconEle: HTMLImageElement\n pane: PaneDefinition\n noun: string\n noIndexHTML: boolean\n div: HTMLElement,\n me: NamedNode,\n dom: HTMLDocument,\n refreshTarget?: HTMLTableElement\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.esm.js","names":[],"sources":["../../src/create/types.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\n\nexport type CreateContext = {\n div: HTMLElement\n dom: HTMLDocument\n folder?: NamedNode\n me: NamedNode\n refreshTarget?: HTMLTableElement\n statusArea: HTMLElement\n}\n\nexport interface NewAppInstanceOptions {\n appPathSegment?: string\n event: any\n folder: NamedNode | null\n iconEle: HTMLImageElement\n pane: PaneDefinition\n noun: string\n noIndexHTML: boolean\n div: HTMLElement,\n me: NamedNode,\n dom: HTMLDocument,\n refreshTarget?: HTMLTableElement\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.esm.js","names":["types_exports"],"sources":["../../src/create/types.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\n\nexport type CreateContext = {\n div: HTMLElement\n dom: HTMLDocument\n folder?: NamedNode\n me: NamedNode\n refreshTarget?: HTMLTableElement\n statusArea: HTMLElement\n}\n\nexport interface NewAppInstanceOptions {\n appPathSegment?: string\n event: any\n folder: NamedNode | null\n iconEle: HTMLImageElement\n pane: PaneDefinition\n noun: string\n noIndexHTML: boolean\n div: HTMLElement,\n me: NamedNode,\n dom: HTMLDocument,\n refreshTarget?: HTMLTableElement\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../../src/footer/index.ts"],"sourcesContent":["/*\n This file was copied from mashlib/src/global/footer.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authn, authSession } from 'solid-logic'\nimport { style } from '../lib/style'\nimport { getName, getPod, getPodOwner } from '../utils/headerFooterHelpers'\n\nconst DEFAULT_SOLID_PROJECT_URL = 'https://solidproject.org'\nconst DEFAULT_SOLID_PROJECT_NAME = 'solidproject.org'\n\n/*\n FooterOptions allow for customizing the link and name of the link part of the footer.\n */\nexport type FooterOptions = {\n solidProjectUrl?: string,\n solidProjectName?: string\n}\n\n/**\n * Initialize footer component, the footer object returned depends on whether the user is authenticated.\n * @param store the data store\n * @returns the footer\n */\nexport async function initFooter (store: LiveStore, options?: FooterOptions) {\n const footer = document.getElementById('PageFooter')\n if (!footer) {\n return\n }\n\n const pod = getPod()\n const podOwner = await getPodOwner(pod, store)\n rebuildFooter(footer, store, pod, podOwner, options)\n authSession.events.on('login', () => rebuildFooter(footer, store, pod, podOwner, options))\n authSession.events.on('logout', () => rebuildFooter(footer, store, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function rebuildFooter (footer: HTMLElement, store: LiveStore, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions) {\n const user = authn.currentUser()\n footer.innerHTML = ''\n footer.appendChild(await createControllerInfoBlock(store, user, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createControllerInfoBlock (store: LiveStore, user: NamedNode | null, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions): HTMLElement {\n const profileLinkContainer = document.createElement('div')\n profileLinkContainer.setAttribute('style', style.footer)\n\n const solidProjectLink = document.createElement('a')\n solidProjectLink.href = options && options.solidProjectUrl ? options.solidProjectUrl : DEFAULT_SOLID_PROJECT_URL\n solidProjectLink.innerText = options && options.solidProjectName ? options.solidProjectName : DEFAULT_SOLID_PROJECT_NAME\n\n if (!pod || !podOwner || (user && user.equals(podOwner))) {\n const defaultPrefix = document.createElement('span')\n defaultPrefix.innerText = 'Powered by '\n profileLinkContainer.appendChild(defaultPrefix)\n profileLinkContainer.appendChild(solidProjectLink)\n return profileLinkContainer\n }\n\n const podLinkPre = document.createElement('span')\n podLinkPre.innerText = 'You\\'re visiting '\n\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.innerText = 'the Pod'\n\n const profileLinkPre = document.createElement('span')\n profileLinkPre.innerText = ' controlled by '\n\n const profileLink = document.createElement('a')\n profileLink.href = podOwner.uri\n profileLink.innerText = getName(store, podOwner)\n\n const solidProjectLinkPre = document.createElement('span')\n solidProjectLinkPre.innerText = '. For more info, check out '\n\n const solidProjectLinkPost = document.createElement('span')\n solidProjectLinkPost.innerText = '.'\n\n profileLinkContainer.appendChild(podLinkPre)\n profileLinkContainer.appendChild(podLink)\n profileLinkContainer.appendChild(profileLinkPre)\n profileLinkContainer.appendChild(profileLink)\n profileLinkContainer.appendChild(solidProjectLinkPre)\n profileLinkContainer.appendChild(solidProjectLink)\n profileLinkContainer.appendChild(solidProjectLinkPost)\n\n return profileLinkContainer\n}\n"],"mappings":"qHASA,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["getPod","getPodOwner","authn","style","getName","require_style","require_headerFooterHelpers","solid_logic","DEFAULT_SOLID_PROJECT_URL","DEFAULT_SOLID_PROJECT_NAME","initFooter","footer","pod","podOwner","store","rebuildFooter","options","user","createControllerInfoBlock","profileLinkContainer","solidProjectLink","defaultPrefix","podLinkPre","podLink","profileLinkPre","profileLink","solidProjectLinkPre","solidProjectLinkPost"],"sources":["../../src/footer/index.ts"],"sourcesContent":["/*\n This file was copied from mashlib/src/global/footer.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authn, authSession } from 'solid-logic'\nimport { style } from '../lib/style'\nimport { getName, getPod, getPodOwner } from '../utils/headerFooterHelpers'\n\nconst DEFAULT_SOLID_PROJECT_URL = 'https://solidproject.org'\nconst DEFAULT_SOLID_PROJECT_NAME = 'solidproject.org'\n\n/*\n FooterOptions allow for customizing the link and name of the link part of the footer.\n */\nexport type FooterOptions = {\n solidProjectUrl?: string,\n solidProjectName?: string\n}\n\n/**\n * Initialize footer component, the footer object returned depends on whether the user is authenticated.\n * @param store the data store\n * @returns the footer\n */\nexport async function initFooter (store: LiveStore, options?: FooterOptions) {\n const footer = document.getElementById('PageFooter')\n if (!footer) {\n return\n }\n\n const pod = getPod()\n const podOwner = await getPodOwner(pod, store)\n rebuildFooter(footer, store, pod, podOwner, options)\n authSession.events.on('login', () => rebuildFooter(footer, store, pod, podOwner, options))\n authSession.events.on('logout', () => rebuildFooter(footer, store, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function rebuildFooter (footer: HTMLElement, store: LiveStore, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions) {\n const user = authn.currentUser()\n footer.innerHTML = ''\n footer.appendChild(await createControllerInfoBlock(store, user, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createControllerInfoBlock (store: LiveStore, user: NamedNode | null, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions): HTMLElement {\n const profileLinkContainer = document.createElement('div')\n profileLinkContainer.setAttribute('style', style.footer)\n\n const solidProjectLink = document.createElement('a')\n solidProjectLink.href = options && options.solidProjectUrl ? options.solidProjectUrl : DEFAULT_SOLID_PROJECT_URL\n solidProjectLink.innerText = options && options.solidProjectName ? options.solidProjectName : DEFAULT_SOLID_PROJECT_NAME\n\n if (!pod || !podOwner || (user && user.equals(podOwner))) {\n const defaultPrefix = document.createElement('span')\n defaultPrefix.innerText = 'Powered by '\n profileLinkContainer.appendChild(defaultPrefix)\n profileLinkContainer.appendChild(solidProjectLink)\n return profileLinkContainer\n }\n\n const podLinkPre = document.createElement('span')\n podLinkPre.innerText = 'You\\'re visiting '\n\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.innerText = 'the Pod'\n\n const profileLinkPre = document.createElement('span')\n profileLinkPre.innerText = ' controlled by '\n\n const profileLink = document.createElement('a')\n profileLink.href = podOwner.uri\n profileLink.innerText = getName(store, podOwner)\n\n const solidProjectLinkPre = document.createElement('span')\n solidProjectLinkPre.innerText = '. For more info, check out '\n\n const solidProjectLinkPost = document.createElement('span')\n solidProjectLinkPost.innerText = '.'\n\n profileLinkContainer.appendChild(podLinkPre)\n profileLinkContainer.appendChild(podLink)\n profileLinkContainer.appendChild(profileLinkPre)\n profileLinkContainer.appendChild(profileLink)\n profileLinkContainer.appendChild(solidProjectLinkPre)\n profileLinkContainer.appendChild(solidProjectLink)\n profileLinkContainer.appendChild(solidProjectLinkPost)\n\n return profileLinkContainer\n}\n"],"mappings":"qHASA,IAAMQ,EAA4B,2BAC5BC,EAA6B,mBAenC,eAAsBC,EAAY,EAAkB,EAAyB,CAC3E,IAAMC,EAAS,SAAS,eAAe,YAAY,EACnD,GAAI,CAACA,EACH,OAGF,IAAMC,EAAMZ,EAAAA,OAAO,EACba,EAAW,MAAMZ,EAAAA,YAAYW,EAAKE,CAAK,EAK7C,OAJAC,EAAcJ,EAAQG,EAAOF,EAAKC,EAAUG,CAAO,EACnDT,EAAA,YAAY,OAAO,GAAG,YAAeQ,EAAcJ,EAAQG,EAAOF,EAAKC,EAAUG,CAAO,CAAC,EACzFT,EAAA,YAAY,OAAO,GAAG,aAAgBQ,EAAcJ,EAAQG,EAAOF,EAAKC,EAAUG,CAAO,CAAC,EAEnFL,CACT,CAIA,eAAsBI,EAAe,EAAqB,EAAkB,EAAuB,EAA4B,EAAyB,CACtJ,IAAME,EAAOf,EAAAA,MAAM,YAAY,EAI/B,MAHA,GAAO,UAAY,GACnBS,EAAO,YAAY,MAAMO,EAA0BJ,EAAOG,EAAML,EAAKC,EAAUG,CAAO,CAAC,EAEhFL,CACT,CAIA,SAAgBO,EAA2B,EAAkB,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"],"sourcesContent":["/*\n This file was copied from mashlib/src/global/footer.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authn, authSession } from 'solid-logic'\nimport { style } from '../lib/style'\nimport { getName, getPod, getPodOwner } from '../utils/headerFooterHelpers'\n\nconst DEFAULT_SOLID_PROJECT_URL = 'https://solidproject.org'\nconst DEFAULT_SOLID_PROJECT_NAME = 'solidproject.org'\n\n/*\n FooterOptions allow for customizing the link and name of the link part of the footer.\n */\nexport type FooterOptions = {\n solidProjectUrl?: string,\n solidProjectName?: string\n}\n\n/**\n * Initialize footer component, the footer object returned depends on whether the user is authenticated.\n * @param store the data store\n * @returns the footer\n */\nexport async function initFooter (store: LiveStore, options?: FooterOptions) {\n const footer = document.getElementById('PageFooter')\n if (!footer) {\n return\n }\n\n const pod = getPod()\n const podOwner = await getPodOwner(pod, store)\n rebuildFooter(footer, store, pod, podOwner, options)\n authSession.events.on('login', () => rebuildFooter(footer, store, pod, podOwner, options))\n authSession.events.on('logout', () => rebuildFooter(footer, store, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function rebuildFooter (footer: HTMLElement, store: LiveStore, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions) {\n const user = authn.currentUser()\n footer.innerHTML = ''\n footer.appendChild(await createControllerInfoBlock(store, user, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createControllerInfoBlock (store: LiveStore, user: NamedNode | null, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions): HTMLElement {\n const profileLinkContainer = document.createElement('div')\n profileLinkContainer.setAttribute('style', style.footer)\n\n const solidProjectLink = document.createElement('a')\n solidProjectLink.href = options && options.solidProjectUrl ? options.solidProjectUrl : DEFAULT_SOLID_PROJECT_URL\n solidProjectLink.innerText = options && options.solidProjectName ? options.solidProjectName : DEFAULT_SOLID_PROJECT_NAME\n\n if (!pod || !podOwner || (user && user.equals(podOwner))) {\n const defaultPrefix = document.createElement('span')\n defaultPrefix.innerText = 'Powered by '\n profileLinkContainer.appendChild(defaultPrefix)\n profileLinkContainer.appendChild(solidProjectLink)\n return profileLinkContainer\n }\n\n const podLinkPre = document.createElement('span')\n podLinkPre.innerText = 'You\\'re visiting '\n\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.innerText = 'the Pod'\n\n const profileLinkPre = document.createElement('span')\n profileLinkPre.innerText = ' controlled by '\n\n const profileLink = document.createElement('a')\n profileLink.href = podOwner.uri\n profileLink.innerText = getName(store, podOwner)\n\n const solidProjectLinkPre = document.createElement('span')\n solidProjectLinkPre.innerText = '. For more info, check out '\n\n const solidProjectLinkPost = document.createElement('span')\n solidProjectLinkPost.innerText = '.'\n\n profileLinkContainer.appendChild(podLinkPre)\n profileLinkContainer.appendChild(podLink)\n profileLinkContainer.appendChild(profileLinkPre)\n profileLinkContainer.appendChild(profileLink)\n profileLinkContainer.appendChild(solidProjectLinkPre)\n profileLinkContainer.appendChild(solidProjectLink)\n profileLinkContainer.appendChild(solidProjectLinkPost)\n\n return profileLinkContainer\n}\n"],"mappings":";;;;AASA,
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["DEFAULT_SOLID_PROJECT_URL","DEFAULT_SOLID_PROJECT_NAME","initFooter","footer","pod","getPod","podOwner","getPodOwner","store","rebuildFooter","options","authSession","user","authn","createControllerInfoBlock","profileLinkContainer","style","solidProjectLink","defaultPrefix","podLinkPre","podLink","profileLinkPre","profileLink","getName","solidProjectLinkPre","solidProjectLinkPost"],"sources":["../../src/footer/index.ts"],"sourcesContent":["/*\n This file was copied from mashlib/src/global/footer.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authn, authSession } from 'solid-logic'\nimport { style } from '../lib/style'\nimport { getName, getPod, getPodOwner } from '../utils/headerFooterHelpers'\n\nconst DEFAULT_SOLID_PROJECT_URL = 'https://solidproject.org'\nconst DEFAULT_SOLID_PROJECT_NAME = 'solidproject.org'\n\n/*\n FooterOptions allow for customizing the link and name of the link part of the footer.\n */\nexport type FooterOptions = {\n solidProjectUrl?: string,\n solidProjectName?: string\n}\n\n/**\n * Initialize footer component, the footer object returned depends on whether the user is authenticated.\n * @param store the data store\n * @returns the footer\n */\nexport async function initFooter (store: LiveStore, options?: FooterOptions) {\n const footer = document.getElementById('PageFooter')\n if (!footer) {\n return\n }\n\n const pod = getPod()\n const podOwner = await getPodOwner(pod, store)\n rebuildFooter(footer, store, pod, podOwner, options)\n authSession.events.on('login', () => rebuildFooter(footer, store, pod, podOwner, options))\n authSession.events.on('logout', () => rebuildFooter(footer, store, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function rebuildFooter (footer: HTMLElement, store: LiveStore, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions) {\n const user = authn.currentUser()\n footer.innerHTML = ''\n footer.appendChild(await createControllerInfoBlock(store, user, pod, podOwner, options))\n\n return footer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createControllerInfoBlock (store: LiveStore, user: NamedNode | null, pod: NamedNode | null, podOwner: NamedNode | null, options?: FooterOptions): HTMLElement {\n const profileLinkContainer = document.createElement('div')\n profileLinkContainer.setAttribute('style', style.footer)\n\n const solidProjectLink = document.createElement('a')\n solidProjectLink.href = options && options.solidProjectUrl ? options.solidProjectUrl : DEFAULT_SOLID_PROJECT_URL\n solidProjectLink.innerText = options && options.solidProjectName ? options.solidProjectName : DEFAULT_SOLID_PROJECT_NAME\n\n if (!pod || !podOwner || (user && user.equals(podOwner))) {\n const defaultPrefix = document.createElement('span')\n defaultPrefix.innerText = 'Powered by '\n profileLinkContainer.appendChild(defaultPrefix)\n profileLinkContainer.appendChild(solidProjectLink)\n return profileLinkContainer\n }\n\n const podLinkPre = document.createElement('span')\n podLinkPre.innerText = 'You\\'re visiting '\n\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.innerText = 'the Pod'\n\n const profileLinkPre = document.createElement('span')\n profileLinkPre.innerText = ' controlled by '\n\n const profileLink = document.createElement('a')\n profileLink.href = podOwner.uri\n profileLink.innerText = getName(store, podOwner)\n\n const solidProjectLinkPre = document.createElement('span')\n solidProjectLinkPre.innerText = '. For more info, check out '\n\n const solidProjectLinkPost = document.createElement('span')\n solidProjectLinkPost.innerText = '.'\n\n profileLinkContainer.appendChild(podLinkPre)\n profileLinkContainer.appendChild(podLink)\n profileLinkContainer.appendChild(profileLinkPre)\n profileLinkContainer.appendChild(profileLink)\n profileLinkContainer.appendChild(solidProjectLinkPre)\n profileLinkContainer.appendChild(solidProjectLink)\n profileLinkContainer.appendChild(solidProjectLinkPost)\n\n return profileLinkContainer\n}\n"],"mappings":";;;;AASA,IAAMA,IAA4B,4BAC5BC,IAA6B;AAenC,eAAsBC,EAAY,GAAkB,GAAyB;CAC3E,IAAMC,IAAS,SAAS,eAAe,YAAY;CACnD,IAAI,CAACA,GACH;CAGF,IAAMC,IAAMC,EAAO,GACbC,IAAW,MAAMC,EAAYH,GAAKI,CAAK;CAK7C,OAJAC,EAAcN,GAAQK,GAAOJ,GAAKE,GAAUI,CAAO,GACnDC,EAAY,OAAO,GAAG,eAAeF,EAAcN,GAAQK,GAAOJ,GAAKE,GAAUI,CAAO,CAAC,GACzFC,EAAY,OAAO,GAAG,gBAAgBF,EAAcN,GAAQK,GAAOJ,GAAKE,GAAUI,CAAO,CAAC,GAEnFP;AACT;AAIA,eAAsBM,EAAe,GAAqB,GAAkB,GAAuB,GAA4B,GAAyB;CACtJ,IAAMG,IAAOC,EAAM,YAAY;CAI/B,OAHA,EAAO,YAAY,IACnBV,EAAO,YAAY,MAAMW,EAA0BN,GAAOI,GAAMR,GAAKE,GAAUI,CAAO,CAAC,GAEhFP;AACT;AAIA,SAAgBW,EAA2B,GAAkB,GAAwB,GAAuB,GAA4B,GAAsC;CAC5K,IAAMC,IAAuB,SAAS,cAAc,KAAK;CACzD,EAAqB,aAAa,SAASC,EAAM,MAAM;CAEvD,IAAMC,IAAmB,SAAS,cAAc,GAAG;CAInD,IAHA,EAAiB,OAAOP,KAAWA,EAAQ,kBAAkBA,EAAQ,kBAAkBV,GACvF,EAAiB,YAAYU,KAAWA,EAAQ,mBAAmBA,EAAQ,mBAAmBT,GAE1F,CAACG,KAAO,CAACE,KAAaM,KAAQA,EAAK,OAAON,CAAQ,GAAI;EACxD,IAAMY,IAAgB,SAAS,cAAc,MAAM;EAInD,OAHA,EAAc,YAAY,eAC1BH,EAAqB,YAAYG,CAAa,GAC9CH,EAAqB,YAAYE,CAAgB,GAC1CF;CACT;CAEA,IAAMI,IAAa,SAAS,cAAc,MAAM;CAChD,EAAW,YAAY;CAEvB,IAAMC,IAAU,SAAS,cAAc,GAAG;CAE1C,AADA,EAAQ,OAAOhB,EAAI,KACnB,EAAQ,YAAY;CAEpB,IAAMiB,IAAiB,SAAS,cAAc,MAAM;CACpD,EAAe,YAAY;CAE3B,IAAMC,IAAc,SAAS,cAAc,GAAG;CAE9C,AADA,EAAY,OAAOhB,EAAS,KAC5B,EAAY,YAAYiB,EAAQf,GAAOF,CAAQ;CAE/C,IAAMkB,IAAsB,SAAS,cAAc,MAAM;CACzD,EAAoB,YAAY;CAEhC,IAAMC,IAAuB,SAAS,cAAc,MAAM;CAW1D,OAVA,EAAqB,YAAY,KAEjCV,EAAqB,YAAYI,CAAU,GAC3CJ,EAAqB,YAAYK,CAAO,GACxCL,EAAqB,YAAYM,CAAc,GAC/CN,EAAqB,YAAYO,CAAW,GAC5CP,EAAqB,YAAYS,CAAmB,GACpDT,EAAqB,YAAYE,CAAgB,GACjDF,EAAqB,YAAYU,CAAoB,GAE9CV;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-profile.cjs.js","names":[],"sources":["../../src/header/empty-profile.ts"],"sourcesContent":["export const emptyProfile = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>`\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"empty-profile.cjs.js","names":["emptyProfile"],"sources":["../../src/header/empty-profile.ts"],"sourcesContent":["export const emptyProfile = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>`\n"],"mappings":"AAAA,IAAaA,EAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-profile.esm.js","names":[],"sources":["../../src/header/empty-profile.ts"],"sourcesContent":["export const emptyProfile = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>`\n"],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"empty-profile.esm.js","names":["emptyProfile"],"sources":["../../src/header/empty-profile.ts"],"sourcesContent":["export const emptyProfile = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>`\n"],"mappings":";AAAA,IAAaA,IAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"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":"gTAkBA,IAAM,EAAyB,EAAA,MAAM,SAAW,gBAC1C,EAAwB,uDAgC9B,eAAsB,EAAY,EAAuB,EAA2B,EAAyB,CAC3G,IAAM,EAAS,SAAS,eAAe,YAAY,EACnD,GAAI,CAAC,EACH,OAGF,IAAM,EAAM,EAAA,OAAO,EACnB,EAAc,EAAQ,EAAO,EAAK,EAAc,CAAO,CAAC,CAAC,EACzD,EAAA,YAAY,OAAO,GAAG,SAAU,EAAc,EAAQ,EAAO,EAAK,EAAc,CAAO,CAAC,EACxF,EAAA,YAAY,OAAO,GAAG,QAAS,EAAc,EAAQ,EAAO,EAAK,EAAc,CAAO,CAAC,CACzF,CAIA,SAAgB,EAAe,EAAqB,EAAuB,EAAgB,EAA2B,EAAyB,CAC7I,OAAO,SAAY,CACjB,IAAM,EAAO,EAAA,MAAM,YAAY,EAC/B,EAAO,UAAY,GACnB,EAAO,YAAY,MAAM,EAAa,EAAO,EAAK,EAAM,EAAc,CAAO,CAAC,CAChF,CACF,CAIA,eAAsB,EAAc,EAAuB,EAAgB,EAAwB,EAA2B,EAA+C,CAC3K,IAAM,EAAU,SAAS,cAAc,GAAG,EAC1C,EAAQ,KAAO,EAAI,IACnB,EAAQ,aAAa,QAAS,EAAA,MAAM,gBAAgB,EACpD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,GAAY,CAAC,GAAc,IAG9C,EAAQ,aAAa,iBAAkB,CAAC,EAAA,CAAY,SAAS,CAAC,EAC9D,EAAK,aAAa,cAAe,EAAW,SAAS,CAAC,EACxD"}
|
|
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":"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,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,EAAAA,MAAM,wCAAwC,CAC3E,CAAC,EAEMyD,CACT,CAKA,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":[],"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":";;;;;;;;;AAkBA,IAAM,IAAyB,EAAM,WAAW,iBAC1C,IAAwB;AAgC9B,eAAsB,EAAY,GAAuB,GAA2B,GAAyB;CAC3G,IAAM,IAAS,SAAS,eAAe,YAAY;CACnD,IAAI,CAAC,GACH;CAGF,IAAM,IAAM,EAAO;CAGnB,AAFA,EAAc,GAAQ,GAAO,GAAK,GAAc,CAAO,CAAC,CAAC,GACzD,EAAY,OAAO,GAAG,UAAU,EAAc,GAAQ,GAAO,GAAK,GAAc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,GAAuB,GAAuC;CAC3F,IAAI,IAAa;CACjB,IAAI;EAEF,IADA,IAAa,EAAkB,CAAI,GAC/B,CAAC,GACH,OAAO;CAEX,QAAQ;EACN,OAAO;CACT;CAEA,IAAM,IAAe,SAAS,cAAc,KAAK;CAGjD,OAFA,EAAa,aAAa,SAAS,EAAM,mBAAmB,GAC5D,EAAa,MAAM,kBAAkB,OAAO,EAAW,IAChD;AACT;AAKA,SAAS,EAAY,GAAc,GAA4B,GAAyB;CACtF,IAAM,IAAa,EAAQ,aAAa,eAAe,MAAM,QACvD,IAAS,EAAM,SAAS,aACxB,IAAQ,EAAM,SAAS;CACxB,KAAc,KAAY,CAAC,KAAc,MAG9C,EAAQ,aAAa,kBAAkB,CAAC,EAAA,CAAY,SAAS,CAAC,GAC9D,EAAK,aAAa,eAAe,EAAW,SAAS,CAAC;AACxD"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["widgets.findImage","DEFAULT_HELP_MENU_ICON","icons","DEFAUL_SOLID_ICON_URL","initHeader","header","pod","getPod","rebuildHeader","store","userMenuList","options","authSession","user","authn","createBanner","podLink","style","image","userMenu","createUserMenu","createLoginSignUpButtons","banner","leftSideOfHeader","helpMenu","createHelpMenu","helpMenuItems","helpMenuList","menuItem","createUserMenuItem","createUserMenuLink","createUserMenuButton","helpMenuContainer","helpMenuTrigger","helpMenuIcon","throttledMenuToggle","throttle","toggleMenu","event","timer","profileLoginButtonPre","loginStatusBox","button","onClick","label","link","href","target","fetcher","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","getProfileImg","loggedInMenuContainer","menuProfileItem","child","profileUrl","findImage","emptyProfile","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":";;;;;;;;;AAkBA,IAAMC,IAAyBC,EAAM,WAAW,iBAC1CC,IAAwB;AAgC9B,eAAsBC,EAAY,GAAuB,GAA2B,GAAyB;CAC3G,IAAMC,IAAS,SAAS,eAAe,YAAY;CACnD,IAAI,CAAC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,CAAK,GAEzB,SADqB,eAAe,aACpC,CAAA,EAAK,aAAa,SAASrB,EAAM,4BAA4B;CAC/D,CAAC,GACDqC,EAAsB,iBAAiB,aAAY,MAAS;EAG1D,AAFA,IAAQ,iBAAiBnB,EAAoBG,CAAK,GAAG,GAAG,GAExD,SADqB,eAAe,aACpC,CAAA,EAAK,aAAa,SAASrB,EAAM,wCAAwC;CAC3E,CAAC,GAEMqC;AACT;AAKA,SAAgBzB,EAAoB,GAAiC;CACnE,IAAM0B,IAAkB,SAAS,cAAc,IAAI;CAGnD,OAFAA,EAAgB,aAAa,SAAStC,EAAM,sBAAsB,GAClEsC,EAAgB,YAAYC,CAAK,GAC1BD;AACT;AAIA,SAAgBF,EAAe,GAAuB,GAAuC;CAC3F,IAAII,IAAa;CACjB,IAAI;EAEF,IADA,IAAazD,EAAkBa,CAAI,GAC/B,CAAC4C,GACH,OAAOE;CAEX,QAAQ;EACN,OAAOA;CACT;CAEA,IAAMC,IAAe,SAAS,cAAc,KAAK;CAGjD,OAFAA,EAAa,aAAa,SAAS3C,EAAM,mBAAmB,GAC5D,EAAa,MAAM,kBAAkB,OAAOwC,EAAW,IAChDG;AACT;AAKA,SAASvB,EAAY,GAAc,GAA4B,GAAyB;CACtF,IAAMwB,IAAaC,EAAQ,aAAa,eAAe,MAAM,QACvDC,IAASzB,EAAM,SAAS,aACxB0B,IAAQ1B,EAAM,SAAS;CAC7B,AAAKuB,KAAcE,KAAY,CAACF,KAAcG,MAG9CF,EAAQ,aAAa,kBAAkB,CAACD,EAAA,CAAY,SAAS,CAAC,GAC9DI,EAAK,aAAa,eAAeJ,EAAW,SAAS,CAAC;AACxD"}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"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/context'\nexport * from './lib/code-editor'\n"],"mappings":"04DAkCA,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["require_ns","require_log","require_index","require_style","require_iconBase","require_language","require_index$1","require_login","require_index$2","require_index$3","require_index$4","require_index$5","require_messageArea","require_participation","require_pad","require_infinite","require_preferences","require_table","require_tabs","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_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/context'\nexport * from './lib/code-editor'\n"],"mappings":"04DAkCA,IAAawC,EAAM,OAAO,OAAW,IAAc,OAAO,SAAW"}
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":[],"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/context'\nexport * from './lib/code-editor'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,
|
|
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_SIGNUP_URL","ShowDialogEvent","acl","aclControl","authContext","create","types_exports","customElement","dialogContext","fileExplorerContext","generateId","icons","infiniteMessageArea","initFooter","initHeader","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/context'\nexport * from './lib/code-editor'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAaU,IAAM,OAAO,SAAW,MAAc,OAAO,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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 { S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./chunks/src-
|
|
1
|
+
import { h as e } from "./chunks/index.esm-AZPmKqjU.js";
|
|
2
|
+
import { a as t, c as n, n as r, o as i, s as a, t as o } from "./chunks/auth-DrN7Ex4E.js";
|
|
3
|
+
import { l as s, m as c, t as l } from "./chunks/style-Dpwrc8CC.js";
|
|
4
|
+
import { S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./chunks/src-BWY65mD0.js";
|
|
5
5
|
import { _ as M, a as N, g as P, h as F, m as I, n as L, o as R, t as z, v as B, y as V } from "./chunks/components-BHoVP7zE.js";
|
|
6
6
|
import { n as H, t as U } from "./chunks/dialogs-D2n-R0lI.js";
|
|
7
7
|
import { t as W } from "./chunks/show-dialog-eEW5yRBv.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.cjs.js","names":[],"sources":["../../../src/lib/auth/Account.ts"],"sourcesContent":["export default class Account {\n public readonly webId: string\n public readonly avatarUrl?: string\n\n constructor (webId: string, avatarUrl?: string) {\n this.webId = webId\n this.avatarUrl = avatarUrl\n }\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Account.cjs.js","names":["Account","webId","avatarUrl"],"sources":["../../../src/lib/auth/Account.ts"],"sourcesContent":["export default class Account {\n public readonly webId: string\n public readonly avatarUrl?: string\n\n constructor (webId: string, avatarUrl?: string) {\n this.webId = webId\n this.avatarUrl = avatarUrl\n }\n}\n"],"mappings":"AAAA,IAAqBA,EAArB,KAA6B,CAC3B,MACA,UAEA,YAAa,EAAe,EAAoB,CAC9C,KAAK,MAAQC,EACb,KAAK,UAAYC,CACnB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.esm.js","names":[],"sources":["../../../src/lib/auth/Account.ts"],"sourcesContent":["export default class Account {\n public readonly webId: string\n public readonly avatarUrl?: string\n\n constructor (webId: string, avatarUrl?: string) {\n this.webId = webId\n this.avatarUrl = avatarUrl\n }\n}\n"],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"Account.esm.js","names":["Account","webId","avatarUrl"],"sources":["../../../src/lib/auth/Account.ts"],"sourcesContent":["export default class Account {\n public readonly webId: string\n public readonly avatarUrl?: string\n\n constructor (webId: string, avatarUrl?: string) {\n this.webId = webId\n this.avatarUrl = avatarUrl\n }\n}\n"],"mappings":";AAAA,IAAqBA,IAArB,MAA6B;CAC3B;CACA;CAEA,YAAa,GAAe,GAAoB;EAE9C,AADA,KAAK,QAAQC,GACb,KAAK,YAAYC;CACnB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopAuth.cjs.js","names":[],"sources":["../../../src/lib/auth/NoopAuth.ts"],"sourcesContent":["import { AuthContext } from './context'\n\nexport default class NoopAuth implements AuthContext {\n public readonly initialized = false\n public readonly account = null\n\n async login () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async signup () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async logout () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n onSessionUpdated () {\n return () => undefined\n }\n}\n"],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"NoopAuth.cjs.js","names":["NoopAuth"],"sources":["../../../src/lib/auth/NoopAuth.ts"],"sourcesContent":["import { AuthContext } from './context'\n\nexport default class NoopAuth implements AuthContext {\n public readonly initialized = false\n public readonly account = null\n\n async login () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async signup () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async logout () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n onSessionUpdated () {\n return () => undefined\n }\n}\n"],"mappings":"AAEA,IAAqBA,EAArB,KAAqD,CACnD,YAA8B,GAC9B,QAA0B,KAE1B,MAAM,OAAS,CACb,MAAU,MAAM,0CAA2C,CAC7D,CAEA,MAAM,QAAU,CACd,MAAU,MAAM,0CAA2C,CAC7D,CAEA,MAAM,QAAU,CACd,MAAU,MAAM,0CAA2C,CAC7D,CAEA,kBAAoB,CAClB,UAAa,IAAA,EACf,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopAuth.esm.js","names":[],"sources":["../../../src/lib/auth/NoopAuth.ts"],"sourcesContent":["import { AuthContext } from './context'\n\nexport default class NoopAuth implements AuthContext {\n public readonly initialized = false\n public readonly account = null\n\n async login () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async signup () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async logout () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n onSessionUpdated () {\n return () => undefined\n }\n}\n"],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"NoopAuth.esm.js","names":["NoopAuth"],"sources":["../../../src/lib/auth/NoopAuth.ts"],"sourcesContent":["import { AuthContext } from './context'\n\nexport default class NoopAuth implements AuthContext {\n public readonly initialized = false\n public readonly account = null\n\n async login () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async signup () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n async logout () {\n throw new Error('Can\\'t use auth, missing context provider')\n }\n\n onSessionUpdated () {\n return () => undefined\n }\n}\n"],"mappings":";AAEA,IAAqBA,IAArB,MAAqD;CACnD,cAA8B;CAC9B,UAA0B;CAE1B,MAAM,QAAS;EACb,MAAU,MAAM,0CAA2C;CAC7D;CAEA,MAAM,SAAU;EACd,MAAU,MAAM,0CAA2C;CAC7D;CAEA,MAAM,SAAU;EACd,MAAU,MAAM,0CAA2C;CAC7D;CAEA,mBAAoB;EAClB,aAAa,KAAA;CACf;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../ns.cjs.js"),t=require("./Account.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(t){let n=i.solidLogicSingleton.store,r=n.sym(t),a=n.any(r,e.default.sioc(`avatar`))||n.any(r,e.default.foaf(`img`))||n.any(r,e.default.vcard(`logo`))||n.any(r,e.default.vcard(`hasPhoto`))||n.any(r,e.default.vcard(`photo`))||n.any(r,e.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(){await i.authn.checkUser(),this._initialized=!0,this.listeners.forEach(e=>e())}async loadProfile(){this.profileLoaded
|
|
1
|
+
const e=require("../ns.cjs.js"),t=require("./Account.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(t){let n=i.solidLogicSingleton.store,r=n.sym(t),a=n.any(r,e.default.sioc(`avatar`))||n.any(r,e.default.foaf(`img`))||n.any(r,e.default.vcard(`logo`))||n.any(r,e.default.vcard(`hasPhoto`))||n.any(r,e.default.vcard(`photo`))||n.any(r,e.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 e=i.authSession.webId??i.authSession.info?.webId;if(!(i.authSession.isActive??i.authSession.info?.isLoggedIn??!!e)||!e)return null;let n=o(e);return new t.default(e,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":[],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import Account from '@/lib/auth/Account'\nimport ns from '@/lib/ns'\nimport { authn, authSession, 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 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":"kOAQA,
|
|
1
|
+
{"version":3,"file":"SolidAuth.cjs.js","names":["solidLogicSingleton","ns","authSession","authn","Account","LoginModal","require_ns","require_Account","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":"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,GAC9BY,EAAM,IAAIC,EAAIb,EAAAA,QAAG,MAAM,UAAU,CAAC,GAClCY,EAAM,IAAIC,EAAIb,EAAAA,QAAG,MAAM,OAAO,CAAC,GAC/BY,EAAM,IAAIC,EAAIb,EAAAA,QAAG,KAAK,WAAW,CAAC,EAEpC,OAAOe,EAASA,EAAc,MAAQ,IAAA,EACxC,CAEA,IAAqBC,EAArB,KAAsD,CAKhC,UAJpB,aAAuB,GACvB,cAAwB,GACxB,UAAuC,CAAC,EAExC,YAAa,EAA2BN,EAAoB,CAAxC,KAAA,UAAAO,CAAyC,CAE7D,MAAM,YAAc,CAClBR,EAAA,YAAY,OAAO,GAAG,qBAAwB,CAC3CA,EAAA,oBAAqB,MAAM,QAAgB,0BAA0B,CACxE,CAAC,GAOD,EAAAA,EAAA,yBAAA,CAAyBR,EAAAA,YAAY,WAAc,CAC7CA,EAAAA,YAAY,MAAM,YAAY,OAAO,SAAS,OAAO,CAC3D,CAAC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AAU,KAAKN,CAAQ,EAExB,OAAOK,EAAmB,kBAAqB,WACjDA,EAAmB,iBAAiB,qBAAsBL,CAAQ,GAElET,EAAA,YAAY,OAAO,GAAG,QAASS,CAAQ,EACvCT,EAAA,YAAY,OAAO,GAAG,SAAUS,CAAQ,EACxCT,EAAA,YAAY,OAAO,GAAG,iBAAkBS,CAAQ,OAGrC,CACX,KAAK,UAAY,KAAK,UAAU,OAAO,GAAaO,IAAcP,CAAQ,EAEtE,OAAOK,EAAmB,qBAAwB,WACpDA,EAAmB,oBAAoB,qBAAsBL,CAAQ,GAErET,EAAA,YAAY,OAAO,IAAI,QAASS,CAAQ,EACxCT,EAAA,YAAY,OAAO,IAAI,SAAUS,CAAQ,EACzCT,EAAA,YAAY,OAAO,IAAI,iBAAkBS,CAAQ,EAErD,CACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/SolidAuth.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAKxC,eAAO,MAAM,kBAAkB,uCAAuC,CAAA;AAgBtE,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,WAAW;IAK/B,SAAS,EAAE,MAAM;IAJrC,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAwB;gBAErB,SAAS,GAAE,MAA2B;IAEpD,UAAU;
|
|
1
|
+
{"version":3,"file":"SolidAuth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/SolidAuth.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAKxC,eAAO,MAAM,kBAAkB,uCAAuC,CAAA;AAgBtE,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,WAAW;IAK/B,SAAS,EAAE,MAAM;IAJrC,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAwB;gBAErB,SAAS,GAAE,MAA2B;IAEpD,UAAU;IAoBV,WAAW;IAYjB,IAAI,WAAW,IAAK,OAAO,CAE1B;IAED,IAAI,OAAO,IAAK,OAAO,GAAG,IAAI,CAW7B;IAEK,KAAK,CAAE,QAAQ,CAAC,EAAE,MAAM;IAuBxB,MAAM;IAIN,MAAM;IAIZ,gBAAgB,CAAE,QAAQ,EAAE,MAAM,OAAO;CA4B1C"}
|