diff --git a/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz b/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz new file mode 100644 index 0000000..20c2805 Binary files /dev/null and b/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz differ diff --git a/package.json b/package.json index 199cf42..013df64 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,8 @@ "@gouvminint/vue-dsfr": "^5.14.2", "@vueuse/components": "^10.9.0", "@vueuse/core": "^10.9.0", - "html2canvas": "^1.4.1", - "jspdf": "^2.5.2", "geopf-extensions-openlayers": "./geopf-extensions-openlayers-1.0.0-beta.1-296.tgz", + "jspdf": "^2.5.2", "ol": "8.2.0", "vue": "^3.4.21", "vue-router": "^4.3.0" diff --git a/src/components.d.ts b/src/components.d.ts index 9d23849..0709a6f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -57,6 +57,7 @@ declare module 'vue' { MenuControl: typeof import('./components/menu/MenuControl.vue')['default'] MenuLateralNavButton: typeof import('./components/menu/MenuLateralNavButton.vue')['default'] MenuLateralWrapper: typeof import('./components/menu/MenuLateralWrapper.vue')['default'] + MenuTierce: typeof import('./components/menu/MenuTierce.vue')['default'] ModalConsent: typeof import('./components/modals/ModalConsent.vue')['default'] ModalInformation: typeof import('./components/modals/ModalInformation.vue')['default'] ModalTheme: typeof import('./components/modals/ModalTheme.vue')['default'] @@ -64,6 +65,7 @@ declare module 'vue' { OverviewMap: typeof import('./components/carte/control/OverviewMap.vue')['default'] Patience: typeof import('./components/utils/Patience.vue')['default'] Print: typeof import('./components/carte/control/Print.vue')['default'] + PrintModal: typeof import('./components/carte/control/PrintModal.vue')['default'] ReverseGeocode: typeof import('./components/carte/control/ReverseGeocode.vue')['default'] RightMenuTool: typeof import('./components/menu/RightMenuTool.vue')['default'] Route: typeof import('./components/carte/control/Route.vue')['default'] @@ -72,6 +74,7 @@ declare module 'vue' { ScaleLine: typeof import('./components/carte/control/ScaleLine.vue')['default'] SearchEngine: typeof import('./components/carte/control/SearchEngine.vue')['default'] Share: typeof import('./components/carte/control/Share.vue')['default'] + ShareModal: typeof import('./components/carte/control/ShareModal.vue')['default'] StoreData: typeof import('./components/StoreData.vue')['default'] Territories: typeof import('./components/carte/control/Territories.vue')['default'] VIcon: typeof import('oh-vue-icons')['OhVueIcon'] diff --git a/src/components/CartoAndTools.vue b/src/components/CartoAndTools.vue index 8e84527..ae3890c 100644 --- a/src/components/CartoAndTools.vue +++ b/src/components/CartoAndTools.vue @@ -2,16 +2,29 @@ import Carto from '@/components/carte/Carto.vue' import LeftMenuTool from '@/components/menu/LeftMenuTool.vue' import RightMenuTool from '@/components/menu/RightMenuTool.vue' -import MenuCatalogue from '@/components/menu/catalogue/MenuCatalogue.vue' -import MenuControl from '@/components/menu/MenuControl.vue'; +import ModalTheme from '@/components/modals/ModalTheme.vue' +import ShareModal from '@/components/carte/control/ShareModal.vue' +import PrintModal from "@/components/carte/control/PrintModal.vue"; -import { useControls } from '@/composables/controls' import { useDataStore } from "@/stores/dataStore" import { useMapStore } from "@/stores/mapStore" const mapStore = useMapStore(); const dataStore = useDataStore(); + +const refModalTheme = ref(null) +const modalShareRef = ref(null) +const refPrintModal = ref(null) +const onModalShareOpen = () => { + modalShareRef.value.onModalShareOpen() +} +const onModalThemeOpen = () => { + refModalTheme.value.openModalTheme() +} +const onModalPrintOpen = () => { + refPrintModal.value.onModalPrintOpen() +} // INFO // Les listes sont initialisées via le mapStore, et @@ -45,44 +58,40 @@ const selectedControls = computed(() => { return controls; }); -provide("selectedLayers", selectedLayers); +const cartoRef = ref(null) +provide("selectedLayers", selectedLayers); diff --git a/src/components/carte/Controls.vue b/src/components/carte/Controls.vue index 5fb2f29..2ffcb7e 100644 --- a/src/components/carte/Controls.vue +++ b/src/components/carte/Controls.vue @@ -11,6 +11,8 @@ - - \ No newline at end of file diff --git a/src/components/carte/control/PrintModal.vue b/src/components/carte/control/PrintModal.vue new file mode 100644 index 0000000..bdf48de --- /dev/null +++ b/src/components/carte/control/PrintModal.vue @@ -0,0 +1,490 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/components/carte/control/Share.vue b/src/components/carte/control/Share.vue index 4ce733c..5bc3231 100644 --- a/src/components/carte/control/Share.vue +++ b/src/components/carte/control/Share.vue @@ -15,6 +15,7 @@ import { useDataStore } from '@/stores/dataStore'; import { useMapStore } from '@/stores/mapStore'; import { useEulerian } from '@/plugins/Eulerian.js'; import { useClipboard } from '@vueuse/core' +import ShareModal from '@/components/carte/control/ShareModal.vue' const eulerian = useEulerian(); const dataStore = useDataStore(); @@ -26,91 +27,13 @@ const props = defineProps({ shareOptions: Object }); +const modalShareRef = ref(null) + // paramètres du composant bouton const btnTitle = "Ouvrir le panneau de partage de carte"; const btnIcon = "fr-icon-link"; // FIXME icone de partage dsfr !? const btnLabel = ""; -// paramètres du composant de la modale -const title = "Partager une carte"; -const size = "lg"; - -const shareModalOpened = ref(false); - -const onModalShareOpen = () => { - shareModalOpened.value = true; - eulerian.pause(); -}; -const onModalShareClose = () => { - shareModalOpened.value = false; - eulerian.resume(); -}; - -// les paramètres du composant de partage -const contacts = dataStore.getContacts(); -const permalinkEncoded = computed(() => { - return encodeURI(mapStore.permalink).replaceAll("&", "%26") -}) -const mail = computed(() => { - return { - address : contacts.mail, - subject : "Cartes à consulter sur cartes.gouv.fr", - body : "Bonjour,%0AJe vous invite à consulter cette carte sur Cartes.gouv.fr :%0A" + `${permalinkEncoded.value}` - } -}); - -const shareMail = computed(() => { - return { - "to" : `mailto:${mail.value.address}?subject=${mail.value.subject}&body=${mail.value.body}`, - "label" : "Envoyer un mail" - }; -}) -const shareNetworks = computed(() => { - return [ - { - "name": "facebook", - "label": "Partager sur Facebook", - "url": contacts.networks.facebook + "?display=popup&u=" + mapStore.permalink - }, - { - "name": "twitter-x", - "label": "Partager sur X (anciennement Twitter)", - "url": contacts.networks.twitter + "?url=" + permalinkEncoded.value + "&text=Ma carte IGN&via=&hashtags=IGNFrance" - }, - { - "name": "linkedin", - "label": "Partager sur LinkedIn", - "url": contacts.networks.linkedin + "?url=" + mapStore.permalink + "&title=Ma%20carte%20IGN" - }, - { - "name": "instagram", - "label": "Partager sur Instagram", - "url": contacts.networks.instagram - } - ] -}); - -// creation de l'iframe de partage -const iframe = computed(() => { - return ``; -}); -const clipboardSource = ref('') -const { text, copy, copied, isSupported } = useClipboard({ clipboardSource }) - -const target = ref(null); - -const icon = "co-copy" -const defaultScale = ref(0.8325); -const iconProps = computed(() => typeof icon === 'string' - ? { scale: defaultScale.value, name: icon } - : { scale: defaultScale.value, ...icon }, -); - onMounted(() => { nextTick(function () { //code here @@ -122,6 +45,10 @@ onBeforeMount(() => { //code here }) }); + +const onModalShareOpen = () => { + modalShareRef.value.onModalShareOpen() +} @@ -249,10 +115,6 @@ onBeforeMount(() => { width: 40px; height: 40px; } - .share-iframe-input { - height: 200px; - } - /* positionnement absolu à adapter en fonction du positionnement des autres boutons car n'est pas dans la grille */ @media (max-width: 576px){ diff --git a/src/components/carte/control/ShareModal.vue b/src/components/carte/control/ShareModal.vue new file mode 100644 index 0000000..36c8dee --- /dev/null +++ b/src/components/carte/control/ShareModal.vue @@ -0,0 +1,204 @@ + + + + + + + + + diff --git a/src/components/menu/LeftMenuTool.vue b/src/components/menu/LeftMenuTool.vue index 7300fad..3d025ef 100644 --- a/src/components/menu/LeftMenuTool.vue +++ b/src/components/menu/LeftMenuTool.vue @@ -1,6 +1,8 @@