900c18bbcf
* feat(viewer-lib): Adding outline rendering support for all/any pipeline: - Implemented EdgesPipeline as a standalone pipeline. Can be used as is, but it's mostly used by other pipelines to add outline rendering support - Moved the MRT/non-MRT versions for edge generation inside the EdgesPipeline. This removed a lot of redundant pipelines - Added optional outline rendering support for all relevant pipelines * feat(viewer-lib): Added optional edges to the TAA pipeline. * chore(viewer-lib): Renamed some of the pipelines to be more consistent with the names given by the frontend. Cleaned up older stuff * chore(viewer-lib): ViewportPass makes sure it requests renders until matcap texture finished loading * chore(frontend-2): Updated the frontend with the new view mode type changes * feat(viewer-lib): Some updates on view modes:Added support for outline thickness and color. Removed the background texture option from edges pass * feat(viewer-lib): Handles WEB-3147: - Outlines are now displayable on top of any dom element. - There is one asterisk. Pure black colored outlines (0) do not blend properly because of some browser weirdness * feat(viewer-lib): All pipelines besides pen now draw the outlines of transparent objects with a bunch of downsides * chore(viewer-lib): Fixed sandbox errors * feat(viewer-lib): Updated ViewModes extension to work with pipeline options. Defined EdgesPipelineOptions * chore(viewer-lib): Fixed sandbox compile errors * chore(sandbox): Viewer load not object loader only * chore(viewer-lib): Fixed linting issues. are now optional when setting view modes * feat(fe): View mode menu changes with no integration * feat(fe): Frontend view mode menu integration * fix(viewer-lib): Fixed the false gradient generated at the edges of the screen when in pen mode * fix(fe): Better naming. Parse line weight to number * chore(viewer-lib): A few updates: - ViewModes now caches it's current options so it can properly determine when to do a full pipeline change and when to just update options - Default pipeline options are now exported by the viewer - Default pipeline options have edges enabled * feat(fe): Design changes. Remove unneeded watch. Fix shortcuts * feat(fe): use dark mode colours. add colour controls * fix(fe): shortcuts and colours * fix(fe): reactive defaultColor * feat(fe): New descriptions. New hex colours. * feat(fe): add mixpanel. watch darkmode * fix(fe): fix dark mode watch --------- Co-authored-by: andrewwallacespeckle <andrew@speckle.systems>
61 lines
1.5 KiB
Vue
61 lines
1.5 KiB
Vue
<template>
|
|
<div ref="menuWrapper" class="relative z-30">
|
|
<ViewerControlsButtonToggle
|
|
v-tippy="tooltip"
|
|
flat
|
|
secondary
|
|
:active="open"
|
|
@click="toggleMenu"
|
|
>
|
|
<slot name="trigger-icon" />
|
|
</ViewerControlsButtonToggle>
|
|
<div
|
|
v-if="open"
|
|
ref="menuContent"
|
|
v-keyboard-clickable
|
|
class="absolute left-10 sm:left-[46px] -top-0 bg-foundation rounded-md border border-outline-2 flex flex-col overflow-hidden shadow"
|
|
>
|
|
<div
|
|
v-if="$slots.title"
|
|
class="flex items-center py-2 px-2 border-b border-outline-2 sticky top-0 z-50 bg-foundation"
|
|
>
|
|
<div class="flex items-center text-body-2xs text-foreground font-medium">
|
|
<span class="truncate flex-1">
|
|
<slot name="title"></slot>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="max-h-68 simple-scrollbar overflow-y-auto">
|
|
<slot />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onClickOutside } from '@vueuse/core'
|
|
|
|
defineProps<{
|
|
tooltip?: string
|
|
}>()
|
|
|
|
const open = defineModel<boolean>('open', { default: false })
|
|
|
|
const menuContent = ref<HTMLElement | null>(null)
|
|
const menuWrapper = ref<HTMLElement | null>(null)
|
|
|
|
const toggleMenu = () => {
|
|
open.value = !open.value
|
|
}
|
|
|
|
onClickOutside(
|
|
menuContent,
|
|
(event) => {
|
|
if (!menuWrapper.value?.contains(event.target as Node)) {
|
|
open.value = false
|
|
}
|
|
},
|
|
{ ignore: [menuWrapper] }
|
|
)
|
|
</script>
|