Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
616d98f
chore(core): change @internal to @alpha to indicate plugin usability
dopenguin Aug 28, 2025
b4a1811
refactor(core): add hasSmallDisplay to export store
dopenguin Aug 28, 2025
0929011
feat(core): add reusable component PolarIconButton
dopenguin Aug 28, 2025
26a8e8d
refactor(core): update styling of PolarIconButton to fit design
dopenguin Aug 28, 2025
e2972d1
feat(core): add possibility to revert the colours of PolarIconButton …
dopenguin Aug 28, 2025
44b84af
refactor(iconMenu): use PolarIconButton in NineRegionsButton
dopenguin Aug 28, 2025
a2e450c
fix(iconMenu): add default value for hint if a custom buttonComponent…
dopenguin Aug 28, 2025
22f7465
refactor(fullscreen): use PolarIconButton in FullscreenUI
dopenguin Aug 28, 2025
3b363f9
refactor(core): add a z-index to the tooltip in PolarIconButton so it…
dopenguin Aug 28, 2025
a6ac584
chore(iconMenu): remove redundant todo
dopenguin Aug 28, 2025
26c0ef7
refactor(iconMenu): remove TopRightMenu as it will no longer be imple…
dopenguin Aug 28, 2025
aef3f3c
chore(iconMenu): add todo regarding v-if in IconMenu
dopenguin Aug 28, 2025
c9753bb
fix(iconMenu): update styling of other buttons if another menu is opened
dopenguin Aug 28, 2025
e0c7886
chore(iconMenu): remove redundant prop id from NineRegionsButton
dopenguin Aug 28, 2025
a451ee6
feat(core): add possibility to directly pass classes to the button el…
dopenguin Aug 28, 2025
9616ee9
refactor(iconMenu/fullscreen): independently add fullscreen and place…
dopenguin Aug 28, 2025
23bdbb2
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Aug 29, 2025
2296f8e
refactor(iconMenu): use getter for layout added in #339
dopenguin Aug 29, 2025
34390ad
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Aug 29, 2025
c631775
refactor(fullscreen): remove redundant !important on styling
dopenguin Sep 1, 2025
53bc59f
refactor(core): remove redundant !important on background styling of …
dopenguin Sep 1, 2025
483cbfa
fix: update addPlugin order in snowbox
dopenguin Sep 1, 2025
de8f5b5
refactor(iconMenu): remove some plugins from iconMenu if layout is se…
dopenguin Sep 1, 2025
dde5d4b
refactor(iconMenu): add menu implementation for layout standard
dopenguin Sep 1, 2025
0597004
fix(iconMenu): remove defaulted displayComponent
dopenguin Sep 1, 2025
2264d27
fix(iconMenu): add type-save access to $el
dopenguin Sep 1, 2025
5fcaf76
refactor(iconMenu): remove redundant type
dopenguin Sep 1, 2025
a5dd4bc
fix(fullscreen): move translation mock as the translation function is…
dopenguin Sep 1, 2025
b34dd2b
fix(fullscreen): remove redundant import
dopenguin Sep 1, 2025
69a0a61
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Sep 4, 2025
1906e74
refactor(iconMenu): remove last already implemented component
dopenguin Sep 5, 2025
6efd4f9
fix(fullscreen): allow unscoped style tag for now
dopenguin Sep 10, 2025
c160744
refactor: this button needs less js
warm-coolguy Sep 18, 2025
410eb78
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Sep 19, 2025
13f217f
refactor(iconMenu): use nullish coalescing instead of the ternary ope…
dopenguin Sep 19, 2025
2d80147
refactor(iconMenu): remove redundant filter
dopenguin Sep 19, 2025
f9176cb
refactor(iconMenu): remove redundant assignment
dopenguin Sep 19, 2025
8caa28c
refactor(iconMenu): use computed value instead of updating a state value
dopenguin Sep 19, 2025
04ece4f
Merge branch 'vue3/migrate-plugin-icon-menu' into vue3/refactor-button
dopenguin Sep 19, 2025
140bdb4
refactor: update PolarIconButton even more
dopenguin Sep 19, 2025
89da3d6
Merge pull request #362 from Dataport/vue3/refactor-button
dopenguin Sep 19, 2025
6359f83
refactor: use updated PolarIconButton in StandardMenu
dopenguin Sep 19, 2025
1e83e48
refactor: directly use @click instead of passing the function through…
dopenguin Sep 19, 2025
eac136e
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Sep 22, 2025
c058772
refactor: show all pointer-events on PolarIconButton
dopenguin Sep 24, 2025
1a08ca9
refactor: add fullscreen to the iconMenu
dopenguin Sep 24, 2025
024cd54
refactor(iconMenu): update iconMenu to only include one menu that is …
dopenguin Sep 24, 2025
b35a7ea
refactor(iconMenu): update configuration parameter menus to enable me…
dopenguin Sep 24, 2025
e49f4a1
refactor(iconMenu): move menu list to separate component in preparati…
dopenguin Sep 24, 2025
f057f0c
refactor(iconMenu): remove file ending
dopenguin Sep 25, 2025
7d02557
refactor(iconMenu): re-add type specification
dopenguin Sep 25, 2025
f9bc523
refactor(iconMenu): implement focus view menu
dopenguin Sep 25, 2025
67f517b
refactor(iconMenu): use correct name for the new menu in configuration
dopenguin Sep 25, 2025
2fea2eb
refactor(iconMenu): update todo
dopenguin Sep 25, 2025
433f64b
fix(iconMenu): add file extension to appease tests
dopenguin Sep 25, 2025
85d2dc1
fix(iconMenu): use rem instead of px
dopenguin Sep 25, 2025
19d873f
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Sep 29, 2025
b239601
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Oct 13, 2025
b706ea2
Merge branch 'chore/eslint-lines-around-comment' into vue3/migrate-pl…
dopenguin Oct 13, 2025
f608d76
fix: add missing empty lines
dopenguin Oct 13, 2025
a171bb1
fix(iconMenu): update $t call to equal what the type expects
dopenguin Oct 15, 2025
89865d9
fix(iconMenu): remove a remnant of the past
dopenguin Oct 15, 2025
338b127
fix: correctly use IconMenu in iceberg example
dopenguin Oct 15, 2025
4508d4e
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Oct 15, 2025
1f276fd
Merge branch 'next' into vue3/migrate-plugin-icon-menu
dopenguin Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/iceberg/components/IcebergMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ watch(map, (map) => {
displayComponent: true,
layoutTag: 'TOP_RIGHT',
menus: [
{
plugin: pluginFullscreen(),
hint: 'Full of yourself',
},
[
{
plugin: pluginFullscreen(),
},
],
],
}),
pluginToast({
Expand Down
37 changes: 37 additions & 0 deletions examples/snowbox/GeoLocationMock.ce.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<button
class="kern-btn kern-btn--secondary mock-button"
@click="clicked = !clicked"
>
<span class="kern-icon" :class="icon" aria-hidden="true" />
<span class="kern-label kern-sr-only"> Locate me </span>
</button>
</template>

<script setup lang="ts">
import { computed, ref } from 'vue'

const clicked = ref(false)
const icon = computed(() =>
clicked.value ? 'kern-icon-fill--near-me' : 'kern-icon--near-me'
)
</script>

<style scoped>
.kern-btn {
background: var(--kern-color-layout-background-default);
box-shadow:
0 1px 1px 0 rgba(53, 57, 86, 0.16),
0 1px 2px 0 rgba(53, 57, 86, 0.25),
0 1px 6px 0 rgba(110, 117, 151, 0.25);
border: none;
pointer-events: all;

&:focus,
&:hover {
background: var(--kern-color-layout-background-default);
border: solid var(--kern-color-action-on-default);
outline: solid var(--kern-color-action-default);
}
}
</style>
7 changes: 7 additions & 0 deletions examples/snowbox/YetAnotherEmptyComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div style="background: #fff">Awesome</div>
</template>

<script setup lang="ts">
// keep this block to enforce language
</script>
81 changes: 54 additions & 27 deletions examples/snowbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import EmptyComponent from './EmptyComponent.vue'
import styleJsonUrl from './style.json?url'
import AnotherEmptyComponent from './AnotherEmptyComponent.vue'
import YetAnotherEmptyComponent from './YetAnotherEmptyComponent.vue'
import GeoLocationMockCe from './GeoLocationMock.ce.vue'

const basemapId = '23420'
const basemapGreyId = '23421'
Expand Down Expand Up @@ -51,7 +53,7 @@
},
}

