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":"photo-capture-modal-BhmL3kYD.js","names":["customElement","DialogComponent","html","nothing","property","state","styles","_classDecs","_PhotoCaptureModal","_PhotoCaptureModal2","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_nameDecs","type","String","reflect","_headingDecs","_captureLabelDecs","_confirmLabelDecs","_retakeLabelDecs","_cancelLabelDecs","attribute","_fileNamePrefixDecs","_mediaConstraintsDecs","_constraintsDecs","_captureFormatDecs","_captureQualityDecs","Number","_showCancelButtonDecs","Boolean","_facingModeDecs","_errorMessageDecs","_previewUrlDecs","_startingPreviewDecs","_valueDecs","_PhotoCaptureModal3","PhotoCaptureModal","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_name","_init_heading","_init_captureLabel","_init_confirmLabel","_init_retakeLabel","_init_cancelLabel","_init_fileNamePrefix","_init_mediaConstraints","undefined","_init_constraints","_init_captureFormat","_init_captureQuality","_init_showCancelButton","_init_facingMode","_init_errorMessage","_init_previewUrl","_init_startingPreview","_init_value","_defineProperty","_classPrivateFieldGet","name","v","_classPrivateFieldSet","heading","captureLabel","confirmLabel","retakeLabel","cancelLabel","fileNamePrefix","mediaConstraints","constraints","captureFormat","captureQuality","showCancelButton","facingMode","errorMessage","previewUrl","startingPreview","value","disconnectedCallback","stopStream","revokePreviewUrl","willUpdate","changed","has","normalizedValue","File","syncPreviewFromValue","updated","stream","queuePreviewStart","video","shadowRoot","querySelector","srcObject","render","renderViewport","renderStatus","close","onRetake","onConfirm","onCapture","contents","clearValue","width","videoWidth","clientWidth","height","videoHeight","clientHeight","canvas","document","createElement","context","getContext","drawImage","blob","Promise","resolve","toBlob","createFileFromBlob","contentType","extension","fileExtensionForMimeType","safePrefix","trim","Date","now","mimeType","startPreview","catch","getTracks","forEach","track","stop","file","URL","createObjectURL","revokeObjectURL","navigator","mediaDevices","getUserMedia","resolveMediaConstraints","requestUpdate","updateComplete","play","error","message","JSON","parse","Error","ideal","e","c","_initClass","_applyDecs","_Class","_identity","default","PhotoCaptureModal"],"sources":["../../src/components/photo-capture-modal/PhotoCaptureModal.styles.css","../../src/components/photo-capture-modal/PhotoCaptureModal.ts","../../src/components/photo-capture-modal/index.ts"],"sourcesContent":[".viewport {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 200px;\n border-radius: 0.5rem;\n overflow: hidden;\n background: color-mix(in srgb, #ffffff 92%, #000 8%);\n}\n\n.viewport video,\n.viewport img {\n display: block;\n width: 100%;\n max-width: 260px;\n height: auto;\n border-radius: 0.5rem;\n margin: 0 auto;\n object-fit: cover;\n}\n\n.status {\n width: 100%;\n text-align: center;\n color: var(--photo-capture-muted-text);\n font-size: 0.875rem;\n}\n\n.status.error {\n color: var(--color-error, #b00020);\n}\n","import { customElement, DialogComponent } from '@/lib/components'\nimport { html, PropertyValues, nothing } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport '@/components/button'\nimport '@/components/dialog'\nimport '@/components/dialog-content'\nimport '@/components/dialog-footer'\n\nimport styles from './PhotoCaptureModal.styles.css'\n\n@customElement('solid-ui-photo-capture-modal')\nexport default class PhotoCaptureModal extends DialogComponent<File> {\n static styles = styles\n\n @property({ type: String, reflect: true })\n accessor name = ''\n\n @property({ type: String, reflect: true })\n accessor heading = 'Take a photo'\n\n @property({ type: String, reflect: true })\n accessor captureLabel = 'Take Photo'\n\n @property({ type: String, reflect: true })\n accessor confirmLabel = 'Use Photo'\n\n @property({ type: String, reflect: true })\n accessor retakeLabel = 'Retake'\n\n @property({ type: String, attribute: 'cancel-label', reflect: true })\n accessor cancelLabel = 'Cancel'\n\n @property({ type: String, attribute: 'file-name-prefix', reflect: true })\n accessor fileNamePrefix = ''\n\n @property({ attribute: false })\n accessor mediaConstraints: MediaStreamConstraints | undefined = undefined\n\n @property({ type: String, reflect: true })\n accessor constraints = ''\n\n @property({ type: String, attribute: 'capture-format', reflect: true })\n accessor captureFormat = 'image/png'\n\n @property({ type: Number, attribute: 'capture-quality' })\n accessor captureQuality: number | undefined = undefined\n\n @property({ type: Boolean, attribute: 'show-cancel-button', reflect: true })\n accessor showCancelButton = true\n\n @property({ type: String, attribute: 'facing-mode', reflect: true })\n accessor facingMode = 'user'\n\n @state()\n accessor errorMessage = ''\n\n @state()\n accessor previewUrl = ''\n\n @state()\n accessor startingPreview = false\n\n @state()\n accessor value: File | null = null\n\n private stream: MediaStream | null = null\n\n disconnectedCallback () {\n this.stopStream()\n this.revokePreviewUrl()\n super.disconnectedCallback()\n }\n\n protected willUpdate (changed: PropertyValues<this>) {\n super.willUpdate(changed)\n\n if (changed.has('value')) {\n const normalizedValue = this.value instanceof File ? this.value : null\n\n if (normalizedValue !== this.value) {\n this.value = normalizedValue\n\n return\n }\n\n this.syncPreviewFromValue(normalizedValue)\n }\n }\n\n protected updated (changed: PropertyValues<this>) {\n if (\n !this.value &&\n !this.stream &&\n !this.startingPreview &&\n (changed.has('previewUrl') || changed.has('value'))\n ) {\n this.queuePreviewStart()\n }\n\n if (this.stream) {\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video && video.srcObject !== this.stream) {\n video.srcObject = this.stream\n }\n }\n }\n\n protected render () {\n return html`\n <solid-ui-dialog title=${this.heading}>\n <solid-ui-dialog-content>\n ${this.renderViewport()}\n ${this.renderStatus()}\n </solid-ui-dialog-content>\n <solid-ui-dialog-footer>\n ${this.showCancelButton\n ? html`<solid-ui-button variant=\"secondary\" @click=${() => this.close()}>${this.cancelLabel}</solid-ui-button>`\n : nothing\n }\n\n ${this.value\n ? html`\n <solid-ui-button @click=${this.onRetake}>${this.retakeLabel}</solid-ui-button>\n <solid-ui-button @click=${this.onConfirm}>${this.confirmLabel}</solid-ui-button>\n `\n : html`\n <solid-ui-button\n ?disabled=${this.startingPreview || !this.stream}\n @click=${this.onCapture}\n >\n ${this.captureLabel}\n </solid-ui-button>\n `\n }\n </solid-ui-dialog-footer>\n </solid-ui-dialog>\n `\n }\n\n private renderViewport () {\n const contents = this.previewUrl\n ? html`<img src=\"${this.previewUrl}\" alt=\"Captured photo preview\" />`\n : html`<video autoplay playsinline muted></video>`\n\n return html`<div class=\"viewport\">${contents}</div>`\n }\n\n private renderStatus () {\n if (this.errorMessage) {\n return html`<div class=\"status error\">${this.errorMessage}</div>`\n }\n\n if (this.startingPreview) {\n return html`<div class=\"status\">Opening camera…</div>`\n }\n\n if (!this.value) {\n return html`<div class=\"status\">Preview the camera and take a photo when ready.</div>`\n }\n\n return html`<div class=\"status\">Review the photo before confirming it.</div>`\n }\n\n private onRetake () {\n this.clearValue()\n this.queuePreviewStart()\n }\n\n private onConfirm () {\n if (!this.value) {\n return\n }\n\n this.close(this.value)\n }\n\n private async onCapture () {\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (!video) {\n return\n }\n\n const width = video.videoWidth || video.clientWidth || 640\n const height = video.videoHeight || video.clientHeight || 480\n const canvas = document.createElement('canvas')\n canvas.width = width\n canvas.height = height\n\n const context = canvas.getContext('2d')\n\n if (!context) {\n this.errorMessage = 'Unable to capture a photo in this browser'\n\n return\n }\n\n context.drawImage(video, 0, 0, width, height)\n\n const blob = await new Promise<Blob | null>(resolve => {\n canvas.toBlob(resolve, this.captureFormat, this.captureQuality)\n })\n\n if (!blob) {\n this.errorMessage = 'Unable to create an image from the current camera frame'\n\n return\n }\n\n this.value = this.createFileFromBlob(blob)\n this.errorMessage = ''\n }\n\n private createFileFromBlob (blob: Blob): File {\n const contentType = blob.type || this.captureFormat\n const extension = this.fileExtensionForMimeType(contentType)\n const safePrefix = (this.fileNamePrefix || this.name || 'photo').trim() || 'photo'\n\n return new File([blob], `${safePrefix}-${Date.now()}.${extension}`, { type: contentType })\n }\n\n private fileExtensionForMimeType (mimeType: string): string {\n switch (mimeType) {\n case 'image/jpeg':\n return 'jpg'\n case 'image/webp':\n return 'webp'\n case 'image/gif':\n return 'gif'\n default:\n return 'png'\n }\n }\n\n private queuePreviewStart () {\n this.startPreview().catch(() => undefined)\n }\n\n private stopStream () {\n if (!this.stream) {\n return\n }\n\n this.stream.getTracks().forEach(track => track.stop())\n this.stream = null\n\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video) {\n video.srcObject = null\n }\n }\n\n private syncPreviewFromValue (file: File | null) {\n this.revokePreviewUrl()\n\n if (!file) {\n return\n }\n\n this.stopStream()\n this.previewUrl = URL.createObjectURL(file)\n }\n\n private clearValue () {\n this.value = null\n this.errorMessage = ''\n }\n\n private revokePreviewUrl () {\n if (this.previewUrl) {\n URL.revokeObjectURL(this.previewUrl)\n }\n\n this.previewUrl = ''\n }\n\n private async startPreview () {\n if (this.value || this.startingPreview) {\n return\n }\n\n if (!navigator.mediaDevices?.getUserMedia) {\n this.errorMessage = 'Camera access is not available in this browser'\n\n return\n }\n\n this.startingPreview = true\n this.errorMessage = ''\n\n try {\n const stream = await navigator.mediaDevices.getUserMedia(this.resolveMediaConstraints())\n\n this.stream = stream\n this.requestUpdate()\n\n await this.updateComplete\n\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video) {\n video.srcObject = stream\n\n await video.play?.().catch(() => undefined)\n }\n } catch (error) {\n this.errorMessage = (error as Error)?.message || 'Unable to start the camera preview'\n } finally {\n this.startingPreview = false\n }\n }\n\n private resolveMediaConstraints (): MediaStreamConstraints {\n if (this.mediaConstraints) {\n return this.mediaConstraints\n }\n\n if (this.constraints) {\n try {\n return JSON.parse(this.constraints) as MediaStreamConstraints\n } catch (error) {\n throw new Error(`Invalid constraints JSON: ${(error as Error).message}`)\n }\n }\n\n return {\n video: this.facingMode\n ? { facingMode: { ideal: this.facingMode } }\n : true\n }\n }\n}\n","import PhotoCaptureModal from './PhotoCaptureModal'\n\nexport { PhotoCaptureModal }\nexport default PhotoCaptureModal\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACSmDO,IAAA,CAElDP,EAAc,8BAA8B,CAAC;AAAA,IAAAQ;AAAA,KAAAC,MAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,kBAAA,IAAAJ,QAAA,GAAAK,kBAAA,IAAAL,QAAA,GAAAM,kBAAA,IAAAN,QAAA,GAAAO,kBAAA,IAAAP,QAAA,GAAAQ,kBAAA,IAAAR,QAAA,GAAAS,kBAAA,IAAAT,QAAA,GAAAU,kBAAA,IAAAV,QAAA,GAAAW,kBAAA,IAAAX,QAAA,GAAAY,kBAAA,IAAAZ,QAAA,GAAAa,kBAAA,IAAAb,QAAA,GAAAc,kBAAA,IAAAd,QAAA,GAAAe,kBAAA,IAAAf,QAAA,GAAAgB,kBAAA,IAAAhB,QAAA,GAAAiB,MAAAC,IAI3CzB,EAAS;CAAE0B,MAAMC;CAAQC,SAAS;AAAK,CAAC,GAACC,IAGzC7B,EAAS;CAAE0B,MAAMC;CAAQC,SAAS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A;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAA5C,GAAA,GAAA,KAAA,GAlU8CN,CAAe,GAAAmD,IAAA0H,IAAA,cAAAC,GAAA;CAAAzH,cAAA;EAAA,MAAA9C,CAAA,GAAAoE,EAAA,MAAA,UAC5CtE,CAAM,GAAAsK,EAAA;CAAA;AAAA,GAAAhG,EAAAkG,GAAArK,IAAA,KAAA,CAAA,GAAAqK,GAAA;;;ACVxB,IAAA,KAAeG"}
|
|
1
|
+
{"version":3,"file":"photo-capture-modal-BhmL3kYD.js","names":["customElement","DialogComponent","html","nothing","property","state","styles","_classDecs","_PhotoCaptureModal","_PhotoCaptureModal2","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_nameDecs","type","String","reflect","_headingDecs","_captureLabelDecs","_confirmLabelDecs","_retakeLabelDecs","_cancelLabelDecs","attribute","_fileNamePrefixDecs","_mediaConstraintsDecs","_constraintsDecs","_captureFormatDecs","_captureQualityDecs","Number","_showCancelButtonDecs","Boolean","_facingModeDecs","_errorMessageDecs","_previewUrlDecs","_startingPreviewDecs","_valueDecs","_PhotoCaptureModal3","PhotoCaptureModal","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_name","_init_heading","_init_captureLabel","_init_confirmLabel","_init_retakeLabel","_init_cancelLabel","_init_fileNamePrefix","_init_mediaConstraints","undefined","_init_constraints","_init_captureFormat","_init_captureQuality","_init_showCancelButton","_init_facingMode","_init_errorMessage","_init_previewUrl","_init_startingPreview","_init_value","_defineProperty","_classPrivateFieldGet","name","v","_classPrivateFieldSet","heading","captureLabel","confirmLabel","retakeLabel","cancelLabel","fileNamePrefix","mediaConstraints","constraints","captureFormat","captureQuality","showCancelButton","facingMode","errorMessage","previewUrl","startingPreview","value","disconnectedCallback","stopStream","revokePreviewUrl","willUpdate","changed","has","normalizedValue","File","syncPreviewFromValue","updated","stream","queuePreviewStart","video","shadowRoot","querySelector","srcObject","render","renderViewport","renderStatus","close","onRetake","onConfirm","onCapture","contents","clearValue","width","videoWidth","clientWidth","height","videoHeight","clientHeight","canvas","document","createElement","context","getContext","drawImage","blob","Promise","resolve","toBlob","createFileFromBlob","contentType","extension","fileExtensionForMimeType","safePrefix","trim","Date","now","mimeType","startPreview","catch","getTracks","forEach","track","stop","file","URL","createObjectURL","revokeObjectURL","navigator","mediaDevices","getUserMedia","resolveMediaConstraints","requestUpdate","updateComplete","play","error","message","JSON","parse","Error","ideal","e","c","_initClass","_applyDecs","_Class","_identity","default","property","state","nothing","styles","PhotoCaptureModal","PhotoCaptureModal","DialogComponent","A","customElement","n","b","PhotoCaptureModal_styles_default","_Class","_PhotoCaptureModal3","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_initProto","_initClass","_classDecs","_nameDecs","_init_name","_headingDecs","_init_heading","_captureLabelDecs","_init_captureLabel","_confirmLabelDecs","_init_confirmLabel","_retakeLabelDecs","_init_retakeLabel","_cancelLabelDecs","_init_cancelLabel","_fileNamePrefixDecs","_init_fileNamePrefix","_mediaConstraintsDecs","_init_mediaConstraints","_constraintsDecs","_init_constraints","_captureFormatDecs","_init_captureFormat","_captureQualityDecs","_init_captureQuality","_showCancelButtonDecs","_init_showCancelButton","_facingModeDecs","_init_facingMode","_errorMessageDecs","_init_errorMessage","_previewUrlDecs","_init_previewUrl","_startingPreviewDecs","_init_startingPreview","_valueDecs","_init_value","_PhotoCaptureModal2","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","i","o","c","applyDec","m","h","y","v","g","u","w","S","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_identity","_PhotoCaptureModal","args","changed","normalizedValue","video","contents","width","height","canvas","context","blob","resolve","contentType","extension","safePrefix","mimeType","track","file","stream","error","photo_capture_modal_default"],"sources":["../../src/components/photo-capture-modal/PhotoCaptureModal.styles.css","../../src/components/photo-capture-modal/PhotoCaptureModal.ts","../../src/components/photo-capture-modal/index.ts"],"sourcesContent":[".viewport {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 200px;\n border-radius: 0.5rem;\n overflow: hidden;\n background: color-mix(in srgb, #ffffff 92%, #000 8%);\n}\n\n.viewport video,\n.viewport img {\n display: block;\n width: 100%;\n max-width: 260px;\n height: auto;\n border-radius: 0.5rem;\n margin: 0 auto;\n object-fit: cover;\n}\n\n.status {\n width: 100%;\n text-align: center;\n color: var(--photo-capture-muted-text);\n font-size: 0.875rem;\n}\n\n.status.error {\n color: var(--color-error, #b00020);\n}\n","import { customElement, DialogComponent } from '@/lib/components'\nimport { html, PropertyValues, nothing } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport '@/components/button'\nimport '@/components/dialog'\nimport '@/components/dialog-content'\nimport '@/components/dialog-footer'\n\nimport styles from './PhotoCaptureModal.styles.css'\n\n@customElement('solid-ui-photo-capture-modal')\nexport default class PhotoCaptureModal extends DialogComponent<File> {\n static styles = styles\n\n @property({ type: String, reflect: true })\n accessor name = ''\n\n @property({ type: String, reflect: true })\n accessor heading = 'Take a photo'\n\n @property({ type: String, reflect: true })\n accessor captureLabel = 'Take Photo'\n\n @property({ type: String, reflect: true })\n accessor confirmLabel = 'Use Photo'\n\n @property({ type: String, reflect: true })\n accessor retakeLabel = 'Retake'\n\n @property({ type: String, attribute: 'cancel-label', reflect: true })\n accessor cancelLabel = 'Cancel'\n\n @property({ type: String, attribute: 'file-name-prefix', reflect: true })\n accessor fileNamePrefix = ''\n\n @property({ attribute: false })\n accessor mediaConstraints: MediaStreamConstraints | undefined = undefined\n\n @property({ type: String, reflect: true })\n accessor constraints = ''\n\n @property({ type: String, attribute: 'capture-format', reflect: true })\n accessor captureFormat = 'image/png'\n\n @property({ type: Number, attribute: 'capture-quality' })\n accessor captureQuality: number | undefined = undefined\n\n @property({ type: Boolean, attribute: 'show-cancel-button', reflect: true })\n accessor showCancelButton = true\n\n @property({ type: String, attribute: 'facing-mode', reflect: true })\n accessor facingMode = 'user'\n\n @state()\n accessor errorMessage = ''\n\n @state()\n accessor previewUrl = ''\n\n @state()\n accessor startingPreview = false\n\n @state()\n accessor value: File | null = null\n\n private stream: MediaStream | null = null\n\n disconnectedCallback () {\n this.stopStream()\n this.revokePreviewUrl()\n super.disconnectedCallback()\n }\n\n protected willUpdate (changed: PropertyValues<this>) {\n super.willUpdate(changed)\n\n if (changed.has('value')) {\n const normalizedValue = this.value instanceof File ? this.value : null\n\n if (normalizedValue !== this.value) {\n this.value = normalizedValue\n\n return\n }\n\n this.syncPreviewFromValue(normalizedValue)\n }\n }\n\n protected updated (changed: PropertyValues<this>) {\n if (\n !this.value &&\n !this.stream &&\n !this.startingPreview &&\n (changed.has('previewUrl') || changed.has('value'))\n ) {\n this.queuePreviewStart()\n }\n\n if (this.stream) {\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video && video.srcObject !== this.stream) {\n video.srcObject = this.stream\n }\n }\n }\n\n protected render () {\n return html`\n <solid-ui-dialog title=${this.heading}>\n <solid-ui-dialog-content>\n ${this.renderViewport()}\n ${this.renderStatus()}\n </solid-ui-dialog-content>\n <solid-ui-dialog-footer>\n ${this.showCancelButton\n ? html`<solid-ui-button variant=\"secondary\" @click=${() => this.close()}>${this.cancelLabel}</solid-ui-button>`\n : nothing\n }\n\n ${this.value\n ? html`\n <solid-ui-button @click=${this.onRetake}>${this.retakeLabel}</solid-ui-button>\n <solid-ui-button @click=${this.onConfirm}>${this.confirmLabel}</solid-ui-button>\n `\n : html`\n <solid-ui-button\n ?disabled=${this.startingPreview || !this.stream}\n @click=${this.onCapture}\n >\n ${this.captureLabel}\n </solid-ui-button>\n `\n }\n </solid-ui-dialog-footer>\n </solid-ui-dialog>\n `\n }\n\n private renderViewport () {\n const contents = this.previewUrl\n ? html`<img src=\"${this.previewUrl}\" alt=\"Captured photo preview\" />`\n : html`<video autoplay playsinline muted></video>`\n\n return html`<div class=\"viewport\">${contents}</div>`\n }\n\n private renderStatus () {\n if (this.errorMessage) {\n return html`<div class=\"status error\">${this.errorMessage}</div>`\n }\n\n if (this.startingPreview) {\n return html`<div class=\"status\">Opening camera…</div>`\n }\n\n if (!this.value) {\n return html`<div class=\"status\">Preview the camera and take a photo when ready.</div>`\n }\n\n return html`<div class=\"status\">Review the photo before confirming it.</div>`\n }\n\n private onRetake () {\n this.clearValue()\n this.queuePreviewStart()\n }\n\n private onConfirm () {\n if (!this.value) {\n return\n }\n\n this.close(this.value)\n }\n\n private async onCapture () {\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (!video) {\n return\n }\n\n const width = video.videoWidth || video.clientWidth || 640\n const height = video.videoHeight || video.clientHeight || 480\n const canvas = document.createElement('canvas')\n canvas.width = width\n canvas.height = height\n\n const context = canvas.getContext('2d')\n\n if (!context) {\n this.errorMessage = 'Unable to capture a photo in this browser'\n\n return\n }\n\n context.drawImage(video, 0, 0, width, height)\n\n const blob = await new Promise<Blob | null>(resolve => {\n canvas.toBlob(resolve, this.captureFormat, this.captureQuality)\n })\n\n if (!blob) {\n this.errorMessage = 'Unable to create an image from the current camera frame'\n\n return\n }\n\n this.value = this.createFileFromBlob(blob)\n this.errorMessage = ''\n }\n\n private createFileFromBlob (blob: Blob): File {\n const contentType = blob.type || this.captureFormat\n const extension = this.fileExtensionForMimeType(contentType)\n const safePrefix = (this.fileNamePrefix || this.name || 'photo').trim() || 'photo'\n\n return new File([blob], `${safePrefix}-${Date.now()}.${extension}`, { type: contentType })\n }\n\n private fileExtensionForMimeType (mimeType: string): string {\n switch (mimeType) {\n case 'image/jpeg':\n return 'jpg'\n case 'image/webp':\n return 'webp'\n case 'image/gif':\n return 'gif'\n default:\n return 'png'\n }\n }\n\n private queuePreviewStart () {\n this.startPreview().catch(() => undefined)\n }\n\n private stopStream () {\n if (!this.stream) {\n return\n }\n\n this.stream.getTracks().forEach(track => track.stop())\n this.stream = null\n\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video) {\n video.srcObject = null\n }\n }\n\n private syncPreviewFromValue (file: File | null) {\n this.revokePreviewUrl()\n\n if (!file) {\n return\n }\n\n this.stopStream()\n this.previewUrl = URL.createObjectURL(file)\n }\n\n private clearValue () {\n this.value = null\n this.errorMessage = ''\n }\n\n private revokePreviewUrl () {\n if (this.previewUrl) {\n URL.revokeObjectURL(this.previewUrl)\n }\n\n this.previewUrl = ''\n }\n\n private async startPreview () {\n if (this.value || this.startingPreview) {\n return\n }\n\n if (!navigator.mediaDevices?.getUserMedia) {\n this.errorMessage = 'Camera access is not available in this browser'\n\n return\n }\n\n this.startingPreview = true\n this.errorMessage = ''\n\n try {\n const stream = await navigator.mediaDevices.getUserMedia(this.resolveMediaConstraints())\n\n this.stream = stream\n this.requestUpdate()\n\n await this.updateComplete\n\n const video = this.shadowRoot?.querySelector<HTMLVideoElement>('video')\n\n if (video) {\n video.srcObject = stream\n\n await video.play?.().catch(() => undefined)\n }\n } catch (error) {\n this.errorMessage = (error as Error)?.message || 'Unable to start the camera preview'\n } finally {\n this.startingPreview = false\n }\n }\n\n private resolveMediaConstraints (): MediaStreamConstraints {\n if (this.mediaConstraints) {\n return this.mediaConstraints\n }\n\n if (this.constraints) {\n try {\n return JSON.parse(this.constraints) as MediaStreamConstraints\n } catch (error) {\n throw new Error(`Invalid constraints JSON: ${(error as Error).message}`)\n }\n }\n\n return {\n video: this.facingMode\n ? { facingMode: { ideal: this.facingMode } }\n : true\n }\n }\n}\n","import PhotoCaptureModal from './PhotoCaptureModal'\n\nexport { PhotoCaptureModal }\nexport default PhotoCaptureModal\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACSmDO,IAAA,CAElDP,EAAc,8BAA8B,CAAC;AAAA,IAAAQ;AAAA,KAAAC,MAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,kBAAA,IAAAJ,QAAA,GAAAK,kBAAA,IAAAL,QAAA,GAAAM,kBAAA,IAAAN,QAAA,GAAAO,kBAAA,IAAAP,QAAA,GAAAQ,kBAAA,IAAAR,QAAA,GAAAS,kBAAA,IAAAT,QAAA,GAAAU,kBAAA,IAAAV,QAAA,GAAAW,kBAAA,IAAAX,QAAA,GAAAY,kBAAA,IAAAZ,QAAA,GAAAa,kBAAA,IAAAb,QAAA,GAAAc,kBAAA,IAAAd,QAAA,GAAAe,kBAAA,IAAAf,QAAA,GAAAgB,kBAAA,IAAAhB,QAAA,GAAAiB,MAAAC,IAI3CzB,EAAS;CAAE0B,MAAMC;CAAQC,SAAS;AAAK,CAAC,GAACC,IAGzC7B,EAAS;CAAE0B,MAAMC;CAAQC,SAAS;AAAK,CAAC,GAACE,KAGzC9B,EAAS;CAAE0B,MAAMC;CAAQC,SAAS;AAAK,CAAC,GAACG,KAGzC/B,EAAS;CAAE0B,MAAMC;C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A;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAA5C,GAAA,GAAA,KAAA,GAlU8CN,CAAe,GAAAmD,IAAA0H,IAAA,cAAAC,GAAA;CAAAzH,cAAA;EAAA,MAAA9C,CAAA,GAAAoE,EAAA,MAAA,UAC5CtE,CAAM,GAAAsK,EAAA;CAAA;AAAA,GAAAhG,EAAAkG,GAAArK,IAAA,KAAA,CAAA,GAAAqK,GAAA;;;ACVxB,IAAAoI,KAAe7H"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, o as t } from "./auth-
|
|
1
|
+
import { n as e, o as t } from "./auth-DrN7Ex4E.js";
|
|
2
2
|
import { g as n, i as r, o as i, u as a } from "./components-BHoVP7zE.js";
|
|
3
3
|
import { n as o } from "./DialogProvider-BFllJFfq.js";
|
|
4
4
|
import "./dialogs-root-ngPW2Q6K.js";
|
|
@@ -212,4 +212,4 @@ var k = E;
|
|
|
212
212
|
//#endregion
|
|
213
213
|
export { E as n, k as t };
|
|
214
214
|
|
|
215
|
-
//# sourceMappingURL=provider-
|
|
215
|
+
//# sourceMappingURL=provider-D5r57fK1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-D5r57fK1.js","names":["customElement","WebComponent","provide","html","property","authContext","SolidAuth","DEFAULT_SIGNUP_URL","_classDecs","_Provider","_A","WeakMap","_B","_ref","_signupUrlDecs","type","String","reflect","_authDecs","context","Provider","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_signupUrl","_init_auth","_classPrivateFieldGet","signupUrl","v","_classPrivateFieldSet","auth","connectedCallback","initialize","willUpdate","changedProperties","has","render","_Provider2","e","c","_initClass","_applyDecs","default","property","provide","Provider","Provider","SolidAuth","authContext","customElement","n","WebComponent","b","e","_Provider2","_initProto","_initClass","_classDecs","_signupUrlDecs","_init_signupUrl","_authDecs","_init_auth","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_applyDecs","i","o","c","applyDec","m","h","y","v","g","u","w","S","A","d","p","_setFunctionName","P","j","D","E","I","O","k","F","l","f","N","_checkInRHS","_toPropertyKey","_toPrimitive","t","_Provider","_A","_B","args","changedProperties","provider_default"],"sources":["../../src/components/provider/Provider.ts","../../src/components/provider/index.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { provide } from '@lit/context'\nimport { html, type PropertyValues } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { authContext } from '@/lib/auth'\nimport { SolidAuth, DEFAULT_SIGNUP_URL } from '@/lib/auth'\n\nimport '@/components/dialogs-root'\n\n@customElement('solid-ui-provider')\nexport default class Provider extends WebComponent {\n @property({ type: String, reflect: true })\n accessor signupUrl: string | undefined\n\n @provide({ context: authContext })\n private accessor auth = new SolidAuth()\n\n async connectedCallback () {\n super.connectedCallback()\n\n await this.auth.initialize()\n }\n\n protected willUpdate (changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties)\n\n if (changedProperties.has('signupUrl')) {\n this.auth.signupUrl = this.signupUrl ?? DEFAULT_SIGNUP_URL\n }\n }\n\n protected render () {\n return html`\n <slot></slot>\n <solid-ui-dialogs-root></solid-ui-dialogs-root>\n `\n }\n}\n","import Provider from './Provider'\n\nexport { Provider }\nexport default Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA;CAAAI;CAAA;CAAA;AAAA,CAAA,GAAAV,GAAA,GAAA,KAAA,GA3BqCP,CAAY,GAAAwC,EAAA;;;ACPlD,IAAAoE,IAAe/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-BYu9q8lA.js","names":["e","t"],"sources":["../../node_modules/@lit/reactive-element/decorators/base.js","../../node_modules/@lit/reactive-element/decorators/query.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n"],"x_google_ignoreList":[0,1],"mappings":";AAKA,IAAMA,KAAG,GAAE,GAAE,OAAK,EAAE,eAAa,CAAC,GAAE,EAAE,aAAW,CAAC,GAAE,QAAQ,YAAoB,OAAO,KAAjB,YAAoB,OAAO,eAAe,GAAE,
|
|
1
|
+
{"version":3,"file":"query-BYu9q8lA.js","names":["e","t","e$1","c","e","t","r","s","n","i"],"sources":["../../node_modules/@lit/reactive-element/decorators/base.js","../../node_modules/@lit/reactive-element/decorators/query.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n"],"x_google_ignoreList":[0,1],"mappings":";AAKA,IAAMA,KAAG,GAAE,GAAE,OAAK,EAAE,eAAa,CAAC,GAAE,EAAE,aAAW,CAAC,GAAE,QAAQ,YAAoB,OAAO,KAAjB,YAAoB,OAAO,eAAe,GAAE,GAAEG,CAAC,GAAEA;;;ACApH,SAASC,EAAE,GAAE,GAAE;CAAC,QAAO,GAAE,GAAE,MAAI;EAAC,IAAM,KAAE,MAAGC,EAAE,YAAY,cAAcD,CAAC,KAAG;EAAK,IAAGE,GAAE;GAAC,IAAK,EAAC,KAAIF,GAAE,KAAIE,MAAa,OAAOC,KAAjB,WAAmBC,IAAEC,YAAQ;IAAC,IAAMJ,IAAE,OAAO;IAAE,OAAM;KAAC,MAAK;MAAC,OAAO,KAAKA;KAAE;KAAE,IAAI,GAAE;MAAC,KAAKA,KAAGD;KAAC;IAAC;GAAC,EAAA,CAAG;GAAE,OAAOH,EAAEO,GAAED,GAAE,EAAC,MAAK;IAAC,IAAIF,IAAED,EAAE,KAAK,IAAI;IAAE,OAAgBC,MAAT,KAAK,MAAQ,IAAE,EAAE,IAAI,IAAUA,MAAP,QAAU,KAAK,eAAaC,EAAE,KAAK,MAAKD,CAAC,IAAGA;GAAC,EAAC,CAAC;EAAC;EAAC,OAAOJ,EAAEO,GAAED,GAAE,EAAC,MAAK;GAAC,OAAO,EAAE,IAAI;EAAC,EAAC,CAAC;CAAC;AAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as e, h as t } from "./index.esm-AZPmKqjU.js";
|
|
2
2
|
import { b as n, g as r, i, o as a, r as o, u as s } from "./components-BHoVP7zE.js";
|
|
3
|
-
import { a as c, i as l, o as u, r as d, s as f } from "./rdf-input-
|
|
3
|
+
import { a as c, i as l, o as u, r as d, s as f } from "./rdf-input-DeDhyQ3p.js";
|
|
4
4
|
//#region src/components/rdf-form/RDFForm.ts
|
|
5
5
|
var p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j;
|
|
6
6
|
function M(e, t, n) {
|
|
@@ -236,17 +236,17 @@ j = (_ = n({
|
|
|
236
236
|
r && n.updater?.editable(r) !== void 0 && n.updater?.editable(r) !== !1 && (this.entireDataIsReadonly = !1);
|
|
237
237
|
let i = u(this.currentStore, U(this.formUrl));
|
|
238
238
|
if (!i) throw Error("No ui:Form found in " + U(this.formUrl));
|
|
239
|
-
let a =
|
|
240
|
-
let r = n.each(
|
|
239
|
+
let a = e(U(this.formUrl)), o = n.each(i, t.ui("parts"), null, a), c = (f(n, o) || []).flatMap((e) => e && typeof e == "object" && "elements" in e && Array.isArray(e.elements) ? e.elements : [e]).map((e) => {
|
|
240
|
+
let r = n.each(e, t.rdf("type"), null, a)[0], i = r ? r.value || String(r) : e.value || String(e), o = i.lastIndexOf("#");
|
|
241
241
|
return {
|
|
242
|
-
value:
|
|
242
|
+
value: e,
|
|
243
243
|
fieldValue: o >= 0 ? i.slice(o + 1) : i
|
|
244
244
|
};
|
|
245
245
|
});
|
|
246
246
|
return s`
|
|
247
247
|
<form>
|
|
248
|
-
${c.map((
|
|
249
|
-
switch (
|
|
248
|
+
${c.map((t) => {
|
|
249
|
+
switch (t.fieldValue) {
|
|
250
250
|
case "PhoneField":
|
|
251
251
|
case "EmailField":
|
|
252
252
|
case "ColorField":
|
|
@@ -260,23 +260,23 @@ j = (_ = n({
|
|
|
260
260
|
case "TextField":
|
|
261
261
|
case "SingleLineTextField":
|
|
262
262
|
case "NamedNodeURIField": return s` <solid-ui-rdf-input
|
|
263
|
-
.formSubject=${t
|
|
264
|
-
.dataSubject=${
|
|
263
|
+
.formSubject=${e(t.value)}
|
|
264
|
+
.dataSubject=${e(r)}
|
|
265
265
|
.storeVersion=${this._loadVersion}
|
|
266
266
|
.readonly=${this.entireDataIsReadonly}
|
|
267
267
|
></solid-ui-rdf-input>
|
|
268
268
|
<br>`;
|
|
269
|
-
case "MultiLineTextField": return s`<input .rdf=${
|
|
270
|
-
case "BooleanField": return s`<input .rdf=${
|
|
271
|
-
case "TristateField": return s`<input .rdf=${
|
|
272
|
-
case "Classifier": return s`<input .rdf=${
|
|
273
|
-
case "Choice": return s`<input .rdf=${
|
|
274
|
-
case "Multiple": return s`<input .rdf=${
|
|
275
|
-
case "Options": return s`<input .rdf=${
|
|
276
|
-
case "AutocompleteField": return s`<input .rdf=${
|
|
269
|
+
case "MultiLineTextField": return s`<input .rdf=${t}></input>`;
|
|
270
|
+
case "BooleanField": return s`<input .rdf=${t}></input>`;
|
|
271
|
+
case "TristateField": return s`<input .rdf=${t}></input>`;
|
|
272
|
+
case "Classifier": return s`<input .rdf=${t}></input>`;
|
|
273
|
+
case "Choice": return s`<input .rdf=${t}></input>`;
|
|
274
|
+
case "Multiple": return s`<input .rdf=${t}></input>`;
|
|
275
|
+
case "Options": return s`<input .rdf=${t}></input>`;
|
|
276
|
+
case "AutocompleteField": return s`<input .rdf=${t}></input>`;
|
|
277
277
|
case "Comment":
|
|
278
|
-
case "Heading": return s`<input .rdf=${
|
|
279
|
-
default: return s`<div>Unknown part type: ${
|
|
278
|
+
case "Heading": return s`<input .rdf=${t}></input>`;
|
|
279
|
+
default: return s`<div>Unknown part type: ${t}</div>`;
|
|
280
280
|
}
|
|
281
281
|
})}
|
|
282
282
|
</form>
|
|
@@ -287,7 +287,7 @@ j = (_ = n({
|
|
|
287
287
|
}
|
|
288
288
|
async loadDocumentsIfNeeded() {
|
|
289
289
|
let e = this.currentStore, t = U(this.formUrl), n = U(this.subjectUrl);
|
|
290
|
-
if (
|
|
290
|
+
if (t && n) try {
|
|
291
291
|
await c(e, t), await c(e, n), this._loadVersion += 1, this._documentsLoaded = !0;
|
|
292
292
|
} catch (e) {
|
|
293
293
|
console.error("Failed to load RDF documents", e);
|
|
@@ -336,4 +336,4 @@ var Q = W;
|
|
|
336
336
|
//#endregion
|
|
337
337
|
export { W as n, Q as t };
|
|
338
338
|
|
|
339
|
-
//# sourceMappingURL=rdf-form-
|
|
339
|
+
//# sourceMappingURL=rdf-form-B2zTR8Qv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdf-form-B2zTR8Qv.js","names":["property","state","html","consume","customElement","WebComponent","ns","fetchData","findForm","sortBySequence","sym","DEFAULT_STORE","storeContext","urlConverter","fromAttribute","value","URL","toAttribute","hrefFromUrlValue","href","_classDecs","_RDFForm","_A","WeakMap","_B","_C","_D","_E","_F","_G","_ref","_storeContextDecs","context","subscribe","_passedInStoreDecs","attribute","_entireDataIsReadonlyDecs","_loadVersionDecs","_documentsLoadedDecs","_formUrlDecs","converter","_subjectUrlDecs","RDFForm","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_passedInStore","_init_entireDataIsReadonly","_init__loadVersion","_init__documentsLoaded","_init_formUrl","_init_subjectUrl","_classPrivateFieldGet","v","_classPrivateFieldSet","passedInStore","currentStore","store","entireDataIsReadonly","_loadVersion","_documentsLoaded","formUrl","subjectUrl","render","updater","editable","undefined","formRoot","Error","formDocument","parts","each","ui","partsBySequence","partItems","flatMap","item","Array","isArray","elements","uiFields","map","types","rdf","typeNode","String","hashIndex","lastIndexOf","fieldValue","slice","part","willUpdate","changedProperties","has","loadDocumentsIfNeeded","error","console","_RDFForm2","e","c","_initClass","_applyDecs","default","consume","property","state","sym","ns","RDFForm","RDFForm","namedNode","ns_default","c","customElement","WebComponent","b","fetchData","storeContext","findForm","DEFAULT_STORE","sortBySequence","_RDFForm2","_initProto","_initClass","_classDecs","_storeContextDecs","_init_storeContext","_passedInStoreDecs","_init_passedInStore","_entireDataIsReadonlyDecs","_init_entireDataIsReadonly","_loadVersionDecs","_init__loadVersion","_documentsLoadedDecs","_init__documentsLoaded","_formUrlDecs","_init_formUrl","_subjectUrlDecs","_init_subjectUrl","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_applyDecs","i","n","o","applyDec","m","h","y","v","g","u","w","S","A","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPropertyKey","_toPrimitive","t","e","urlConverter","value","hrefFromUrlValue","_RDFForm","_A","_B","_C","_D","_E","_F","_G","args","store","subjectUrl","formRoot","formDocument","parts","uiFields","item","typeNode","hashIndex","part","changedProperties","formUrl","error","rdf_form_default"],"sources":["../../src/components/rdf-form/RDFForm.ts","../../src/components/rdf-form/index.ts"],"sourcesContent":["import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport type { PropertyValues } from 'lit'\nimport { consume } from '@lit/context'\nimport { customElement, WebComponent } from '@/lib/components'\nimport ns from '../../lib/ns'\nimport { fetchData, findForm, sortBySequence } from '../../lib/forms/rdfFormsHelper'\nimport { sym, LiveStore } from 'rdflib'\nimport '@/components/rdf-input'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\n\nconst urlConverter = {\n fromAttribute (value: string | null): URL | null {\n if (!value) return null\n\n try {\n return new URL(value)\n } catch {\n return null\n }\n },\n toAttribute (value: URL | null) {\n if (!value) return null\n return value\n }\n}\n\nconst hrefFromUrlValue = (value: URL | null): string =>\n value?.href ?? ''\n\n@customElement('solid-ui-rdf-form')\nexport default class RDFForm extends WebComponent {\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false })\n accessor passedInStore: LiveStore | null = null\n\n private get currentStore (): LiveStore {\n return this.passedInStore ?? this.storeContext.store\n }\n\n @state()\n private accessor entireDataIsReadonly: boolean = true // to protect data, we default to not editable\n\n @state()\n private accessor _loadVersion = 0\n\n @state()\n private accessor _documentsLoaded = false\n\n @property({ converter: urlConverter })\n accessor formUrl: URL | null = null\n\n @property({ converter: urlConverter })\n accessor subjectUrl: URL | null = null\n\n render () {\n if (!this._documentsLoaded) {\n return html``\n }\n\n const store = this.currentStore\n\n const subjectUrl = hrefFromUrlValue(this.subjectUrl)\n if (subjectUrl && store.updater?.editable(subjectUrl) !== undefined && store.updater?.editable(subjectUrl) !== false) {\n this.entireDataIsReadonly = false\n }\n\n const formRoot = findForm(this.currentStore, hrefFromUrlValue(this.formUrl)) // If there are more 'a ui:Form' elements in a form file\n if (!formRoot) throw new Error('No ui:Form found in ' + hrefFromUrlValue(this.formUrl))\n\n const formDocument = sym(hrefFromUrlValue(this.formUrl)) // rdflib NamedNode for the document\n const parts = store.each(formRoot, ns.ui('parts'), null, formDocument)\n const partsBySequence = sortBySequence(store, parts)\n const partItems = (partsBySequence || []).flatMap(item => {\n if (item && typeof item === 'object' && 'elements' in item && Array.isArray((item as any).elements)) {\n return (item as any).elements\n }\n return [item]\n })\n const uiFields = partItems.map(item => {\n const types = store.each(item as any, ns.rdf('type'), null, formDocument)\n const typeNode = types[0]\n const value = typeNode ? ((typeNode as any).value || String(typeNode)) : ((item as any).value || String(item))\n const hashIndex = value.lastIndexOf('#')\n return {\n value: item,\n fieldValue: hashIndex >= 0 ? value.slice(hashIndex + 1) : value\n }\n })\n\n return html`\n <form>\n ${uiFields.map(part => {\n switch (part.fieldValue) {\n case 'PhoneField':\n case 'EmailField':\n case 'ColorField':\n case 'DateField':\n case 'DateTimeField':\n case 'TimeField':\n case 'NumericField':\n case 'IntegerField':\n case 'DecimalField':\n case 'FloatField':\n case 'TextField':\n case 'SingleLineTextField':\n case 'NamedNodeURIField': {\n return html` <solid-ui-rdf-input \n .formSubject=${sym(part.value)} \n .dataSubject=${sym(subjectUrl)}\n .storeVersion=${this._loadVersion}\n .readonly=${this.entireDataIsReadonly}\n ></solid-ui-rdf-input>\n <br>`\n }\n case 'MultiLineTextField':\n return html`<input .rdf=${part}></input>`\n case 'BooleanField':\n return html`<input .rdf=${part}></input>`\n case 'TristateField':\n return html`<input .rdf=${part}></input>`\n case 'Classifier':\n return html`<input .rdf=${part}></input>`\n case 'Choice':\n return html`<input .rdf=${part}></input>`\n case 'Multiple':\n return html`<input .rdf=${part}></input>`\n case 'Options':\n return html`<input .rdf=${part}></input>`\n case 'AutocompleteField':\n return html`<input .rdf=${part}></input>`\n case 'Comment':\n case 'Heading':\n return html`<input .rdf=${part}></input>`\n default:\n return html`<div>Unknown part type: ${part}</div>`\n }\n })}\n </form>\n `\n }\n\n protected override willUpdate (changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties)\n if (changedProperties.has('formUrl') ||\n changedProperties.has('subjectUrl') ||\n changedProperties.has('passedInStore')\n ) {\n this.loadDocumentsIfNeeded()\n }\n }\n\n private async loadDocumentsIfNeeded () {\n const store = this.currentStore\n const formUrl = hrefFromUrlValue(this.formUrl)\n const subjectUrl = hrefFromUrlValue(this.subjectUrl)\n\n if (!formUrl || !subjectUrl) return\n\n try {\n await fetchData(store, formUrl)\n await fetchData(store, subjectUrl)\n this._loadVersion += 1\n this._documentsLoaded = true\n } catch (error) {\n console.error('Failed to load RDF documents', error)\n }\n }\n}\n","import RDFForm from './RDFForm'\n\nexport { RDFForm }\nexport default RDFForm\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMa,IAAe;CACnBC,cAAe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;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GA3IoCf,CAAY,GAAAiG,EAAA;;;AC5BjD,IAAAuG,IAAe/F"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as i, u as a } from "./style-
|
|
1
|
+
import { C as e, L as t, S as n, h as r } from "./index.esm-AZPmKqjU.js";
|
|
2
|
+
import { t as i, u as a } from "./style-Dpwrc8CC.js";
|
|
3
3
|
import { b as o, g as s, i as c, o as l, r as u, u as d, x as f, y as p } from "./components-BHoVP7zE.js";
|
|
4
4
|
import "./input-BIhn_8nf.js";
|
|
5
5
|
//#region src/lib/forms/rdfFormsHelper.ts
|
|
6
6
|
async function m(e, t) {
|
|
7
|
-
let
|
|
8
|
-
return e.holds(void 0, void 0, void 0,
|
|
7
|
+
let r = n(t);
|
|
8
|
+
return e.holds(void 0, void 0, void 0, r) && e.removeStatements(e.statementsMatching(void 0, void 0, void 0, r)), await e.fetcher.load(t, {
|
|
9
9
|
force: !0,
|
|
10
10
|
clearPreviousData: !0
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function h(e, t) {
|
|
14
|
-
let
|
|
15
|
-
let
|
|
14
|
+
let n = t.map((t) => {
|
|
15
|
+
let n = e.any(t, r.ui("sequence")), i = n ? Number(n.value) : 9999;
|
|
16
16
|
return [Number.isNaN(i) ? 9999 : i, t];
|
|
17
17
|
});
|
|
18
|
-
return
|
|
18
|
+
return n.sort((e, t) => e[0] - t[0]), n.map((e) => e[1]);
|
|
19
19
|
}
|
|
20
20
|
function g(e, t) {
|
|
21
21
|
let n = e.findTypeURIs(t), r = e.bottomTypeURIs(n), i = [];
|
|
@@ -25,76 +25,76 @@ function g(e, t) {
|
|
|
25
25
|
function _(e, t) {
|
|
26
26
|
let i = t.split("#")[0], a = t.includes("#") ? t.split("#")[1] : null;
|
|
27
27
|
if (a) {
|
|
28
|
-
let t =
|
|
29
|
-
if (e.holds(t,
|
|
28
|
+
let t = n(i + "#" + a);
|
|
29
|
+
if (e.holds(t, r.rdf("type"), r.ui("Form"))) return t;
|
|
30
30
|
}
|
|
31
|
-
return e.each(null,
|
|
31
|
+
return e.each(null, r.rdf("type"), r.ui("Form")).find((e) => e.termType === "NamedNode") || null;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/lib/forms/fieldParams.ts
|
|
35
35
|
var v = {
|
|
36
|
-
[
|
|
36
|
+
[r.ui("ColorField").uri]: {
|
|
37
37
|
size: 9,
|
|
38
38
|
type: "color",
|
|
39
39
|
style: "height: 3em;",
|
|
40
40
|
dt: "color",
|
|
41
41
|
pattern: /^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/
|
|
42
42
|
},
|
|
43
|
-
[
|
|
43
|
+
[r.ui("DateField").uri]: {
|
|
44
44
|
size: 20,
|
|
45
45
|
type: "date",
|
|
46
46
|
dt: "date",
|
|
47
47
|
pattern: /^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/
|
|
48
48
|
},
|
|
49
|
-
[
|
|
49
|
+
[r.ui("DateTimeField").uri]: {
|
|
50
50
|
size: 20,
|
|
51
51
|
type: "datetime-local",
|
|
52
52
|
dt: "dateTime",
|
|
53
53
|
pattern: /^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/
|
|
54
54
|
},
|
|
55
|
-
[
|
|
55
|
+
[r.ui("TimeField").uri]: {
|
|
56
56
|
size: 10,
|
|
57
57
|
type: "time",
|
|
58
58
|
dt: "time",
|
|
59
59
|
pattern: /^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[r.ui("IntegerField").uri]: {
|
|
62
62
|
size: 12,
|
|
63
63
|
style: "text-align: right;",
|
|
64
64
|
dt: "integer",
|
|
65
65
|
pattern: /^\s*-?[0-9]+\s*$/
|
|
66
66
|
},
|
|
67
|
-
[
|
|
67
|
+
[r.ui("DecimalField").uri]: {
|
|
68
68
|
size: 12,
|
|
69
69
|
style: "text-align: right;",
|
|
70
70
|
dt: "decimal",
|
|
71
71
|
pattern: /^\s*-?[0-9]*(\.[0-9]*)?\s*$/
|
|
72
72
|
},
|
|
73
|
-
[
|
|
73
|
+
[r.ui("FloatField").uri]: {
|
|
74
74
|
size: 12,
|
|
75
75
|
style: "text-align: right;",
|
|
76
76
|
dt: "float",
|
|
77
77
|
pattern: /^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/
|
|
78
78
|
},
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
79
|
+
[r.ui("SingleLineTextField").uri]: {},
|
|
80
|
+
[r.ui("NamedNodeURIField").uri]: { namedNode: !0 },
|
|
81
|
+
[r.ui("TextField").uri]: {},
|
|
82
|
+
[r.ui("PhoneField").uri]: {
|
|
83
83
|
size: 20,
|
|
84
84
|
defaultInputValue: "tel:",
|
|
85
85
|
pattern: /^\+?[\d-]+[\d]*$/
|
|
86
86
|
},
|
|
87
|
-
[
|
|
87
|
+
[r.ui("EmailField").uri]: {
|
|
88
88
|
size: 30,
|
|
89
89
|
defaultInputValue: "mailto:",
|
|
90
90
|
pattern: /^\s*.*@.*\..*\s*$/
|
|
91
91
|
},
|
|
92
|
-
[
|
|
93
|
-
[
|
|
92
|
+
[r.ui("Group").uri]: { style: i.formGroupStyle },
|
|
93
|
+
[r.ui("Comment").uri]: {
|
|
94
94
|
element: "p",
|
|
95
95
|
style: i.commentStyle
|
|
96
96
|
},
|
|
97
|
-
[
|
|
97
|
+
[r.ui("Heading").uri]: {
|
|
98
98
|
element: "h3",
|
|
99
99
|
style: i.formHeadingStyle
|
|
100
100
|
}
|
|
@@ -326,10 +326,10 @@ L = (T = o({
|
|
|
326
326
|
super(), z(this, J, (S(this), E(this, y))), z(this, Y, O(this, null)), z(this, X, A(this, null)), z(this, Z, M(this, 0)), z(this, Q, P(this, null)), R(this, "_updateInFlight", !1), R(this, "_pendingUpdateValue", null), z(this, $, I(this, !0)), this.id = p();
|
|
327
327
|
}
|
|
328
328
|
render() {
|
|
329
|
-
let e = this.getDocument(this.formSubject), t = this.getFormProperty(this.formSubject,
|
|
329
|
+
let e = this.getDocument(this.formSubject), t = this.getFormProperty(this.formSubject, r.ui("property"), e), n = this.getInputLabel(this.formSubject, t, e), i = this.getReadOnly(this.readonly, this.formSubject, e), a = this.formSubject ? g(this.storeContext.store, this.formSubject) : void 0, o = a ? v[a] ?? {} : {}, s = o.type ?? "text", c = this.getSelectedTerm(this.dataSubject, t, this.formSubject, o), l = i ? "" : this.defaultInputValue(o), u = this._updateInFlight || this._pendingUpdateValue !== null ? this.localInputValue ?? "" : this.termToInputValue(c);
|
|
330
330
|
return d`
|
|
331
331
|
<solid-ui-input
|
|
332
|
-
label="${
|
|
332
|
+
label="${n}"
|
|
333
333
|
name="name-${this.id}"
|
|
334
334
|
.value=${u}
|
|
335
335
|
.placeholder=${l}
|
|
@@ -344,16 +344,16 @@ L = (T = o({
|
|
|
344
344
|
getFormProperty(e, t, n) {
|
|
345
345
|
if (e) return this.storeContext.store.any(e, t, null, n);
|
|
346
346
|
}
|
|
347
|
-
getInputLabel(e, t,
|
|
347
|
+
getInputLabel(e, t, n) {
|
|
348
348
|
if (!e) return "";
|
|
349
|
-
let i = this.storeContext.store.any(e,
|
|
349
|
+
let i = this.storeContext.store.any(e, r.ui("label"), null, n), o = t ? a(t, !0) : "";
|
|
350
350
|
return i ? i.value : o;
|
|
351
351
|
}
|
|
352
|
-
getReadOnly(e, t,
|
|
353
|
-
return t && e === !1 ? !!this.storeContext.store.anyJS(t,
|
|
352
|
+
getReadOnly(e, t, n) {
|
|
353
|
+
return t && e === !1 ? !!this.storeContext.store.anyJS(t, r.ui("suppressEmptyUneditable"), null, n) : e;
|
|
354
354
|
}
|
|
355
|
-
getSelectedTerm(e, t,
|
|
356
|
-
let a =
|
|
355
|
+
getSelectedTerm(e, t, n, i) {
|
|
356
|
+
let a = n ? this.storeContext.store.any(n, r.ui("default")) : void 0;
|
|
357
357
|
return !t || !e ? a : this.storeContext.store.any(e, t) || a;
|
|
358
358
|
}
|
|
359
359
|
termToInputValue(e) {
|
|
@@ -373,9 +373,9 @@ L = (T = o({
|
|
|
373
373
|
}
|
|
374
374
|
async runPendingUpdate() {
|
|
375
375
|
if (this._pendingUpdateValue === null) return;
|
|
376
|
-
let
|
|
376
|
+
let n = this._pendingUpdateValue;
|
|
377
377
|
this._pendingUpdateValue = null, this._updateInFlight = !0;
|
|
378
|
-
let i = this.getFormProperty(this.formSubject,
|
|
378
|
+
let i = this.getFormProperty(this.formSubject, r.ui("property"), this.getDocument(this.formSubject));
|
|
379
379
|
if (!i || !this.dataSubject) {
|
|
380
380
|
this._updateInFlight = !1, this.localInputValue = "";
|
|
381
381
|
return;
|
|
@@ -386,9 +386,9 @@ L = (T = o({
|
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
let o = this.storeContext.store.statementsMatching(this.dataSubject, i), s = [];
|
|
389
|
-
if (
|
|
389
|
+
if (n) {
|
|
390
390
|
let a, c = this.formSubject ? g(this.storeContext.store, this.formSubject) : void 0, l = c ? v[c] ?? {} : {};
|
|
391
|
-
l.namedNode ? a = this.storeContext.store.sym(
|
|
391
|
+
l.namedNode ? a = this.storeContext.store.sym(n) : l.defaultInputValue ? (a = encodeURIComponent(n.replace(/ /g, "")), a = this.storeContext.store.sym(l.defaultInputValue + a)) : a = l.dt ? new t(n.trim(), void 0, r.xsd(l.dt)) : new t(n), s = o.map((t) => e(t.subject, t.predicate, a, t.why)), s.length === 0 && (s = [e(this.dataSubject, i, a, this.getDocument(this.dataSubject))]);
|
|
392
392
|
}
|
|
393
393
|
try {
|
|
394
394
|
await this.storeContext.store.updater.updateMany(o, s), this.storeVersion += 1;
|
|
@@ -437,4 +437,4 @@ var ne = q;
|
|
|
437
437
|
//#endregion
|
|
438
438
|
export { m as a, b as i, q as n, _ as o, y as r, h as s, ne as t };
|
|
439
439
|
|
|
440
|
-
//# sourceMappingURL=rdf-input-
|
|
440
|
+
//# sourceMappingURL=rdf-input-DeDhyQ3p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdf-input-DeDhyQ3p.js","names":["sym","parse","ns","baseUri","loadDocument","store","documentSource","documentName","documentURI","preferRemote","finalDocumentUri","document","holds","undefined","removeStatements","statementsMatching","parseSource","Promise","resolve","reject","err","console","error","fetcher","load","force","clearPreviousData","then","catch","trim","length","Error","fetchData","sortBySequence","list","subfields","map","p","k","any","ui","seq","Number","value","isNaN","sort","a","b","pair","mostSpecificClassURI","subject","typeUri","findTypeURIs","specificTypes","bottomTypeURIs","finalTypes","t","push","findForm","sourceUri","docUrl","split","fragment","includes","candidate","rdf","forms","each","found","find","term","termType","sym","ns","ns","style","fieldParams","ui","uri","size","type","dt","pattern","namedNode","defaultInputValue","formGroupStyle","element","commentStyle","formHeadingStyle","ns","NoopStore","store","Error","createContext","NoopStore","DEFAULT_STORE","storeContext","Symbol","createContext","property","state","html","ns","customElement","generateId","WebComponent","Literal","st","label","mostSpecificClassURI","fieldParams","fieldTypeParams","DEFAULT_STORE","storeContext","consume","_classDecs","_RDFInput","_A","WeakMap","_B","_C","_D","_E","_F","_ref","_storeContextDecs","context","subscribe","_formSubjectDecs","attribute","type","Object","_dataSubjectDecs","_storeVersionDecs","Number","_localInputValueDecs","_readonlyDecs","Boolean","reflect","RDFInput","_classPrivateFieldGet","v","_classPrivateFieldSet","formSubject","dataSubject","storeVersion","localInputValue","readonly","constructor","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_formSubject","_init_dataSubject","_init_storeVersion","_init_localInputValue","_defineProperty","_init_readonly","id","render","formDocument","getDocument","uiPropertyTerm","getFormProperty","ui","inputLabel","getInputLabel","getReadOnly","fieldType","store","undefined","params","inputType","selectedTerm","getSelectedTerm","placeholder","defaultInputValue","inputValue","_updateInFlight","_pendingUpdateValue","termToInputValue","updateData","subject","doc","graph","any","formFieldSubject","uiLabel","propertyLabel","value","anyJS","defaultTerm","inputTerm","term","decodeURIComponent","String","stripped","replace","e","newValue","target","runPendingUpdate","dataDocument","updater","editable","toDeleteSt","statementsMatching","toInsertSt","objectFromNewValue","namedNode","sym","encodeURIComponent","dt","trim","xsd","map","statement","predicate","why","length","updateMany","err","console","error","_RDFInput2","c","_initClass","_applyDecs","default","consume","property","state","ns","fieldTypeParams","RDFInput","RDFInput","st","Literal","namedNode","ns_default","style","label","c","customElement","n$1","WebComponent","b","n","generateId","fetchData","document","documentURI","store","sortBySequence","subfields","list","k","p","seq","a","pair","mostSpecificClassURI","typeUri","subject","specificTypes","finalTypes","t","findForm","docUrl","sourceUri","fragment","candidate","term","fieldParams","DEFAULT_STORE","storeContext","_RDFInput2","_initProto","_initClass","_classDecs","_storeContextDecs","_init_storeContext","_formSubjectDecs","_init_formSubject","_dataSubjectDecs","_init_dataSubject","_storeVersionDecs","_init_storeVersion","_localInputValueDecs","_init_localInputValue","_readonlyDecs","_init_readonly","_ref","_defineProperty","_toPropertyKey","r","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","o","applyDec","m","h","y","v","g","u","w","S","A","d","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_RDFInput","_A","_B","_C","_D","_E","_F","formDocument","uiPropertyTerm","inputLabel","readonly","fieldType","params","inputType","selectedTerm","placeholder","inputValue","property","graph","formFieldSubject","uiLabel","propertyLabel","defaultTerm","dataSubject","newValue","dataDocument","toDeleteSt","toInsertSt","objectFromNewValue","statement","err","rdf_input_default"],"sources":["../../src/lib/forms/rdfFormsHelper.ts","../../src/lib/forms/fieldParams.ts","../../src/lib/forms/store/NoopStore.ts","../../src/lib/forms/store/StoreContext.ts","../../src/components/rdf-input/RDFInput.ts","../../src/components/rdf-input/index.ts"],"sourcesContent":["import { sym, LiveStore, parse } from 'rdflib'\nimport type { Term } from 'rdflib/lib/tf-types'\n// eslint-disable-next-line camelcase\nimport type { Quad_Subject, NamedNode } from 'rdflib/lib/tf-types'\nimport ns from '../../lib/ns'\n\nconst baseUri = 'https://solidos.github.io/solid-ui/src/ontology/'\n\nexport function loadDocument (\n store: LiveStore,\n documentSource: string,\n documentName: string,\n documentURI?: string,\n preferRemote = false\n) {\n const finalDocumentUri = documentURI || baseUri + documentName // Full URI to the file\n const document = sym(finalDocumentUri) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n const parseSource = () => {\n return new Promise<void>((resolve, reject) => {\n parse(documentSource, store, finalDocumentUri, 'text/turtle', (err) => {\n if (err) {\n console.error('Parse document error for ', finalDocumentUri, err)\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n\n if (preferRemote && documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {}).catch((err) => {\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n throw err\n })\n }\n\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n\n if (documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {})\n }\n\n return Promise.reject(new Error(`No document source or URI for ${documentName}`))\n}\n\nexport async function fetchData (\n store: LiveStore,\n documentURI: string\n) {\n const document = sym(documentURI) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n return await store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n })\n}\n\nexport function sortBySequence (\n store: LiveStore,\n list: Term[]\n) {\n const subfields = list.map((p) => {\n const k = store.any(p as any, ns.ui('sequence'))\n const seq = k ? Number((k as { value: string }).value) : 9999\n return [Number.isNaN(seq) ? 9999 : seq, p] as const\n })\n\n subfields.sort((a, b) => a[0] - b[0])\n\n return subfields.map(pair => pair[1])\n}\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param subject a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\n// eslint-disable-next-line camelcase\nexport function mostSpecificClassURI (store: LiveStore, subject: Quad_Subject): string {\n const typeUri = store.findTypeURIs(subject)\n const specificTypes = store.bottomTypeURIs(typeUri) // most specific\n const finalTypes: any[] = []\n for (const t in specificTypes) finalTypes.push(t)\n // if (finalTypes.length > 1) throw \"Didn't expect \"+subject+\" to have multiple bottom types: \"+finalTypes\n return finalTypes[0]\n}\n\n// Find the first ui:Form node in a store, optionally matching a fragment.\n// code based on Jeff Zucker's sol-components: https://github.com/jeff-zucker/sol-components (core/form-utils.js)\nexport function findForm (store: LiveStore, sourceUri: string): NamedNode | null {\n const docUrl = sourceUri.split('#')[0]\n const fragment = sourceUri.includes('#') ? sourceUri.split('#')[1] : null\n if (fragment) {\n const candidate = sym(docUrl + '#' + fragment)\n if (store.holds(candidate, ns.rdf('type'), ns.ui('Form'))) return candidate\n }\n const forms = store.each(null, ns.rdf('type'), ns.ui('Form'))\n const found = forms.find((term) => term.termType === 'NamedNode')\n return found ? (found as NamedNode) : null\n}\n","import ns from '../../lib/ns'\nimport { style } from '../../lib/style'\n\nexport type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'datetime'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'checkbox'\n | 'radio'\n | 'file'\n | 'submit'\n | 'image'\n | 'reset'\n | 'button'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: InputType, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n defaultInputValue?: string, // e.g. 'mailto:'. Default value in input field, will be removed when displaying actual value to user.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and defaultInputValue.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n defaultInputValue: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n defaultInputValue: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: style.formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: style.commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: style.formHeadingStyle\n }\n}\n","import { LiveStore } from 'rdflib'\nimport { StoreContext } from './StoreContext'\n\nexport default class NoopStore implements StoreContext {\n get store (): LiveStore {\n throw new Error('Cannot use RDF forms without a store')\n }\n}\n","import { createContext } from '@lit/context'\nimport { LiveStore } from 'rdflib'\nimport NoopStore from './NoopStore'\n\nexport interface StoreContext {\n store: LiveStore\n}\n\nexport const DEFAULT_STORE = new NoopStore()\nexport const storeContext = createContext<StoreContext>(Symbol('storeContext'))\n","import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport ns from '../../lib/ns'\nimport { customElement, generateId, WebComponent } from '@/lib/components'\nimport { Literal, NamedNode, st } from 'rdflib'\nimport { label } from '../../utils'\nimport { mostSpecificClassURI } from '../../lib/forms/rdfFormsHelper'\nimport { FieldParamsObject, fieldParams as fieldTypeParams, InputType } from '../../lib/forms/fieldParams'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\nimport { consume } from '@lit/context'\nimport '@/components/input'\n\n@customElement('solid-ui-rdf-input')\nexport default class RDFInput extends WebComponent {\n // example RDF Turtle format source:\n // :nameField a ui:SingleLineTextField ;\n // ui:property vcard:fn;\n // ui:label \"name\" .\n\n // formSubject describes the field metadata\n // dataSubject points to the data resource containing the value\n\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false, type: Object })\n accessor formSubject: NamedNode | null = null\n\n @property({ attribute: false, type: Object })\n accessor dataSubject: NamedNode | null = null\n\n @property({ type: Number })\n accessor storeVersion = 0\n\n @state()\n private accessor localInputValue: string | null = null\n\n private _updateInFlight = false\n private _pendingUpdateValue: string | null = null\n\n @property({ type: Boolean, reflect: true })\n accessor readonly: boolean = true // to protect data, we default to not editable\n\n constructor () {\n super()\n\n this.id = generateId()\n }\n\n render () {\n const formDocument = this.getDocument(this.formSubject)\n\n // for building the HTML input element\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), formDocument)\n const inputLabel = this.getInputLabel(this.formSubject, uiPropertyTerm, formDocument)\n const readonly = this.getReadOnly(this.readonly, this.formSubject, formDocument)\n\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n const inputType: InputType = params.type ?? 'text'\n\n // for populating the HTML input element\n const selectedTerm = this.getSelectedTerm(this.dataSubject, uiPropertyTerm, this.formSubject, params)\n const placeholder = readonly ? '' : this.defaultInputValue(params)\n const inputValue = this._updateInFlight || this._pendingUpdateValue !== null\n ? this.localInputValue ?? ''\n : this.termToInputValue(selectedTerm)\n\n return html`\n <solid-ui-input\n label=\"${inputLabel}\"\n name=\"name-${this.id}\"\n .value=${inputValue}\n .placeholder=${placeholder}\n type=\"${inputType}\"\n ?readonly=${readonly}\n @input=${this.updateData}\n ></solid-ui-input>`\n }\n\n private getDocument (subject: NamedNode | null | undefined) {\n return subject?.doc ? subject.doc() : undefined\n }\n\n private getFormProperty (subject: NamedNode | null | undefined, property: NamedNode, graph?: any): NamedNode | undefined {\n if (!subject) return undefined\n return this.storeContext.store.any(subject, property, null, graph) as NamedNode | undefined\n }\n\n private getInputLabel (formFieldSubject: NamedNode | null | undefined, uiPropertyTerm?: NamedNode, graph?: any): string {\n if (!formFieldSubject) return ''\n const uiLabel = this.storeContext.store.any(formFieldSubject, ns.ui('label'), null, graph)\n const propertyLabel = uiPropertyTerm ? label(uiPropertyTerm, true) : ''\n return uiLabel ? uiLabel.value : propertyLabel\n }\n\n private getReadOnly (readonly: boolean, formFieldSubject?: NamedNode | null, graph?: any): boolean {\n if (formFieldSubject && readonly === false) { // if readonly is false, we can ovverride it if the field is marked as uneditable in the form\n return !!this.storeContext.store.anyJS(formFieldSubject, ns.ui('suppressEmptyUneditable'), null, graph)\n }\n return readonly\n }\n\n private getSelectedTerm (\n dataSubject?: NamedNode | null,\n uiPropertyTerm?: NamedNode,\n formFieldSubject?: NamedNode | null,\n params?: { defaultInputValue?: string }\n ) {\n const defaultTerm = formFieldSubject\n ? this.storeContext.store.any(formFieldSubject, ns.ui('default'))\n : undefined\n\n if (!uiPropertyTerm || !dataSubject) {\n return defaultTerm\n }\n\n const inputTerm = this.storeContext.store.any(dataSubject, uiPropertyTerm)\n return inputTerm || defaultTerm\n }\n\n private termToInputValue (term: any) {\n if (!term || !('value' in term) || !term.value) return ''\n\n try {\n return decodeURIComponent(term.value)\n } catch {\n return String(term.value)\n }\n }\n\n private defaultInputValue (params: { defaultInputValue?: string } = {}) {\n const stripped = params.defaultInputValue ?? ''\n return stripped.replace(/ /g, '')\n }\n\n private async updateData (e: CustomEvent) {\n const newValue = (e.target as HTMLInputElement).value\n this.localInputValue = newValue\n this._pendingUpdateValue = newValue\n\n if (this._updateInFlight) {\n return\n }\n\n await this.runPendingUpdate()\n }\n\n private async runPendingUpdate () {\n if (this._pendingUpdateValue === null) {\n return\n }\n\n const newValue = this._pendingUpdateValue\n this._pendingUpdateValue = null\n this._updateInFlight = true\n\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), this.getDocument(this.formSubject))\n if (!uiPropertyTerm || !this.dataSubject) {\n this._updateInFlight = false\n this.localInputValue = ''\n return\n }\n\n const dataDocument = this.getDocument(this.dataSubject)\n if (dataDocument && this.storeContext.store.updater?.editable(dataDocument) === false) {\n this._updateInFlight = false\n return\n }\n\n const toDeleteSt = this.storeContext.store.statementsMatching(this.dataSubject, uiPropertyTerm)\n let toInsertSt: Array<ReturnType<typeof st>> = []\n\n if (newValue) {\n let objectFromNewValue\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params: FieldParamsObject = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n if (params.namedNode) {\n objectFromNewValue = this.storeContext.store.sym(newValue)\n } else if (params.defaultInputValue) {\n objectFromNewValue = encodeURIComponent(newValue.replace(/ /g, ''))\n objectFromNewValue = this.storeContext.store.sym(params.defaultInputValue + objectFromNewValue)\n } else {\n if (params.dt) {\n objectFromNewValue = new Literal(\n newValue.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n objectFromNewValue = new Literal(newValue)\n }\n }\n toInsertSt = toDeleteSt.map((statement) => st(statement.subject, statement.predicate, objectFromNewValue, statement.why))\n if (toInsertSt.length === 0) {\n toInsertSt = [st(this.dataSubject, uiPropertyTerm, objectFromNewValue, this.getDocument(this.dataSubject))]\n }\n }\n\n try {\n await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)\n this.storeVersion += 1\n } catch (err) {\n console.error('RDFInput update failed', err)\n } finally {\n this._updateInFlight = false\n }\n\n if (this._pendingUpdateValue !== null) {\n await this.runPendingUpdate()\n }\n }\n}\n","import RDFInput from './RDFInput'\n\nexport { RDFInput }\nexport default RDFInput\n"],"mappings":";;;;;AA6DA,eAAsBgC,EACpB3B,GACAG,GACA;CACA,IAAMG,IAAWX,EAAIQ,CAAW;CAMhC,OAJIH,EAAMO,MAAMC,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,KACvDN,EAAMS,iBAAiBT,EAAMU,mBAAmBF,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,CAAC,GAGrF,MAAMN,EAAMkB,QAAQC,KAAKhB,GAAa;EAC3CiB,OAAO;EACPC,mBAAmB;CACrB,CAAC;AACH;AAEA,SAAgBO,EACd5B,GACA6B,GACA;CACA,IAAMC,IAAYD,EAAKE,KAAKC,MAAM;EAChC,IAAMC,IAAIjC,EAAMkC,IAAIF,GAAUnC,EAAGsC,GAAG,UAAU,CAAC,GACzCC,IAAMH,IAAII,OAAQJ,EAAwBK,KAAK,IAAI;EACzD,OAAO,CAACD,OAAOE,MAAMH,CAAG,IAAI,OAAOA,GAAKJ,CAAC;CAC3C,CAAC;CAID,OAFAF,EAAUU,MAAMC,GAAGC,MAAMD,EAAE,KAAKC,EAAE,EAAE,GAE7BZ,EAAUC,KAAIY,MAAQA,EAAK,EAAE;AACtC;AAWA,SAAgBC,EAAsB5C,GAAkB6C,GAA+B;CACrF,IAAMC,IAAU9C,EAAM+C,aAAaF,CAAO,GACpCG,IAAgBhD,EAAMiD,eAAeH,CAAO,GAC5CI,IAAoB,CAAA;CAC1B,KAAK,IAAMC,KAAKH,GAAeE,EAAWE,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K,GACd3C,KAAAA,GACApE,EAAGgH,IAAI3C,EAAOyC,EAAE,CAClB,IAEqB,IAAI1G,EAAQ6F,CAAQ,GAG7CQ,IAAaF,EAAWU,KAAKC,MAAc7G,EAAG6G,EAAUlC,SAASkC,EAAUC,WAAWT,GAAoBQ,EAAUE,GAAG,CAAC,GACpHX,EAAWY,WAAW,MACxBZ,IAAa,CAACpG,EAAG,KAAKqC,aAAakB,GAAgB8C,GAAoB,KAAK/C,YAAY,KAAKjB,WAAW,CAAC,CAAC;EAE9G;EAEA,IAAI;GAEF,AADA,MAAM,KAAK/B,aAAawD,MAAMkC,QAAQiB,WAAWf,GAAYE,CAAiB,GAC9E,KAAK9D,gBAAgB;EACvB,SAAS4E,GAAK;GACZC,QAAQC,MAAM,0BAA0BF,CAAG;EAC7C,UAAU;GACR,KAAK3C,kBAAkB;EACzB;EAEA,AAAI,KAAKC,wBAAwB,QAC/B,MAAM,KAAKsB,iBAAiB;CAEhC;AACF,GAAC,CAAAH,GAAA,CAAA/C,GAAAC,GAAAC,GAAAC,GAAAC,GAAAE,GAAAP,IAAA2E,GAAA,CAAA7G,GAAA8G,MAAAC,EAAAH,GAAA;CAAA;EAAAnG;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAI;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GAvMqCV,CAAY,GAAAyH,EAAA;;;ACVlD,IAAAqI,KAAe7H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-BcC-ICqO.js","names":["isEmptyValue","value","undefined","customElement","FormControlComponent","html","nothing","property","query","state","isEmptyValue","styles","_classDecs","_Select","_Select2","_A","WeakMap","_B","_ref","_optionsDecs","type","Array","_controlElementDecs","_optionsDecs2","_Select3","Select","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_controlElement","_init__options","value","_options","options","querySelectorAll","from","map","option","label","textContent","controlElement","_classPrivateFieldGet","v","_classPrivateFieldSet","render","defaultOption","some","controlTrait","renderLabel","controlId","name","required","onChange","find","setValue","dispatchEvent","CustomEvent","bubbles","composed","detail","e","c","_initClass","_applyDecs","_Class","_identity","_defineProperty","default","Select"],"sources":["../../src/lib/values.ts","../../src/components/select/Select.styles.css","../../src/components/select/Select.ts","../../src/components/select/index.ts"],"sourcesContent":["export function isEmptyValue (value: unknown): boolean {\n return value === null || value === undefined || value === ''\n}\n",":host {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 5px;\n\n label {\n color: var(--solid-ui-color-gray-600);\n font-size: var(--solid-ui-font-size-sm);\n font-weight: 400;\n }\n\n .input-wrapper {\n position: relative;\n width: 100%;\n\n select {\n appearance: none;\n border: 1px solid var(--solid-ui-color-gray-400);\n border-radius: 5px;\n padding: 10px;\n padding-right: 40px;\n width: 100%;\n background: white;\n color: var(--solid-ui-color-gray-700);\n font-size: inherit;\n cursor: pointer;\n }\n\n icon-lucide-chevron-down {\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--solid-ui-color-gray-500);\n width: var(--solid-ui-font-size-lg);\n height: var(--solid-ui-font-size-lg);\n pointer-events: none;\n }\n }\n}\n","import { customElement, FormControlComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport { isEmptyValue } from '@/lib/values'\nimport type SelectOption from '@/components/select-option/SelectOption'\n\nimport '~icons/lucide/chevron-down'\n\nimport styles from './Select.styles.css'\n\nexport type SelectOptionData = {\n value: unknown;\n label: string;\n}\n\nexport type SelectChangeEvent = CustomEvent<{ option: SelectOptionData }>\n\n@customElement('solid-ui-select')\nexport default class Select extends FormControlComponent {\n static styles = styles\n\n @property({ type: Array })\n set options (value: SelectOptionData[] | null) {\n this._options = value\n }\n\n get options (): SelectOptionData[] {\n if (this._options) {\n return this._options\n }\n\n const options = this.querySelectorAll<SelectOption>(\n 'solid-ui-select-option'\n )\n\n return Array.from(options).map((option) => ({\n value: option.value,\n label: option.textContent,\n }))\n }\n\n @query('select')\n protected accessor controlElement: HTMLSelectElement | null = null;\n\n @state()\n private accessor _options: SelectOptionData[] | null = null\n\n protected render () {\n const defaultOption = this.options.some(option => isEmptyValue(option.value))\n ? nothing\n : html`<option disabled value=\"\" ?selected=${!this.value}>Select an option</option>`\n\n return html`\n ${this.controlTrait.renderLabel()}\n\n <div class=\"input-wrapper\">\n <select\n id=\"${this.controlTrait.controlId}\"\n name=${this.name}\n ?required=${this.required}\n @change=${this.onChange}\n >\n ${defaultOption}\n ${this.options.map(\n (option) =>\n html`<option\n .value=${option.value}\n ?selected=${option.value === this.value}\n >\n ${option.label}\n </option>`\n )}\n </select>\n <icon-lucide-chevron-down></icon-lucide-chevron-down>\n </div>\n `\n }\n\n private onChange () {\n const value = this.controlElement?.value ?? null\n const option = this.options.find((option) => option.value === value)\n\n this.controlTrait.setValue(value)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: { option } }))\n }\n}\n","import Select from './Select'\n\nexport * from './Select'\nexport { Select }\nexport default Select\n"],"mappings":";;;;AAAA,SAAgBA,EAAcC,GAAyB;CACrD,OAAOA,KAAU,QAA+BA,MAAU;AAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEMwCW,IAAA,CASvCT,EAAc,iBAAiB,CAAC;AAAA,IAAAU;AAAA,KAAAC,KAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,KAAAC,IAI9BZ,EAAS,EAAEa,MAAMC,MAAM,CAAC,GAACC,IAoB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C;;;;;CAKT;CAEQc,WAAY;EAClB,IAAMrB,IAAQ,KAAKS,gBAAgBT,SAAS,MACtCM,IAAS,KAAKJ,QAAQoB,MAAMhB,MAAWA,EAAON,UAAUA,CAAK;EAGnE,AADA,KAAKgB,aAAaO,SAASvB,CAAK,GAChC,KAAKwB,cAAc,IAAIC,YAAY,UAAU;GAAEC,SAAS;GAAMC,UAAU;GAAMC,QAAQ,EAAEtB,UAAO;EAAE,CAAC,CAAC;CACrG;AACF,GAAC,CAAAuB,GAAA,CAAA/B,GAAAC,GAAAF,IAAAiC,GAAA,CAAAjD,GAAAkD,MAAAC,EAAAxC,GAAA;CAAA;EAAAL;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAAX,GAAA,GAAA,KAAA,GAnEmCR,CAAoB,GAAAoB,IAAAyC,IAAA,cAAAC,EAAA;CAAAxC,cAAA;EAAA,MAAAb,CAAA,GAAAsD,EAAA,MAAA,UACtCxD,CAAM,GAAAoD,EAAA;CAAA;AAAA,GAAAI,EAAAF,GAAAnD,GAAA,KAAA,CAAA,GAAAmD,GAAA;;;ACfxB,
|
|
1
|
+
{"version":3,"file":"select-BcC-ICqO.js","names":["isEmptyValue","value","undefined","customElement","FormControlComponent","html","nothing","property","query","state","isEmptyValue","styles","_classDecs","_Select","_Select2","_A","WeakMap","_B","_ref","_optionsDecs","type","Array","_controlElementDecs","_optionsDecs2","_Select3","Select","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_controlElement","_init__options","value","_options","options","querySelectorAll","from","map","option","label","textContent","controlElement","_classPrivateFieldGet","v","_classPrivateFieldSet","render","defaultOption","some","controlTrait","renderLabel","controlId","name","required","onChange","find","setValue","dispatchEvent","CustomEvent","bubbles","composed","detail","e","c","_initClass","_applyDecs","_Class","_identity","_defineProperty","default","property","query","state","nothing","styles","Select","Select","A","customElement","i","FormControlComponent","b","e","isEmptyValue","value","Select_styles_default","_Class","_Select3","_A","_B","_initProto","_initClass","_classDecs","_optionsDecs","_controlElementDecs","_init_controlElement","_optionsDecs2","_init__options","_Select2","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_defineProperty","_toPropertyKey","t","_applyDecs","n","o","c","applyDec","m","h","y","v","g","u","w","S","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","_identity","_Select","args","options","option","defaultOption","select_default"],"sources":["../../src/lib/values.ts","../../src/components/select/Select.styles.css","../../src/components/select/Select.ts","../../src/components/select/index.ts"],"sourcesContent":["export function isEmptyValue (value: unknown): boolean {\n return value === null || value === undefined || value === ''\n}\n",":host {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 5px;\n\n label {\n color: var(--solid-ui-color-gray-600);\n font-size: var(--solid-ui-font-size-sm);\n font-weight: 400;\n }\n\n .input-wrapper {\n position: relative;\n width: 100%;\n\n select {\n appearance: none;\n border: 1px solid var(--solid-ui-color-gray-400);\n border-radius: 5px;\n padding: 10px;\n padding-right: 40px;\n width: 100%;\n background: white;\n color: var(--solid-ui-color-gray-700);\n font-size: inherit;\n cursor: pointer;\n }\n\n icon-lucide-chevron-down {\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--solid-ui-color-gray-500);\n width: var(--solid-ui-font-size-lg);\n height: var(--solid-ui-font-size-lg);\n pointer-events: none;\n }\n }\n}\n","import { customElement, FormControlComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport { isEmptyValue } from '@/lib/values'\nimport type SelectOption from '@/components/select-option/SelectOption'\n\nimport '~icons/lucide/chevron-down'\n\nimport styles from './Select.styles.css'\n\nexport type SelectOptionData = {\n value: unknown;\n label: string;\n}\n\nexport type SelectChangeEvent = CustomEvent<{ option: SelectOptionData }>\n\n@customElement('solid-ui-select')\nexport default class Select extends FormControlComponent {\n static styles = styles\n\n @property({ type: Array })\n set options (value: SelectOptionData[] | null) {\n this._options = value\n }\n\n get options (): SelectOptionData[] {\n if (this._options) {\n return this._options\n }\n\n const options = this.querySelectorAll<SelectOption>(\n 'solid-ui-select-option'\n )\n\n return Array.from(options).map((option) => ({\n value: option.value,\n label: option.textContent,\n }))\n }\n\n @query('select')\n protected accessor controlElement: HTMLSelectElement | null = null;\n\n @state()\n private accessor _options: SelectOptionData[] | null = null\n\n protected render () {\n const defaultOption = this.options.some(option => isEmptyValue(option.value))\n ? nothing\n : html`<option disabled value=\"\" ?selected=${!this.value}>Select an option</option>`\n\n return html`\n ${this.controlTrait.renderLabel()}\n\n <div class=\"input-wrapper\">\n <select\n id=\"${this.controlTrait.controlId}\"\n name=${this.name}\n ?required=${this.required}\n @change=${this.onChange}\n >\n ${defaultOption}\n ${this.options.map(\n (option) =>\n html`<option\n .value=${option.value}\n ?selected=${option.value === this.value}\n >\n ${option.label}\n </option>`\n )}\n </select>\n <icon-lucide-chevron-down></icon-lucide-chevron-down>\n </div>\n `\n }\n\n private onChange () {\n const value = this.controlElement?.value ?? null\n const option = this.options.find((option) => option.value === value)\n\n this.controlTrait.setValue(value)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: { option } }))\n }\n}\n","import Select from './Select'\n\nexport * from './Select'\nexport { Select }\nexport default Select\n"],"mappings":";;;;AAAA,SAAgBA,EAAcC,GAAyB;CACrD,OAAOA,KAAU,QAA+BA,MAAU;AAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEMwCW,IAAA,CASvCT,EAAc,iBAAiB,CAAC;AAAA,IAAAU;AAAA,KAAAC,KAAAC,kBAAA,IAAAC,QAA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