@creopse/bridge 0.1.0 → 0.1.1
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/index-BWhWXGj9.js +13 -0
- package/dist/react/bridge.js +27 -0
- package/dist/react/bridge10.js +24 -0
- package/dist/react/bridge11.js +32 -0
- package/dist/react/bridge12.js +23 -0
- package/dist/react/bridge13.js +18 -0
- package/dist/react/bridge2.js +66 -0
- package/dist/react/bridge3.js +37 -0
- package/dist/react/bridge4.js +20 -0
- package/dist/react/bridge5.js +54 -0
- package/dist/react/bridge6.js +54 -0
- package/dist/react/bridge7.js +70 -0
- package/dist/react/bridge8.js +54 -0
- package/dist/react/bridge9.js +37 -0
- package/dist/vite/index.js +6 -2
- package/dist/vite/react.js +131 -147
- package/dist/vite/vue.js +123 -138
- package/dist/vue/bridge.js +15 -0
- package/dist/vue/bridge2.js +27 -0
- package/dist/vue/bridge3.js +1 -0
- package/dist/vue/bridge4.js +18 -0
- package/dist/vue/bridge5.js +1 -0
- package/dist/vue/bridge6.js +41 -0
- package/dist/vue/bridge7.js +16 -0
- package/package.json +38 -12
- package/dist/react/components/AsyncImg/AsyncImg.d.ts +0 -12
- package/dist/react/components/AsyncImg/AsyncImg.js +0 -20
- package/dist/react/components/AsyncImg/index.d.ts +0 -1
- package/dist/react/components/AsyncImg/index.js +0 -1
- package/dist/react/components/CustomTransition/CustomTransition.d.ts +0 -12
- package/dist/react/components/CustomTransition/CustomTransition.js +0 -48
- package/dist/react/components/CustomTransition/index.d.ts +0 -1
- package/dist/react/components/CustomTransition/index.js +0 -1
- package/dist/react/components/Image/Image.d.ts +0 -14
- package/dist/react/components/Image/Image.js +0 -20
- package/dist/react/components/Image/index.d.ts +0 -1
- package/dist/react/components/Image/index.js +0 -1
- package/dist/react/components/MountedTeleport/MountedTeleport.d.ts +0 -8
- package/dist/react/components/MountedTeleport/MountedTeleport.js +0 -43
- package/dist/react/components/MountedTeleport/index.d.ts +0 -1
- package/dist/react/components/MountedTeleport/index.js +0 -1
- package/dist/react/components/PageLayout/PageLayout.d.ts +0 -20
- package/dist/react/components/PageLayout/PageLayout.js +0 -30
- package/dist/react/components/PageLayout/index.d.ts +0 -1
- package/dist/react/components/PageLayout/index.js +0 -1
- package/dist/react/components/ReadMore/ReadMore.d.ts +0 -12
- package/dist/react/components/ReadMore/ReadMore.js +0 -33
- package/dist/react/components/ReadMore/index.d.ts +0 -1
- package/dist/react/components/ReadMore/index.js +0 -1
- package/dist/react/components/StickyBottom/StickyBottom.d.ts +0 -9
- package/dist/react/components/StickyBottom/StickyBottom.js +0 -57
- package/dist/react/components/StickyBottom/index.d.ts +0 -1
- package/dist/react/components/StickyBottom/index.js +0 -1
- package/dist/react/components/StickyTop/StickyTop.d.ts +0 -9
- package/dist/react/components/StickyTop/StickyTop.js +0 -56
- package/dist/react/components/StickyTop/index.d.ts +0 -1
- package/dist/react/components/StickyTop/index.js +0 -1
- package/dist/react/components/index.d.ts +0 -8
- package/dist/react/components/index.js +0 -8
- package/dist/react/hooks/access.d.ts +0 -25
- package/dist/react/hooks/access.js +0 -41
- package/dist/react/hooks/core-bridge.d.ts +0 -13
- package/dist/react/hooks/core-bridge.js +0 -19
- package/dist/react/hooks/responsive.d.ts +0 -15
- package/dist/react/hooks/responsive.js +0 -42
- package/dist/react/hooks/user-preference.d.ts +0 -4
- package/dist/react/hooks/user-preference.js +0 -17
- package/dist/utils/constants.d.ts +0 -2
- package/dist/utils/constants.js +0 -3
- package/dist/utils/functions.d.ts +0 -33
- package/dist/utils/functions.js +0 -53
- package/dist/vite/index.d.ts +0 -2
- package/dist/vite/react.d.ts +0 -45
- package/dist/vite/vue.d.ts +0 -40
- package/dist/vue/composables/access.d.ts +0 -25
- package/dist/vue/composables/access.js +0 -58
- package/dist/vue/composables/core-bridge.d.ts +0 -12
- package/dist/vue/composables/core-bridge.js +0 -15
- package/dist/vue/composables/responsive.d.ts +0 -15
- package/dist/vue/composables/responsive.js +0 -35
- package/dist/vue/composables/user-preference.d.ts +0 -12
- package/dist/vue/composables/user-preference.js +0 -14
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js";
|
|
2
|
+
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/browser-image-compression@2.0.2/node_modules/browser-image-compression/dist/browser-image-compression.mjs";
|
|
3
|
+
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.js";
|
|
4
|
+
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/moment@2.30.1/node_modules/moment/locale/fr.js";
|
|
5
|
+
function n(r) {
|
|
6
|
+
return r.replace(/[^a-z0-9\/-]/g, "").replace(/\//g, "-");
|
|
7
|
+
}
|
|
8
|
+
var o = "PluginDashboard", p = "PluginSettings";
|
|
9
|
+
export {
|
|
10
|
+
o as D,
|
|
11
|
+
p as S,
|
|
12
|
+
n as s
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PageHeader as r, PageLayout as t } from "./bridge2.js";
|
|
2
|
+
import { default as f } from "./bridge3.js";
|
|
3
|
+
import { default as m } from "./bridge4.js";
|
|
4
|
+
import { default as u } from "./bridge5.js";
|
|
5
|
+
import { default as d } from "./bridge6.js";
|
|
6
|
+
import { default as c } from "./bridge7.js";
|
|
7
|
+
import { default as n } from "./bridge8.js";
|
|
8
|
+
import { default as y } from "./bridge9.js";
|
|
9
|
+
import { useAccess as T } from "./bridge10.js";
|
|
10
|
+
import { useResponsive as A } from "./bridge11.js";
|
|
11
|
+
import { useCoreBridge as C } from "./bridge12.js";
|
|
12
|
+
import { useUserPreference as M } from "./bridge13.js";
|
|
13
|
+
export {
|
|
14
|
+
f as AsyncImg,
|
|
15
|
+
c as CustomTransition,
|
|
16
|
+
m as Image,
|
|
17
|
+
y as MountedTeleport,
|
|
18
|
+
r as PageHeader,
|
|
19
|
+
t as PageLayout,
|
|
20
|
+
n as ReadMore,
|
|
21
|
+
d as StickyBottom,
|
|
22
|
+
u as StickyTop,
|
|
23
|
+
T as useAccess,
|
|
24
|
+
C as useCoreBridge,
|
|
25
|
+
A as useResponsive,
|
|
26
|
+
M as useUserPreference
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AccessGuard as a, UserRole as i, Permission as o } from "@creopse/utils/enums";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const c = (e, s) => (e?.findIndex(
|
|
4
|
+
(n) => n.name === s
|
|
5
|
+
) ?? -1) > -1, t = (e, s) => (e?.findIndex((n) => n.name === s) ?? -1) > -1, u = (e) => t(e, i.SUPER_ADMIN), l = (e) => Object.values(o).includes(e), r = [
|
|
6
|
+
{ label: "API", value: a.API, tagType: "warning" },
|
|
7
|
+
{ label: "Web", value: a.WEB, tagType: "info" },
|
|
8
|
+
{ label: "Admin", value: a.ADMIN, tagType: "success" },
|
|
9
|
+
{ label: "Mobile", value: a.MOBILE, tagType: "error" }
|
|
10
|
+
];
|
|
11
|
+
return {
|
|
12
|
+
accessGuards: r,
|
|
13
|
+
getAccessGuardLabel: (e) => r.find((s) => s.value === e)?.label,
|
|
14
|
+
getAccessGuardTagType: (e) => r.find((s) => s.value === e)?.tagType || "default",
|
|
15
|
+
getRoleName: (e, s) => e?.find((n) => n.id === s)?.name || window.__creopse__.i18n.t("undefined"),
|
|
16
|
+
isPermissionNative: l,
|
|
17
|
+
userIsSuperAdmin: u,
|
|
18
|
+
userCan: c,
|
|
19
|
+
userIs: t
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
p as useAccess
|
|
24
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState as p, useEffect as x } from "react";
|
|
2
|
+
const d = (e) => window.matchMedia(e), t = (e) => {
|
|
3
|
+
const [i, o] = p(() => d(e).matches);
|
|
4
|
+
return x(() => {
|
|
5
|
+
const n = d(e), s = (c) => o(c.matches);
|
|
6
|
+
return n.addEventListener("change", s), () => n.removeEventListener("change", s);
|
|
7
|
+
}, [e]), i;
|
|
8
|
+
}, S = () => {
|
|
9
|
+
const e = t("(min-width: 1536px)"), i = t(
|
|
10
|
+
"(min-width: 1280px) and (max-width: 1535px)"
|
|
11
|
+
), o = t(
|
|
12
|
+
"(min-width: 1024px) and (max-width: 1279px)"
|
|
13
|
+
), n = t("(min-width: 768px) and (max-width: 1023px)"), s = t("(max-width: 767px)"), c = t("(min-width: 640px)"), m = t("(min-width: 768px)"), r = t("(min-width: 1024px)"), a = t("(min-width: 1280px)"), h = t("(min-width: 1536px)");
|
|
14
|
+
return {
|
|
15
|
+
is2XlScreen: e,
|
|
16
|
+
isXlScreen: i,
|
|
17
|
+
isLgScreen: o,
|
|
18
|
+
isMdScreen: n,
|
|
19
|
+
isSmScreen: s,
|
|
20
|
+
fromSm: c,
|
|
21
|
+
fromMd: m,
|
|
22
|
+
fromLg: r,
|
|
23
|
+
fromXl: a,
|
|
24
|
+
from2Xl: h,
|
|
25
|
+
isMobile: !m,
|
|
26
|
+
isTablet: m && !r,
|
|
27
|
+
isDesktop: r
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
S as useResponsive
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useStore as r } from "zustand";
|
|
2
|
+
const h = () => {
|
|
3
|
+
const { sharedData: e, api: o, i18n: s, router: a, helpers: n, stores: t } = window.__creopse__, i = r(
|
|
4
|
+
t.auth
|
|
5
|
+
), u = r(
|
|
6
|
+
t.server
|
|
7
|
+
), p = r(t.ui);
|
|
8
|
+
return {
|
|
9
|
+
locale: e?.locale,
|
|
10
|
+
env: e?.env,
|
|
11
|
+
appConfig: e?.appConfig,
|
|
12
|
+
api: o,
|
|
13
|
+
i18n: s,
|
|
14
|
+
router: a,
|
|
15
|
+
helpers: n,
|
|
16
|
+
auth: i,
|
|
17
|
+
server: u,
|
|
18
|
+
ui: p
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
h as useCoreBridge
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Bool as e } from "@creopse/utils/enums";
|
|
2
|
+
import { useState as l, useEffect as f } from "react";
|
|
3
|
+
const a = () => {
|
|
4
|
+
const [o, t] = l({
|
|
5
|
+
inAppNotifEnabled: e.TRUE,
|
|
6
|
+
emailNotifEnabled: e.TRUE,
|
|
7
|
+
locale: window.__creopse__.i18n.getLocale()
|
|
8
|
+
});
|
|
9
|
+
return f(() => {
|
|
10
|
+
t((r) => ({
|
|
11
|
+
...r,
|
|
12
|
+
locale: window.__creopse__.i18n.getLocale()
|
|
13
|
+
}));
|
|
14
|
+
}, []), { defaultPrefs: o };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
a as useUserPreference
|
|
18
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Icon as t } from "@iconify/react";
|
|
4
|
+
import { useResponsive as h } from "./bridge11.js";
|
|
5
|
+
const p = ({
|
|
6
|
+
title: r,
|
|
7
|
+
extra: n,
|
|
8
|
+
header: a,
|
|
9
|
+
onBack: l,
|
|
10
|
+
children: i
|
|
11
|
+
}) => /* @__PURE__ */ d("div", { className: "n-page-header", children: [
|
|
12
|
+
a && /* @__PURE__ */ e("div", { className: "n-page-header__header", children: a }),
|
|
13
|
+
/* @__PURE__ */ d("div", { className: "n-page-header__content-header", children: [
|
|
14
|
+
/* @__PURE__ */ e("div", { className: "n-page-header__back", onClick: l, role: "button", "aria-label": "Go back", children: /* @__PURE__ */ e("div", { className: "n-page-header-back", children: /* @__PURE__ */ e(t, { icon: "ic:baseline-arrow-back-ios" }) }) }),
|
|
15
|
+
r && /* @__PURE__ */ e("div", { className: "n-page-header__title", children: r }),
|
|
16
|
+
n && /* @__PURE__ */ e("div", { className: "n-page-header__extra", children: n })
|
|
17
|
+
] }),
|
|
18
|
+
i && /* @__PURE__ */ e("div", { className: "n-page-header__content", children: i })
|
|
19
|
+
] }), g = ({
|
|
20
|
+
title: r = null,
|
|
21
|
+
displayTitle: n = !0,
|
|
22
|
+
onBack: a = null,
|
|
23
|
+
header: l,
|
|
24
|
+
headerExtra: i,
|
|
25
|
+
titleSlot: c,
|
|
26
|
+
children: s
|
|
27
|
+
}) => {
|
|
28
|
+
const { isMobile: o } = h();
|
|
29
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
p,
|
|
32
|
+
{
|
|
33
|
+
header: l,
|
|
34
|
+
title: n ? c ?? /* @__PURE__ */ e(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
style: {
|
|
38
|
+
display: "-webkit-box",
|
|
39
|
+
WebkitLineClamp: 2,
|
|
40
|
+
WebkitBoxOrient: "vertical",
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
wordBreak: "break-word"
|
|
43
|
+
},
|
|
44
|
+
children: r || ""
|
|
45
|
+
}
|
|
46
|
+
) : void 0,
|
|
47
|
+
extra: i ? /* @__PURE__ */ e(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: o ? "flex flex-col items-end gap-2" : "flex items-center gap-2",
|
|
51
|
+
children: i
|
|
52
|
+
}
|
|
53
|
+
) : void 0,
|
|
54
|
+
onBack: () => {
|
|
55
|
+
a ? a() : window.__creopse__.router.back();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
s
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
p as PageHeader,
|
|
64
|
+
g as PageLayout,
|
|
65
|
+
g as default
|
|
66
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useEffect as u } from "react";
|
|
3
|
+
const y = ({
|
|
4
|
+
load: r,
|
|
5
|
+
alt: o,
|
|
6
|
+
width: e,
|
|
7
|
+
height: s,
|
|
8
|
+
title: c,
|
|
9
|
+
loading: a,
|
|
10
|
+
style: i
|
|
11
|
+
}) => {
|
|
12
|
+
const [n, l] = f("");
|
|
13
|
+
return u(() => {
|
|
14
|
+
(async () => {
|
|
15
|
+
try {
|
|
16
|
+
const t = await r();
|
|
17
|
+
l(t);
|
|
18
|
+
} catch (t) {
|
|
19
|
+
console.error("Failed to load image:", t);
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
}, [r]), /* @__PURE__ */ m(
|
|
23
|
+
"img",
|
|
24
|
+
{
|
|
25
|
+
src: n,
|
|
26
|
+
alt: o,
|
|
27
|
+
title: c,
|
|
28
|
+
style: i,
|
|
29
|
+
width: e,
|
|
30
|
+
height: s,
|
|
31
|
+
loading: a
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
y as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import p from "./bridge3.js";
|
|
4
|
+
import { useCoreBridge as d } from "./bridge12.js";
|
|
5
|
+
const x = (o) => {
|
|
6
|
+
const { src: t, alt: i = "", width: s, height: m, title: l, loading: n, style: a, size: g = "original", sync: c = !1 } = o, {
|
|
7
|
+
helpers: { getImage: f }
|
|
8
|
+
} = d(), e = {
|
|
9
|
+
alt: i,
|
|
10
|
+
width: s,
|
|
11
|
+
height: m,
|
|
12
|
+
title: l,
|
|
13
|
+
loading: n,
|
|
14
|
+
style: a
|
|
15
|
+
};
|
|
16
|
+
return c ? /* @__PURE__ */ r("img", { src: t, ...e }) : /* @__PURE__ */ r(p, { load: () => f(t, g), ...e });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
x as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as v, useState as c, useEffect as x } from "react";
|
|
3
|
+
const y = ({
|
|
4
|
+
top: n = 0,
|
|
5
|
+
zIndex: u = 1,
|
|
6
|
+
className: f = "",
|
|
7
|
+
children: g = /* @__PURE__ */ s("div", { children: "Sticky Top" })
|
|
8
|
+
}) => {
|
|
9
|
+
const e = v(null), [t, d] = c(!1), [p, l] = c("auto"), [w, r] = c("auto");
|
|
10
|
+
return x(() => {
|
|
11
|
+
const o = () => {
|
|
12
|
+
if (!e.current) return;
|
|
13
|
+
const i = e.current.getBoundingClientRect(), a = i.top <= n;
|
|
14
|
+
a && !t ? (l(i.width + "px"), r(i.height + "px"), d(!0)) : !a && t && (d(!1), l("auto"));
|
|
15
|
+
}, h = () => {
|
|
16
|
+
if (!t && e.current) {
|
|
17
|
+
const i = e.current.getBoundingClientRect();
|
|
18
|
+
r(i.height + "px");
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
if (e.current) {
|
|
22
|
+
const i = e.current.getBoundingClientRect();
|
|
23
|
+
r(i.height + "px");
|
|
24
|
+
}
|
|
25
|
+
return window.addEventListener("scroll", o), window.addEventListener("resize", h), o(), () => {
|
|
26
|
+
window.removeEventListener("scroll", o), window.removeEventListener("resize", h);
|
|
27
|
+
};
|
|
28
|
+
}, [n, t]), /* @__PURE__ */ s(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
ref: e,
|
|
32
|
+
style: {
|
|
33
|
+
height: t ? w : "auto",
|
|
34
|
+
zIndex: u
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ s(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: f,
|
|
40
|
+
style: {
|
|
41
|
+
position: t ? "fixed" : "static",
|
|
42
|
+
top: t ? `${n}px` : "auto",
|
|
43
|
+
width: t ? p : "auto",
|
|
44
|
+
zIndex: u
|
|
45
|
+
},
|
|
46
|
+
children: g
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
y as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useState as c, useEffect as x } from "react";
|
|
3
|
+
const R = ({
|
|
4
|
+
bottom: n = 0,
|
|
5
|
+
zIndex: d = 1,
|
|
6
|
+
className: f = "",
|
|
7
|
+
children: g = /* @__PURE__ */ s("div", { children: "Sticky Bottom" })
|
|
8
|
+
}) => {
|
|
9
|
+
const e = m(null), [t, u] = c(!1), [w, l] = c("auto"), [p, o] = c("auto");
|
|
10
|
+
return x(() => {
|
|
11
|
+
const r = () => {
|
|
12
|
+
if (!e.current) return;
|
|
13
|
+
const i = e.current.getBoundingClientRect(), v = window.innerHeight, a = i.bottom <= v - n;
|
|
14
|
+
a && !t ? (l(i.width + "px"), o(i.height + "px"), u(!0)) : !a && t && (u(!1), l("auto"));
|
|
15
|
+
}, h = () => {
|
|
16
|
+
if (!t && e.current) {
|
|
17
|
+
const i = e.current.getBoundingClientRect();
|
|
18
|
+
o(i.height + "px");
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
if (e.current) {
|
|
22
|
+
const i = e.current.getBoundingClientRect();
|
|
23
|
+
o(i.height + "px");
|
|
24
|
+
}
|
|
25
|
+
return window.addEventListener("scroll", r), window.addEventListener("resize", h), r(), () => {
|
|
26
|
+
window.removeEventListener("scroll", r), window.removeEventListener("resize", h);
|
|
27
|
+
};
|
|
28
|
+
}, [n, t]), /* @__PURE__ */ s(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
ref: e,
|
|
32
|
+
style: {
|
|
33
|
+
height: t ? p : "auto",
|
|
34
|
+
zIndex: d
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ s(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: f,
|
|
40
|
+
style: {
|
|
41
|
+
position: t ? "fixed" : "static",
|
|
42
|
+
bottom: t ? `${n}px` : "auto",
|
|
43
|
+
width: t ? w : "auto",
|
|
44
|
+
zIndex: d
|
|
45
|
+
},
|
|
46
|
+
children: g
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
R as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { AnimatePresence as l, motion as s } from "framer-motion";
|
|
4
|
+
const u = ({
|
|
5
|
+
name: a = "fade",
|
|
6
|
+
mode: n = "wait",
|
|
7
|
+
appear: e = !1,
|
|
8
|
+
children: o,
|
|
9
|
+
contentKey: r = "default"
|
|
10
|
+
}) => {
|
|
11
|
+
const i = {
|
|
12
|
+
fade: {
|
|
13
|
+
initial: { opacity: 0 },
|
|
14
|
+
animate: { opacity: 1 },
|
|
15
|
+
exit: { opacity: 0 },
|
|
16
|
+
transition: { duration: 0.5, ease: "easeInOut" }
|
|
17
|
+
},
|
|
18
|
+
"slide-fade": {
|
|
19
|
+
initial: { opacity: 0, x: 20 },
|
|
20
|
+
animate: { opacity: 1, x: 0 },
|
|
21
|
+
exit: { opacity: 0, x: 20 },
|
|
22
|
+
transition: {
|
|
23
|
+
duration: 0.3,
|
|
24
|
+
ease: "easeOut"
|
|
25
|
+
},
|
|
26
|
+
// Separate exit transition
|
|
27
|
+
exitTransition: {
|
|
28
|
+
duration: 0.8,
|
|
29
|
+
ease: [0.36, 0.66, 0.04, 1]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
bounce: {
|
|
33
|
+
initial: { scale: 0 },
|
|
34
|
+
animate: { scale: 1 },
|
|
35
|
+
exit: { scale: 0 },
|
|
36
|
+
transition: {
|
|
37
|
+
duration: 0.5,
|
|
38
|
+
type: "spring",
|
|
39
|
+
bounce: 0.4
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}[a];
|
|
43
|
+
return n ? /* @__PURE__ */ t(l, { mode: n, initial: e, children: /* @__PURE__ */ t(
|
|
44
|
+
s.div,
|
|
45
|
+
{
|
|
46
|
+
initial: i.initial,
|
|
47
|
+
animate: i.animate,
|
|
48
|
+
exit: i.exit,
|
|
49
|
+
transition: i.transition,
|
|
50
|
+
...a === "slide-fade" && {
|
|
51
|
+
exit: i.exit,
|
|
52
|
+
// @ts-expect-error - exitTransition is a custom property we added
|
|
53
|
+
transition: { ...i.transition, exit: i.exitTransition }
|
|
54
|
+
},
|
|
55
|
+
children: o
|
|
56
|
+
},
|
|
57
|
+
r
|
|
58
|
+
) }) : /* @__PURE__ */ t(
|
|
59
|
+
s.div,
|
|
60
|
+
{
|
|
61
|
+
initial: e ? i.initial : !1,
|
|
62
|
+
animate: i.animate,
|
|
63
|
+
transition: i.transition,
|
|
64
|
+
children: o
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
u as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as i, jsx as l, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
const D = ({
|
|
4
|
+
moreStr: u = "Read more",
|
|
5
|
+
lessStr: a = "Read less",
|
|
6
|
+
link: d = "#",
|
|
7
|
+
maxChars: r = 100,
|
|
8
|
+
text: n,
|
|
9
|
+
className: c = "",
|
|
10
|
+
linkClassName: s = ""
|
|
11
|
+
}) => {
|
|
12
|
+
const [t, o] = m(!1), h = () => !t && n.length > r ? n.substring(0, r).trim() + "..." : n, f = (e) => {
|
|
13
|
+
e.preventDefault(), o(!t);
|
|
14
|
+
};
|
|
15
|
+
if (!n)
|
|
16
|
+
return null;
|
|
17
|
+
const p = n.length > r;
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: c, children: [
|
|
19
|
+
/* @__PURE__ */ l("span", { children: h() }),
|
|
20
|
+
p && /* @__PURE__ */ i(g, { children: [
|
|
21
|
+
" ",
|
|
22
|
+
t ? a && /* @__PURE__ */ l(
|
|
23
|
+
"a",
|
|
24
|
+
{
|
|
25
|
+
href: d,
|
|
26
|
+
onClick: f,
|
|
27
|
+
className: s,
|
|
28
|
+
role: "button",
|
|
29
|
+
tabIndex: 0,
|
|
30
|
+
onKeyDown: (e) => {
|
|
31
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(!1));
|
|
32
|
+
},
|
|
33
|
+
children: a
|
|
34
|
+
}
|
|
35
|
+
) : /* @__PURE__ */ l(
|
|
36
|
+
"a",
|
|
37
|
+
{
|
|
38
|
+
href: d,
|
|
39
|
+
onClick: f,
|
|
40
|
+
className: s,
|
|
41
|
+
role: "button",
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
onKeyDown: (e) => {
|
|
44
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(!0));
|
|
45
|
+
},
|
|
46
|
+
children: u
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] })
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
D as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState as s, useEffect as f } from "react";
|
|
2
|
+
import { createPortal as c } from "react-dom";
|
|
3
|
+
const p = ({
|
|
4
|
+
to: e,
|
|
5
|
+
children: a,
|
|
6
|
+
disabled: n = !1
|
|
7
|
+
}) => {
|
|
8
|
+
const [l, o] = s(!1), [u, t] = s(null);
|
|
9
|
+
return f(() => (o(!0), () => {
|
|
10
|
+
o(!1);
|
|
11
|
+
}), []), f(() => {
|
|
12
|
+
if (!l || n) {
|
|
13
|
+
t(null);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
let r = null;
|
|
17
|
+
if (typeof e == "string") {
|
|
18
|
+
if (r = document.querySelector(e), !r) {
|
|
19
|
+
console.warn(
|
|
20
|
+
`MountedTeleport: Target element not found for selector "${e}"`
|
|
21
|
+
), t(null);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
} else if (e instanceof HTMLElement)
|
|
25
|
+
r = e;
|
|
26
|
+
else {
|
|
27
|
+
console.warn(
|
|
28
|
+
"MountedTeleport: Invalid target type. Expected string selector or HTMLElement."
|
|
29
|
+
), t(null);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
t(r);
|
|
33
|
+
}, [e, l, n]), !l || n || !u ? null : c(a, u);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
p as default
|
|
37
|
+
};
|
package/dist/vite/index.js
CHANGED