// TODO: Re-enable with isSelectable

Check warning on line 56 in examples/snowbox/index.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Re-enable with isSelectable'
/*
// arbitrary condition for testing
const isEvenId = (mmlid) => Number(mmlid.slice(-1)) % 2 === 0
Expand Down Expand Up @@ -95,7 +97,7 @@
visibility: true,
},
],
layout: 'nineRegions',
layout: 'standard',
checkServiceAvailability: true,
featureStyles: styleJsonUrl,
markers: {
Expand All @@ -118,14 +120,14 @@
stroke: '#FFFFFF',
fill: '#333333',
},
// TODO(dopenguin): Has some HMR issues, needs to be fixed

Check warning on line 123 in examples/snowbox/index.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO(dopenguin): Has some HMR issues,...'
// isSelectable: isReportSelectable,
},
],
clusterClickZoom: true,
},
// theme: dataportTheme,
/*

Check warning on line 130 in examples/snowbox/index.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO(dopenguin): Surrounding application...'
TODO(dopenguin): Surrounding application should be able give information about dark or light mode via update of a state parameter; light mode by default
*/
locales: [
Expand All @@ -138,6 +140,12 @@
label_off: 'Mach klein',
},
},
iconMenu: {
hints: {
attributions: 'LMAO',
fullscreen: 'BEEEEEG YOSHEEEEE',
},
},
},
},
],
Expand Down Expand Up @@ -172,48 +180,67 @@
document.getElementById('secondMapContainer').innerText = ''
})

