solid-panes 5.0.0 → 5.1.0-1
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/README.md +84 -2
- package/dist/RDFXMLPane2.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/cake.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/cake.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/cake.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/cake.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/camera.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/camera.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/camera.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/camera.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/mail.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/mail.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/mail.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/mail.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/map-pin.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/map-pin.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/map-pin.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/map-pin.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/phone.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/phone.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/phone.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/phone.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -0
- package/dist/audio/audioPane.cjs.js +1 -1
- package/dist/audio/audioPane.cjs.js.map +1 -1
- package/dist/audio/audioPane.esm.js +1 -5
- package/dist/audio/audioPane.esm.js.map +1 -1
- package/dist/classInstancePane.cjs.js.map +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
- package/dist/components/editor-card/EditorCard.esm.js +4 -7
- package/dist/components/editor-card/EditorCard.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +5 -5
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +97 -96
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -1
- package/dist/components/header/Header.cjs.js +1 -1
- package/dist/components/header/Header.cjs.js.map +1 -1
- package/dist/components/header/Header.esm.js +2 -2
- package/dist/components/header/Header.styles.cjs.js +1 -1
- package/dist/components/header/Header.styles.cjs.js.map +1 -1
- package/dist/components/header/Header.styles.esm.js +1 -1
- package/dist/components/header/Header.styles.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.cjs.js +1 -1
- package/dist/components/navbar/Navbar.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.d.ts +2 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.esm.js +2 -2
- package/dist/components/navbar/Navbar.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.cjs.js +1 -1
- package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.esm.js +1 -1
- package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.cjs.js +95 -0
- package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.d.ts +45 -0
- package/dist/components/profile-heading/ProfileHeading.d.ts.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.esm.js +480 -0
- package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +2 -0
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js +7 -0
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/index.d.ts +3 -0
- package/dist/components/profile-heading/editor/index.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts +44 -0
- package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +297 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +642 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts +4 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +16 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +76 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js +19 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts +2 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +28 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts +4 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +151 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/types.d.ts +34 -0
- package/dist/components/profile-heading/editor/sections/heading/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts +7 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +20 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts +3 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +11 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts +20 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +1291 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts +45 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +211 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts +21 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +18 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +18 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/types.d.ts +31 -0
- package/dist/components/profile-heading/editor/sections/shared/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/textUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.d.ts +6 -0
- package/dist/components/profile-heading/editor/textUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.esm.js +26 -0
- package/dist/components/profile-heading/editor/textUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts +9 -0
- package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js +2 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts +14 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +6 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js +2 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.d.ts +42 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +6 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/profileTexts.d.ts +14 -0
- package/dist/components/profile-heading/editor/texts/profileTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts +2 -0
- package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts.d.ts +6 -0
- package/dist/components/profile-heading/editor/texts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog.d.ts +41 -0
- package/dist/components/profile-heading/editor/ui/dialog.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +17 -0
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js +263 -0
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.cjs.js +5 -0
- package/dist/components/profile-heading/editor/ui/spinner.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.d.ts +3 -0
- package/dist/components/profile-heading/editor/ui/spinner.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.esm.js +12 -0
- package/dist/components/profile-heading/editor/ui/spinner.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js +2 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts +2 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +18 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js.map +1 -0
- package/dist/components/profile-heading/friendActions.cjs.js +2 -0
- package/dist/components/profile-heading/friendActions.cjs.js.map +1 -0
- package/dist/components/profile-heading/friendActions.d.ts +11 -0
- package/dist/components/profile-heading/friendActions.d.ts.map +1 -0
- package/dist/components/profile-heading/friendActions.esm.js +32 -0
- package/dist/components/profile-heading/friendActions.esm.js.map +1 -0
- package/dist/components/profile-heading/index.cjs.js +1 -0
- package/dist/components/profile-heading/index.d.ts +5 -0
- package/dist/components/profile-heading/index.d.ts.map +1 -0
- package/dist/components/profile-heading/index.esm.js +1 -0
- package/dist/components/profile-heading/profileHeadingData.cjs.js +2 -0
- package/dist/components/profile-heading/profileHeadingData.cjs.js.map +1 -0
- package/dist/components/profile-heading/profileHeadingData.d.ts +6 -0
- package/dist/components/profile-heading/profileHeadingData.d.ts.map +1 -0
- package/dist/components/profile-heading/profileHeadingData.esm.js +81 -0
- package/dist/components/profile-heading/profileHeadingData.esm.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +2 -2
- package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
- package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
- package/dist/dashboard/homepage.cjs.js.map +1 -1
- package/dist/dataContentPane2.cjs.js.map +1 -1
- package/dist/defaultPane2.cjs.js.map +1 -1
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
- package/dist/form/pane.cjs.js.map +1 -1
- package/dist/home/homePane.cjs.js.map +1 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/icons/folder.cjs.js.map +1 -1
- package/dist/icons/friends.cjs.js.map +1 -1
- package/dist/icons/person.cjs.js.map +1 -1
- package/dist/imagePane2.cjs.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +15 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/internal/internalPane2.cjs.js +1 -1
- package/dist/internal/internalPane2.cjs.js.map +1 -1
- package/dist/internal/internalPane2.esm.js +2 -5
- package/dist/internal/internalPane2.esm.js.map +1 -1
- package/dist/mainPage/header.cjs.js +1 -1
- package/dist/mainPage/header.cjs.js.map +1 -1
- package/dist/mainPage/header.d.ts +2 -2
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.esm.js +48 -44
- package/dist/mainPage/header.esm.js.map +1 -1
- package/dist/mainPage/index.cjs.js +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +27 -21
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.cjs.js +1 -1
- package/dist/mainPage/navbar.cjs.js.map +1 -1
- package/dist/mainPage/navbar.d.ts +3 -2
- package/dist/mainPage/navbar.d.ts.map +1 -1
- package/dist/mainPage/navbar.esm.js +77 -42
- package/dist/mainPage/navbar.esm.js.map +1 -1
- package/dist/mainPage/navigation.cjs.js +2 -0
- package/dist/mainPage/navigation.cjs.js.map +1 -0
- package/dist/mainPage/navigation.d.ts +6 -0
- package/dist/mainPage/navigation.d.ts.map +1 -0
- package/dist/mainPage/navigation.esm.js +22 -0
- package/dist/mainPage/navigation.esm.js.map +1 -0
- package/dist/mainPage/profileHeading.d.ts +5 -0
- package/dist/mainPage/profileHeading.d.ts.map +1 -0
- package/dist/mainPage/profileHeading2.cjs.js +2 -0
- package/dist/mainPage/profileHeading2.cjs.js.map +1 -0
- package/dist/mainPage/profileHeading2.esm.js +158 -0
- package/dist/mainPage/profileHeading2.esm.js.map +1 -0
- package/dist/n3Pane2.cjs.js.map +1 -1
- package/dist/navigation/browserEvents.cjs.js +2 -0
- package/dist/navigation/browserEvents.cjs.js.map +1 -0
- package/dist/navigation/browserEvents.d.ts +15 -0
- package/dist/navigation/browserEvents.d.ts.map +1 -0
- package/dist/navigation/browserEvents.esm.js +32 -0
- package/dist/navigation/browserEvents.esm.js.map +1 -0
- package/dist/navigation/chrome.cjs.js +2 -0
- package/dist/navigation/chrome.cjs.js.map +1 -0
- package/dist/navigation/chrome.d.ts +69 -0
- package/dist/navigation/chrome.d.ts.map +1 -0
- package/dist/navigation/chrome.esm.js +43 -0
- package/dist/navigation/chrome.esm.js.map +1 -0
- package/dist/navigation/controller.cjs.js +2 -0
- package/dist/navigation/controller.cjs.js.map +1 -0
- package/dist/navigation/controller.d.ts +51 -0
- package/dist/navigation/controller.d.ts.map +1 -0
- package/dist/navigation/controller.esm.js +45 -0
- package/dist/navigation/controller.esm.js.map +1 -0
- package/dist/navigation/events.cjs.js +2 -0
- package/dist/navigation/events.cjs.js.map +1 -0
- package/dist/navigation/events.d.ts +17 -0
- package/dist/navigation/events.d.ts.map +1 -0
- package/dist/navigation/events.esm.js +18 -0
- package/dist/navigation/events.esm.js.map +1 -0
- package/dist/navigation/navbarVisibility.cjs.js +2 -0
- package/dist/navigation/navbarVisibility.cjs.js.map +1 -0
- package/dist/navigation/navbarVisibility.d.ts +5 -0
- package/dist/navigation/navbarVisibility.d.ts.map +1 -0
- package/dist/navigation/navbarVisibility.esm.js +26 -0
- package/dist/navigation/navbarVisibility.esm.js.map +1 -0
- package/dist/navigation/options.cjs.js +2 -0
- package/dist/navigation/options.cjs.js.map +1 -0
- package/dist/navigation/options.d.ts +16 -0
- package/dist/navigation/options.d.ts.map +1 -0
- package/dist/navigation/options.esm.js +8 -0
- package/dist/navigation/options.esm.js.map +1 -0
- package/dist/navigation/podContext.cjs.js +2 -0
- package/dist/navigation/podContext.cjs.js.map +1 -0
- package/dist/navigation/podContext.d.ts +21 -0
- package/dist/navigation/podContext.d.ts.map +1 -0
- package/dist/navigation/podContext.esm.js +62 -0
- package/dist/navigation/podContext.esm.js.map +1 -0
- package/dist/navigation/state.cjs.js +2 -0
- package/dist/navigation/state.cjs.js.map +1 -0
- package/dist/navigation/state.d.ts +40 -0
- package/dist/navigation/state.d.ts.map +1 -0
- package/dist/navigation/state.esm.js +41 -0
- package/dist/navigation/state.esm.js.map +1 -0
- package/dist/outline/context.cjs.js.map +1 -1
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +387 -353
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/outlineIcons.cjs.js.map +1 -1
- package/dist/outline/propertyViews.cjs.js.map +1 -1
- package/dist/outline/queryByExample.cjs.js.map +1 -1
- package/dist/outline/userInput.cjs.js +1 -1
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +12 -13
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/outline/viewAsImage.cjs.js.map +1 -1
- package/dist/outline/viewAsMbox.cjs.js.map +1 -1
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.cjs.js.map +1 -1
- package/dist/pad/padPane2.esm.js +2 -6
- package/dist/pad/padPane2.esm.js.map +1 -1
- package/dist/playlist/playlistPane.cjs.js.map +1 -1
- package/dist/registerPanes.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.cjs.js +1 -1
- package/dist/schedule/schedulePane2.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.esm.js +1 -5
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/sharing/sharingPane.cjs.js.map +1 -1
- package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
- package/dist/social/editProfileDetails.cjs.js +1 -1
- package/dist/social/editProfileDetails.cjs.js.map +1 -1
- package/dist/social/editProfileDetails.esm.js +0 -2
- package/dist/social/editProfileDetails.esm.js.map +1 -1
- package/dist/social/icons.cjs.js +4 -4
- package/dist/social/icons.cjs.js.map +1 -1
- package/dist/social/icons.esm.js +5 -5
- package/dist/social/icons.esm.js.map +1 -1
- package/dist/social/socialPane.d.ts +0 -1
- package/dist/social/socialPane.d.ts.map +1 -1
- package/dist/social/socialPane2.cjs.js +3 -3
- package/dist/social/socialPane2.cjs.js.map +1 -1
- package/dist/social/socialPane2.esm.js +97 -154
- package/dist/social/socialPane2.esm.js.map +1 -1
- package/dist/social/socialSections.cjs.js +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/social/socialSections.d.ts +2 -2
- package/dist/social/socialSections.d.ts.map +1 -1
- package/dist/social/socialSections.esm.js +62 -139
- package/dist/social/socialSections.esm.js.map +1 -1
- package/dist/social/triage.cjs.js.map +1 -1
- package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
- package/dist/tableViewPane.cjs.js.map +1 -1
- package/dist/transaction/pane.cjs.js.map +1 -1
- package/dist/transaction/pane.esm.js +1 -1
- package/dist/transaction/pane.esm.js.map +1 -1
- package/dist/transaction/period.cjs.js.map +1 -1
- package/dist/trip/tripPane.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/pane.cjs.js +1 -1
- package/dist/ui/pane.cjs.js.map +1 -1
- package/dist/ui/pane.esm.js +2 -5
- package/dist/ui/pane.esm.js.map +1 -1
- package/dist/utils/paneUtils.cjs.js +1 -1
- package/dist/utils/paneUtils.cjs.js.map +1 -1
- package/dist/utils/paneUtils.esm.js +4 -4
- package/dist/utils/paneUtils.esm.js.map +1 -1
- package/dist/utils/podUtils.cjs.js.map +1 -1
- package/dist/utils/viewerUtils.cjs.js +2 -0
- package/dist/utils/viewerUtils.cjs.js.map +1 -0
- package/dist/utils/viewerUtils.d.ts +5 -0
- package/dist/utils/viewerUtils.d.ts.map +1 -0
- package/dist/utils/viewerUtils.esm.js +13 -0
- package/dist/utils/viewerUtils.esm.js.map +1 -0
- package/dist/utils/webIdUtils.cjs.js +1 -1
- package/dist/utils/webIdUtils.cjs.js.map +1 -1
- package/dist/utils/webIdUtils.d.ts +1 -0
- package/dist/utils/webIdUtils.d.ts.map +1 -1
- package/dist/utils/webIdUtils.esm.js +23 -19
- package/dist/utils/webIdUtils.esm.js.map +1 -1
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +11 -11
- package/dist/versionInfo.esm.js.map +1 -1
- package/dist/video/videoPane.cjs.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadingEditDialog.esm.js","names":["openInputDialog","html","render","Image","processHeadingMutations","combinePhoneValue","splitPhoneValue","normalizeEmailTypeForEdit","normalizePhoneTypeForEdit","toSavedHeadingEmailType","toSavedHeadingPhoneType","applyRowFieldChange","applyRowSelectChange","summarizeRowOps","hasNonEmptyText","sanitizeTextValue","toText","toTypeLabel","dialogCancelLabelText","dialogSubmitLabelText","editHeadingDialogTitleText","ownerLoginRequiredDialogMessageText","saveHeadingUpdatesFailedMessageText","sanitizeAddressFieldValue","sanitizeBasicInputFieldValue","sanitizeEmailValue","sanitizePhoneLocalValue","toStorageDateISO","invalidateResolvedPhotoDisplaySrc","resolvePhotoDisplaySrc","uploadPhotoFile","HEADING_PHONE_TYPE_OPTIONS","label","value","HEADING_EMAIL_TYPE_OPTIONS","HEADING_PRONOUN_OPTIONS","isContactPointRow","row","isAddressRow","isProfileBasicRow","normalizeHeadingContactTypeValue","options","some","option","getHeadingContactTypeOptions","kind","withDefaultHeadingContactType","type","rowHasContent","streetAddress","locality","region","postalCode","countryName","name","nickname","imageSrc","location","pronouns","dateOfBirth","normalizePronounsValue","normalized","toLowerCase","replace","toFormState","profileData","basicInfo","entryNode","status","primaryEmail","primaryPhone","primaryAddress","emailTypeWasMissing","phoneTypeWasMissing","normalizedEmailType","normalizedPhoneType","email","valueNode","phone","address","imagePreviewSrc","clearImagePreview","undefined","setHeadingImagePreview","formState","file","URL","createObjectURL","previewUrl","revokeObjectURL","setResolvedHeadingPreview","resolvedImageSrc","mapEmailOpsForSave","ops","mapRow","create","map","update","remove","mapPhoneOpsForSave","summarizeHeadingContactOps","typeWasMissing","length","renderContactPhoneInput","typeLabel","inputName","splitValue","selectedDialCode","dialCode","handleValueInput","e","target","nextValue","handleTypeInput","event","detail","nextType","String","localNumber","renderContactEmailInputRow","renderContactAddressInput","streetAddressName","localityName","regionName","postalCodeName","handleAddressInput","field","renderHeadingInfoInput","rerender","imageSrcLabel","recommendedImageToLoad","nameLabel","nicknameLabel","pronounsLabel","dateOfBirthLabel","handleBasicInfoInput","handleDateOfBirthInput","handlePronounsInput","handleUpload","button","currentTarget","dom","ownerDocument","document","fileInput","createElement","accept","hidden","cleanupFileInput","addEventListener","files","pendingImageFile","error","console","once","body","appendChild","click","handleCameraInput","handleDelete","renderHeadingEditTemplate","form","viewerMode","createHeadingEditForm","classList","add","autocomplete","setAttribute","isValidHeadingEmailAddress","test","isValidHeadingPhoneNumber","validateHeadingDataBeforeSave","createHeadingEditDialog","_event","store","subject","onSaved","originalPhotoUri","result","title","headerAction","submitLabel","cancelLabel","shouldCloseWithoutSave","basicInfoOps","phoneOps","emailOps","addressOps","validate","onSave","uploadedUri","plan","basicOps","nextPhotoUri","warn","formatSaveError","Error","message","HEADING_PHONE_TYPE_OPTIONS","HEADING_EMAIL_TYPE_OPTIONS","HEADING_PRONOUN_OPTIONS","isContactPointRow","row","isAddressRow","isProfileBasicRow","normalizeHeadingContactTypeValue","options","option","value","getHeadingContactTypeOptions","kind","withDefaultHeadingContactType","rowHasContent","hasNonEmptyText","normalizePronounsValue","normalized","sanitizeTextValue","toFormState","basicInfo","toText","profileData","primaryEmail","primaryPhone","primaryAddress","emailTypeWasMissing","normalizeEmailTypeForEdit","phoneTypeWasMissing","normalizePhoneTypeForEdit","normalizedEmailType","normalizedPhoneType","email","sanitizeEmailValue","phone","address","sanitizeAddressFieldValue","toTypeLabel","setHeadingImagePreview","formState","previewUrl","file","setResolvedHeadingPreview","resolvedImageSrc","mapEmailOpsForSave","mapRow","toSavedHeadingEmailType","ops","mapPhoneOpsForSave","toSavedHeadingPhoneType","summarizeHeadingContactOps","summarizeRowOps","typeWasMissing","renderContactPhoneInput","label","typeLabel","inputName","splitValue","splitPhoneValue","selectedDialCode","target","e","nextValue","sanitizePhoneLocalValue","applyRowFieldChange","combinePhoneValue","event","nextType","applyRowSelectChange","renderContactEmailInputRow","renderContactAddressInput","handleAddressInput","field","renderHeadingInfoInput","nameLabel","nicknameLabel","pronounsLabel","handleBasicInfoInput","sanitizeBasicInputFieldValue","Image","imagePreviewSrc","rerender","error","dom","fileInput","cleanupFileInput","toStorageDateISO","renderHeadingEditTemplate","form","viewerMode","ownerLoginRequiredDialogMessageText","createHeadingEditForm","isValidHeadingEmailAddress","isValidHeadingPhoneNumber","validateHeadingDataBeforeSave","localNumber","createHeadingEditDialog","originalPhotoUri","resolvePhotoDisplaySrc","store","openInputDialog","basicInfoOps","phoneOps","emailOps","addressOps","uploadedUri","uploadPhotoFile","subject","plan","processHeadingMutations","nextPhotoUri","onSaved"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/HeadingEditDialog.ts"],"sourcesContent":["import { openInputDialog } from '../../ui/dialog'\nimport { html, render, TemplateResult } from 'lit-html'\nimport 'solid-ui/components/button'\nimport 'solid-ui/components/combobox'\nimport 'solid-ui/components/combobox-option'\nimport { type ComboboxChangeEvent } from 'solid-ui/components/combobox'\nimport 'solid-ui/components/photo-capture'\nimport type { PhotoCapture } from 'solid-ui/components/photo-capture'\nimport { ProfileDetails, HeadingMutationPlan, ProfileBasicRow } from './types'\nimport { Image } from './imagePreview'\nimport '../../styles/EditDialogs.css'\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { processHeadingMutations } from './mutations'\nimport { ViewerMode } from '../../../../../types'\nimport {\n combinePhoneValue,\n splitPhoneValue\n} from '../shared/phoneCountries'\nimport {\n normalizeEmailTypeForEdit,\n normalizePhoneTypeForEdit,\n toSavedHeadingEmailType,\n toSavedHeadingPhoneType\n} from '../shared/contactTypeUtils'\nimport { applyRowFieldChange, applyRowSelectChange, summarizeRowOps } from '../shared/rowState'\nimport { hasNonEmptyText, sanitizeTextValue, toText, toTypeLabel } from '../../textUtils'\nimport {\n dialogCancelLabelText,\n dialogSubmitLabelText,\n editHeadingDialogTitleText,\n ownerLoginRequiredDialogMessageText,\n saveHeadingUpdatesFailedMessageText\n} from '../../texts'\nimport '~icons/lucide/camera'\nimport { ContactAddressRow, ContactPointRow } from '../contactInfo/types'\nimport { sanitizeAddressFieldValue, sanitizeBasicInputFieldValue, sanitizeEmailValue, sanitizePhoneLocalValue } from '../shared/sanitizeUtils'\nimport { toStorageDateISO } from './dateHelpers'\nimport { invalidateResolvedPhotoDisplaySrc, resolvePhotoDisplaySrc, uploadPhotoFile } from './imageHelpers'\n/* Note: new design - has address type in More Edit Contacts for now we will leave\n out Address Type, but a ticket will be created to add type later\n so I will keep the code and just comment it out for now.\n new design - has country code, will comment out code for now and create a ticket to add later. */\n\ntype HeadingFormState = {\n basicInfo: ProfileBasicRow\n email: ContactPointRow\n phone: ContactPointRow\n address: ContactAddressRow\n emailTypeWasMissing: boolean\n phoneTypeWasMissing: boolean\n pendingImageFile?: File | null\n imagePreviewSrc: string\n clearImagePreview: () => void\n}\n\ntype HeadingContactTypeOption = {\n label: string\n value: string\n}\n\ntype HeadingPronounsOption = {\n label: string\n value: string\n}\n\ntype HeadingContactTypeKind = 'phone' | 'email'\n\nconst HEADING_PHONE_TYPE_OPTIONS: HeadingContactTypeOption[] = [\n { label: 'Mobile', value: 'Mobile' },\n { label: 'Home', value: 'Home' },\n { label: 'Work', value: 'Work' }\n]\n\nconst HEADING_EMAIL_TYPE_OPTIONS: HeadingContactTypeOption[] = [\n { label: 'Personal', value: 'Personal' },\n { label: 'Office', value: 'Office' }\n]\n\nconst HEADING_PRONOUN_OPTIONS: HeadingPronounsOption[] = [\n { label: 'He/Him', value: 'He/Him' },\n { label: 'She/Her', value: 'She/Her' },\n { label: 'They/Them', value: 'They/Them' }\n]\n\ntype Row = ProfileBasicRow | ContactPointRow | ContactAddressRow\n\nfunction isContactPointRow (row: Row): row is ContactPointRow {\n return 'value' in row\n}\n\nfunction isAddressRow (row: Row): row is ContactAddressRow {\n return 'streetAddress' in row\n}\n\nfunction isProfileBasicRow (row: Row): row is ProfileBasicRow {\n return 'name' in row\n}\n\nfunction normalizeHeadingContactTypeValue (value: string, options: HeadingContactTypeOption[]): string {\n return options.some((option) => option.value === value) ? value : options[0]?.value || ''\n}\n\nfunction getHeadingContactTypeOptions (kind: HeadingContactTypeKind): HeadingContactTypeOption[] {\n return kind === 'phone' ? HEADING_PHONE_TYPE_OPTIONS : HEADING_EMAIL_TYPE_OPTIONS\n}\n\nfunction withDefaultHeadingContactType (\n row: ContactPointRow,\n kind: HeadingContactTypeKind\n): ContactPointRow {\n return {\n ...row,\n type: normalizeHeadingContactTypeValue(row.type || '', getHeadingContactTypeOptions(kind))\n }\n}\n\nfunction rowHasContent (row: Row): boolean {\n if (isContactPointRow(row)) {\n return hasNonEmptyText(row.value)\n }\n if (isAddressRow(row)) {\n return [\n row.streetAddress,\n row.locality,\n row.region,\n row.postalCode,\n row.countryName\n ].some(hasNonEmptyText)\n }\n if (isProfileBasicRow(row)) {\n return [\n row.name,\n row.nickname,\n row.imageSrc,\n row.location,\n row.pronouns,\n row.dateOfBirth\n ].some(hasNonEmptyText)\n }\n return false\n}\n\nfunction normalizePronounsValue (value: string | undefined): string {\n const normalized = sanitizeTextValue(value || '').toLowerCase().replace(/\\s+/g, '')\n if (!normalized) return ''\n if (normalized === 'he' || normalized === 'he/him') return 'He/Him'\n if (normalized === 'she' || normalized === 'she/her') return 'She/Her'\n if (normalized === 'they' || normalized === 'they/them') return 'They/Them'\n return value || ''\n}\n\nfunction toFormState (profileData: ProfileDetails): HeadingFormState {\n const basicInfo: ProfileBasicRow = {\n name: sanitizeTextValue(toText(profileData.name)),\n nickname: sanitizeTextValue(toText(profileData.nickname || '')),\n imageSrc: sanitizeTextValue(toText(profileData.imageSrc || '')),\n location: sanitizeTextValue(toText(profileData.location || '')),\n pronouns: normalizePronounsValue(toText(profileData.pronouns || '')),\n dateOfBirth: sanitizeTextValue(toText(profileData.dateOfBirth || '')),\n entryNode: toText(profileData.entryNode),\n status: toText(profileData.entryNode) ? 'existing' as const : 'new' as const\n }\n const primaryEmail = profileData.primaryEmail\n const primaryPhone = profileData.primaryPhone\n const primaryAddress = profileData.primaryAddress\n const emailTypeWasMissing = !normalizeEmailTypeForEdit(primaryEmail?.type)\n const phoneTypeWasMissing = !normalizePhoneTypeForEdit(primaryPhone?.type)\n\n const normalizedEmailType = normalizeEmailTypeForEdit(primaryEmail?.type)\n const normalizedPhoneType = normalizePhoneTypeForEdit(primaryPhone?.type)\n\n const email: ContactPointRow = {\n value: sanitizeEmailValue(toText(primaryEmail?.valueNode).replace(/^mailto:/i, '')),\n type: normalizedEmailType,\n entryNode: toText(primaryEmail?.entryNode),\n status: toText(primaryEmail?.entryNode) ? 'existing' as const : 'new' as const\n }\n const phone: ContactPointRow = {\n value: sanitizeTextValue(\n toText(primaryPhone?.valueNode || primaryPhone?.entryNode || '').replace(/^tel:/i, '')\n ),\n type: normalizedPhoneType,\n entryNode: toText(primaryPhone?.entryNode || ''),\n status: toText(primaryPhone?.entryNode || '') ? 'existing' as const : 'new' as const\n }\n const address: ContactAddressRow = {\n streetAddress: sanitizeAddressFieldValue(toText(primaryAddress?.streetAddress)),\n locality: sanitizeAddressFieldValue(toText(primaryAddress?.locality)),\n region: sanitizeAddressFieldValue(toText(primaryAddress?.region)),\n postalCode: sanitizeAddressFieldValue(toText(primaryAddress?.postalCode)),\n countryName: sanitizeAddressFieldValue(toText(primaryAddress?.countryName)),\n type: toTypeLabel(primaryAddress?.type),\n entryNode: toText(primaryAddress?.entryNode),\n status: toText(primaryAddress?.entryNode) ? 'existing' as const : 'new' as const\n }\n\n return {\n basicInfo: (basicInfo) || { name: '', nickname: '', imageSrc: '', location: '', pronouns: '', dateOfBirth: '', entryNode: '', status: 'new' },\n email: (email) || { value: '', type: '', entryNode: '', status: 'new' },\n phone: (phone) || { value: '', type: '', entryNode: '', status: 'new' },\n address: (address) || { streetAddress: '', locality: '', region: '', postalCode: '', countryName: '', type: '', entryNode: '', status: 'new' },\n emailTypeWasMissing,\n phoneTypeWasMissing,\n imagePreviewSrc: '',\n clearImagePreview: () => undefined\n }\n}\n\nfunction setHeadingImagePreview (formState: HeadingFormState, file: File) {\n formState.clearImagePreview()\n\n if (typeof URL.createObjectURL !== 'function') {\n formState.imagePreviewSrc = ''\n formState.clearImagePreview = () => undefined\n return\n }\n\n const previewUrl = URL.createObjectURL(file)\n formState.imagePreviewSrc = previewUrl\n formState.clearImagePreview = () => {\n URL.revokeObjectURL(previewUrl)\n formState.imagePreviewSrc = ''\n formState.clearImagePreview = () => undefined\n }\n}\n\nfunction setResolvedHeadingPreview (formState: HeadingFormState, resolvedImageSrc?: string) {\n formState.clearImagePreview()\n\n if (!resolvedImageSrc) {\n return\n }\n\n formState.imagePreviewSrc = resolvedImageSrc\n\n formState.clearImagePreview = () => {\n formState.imagePreviewSrc = ''\n formState.clearImagePreview = () => undefined\n }\n}\n\ntype ProfileBasicEditableField =\n | 'name'\n | 'nickname'\n | 'imageSrc'\n | 'pronouns'\n | 'dateOfBirth'\n\ntype ContactAddressEditableField =\n | 'streetAddress'\n | 'locality'\n | 'region'\n | 'postalCode'\n | 'countryName'\n\ntype ContactPhoneInputRowProps = {\n phone: ContactPointRow\n}\n\ntype ContactEmailInputRowProps = {\n email: ContactPointRow\n}\n\ntype ContactAddressInputRowProps = {\n address: ContactAddressRow\n}\n\nfunction mapEmailOpsForSave (ops: { create: ContactPointRow[], update: ContactPointRow[], remove: ContactPointRow[] }) {\n const mapRow = (row: ContactPointRow): ContactPointRow => ({\n ...withDefaultHeadingContactType(row, 'email'),\n type: toSavedHeadingEmailType(withDefaultHeadingContactType(row, 'email').type)\n })\n\n return {\n create: ops.create.map(mapRow),\n update: ops.update.map(mapRow),\n remove: ops.remove.map(mapRow)\n }\n}\n\nfunction mapPhoneOpsForSave (ops: { create: ContactPointRow[], update: ContactPointRow[], remove: ContactPointRow[] }) {\n const mapRow = (row: ContactPointRow): ContactPointRow => ({\n ...withDefaultHeadingContactType(row, 'phone'),\n type: toSavedHeadingPhoneType(withDefaultHeadingContactType(row, 'phone').type)\n })\n\n return {\n create: ops.create.map(mapRow),\n update: ops.update.map(mapRow),\n remove: ops.remove.map(mapRow)\n }\n}\n\nfunction summarizeHeadingContactOps (\n row: ContactPointRow,\n kind: HeadingContactTypeKind,\n typeWasMissing: boolean\n) {\n const ops = summarizeRowOps([row], rowHasContent)\n\n if (\n typeWasMissing &&\n row.entryNode &&\n row.status === 'existing' &&\n rowHasContent(row) &&\n ops.create.length === 0 &&\n ops.update.length === 0 &&\n ops.remove.length === 0\n ) {\n return {\n create: ops.create,\n update: [withDefaultHeadingContactType({ ...row, status: 'modified' }, kind)],\n remove: ops.remove\n }\n }\n\n return ops\n}\n\nfunction renderContactPhoneInput ({\n phone\n}: ContactPhoneInputRowProps) {\n const label = 'Mobile Number'\n const typeLabel = 'Phone Type 1'\n const inputName = 'phone-value'\n const splitValue = splitPhoneValue(phone?.value || '')\n const selectedDialCode = splitValue.dialCode\n\n const handleValueInput = (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextValue = sanitizePhoneLocalValue(target.value)\n if (phone) {\n applyRowFieldChange(phone, 'value', combinePhoneValue(selectedDialCode, nextValue), rowHasContent)\n }\n }\n\n const handleTypeInput = (e: Event) => {\n const event = e as ComboboxChangeEvent\n if (!event.detail.option) return\n const nextType = String(event.detail.option.value)\n if (phone) {\n applyRowSelectChange(phone, 'type', nextType)\n }\n }\n\n return html`\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal profile-edit-dialog__row--contact-point\">\n <div class=\"profile-edit-dialog__field\">\n <label aria-label=${label} class=\"label\">\n ${label}\n <input\n class=\"input\"\n type=\"tel\"\n name=${inputName}\n .value=${splitValue.localNumber}\n required\n data-contact-field=\"value\"\n data-entry-node=${phone?.entryNode || ''}\n data-row-status=${phone?.status || 'n/a'}\n placeholder=${label}\n autocomplete=\"tel-national\"\n inputmode=\"tel\"\n @input=${handleValueInput}\n />\n </label>\n </div>\n <label aria-label=${typeLabel} class=\"label profile-edit-dialog__field-type profile-edit-dialog__field-type--contact-point\">\n <solid-ui-combobox\n select-only\n class=\"profile-edit-dialog__type-select\"\n id=${`phone-type-select-${inputName}`}\n aria-label=${typeLabel}\n .value=${normalizeHeadingContactTypeValue(phone?.type || '', HEADING_PHONE_TYPE_OPTIONS)}\n @change=${handleTypeInput}\n >\n ${HEADING_PHONE_TYPE_OPTIONS.map((option) => html`<solid-ui-combobox-option value=${option.value}>${option.label}</solid-ui-combobox-option>`)}\n </solid-ui-combobox>\n </label>\n </div>\n `\n}\n\nfunction renderContactEmailInputRow ({\n email\n}: ContactEmailInputRowProps) {\n const label = 'Email'\n const typeLabel = 'Email Type'\n const inputName = 'email-value'\n\n const handleValueInput = (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextValue = sanitizeEmailValue(target.value)\n if (email) {\n applyRowFieldChange(email, 'value', nextValue, rowHasContent)\n }\n }\n\n const handleTypeInput = (e: Event) => {\n const event = e as ComboboxChangeEvent\n if (!event.detail.option) return\n const nextType = String(event.detail.option.value)\n if (email) {\n applyRowSelectChange(email, 'type', nextType)\n }\n }\n\n return html`\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal profile-edit-dialog__row--contact-point\">\n <label aria-label=${label} class=\"label profile-edit-dialog__field\">\n ${label}\n <input\n class=\"input\"\n type=\"email\"\n name=${inputName}\n .value=${email?.value || ''}\n required\n data-contact-field=\"value\"\n data-entry-node=${email?.entryNode || ''}\n data-row-status=${email?.status || 'n/a'}\n placeholder=\"Email Address\"\n autocomplete=\"email\"\n inputmode=\"email\"\n @input=${handleValueInput}\n />\n </label>\n <label aria-label=${typeLabel} class=\"label profile-edit-dialog__field-type profile-edit-dialog__field-type--contact-point\">\n <solid-ui-combobox\n select-only\n class=\"profile-edit-dialog__type-select\"\n id=${`email-type-select-${inputName}`}\n aria-label=${typeLabel}\n .value=${normalizeHeadingContactTypeValue(email?.type || '', HEADING_EMAIL_TYPE_OPTIONS)}\n @change=${handleTypeInput}\n >\n ${HEADING_EMAIL_TYPE_OPTIONS.map((option) => html`<solid-ui-combobox-option value=${option.value}>${option.label}</solid-ui-combobox-option>`)}\n </solid-ui-combobox>\n </label>\n </div>\n `\n}\n\nfunction renderContactAddressInput ({\n address\n}: ContactAddressInputRowProps) {\n const label = 'Address'\n /* const typeLabel = 'Address Type' */\n /* const typeInputName = 'address-type' */\n /* const addressTypeSelectId = 'address-type-select' */\n const streetAddressName = 'address-street'\n const localityName = 'address-locality'\n const regionName = 'address-region'\n const postalCodeName = 'address-postal'\n const countryName = 'address-country'\n\n const handleAddressInput = (field: ContactAddressEditableField) => (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextValue = sanitizeAddressFieldValue(target.value)\n if (address) {\n applyRowFieldChange(address, field, nextValue, rowHasContent)\n }\n }\n\n /* const handleTypeInput = (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextType = target.value\n if (address) {\n applyRowSelectChange(address, 'type', nextType)\n }\n } */\n\n return html`\n <label aria-label=${`${label} Street`} class=\"label profile-edit-dialog__field profile-edit-dialog__field--row-width\">\n Street Address\n <input\n class=\"input\"\n type=\"text\"\n name=${streetAddressName}\n .value=${address?.streetAddress || ''}\n required\n data-contact-field=\"streetAddress\"\n data-entry-node=${address?.entryNode || ''}\n data-row-status=${address?.status || 'n/a'}\n placeholder=\"Street Address\"\n autocomplete=\"street-address\"\n inputmode=\"text\"\n @change=${handleAddressInput('streetAddress')}\n />\n </label>\n\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal profile-edit-dialog__row--full\">\n <label aria-label=${`${label} Locality`} class=\"label profile-edit-dialog__field\">\n Locality\n <input\n class=\"input\"\n type=\"text\"\n name=${localityName}\n .value=${address?.locality || ''}\n data-contact-field=\"locality\"\n data-entry-node=${address?.entryNode || ''}\n data-row-status=${address?.status || 'n/a'}\n placeholder=\"City / Locality\"\n autocomplete=\"address-level2\"\n inputmode=\"text\"\n @change=${handleAddressInput('locality')}\n />\n </label>\n <label aria-label=${`${label} Postal Code`} class=\"label profile-edit-dialog__field\">\n Postal Code\n <input\n class=\"input\"\n type=\"text\"\n name=${postalCodeName}\n .value=${address?.postalCode || ''}\n data-contact-field=\"postalCode\"\n data-entry-node=${address?.entryNode || ''}\n data-row-status=${address?.status || 'n/a'}\n placeholder=\"Postal Code\"\n autocomplete=\"postal-code\"\n inputmode=\"text\"\n @change=${handleAddressInput('postalCode')}\n />\n </label>\n </div>\n\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal profile-edit-dialog__row--full\">\n <label aria-label=${`${label} Region`} class=\"label profile-edit-dialog__field\">\n Region\n <input\n class=\"input\"\n type=\"text\"\n name=${regionName}\n .value=${address?.region || ''}\n data-contact-field=\"region\"\n data-entry-node=${address?.entryNode || ''}\n data-row-status=${address?.status || 'n/a'}\n placeholder=\"State / Region\"\n inputmode=\"text\"\n @change=${handleAddressInput('region')}\n />\n </label>\n <label aria-label=${`${label} Country`} class=\"label profile-edit-dialog__field\">\n Country\n <input\n class=\"input\"\n type=\"text\"\n name=${countryName}\n .value=${address?.countryName || ''}\n data-contact-field=\"countryName\"\n data-entry-node=${address?.entryNode || ''}\n data-row-status=${address?.status || 'n/a'}\n placeholder=\"Country\"\n autocomplete=\"country-name\"\n inputmode=\"text\"\n @change=${handleAddressInput('countryName')}\n />\n </label>\n </div>\n `\n}\n\nfunction renderHeadingInfoInput (\n formState: HeadingFormState,\n rerender: () => void\n): TemplateResult {\n const { basicInfo, phone, email, imagePreviewSrc } = formState\n const imageSrcLabel = 'Profile Photo'\n const recommendedImageToLoad = 'Recommended: Square JPG, PNG. Max 2MB.'\n const nameLabel = 'Full Name'\n const nicknameLabel = 'Nickname'\n const pronounsLabel = 'Pronouns'\n const dateOfBirthLabel = 'DOB'\n\n const handleBasicInfoInput = (field: ProfileBasicEditableField) => (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextValue = sanitizeBasicInputFieldValue(target.value)\n if (basicInfo) {\n applyRowFieldChange(basicInfo, field, nextValue, rowHasContent)\n }\n }\n\n const handleDateOfBirthInput = (e: Event) => {\n const target = e.target as HTMLInputElement\n const nextValue = sanitizeBasicInputFieldValue(target.value)\n if (basicInfo) {\n applyRowFieldChange(basicInfo, 'dateOfBirth', toStorageDateISO(nextValue), rowHasContent)\n }\n }\n const handlePronounsInput = (e: Event) => {\n const event = e as ComboboxChangeEvent\n if (!event.detail.option) return\n const nextValue = normalizePronounsValue(String(event.detail.option.value))\n if (basicInfo) {\n applyRowFieldChange(basicInfo, 'pronouns', nextValue, rowHasContent)\n }\n }\n\n const handleUpload = async (e: Event) => {\n const button = e.currentTarget as HTMLButtonElement | null\n const dom = button?.ownerDocument || document\n const fileInput = dom.createElement('input')\n fileInput.type = 'file'\n fileInput.accept = 'image/*'\n fileInput.hidden = true\n\n const cleanupFileInput = () => {\n fileInput.remove()\n }\n\n fileInput.addEventListener('change', async () => {\n const file = fileInput.files?.[0]\n cleanupFileInput()\n if (!file || !basicInfo) return\n\n try {\n formState.pendingImageFile = file\n setHeadingImagePreview(formState, file)\n basicInfo.status = basicInfo.entryNode ? 'modified' : 'new'\n rerender()\n } catch (error) {\n console.error('Profile image upload failed', error)\n }\n }, { once: true })\n\n dom.body.appendChild(fileInput)\n fileInput.click()\n }\n\n const handleCameraInput = async (event: InputEvent) => {\n const file = (event.target as PhotoCapture).value\n\n if (!file || !basicInfo) return\n\n try {\n formState.pendingImageFile = file\n setHeadingImagePreview(formState, file)\n basicInfo.status = basicInfo.entryNode ? 'modified' : 'new'\n rerender()\n } catch (error) {\n console.error('Profile camera upload failed', error)\n }\n }\n\n const handleDelete = async () => {\n if (!basicInfo) return\n formState.pendingImageFile = null\n formState.clearImagePreview()\n applyRowFieldChange(basicInfo, 'imageSrc', '', rowHasContent)\n rerender()\n }\n\n return html`\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--heading-photo\">\n <header class=\"profile-edit-dialog__image-preview-header\" aria-label=\"Profile Image\">\n <div class=\"profile-edit-dialog__image-frame\">\n ${Image(imagePreviewSrc || basicInfo.imageSrc, basicInfo.name)}\n <solid-ui-photo-capture\n capture-label=\"Take Photo\"\n confirm-label=\"Use Photo\"\n retake-label=\"Retake\"\n cancel-label=\"Close camera\"\n file-name-prefix=\"camera\"\n facing-mode=\"user\"\n @input=${handleCameraInput}\n >\n <button\n slot=\"trigger\"\n type=\"button\"\n class=\"profile-edit-dialog__image-camera-button\"\n aria-label=\"Take a photo\"\n title=\"Take a photo\"\n >\n <icon-lucide-camera aria-hidden=\"true\"></icon-lucide-camera>\n </button>\n </solid-ui-photo-capture>\n </div>\n </header>\n\n <div class=\"profile-edit-dialog__image-preview\" aria-label=\"Profile Photo Preview\">\n <p class=\"profile-edit-dialog__image-preview-label\">${imageSrcLabel}</p>\n <p class=\"profile-edit-dialog__image-preview-description\">${recommendedImageToLoad}</p>\n\n <div class=\"profile-edit-dialog__image-preview-actions\">\n <solid-ui-button\n variant=\"secondary\"\n class=\"profile-edit-dialog__image-button profile-edit-dialog__image-upload-button\"\n aria-label=\"Upload new profile photo\"\n title=\"Upload\"\n @click=${handleUpload}\n >\n Upload\n </solid-ui-button>\n <solid-ui-button\n variant=\"secondary\"\n class=\"profile-edit-dialog__image-button profile-edit-dialog__image-remove-button\"\n aria-label=\"Delete profile photo\"\n title=\"Remove\"\n @click=${handleDelete}\n >\n Remove\n </solid-ui-button>\n </div>\n </div>\n </div>\n <div class=\"profile-edit-dialog__image-camera-capture-row\">\n <div class=\"profile-edit-dialog__image-camera-capture-frame\" hidden></div>\n </div>\n <div class=\"profile-edit\">\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal\">\n <label aria-label=${nameLabel} class=\"label profile-edit-dialog__field\">\n ${nameLabel}\n <input\n class=\"input\"\n type=\"text\"\n name=\"name\"\n .value=${basicInfo?.name || ''}\n required\n data-contact-field=\"name\"\n data-entry-node=${basicInfo?.entryNode || ''}\n data-row-status=${basicInfo?.status || 'n/a'}\n placeholder=\"Full Name\"\n autocomplete=\"name\"\n inputmode=\"text\"\n @change=${handleBasicInfoInput('name')}\n />\n </label>\n <label aria-label=${nicknameLabel} class=\"label profile-edit-dialog__field\">\n ${nicknameLabel}\n <input\n class=\"input\"\n type=\"text\"\n name=\"nickname\"\n .value=${basicInfo?.nickname || ''}\n data-contact-field=\"nickname\"\n data-entry-node=${basicInfo?.entryNode || ''}\n data-row-status=${basicInfo?.status || 'n/a'}\n placeholder=\"Nickname\"\n autocomplete=\"nickname\"\n inputmode=\"text\"\n @change=${handleBasicInfoInput('nickname')}\n />\n </label>\n </div>\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal profile-edit-dialog__row--heading-dob\">\n <div class=\"profile-edit-dialog__field-type profile-edit-dialog__field--stack\">\n <label aria-label=${pronounsLabel} class=\"label\">\n ${pronounsLabel}\n </label>\n <solid-ui-combobox\n select-only\n class=\"profile-edit-dialog__type-select\"\n name=\"pronouns\"\n data-heading-basic-field=\"pronouns\"\n aria-label=${pronounsLabel}\n .value=${normalizePronounsValue(basicInfo?.pronouns || '')}\n @change=${handlePronounsInput}\n >\n ${HEADING_PRONOUN_OPTIONS.map((option) => html`<solid-ui-combobox-option value=${option.value}>${option.label}</solid-ui-combobox-option>`)}\n </solid-ui-combobox>\n </div>\n <div class=\"profile-edit-dialog__field profile-edit-dialog__field--stack\">\n <label aria-label=${dateOfBirthLabel} class=\"label\">\n ${dateOfBirthLabel}\n </label>\n <input\n class=\"input profile-edit-dialog__input--dob\"\n type=\"date\"\n name=\"dateOfBirth\"\n .value=${toStorageDateISO(basicInfo?.dateOfBirth || '')}\n data-contact-field=\"dateOfBirth\"\n data-entry-node=${basicInfo?.entryNode || ''}\n data-row-status=${basicInfo?.status || 'n/a'}\n autocomplete=\"off\"\n data-lpignore=\"true\"\n data-1p-ignore=\"true\"\n data-bwignore=\"true\"\n @change=${handleDateOfBirthInput}\n />\n </div>\n </div>\n <div class=\"profile-edit-dialog__row profile-edit-dialog__row--equal\">\n <div class=\"profile-edit-dialog__field profile-edit-dialog__field--full\">\n ${renderContactPhoneInput({ phone })}\n </div>\n <div class=\"profile-edit-dialog__field profile-edit-dialog__field--full\">\n ${renderContactEmailInputRow({ email })}\n </div>\n </div>\n </div>\n `\n}\n\nfunction renderHeadingEditTemplate (\n form: HTMLFormElement,\n formState: HeadingFormState,\n viewerMode: ViewerMode\n) {\n const rerender = () => renderHeadingEditTemplate(form, formState, viewerMode)\n\n render(html`\n ${renderHeadingInfoInput(formState, rerender)}\n ${renderContactAddressInput({ address: formState.address })}\n ${viewerMode !== 'owner'\n ? html`<p class=\"profile-edit-dialog__login-message\">${ownerLoginRequiredDialogMessageText}</p>`\n : null}\n `, form)\n}\n\nfunction createHeadingEditForm (\n profileData: ProfileDetails,\n viewerMode: ViewerMode\n) {\n const form = document.createElement('form')\n form.classList.add('profile__edit-form', 'profile__edit-form--heading', 'profile-edit-dialog--heading')\n form.autocomplete = 'off'\n form.setAttribute('data-lpignore', 'true')\n form.setAttribute('data-1p-ignore', 'true')\n form.setAttribute('data-bwignore', 'true')\n\n const formState = toFormState(profileData)\n renderHeadingEditTemplate(form, formState, viewerMode)\n\n return { form, formState }\n}\n\nfunction isValidHeadingEmailAddress (value: string): boolean {\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)\n}\n\nfunction isValidHeadingPhoneNumber (value: string): boolean {\n return /^\\d+$/.test(value)\n}\n\nfunction validateHeadingDataBeforeSave (formState: HeadingFormState): string | null {\n if (!hasNonEmptyText(formState.basicInfo.name)) {\n return 'Full Name is required.'\n }\n\n const { localNumber } = splitPhoneValue(formState.phone?.value || '')\n if (rowHasContent(formState.phone) && !isValidHeadingPhoneNumber(localNumber)) {\n return 'Phone Number 1 should contain only numbers.'\n }\n\n if (rowHasContent(formState.email) && !isValidHeadingEmailAddress(formState.email?.value || '')) {\n return 'Email address must be a valid email address.'\n }\n\n return null\n}\n\nexport async function createHeadingEditDialog (\n _event: Event,\n store: LiveStore,\n subject: NamedNode,\n profileData: ProfileDetails,\n viewerMode: ViewerMode,\n onSaved?: () => Promise<void> | void\n) {\n const dom = document\n const originalPhotoUri = sanitizeTextValue(toText(profileData.imageSrc || ''))\n const { form, formState } = createHeadingEditForm(profileData, viewerMode)\n\n if (formState.basicInfo.imageSrc) {\n const resolvedImageSrc = await resolvePhotoDisplaySrc(store, formState.basicInfo.imageSrc)\n if (resolvedImageSrc && resolvedImageSrc !== formState.basicInfo.imageSrc) {\n setResolvedHeadingPreview(formState, resolvedImageSrc)\n renderHeadingEditTemplate(form, formState, viewerMode)\n }\n }\n\n const result = await openInputDialog({\n title: editHeadingDialogTitleText,\n dom,\n form,\n headerAction: { type: 'none' },\n submitLabel: dialogSubmitLabelText,\n cancelLabel: dialogCancelLabelText,\n shouldCloseWithoutSave: () => {\n const basicInfoOps = summarizeRowOps([formState.basicInfo], rowHasContent)\n const phoneOps = summarizeHeadingContactOps(formState.phone, 'phone', formState.phoneTypeWasMissing)\n const emailOps = summarizeHeadingContactOps(formState.email, 'email', formState.emailTypeWasMissing)\n const addressOps = summarizeRowOps([formState.address], rowHasContent)\n\n return (\n basicInfoOps.create.length === 0 && basicInfoOps.update.length === 0 && basicInfoOps.remove.length === 0 &&\n phoneOps.create.length === 0 && phoneOps.update.length === 0 && phoneOps.remove.length === 0 &&\n emailOps.create.length === 0 && emailOps.update.length === 0 && emailOps.remove.length === 0 &&\n addressOps.create.length === 0 && addressOps.update.length === 0 && addressOps.remove.length === 0\n )\n },\n validate: () => {\n if (viewerMode !== 'owner') {\n return ownerLoginRequiredDialogMessageText\n }\n return validateHeadingDataBeforeSave(formState)\n },\n onSave: async () => {\n if (formState.pendingImageFile) {\n const uploadedUri = await uploadPhotoFile(store, subject, formState.pendingImageFile)\n applyRowFieldChange(formState.basicInfo, 'imageSrc', uploadedUri, rowHasContent)\n }\n\n const phoneOps = summarizeHeadingContactOps(formState.phone, 'phone', formState.phoneTypeWasMissing)\n const emailOps = summarizeHeadingContactOps(formState.email, 'email', formState.emailTypeWasMissing)\n const plan: HeadingMutationPlan = {\n basicOps: summarizeRowOps([formState.basicInfo], rowHasContent),\n phoneOps: mapPhoneOpsForSave(phoneOps),\n emailOps: mapEmailOpsForSave(emailOps),\n addressOps: summarizeRowOps([formState.address], rowHasContent)\n }\n await processHeadingMutations(store, subject, plan)\n\n const nextPhotoUri = sanitizeTextValue(formState.basicInfo.imageSrc || '')\n if (originalPhotoUri && originalPhotoUri !== nextPhotoUri) {\n try {\n invalidateResolvedPhotoDisplaySrc(originalPhotoUri)\n } catch (error) {\n console.warn('Failed to invalidate resolved photo cache', error)\n }\n }\n },\n formatSaveError: (error: unknown) => {\n return error instanceof Error ? error.message : saveHeadingUpdatesFailedMessageText\n }\n })\n\n if (!result) {\n return\n }\n\n if (onSaved) {\n await onSaved()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmEA,IAAM+B,IAAyD;CAC7D;EAAEC,OAAO;EAAUC,OAAO;CAAS;CACnC;EAAED,OAAO;EAAQC,OAAO;CAA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AA4B;IAChCC,UAAUnL,EAAgB,CAACuE,EAAUlB,SAAS,GAAGlB,CAAa;IAC9DyI,UAAUtF,EAAmBsF,CAAQ;IACrCC,UAAU9F,EAAmB8F,CAAQ;IACrCC,YAAY9K,EAAgB,CAACuE,EAAUL,OAAO,GAAG/B,CAAa;GAChE;GACA,MAAM5C,EAAwB0K,GAAOC,GAASgB,CAAI;GAElD,IAAME,IAAelL,EAAkBqE,EAAUlB,UAAUV,YAAY,EAAE;GACzE,IAAIyH,KAAoBA,MAAqBgB,GAC3C,IAAI;IACFrK,EAAkCqJ,CAAgB;GACpD,SAASzB,GAAO;IACdC,QAAQyC,KAAK,6CAA6C1C,CAAK;GACjE;EAEJ;EACA2C,kBAAkB3C,MACTA,aAAiB4C,QAAQ5C,EAAM6C,UAAAA;CAE1C,CAAC,KAMGrB,KACF,MAAMA,EAAQ;AAElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateHelpers.cjs.js","names":["normalizeDmy","value","dmyMatch","match","day","month","year","toDisplayDateDMY","emptyFallback","raw","trim","isoMatch","normalizedDmy","toEditableDateDMY","toStorageDateISO","toStorageDateISO","raw","value","dmyMatch","day","month","year"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/dateHelpers.ts"],"sourcesContent":["function normalizeDmy (value: string): string {\n const dmyMatch = value.match(/^(\\d{2})[/-](\\d{2})[/-](\\d{4})$/)\n if (!dmyMatch) return ''\n\n const [, day, month, year] = dmyMatch\n return `${day}-${month}-${year}`\n}\n\nexport function toDisplayDateDMY (value: string | undefined, emptyFallback = ''): string {\n const raw = (value || '').trim()\n if (!raw) return emptyFallback\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})/)\n if (isoMatch) {\n const [, year, month, day] = isoMatch\n return `${day}-${month}-${year}`\n }\n\n const normalizedDmy = normalizeDmy(raw)\n if (normalizedDmy) return normalizedDmy\n\n return raw\n}\n\nexport function toEditableDateDMY (value: string | undefined): string {\n const raw = (value || '').trim()\n if (!raw) return ''\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (isoMatch) {\n const [, year, month, day] = isoMatch\n return `${day}-${month}-${year}`\n }\n\n return normalizeDmy(raw)\n}\n\nexport function toStorageDateISO (value: string | undefined): string {\n const raw = (value || '').trim()\n if (!raw) return ''\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (isoMatch) return raw\n\n const dmyMatch = raw.match(/^(\\d{2})[/-](\\d{2})[/-](\\d{4})$/)\n if (dmyMatch) {\n const [, day, month, year] = dmyMatch\n return `${year}-${month}-${day}`\n }\n\n return ''\n}\n"],"mappings":"AAqCA,SAAgBc,EAAkBb,EAAmC,CACnE,IAAMQ,GAAOR,GAAS,GAAA,CAAIS,KAAK,EAC/B,GAAI,CAACD,EAAK,MAAO,GAGjB,GADiBA,EAAIN,MAAM,2BACvBQ,EAAU,OAAOF,EAErB,IAAMP,EAAWO,EAAIN,MAAM,iCAAiC,EAC5D,GAAID,EAAU,CACZ,GAAM,EAAGE,EAAKC,EAAOC,GAAQJ,EAC7B,MAAO,GAAGI,EAAI,GAAID,EAAK,GAAID,GAC7B,CAEA,MAAO,EACT,C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function toDisplayDateDMY(value: string | undefined, emptyFallback?: string): string;
|
|
2
|
+
export declare function toEditableDateDMY(value: string | undefined): string;
|
|
3
|
+
export declare function toStorageDateISO(value: string | undefined): string;
|
|
4
|
+
//# sourceMappingURL=dateHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/components/profile-heading/editor/sections/heading/dateHelpers.ts"],"names":[],"mappings":"AAQA,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,SAAK,GAAG,MAAM,CAcvF;AAED,wBAAgB,iBAAiB,CAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAWpE;AAED,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAcnE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/profile-heading/editor/sections/heading/dateHelpers.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = (e || "").trim();
|
|
4
|
+
if (!t) return "";
|
|
5
|
+
if (t.match(/^(\d{4})-(\d{2})-(\d{2})$/)) return t;
|
|
6
|
+
let n = t.match(/^(\d{2})[/-](\d{2})[/-](\d{4})$/);
|
|
7
|
+
if (n) {
|
|
8
|
+
let [, e, t, r] = n;
|
|
9
|
+
return `${r}-${t}-${e}`;
|
|
10
|
+
}
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as toStorageDateISO };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=dateHelpers.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateHelpers.esm.js","names":["normalizeDmy","value","dmyMatch","match","day","month","year","toDisplayDateDMY","emptyFallback","raw","trim","isoMatch","normalizedDmy","toEditableDateDMY","toStorageDateISO","toStorageDateISO","raw","value","dmyMatch","day","month","year"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/dateHelpers.ts"],"sourcesContent":["function normalizeDmy (value: string): string {\n const dmyMatch = value.match(/^(\\d{2})[/-](\\d{2})[/-](\\d{4})$/)\n if (!dmyMatch) return ''\n\n const [, day, month, year] = dmyMatch\n return `${day}-${month}-${year}`\n}\n\nexport function toDisplayDateDMY (value: string | undefined, emptyFallback = ''): string {\n const raw = (value || '').trim()\n if (!raw) return emptyFallback\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})/)\n if (isoMatch) {\n const [, year, month, day] = isoMatch\n return `${day}-${month}-${year}`\n }\n\n const normalizedDmy = normalizeDmy(raw)\n if (normalizedDmy) return normalizedDmy\n\n return raw\n}\n\nexport function toEditableDateDMY (value: string | undefined): string {\n const raw = (value || '').trim()\n if (!raw) return ''\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (isoMatch) {\n const [, year, month, day] = isoMatch\n return `${day}-${month}-${year}`\n }\n\n return normalizeDmy(raw)\n}\n\nexport function toStorageDateISO (value: string | undefined): string {\n const raw = (value || '').trim()\n if (!raw) return ''\n\n const isoMatch = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (isoMatch) return raw\n\n const dmyMatch = raw.match(/^(\\d{2})[/-](\\d{2})[/-](\\d{4})$/)\n if (dmyMatch) {\n const [, day, month, year] = dmyMatch\n return `${year}-${month}-${day}`\n }\n\n return ''\n}\n"],"mappings":";AAqCA,SAAgBc,EAAkBb,GAAmC;CACnE,IAAMQ,KAAOR,KAAS,GAAA,CAAIS,KAAK;CAC/B,IAAI,CAACD,GAAK,OAAO;CAGjB,IADiBA,EAAIN,MAAM,2BACvBQ,GAAU,OAAOF;CAErB,IAAMP,IAAWO,EAAIN,MAAM,iCAAiC;CAC5D,IAAID,GAAU;EACZ,IAAM,GAAGE,GAAKC,GAAOC,KAAQJ;EAC7B,OAAO,GAAGI,EAAI,GAAID,EAAK,GAAID;CAC7B;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("solid-ui"),t=require("solid-logic"),n=require("rdflib");var r=new Map;function i(e){if(!e)return;let t=r.get(e);t&&(r.delete(e),t.startsWith(`blob:`)&&typeof URL.revokeObjectURL==`function`&&URL.revokeObjectURL(t))}var a={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/svg+xml":`svg`,"image/webp":`webp`,"image/bmp":`bmp`,"image/tiff":`tiff`,"application/pdf":`pdf`,"text/plain":`txt`,"text/html":`html`,"application/json":`json`,"application/octet-stream":`bin`},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[t,e])),s={extension:e=>a[e]||!1,lookup:e=>o[e.split(`.`).pop()?.toLowerCase()||``]||!1};function c(e){let t=e.doc().uri,n=t.lastIndexOf(`/`);return n>=0?t.slice(0,n+1):t}async function l(e,t){if(!t||t.startsWith(`blob:`)||t.startsWith(`data:`))return t;let n=r.get(t);if(n)return n;let i=e.fetcher;if(!i?._fetch||typeof URL.createObjectURL!=`function`)return t;try{let e=await i._fetch(t);if(!e.ok)return t;let n=await e.blob(),a=URL.createObjectURL(n);return r.set(t,a),a}catch{return t}}async function u(r,i,a){if(!r.fetcher)throw Error(`Store has no fetcher.`);let o=a.type||s.lookup(a.name)||`application/octet-stream`;if(!o.startsWith(`image/`))throw Error(`Selected file is not an image.`);if(a.size>2097152)throw Error(`Selected image must be 2 MB or smaller.`);let l=s.extension(o)||`bin`,u=encodeURIComponent(a.name||`image.${l}`);o!==s.lookup(a.name||``)&&(u+=`_.${l}`);let d=c(i),f=`${d}${u}`;for(let t=0;r.holds(i,e.ns.vcard(`hasPhoto`),(0,n.sym)(f));t++)f=`${d}${`image_${t}.${l}`}`;try{let e=await a.arrayBuffer(),t=await r.fetcher.webOperation(`PUT`,f,{data:e,contentType:o});if(!t.ok)throw Error(`Error uploading picture: ${t.status} ${t.statusText}`)}catch(e){throw Error(`Error uploading picture: ${e}`)}let p=t.authn.currentUser();if(p)try{await t.solidLogicSingleton.acl.setACLUserPublic(f,p,{public:[`Read`]})}catch(e){console.error(`Error setting uploaded picture permissions: ${e}`)}return f}exports.invalidateResolvedPhotoDisplaySrc=i,exports.resolvePhotoDisplaySrc=l,exports.uploadPhotoFile=u;
|
|
2
|
+
//# sourceMappingURL=imageHelpers.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageHelpers.cjs.js","names":["sym","ns","authn","solidLogicSingleton","resolvedHeadingImageCache","Map","invalidateResolvedPhotoDisplaySrc","imageSrc","cachedImageSrc","get","delete","startsWith","URL","revokeObjectURL","mimeMap","extMap","Object","fromEntries","entries","map","contentType","extension","mime","lookup","filename","ext","split","pop","toLowerCase","subjectDirectoryUri","subject","docUri","doc","uri","lastSlash","lastIndexOf","slice","resolvePhotoDisplaySrc","store","fetcher","_fetch","createObjectURL","response","ok","imageBlob","blob","resolvedImageSrc","set","uploadPhotoFile","file","Error","detectedContentType","type","name","size","encodeURIComponent","directoryUri","candidateUri","index","holds","vcard","fallbackName","data","arrayBuffer","webOperation","status","statusText","error","currentUser","acl","setACLUserPublic","public","console","ns","sym","authn","solidLogicSingleton","solid_ui","solid_logic","rdflib","resolvedHeadingImageCache","invalidateResolvedPhotoDisplaySrc","imageSrc","cachedImageSrc","mimeMap","extMap","contentType","extension","mime","filename","subjectDirectoryUri","docUri","subject","lastSlash","resolvePhotoDisplaySrc","fetcher","store","response","imageBlob","resolvedImageSrc","uploadPhotoFile","detectedContentType","file","directoryUri","candidateUri","index","data","error","currentUser"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imageHelpers.ts"],"sourcesContent":["import { LiveStore, NamedNode, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\nimport { authn, solidLogicSingleton } from 'solid-logic'\n\nconst resolvedHeadingImageCache = new Map<string, string>()\n\nexport function invalidateResolvedPhotoDisplaySrc (imageSrc?: string): void {\n if (!imageSrc) return\n\n const cachedImageSrc = resolvedHeadingImageCache.get(imageSrc)\n if (!cachedImageSrc) return\n\n resolvedHeadingImageCache.delete(imageSrc)\n if (cachedImageSrc.startsWith('blob:') && typeof URL.revokeObjectURL === 'function') {\n URL.revokeObjectURL(cachedImageSrc)\n }\n}\n/* Code copied from contact-pane/src/mugshotGallery and modified to fit the needs of the new design */\nconst mimeMap: Record<string, string> = {\n 'image/png': 'png',\n 'image/jpeg': 'jpg',\n 'image/gif': 'gif',\n 'image/svg+xml': 'svg',\n 'image/webp': 'webp',\n 'image/bmp': 'bmp',\n 'image/tiff': 'tiff',\n 'application/pdf': 'pdf',\n 'text/plain': 'txt',\n 'text/html': 'html',\n 'application/json': 'json',\n 'application/octet-stream': 'bin'\n}\n\nconst extMap = Object.fromEntries(\n Object.entries(mimeMap).map(([contentType, extension]) => [extension, contentType])\n) as Record<string, string>\n\nconst mime = {\n extension: (contentType: string): string | false => mimeMap[contentType] || false,\n lookup: (filename: string): string | false => {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return extMap[ext] || false\n }\n}\n\nfunction subjectDirectoryUri (subject: NamedNode): string {\n const docUri = subject.doc().uri\n const lastSlash = docUri.lastIndexOf('/')\n return lastSlash >= 0 ? docUri.slice(0, lastSlash + 1) : docUri\n}\n\nexport async function resolvePhotoDisplaySrc (store: LiveStore, imageSrc?: string): Promise<string | undefined> {\n if (!imageSrc || imageSrc.startsWith('blob:') || imageSrc.startsWith('data:')) {\n return imageSrc\n }\n\n const cachedImageSrc = resolvedHeadingImageCache.get(imageSrc)\n if (cachedImageSrc) {\n return cachedImageSrc\n }\n\n const fetcher = store.fetcher as { _fetch?: (url: string) => Promise<Response> } | undefined\n if (!fetcher?._fetch || typeof URL.createObjectURL !== 'function') {\n return imageSrc\n }\n\n try {\n const response = await fetcher._fetch(imageSrc)\n if (!response.ok) {\n return imageSrc\n }\n\n const imageBlob = await response.blob()\n const resolvedImageSrc = URL.createObjectURL(imageBlob)\n resolvedHeadingImageCache.set(imageSrc, resolvedImageSrc)\n return resolvedImageSrc\n } catch {\n return imageSrc\n }\n}\n\nexport async function uploadPhotoFile (store: LiveStore, subject: NamedNode, file: File): Promise<string> {\n if (!store.fetcher) {\n throw new Error('Store has no fetcher.')\n }\n\n const detectedContentType = file.type || mime.lookup(file.name) || 'application/octet-stream'\n if (!detectedContentType.startsWith('image/')) {\n throw new Error('Selected file is not an image.')\n }\n if (file.size > 2 * 1024 * 1024) {\n throw new Error('Selected image must be 2 MB or smaller.')\n }\n\n const extension = mime.extension(detectedContentType) || 'bin'\n let filename = encodeURIComponent(file.name || `image.${extension}`)\n\n if (detectedContentType !== mime.lookup(file.name || '')) {\n filename += `_.${extension}`\n }\n\n const directoryUri = subjectDirectoryUri(subject)\n let candidateUri = `${directoryUri}${filename}`\n\n for (let index = 0; store.holds(subject, ns.vcard('hasPhoto'), sym(candidateUri)); index++) {\n const fallbackName = `image_${index}.${extension}`\n candidateUri = `${directoryUri}${fallbackName}`\n }\n try {\n const data = await file.arrayBuffer()\n const response = await store.fetcher.webOperation('PUT', candidateUri, {\n data: data as unknown as string,\n contentType: detectedContentType\n } as any)\n if (!response.ok) {\n throw new Error(`Error uploading picture: ${response.status} ${response.statusText}`)\n }\n } catch (error) {\n throw new Error(`Error uploading picture: ${error}`)\n }\n\n const currentUser = authn.currentUser()\n if (currentUser) {\n try {\n await solidLogicSingleton.acl.setACLUserPublic(candidateUri, currentUser, {\n public: ['Read'] as unknown as []\n })\n } catch (error) {\n console.error(`Error setting uploaded picture permissions: ${error}`)\n }\n }\n\n return candidateUri\n}\n"],"mappings":"A,uEAIA,IAAMI,EAA4B,IAAIC,IAEtC,SAAgBC,EAAmCC,EAAyB,CAC1E,GAAI,CAACA,EAAU,OAEf,IAAMC,EAAiBJ,EAA0BK,IAAIF,CAAQ,EACxDC,IAELJ,EAA0BM,OAAOH,CAAQ,EACrCC,EAAeG,WAAW,OAAO,GAAK,OAAOC,IAAIC,iBAAoB,YACvED,IAAIC,gBAAgBL,CAAc,EAEtC,CAEA,IAAMM,EAAkC,CACtC,YAAa,MACb,aAAc,MACd,YAAa,MACb,gBAAiB,MACjB,aAAc,OACd,YAAa,MACb,aAAc,OACd,kBAAmB,MACnB,aAAc,MACd,YAAa,OACb,mBAAoB,OACpB,2BAA4B,KAC9B,EAEMC,EAASC,OAAOC,YACpBD,OAAOE,QAAQJ,CAAO,CAAC,CAACK,KAAK,CAACC,EAAaC,KAAe,CAACA,EAAWD,CAAW,CAAC,CACpF,EAEME,EAAO,CACXD,UAAYD,GAAwCN,EAAQM,IAAgB,GAC5EG,OAASC,GAEAT,EADKS,EAASE,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,EAAEC,YAAY,G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D7B,GAAY,KAAKH,KAGnB,IAAMmC,EAAe3B,EAAoBC,CAAO,EAC5C2B,EAAe,GAAGD,IAAehC,IAErC,IAAK,IAAIkC,EAAQ,EAAGpB,EAAMqB,MAAM7B,EAAS7B,EAAAA,GAAG2D,MAAM,UAAU,GAAA,EAAG5D,EAAAA,IAAAA,CAAIyD,CAAY,CAAC,EAAGC,IAEjFD,EAAe,GAAGD,IAAeK,SADHH,EAAK,GAAIrC,MAGzC,GAAI,CACF,IAAMyC,EAAO,MAAMb,EAAKc,YAAY,EAC9BrB,EAAW,MAAMJ,EAAMC,QAAQyB,aAAa,MAAOP,EAAc,CAC/DK,OACN1C,YAAa+B,CACf,CAAQ,EACR,GAAI,CAACT,EAASC,GACZ,MAAUO,MAAM,4BAA4BR,EAASuB,OAAM,GAAIvB,EAASwB,YAAY,CAExF,OAASC,EAAO,CACd,MAAUjB,MAAM,4BAA4BiB,GAAO,CACrD,CAEA,IAAMC,EAAclE,EAAAA,MAAMkE,YAAY,EACtC,GAAIA,EACF,GAAI,CACF,MAAMjE,EAAAA,oBAAoBkE,IAAIC,iBAAiBb,EAAcW,EAAa,CACxEG,OAAQ,CAAC,MAAM,CACjB,CAAC,CACH,OAASJ,EAAO,CACdK,QAAQL,MAAM,+CAA+CA,GAAO,CACtE,CAGF,OAAOV,CACT,C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LiveStore, NamedNode } from '../../../../../../node_modules/rdflib';
|
|
2
|
+
export declare function invalidateResolvedPhotoDisplaySrc(imageSrc?: string): void;
|
|
3
|
+
export declare function resolvePhotoDisplaySrc(store: LiveStore, imageSrc?: string): Promise<string | undefined>;
|
|
4
|
+
export declare function uploadPhotoFile(store: LiveStore, subject: NamedNode, file: File): Promise<string>;
|
|
5
|
+
//# sourceMappingURL=imageHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imageHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAMlD,wBAAgB,iCAAiC,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAU1E;AAmCD,wBAAsB,sBAAsB,CAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B9G;AAED,wBAAsB,eAAe,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAoDxG"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ns as e } from "solid-ui";
|
|
2
|
+
import { authn as t, solidLogicSingleton as n } from "solid-logic";
|
|
3
|
+
import { sym as r } from "rdflib";
|
|
4
|
+
//#region src/components/profile-heading/editor/sections/heading/imageHelpers.ts
|
|
5
|
+
var i = /* @__PURE__ */ new Map();
|
|
6
|
+
function a(e) {
|
|
7
|
+
if (!e) return;
|
|
8
|
+
let t = i.get(e);
|
|
9
|
+
t && (i.delete(e), t.startsWith("blob:") && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(t));
|
|
10
|
+
}
|
|
11
|
+
var o = {
|
|
12
|
+
"image/png": "png",
|
|
13
|
+
"image/jpeg": "jpg",
|
|
14
|
+
"image/gif": "gif",
|
|
15
|
+
"image/svg+xml": "svg",
|
|
16
|
+
"image/webp": "webp",
|
|
17
|
+
"image/bmp": "bmp",
|
|
18
|
+
"image/tiff": "tiff",
|
|
19
|
+
"application/pdf": "pdf",
|
|
20
|
+
"text/plain": "txt",
|
|
21
|
+
"text/html": "html",
|
|
22
|
+
"application/json": "json",
|
|
23
|
+
"application/octet-stream": "bin"
|
|
24
|
+
}, s = Object.fromEntries(Object.entries(o).map(([e, t]) => [t, e])), c = {
|
|
25
|
+
extension: (e) => o[e] || !1,
|
|
26
|
+
lookup: (e) => s[e.split(".").pop()?.toLowerCase() || ""] || !1
|
|
27
|
+
};
|
|
28
|
+
function l(e) {
|
|
29
|
+
let t = e.doc().uri, n = t.lastIndexOf("/");
|
|
30
|
+
return n >= 0 ? t.slice(0, n + 1) : t;
|
|
31
|
+
}
|
|
32
|
+
async function u(e, t) {
|
|
33
|
+
if (!t || t.startsWith("blob:") || t.startsWith("data:")) return t;
|
|
34
|
+
let n = i.get(t);
|
|
35
|
+
if (n) return n;
|
|
36
|
+
let r = e.fetcher;
|
|
37
|
+
if (!r?._fetch || typeof URL.createObjectURL != "function") return t;
|
|
38
|
+
try {
|
|
39
|
+
let e = await r._fetch(t);
|
|
40
|
+
if (!e.ok) return t;
|
|
41
|
+
let n = await e.blob(), a = URL.createObjectURL(n);
|
|
42
|
+
return i.set(t, a), a;
|
|
43
|
+
} catch {
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function d(i, a, o) {
|
|
48
|
+
if (!i.fetcher) throw Error("Store has no fetcher.");
|
|
49
|
+
let s = o.type || c.lookup(o.name) || "application/octet-stream";
|
|
50
|
+
if (!s.startsWith("image/")) throw Error("Selected file is not an image.");
|
|
51
|
+
if (o.size > 2097152) throw Error("Selected image must be 2 MB or smaller.");
|
|
52
|
+
let u = c.extension(s) || "bin", d = encodeURIComponent(o.name || `image.${u}`);
|
|
53
|
+
s !== c.lookup(o.name || "") && (d += `_.${u}`);
|
|
54
|
+
let f = l(a), p = `${f}${d}`;
|
|
55
|
+
for (let t = 0; i.holds(a, e.vcard("hasPhoto"), r(p)); t++) p = `${f}${`image_${t}.${u}`}`;
|
|
56
|
+
try {
|
|
57
|
+
let e = await o.arrayBuffer(), t = await i.fetcher.webOperation("PUT", p, {
|
|
58
|
+
data: e,
|
|
59
|
+
contentType: s
|
|
60
|
+
});
|
|
61
|
+
if (!t.ok) throw Error(`Error uploading picture: ${t.status} ${t.statusText}`);
|
|
62
|
+
} catch (e) {
|
|
63
|
+
throw Error(`Error uploading picture: ${e}`);
|
|
64
|
+
}
|
|
65
|
+
let m = t.currentUser();
|
|
66
|
+
if (m) try {
|
|
67
|
+
await n.acl.setACLUserPublic(p, m, { public: ["Read"] });
|
|
68
|
+
} catch (e) {
|
|
69
|
+
console.error(`Error setting uploaded picture permissions: ${e}`);
|
|
70
|
+
}
|
|
71
|
+
return p;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { a as invalidateResolvedPhotoDisplaySrc, u as resolvePhotoDisplaySrc, d as uploadPhotoFile };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=imageHelpers.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageHelpers.esm.js","names":["sym","ns","authn","solidLogicSingleton","resolvedHeadingImageCache","Map","invalidateResolvedPhotoDisplaySrc","imageSrc","cachedImageSrc","get","delete","startsWith","URL","revokeObjectURL","mimeMap","extMap","Object","fromEntries","entries","map","contentType","extension","mime","lookup","filename","ext","split","pop","toLowerCase","subjectDirectoryUri","subject","docUri","doc","uri","lastSlash","lastIndexOf","slice","resolvePhotoDisplaySrc","store","fetcher","_fetch","createObjectURL","response","ok","imageBlob","blob","resolvedImageSrc","set","uploadPhotoFile","file","Error","detectedContentType","type","name","size","encodeURIComponent","directoryUri","candidateUri","index","holds","vcard","fallbackName","data","arrayBuffer","webOperation","status","statusText","error","currentUser","acl","setACLUserPublic","public","console","resolvedHeadingImageCache","invalidateResolvedPhotoDisplaySrc","imageSrc","cachedImageSrc","mimeMap","extMap","contentType","extension","mime","filename","subjectDirectoryUri","docUri","subject","lastSlash","resolvePhotoDisplaySrc","fetcher","store","response","imageBlob","resolvedImageSrc","uploadPhotoFile","detectedContentType","file","directoryUri","candidateUri","index","ns","sym","data","error","currentUser","authn","solidLogicSingleton"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imageHelpers.ts"],"sourcesContent":["import { LiveStore, NamedNode, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\nimport { authn, solidLogicSingleton } from 'solid-logic'\n\nconst resolvedHeadingImageCache = new Map<string, string>()\n\nexport function invalidateResolvedPhotoDisplaySrc (imageSrc?: string): void {\n if (!imageSrc) return\n\n const cachedImageSrc = resolvedHeadingImageCache.get(imageSrc)\n if (!cachedImageSrc) return\n\n resolvedHeadingImageCache.delete(imageSrc)\n if (cachedImageSrc.startsWith('blob:') && typeof URL.revokeObjectURL === 'function') {\n URL.revokeObjectURL(cachedImageSrc)\n }\n}\n/* Code copied from contact-pane/src/mugshotGallery and modified to fit the needs of the new design */\nconst mimeMap: Record<string, string> = {\n 'image/png': 'png',\n 'image/jpeg': 'jpg',\n 'image/gif': 'gif',\n 'image/svg+xml': 'svg',\n 'image/webp': 'webp',\n 'image/bmp': 'bmp',\n 'image/tiff': 'tiff',\n 'application/pdf': 'pdf',\n 'text/plain': 'txt',\n 'text/html': 'html',\n 'application/json': 'json',\n 'application/octet-stream': 'bin'\n}\n\nconst extMap = Object.fromEntries(\n Object.entries(mimeMap).map(([contentType, extension]) => [extension, contentType])\n) as Record<string, string>\n\nconst mime = {\n extension: (contentType: string): string | false => mimeMap[contentType] || false,\n lookup: (filename: string): string | false => {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return extMap[ext] || false\n }\n}\n\nfunction subjectDirectoryUri (subject: NamedNode): string {\n const docUri = subject.doc().uri\n const lastSlash = docUri.lastIndexOf('/')\n return lastSlash >= 0 ? docUri.slice(0, lastSlash + 1) : docUri\n}\n\nexport async function resolvePhotoDisplaySrc (store: LiveStore, imageSrc?: string): Promise<string | undefined> {\n if (!imageSrc || imageSrc.startsWith('blob:') || imageSrc.startsWith('data:')) {\n return imageSrc\n }\n\n const cachedImageSrc = resolvedHeadingImageCache.get(imageSrc)\n if (cachedImageSrc) {\n return cachedImageSrc\n }\n\n const fetcher = store.fetcher as { _fetch?: (url: string) => Promise<Response> } | undefined\n if (!fetcher?._fetch || typeof URL.createObjectURL !== 'function') {\n return imageSrc\n }\n\n try {\n const response = await fetcher._fetch(imageSrc)\n if (!response.ok) {\n return imageSrc\n }\n\n const imageBlob = await response.blob()\n const resolvedImageSrc = URL.createObjectURL(imageBlob)\n resolvedHeadingImageCache.set(imageSrc, resolvedImageSrc)\n return resolvedImageSrc\n } catch {\n return imageSrc\n }\n}\n\nexport async function uploadPhotoFile (store: LiveStore, subject: NamedNode, file: File): Promise<string> {\n if (!store.fetcher) {\n throw new Error('Store has no fetcher.')\n }\n\n const detectedContentType = file.type || mime.lookup(file.name) || 'application/octet-stream'\n if (!detectedContentType.startsWith('image/')) {\n throw new Error('Selected file is not an image.')\n }\n if (file.size > 2 * 1024 * 1024) {\n throw new Error('Selected image must be 2 MB or smaller.')\n }\n\n const extension = mime.extension(detectedContentType) || 'bin'\n let filename = encodeURIComponent(file.name || `image.${extension}`)\n\n if (detectedContentType !== mime.lookup(file.name || '')) {\n filename += `_.${extension}`\n }\n\n const directoryUri = subjectDirectoryUri(subject)\n let candidateUri = `${directoryUri}${filename}`\n\n for (let index = 0; store.holds(subject, ns.vcard('hasPhoto'), sym(candidateUri)); index++) {\n const fallbackName = `image_${index}.${extension}`\n candidateUri = `${directoryUri}${fallbackName}`\n }\n try {\n const data = await file.arrayBuffer()\n const response = await store.fetcher.webOperation('PUT', candidateUri, {\n data: data as unknown as string,\n contentType: detectedContentType\n } as any)\n if (!response.ok) {\n throw new Error(`Error uploading picture: ${response.status} ${response.statusText}`)\n }\n } catch (error) {\n throw new Error(`Error uploading picture: ${error}`)\n }\n\n const currentUser = authn.currentUser()\n if (currentUser) {\n try {\n await solidLogicSingleton.acl.setACLUserPublic(candidateUri, currentUser, {\n public: ['Read'] as unknown as []\n })\n } catch (error) {\n console.error(`Error setting uploaded picture permissions: ${error}`)\n }\n }\n\n return candidateUri\n}\n"],"mappings":";;;;AAIA,IAAMI,oBAA4B,IAAIC,IAAoB;AAE1D,SAAgBC,EAAmCC,GAAyB;CAC1E,IAAI,CAACA,GAAU;CAE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kE,IAAIC,iBAAiBb,GAAcW,GAAa,EACxEG,QAAQ,CAAC,MAAM,EACjB,CAAC;CACH,SAASJ,GAAO;EACdK,QAAQL,MAAM,+CAA+CA,GAAO;CACtE;CAGF,OAAOV;AACT"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require("../../../../../_virtual/~icons/lucide/circle-user-round.cjs.js");let e=require("lit-html");var t=e.html`<icon-lucide-circle-user-round aria-hidden="true" focusable="false" style="width:48px;height:48px;color:#D9E1F2"></icon-lucide-circle-user-round>`,n=e=>{let t=e.currentTarget,n=t?.parentElement;t&&n&&(t.hidden=!0,n.classList.add(`profile__image-frame--fallback`))},r=(r,i)=>e.html`
|
|
2
|
+
<div class=${r?`profile__image-frame`:`profile__image-frame profile__image-frame--fallback`}>
|
|
3
|
+
${r?e.html`
|
|
4
|
+
<img
|
|
5
|
+
class="profile__hero"
|
|
6
|
+
src=${r}
|
|
7
|
+
alt=${i||``}
|
|
8
|
+
width="140"
|
|
9
|
+
height="140"
|
|
10
|
+
loading="eager"
|
|
11
|
+
@error=${n}
|
|
12
|
+
/>
|
|
13
|
+
`:e.nothing}
|
|
14
|
+
<div class="profile__hero-alt" role="img" aria-label=${i||``}>
|
|
15
|
+
<span class="profile__hero-icon">${t}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
`;exports.Image=r;
|
|
19
|
+
//# sourceMappingURL=imagePreview.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePreview.cjs.js","names":["html","nothing","personInCircleIcon","showHeadingImageFallback","event","image","currentTarget","frame","parentElement","hidden","classList","add","Image","src","alt","nothing","lit_html","personInCircleIcon","showHeadingImageFallback","image","event","frame","Image","src","alt"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imagePreview.ts"],"sourcesContent":["import { html, nothing } from 'lit-html'\nimport '~icons/lucide/circle-user-round'\n\nconst personInCircleIcon = html`<icon-lucide-circle-user-round aria-hidden=\"true\" focusable=\"false\" style=\"width:48px;height:48px;color:#D9E1F2\"></icon-lucide-circle-user-round>`\n\nconst showHeadingImageFallback = (event: Event) => {\n const image = event.currentTarget as HTMLImageElement | null\n const frame = image?.parentElement\n if (!image || !frame) return\n\n image.hidden = true\n frame.classList.add('profile__image-frame--fallback')\n}\n\nexport const Image = (src?: string, alt?: string) => html`\n <div class=${src ? 'profile__image-frame' : 'profile__image-frame profile__image-frame--fallback'}>\n ${src\n ? html`\n <img\n class=\"profile__hero\"\n src=${src}\n alt=${alt || ''}\n width=\"140\"\n height=\"140\"\n loading=\"eager\"\n @error=${showHeadingImageFallback}\n />\n `\n : nothing}\n <div class=\"profile__hero-alt\" role=\"img\" aria-label=${alt || ''}>\n <span class=\"profile__hero-icon\">${personInCircleIcon}</span>\n </div>\n </div>\n`\n"],"mappings":"A,oGAGA,IAAME,EAAqBF,EAAAA,IAAI,oJAEzBG,EAA4BC,GAAiB,CACjD,IAAMC,EAAQD,EAAME,cACdC,EAAQF,GAAOG,cAChBH,GAAUE,IAEfF,EAAMI,OAAS,GACfF,EAAMG,UAAUC,IAAI,gCAAgC,EACtD,EAEaC,GAASC,EAAcC,IAAiBd,EAAAA,IAAI;eAC1Ca,EAAM,uBAAyB,sDAAqD;MAC7FA,EACEb,EAAAA,IAAI;;;kBAGMa,EAAG;kBACHC,GAAO,GAAE;;;;qBAINX,EAAwB;;UAGrCF,EAAAA,QAAO;2DAC4Ca,GAAO,GAAE;yCAC3BZ,EAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePreview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imagePreview.ts"],"names":[],"mappings":"AACA,OAAO,iCAAiC,CAAA;AAaxC,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,yCAmB/C,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "../../../../../_virtual/~icons/lucide/circle-user-round.esm.js";
|
|
2
|
+
import { html as e, nothing as t } from "lit-html";
|
|
3
|
+
//#region src/components/profile-heading/editor/sections/heading/imagePreview.ts
|
|
4
|
+
var n = e`<icon-lucide-circle-user-round aria-hidden="true" focusable="false" style="width:48px;height:48px;color:#D9E1F2"></icon-lucide-circle-user-round>`, r = (e) => {
|
|
5
|
+
let t = e.currentTarget, n = t?.parentElement;
|
|
6
|
+
t && n && (t.hidden = !0, n.classList.add("profile__image-frame--fallback"));
|
|
7
|
+
}, i = (i, a) => e`
|
|
8
|
+
<div class=${i ? "profile__image-frame" : "profile__image-frame profile__image-frame--fallback"}>
|
|
9
|
+
${i ? e`
|
|
10
|
+
<img
|
|
11
|
+
class="profile__hero"
|
|
12
|
+
src=${i}
|
|
13
|
+
alt=${a || ""}
|
|
14
|
+
width="140"
|
|
15
|
+
height="140"
|
|
16
|
+
loading="eager"
|
|
17
|
+
@error=${r}
|
|
18
|
+
/>
|
|
19
|
+
` : t}
|
|
20
|
+
<div class="profile__hero-alt" role="img" aria-label=${a || ""}>
|
|
21
|
+
<span class="profile__hero-icon">${n}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as Image };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=imagePreview.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePreview.esm.js","names":["html","nothing","personInCircleIcon","showHeadingImageFallback","event","image","currentTarget","frame","parentElement","hidden","classList","add","Image","src","alt","personInCircleIcon","showHeadingImageFallback","image","event","frame","Image","src","alt","nothing"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/imagePreview.ts"],"sourcesContent":["import { html, nothing } from 'lit-html'\nimport '~icons/lucide/circle-user-round'\n\nconst personInCircleIcon = html`<icon-lucide-circle-user-round aria-hidden=\"true\" focusable=\"false\" style=\"width:48px;height:48px;color:#D9E1F2\"></icon-lucide-circle-user-round>`\n\nconst showHeadingImageFallback = (event: Event) => {\n const image = event.currentTarget as HTMLImageElement | null\n const frame = image?.parentElement\n if (!image || !frame) return\n\n image.hidden = true\n frame.classList.add('profile__image-frame--fallback')\n}\n\nexport const Image = (src?: string, alt?: string) => html`\n <div class=${src ? 'profile__image-frame' : 'profile__image-frame profile__image-frame--fallback'}>\n ${src\n ? html`\n <img\n class=\"profile__hero\"\n src=${src}\n alt=${alt || ''}\n width=\"140\"\n height=\"140\"\n loading=\"eager\"\n @error=${showHeadingImageFallback}\n />\n `\n : nothing}\n <div class=\"profile__hero-alt\" role=\"img\" aria-label=${alt || ''}>\n <span class=\"profile__hero-icon\">${personInCircleIcon}</span>\n </div>\n </div>\n`\n"],"mappings":";;;AAGA,IAAME,IAAqBF,CAAI,qJAEzBG,KAA4BC,MAAiB;CACjD,IAAMC,IAAQD,EAAME,eACdC,IAAQF,GAAOG;CACrB,AAAKH,KAAUE,MAEfF,EAAMI,SAAS,IACfF,EAAMG,UAAUC,IAAI,gCAAgC;AACtD,GAEaC,KAASC,GAAcC,MAAiBd,CAAI;eAC1Ca,IAAM,yBAAyB,sDAAqD;MAC7FA,IACEb,CAAI;;;kBAGMa,EAAG;kBACHC,KAAO,GAAE;;;;qBAINX,EAAwB;;YAGrCF,EAAO;2DAC4Ca,KAAO,GAAE;yCAC3BZ,EAAkB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../texts/messageTexts.cjs.js"),t=require("../shared/rdfMutationHelpers.cjs.js"),n=require("../shared/idNodeFactory.cjs.js");let r=require("solid-ui"),i=require("rdflib");function a(e){let t=(e||``).trim();if(!t)return{};let[n,r]=t.split(`/`).map(e=>e.trim());return{subjectPronoun:n||void 0,objectPronoun:r||void 0}}function o(e,t,n,a){let o=a.value.startsWith(`tel:`)?a.value:`tel:${a.value}`,s=(0,i.sym)(o),c=[(0,i.st)(e,r.ns.vcard(`hasTelephone`),n,t),(0,i.st)(n,r.ns.vcard(`value`),s,t)];return a.type&&c.push((0,i.st)(n,r.ns.rdf(`type`),r.ns.vcard(a.type),t)),c}function s(e,t,n,a){let o=a.value.startsWith(`mailto:`)?a.value:`mailto:${a.value}`,s=(0,i.sym)(o),c=[(0,i.st)(e,r.ns.vcard(`hasEmail`),n,t),(0,i.st)(n,r.ns.vcard(`value`),s,t)];return a.type&&c.push((0,i.st)(n,r.ns.rdf(`type`),r.ns.vcard(a.type),t)),c}function c(e,t,n,a){let o=[(0,i.st)(e,r.ns.vcard(`hasAddress`),n,t)];return a.type&&o.push((0,i.st)(n,r.ns.rdf(`type`),r.ns.vcard(a.type),t)),a.streetAddress&&o.push((0,i.st)(n,r.ns.vcard(`street-address`),(0,i.literal)(a.streetAddress),t)),a.locality&&o.push((0,i.st)(n,r.ns.vcard(`locality`),(0,i.literal)(a.locality),t)),a.region&&o.push((0,i.st)(n,r.ns.vcard(`region`),(0,i.literal)(a.region),t)),a.postalCode&&o.push((0,i.st)(n,r.ns.vcard(`postal-code`),(0,i.literal)(a.postalCode),t)),a.countryName&&o.push((0,i.st)(n,r.ns.vcard(`country-name`),(0,i.literal)(a.countryName),t)),o}function l(e,n){return e.find(e=>!!e.entryNode&&!!t.findExistingNode(n,e.entryNode))}function u(e){return e.find(e=>!e.entryNode)}async function d(i,a,s,c){let d=a.doc(),f=i.each(a,r.ns.vcard(`hasTelephone`),null,d),p=[],m=[],h=l(s.remove,f),g=l(s.update,f),_=u(s.create)||s.create[0];if(h?.entryNode){let e=t.findExistingNode(f,h.entryNode);if(e){let n=t.collectLinkedNodeStatements(i,a,r.ns.vcard(`hasTelephone`),d).linkStatements.find(t=>t.object?.value===e.value);n&&p.push(n),p.push(...t.collectNodeStatements(i,e,d))}}if(g){let e=t.findExistingNode(f,g.entryNode);e&&(p.push(...t.collectNodeStatements(i,e,d)),m.push(...o(a,d,e,g)))}_&&m.push(...o(a,d,n.createIdNode(d),_));let v=await t.shouldForceDocumentPutForStatements(i,d,m,void 0,{documentTextCache:c});await t.runUpdateTransport(i,d,p,m,{unsupportedMessage:e.updaterUnsupportedStoreErrorMessageText,failureMessage:`Failed to save heading updates`,documentTextCache:c,useDavFallback:!1,usePutFallback:v,forcePut:v})}async function f(i,a,o,c){let d=a.doc(),f=i.each(a,r.ns.vcard(`hasEmail`),null,d),p=[],m=[],h=l(o.remove,f),g=l(o.update,f),_=u(o.create)||o.create[0];if(h?.entryNode){let e=t.findExistingNode(f,h.entryNode);if(e){let n=t.collectLinkedNodeStatements(i,a,r.ns.vcard(`hasEmail`),d).linkStatements.find(t=>t.object?.value===e.value);n&&p.push(n),p.push(...t.collectNodeStatements(i,e,d))}}if(g){let e=t.findExistingNode(f,g.entryNode);e&&(p.push(...t.collectNodeStatements(i,e,d)),m.push(...s(a,d,e,g)))}_&&m.push(...s(a,d,n.createIdNode(d),_));let v=await t.shouldForceDocumentPutForStatements(i,d,m,void 0,{documentTextCache:c});await t.runUpdateTransport(i,d,p,m,{unsupportedMessage:e.updaterUnsupportedStoreErrorMessageText,failureMessage:`Failed to save heading updates`,documentTextCache:c,useDavFallback:!1,usePutFallback:v,forcePut:v})}async function p(i,a,o,s){let d=a.doc(),f=i.each(a,r.ns.vcard(`hasAddress`),null,d),p=[],m=[],h=l(o.remove,f),g=l(o.update,f),_=u(o.create)||o.create[0];if(h?.entryNode){let e=t.findExistingNode(f,h.entryNode);if(e){let n=t.collectLinkedNodeStatements(i,a,r.ns.vcard(`hasAddress`),d).linkStatements.find(t=>t.object?.value===e.value);n&&p.push(n),p.push(...t.collectNodeStatements(i,e,d))}}if(g){let e=t.findExistingNode(f,g.entryNode);e&&(p.push(...t.collectNodeStatements(i,e,d)),m.push(...c(a,d,e,g)))}_&&m.push(...c(a,d,n.createIdNode(d),_));let v=await t.shouldForceDocumentPutForStatements(i,d,m,void 0,{documentTextCache:s});await t.runUpdateTransport(i,d,p,m,{unsupportedMessage:e.updaterUnsupportedStoreErrorMessageText,failureMessage:`Failed to save heading updates`,documentTextCache:s,useDavFallback:!1,usePutFallback:v,forcePut:v})}async function m(n,o,s,c){let l=o.doc(),u=[],d=[],f=(e,r)=>{let a=(r||``).trim(),s=a?(0,i.literal)(a):null;t.replacePredicateStatements(n,o,e,l,u,d,s)},p=e=>{let a=(e||``).trim(),s=a?a.startsWith(`http://`)||a.startsWith(`https://`)?(0,i.sym)(a):(0,i.literal)(a):null;t.replacePredicateStatements(n,o,r.ns.vcard(`hasPhoto`),l,u,d,s)},m=e=>{let{subjectPronoun:s,objectPronoun:c}=a(e);t.replacePredicateStatements(n,o,r.ns.solid(`preferredSubjectPronoun`),l,u,d,s?(0,i.literal)(s):null),t.replacePredicateStatements(n,o,r.ns.solid(`preferredObjectPronoun`),l,u,d,c?(0,i.literal)(c):null),t.replacePredicateStatements(n,o,r.ns.solid(`preferredRelativePronoun`),l,u,d,null)},h=(e,t=!1)=>{let n=t?{name:``,nickname:``,pronouns:``,dateOfBirth:``,imageSrc:``}:e;f(r.ns.vcard(`fn`),n.name),f(r.ns.foaf(`nick`),n.nickname),f(r.ns.vcard(`nickname`),n.nickname),f(r.ns.vcard(`bday`),n.dateOfBirth),m(n.pronouns),p(n.imageSrc)},g=s.remove[0],_=s.update[0],v=s.create[0],y=_||v||g;y&&h(y,!(!g||_||v));let b=await t.shouldForceDocumentPutForStatements(n,l,d,void 0,{documentTextCache:c});await t.runUpdateTransport(n,l,u,d,{unsupportedMessage:e.updaterUnsupportedStoreErrorMessageText,failureMessage:`Failed to save heading updates`,documentTextCache:c,useDavFallback:!1,usePutFallback:b,forcePut:b})}async function h(t,n,r){try{let e=new Map;await m(t,n,r.basicOps,e),await d(t,n,r.phoneOps,e),await f(t,n,r.emailOps,e),await p(t,n,r.addressOps,e)}catch(t){let n=t instanceof Error?t:Error(String(t));console.error(e.headingMutationSaveFailedDebugText,n);let r=Error(e.saveHeadingUpdatesFailedMessageText);throw Object.defineProperty(r,"cause",{value:n}),r}}exports.processHeadingMutations=h;
|
|
2
|
+
//# sourceMappingURL=mutations.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.cjs.js","names":["st","literal","sym","ns","collectLinkedNodeStatements","collectNodeStatements","findExistingNode","replacePredicateStatements","runUpdateTransport","shouldForceDocumentPutForStatements","createIdNode","headingMutationSaveFailedDebugText","saveHeadingUpdatesFailedMessageText","updaterUnsupportedStoreErrorMessageText","splitPronouns","value","normalized","trim","subjectPronounRaw","objectPronounRaw","split","map","part","subjectPronoun","undefined","objectPronoun","buildPhoneStatements","subject","doc","node","phone","normalizedValue","startsWith","valueNode","inserts","vcard","type","push","rdf","buildEmailStatements","email","buildAddressStatements","address","streetAddress","locality","region","postalCode","countryName","findOpWithExistingEntry","ops","existingNodes","find","op","Boolean","entryNode","findCreateOp","mutatePhoneEntry","store","phoneOps","documentTextCache","existingPhoneNodes","each","deletions","insertions","removePhone","remove","updatePhone","update","createPhone","create","existingNode","linkedPhoneStatements","matchingLinkStatement","linkStatements","statement","object","shouldSerializeDocument","unsupportedMessage","failureMessage","useDavFallback","usePutFallback","forcePut","mutateEmailEntry","emailOps","existingEmailNodes","removeEmail","updateEmail","createEmail","linkedEmailStatements","mutateAddressEntry","addressOps","existingAddressNodes","removeAddress","updateAddress","createAddress","linkedAddressStatements","mutateBasicProfileEntry","basicOps","replaceLiteralField","predicate","nextObject","replacePhotoField","replacePronounFields","solid","applyBasics","basic","clearAll","data","name","nickname","pronouns","dateOfBirth","imageSrc","foaf","removeBasic","updateBasic","createBasic","selectedBasic","processHeadingMutations","mutationPlan","Map","error","rootError","Error","String","console","saveError","Object","defineProperty","sym","st","ns","literal","findExistingNode","collectLinkedNodeStatements","collectNodeStatements","createIdNode","shouldForceDocumentPutForStatements","runUpdateTransport","updaterUnsupportedStoreErrorMessageText","headingMutationSaveFailedDebugText","saveHeadingUpdatesFailedMessageText","require_messageTexts","require_rdfMutationHelpers","require_idNodeFactory","solid_ui","rdflib","splitPronouns","normalized","value","subjectPronounRaw","objectPronounRaw","part","buildPhoneStatements","normalizedValue","phone","valueNode","inserts","subject","node","doc","buildEmailStatements","email","buildAddressStatements","address","findOpWithExistingEntry","ops","op","existingNodes","findCreateOp","mutatePhoneEntry","existingPhoneNodes","store","deletions","insertions","removePhone","phoneOps","updatePhone","createPhone","existingNode","matchingLinkStatement","statement","shouldSerializeDocument","mutateEmailEntry","existingEmailNodes","removeEmail","emailOps","updateEmail","createEmail","mutateAddressEntry","existingAddressNodes","removeAddress","addressOps","updateAddress","createAddress","mutateBasicProfileEntry","replaceLiteralField","nextObject","predicate","replacePhotoField","replacePronounFields","subjectPronoun","objectPronoun","applyBasics","data","clearAll","basic","removeBasic","basicOps","updateBasic","createBasic","selectedBasic","processHeadingMutations","documentTextCache","mutationPlan","error","rootError","saveError"],"sources":["../../../../../../src/components/profile-heading/editor/sections/heading/mutations.ts"],"sourcesContent":["import { LiveStore, NamedNode, Node, st, literal, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\nimport { ProfileBasicRow, HeadingMutationPlan } from './types'\nimport { MutationOps } from '../shared/types'\nimport { MutationDocumentTextCache, collectLinkedNodeStatements, collectNodeStatements, findExistingNode, replacePredicateStatements, runUpdateTransport, shouldForceDocumentPutForStatements } from '../shared/rdfMutationHelpers'\nimport { createIdNode } from '../shared/idNodeFactory'\nimport { ContactAddressRow, ContactPointRow } from '../contactInfo/types'\nimport { headingMutationSaveFailedDebugText, saveHeadingUpdatesFailedMessageText, updaterUnsupportedStoreErrorMessageText } from '../../texts'\n\nfunction splitPronouns (value?: string): { subjectPronoun?: string, objectPronoun?: string } {\n const normalized = (value || '').trim()\n if (!normalized) return {}\n\n const [subjectPronounRaw, objectPronounRaw] = normalized.split('/').map((part) => part.trim())\n const subjectPronoun = subjectPronounRaw || undefined\n const objectPronoun = objectPronounRaw || undefined\n\n return { subjectPronoun, objectPronoun }\n}\n\nfunction buildPhoneStatements (subject: NamedNode, doc: NamedNode, node: Node, phone: ContactPointRow) {\n const normalizedValue = phone.value.startsWith('tel:') ? phone.value : `tel:${phone.value}`\n const valueNode = sym(normalizedValue)\n const inserts = [\n st(subject, ns.vcard('hasTelephone'), node as any, doc),\n st(node as any, ns.vcard('value'), valueNode as any, doc)\n ]\n\n if (phone.type) {\n inserts.push(st(node as any, ns.rdf('type'), ns.vcard(phone.type), doc))\n }\n\n return inserts\n}\n\nfunction buildEmailStatements (subject: NamedNode, doc: NamedNode, node: Node, email: ContactPointRow) {\n const normalizedValue = email.value.startsWith('mailto:') ? email.value : `mailto:${email.value}`\n const valueNode = sym(normalizedValue)\n const inserts = [\n st(subject, ns.vcard('hasEmail'), node as any, doc),\n st(node as any, ns.vcard('value'), valueNode as any, doc)\n ]\n\n if (email.type) {\n inserts.push(st(node as any, ns.rdf('type'), ns.vcard(email.type), doc))\n }\n\n return inserts\n}\n\nfunction buildAddressStatements (subject: NamedNode, doc: NamedNode, node: Node, address: ContactAddressRow) {\n const inserts = [st(subject, ns.vcard('hasAddress'), node as any, doc)]\n\n if (address.type) inserts.push(st(node as any, ns.rdf('type'), ns.vcard(address.type), doc))\n if (address.streetAddress) inserts.push(st(node as any, ns.vcard('street-address'), literal(address.streetAddress), doc))\n if (address.locality) inserts.push(st(node as any, ns.vcard('locality'), literal(address.locality), doc))\n if (address.region) inserts.push(st(node as any, ns.vcard('region'), literal(address.region), doc))\n if (address.postalCode) inserts.push(st(node as any, ns.vcard('postal-code'), literal(address.postalCode), doc))\n if (address.countryName) inserts.push(st(node as any, ns.vcard('country-name'), literal(address.countryName), doc))\n\n return inserts\n}\n\nfunction findOpWithExistingEntry<T extends { entryNode: string }> (ops: T[], existingNodes: Node[]): T | undefined {\n return ops.find((op) => Boolean(op.entryNode) && Boolean(findExistingNode(existingNodes, op.entryNode)))\n}\n\nfunction findCreateOp<T extends { entryNode: string }> (ops: T[]): T | undefined {\n return ops.find((op) => !op.entryNode)\n}\n\nasync function mutatePhoneEntry (store: LiveStore, subject: NamedNode, phoneOps: MutationOps<ContactPointRow>, documentTextCache?: MutationDocumentTextCache) {\n const doc = subject.doc()\n const existingPhoneNodes = store.each(subject, ns.vcard('hasTelephone'), null, doc) as Node[]\n const deletions: any[] = []\n const insertions: any[] = []\n\n const removePhone = findOpWithExistingEntry(phoneOps.remove, existingPhoneNodes)\n const updatePhone = findOpWithExistingEntry(phoneOps.update, existingPhoneNodes)\n const createPhone = findCreateOp(phoneOps.create) || phoneOps.create[0]\n\n if (removePhone?.entryNode) {\n const existingNode = findExistingNode(existingPhoneNodes, removePhone.entryNode)\n if (existingNode) {\n const linkedPhoneStatements = collectLinkedNodeStatements(store, subject, ns.vcard('hasTelephone'), doc)\n const matchingLinkStatement = linkedPhoneStatements.linkStatements.find((statement) => statement.object?.value === existingNode.value)\n if (matchingLinkStatement) {\n deletions.push(matchingLinkStatement)\n }\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n }\n }\n\n if (updatePhone) {\n const existingNode = findExistingNode(existingPhoneNodes, updatePhone.entryNode)\n if (existingNode) {\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n insertions.push(...buildPhoneStatements(subject, doc, existingNode, updatePhone))\n }\n }\n\n if (createPhone) {\n insertions.push(...buildPhoneStatements(subject, doc, createIdNode(doc), createPhone))\n }\n\n const shouldSerializeDocument = await shouldForceDocumentPutForStatements(store, doc, insertions, undefined, { documentTextCache })\n\n await runUpdateTransport(store, doc, deletions, insertions, {\n unsupportedMessage: updaterUnsupportedStoreErrorMessageText,\n failureMessage: 'Failed to save heading updates',\n documentTextCache,\n useDavFallback: false,\n usePutFallback: shouldSerializeDocument,\n forcePut: shouldSerializeDocument\n })\n}\n\nasync function mutateEmailEntry (store: LiveStore, subject: NamedNode, emailOps: MutationOps<ContactPointRow>, documentTextCache?: MutationDocumentTextCache) {\n const doc = subject.doc()\n const existingEmailNodes = store.each(subject, ns.vcard('hasEmail'), null, doc) as Node[]\n const deletions: any[] = []\n const insertions: any[] = []\n\n const removeEmail = findOpWithExistingEntry(emailOps.remove, existingEmailNodes)\n const updateEmail = findOpWithExistingEntry(emailOps.update, existingEmailNodes)\n const createEmail = findCreateOp(emailOps.create) || emailOps.create[0]\n\n if (removeEmail?.entryNode) {\n const existingNode = findExistingNode(existingEmailNodes, removeEmail.entryNode)\n if (existingNode) {\n const linkedEmailStatements = collectLinkedNodeStatements(store, subject, ns.vcard('hasEmail'), doc)\n const matchingLinkStatement = linkedEmailStatements.linkStatements.find((statement) => statement.object?.value === existingNode.value)\n if (matchingLinkStatement) {\n deletions.push(matchingLinkStatement)\n }\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n }\n }\n\n if (updateEmail) {\n const existingNode = findExistingNode(existingEmailNodes, updateEmail.entryNode)\n if (existingNode) {\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n insertions.push(...buildEmailStatements(subject, doc, existingNode, updateEmail))\n }\n }\n\n if (createEmail) {\n insertions.push(...buildEmailStatements(subject, doc, createIdNode(doc), createEmail))\n }\n\n const shouldSerializeDocument = await shouldForceDocumentPutForStatements(store, doc, insertions, undefined, { documentTextCache })\n\n await runUpdateTransport(store, doc, deletions, insertions, {\n unsupportedMessage: updaterUnsupportedStoreErrorMessageText,\n failureMessage: 'Failed to save heading updates',\n documentTextCache,\n useDavFallback: false,\n usePutFallback: shouldSerializeDocument,\n forcePut: shouldSerializeDocument\n })\n}\n\nasync function mutateAddressEntry (store: LiveStore, subject: NamedNode, addressOps: MutationOps<ContactAddressRow>, documentTextCache?: MutationDocumentTextCache) {\n const doc = subject.doc()\n const existingAddressNodes = store.each(subject, ns.vcard('hasAddress'), null, doc) as Node[]\n const deletions: any[] = []\n const insertions: any[] = []\n\n const removeAddress = findOpWithExistingEntry(addressOps.remove, existingAddressNodes)\n const updateAddress = findOpWithExistingEntry(addressOps.update, existingAddressNodes)\n const createAddress = findCreateOp(addressOps.create) || addressOps.create[0]\n\n if (removeAddress?.entryNode) {\n const existingNode = findExistingNode(existingAddressNodes, removeAddress.entryNode)\n if (existingNode) {\n const linkedAddressStatements = collectLinkedNodeStatements(store, subject, ns.vcard('hasAddress'), doc)\n const matchingLinkStatement = linkedAddressStatements.linkStatements.find((statement) => statement.object?.value === existingNode.value)\n if (matchingLinkStatement) {\n deletions.push(matchingLinkStatement)\n }\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n }\n }\n\n if (updateAddress) {\n const existingNode = findExistingNode(existingAddressNodes, updateAddress.entryNode)\n if (existingNode) {\n deletions.push(...collectNodeStatements(store, existingNode, doc))\n insertions.push(...buildAddressStatements(subject, doc, existingNode, updateAddress))\n }\n }\n\n if (createAddress) {\n insertions.push(...buildAddressStatements(subject, doc, createIdNode(doc), createAddress))\n }\n\n const shouldSerializeDocument = await shouldForceDocumentPutForStatements(store, doc, insertions, undefined, { documentTextCache })\n\n await runUpdateTransport(store, doc, deletions, insertions, {\n unsupportedMessage: updaterUnsupportedStoreErrorMessageText,\n failureMessage: 'Failed to save heading updates',\n documentTextCache,\n useDavFallback: false,\n usePutFallback: shouldSerializeDocument,\n forcePut: shouldSerializeDocument\n })\n}\n\nasync function mutateBasicProfileEntry (store: LiveStore, subject: NamedNode, basicOps: MutationOps<ProfileBasicRow>, documentTextCache?: MutationDocumentTextCache) {\n const doc = subject.doc()\n const deletions: any[] = []\n const insertions: any[] = []\n\n const replaceLiteralField = (predicate: NamedNode, value?: string) => {\n const normalized = (value || '').trim()\n const nextObject = normalized ? literal(normalized) : null\n replacePredicateStatements(store, subject, predicate, doc, deletions, insertions, nextObject)\n }\n\n const replacePhotoField = (value?: string) => {\n const normalized = (value || '').trim()\n const nextObject = !normalized\n ? null\n : (normalized.startsWith('http://') || normalized.startsWith('https://'))\n ? sym(normalized)\n : literal(normalized)\n replacePredicateStatements(store, subject, ns.vcard('hasPhoto'), doc, deletions, insertions, nextObject)\n }\n\n const replacePronounFields = (value?: string) => {\n const { subjectPronoun, objectPronoun } = splitPronouns(value)\n\n replacePredicateStatements(\n store,\n subject,\n ns.solid('preferredSubjectPronoun'),\n doc,\n deletions,\n insertions,\n subjectPronoun ? literal(subjectPronoun) : null\n )\n replacePredicateStatements(\n store,\n subject,\n ns.solid('preferredObjectPronoun'),\n doc,\n deletions,\n insertions,\n objectPronoun ? literal(objectPronoun) : null\n )\n replacePredicateStatements(\n store,\n subject,\n ns.solid('preferredRelativePronoun'),\n doc,\n deletions,\n insertions,\n null\n )\n }\n\n const applyBasics = (basic: ProfileBasicRow, clearAll = false) => {\n const data = clearAll\n ? {\n name: '',\n nickname: '',\n pronouns: '',\n dateOfBirth: '',\n imageSrc: ''\n }\n : basic\n\n replaceLiteralField(ns.vcard('fn'), data.name)\n // Keep foaf:nick in sync where available in existing data.\n replaceLiteralField(ns.foaf('nick'), data.nickname)\n replaceLiteralField(ns.vcard('nickname'), data.nickname)\n replaceLiteralField(ns.vcard('bday'), data.dateOfBirth)\n replacePronounFields(data.pronouns)\n replacePhotoField(data.imageSrc)\n }\n\n const removeBasic = basicOps.remove[0]\n const updateBasic = basicOps.update[0]\n const createBasic = basicOps.create[0]\n\n const selectedBasic = updateBasic || createBasic || removeBasic\n if (selectedBasic) {\n applyBasics(selectedBasic, Boolean(removeBasic && !updateBasic && !createBasic))\n }\n\n const shouldSerializeDocument = await shouldForceDocumentPutForStatements(store, doc, insertions, undefined, { documentTextCache })\n\n await runUpdateTransport(store, doc, deletions, insertions, {\n unsupportedMessage: updaterUnsupportedStoreErrorMessageText,\n failureMessage: 'Failed to save heading updates',\n documentTextCache,\n useDavFallback: false,\n usePutFallback: shouldSerializeDocument,\n forcePut: shouldSerializeDocument\n })\n}\n\nexport async function processHeadingMutations (store: LiveStore, subject: NamedNode, mutationPlan: HeadingMutationPlan) {\n try {\n const documentTextCache: MutationDocumentTextCache = new Map()\n await mutateBasicProfileEntry(store, subject, mutationPlan.basicOps, documentTextCache)\n await mutatePhoneEntry(store, subject, mutationPlan.phoneOps, documentTextCache)\n await mutateEmailEntry(store, subject, mutationPlan.emailOps, documentTextCache)\n await mutateAddressEntry(store, subject, mutationPlan.addressOps, documentTextCache)\n } catch (error) {\n const rootError = error instanceof Error ? error : new Error(String(error))\n console.error(headingMutationSaveFailedDebugText, rootError)\n const saveError = new Error(saveHeadingUpdatesFailedMessageText)\n Object.defineProperty(saveError, 'cause', { value: rootError })\n throw saveError\n }\n}\n"],"mappings":"A,8LASA,SAASc,EAAeC,EAAqE,CAC3F,IAAMC,GAAcD,GAAS,GAAA,CAAIE,KAAK,EACtC,GAAI,CAACD,EAAY,MAAO,CAAC,EAEzB,GAAM,CAACE,EAAmBC,GAAoBH,EAAWI,MAAM,GAAG,CAAC,CAACC,IAAKC,GAASA,EAAKL,KAAK,CAAC,EAI7F,MAAO,CAAEM,eAHcL,GAAqBM,IAAAA,GAGnBC,cAFHN,GAAoBK,IAAAA,EAEH,CACzC,CAEA,SAASE,EAAsBC,EAAoBC,EAAgBC,EAAYC,EAAwB,CACrG,IAAMC,EAAkBD,EAAMf,MAAMiB,WAAW,MAAM,EAAIF,EAAMf,MAAQ,OAAOe,EAAMf,QAC9EkB,GAAAA,EAAY/B,EAAAA,IAAAA,CAAI6B,CAAe,EAC/BG,EAAU,EAAA,EACdlC,EAAAA,GAAAA,CAAG2B,EAASxB,EAAAA,GAAGgC,MAAM,cAAc,EAAGN,EAAaD,CAAG,GAAA,EACtD5B,EAAAA,GAAAA,CAAG6B,EAAa1B,EAAAA,GAAGgC,MAAM,OAAO,EAAGF,EAAkBL,CAAG,CAAC,EAO3D,OAJIE,EAAMM,MACRF,EAAQG,MAAAA,EAAKrC,EAAAA,GAAAA,CAAG6B,EAAa1B,EAAAA,GAAGmC,IAAI,MAAM,EAAGnC,EAAAA,GAAGgC,MAAML,EAAMM,IAAI,EAAGR,CAAG,CAAC,EAGlEM,CACT,CAEA,SAASK,EAAsBZ,EAAoBC,EAAgBC,EAAYW,EAAwB,CACrG,IAAMT,EAAkBS,EAAMzB,MAAMiB,WAAW,SAAS,EAAIQ,EAAMzB,MAAQ,UAAUyB,EAAMzB,QACpFkB,GAAAA,EAAY/B,EAAAA,IAAAA,CAAI6B,CAAe,EAC/BG,EAAU,EAAA,EACdlC,EAAAA,GAAAA,CAAG2B,EAASxB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,IAAMC,EAAYD,aAAiBE,MAAQF,EAAYE,MAAMC,OAAOH,CAAK,CAAC,EAC1EI,QAAQJ,MAAM9G,EAAAA,mCAAoC+G,CAAS,EAC3D,IAAMI,EAAgBH,MAAM/G,EAAAA,mCAAmC,EAE/D,MADAmH,OAAOC,eAAeF,EAAW,QAAS,CAAE/G,MAAO2G,CAAU,CAAC,EACxDI,CACR,CACF,C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LiveStore, NamedNode } from '../../../../../../node_modules/rdflib';
|
|
2
|
+
import { HeadingMutationPlan } from './types';
|
|
3
|
+
export declare function processHeadingMutations(store: LiveStore, subject: NamedNode, mutationPlan: HeadingMutationPlan): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../../../../src/components/profile-heading/editor/sections/heading/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAErE,OAAO,EAAmB,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA6S9D,wBAAsB,uBAAuB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,iBAcrH"}
|