wimui 0.23.13 → 0.23.14
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/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +136 -106
- package/dist/components/feedback/Tour/tour.module.cjs +1 -1
- package/dist/components/feedback/Tour/tour.module.js +1 -1
- package/dist/components/layout/Footer/Footer.cjs +1 -1
- package/dist/components/layout/Footer/Footer.js +1 -1
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/i18n/generated/resources.cjs +1 -1
- package/dist/i18n/generated/resources.js +12 -0
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +3 -0
- package/dist/locales/ja/common.json +3 -0
- package/dist/locales/pt/common.json +3 -0
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../overlay/Portal/Portal.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../overlay/Portal/Portal.cjs"),r=require("../../form/Button/Button.cjs"),i=require("./tour.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=16;function l(e){let t=getComputedStyle(e);return`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`}async function u(e){let t=document.fonts;if(!(!t||typeof t.load!=`function`)){try{await t.load(l(e))}catch{}for(;t.status===`loading`;)await new Promise(e=>{t.addEventListener(`loadingdone`,()=>e(),{once:!0})})}}function d(e){let t=document.fonts;return!t||typeof t.load!=`function`?!1:t.status===`loading`?!0:typeof t.check==`function`&&!t.check(l(e))}function f(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.width)===Math.round(t.width)&&Math.round(e.height)===Math.round(t.height)}function p(e){return e.top>=c&&e.bottom<=window.innerHeight-c&&e.left>=c&&e.right<=window.innerWidth-c}var m=({steps:e,open:c,onClose:l,onFinish:m})=>{let{t:h}=t.useWimTranslation(`common`),[g,_]=(0,a.useState)(0),[v,y]=(0,a.useState)(null),b=e[g],x=b?.target;if((0,a.useLayoutEffect)(()=>{if(!c||!x){y(null);return}let e=!1,t=t=>{e||y(e=>t?e&&f(e,t)?e:t:null)},n=()=>{let e=document.querySelector(x);if(!e){t(null);return}p(e.getBoundingClientRect())||e.scrollIntoView({block:`center`,inline:`nearest`}),t(e.getBoundingClientRect())},r=()=>{let e=document.querySelector(x);t(e?e.getBoundingClientRect():null)},i=()=>{window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0)},a=async()=>{let t=document.querySelector(x);t&&await u(t),!e&&(n(),i())},o=document.querySelector(x);return o&&d(o)?a():(n(),i()),()=>{e=!0,window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0)}},[c,g,x]),!c||!b)return null;let S=()=>{g<e.length-1?_(g+1):(m?m():l(),_(0))},C=()=>{g>0&&_(g-1)},w={},T=b.placement||`bottom`;if(v){let e=window.innerWidth,t=Math.min(300,e-32),n=T;if(e<640&&(n===`left`||n===`right`)&&(n=`bottom`),T=n,n===`top`||n===`bottom`){let r=v.left+v.width/2,i=t/2+16,a=e-t/2-16;r=i>a?e/2:Math.max(i,Math.min(a,r)),w.left=r,n===`top`?(w.top=v.top-12,w.transform=`translate(-50%, -100%)`):(w.top=v.bottom+12,w.transform=`translateX(-50%)`)}else n===`left`?(w.left=v.left-12,w.top=v.top+v.height/2,w.transform=`translate(-100%, -50%)`):n===`right`&&(w.left=v.right+12,w.top=v.top+v.height/2,w.transform=`translateY(-50%)`)}return(0,s.jsxs)(n.Portal,{children:[(0,s.jsx)(`div`,{className:i.default.mask,onClick:l,role:`button`,tabIndex:0,"aria-label":h(`a11y.close_tour`),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&l()}}),v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{className:i.default.highlight,style:{top:v.top-4,left:v.left-4,width:v.width+8,height:v.height+8}}),(0,s.jsx)(`div`,{className:(0,o.default)(`wim-tour`,i.default.bubble),"data-placement":T,style:w,children:(0,s.jsxs)(`div`,{className:i.default.inner,children:[(0,s.jsx)(`h3`,{className:i.default.title,children:b.title}),(0,s.jsx)(`p`,{className:i.default.description,children:b.description}),(0,s.jsxs)(`div`,{className:i.default.footer,children:[(0,s.jsxs)(`span`,{className:i.default.progress,children:[g+1,` / `,e.length]}),(0,s.jsxs)(`div`,{className:i.default.buttons,children:[g>0&&(0,s.jsx)(r.Button,{size:`sm`,variant:`outline`,onClick:C,children:h(`action.back`)}),(0,s.jsx)(r.Button,{size:`sm`,variant:`solid`,onClick:S,children:g===e.length-1?h(`action.finish`):h(`action.next`)})]})]})]})})]})]})};exports.Tour=m;
|
|
@@ -1,115 +1,145 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import n from "
|
|
5
|
-
import
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { Portal as t } from "../../overlay/Portal/Portal.js";
|
|
4
|
+
import { Button as n } from "../../form/Button/Button.js";
|
|
5
|
+
import r from "./tour.module.js";
|
|
6
|
+
import { useLayoutEffect as i, useState as a } from "react";
|
|
7
|
+
import o from "classnames";
|
|
8
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/feedback/Tour/Tour.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
var u = 16;
|
|
11
|
+
function d(e) {
|
|
12
|
+
let t = getComputedStyle(e);
|
|
13
|
+
return `${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;
|
|
14
|
+
}
|
|
15
|
+
async function f(e) {
|
|
16
|
+
let t = document.fonts;
|
|
17
|
+
if (!(!t || typeof t.load != "function")) {
|
|
18
|
+
try {
|
|
19
|
+
await t.load(d(e));
|
|
20
|
+
} catch {}
|
|
21
|
+
for (; t.status === "loading";) await new Promise((e) => {
|
|
22
|
+
t.addEventListener("loadingdone", () => e(), { once: !0 });
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function p(e) {
|
|
27
|
+
let t = document.fonts;
|
|
28
|
+
return !t || typeof t.load != "function" ? !1 : t.status === "loading" ? !0 : typeof t.check == "function" && !t.check(d(e));
|
|
29
|
+
}
|
|
30
|
+
function m(e, t) {
|
|
31
|
+
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.width) === Math.round(t.width) && Math.round(e.height) === Math.round(t.height);
|
|
32
|
+
}
|
|
33
|
+
function h(e) {
|
|
34
|
+
return e.top >= u && e.bottom <= window.innerHeight - u && e.left >= u && e.right <= window.innerWidth - u;
|
|
35
|
+
}
|
|
36
|
+
var g = ({ steps: u, open: d, onClose: g, onFinish: _ }) => {
|
|
37
|
+
let { t: v } = e("common"), [y, b] = a(0), [x, S] = a(null), C = u[y], w = C?.target;
|
|
38
|
+
if (i(() => {
|
|
39
|
+
if (!d || !w) {
|
|
40
|
+
S(null);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
let e = !1, t = (t) => {
|
|
44
|
+
e || S((e) => t ? e && m(e, t) ? e : t : null);
|
|
45
|
+
}, n = () => {
|
|
46
|
+
let e = document.querySelector(w);
|
|
47
|
+
if (!e) {
|
|
48
|
+
t(null);
|
|
49
|
+
return;
|
|
33
50
|
}
|
|
51
|
+
h(e.getBoundingClientRect()) || e.scrollIntoView({
|
|
52
|
+
block: "center",
|
|
53
|
+
inline: "nearest"
|
|
54
|
+
}), t(e.getBoundingClientRect());
|
|
55
|
+
}, r = () => {
|
|
56
|
+
let e = document.querySelector(w);
|
|
57
|
+
t(e ? e.getBoundingClientRect() : null);
|
|
58
|
+
}, i = () => {
|
|
59
|
+
window.addEventListener("resize", r), window.addEventListener("scroll", r, !0);
|
|
60
|
+
}, a = async () => {
|
|
61
|
+
let t = document.querySelector(w);
|
|
62
|
+
t && await f(t), !e && (n(), i());
|
|
63
|
+
}, o = document.querySelector(w);
|
|
64
|
+
return o && p(o) ? a() : (n(), i()), () => {
|
|
65
|
+
e = !0, window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
34
66
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
r =
|
|
49
|
-
|
|
67
|
+
}, [
|
|
68
|
+
d,
|
|
69
|
+
y,
|
|
70
|
+
w
|
|
71
|
+
]), !d || !C) return null;
|
|
72
|
+
let T = () => {
|
|
73
|
+
y < u.length - 1 ? b(y + 1) : (_ ? _() : g(), b(0));
|
|
74
|
+
}, E = () => {
|
|
75
|
+
y > 0 && b(y - 1);
|
|
76
|
+
}, D = {}, O = C.placement || "bottom";
|
|
77
|
+
if (x) {
|
|
78
|
+
let e = window.innerWidth, t = Math.min(300, e - 32), n = O;
|
|
79
|
+
if (e < 640 && (n === "left" || n === "right") && (n = "bottom"), O = n, n === "top" || n === "bottom") {
|
|
80
|
+
let r = x.left + x.width / 2, i = t / 2 + 16, a = e - t / 2 - 16;
|
|
81
|
+
r = i > a ? e / 2 : Math.max(i, Math.min(a, r)), D.left = r, n === "top" ? (D.top = x.top - 12, D.transform = "translate(-50%, -100%)") : (D.top = x.bottom + 12, D.transform = "translateX(-50%)");
|
|
82
|
+
} else n === "left" ? (D.left = x.left - 12, D.top = x.top + x.height / 2, D.transform = "translate(-100%, -50%)") : n === "right" && (D.left = x.right + 12, D.top = x.top + x.height / 2, D.transform = "translateY(-50%)");
|
|
50
83
|
}
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
children:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
className:
|
|
87
|
-
children: [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onClick: _,
|
|
105
|
-
children: f === c.length - 1 ? "Finish" : "Next"
|
|
106
|
-
})]
|
|
84
|
+
return /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("div", {
|
|
85
|
+
className: r.mask,
|
|
86
|
+
onClick: g,
|
|
87
|
+
role: "button",
|
|
88
|
+
tabIndex: 0,
|
|
89
|
+
"aria-label": v("a11y.close_tour"),
|
|
90
|
+
onKeyDown: (e) => {
|
|
91
|
+
(e.key === "Enter" || e.key === " ") && g();
|
|
92
|
+
}
|
|
93
|
+
}), x && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
94
|
+
className: r.highlight,
|
|
95
|
+
style: {
|
|
96
|
+
top: x.top - 4,
|
|
97
|
+
left: x.left - 4,
|
|
98
|
+
width: x.width + 8,
|
|
99
|
+
height: x.height + 8
|
|
100
|
+
}
|
|
101
|
+
}), /* @__PURE__ */ c("div", {
|
|
102
|
+
className: o("wim-tour", r.bubble),
|
|
103
|
+
"data-placement": O,
|
|
104
|
+
style: D,
|
|
105
|
+
children: /* @__PURE__ */ l("div", {
|
|
106
|
+
className: r.inner,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ c("h3", {
|
|
109
|
+
className: r.title,
|
|
110
|
+
children: C.title
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ c("p", {
|
|
113
|
+
className: r.description,
|
|
114
|
+
children: C.description
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ l("div", {
|
|
117
|
+
className: r.footer,
|
|
118
|
+
children: [/* @__PURE__ */ l("span", {
|
|
119
|
+
className: r.progress,
|
|
120
|
+
children: [
|
|
121
|
+
y + 1,
|
|
122
|
+
" / ",
|
|
123
|
+
u.length
|
|
124
|
+
]
|
|
125
|
+
}), /* @__PURE__ */ l("div", {
|
|
126
|
+
className: r.buttons,
|
|
127
|
+
children: [y > 0 && /* @__PURE__ */ c(n, {
|
|
128
|
+
size: "sm",
|
|
129
|
+
variant: "outline",
|
|
130
|
+
onClick: E,
|
|
131
|
+
children: v("action.back")
|
|
132
|
+
}), /* @__PURE__ */ c(n, {
|
|
133
|
+
size: "sm",
|
|
134
|
+
variant: "solid",
|
|
135
|
+
onClick: T,
|
|
136
|
+
children: y === u.length - 1 ? v("action.finish") : v("action.next")
|
|
107
137
|
})]
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
]
|
|
111
141
|
})
|
|
112
|
-
] });
|
|
142
|
+
})] })] });
|
|
113
143
|
};
|
|
114
144
|
//#endregion
|
|
115
|
-
export {
|
|
145
|
+
export { g as Tour };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_mask_v8tqh_3`,t=`_highlight_v8tqh_9`,n=`_bubble_v8tqh_17`,r=`_inner_v8tqh_27`,i=`_title_v8tqh_30`,a=`_description_v8tqh_35`,o=`_footer_v8tqh_40`,s=`_progress_v8tqh_45`,c=`_buttons_v8tqh_49`,l={mask:e,highlight:t,bubble:n,inner:r,title:i,description:a,footer:o,progress:s,buttons:c};exports.bubble=n,exports.buttons=c,exports.default=l,exports.description=a,exports.footer=o,exports.highlight=t,exports.inner=r,exports.mask=e,exports.progress=s,exports.title=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Tour/tour.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_mask_v8tqh_3", t = "_highlight_v8tqh_9", n = "_bubble_v8tqh_17", r = "_inner_v8tqh_27", i = "_title_v8tqh_30", a = "_description_v8tqh_35", o = "_footer_v8tqh_40", s = "_progress_v8tqh_45", c = "_buttons_v8tqh_49", l = {
|
|
4
4
|
mask: e,
|
|
5
5
|
highlight: t,
|
|
6
6
|
bubble: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./footer.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=n.default.forwardRef(({className:e,children:n,bordered:a,fluid:o,background:s=`surface`,...c},l)=>(0,i.jsx)(`footer`,{ref:l,className:(0,r.default)(`wim-footer`,t.default.root,a&&t.default.bordered,s&&t.default[`bg-${s}`],e),"data-bordered":a,...c,children:(0,i.jsx)(`div`,{className:(0,r.default)(t.default.container,o&&t.default.fluid),children:n})}));a.displayName=`Footer`;var o=n.default.forwardRef(({className:e,children:n,title:a,...o},s)=>(0,i.jsxs)(`div`,{ref:s,className:(0,r.default)(t.default.section,e),...o,children:[a&&(0,i.jsx)(`
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./footer.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=n.default.forwardRef(({className:e,children:n,bordered:a,fluid:o,background:s=`surface`,...c},l)=>(0,i.jsx)(`footer`,{ref:l,className:(0,r.default)(`wim-footer`,t.default.root,a&&t.default.bordered,s&&t.default[`bg-${s}`],e),"data-bordered":a,...c,children:(0,i.jsx)(`div`,{className:(0,r.default)(t.default.container,o&&t.default.fluid),children:n})}));a.displayName=`Footer`;var o=n.default.forwardRef(({className:e,children:n,title:a,...o},s)=>(0,i.jsxs)(`div`,{ref:s,className:(0,r.default)(t.default.section,e),...o,children:[a&&(0,i.jsx)(`p`,{className:t.default.sectionTitle,children:a}),(0,i.jsx)(`div`,{className:t.default.sectionContent,children:n})]}));o.displayName=`Footer.Section`;var s=n.default.forwardRef(({className:e,children:n,...a},o)=>(0,i.jsx)(`div`,{ref:o,className:(0,r.default)(t.default.bottom,e),...a,children:n}));s.displayName=`Footer.Bottom`;var c=Object.assign(a,{Section:o,Bottom:s});exports.Footer=c,exports.default=c,exports.FooterBottom=s,exports.FooterSection=o;
|
|
@@ -19,7 +19,7 @@ var o = t.forwardRef(({ className: t, children: a, title: o, ...s }, c) => /* @_
|
|
|
19
19
|
ref: c,
|
|
20
20
|
className: n(e.section, t),
|
|
21
21
|
...s,
|
|
22
|
-
children: [o && /* @__PURE__ */ r("
|
|
22
|
+
children: [o && /* @__PURE__ */ r("p", {
|
|
23
23
|
className: e.sectionTitle,
|
|
24
24
|
children: o
|
|
25
25
|
}), /* @__PURE__ */ r("div", {
|