addPlugin(
map,
pluginToast({
displayComponent: true,
layoutTag: 'BOTTOM_MIDDLE',
})
)
addPlugin(
map,
pluginIconMenu({
displayComponent: true,
layoutTag: 'TOP_RIGHT',
initiallyOpen: 'kewl',
menus: [
{
plugin: pluginFullscreen(),
hint: 'Full of yourself',
},
// TODO: Delete these two including the component once another plugin is implemented
focusMenus: [
{
plugin: {
component: EmptyComponent,
id: 'kewl',
component: YetAnotherEmptyComponent,
id: 'attributions',
locales: [],
},
icon: 'kern-icon-fill--layers',
hint: 'Something layered',
icon: 'kern-icon--near-me',
},
{
plugin: {
component: AnotherEmptyComponent,
id: 'realKewl',
locales: [],
],
menus: [
// TODO: Delete the mock plugins including the components once the correct plugins have been implemented

Check warning on line 207 in examples/snowbox/index.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Delete the mock plugins including...'
[
{
plugin: {
component: GeoLocationMockCe,
id: 'geoLocationMock',
locales: [],
},
},
icon: 'kern-icon--layers',
hint: 'Something kewl',
},
],
[
{
plugin: {
component: AnotherEmptyComponent,
id: 'realKewl',
locales: [],
},
icon: 'kern-icon--share',
},
],
[
{
plugin: {
component: EmptyComponent,
id: 'kewl',
locales: [],
},
icon: 'kern-icon-fill--layers',
},
{
plugin: pluginFullscreen({}),
},
],
],
})
)

addPlugin(
map,
pluginToast({
displayComponent: true,
layoutTag: 'BOTTOM_MIDDLE',
})
)

const toastStore = getStore(map, 'toast')
toastStore.addToast({
text: 'Hallo Welt',
Expand Down
100 changes: 100 additions & 0 deletions src/components/PolarIconButton.ce.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<template>
<button
class="kern-btn kern-btn--secondary polar-icon-button"
:class="{ 'polar-icon-button-active': active }"
>
<span
class="kern-icon"
:class="{ [icon]: true, 'polar-icon-button-icon-active': active }"
aria-hidden="true"
/>
<span class="kern-label kern-sr-only">{{ hint }}</span>
<span
v-if="tooltipPosition && !hasSmallDisplay"
class="polar-tooltip"
:class="`polar-tooltip-${tooltipPosition}`"
aria-hidden="true"
>
{{ hint }}
</span>
</button>
</template>

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useCoreStore } from '@/core/stores/export'

defineProps<{
hint: string
icon: string
active?: boolean
tooltipPosition?: 'left' | 'right'
}>()
const { hasSmallDisplay } = storeToRefs(useCoreStore())
</script>

<style scoped>
.polar-icon-button {
position: relative;
background: var(--kern-color-layout-background-default);
box-shadow:
0 1px 1px 0 rgba(53, 57, 86, 0.16),
0 1px 2px 0 rgba(53, 57, 86, 0.25),
0 1px 6px 0 rgba(110, 117, 151, 0.25);
border: none;
pointer-events: all;

&:focus,
&:hover {
background: var(--kern-color-layout-background-default);
border: solid var(--kern-color-action-on-default);
outline: solid var(--kern-color-action-default);
}

.polar-icon-button-active {
background: var(--kern-color-action-default);

&:focus,
&:hover {
background: var(--kern-color-action-default);
border: solid var(--kern-color-action-on-default);
outline: solid var(--kern-color-action-default);
}
}

.polar-icon-button-icon-active {
background: var(--kern-color-layout-background-default);
}

.polar-tooltip {
z-index: 42;
position: absolute;
padding: 5px 16px;
font-family: sans-serif;
background: #616161e6;
color: #fff;
border: 2px solid #fff;
border-radius: 4px;
font-size: 14px;
line-height: 22px;
white-space: nowrap;
pointer-events: none;
transition-property: opacity, right, left;
transition-duration: 250ms;
transition-timing-function: ease;
opacity: 0;

&.polar-tooltip-left {
right: calc(100% + 0.75rem);
}
&.polar-tooltip-right {
left: calc(100% + 0.75rem);
}
}

&:hover .polar-tooltip,
&:focus-visible .polar-tooltip {
opacity: 1;
}
}
</style>
19 changes: 14 additions & 5 deletions src/core/stores/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useCoreStore = defineStore('core', () => {
/**
* The current height of the map.
*
* @internal
* @alpha
* @readonly
*/
clientHeight: computed(() => mainStore.clientHeight),
Expand All @@ -45,31 +45,40 @@ export const useCoreStore = defineStore('core', () => {
* Whether a mobile device is held horizontally.
* True if {@link hasSmallHeight} and {@link hasWindowSize} are true.
*
* @internal
* @alpha
* @readonly
*/
deviceIsHorizontal: computed(() => mainStore.deviceIsHorizontal),

/**
* Whether the map has a maximum height of {@link SMALL_DISPLAY_HEIGHT} and
* a maximum width of {@link SMALL_DISPLAY_WIDTH}.
*
* @alpha
* @readonly
*/
hasSmallDisplay: computed(() => mainStore.hasSmallDisplay),

/**
* Whether the height of the map is smaller than 480px.
*
* @internal
* @alpha
* @readonly
*/
hasSmallHeight: computed(() => mainStore.hasSmallHeight),

/**
* Whether the width of the map is smaller than 768px.
*
* @internal
* @alpha
* @readonly
*/
hasSmallWidth: computed(() => mainStore.hasSmallWidth),

/**
* Whether the size of the map equals the size of the browser window.
*
* @internal
* @alpha
* @readonly
*/
hasWindowSize: computed(() => mainStore.hasWindowSize),
Expand Down
36 changes: 20 additions & 16 deletions src/plugins/fullscreen/components/FullscreenUI.ce.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
<template>
<button
class="kern-btn kern-btn--primary"
@click="fullscreenEnabled = !fullscreenEnabled"
>
<span
:class="[
'kern-icon',
fullscreenEnabled
? 'kern-icon--fullscreen-exit'
: 'kern-icon--fullscreen',
]"
aria-hidden="true"
/>
<span class="kern-label kern-sr-only">{{
<PolarIconButton
:class="layout === 'standard' ? 'polar-plugin-fullscreen-standard' : ''"
:hint="
$t(($) => $.button.label, {
ns: PluginId,
context: fullscreenEnabled ? 'off' : 'on',
})
}}</span>
</button>
"
:icon="
fullscreenEnabled ? 'kern-icon--fullscreen-exit' : 'kern-icon--fullscreen'
"
tooltip-position="left"
@click="() => (fullscreenEnabled = !fullscreenEnabled)"
/>
</template>

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useFullscreenStore } from '../store'
import { PluginId } from '../types'
import PolarIconButton from '@/components/PolarIconButton.ce.vue'
import { useCoreStore } from '@/core/stores/export.ts'

const { layout } = storeToRefs(useCoreStore())
const { fullscreenEnabled } = storeToRefs(useFullscreenStore())
</script>

<style scoped>
.polar-icon-button.polar-plugin-fullscreen-standard {
box-shadow: none;
}
</style>
Loading
Loading