@resee-movies/nuxt-ux 0.13.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/Card.vue +23 -15
- package/dist/runtime/components/Card.vue.d.ts +8 -5
- package/dist/runtime/components/CardScroller.vue +189 -0
- package/dist/runtime/components/CardScroller.vue.d.ts +36 -0
- package/dist/runtime/components/GlobalHeader.vue +107 -0
- package/dist/runtime/components/GlobalHeader.vue.d.ts +15 -0
- package/dist/runtime/components/GlobalHeaderAnnouncement.vue +49 -0
- package/dist/runtime/components/GlobalHeaderAnnouncement.vue.d.ts +14 -0
- package/dist/runtime/components/Image.vue +70 -127
- package/dist/runtime/components/Image.vue.d.ts +4 -35
- package/dist/runtime/components/ImageBase.vue +114 -0
- package/dist/runtime/components/ImageBase.vue.d.ts +41 -0
- package/dist/runtime/components/LayoutPageRoot.vue +55 -0
- package/dist/runtime/components/LayoutPageRoot.vue.d.ts +21 -0
- package/dist/runtime/components/Message.vue +31 -11
- package/dist/runtime/components/Message.vue.d.ts +4 -3
- package/dist/runtime/components/NotificationContainer.vue +2 -2
- package/dist/runtime/components/ReseeWordLogo.vue +53 -0
- package/dist/runtime/components/ReseeWordLogo.vue.d.ts +12 -0
- package/dist/runtime/components/ScrollPinnedContainer.vue +33 -0
- package/dist/runtime/components/ScrollPinnedContainer.vue.d.ts +14 -0
- package/dist/runtime/components/SuccessSplash.vue +47 -0
- package/dist/runtime/components/SuccessSplash.vue.d.ts +6 -0
- package/dist/runtime/components/form/Form.vue +55 -21
- package/dist/runtime/components/form/Form.vue.d.ts +5 -0
- package/dist/runtime/composables/use-global-header-state.d.ts +10 -0
- package/dist/runtime/composables/use-global-header-state.js +20 -0
- package/dist/runtime/composables/use-load-image.d.ts +3 -0
- package/dist/runtime/composables/use-load-image.js +26 -44
- package/dist/runtime/composables/use-mutable-intersection-observer.d.ts +44 -0
- package/dist/runtime/composables/use-mutable-intersection-observer.js +68 -0
- package/dist/runtime/composables/use-resee-ux.d.ts +5 -0
- package/dist/runtime/composables/use-resee-ux.js +11 -1
- package/dist/runtime/composables/use-two-frame-ref-toggle.d.ts +25 -0
- package/dist/runtime/composables/use-two-frame-ref-toggle.js +24 -0
- package/dist/runtime/utils/validation.d.ts +2 -2
- package/dist/runtime/utils/validation.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class = "flex items-center"
|
|
4
|
+
:class = "{
|
|
5
|
+
'gap-1': props.size === 'xs' || props.size === 'sm',
|
|
6
|
+
'gap-1 lg:gap-2': props.size === 'lg' || props.size === 'responsive'
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
v-if = "props.showLogo"
|
|
11
|
+
:class = "['logo', 'aspect-square', imageSizes.logo]"
|
|
12
|
+
/>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
v-if = "props.showName"
|
|
16
|
+
:class = "['name', 'aspect-[3.875/1]', imageSizes.name]"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { computed } from "vue";
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
showLogo: { type: Boolean, required: false, default: true },
|
|
29
|
+
showName: { type: Boolean, required: false, default: true },
|
|
30
|
+
size: { type: String, required: false, default: "responsive" }
|
|
31
|
+
});
|
|
32
|
+
const imageSizes = computed(() => {
|
|
33
|
+
switch (props.size) {
|
|
34
|
+
case "lg":
|
|
35
|
+
return { logo: "h-10", name: "h-8" };
|
|
36
|
+
case "md":
|
|
37
|
+
return { logo: "h-8", name: "h-6" };
|
|
38
|
+
case "sm":
|
|
39
|
+
return { logo: "h-6", name: "h-4" };
|
|
40
|
+
case "xs":
|
|
41
|
+
return { logo: "h-5", name: "h-3" };
|
|
42
|
+
default:
|
|
43
|
+
return {
|
|
44
|
+
logo: "h-8 lg:h-10",
|
|
45
|
+
name: "h-6 lg:h-8"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style scoped>
|
|
52
|
+
@reference "tailwindcss";.logo,.name{background-repeat:no-repeat;background-size:contain}.logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 32 32'%3E%3Cg data-name='Icon_Black/Color'%3E%3Cpath d='M15.84 32a.52.52 0 0 1-.52-.53l.1-8.73a.52.52 0 0 1 .53-.52.53.53 0 0 1 .52.54l-.1 8.72a.53.53 0 0 1-.53.52M10.27 30.89a.6.6 0 0 1-.19 0 .53.53 0 0 1-.3-.69L13 22.07a.52.52 0 0 1 .68-.29.53.53 0 0 1 .3.68l-3.25 8.1a.52.52 0 0 1-.46.33M5.48 27.85a.54.54 0 0 1-.36-.14.53.53 0 0 1 0-.75L11 20.58a.53.53 0 0 1 .75 0 .52.52 0 0 1 0 .74l-5.88 6.36a.56.56 0 0 1-.39.17M2.11 23.28a.54.54 0 0 1-.48-.3.53.53 0 0 1 .25-.7l7.85-3.8a.53.53 0 1 1 .46.95l-7.85 3.8a.6.6 0 0 1-.23.05M.62 17.8a.53.53 0 0 1 0-1.05L9.27 16a.53.53 0 0 1 .09 1.06l-8.7.7ZM9.57 14.64h-.15l-8.36-2.5a.54.54 0 0 1-.36-.66.53.53 0 0 1 .66-.36l8.36 2.48a.53.53 0 0 1-.15 1ZM10.7 12.44a.57.57 0 0 1-.33-.11L3.47 7a.53.53 0 0 1 .65-.83L11 11.49a.53.53 0 0 1 .09.74.51.51 0 0 1-.39.21M12.54 10.79a.53.53 0 0 1-.45-.25L7.58 3.07a.52.52 0 0 1 .18-.72.54.54 0 0 1 .73.18L13 10a.53.53 0 0 1-.18.73.5.5 0 0 1-.28.06M14.85 9.93a.52.52 0 0 1-.51-.44L12.83.9a.53.53 0 0 1 1-.18l1.51 8.59a.53.53 0 0 1-.43.61ZM17.33 10h-.11a.53.53 0 0 1-.41-.62l1.7-8.61a.53.53 0 1 1 1 .21l-1.7 8.55a.53.53 0 0 1-.48.47M19.62 10.88a.47.47 0 0 1-.28-.09.53.53 0 0 1-.17-.73l4.68-7.36a.53.53 0 1 1 .89.57l-4.67 7.36a.54.54 0 0 1-.45.25M21.43 12.56a.54.54 0 0 1-.43-.21.54.54 0 0 1 .11-.74l7-5.18a.54.54 0 0 1 .74.11.52.52 0 0 1-.11.74l-7 5.18a.5.5 0 0 1-.31.1M22.5 14.79a.54.54 0 0 1-.5-.39.53.53 0 0 1 .38-.65l8.41-2.29a.53.53 0 0 1 .28 1l-8.42 2.29ZM31.38 18.15h-.05l-8.68-.9a.53.53 0 0 1-.47-.58.53.53 0 0 1 .58-.47l8.68.9a.53.53 0 0 1-.06 1ZM29.76 23.6a.5.5 0 0 1-.24-.06l-7.76-4a.53.53 0 0 1 .48-.94l7.77 4a.53.53 0 0 1-.25 1M26.29 28.09a.51.51 0 0 1-.39-.18l-5.8-6.51a.53.53 0 0 1 0-.75.53.53 0 0 1 .74 0l5.81 6.52a.52.52 0 0 1-.05.74.52.52 0 0 1-.31.18M21.43 31a.53.53 0 0 1-.49-.34l-3.06-8.17a.53.53 0 0 1 1-.37l3.06 8.17a.54.54 0 0 1-.31.68.6.6 0 0 1-.2.03'/%3E%3Cpath d='M15.89 28.12a.86.86 0 0 1-.86-.88l.05-4.5a.86.86 0 0 1 .87-.86.86.86 0 0 1 .86.88v4.5a.86.86 0 0 1-.92.86' style='fill:%23189332'/%3E%3Cpath d='M12 26.86a1 1 0 0 1-.33-.06.87.87 0 0 1-.48-1.14l1.49-3.72a.87.87 0 0 1 1.62.65l-1.49 3.72a.89.89 0 0 1-.81.55' style='fill:%23138c3b'/%3E%3Cpath d='M8.84 24.59a.85.85 0 0 1-.6-.23.87.87 0 0 1 0-1.23l2.59-2.78a.87.87 0 0 1 1.23 0 .86.86 0 0 1 .05 1.23l-2.63 2.74a.9.9 0 0 1-.64.27' style='fill:%23149889'/%3E%3Cpath d='M6.46 21.52a.87.87 0 0 1-.38-1.66l3.5-1.69a.87.87 0 1 1 .76 1.57l-3.5 1.69a.9.9 0 0 1-.38.09' style='fill:%2317a2c4'/%3E%3Cpath d='M5 17.79a.87.87 0 0 1 0-1.74l4.27-.35a.87.87 0 1 1 .14 1.74l-4.27.34Z' style='fill:%231d73b2'/%3E%3Cpath d='M9.57 15a1 1 0 0 1-.25 0l-4.74-1.46A.88.88 0 0 1 4 12.46a.87.87 0 0 1 1.09-.59l4.74 1.4a.89.89 0 0 1 .59 1.09.88.88 0 0 1-.85.64' style='fill:%23191384'/%3E%3Cpath d='M10.7 12.78a.9.9 0 0 1-.54-.18L5.55 9a.87.87 0 1 1 1.06-1.35l4.62 3.57a.87.87 0 0 1-.53 1.56' style='fill:%23230f82'/%3E%3Cpath d='M12.54 11.14a.89.89 0 0 1-.75-.42L8.25 4.85A.87.87 0 0 1 9.75 4l3.54 5.87A.87.87 0 0 1 13 11a.84.84 0 0 1-.46.14' style='fill:%236d298c'/%3E%3Cpath d='M14.85 10.27a.87.87 0 0 1-.85-.72L12.64 1.8a.87.87 0 0 1 1.72-.3l1.35 7.75a.87.87 0 0 1-.7 1Z' style='fill:%23932a5f'/%3E%3Cpath d='M17.33 10.3a.5.5 0 0 1-.17 0 .87.87 0 0 1-.69-1l1.7-8.6a.87.87 0 0 1 1.71.3l-1.7 8.6a.87.87 0 0 1-.85.7' style='fill:%23de1c1b'/%3E%3Cpath d='M19.62 11.22a.83.83 0 0 1-.47-.14.88.88 0 0 1-.27-1.2l4.68-7.36a.87.87 0 0 1 1.44.93l-4.67 7.36a.87.87 0 0 1-.71.41' style='fill:%23ee310e'/%3E%3Cpath d='M21.43 12.91a.88.88 0 0 1-.52-1.58l7-5.18a.88.88 0 0 1 1 1.41l-7 5.18a.9.9 0 0 1-.48.17' style='fill:%23fa440f'/%3E%3Cpath d='M22.5 15.13a.87.87 0 0 1-.23-1.71l8.42-2.3a.88.88 0 0 1 .46 1.69l-8.42 2.29a.9.9 0 0 1-.23.03' style='fill:%23f86010'/%3E%3Cpath d='M30.88 18.44h-.09l-8.18-.85a.88.88 0 0 1 .19-1.74l8.2.85a.87.87 0 0 1-.09 1.74Z' style='fill:%23f77511'/%3E%3Cpath d='M28.45 23.27a.85.85 0 0 1-.4-.1l-6.45-3.3a.87.87 0 0 1-.37-1.18.86.86 0 0 1 1.17-.38l6.45 3.31a.87.87 0 0 1 .38 1.17.89.89 0 0 1-.78.48' style='fill:%23f9c611'/%3E%3Cpath d='M24.62 26.56a.85.85 0 0 1-.65-.3l-4.13-4.63a.88.88 0 0 1 .07-1.24.87.87 0 0 1 1.23.08l4.13 4.63a.87.87 0 0 1-.07 1.23.85.85 0 0 1-.58.23' style='fill:%23f9ea17'/%3E%3Cpath d='M20.22 28.12a.87.87 0 0 1-.82-.57l-1.84-4.92a.87.87 0 1 1 1.63-.63L21 26.94a.87.87 0 0 1-.52 1.12.8.8 0 0 1-.26.06' style='fill:%239dcb1e'/%3E%3C/g%3E%3C/svg%3E")}.name{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 124.27 31.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1{fill:%23050404}%3C/style%3E%3C/defs%3E%3Cg id='ReSee_Wordmark'%3E%3Cg id='Wordmark_Black'%3E%3Cpath d='M11.29 20.1H6.51v11H0V.46h14.31c6.38 0 10.28 4.17 10.28 9.86 0 5.42-3.39 8.31-6.7 9.09l6.89 11.65H17.3Zm2.06-14H6.51v8.4h6.84c2.62 0 4.59-1.65 4.59-4.22S16 6.06 13.35 6.06ZM37.25 8.35c6.61 0 11.1 5 11.1 12.2v1.29H31.88c.37 2.8 2.62 5.14 6.38 5.14a9.06 9.06 0 0 0 5.92-2.21l2.57 3.77a13.68 13.68 0 0 1-9.13 3.07c-6.75 0-11.84-4.54-11.84-11.65A11.28 11.28 0 0 1 37.25 8.35m-5.46 9.54h10.92A5.14 5.14 0 0 0 37.25 13a5.33 5.33 0 0 0-5.46 4.89M53.4 21.79a13.38 13.38 0 0 0 9.72 4.13c3.58 0 5.33-1.7 5.33-3.44 0-2.29-2.67-3.07-6.2-3.9-5-1.15-11.42-2.52-11.42-9.36 0-5.09 4.4-9.22 11.6-9.22a17 17 0 0 1 11.93 4.27L70.74 9A13 13 0 0 0 62 5.69c-2.94 0-4.5 1.28-4.5 3.12 0 2.06 2.57 2.71 6.1 3.53 5 1.15 11.47 2.66 11.47 9.45 0 5.6-4 9.82-12.25 9.82-5.87 0-10.09-2-13-4.86ZM88.58 8.35c6.61 0 11.1 5 11.1 12.2v1.29H83.21c.37 2.8 2.62 5.14 6.38 5.14a9 9 0 0 0 5.92-2.21l2.57 3.77A13.68 13.68 0 0 1 89 31.61c-6.75 0-11.84-4.54-11.84-11.65A11.28 11.28 0 0 1 88.58 8.35m-5.46 9.54H94A5.13 5.13 0 0 0 88.58 13a5.33 5.33 0 0 0-5.46 4.89M113.17 8.35c6.61 0 11.1 5 11.1 12.2v1.29H107.8c.37 2.8 2.62 5.14 6.38 5.14a9.06 9.06 0 0 0 5.92-2.21l2.57 3.77a13.68 13.68 0 0 1-9.13 3.07c-6.75 0-11.84-4.54-11.84-11.65a11.27 11.27 0 0 1 11.47-11.61m-5.46 9.54h10.92a5.14 5.14 0 0 0-5.46-4.89 5.33 5.33 0 0 0-5.46 4.89' class='cls-1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}@variant dark{.logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 32 32'%3E%3Cdefs%3E%3Cstyle%3E.cls-1{fill:%23fff}%3C/style%3E%3C/defs%3E%3Cg id='ReSee_Icon'%3E%3Cg id='Icon_White_Color' data-name='Icon_White/Color'%3E%3Cpath d='M15.84 32a.52.52 0 0 1-.52-.53l.1-8.73a.52.52 0 0 1 .53-.52.53.53 0 0 1 .52.54l-.1 8.72a.53.53 0 0 1-.53.52M10.27 30.89a.6.6 0 0 1-.19 0 .53.53 0 0 1-.3-.69L13 22.07a.52.52 0 0 1 .68-.29.53.53 0 0 1 .3.68l-3.25 8.1a.52.52 0 0 1-.46.33M5.48 27.85a.54.54 0 0 1-.36-.14.53.53 0 0 1 0-.75L11 20.58a.53.53 0 0 1 .75 0 .52.52 0 0 1 0 .74l-5.88 6.36a.56.56 0 0 1-.39.17M2.11 23.28a.54.54 0 0 1-.48-.3.53.53 0 0 1 .25-.7l7.85-3.8a.53.53 0 1 1 .46.95l-7.85 3.8a.6.6 0 0 1-.23.05M.62 17.8a.53.53 0 0 1 0-1.05L9.27 16a.53.53 0 0 1 .09 1.06l-8.7.7ZM9.57 14.64h-.15l-8.36-2.5a.54.54 0 0 1-.36-.66.53.53 0 0 1 .66-.36l8.36 2.48a.53.53 0 0 1-.15 1ZM10.7 12.44a.57.57 0 0 1-.33-.11L3.47 7a.53.53 0 0 1 .65-.83L11 11.49a.53.53 0 0 1 .09.74.51.51 0 0 1-.39.21M12.54 10.79a.53.53 0 0 1-.45-.25L7.58 3.07a.52.52 0 0 1 .18-.72.54.54 0 0 1 .73.18L13 10a.53.53 0 0 1-.18.73.5.5 0 0 1-.28.06M14.85 9.93a.52.52 0 0 1-.51-.44L12.83.9a.53.53 0 0 1 1-.18l1.51 8.59a.53.53 0 0 1-.43.61ZM17.33 10h-.11a.53.53 0 0 1-.41-.62l1.7-8.61a.53.53 0 1 1 1 .21l-1.7 8.55a.53.53 0 0 1-.48.47M19.62 10.88a.47.47 0 0 1-.28-.09.53.53 0 0 1-.17-.73l4.68-7.36a.53.53 0 1 1 .89.57l-4.67 7.36a.54.54 0 0 1-.45.25M21.43 12.56a.54.54 0 0 1-.43-.21.54.54 0 0 1 .11-.74l7-5.18a.54.54 0 0 1 .74.11.52.52 0 0 1-.11.74l-7 5.18a.5.5 0 0 1-.31.1M22.5 14.79a.54.54 0 0 1-.5-.39.53.53 0 0 1 .38-.65l8.41-2.29a.53.53 0 0 1 .28 1l-8.42 2.29ZM31.38 18.15h-.05l-8.68-.9a.53.53 0 0 1-.47-.58.53.53 0 0 1 .58-.47l8.68.9a.53.53 0 0 1-.06 1ZM29.76 23.6a.5.5 0 0 1-.24-.06l-7.76-4a.53.53 0 0 1 .48-.94l7.77 4a.53.53 0 0 1-.25 1M26.29 28.09a.51.51 0 0 1-.39-.18l-5.8-6.51a.53.53 0 0 1 0-.75.53.53 0 0 1 .74 0l5.81 6.52a.52.52 0 0 1-.05.74.52.52 0 0 1-.31.18M21.43 31a.53.53 0 0 1-.49-.34l-3.06-8.17a.53.53 0 0 1 1-.37l3.06 8.17a.54.54 0 0 1-.31.68.6.6 0 0 1-.2.03' class='cls-1'/%3E%3Cpath d='M15.89 28.12a.86.86 0 0 1-.86-.88l.05-4.5a.86.86 0 0 1 .87-.86.86.86 0 0 1 .86.88v4.5a.86.86 0 0 1-.92.86' style='fill:%23189332'/%3E%3Cpath d='M12 26.86a1 1 0 0 1-.33-.06.87.87 0 0 1-.48-1.14l1.49-3.72a.87.87 0 0 1 1.62.65l-1.49 3.72a.89.89 0 0 1-.81.55' style='fill:%23138c3b'/%3E%3Cpath d='M8.84 24.59a.85.85 0 0 1-.6-.23.87.87 0 0 1 0-1.23l2.59-2.78a.87.87 0 0 1 1.23 0 .86.86 0 0 1 .05 1.23l-2.63 2.74a.9.9 0 0 1-.64.27' style='fill:%23149889'/%3E%3Cpath d='M6.46 21.52a.87.87 0 0 1-.38-1.66l3.5-1.69a.87.87 0 1 1 .76 1.57l-3.5 1.69a.9.9 0 0 1-.38.09' style='fill:%2317a2c4'/%3E%3Cpath d='M5 17.79a.87.87 0 0 1 0-1.74l4.27-.35a.87.87 0 1 1 .14 1.74l-4.27.34Z' style='fill:%231d73b2'/%3E%3Cpath d='M9.57 15a1 1 0 0 1-.25 0l-4.74-1.46A.88.88 0 0 1 4 12.46a.87.87 0 0 1 1.09-.59l4.74 1.4a.89.89 0 0 1 .59 1.09.88.88 0 0 1-.85.64' style='fill:%23191384'/%3E%3Cpath d='M10.7 12.78a.9.9 0 0 1-.54-.18L5.55 9a.87.87 0 1 1 1.06-1.35l4.62 3.57a.87.87 0 0 1-.53 1.56' style='fill:%23230f82'/%3E%3Cpath d='M12.54 11.14a.89.89 0 0 1-.75-.42L8.25 4.85A.87.87 0 0 1 9.75 4l3.54 5.87A.87.87 0 0 1 13 11a.84.84 0 0 1-.46.14' style='fill:%236d298c'/%3E%3Cpath d='M14.85 10.27a.87.87 0 0 1-.85-.72L12.64 1.8a.87.87 0 0 1 1.72-.3l1.35 7.75a.87.87 0 0 1-.7 1Z' style='fill:%23932a5f'/%3E%3Cpath d='M17.33 10.3a.5.5 0 0 1-.17 0 .87.87 0 0 1-.69-1l1.7-8.6a.87.87 0 0 1 1.71.3l-1.7 8.6a.87.87 0 0 1-.85.7' style='fill:%23de1c1b'/%3E%3Cpath d='M19.62 11.22a.83.83 0 0 1-.47-.14.88.88 0 0 1-.27-1.2l4.68-7.36a.87.87 0 0 1 1.44.93l-4.67 7.36a.87.87 0 0 1-.71.41' style='fill:%23ee310e'/%3E%3Cpath d='M21.43 12.91a.88.88 0 0 1-.52-1.58l7-5.18a.88.88 0 0 1 1 1.41l-7 5.18a.9.9 0 0 1-.48.17' style='fill:%23fa440f'/%3E%3Cpath d='M22.5 15.13a.87.87 0 0 1-.23-1.71l8.42-2.3a.88.88 0 0 1 .46 1.69l-8.42 2.29a.9.9 0 0 1-.23.03' style='fill:%23f86010'/%3E%3Cpath d='M30.88 18.44h-.09l-8.18-.85a.88.88 0 0 1 .19-1.74l8.2.85a.87.87 0 0 1-.09 1.74Z' style='fill:%23f77511'/%3E%3Cpath d='M28.45 23.27a.85.85 0 0 1-.4-.1l-6.45-3.3a.87.87 0 0 1-.37-1.18.86.86 0 0 1 1.17-.38l6.45 3.31a.87.87 0 0 1 .38 1.17.89.89 0 0 1-.78.48' style='fill:%23f9c611'/%3E%3Cpath d='M24.62 26.56a.85.85 0 0 1-.65-.3l-4.13-4.63a.88.88 0 0 1 .07-1.24.87.87 0 0 1 1.23.08l4.13 4.63a.87.87 0 0 1-.07 1.23.85.85 0 0 1-.58.23' style='fill:%23f9ea17'/%3E%3Cpath d='M20.22 28.12a.87.87 0 0 1-.82-.57l-1.84-4.92a.87.87 0 1 1 1.63-.63L21 26.94a.87.87 0 0 1-.52 1.12.8.8 0 0 1-.26.06' style='fill:%239dcb1e'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.name{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 124.27 31.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1{fill:%23fff}%3C/style%3E%3C/defs%3E%3Cg id='ReSee_Wordmark'%3E%3Cg id='Wordmark_White'%3E%3Cpath d='M11.29 20.1H6.51v11H0V.46h14.31c6.38 0 10.28 4.17 10.28 9.86 0 5.42-3.39 8.31-6.7 9.09l6.89 11.65H17.3Zm2.06-14H6.51v8.4h6.84c2.62 0 4.59-1.65 4.59-4.22S16 6.06 13.35 6.06ZM37.25 8.35c6.61 0 11.1 5 11.1 12.2v1.29H31.88c.37 2.8 2.62 5.14 6.38 5.14a9.06 9.06 0 0 0 5.92-2.21l2.57 3.77a13.68 13.68 0 0 1-9.13 3.07c-6.75 0-11.84-4.54-11.84-11.65A11.28 11.28 0 0 1 37.25 8.35m-5.46 9.54h10.92A5.14 5.14 0 0 0 37.25 13a5.33 5.33 0 0 0-5.46 4.89M53.4 21.79a13.38 13.38 0 0 0 9.72 4.13c3.58 0 5.33-1.7 5.33-3.44 0-2.29-2.67-3.07-6.2-3.9-5-1.15-11.42-2.52-11.42-9.36 0-5.09 4.4-9.22 11.6-9.22a17 17 0 0 1 11.93 4.27L70.74 9A13 13 0 0 0 62 5.69c-2.94 0-4.5 1.28-4.5 3.12 0 2.06 2.57 2.71 6.1 3.53 5 1.15 11.47 2.66 11.47 9.45 0 5.6-4 9.82-12.25 9.82-5.87 0-10.09-2-13-4.86ZM88.58 8.35c6.61 0 11.1 5 11.1 12.2v1.29H83.21c.37 2.8 2.62 5.14 6.38 5.14a9 9 0 0 0 5.92-2.21l2.57 3.77A13.68 13.68 0 0 1 89 31.61c-6.75 0-11.84-4.54-11.84-11.65A11.28 11.28 0 0 1 88.58 8.35m-5.46 9.54H94A5.13 5.13 0 0 0 88.58 13a5.33 5.33 0 0 0-5.46 4.89M113.17 8.35c6.61 0 11.1 5 11.1 12.2v1.29H107.8c.37 2.8 2.62 5.14 6.38 5.14a9.06 9.06 0 0 0 5.92-2.21l2.57 3.77a13.68 13.68 0 0 1-9.13 3.07c-6.75 0-11.84-4.54-11.84-11.65a11.27 11.27 0 0 1 11.47-11.61m-5.46 9.54h10.92a5.14 5.14 0 0 0-5.46-4.89 5.33 5.33 0 0 0-5.46 4.89' class='cls-1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ReseeWordLogo component displays the ReSee Movies color wheel logo,
|
|
3
|
+
* and/or the "ReSee" word mark side-by-side.
|
|
4
|
+
*/
|
|
5
|
+
export interface ReseeWordLogoProps {
|
|
6
|
+
showLogo?: boolean;
|
|
7
|
+
showName?: boolean;
|
|
8
|
+
size?: 'lg' | 'md' | 'sm' | 'xs' | 'responsive';
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<ReseeWordLogoProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ReseeWordLogoProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="{ pinned: !props.disabled }">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed } from "vue";
|
|
13
|
+
import { useGlobalHeaderState } from "../composables/use-global-header-state";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
top: { type: Number, required: false, default: 24 },
|
|
16
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
headerHeight,
|
|
20
|
+
subheaderHeight,
|
|
21
|
+
isHeaderPulledDown
|
|
22
|
+
} = useGlobalHeaderState();
|
|
23
|
+
const topOffset = computed(() => {
|
|
24
|
+
if (props.disabled) {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
return isHeaderPulledDown.value ? headerHeight.value + props.top : subheaderHeight.value + props.top;
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.pinned{position:sticky;top:calc(v-bind(topOffset)*1px);transition-duration:calc(var(--default-transition-duration)*2);transition-property:top;transition-timing-function:var(--default-transition-timing-function);will-change:top}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ScrollPinnedContainerProps {
|
|
2
|
+
top?: number;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ScrollPinnedContainerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScrollPinnedContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
6
|
+
default?: (props: {}) => any;
|
|
7
|
+
}>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<svg
|
|
4
|
+
xmlns = "http://www.w3.org/2000/svg"
|
|
5
|
+
viewBox = "0 0 214 214"
|
|
6
|
+
>
|
|
7
|
+
<g fill="none" stroke="currentColor" stroke-width="2">
|
|
8
|
+
<circle
|
|
9
|
+
fill = "currentColor"
|
|
10
|
+
opacity = "0.15"
|
|
11
|
+
cx = "107"
|
|
12
|
+
cy = "107"
|
|
13
|
+
r = "72"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<circle
|
|
17
|
+
fill = "currentColor"
|
|
18
|
+
cx = "107"
|
|
19
|
+
cy = "107"
|
|
20
|
+
r = "72"
|
|
21
|
+
opacity = "0.8"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<polyline
|
|
25
|
+
stroke = "#fff"
|
|
26
|
+
stroke-width = "10"
|
|
27
|
+
points = "73.5,107.8 93.7,127.9 142.2,79.4"
|
|
28
|
+
style = "stroke-dasharray: 50%, 50%; stroke-dashoffset: 100%"
|
|
29
|
+
/>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
|
|
33
|
+
<p v-if="props.text">
|
|
34
|
+
{{ props.text }}
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
text: { type: String, required: false }
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
@reference "tailwindcss";@keyframes checkmark{0%{stroke-dashoffset:50%}to{stroke-dashoffset:0}}@keyframes grow-circle{0%{r:0}}@keyframes grow-circle-bigger{50%{opacity:.11}to{opacity:0;r:100}}@keyframes show-text{to{opacity:1}}div{align-items:center;display:flex;flex-direction:column}svg{color:var(--color-success);margin:--spacing(-4);max-width:--spacing(48)}svg polyline{animation:checkmark .5s cubic-bezier(.55,.2,.71,-.04) .7s backwards}svg circle:first-child{animation:grow-circle .45s cubic-bezier(.66,.23,.51,1.23) backwards,grow-circle-bigger .9s linear 1.1s forwards}svg circle:nth-child(2){animation:grow-circle .5s cubic-bezier(.66,.23,.51,1.23) .25s backwards}p{animation:show-text .5s linear .9s forwards;font-size:var(--text-lg);opacity:0;text-align:center}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
text?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -1,24 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
novalidate = "true"
|
|
6
|
-
:validate-on-mount = "true"
|
|
7
|
-
:validate-on-submit = "true"
|
|
8
|
-
:validate-on-value-update = "true"
|
|
9
|
-
:validate-on-blur = "false"
|
|
10
|
-
:initial-values = "props.initialValues ?? values"
|
|
11
|
-
:aria-disabled = "props.disabled"
|
|
12
|
-
@submit = "handleFormSubmit"
|
|
2
|
+
<Transition
|
|
3
|
+
leave-active-class = "transition-opacity duration-300"
|
|
4
|
+
leave-to-class = "opacity-0"
|
|
13
5
|
>
|
|
14
|
-
<
|
|
6
|
+
<LazySuccessSplash
|
|
7
|
+
v-if = "props.successText && success"
|
|
8
|
+
:text = "props.successText"
|
|
9
|
+
/>
|
|
15
10
|
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
11
|
+
<div v-else>
|
|
12
|
+
<LazyMessage
|
|
13
|
+
v-if = "errors?.length"
|
|
14
|
+
severity = "error"
|
|
15
|
+
class = "mb-6"
|
|
16
|
+
:scroll-into-view = "true"
|
|
17
|
+
>
|
|
18
|
+
<slot name="error" :errors="errors">
|
|
19
|
+
{{ errors.join(" ") }}
|
|
20
|
+
</slot>
|
|
21
|
+
</LazyMessage>
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
<PrimeForm
|
|
24
|
+
v-slot = "$form"
|
|
25
|
+
ref = "form"
|
|
26
|
+
novalidate = "true"
|
|
27
|
+
:validate-on-mount = "true"
|
|
28
|
+
:validate-on-submit = "true"
|
|
29
|
+
:validate-on-value-update = "true"
|
|
30
|
+
:validate-on-blur = "false"
|
|
31
|
+
:initial-values = "props.initialValues ?? values"
|
|
32
|
+
:aria-disabled = "props.disabled"
|
|
33
|
+
@submit = "handleFormSubmit"
|
|
34
|
+
>
|
|
35
|
+
<slot name="before" :state="$form" />
|
|
36
|
+
|
|
37
|
+
<slot name="default" :state="$form">
|
|
38
|
+
<FormFieldBuilder v-if="props.fields?.length" :fields="props.fields" />
|
|
39
|
+
</slot>
|
|
40
|
+
|
|
41
|
+
<slot name="after" :state="$form" />
|
|
42
|
+
</PrimeForm>
|
|
43
|
+
</div>
|
|
44
|
+
</Transition>
|
|
22
45
|
</template>
|
|
23
46
|
|
|
24
47
|
<script>
|
|
@@ -29,9 +52,11 @@ export * from "../../types/form";
|
|
|
29
52
|
import PrimeForm, {} from "@primevue/forms/form";
|
|
30
53
|
import { toNonNullableArray } from "@resee-movies/utilities/arrays/to-non-nullable-array";
|
|
31
54
|
import { isPromiseLike } from "@resee-movies/utilities/objects/is-promise-like";
|
|
32
|
-
import { syncRefs
|
|
33
|
-
import { useTemplateRef } from "vue";
|
|
55
|
+
import { syncRefs } from "@vueuse/core";
|
|
56
|
+
import { ref, useTemplateRef } from "vue";
|
|
34
57
|
import FormFieldBuilder from "./FormFieldBuilder.vue";
|
|
58
|
+
import LazySuccessSplash from "../SuccessSplash.vue";
|
|
59
|
+
import LazyMessage from "../Message.vue";
|
|
35
60
|
import { useReactiveObjectsSync } from "../../composables/use-reactive-objects-sync";
|
|
36
61
|
import { provideFormInstance, getValuesFromFormState } from "../../utils/form";
|
|
37
62
|
const props = defineProps({
|
|
@@ -40,10 +65,13 @@ const props = defineProps({
|
|
|
40
65
|
onChange: { type: [Function, Array], required: false, default: void 0 },
|
|
41
66
|
changeDelay: { type: Number, required: false, default: 1 },
|
|
42
67
|
initialValues: { type: Object, required: false, default: void 0 },
|
|
43
|
-
fields: { type: Array, required: false, default: void 0 }
|
|
68
|
+
fields: { type: Array, required: false, default: void 0 },
|
|
69
|
+
successText: { type: String, required: false, default: void 0 }
|
|
44
70
|
});
|
|
45
71
|
const form = useTemplateRef("form");
|
|
46
72
|
const values = defineModel("values", { type: null, ...{ default: void 0 } });
|
|
73
|
+
const success = ref(false);
|
|
74
|
+
const errors = ref();
|
|
47
75
|
defineEmits(["submit", "change"]);
|
|
48
76
|
const formInstance = provideFormInstance();
|
|
49
77
|
syncRefs(() => props.disabled, formInstance.isDisabled);
|
|
@@ -94,7 +122,13 @@ async function handleFormSubmit(event) {
|
|
|
94
122
|
const results = handlers.map((handler) => handler(newEvent));
|
|
95
123
|
if (!!results.find((result) => isPromiseLike(result))) {
|
|
96
124
|
formInstance.isSubmitting.value = true;
|
|
97
|
-
await Promise.allSettled(results);
|
|
125
|
+
const result = await Promise.allSettled(results);
|
|
126
|
+
if (!result.find((entry) => entry.status === "rejected")) {
|
|
127
|
+
success.value = true;
|
|
128
|
+
errors.value = void 0;
|
|
129
|
+
} else {
|
|
130
|
+
errors.value = result.filter((entry) => entry.status === "rejected").map((entry) => entry.reason);
|
|
131
|
+
}
|
|
98
132
|
formInstance.isSubmitting.value = false;
|
|
99
133
|
}
|
|
100
134
|
}
|
|
@@ -9,6 +9,7 @@ export interface FormProps<T extends FormValues = FormValues> {
|
|
|
9
9
|
changeDelay?: number;
|
|
10
10
|
initialValues?: Partial<T>;
|
|
11
11
|
fields?: FormFieldBuilderOption[];
|
|
12
|
+
successText?: string;
|
|
12
13
|
}
|
|
13
14
|
declare const __VLS_export: <T extends FormValues>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
14
15
|
props: __VLS_PrettifyLocal<(FormProps<T> & {
|
|
@@ -22,6 +23,10 @@ declare const __VLS_export: <T extends FormValues>(__VLS_props: NonNullable<Awai
|
|
|
22
23
|
expose: (exposed: {}) => void;
|
|
23
24
|
attrs: any;
|
|
24
25
|
slots: {
|
|
26
|
+
error?: (props: {
|
|
27
|
+
errors: any;
|
|
28
|
+
}) => any;
|
|
29
|
+
} & {
|
|
25
30
|
before?: (props: {
|
|
26
31
|
state: any;
|
|
27
32
|
}) => any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stateful information about the GlobalHeader component.
|
|
3
|
+
*/
|
|
4
|
+
export declare function useGlobalHeaderState(): {
|
|
5
|
+
headerHeight: import("vue").Ref<number, number>;
|
|
6
|
+
subheaderHeight: import("vue").Ref<number, number>;
|
|
7
|
+
isHeaderDrawerEnabled: import("vue").Ref<boolean, boolean>;
|
|
8
|
+
isHeaderPulledDown: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
offsetFromHeaderStyles: import("vue").ComputedRef<string[]>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
const headerHeight = ref(0);
|
|
3
|
+
const subheaderHeight = ref(0);
|
|
4
|
+
const isHeaderDrawerEnabled = ref(true);
|
|
5
|
+
const isHeaderPulledDown = ref(false);
|
|
6
|
+
const offsetFromHeaderStyles = computed(() => {
|
|
7
|
+
return [
|
|
8
|
+
`margin-top: -${headerHeight.value}px;`,
|
|
9
|
+
`padding-top: ${headerHeight.value}px;`
|
|
10
|
+
];
|
|
11
|
+
});
|
|
12
|
+
export function useGlobalHeaderState() {
|
|
13
|
+
return {
|
|
14
|
+
headerHeight,
|
|
15
|
+
subheaderHeight,
|
|
16
|
+
isHeaderDrawerEnabled,
|
|
17
|
+
isHeaderPulledDown,
|
|
18
|
+
offsetFromHeaderStyles
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -10,6 +10,9 @@ export type LoadImageOptions = {
|
|
|
10
10
|
type?: MaybeRefOrGetter<LoadImageType>;
|
|
11
11
|
reseeConfig?: MaybeRefOrGetter<MediaAssetTransformConfig | undefined>;
|
|
12
12
|
deferLoad?: Ref<boolean>;
|
|
13
|
+
onLoading?: () => void;
|
|
14
|
+
onLoad?: (src: string | undefined) => void;
|
|
15
|
+
onError?: (err: unknown) => void;
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
18
|
* Exposes the {@link loadImage} utility as a set of reactive properties.
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { useNuxtApp } from "#imports";
|
|
2
1
|
import { loadImage } from "@resee-movies/utilities/dom/load-image";
|
|
3
2
|
import { getMediaAssetUrl } from "@resee-movies/utilities/resee/get-media-asset-url";
|
|
4
3
|
import { isString } from "@resee-movies/utilities/strings/is-string";
|
|
5
4
|
import { fromTmdbImageSize } from "@resee-movies/utilities/tmdb/from-tmdb-image-size";
|
|
6
5
|
import { getTmdbImageCache } from "@resee-movies/utilities/tmdb/get-tmdb-image-cache";
|
|
7
6
|
import { getTmdbImageUrl } from "@resee-movies/utilities/tmdb/get-tmdb-image-url";
|
|
8
|
-
import {
|
|
7
|
+
import { isPromiseLike } from "@resee-movies/utilities/objects/is-promise-like";
|
|
9
8
|
import { ref, toRef, toValue, watch } from "vue";
|
|
10
9
|
export function useLoadImage(source, config = {}) {
|
|
11
|
-
const nuxtApp = useNuxtApp();
|
|
12
10
|
const src = ref();
|
|
13
11
|
const key = ref();
|
|
14
12
|
const error = ref();
|
|
@@ -31,69 +29,52 @@ export function useLoadImage(source, config = {}) {
|
|
|
31
29
|
src.value = toValue(config.errorSrc);
|
|
32
30
|
key.value = src.value;
|
|
33
31
|
error.value = new Error('"src" is not defined');
|
|
32
|
+
config.onError?.(error.value);
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
35
|
const loadType = toValue(config.type);
|
|
37
36
|
const imgWidth = toValue(config.width);
|
|
38
|
-
if (import.meta.server || nuxtApp.isHydrating) {
|
|
39
|
-
switch (loadType) {
|
|
40
|
-
case "tmdb": {
|
|
41
|
-
src.value = getTmdbImageUrl(sourceUnwrapped, imgWidth ? toTmdbImageSize(imgWidth) : void 0);
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
case "resee": {
|
|
45
|
-
const filename = toValue(config.friendlyName);
|
|
46
|
-
const reseeConfig = toValue(config.reseeConfig);
|
|
47
|
-
const width = fromTmdbImageSize(imgWidth, { originalIsUndefined: true });
|
|
48
|
-
src.value = getMediaAssetUrl(sourceUnwrapped, filename, { width, format: "webp", ...reseeConfig });
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
default: {
|
|
52
|
-
src.value = sourceUnwrapped;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
loading.value = true;
|
|
56
|
-
key.value = sourceUnwrapped;
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
37
|
if (toValue(config.deferLoad)) {
|
|
60
38
|
return;
|
|
61
39
|
}
|
|
62
|
-
let
|
|
63
|
-
let
|
|
40
|
+
let targetSrc;
|
|
41
|
+
let tempSrc;
|
|
42
|
+
let promise;
|
|
64
43
|
if (loadType === "tmdb") {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
44
|
+
targetSrc = getTmdbImageUrl(sourceUnwrapped, imgWidth);
|
|
45
|
+
const result = getTmdbImageCache().getImage(targetSrc);
|
|
46
|
+
if (isPromiseLike(result)) {
|
|
47
|
+
tempSrc = result.placeholderUrl;
|
|
48
|
+
promise = result;
|
|
49
|
+
}
|
|
68
50
|
} else if (loadType === "resee") {
|
|
69
51
|
const filename = toValue(config.friendlyName);
|
|
70
52
|
const reseeConfig = toValue(config.reseeConfig);
|
|
71
53
|
const width = fromTmdbImageSize(imgWidth, { originalIsUndefined: true });
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
54
|
+
targetSrc = getMediaAssetUrl(sourceUnwrapped, filename, { width, format: "webp", ...reseeConfig });
|
|
55
|
+
promise = loadImage(targetSrc);
|
|
75
56
|
} else {
|
|
76
|
-
|
|
57
|
+
targetSrc = sourceUnwrapped;
|
|
58
|
+
promise = loadImage(targetSrc);
|
|
77
59
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
src.value = tempSrc ?? targetSrc;
|
|
61
|
+
key.value = tempSrc ?? sourceUnwrapped;
|
|
62
|
+
loading.value = !!promise && !tempSrc;
|
|
63
|
+
bgLoading.value = !!promise && !!tempSrc;
|
|
64
|
+
error.value = void 0;
|
|
65
|
+
if (!promise) {
|
|
66
|
+
config.onLoad?.(src.value);
|
|
84
67
|
return;
|
|
85
68
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
loading.value = !pendingSource;
|
|
89
|
-
bgLoading.value = !!pendingSource;
|
|
90
|
-
pendingLoader.then(
|
|
69
|
+
config.onLoading?.();
|
|
70
|
+
promise.then(
|
|
91
71
|
(loadedSrc) => {
|
|
92
72
|
src.value = loadedSrc;
|
|
93
73
|
key.value = sourceUnwrapped;
|
|
94
74
|
loading.value = false;
|
|
95
75
|
bgLoading.value = false;
|
|
96
76
|
error.value = void 0;
|
|
77
|
+
config.onLoad?.(src.value);
|
|
97
78
|
},
|
|
98
79
|
(e) => {
|
|
99
80
|
src.value = toValue(config.errorSrc) ?? toValue(config.placeholderSrc);
|
|
@@ -101,6 +82,7 @@ export function useLoadImage(source, config = {}) {
|
|
|
101
82
|
loading.value = false;
|
|
102
83
|
bgLoading.value = false;
|
|
103
84
|
error.value = e;
|
|
85
|
+
config.onError?.(e);
|
|
104
86
|
}
|
|
105
87
|
);
|
|
106
88
|
},
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ConfigurableWindow, type MaybeComputedElementRef, type MaybeElement, type Pausable } from '@vueuse/core';
|
|
2
|
+
import { type ComputedRef, type MaybeRefOrGetter } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This exists solely to support a dynamic `rootMargin` property. The capability will
|
|
7
|
+
* land natively in Vueuse soon, at which time this can be dropped.
|
|
8
|
+
*/
|
|
9
|
+
export interface UseMutableIntersectionObserverOptions extends ConfigurableWindow {
|
|
10
|
+
/**
|
|
11
|
+
* Start the IntersectionObserver immediately on creation
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The Element or Document whose bounds are used as the bounding box
|
|
18
|
+
* when testing for intersection.
|
|
19
|
+
*/
|
|
20
|
+
root?: MaybeComputedElementRef | Document;
|
|
21
|
+
/**
|
|
22
|
+
* A string which specifies a set of offsets to add to the root's
|
|
23
|
+
* bounding_box when calculating intersections.
|
|
24
|
+
*/
|
|
25
|
+
rootMargin?: MaybeRefOrGetter<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Either a single number or an array of numbers between 0.0 and 1.
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
threshold?: number | number[];
|
|
31
|
+
}
|
|
32
|
+
export interface UseMutableIntersectionObserverReturn extends Pausable {
|
|
33
|
+
isSupported: ComputedRef<boolean>;
|
|
34
|
+
stop: () => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Detects that a target element's visibility.
|
|
38
|
+
*
|
|
39
|
+
* @see https://vueuse.org/useIntersectionObserver
|
|
40
|
+
* @param target
|
|
41
|
+
* @param callback
|
|
42
|
+
* @param options
|
|
43
|
+
*/
|
|
44
|
+
export declare function useMutableIntersectionObserver(target: MaybeComputedElementRef | MaybeRefOrGetter<MaybeElement[]> | MaybeComputedElementRef[], callback: IntersectionObserverCallback, options?: UseMutableIntersectionObserverOptions): UseMutableIntersectionObserverReturn;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultWindow,
|
|
3
|
+
noop,
|
|
4
|
+
notNullish,
|
|
5
|
+
toArray,
|
|
6
|
+
tryOnScopeDispose,
|
|
7
|
+
unrefElement,
|
|
8
|
+
useSupported
|
|
9
|
+
} from "@vueuse/core";
|
|
10
|
+
import { computed, shallowRef, toValue, watch } from "vue";
|
|
11
|
+
export function useMutableIntersectionObserver(target, callback, options = {}) {
|
|
12
|
+
const {
|
|
13
|
+
root,
|
|
14
|
+
rootMargin,
|
|
15
|
+
threshold = 0,
|
|
16
|
+
window = defaultWindow,
|
|
17
|
+
immediate = true
|
|
18
|
+
} = options;
|
|
19
|
+
const isSupported = useSupported(() => window && "IntersectionObserver" in window);
|
|
20
|
+
const targets = computed(() => {
|
|
21
|
+
const _target = toValue(target);
|
|
22
|
+
return toArray(_target).map(unrefElement).filter(notNullish);
|
|
23
|
+
});
|
|
24
|
+
let cleanup = noop;
|
|
25
|
+
const isActive = shallowRef(immediate);
|
|
26
|
+
const stopWatch = isSupported.value ? watch(
|
|
27
|
+
() => [targets.value, unrefElement(root), toValue(rootMargin), isActive.value],
|
|
28
|
+
([targets2, root2, rootMargin2]) => {
|
|
29
|
+
cleanup();
|
|
30
|
+
if (!isActive.value)
|
|
31
|
+
return;
|
|
32
|
+
if (!targets2.length)
|
|
33
|
+
return;
|
|
34
|
+
const observer = new IntersectionObserver(
|
|
35
|
+
callback,
|
|
36
|
+
{
|
|
37
|
+
root: unrefElement(root2),
|
|
38
|
+
rootMargin: rootMargin2,
|
|
39
|
+
threshold
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
targets2.forEach((el) => el && observer.observe(el));
|
|
43
|
+
cleanup = () => {
|
|
44
|
+
observer.disconnect();
|
|
45
|
+
cleanup = noop;
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
{ immediate, flush: "post" }
|
|
49
|
+
) : noop;
|
|
50
|
+
const stop = () => {
|
|
51
|
+
cleanup();
|
|
52
|
+
stopWatch();
|
|
53
|
+
isActive.value = false;
|
|
54
|
+
};
|
|
55
|
+
tryOnScopeDispose(stop);
|
|
56
|
+
return {
|
|
57
|
+
isSupported,
|
|
58
|
+
isActive,
|
|
59
|
+
pause() {
|
|
60
|
+
cleanup();
|
|
61
|
+
isActive.value = false;
|
|
62
|
+
},
|
|
63
|
+
resume() {
|
|
64
|
+
isActive.value = true;
|
|
65
|
+
},
|
|
66
|
+
stop
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
type AppPreferences = {
|
|
2
|
+
dismissNotification?: string;
|
|
3
|
+
};
|
|
1
4
|
/**
|
|
2
5
|
* Provides the ability to manage runtime configuration of the ReSee UX
|
|
3
6
|
* module.
|
|
@@ -22,4 +25,6 @@ export declare function useReseeUx(): {
|
|
|
22
25
|
numOptionsSelected: string;
|
|
23
26
|
};
|
|
24
27
|
};
|
|
28
|
+
preferences: import("#app").CookieRef<AppPreferences>;
|
|
25
29
|
};
|
|
30
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useCookie } from "#imports";
|
|
1
2
|
import { reactive } from "vue";
|
|
2
3
|
const Localization = reactive({
|
|
3
4
|
validation: {
|
|
@@ -18,6 +19,15 @@ const Localization = reactive({
|
|
|
18
19
|
numOptionsSelected: "{count} Item(s) Selected"
|
|
19
20
|
}
|
|
20
21
|
});
|
|
22
|
+
const msInYear = 31536e6;
|
|
21
23
|
export function useReseeUx() {
|
|
22
|
-
|
|
24
|
+
const preferences = useCookie("resee-app-preferences", {
|
|
25
|
+
default: () => ({}),
|
|
26
|
+
secure: true,
|
|
27
|
+
httpOnly: false,
|
|
28
|
+
sameSite: "strict",
|
|
29
|
+
maxAge: msInYear / 1e3,
|
|
30
|
+
expires: new Date(Date.now() + msInYear)
|
|
31
|
+
});
|
|
32
|
+
return { locale: Localization, preferences };
|
|
23
33
|
}
|