diff --git a/.yarn/patches/dom-to-svg-npm-0.12.2-dfe442df49.patch b/.yarn/patches/dom-to-svg-npm-0.12.2-dfe442df49.patch new file mode 100644 index 0000000..0eb82cb --- /dev/null +++ b/.yarn/patches/dom-to-svg-npm-0.12.2-dfe442df49.patch @@ -0,0 +1,15 @@ +diff --git a/lib/inline.js b/lib/inline.js +index 10970092d2efa9c5c120b4843b17ebc359fe1360..66ce98d611f0556fa644141296750e48a39c1371 100644 +--- a/lib/inline.js ++++ b/lib/inline.js +@@ -18,7 +18,9 @@ export async function inlineResources(element) { + (async () => { + var _a; + if (isSVGImageElement(element)) { +- const blob = await withTimeout(10000, `Timeout fetching ${element.href.baseVal}`, () => fetchResource(element.href.baseVal)); ++ const elementHref = element.getAttribute('href') || element.getAttribute('xlink:href'); ++ assert(elementHref, ' element must have href or xlink:href attribute'); ++ const blob = await withTimeout(10000, `Timeout fetching ${elementHref}`, () => fetchResource(elementHref)); + if (blob.type === 'image/svg+xml') { + // If the image is an SVG, inline it into the output SVG. + // Some tools (e.g. Figma) do not support nested SVG. diff --git a/components/viewer/ViewMenuBar.vue b/components/viewer/ViewMenuBar.vue index 5e5eb48..26aa5d5 100644 --- a/components/viewer/ViewMenuBar.vue +++ b/components/viewer/ViewMenuBar.vue @@ -13,11 +13,11 @@
diff --git a/components/viewer/ViewProjectObj.vue b/components/viewer/ViewProjectObj.vue index 4eb6c5b..c176dba 100644 --- a/components/viewer/ViewProjectObj.vue +++ b/components/viewer/ViewProjectObj.vue @@ -21,8 +21,10 @@ @@ -129,6 +131,10 @@ const objTemplateClass = computed(() => { return 'obj-template-top'; }); +const objImageIsURL = computed(() => { + return R.match(/^https?:\/\//, $props.obj.image); +}); + const store = useProjectStore(); const { selectedIds, selected } = useProjectRefs(); @@ -144,6 +150,15 @@ const isEnabled = computed(() => { return condition.value(selectedIds.value); } }); +const alwaysEnable = computed(() => { + switch ($props.viewObject) { + case ViewContext.BackpackEnabled: + case ViewContext.BackpackDisabled: + return true; + default: + return false; + } +}); const canToggle = computed(() => { return ( isEnabled.value && diff --git a/components/viewer/ViewScoreStatus.vue b/components/viewer/ViewScoreStatus.vue index 192dc4e..f418edb 100644 --- a/components/viewer/ViewScoreStatus.vue +++ b/components/viewer/ViewScoreStatus.vue @@ -1,5 +1,5 @@ @@ -24,7 +26,7 @@ import { computed } from 'vue'; import type { PointType } from '~/composables/project'; import { useProjectRefs } from '~/composables/store/project'; -const { vertical, short = false } = defineProps<{ +const $props = defineProps<{ vertical?: boolean; short?: boolean; }>(); @@ -45,7 +47,7 @@ const activeScores = computed<{ score: PointType; value: number }[]>(() => { }); diff --git a/components/viewer/modal/BackpackModal.vue b/components/viewer/modal/BackpackModal.vue index 5f1f459..4310703 100644 --- a/components/viewer/modal/BackpackModal.vue +++ b/components/viewer/modal/BackpackModal.vue @@ -5,56 +5,75 @@