nextcloud-server/dist/federatedfilesharing-settin...

1 line
15 KiB
Plaintext

{"version":3,"file":"federatedfilesharing-settings-personal.mjs","sources":["../node_modules/vue-material-design-icons/Check.vue","../node_modules/vue-material-design-icons/Web.vue","../build/frontend/apps/federatedfilesharing/src/components/PersonalSettings.vue","../build/frontend/apps/federatedfilesharing/src/settings-personal.ts"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon check-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CheckIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon web-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"WebIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script setup lang=\"ts\">\nimport { showSuccess } from '@nextcloud/dialogs'\nimport { loadState } from '@nextcloud/initial-state'\nimport { t } from '@nextcloud/l10n'\nimport { imagePath } from '@nextcloud/router'\nimport { computed, ref } from 'vue'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcInputField from '@nextcloud/vue/components/NcInputField'\nimport NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'\nimport IconCheck from 'vue-material-design-icons/Check.vue'\nimport IconClipboard from 'vue-material-design-icons/ContentCopy.vue'\nimport IconWeb from 'vue-material-design-icons/Web.vue'\n\nconst productName = window.OC.theme.productName\nconst color = loadState<string>('federatedfilesharing', 'color')\nconst textColor = loadState<string>('federatedfilesharing', 'textColor')\nconst cloudId = loadState<string>('federatedfilesharing', 'cloudId')\nconst docUrlFederated = loadState<string>('federatedfilesharing', 'docUrlFederated')\nconst logoPath = loadState<string>('federatedfilesharing', 'logoPath')\nconst reference = loadState<string>('federatedfilesharing', 'reference')\nconst urlFacebookIcon = imagePath('core', 'facebook')\nconst urlMastodonIcon = imagePath('core', 'mastodon')\nconst urlBlueSkyIcon = imagePath('core', 'bluesky')\nconst messageWithURL = t('federatedfilesharing', 'Share with me through my #Nextcloud Federated Cloud ID, see {url}', { url: reference })\nconst messageWithoutURL = t('federatedfilesharing', 'Share with me through my #Nextcloud Federated Cloud ID')\nconst shareMastodonUrl = `https://mastodon.social/?text=${encodeURIComponent(messageWithoutURL)}&url=${encodeURIComponent(reference)}`\nconst shareFacebookUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(reference)}`\nconst shareBlueSkyUrl = `https://bsky.app/intent/compose?text=${encodeURIComponent(messageWithURL)}`\nconst logoPathAbsolute = new URL(logoPath, location.origin)\n\nconst showHtml = ref(false)\nconst isCopied = ref(false)\n\nconst backgroundStyle = computed(() => `\n\tpadding:10px;\n\tbackground-color:${color};\n\tcolor:${textColor};\n\tborder-radius:3px;\n\tpadding-inline-start:4px;`)\n\nconst linkStyle = `background-image:url(${logoPathAbsolute});width:50px;height:30px;position:relative;top:8px;background-size:contain;display:inline-block;background-repeat:no-repeat; background-position: center center;`\nconst htmlCode = computed(() => `<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"${reference}\" style=\"${backgroundStyle.value}\">\n\t<span style=\"${linkStyle}\"></span>\n\t${t('federatedfilesharing', 'Share with me via Nextcloud')}\n</a>`)\n\nconst copyLinkTooltip = computed(() => isCopied.value\n\t? t('federatedfilesharing', 'Cloud ID copied')\n\t: t('federatedfilesharing', 'Copy'))\n\n/**\n *\n */\nasync function copyCloudId(): Promise<void> {\n\ttry {\n\t\tawait navigator.clipboard.writeText(cloudId)\n\t\tshowSuccess(t('federatedfilesharing', 'Cloud ID copied'))\n\t} catch {\n\t\t// no secure context or really old browser - need a fallback\n\t\twindow.prompt(t('federatedfilesharing', 'Clipboard not available. Please copy the cloud ID manually.'), cloudId)\n\t}\n\tisCopied.value = true\n\tshowSuccess(t('federatedfilesharing', 'Copied!'))\n\tsetTimeout(() => {\n\t\tisCopied.value = false\n\t}, 2000)\n}\n</script>\n\n<template>\n\t<NcSettingsSection\n\t\t:name=\"t('federatedfilesharing', 'Federated Cloud')\"\n\t\t:description=\"t('federatedfilesharing', 'You can share with anyone who uses a {productName} server or other Open Cloud Mesh (OCM) compatible servers and services! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com', { productName })\"\n\t\t:doc-url=\"docUrlFederated\">\n\t\t<NcInputField\n\t\t\tclass=\"federated-cloud__cloud-id\"\n\t\t\treadonly\n\t\t\t:label=\"t('federatedfilesharing', 'Your Federated Cloud ID')\"\n\t\t\t:model-value=\"cloudId\"\n\t\t\t:success=\"isCopied\"\n\t\t\tshow-trailing-button\n\t\t\t:trailing-button-label=\"copyLinkTooltip\"\n\t\t\t@trailing-button-click=\"copyCloudId\">\n\t\t\t<template #trailing-button-icon>\n\t\t\t\t<IconCheck v-if=\"isCopied\" :size=\"20\" fill-color=\"var(--color-border-success)\" />\n\t\t\t\t<IconClipboard v-else :size=\"20\" />\n\t\t\t</template>\n\t\t</NcInputField>\n\n\t\t<p class=\"social-button\">\n\t\t\t{{ t('federatedfilesharing', 'Share it so your friends can share files with you:') }}<br>\n\t\t\t<NcButton :href=\"shareBlueSkyUrl\">\n\t\t\t\t{{ t('federatedfilesharing', 'Bluesky') }}\n\t\t\t\t<template #icon>\n\t\t\t\t\t<img class=\"social-button__icon\" :src=\"urlBlueSkyIcon\">\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<NcButton :href=\"shareFacebookUrl\">\n\t\t\t\t{{ t('federatedfilesharing', 'Facebook') }}\n\t\t\t\t<template #icon>\n\t\t\t\t\t<img class=\"social-button__icon social-button__icon--bright\" :src=\"urlFacebookIcon\">\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<NcButton :href=\"shareMastodonUrl\">\n\t\t\t\t{{ t('federatedfilesharing', 'Mastodon') }}\n\t\t\t\t<template #icon>\n\t\t\t\t\t<img class=\"social-button__icon\" :src=\"urlMastodonIcon\">\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\tclass=\"social-button__website-button\"\n\t\t\t\t@click=\"showHtml = !showHtml\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconWeb :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('federatedfilesharing', 'Add to your website') }}\n\t\t\t</NcButton>\n\t\t</p>\n\n\t\t<template v-if=\"showHtml\">\n\t\t\t<p style=\"margin: 10px 0\">\n\t\t\t\t<a\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t:href=\"reference\"\n\t\t\t\t\t:style=\"backgroundStyle\">\n\t\t\t\t\t<span :style=\"linkStyle\" />\n\t\t\t\t\t{{ t('federatedfilesharing', 'Share with me via {productName}', { productName }) }}\n\t\t\t\t</a>\n\t\t\t</p>\n\n\t\t\t<p>\n\t\t\t\t{{ t('federatedfilesharing', 'HTML Code:') }}\n\t\t\t\t<br>\n\t\t\t\t<pre>{{ htmlCode }}</pre>\n\t\t\t</p>\n\t\t</template>\n\t</NcSettingsSection>\n</template>\n\n<style lang=\"scss\" scoped>\n\t.social-button {\n\t\tmargin-top: 0.5rem;\n\n\t\tbutton, a {\n\t\t\tdisplay: inline-flex;\n\t\t\tmargin-inline-start: 0.5rem;\n\t\t\tmargin-top: 1rem;\n\t\t}\n\n\t\t&__website-button {\n\t\t\twidth: min(100%, 400px) !important;\n\t\t}\n\n\t\t&__icon {\n\t\t\theight: 20px;\n\t\t\twidth: 20px;\n\t\t\tfilter: var(--background-invert-if-dark);\n\n\t\t\t&--bright {\n\t\t\t\t// Some logos like the Facebook logo have bright color schema\n\t\t\t\tfilter: var(--background-invert-if-bright);\n\t\t\t}\n\t\t}\n\t}\n\n\t.federated-cloud__cloud-id {\n\t\tmax-width: 300px;\n\t}\n\n\tpre {\n\t\tmargin-top: 0;\n\t\twhite-space: pre-wrap;\n\t}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createApp } from 'vue'\nimport PersonalSettings from './components/PersonalSettings.vue'\n\nimport 'vite/modulepreload-polyfill'\n\nconst app = createApp(PersonalSettings)\napp.mount('#vue-personal-federated')\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","productName","color","loadState","textColor","cloudId","docUrlFederated","logoPath","reference","urlFacebookIcon","imagePath","urlMastodonIcon","urlBlueSkyIcon","messageWithURL","t","messageWithoutURL","shareMastodonUrl","shareFacebookUrl","shareBlueSkyUrl","logoPathAbsolute","showHtml","ref","isCopied","backgroundStyle","computed","linkStyle","htmlCode","copyLinkTooltip","copyCloudId","showSuccess","_createBlock","_unref","NcSettingsSection","_createVNode","NcInputField","IconCheck","IconClipboard","_hoisted_1","NcButton","_createTextVNode","_toDisplayString","IconWeb","_Fragment","_hoisted_5","app","createApp","PersonalSettings"],"mappings":"uZAoBA,MAAKA,EAAU,CACb,KAAM,YACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,6DAxBYC,GAAA,CAAA,EAAE,yDAAyD,iDAXrEC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,kCACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,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