cja-phoenix 1.2.55 → 1.2.56

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
3
  "configKey": "cja-phoenix",
4
- "version": "1.2.55",
4
+ "version": "1.2.56",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -73,7 +73,12 @@ const toggleModal = () => {
73
73
  };
74
74
  watch(active, () => {
75
75
  nextTick(() => {
76
- mobileFull.value = active.value ? props.forceMobileFull || modalContainer.value.clientHeight >= window.innerHeight * 0.75 : false;
76
+ if (!active.value) {
77
+ mobileFull.value = false;
78
+ return;
79
+ }
80
+ const containerHeight = modalContainer.value?.clientHeight ?? 0;
81
+ mobileFull.value = props.forceMobileFull || containerHeight >= window.innerHeight * 0.75;
77
82
  });
78
83
  });
79
84
  defineExpose({ active, openModal, closeModal, toggleModal });
@@ -32,6 +32,7 @@ onMounted(() => {
32
32
  () => [top, headerHeight.value],
33
33
  () => {
34
34
  if (observer) observer.disconnect();
35
+ const stickyOffset = top ?? headerHeight.value;
35
36
  observer = new IntersectionObserver(
36
37
  (entries) => {
37
38
  const entry = entries[0];
@@ -40,7 +41,7 @@ onMounted(() => {
40
41
  }
41
42
  },
42
43
  {
43
- rootMargin: `0px 0px -${window.innerHeight - (top || headerHeight.value)}px 0px`
44
+ rootMargin: `0px 0px -${window.innerHeight - stickyOffset}px 0px`
44
45
  }
45
46
  );
46
47
  observer.observe(stickyContainer.value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
- "version": "1.2.55",
3
+ "version": "1.2.56",
4
4
  "description": "Phoenix utility",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- export type AbTestVersion = "control" | "variant";
2
- export declare function getAbTestVersion(experimentName: string): Promise<AbTestVersion>;
@@ -1,26 +0,0 @@
1
- import { useCookie, useRequestFetch, useRuntimeConfig } from "#imports";
2
- export async function getAbTestVersion(experimentName) {
3
- const { nucleusURL } = useRuntimeConfig().public;
4
- const requestFetch = useRequestFetch();
5
- const abTestCookie = useCookie(
6
- `abTestVersion_${experimentName}`
7
- );
8
- const deviceIdCookie = useCookie("device_id");
9
- if (abTestCookie.value == "control" || abTestCookie.value == "variant") {
10
- return abTestCookie.value;
11
- }
12
- const response = await requestFetch("/experiments/abtest", {
13
- baseURL: nucleusURL,
14
- method: "POST",
15
- headers: {
16
- "Content-Type": "application/json"
17
- },
18
- body: {
19
- experiment_name: experimentName,
20
- device_id: deviceIdCookie.value
21
- }
22
- });
23
- const version = response?.version_shown || "control";
24
- abTestCookie.value = version;
25
- return version;
26
- }