wimui 0.15.0 → 0.16.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/NOTICE +85 -0
- package/README.ja.md +2 -0
- package/README.md +2 -0
- package/dist/components/_internal/FeedbackIcon.cjs +1 -1
- package/dist/components/_internal/FeedbackIcon.js +17 -16
- package/dist/components/ai/ChatUI/chat-ui.module.cjs +1 -1
- package/dist/components/ai/ChatUI/chat-ui.module.js +2 -2
- package/dist/components/ai/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/Terminal/Terminal.cjs +1 -1
- package/dist/components/ai/Terminal/Terminal.js +1 -1
- package/dist/components/data-display/Card/card.module.cjs +1 -1
- package/dist/components/data-display/Card/card.module.js +15 -15
- package/dist/components/data-display/Stats/Stats.cjs +1 -1
- package/dist/components/data-display/Stats/Stats.js +46 -38
- package/dist/components/data-display/Timeline/timeline.module.cjs +1 -1
- package/dist/components/data-display/Timeline/timeline.module.js +6 -6
- package/dist/components/form/Cascader/cascader.module.cjs +1 -1
- package/dist/components/form/Cascader/cascader.module.js +6 -6
- package/dist/components/form/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.js +248 -421
- package/dist/components/form/SignaturePad/signature-pad.module.cjs +1 -1
- package/dist/components/form/SignaturePad/signature-pad.module.js +6 -6
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/form/TreeSelect/tree-select.module.cjs +1 -1
- package/dist/components/form/TreeSelect/tree-select.module.js +6 -6
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +1 -1
- package/dist/components/layout/Transition/Transition.cjs +1 -1
- package/dist/components/layout/Transition/Transition.js +24 -46
- package/dist/components/media/Gallery/Gallery.cjs +1 -1
- package/dist/components/media/Gallery/Gallery.js +1 -1
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.d.ts +4 -0
- package/dist/components/media/Lightbox/Lightbox.js +23 -22
- package/dist/components/navigation/TabBar/TabBar.d.ts +12 -1
- package/dist/components/navigation/TabBar/tab-bar.module.cjs +1 -1
- package/dist/components/navigation/TabBar/tab-bar.module.js +1 -1
- package/dist/components/overlay/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/overlay/BottomSheet/BottomSheet.js +1 -8
- package/dist/components/overlay/BottomSheet/bottom-sheet.module.cjs +1 -1
- package/dist/components/overlay/BottomSheet/bottom-sheet.module.js +8 -10
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +2 -3
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/i18n/generated/resources.cjs +1 -1
- package/dist/i18n/generated/resources.js +9 -3
- package/dist/icon/alert-triangle.cjs +2 -0
- package/dist/icon/alert-triangle.js +31 -0
- package/dist/icon/align-justify.cjs +1 -1
- package/dist/icon/align-justify.js +14 -8
- package/dist/icon/arrow-down.cjs +2 -0
- package/dist/icon/arrow-down.js +22 -0
- package/dist/icon/arrow-left.cjs +2 -0
- package/dist/icon/arrow-left.js +22 -0
- package/dist/icon/arrow-right.cjs +2 -0
- package/dist/icon/arrow-right.js +22 -0
- package/dist/icon/arrow-up.cjs +2 -0
- package/dist/icon/arrow-up.js +22 -0
- package/dist/icon/bell.cjs +1 -1
- package/dist/icon/bell.js +0 -2
- package/dist/icon/bold.cjs +2 -0
- package/dist/icon/bold.js +17 -0
- package/dist/icon/chart.cjs +1 -1
- package/dist/icon/chart.js +0 -2
- package/dist/icon/close-small.cjs +1 -1
- package/dist/icon/close-small.js +21 -11
- package/dist/icon/columns.cjs +1 -1
- package/dist/icon/columns.js +5 -17
- package/dist/icon/credit-card.cjs +1 -1
- package/dist/icon/credit-card.js +0 -2
- package/dist/icon/document.cjs +1 -1
- package/dist/icon/document.js +1 -6
- package/dist/icon/eraser.cjs +2 -0
- package/dist/icon/eraser.js +17 -0
- package/dist/icon/external-link.cjs +1 -1
- package/dist/icon/external-link.js +0 -2
- package/dist/icon/grid.cjs +1 -1
- package/dist/icon/grid.js +36 -36
- package/dist/icon/grip-vertical.cjs +1 -1
- package/dist/icon/grip-vertical.js +0 -2
- package/dist/icon/home.cjs +1 -1
- package/dist/icon/home.js +1 -3
- package/dist/icon/hourglass.cjs +1 -1
- package/dist/icon/hourglass.js +6 -1
- package/dist/icon/index.cjs +1 -1
- package/dist/icon/index.d.ts +29 -1
- package/dist/icon/index.js +176 -148
- package/dist/icon/italic.cjs +2 -0
- package/dist/icon/italic.js +36 -0
- package/dist/icon/link.cjs +2 -0
- package/dist/icon/link.js +17 -0
- package/dist/icon/list-ordered.cjs +2 -0
- package/dist/icon/list-ordered.js +24 -0
- package/dist/icon/list.cjs +2 -0
- package/dist/icon/list.js +54 -0
- package/dist/icon/loading.cjs +1 -1
- package/dist/icon/loading.js +7 -16
- package/dist/icon/maximize.cjs +1 -1
- package/dist/icon/maximize.js +2 -4
- package/dist/icon/menu.cjs +1 -1
- package/dist/icon/menu.js +4 -4
- package/dist/icon/minimize.cjs +1 -1
- package/dist/icon/minimize.js +0 -2
- package/dist/icon/paperclip.cjs +1 -1
- package/dist/icon/paperclip.js +1 -3
- package/dist/icon/phone.cjs +1 -1
- package/dist/icon/phone.js +1 -1
- package/dist/icon/pip.cjs +1 -1
- package/dist/icon/pip.js +15 -31
- package/dist/icon/project.cjs +1 -1
- package/dist/icon/project.js +1 -3
- package/dist/icon/repeat.cjs +1 -1
- package/dist/icon/repeat.js +4 -6
- package/dist/icon/send.cjs +1 -1
- package/dist/icon/send.js +6 -3
- package/dist/icon/settings.cjs +1 -1
- package/dist/icon/settings.js +2 -4
- package/dist/icon/shuffle.cjs +1 -1
- package/dist/icon/shuffle.js +0 -2
- package/dist/icon/skip-back.cjs +1 -1
- package/dist/icon/skip-back.js +0 -2
- package/dist/icon/skip-forward.cjs +1 -1
- package/dist/icon/skip-forward.js +1 -3
- package/dist/icon/square.cjs +1 -1
- package/dist/icon/square.js +13 -9
- package/dist/icon/star.cjs +1 -1
- package/dist/icon/star.js +0 -2
- package/dist/icon/strikethrough.cjs +2 -0
- package/dist/icon/strikethrough.js +26 -0
- package/dist/icon/thumb-down.cjs +1 -1
- package/dist/icon/thumb-down.js +1 -1
- package/dist/icon/underline.cjs +2 -0
- package/dist/icon/underline.js +22 -0
- package/dist/icon/unlink.cjs +2 -0
- package/dist/icon/unlink.js +44 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +90 -76
- package/dist/index.cjs +1 -1
- package/dist/index.js +257 -243
- package/dist/llms-full.txt +11 -2
- package/dist/llms.txt +1 -1
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/components.json +3 -1
- package/dist/reset.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +7 -2
package/NOTICE
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
wimui
|
|
2
|
+
Copyright (c) 2025 takeshi sakuma
|
|
3
|
+
|
|
4
|
+
This product includes third-party material listed below.
|
|
5
|
+
|
|
6
|
+
The icon set in `src/icon/` (shipped compiled into `dist/`) is substantially
|
|
7
|
+
derived from Feather and Lucide, and is used under their licences, reproduced
|
|
8
|
+
in full below.
|
|
9
|
+
|
|
10
|
+
Provenance was established on 2026-08-05 by comparing all 88 shipped icons
|
|
11
|
+
against feather-icons 4.29.2, lucide-static 1.28.0, heroicons 2.2.0,
|
|
12
|
+
bootstrap-icons 1.13.1 and @tabler/icons 3.46.0, and then against the whole of
|
|
13
|
+
@iconify/json 2.2.509 — 236 icon sets, 328,420 icons. Matching is on normalised
|
|
14
|
+
path data rather than on file name, since many icons are shipped here under a
|
|
15
|
+
different name (for example `close` = Feather `x`, `email` = `mail`, `spinner`
|
|
16
|
+
= `loader`, `refresh` = `refresh-cw`, `trash` = `trash-2`, `mute` = `volume-x`,
|
|
17
|
+
`volume` = `volume-2`, `info-circle` = `info`, `thumb-up` = `thumbs-up`,
|
|
18
|
+
`loading` = Lucide `loader-circle`).
|
|
19
|
+
|
|
20
|
+
- 70 icons are identical to a Feather icon.
|
|
21
|
+
- 12 icons are identical to a Lucide icon (`eraser`, `grip-vertical`,
|
|
22
|
+
`hourglass`, `list-ordered`, `loading`, `maximize`, `minimize`, `project`,
|
|
23
|
+
`repeat`, `square`, `strikethrough`, `unlink`).
|
|
24
|
+
- `pdf` is derived from Feather's `file` family — 58 of its 180 path
|
|
25
|
+
characters are identical to `file-minus`, and the fold is `file-text`'s —
|
|
26
|
+
with the P/D/F lettering added here.
|
|
27
|
+
- 5 icons (`chart`, `grid`, `pip`, `skip-back`, `skip-forward`) match no icon
|
|
28
|
+
in any of the 328,420 compared, and share no path fragment with them beyond
|
|
29
|
+
the idioms any 24px arc has in common. No third-party attribution is known
|
|
30
|
+
to be owed for them. `grid` was added to this repository on 2026-07-31 and
|
|
31
|
+
changed from outline to solid on 2026-08-04; `skip-forward` was produced
|
|
32
|
+
here by mirroring `skip-back`.
|
|
33
|
+
|
|
34
|
+
Both licences are reproduced in full below.
|
|
35
|
+
|
|
36
|
+
This breakdown is checked on every audit run — see `scripts/icon-provenance.json`
|
|
37
|
+
and `npm run check:icons:provenance`. If an icon is added or changed so that its
|
|
38
|
+
provenance no longer matches that file, the build fails and this notice has to be
|
|
39
|
+
brought back in line.
|
|
40
|
+
|
|
41
|
+
--------------------------------------------------------------------------------
|
|
42
|
+
Feather — https://github.com/feathericons/feather
|
|
43
|
+
--------------------------------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
The MIT License (MIT)
|
|
46
|
+
|
|
47
|
+
Copyright (c) 2013-2023 Cole Bemis
|
|
48
|
+
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
50
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
51
|
+
in the Software without restriction, including without limitation the rights
|
|
52
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
53
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
54
|
+
furnished to do so, subject to the following conditions:
|
|
55
|
+
|
|
56
|
+
The above copyright notice and this permission notice shall be included in all
|
|
57
|
+
copies or substantial portions of the Software.
|
|
58
|
+
|
|
59
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
60
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
61
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
62
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
63
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
64
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
65
|
+
SOFTWARE.
|
|
66
|
+
|
|
67
|
+
--------------------------------------------------------------------------------
|
|
68
|
+
Lucide — https://github.com/lucide-icons/lucide
|
|
69
|
+
--------------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
ISC License
|
|
72
|
+
|
|
73
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
74
|
+
|
|
75
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
76
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
77
|
+
copyright notice and this permission notice appear in all copies.
|
|
78
|
+
|
|
79
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
80
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
81
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
82
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
83
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
84
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
85
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.ja.md
CHANGED
|
@@ -177,6 +177,8 @@ import "wimui/icons"; // 全アイコン(約 30KB minify / 5KB gzip)を登
|
|
|
177
177
|
|
|
178
178
|
文字列指定を使わなければ `wimui/icons` の読み込みは不要で、アイコンはバンドルに含まれません。
|
|
179
179
|
|
|
180
|
+
アイコンセットは大部分が [Feather](https://github.com/feathericons/feather)(MIT)と [Lucide](https://github.com/lucide-icons/lucide)(ISC)に由来し、パッケージに同梱される [`NOTICE`](./NOTICE) に表示しています。出所は自己申告ではなく、[Iconify](https://github.com/iconify/icon-sets) の 236 セット・328,420 個とパスデータで照合して確かめており、アイコンの追加・変更で `NOTICE` の記述とずれると `npm run check:icons:provenance` がビルドを止めます。
|
|
181
|
+
|
|
180
182
|
## 多言語化(i18n)
|
|
181
183
|
|
|
182
184
|
セットアップなしで英語表示で動作します(コンポーネントが使用する翻訳キーのみを en / ja / pt で内蔵)。**i18next / react-i18next などの依存は不要**です。表示言語を切り替えるには:
|
package/README.md
CHANGED
|
@@ -175,6 +175,8 @@ import "wimui/icons"; // registers all icons (~30KB minified / 5KB gzip)
|
|
|
175
175
|
|
|
176
176
|
If you never use string-based specification, you don't need to import `wimui/icons`, and the icons are not included in your bundle.
|
|
177
177
|
|
|
178
|
+
The icon set is largely derived from [Feather](https://github.com/feathericons/feather) (MIT) and [Lucide](https://github.com/lucide-icons/lucide) (ISC), attributed in [`NOTICE`](./NOTICE), which ships with the package. Provenance is not taken on trust: every shipped icon is matched by path data against 236 icon sets (328,420 icons) from [Iconify](https://github.com/iconify/icon-sets), and `npm run check:icons:provenance` fails the build if an icon is added or changed so that `NOTICE` no longer describes it.
|
|
179
|
+
|
|
178
180
|
## Internationalization (i18n)
|
|
179
181
|
|
|
180
182
|
Works out of the box in English with no setup (only the translation keys used by components are bundled for en / ja / pt). **No dependency on `i18next` / `react-i18next`** is required. To switch the display language:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../icon/alert-circle.cjs"),n=require("../../icon/
|
|
2
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../icon/alert-circle.cjs"),n=require("../../icon/alert-triangle.cjs"),r=require("../../icon/check.cjs"),i=require("../../icon/circle.cjs"),a=require("../../icon/info-circle.cjs"),o=require("../media/Icon/Icon.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({intent:e=`info`,icon:t,size:n=`sm`,className:r,color:a})=>t&&s.default.isValidElement(t)?(0,c.jsx)(c.Fragment,{children:t}):t===!1?null:(0,c.jsx)(o.Icon,{component:u[e]??i.default,size:n,className:r,color:a}),u={success:r.default,danger:t.default,warning:n.default,info:a.default};exports.FeedbackIcon=l;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e from "../../icon/alert-circle.js";
|
|
3
|
-
import t from "../../icon/
|
|
4
|
-
import n from "../../icon/
|
|
5
|
-
import r from "../../icon/
|
|
6
|
-
import
|
|
7
|
-
import a from "
|
|
8
|
-
import
|
|
3
|
+
import t from "../../icon/alert-triangle.js";
|
|
4
|
+
import n from "../../icon/check.js";
|
|
5
|
+
import r from "../../icon/circle.js";
|
|
6
|
+
import i from "../../icon/info-circle.js";
|
|
7
|
+
import { Icon as a } from "../media/Icon/Icon.js";
|
|
8
|
+
import o from "react";
|
|
9
|
+
import { Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/_internal/FeedbackIcon.tsx
|
|
10
|
-
var
|
|
11
|
-
component:
|
|
12
|
-
size:
|
|
13
|
-
className:
|
|
14
|
-
color:
|
|
15
|
-
}),
|
|
16
|
-
success:
|
|
11
|
+
var l = ({ intent: e = "info", icon: t, size: n = "sm", className: i, color: l }) => t && o.isValidElement(t) ? /* @__PURE__ */ c(s, { children: t }) : t === !1 ? null : /* @__PURE__ */ c(a, {
|
|
12
|
+
component: u[e] ?? r,
|
|
13
|
+
size: n,
|
|
14
|
+
className: i,
|
|
15
|
+
color: l
|
|
16
|
+
}), u = {
|
|
17
|
+
success: n,
|
|
17
18
|
danger: e,
|
|
18
|
-
warning:
|
|
19
|
-
info:
|
|
19
|
+
warning: t,
|
|
20
|
+
info: i
|
|
20
21
|
};
|
|
21
22
|
//#endregion
|
|
22
|
-
export {
|
|
23
|
+
export { l as FeedbackIcon };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_container_u2tvr_3`,t=`_messageList_u2tvr_19`,n=`_message_u2tvr_19`,r=`_left_u2tvr_51`,i=`_right_u2tvr_56`,a=`_contentWrapper_u2tvr_61`,o=`_primary_u2tvr_64`,s=`_secondary_u2tvr_67`,c=`_messageAvatar_u2tvr_70`,l=`_sender_u2tvr_79`,u=`_bubble_u2tvr_84`,d=`_typing_u2tvr_95`,f=`_typingDot_u2tvr_102`,p=`_actions_u2tvr_126`,m=`_hoverOnly_u2tvr_133`,h=`_hasAvatar_u2tvr_151`,g=`_timestamp_u2tvr_191`,_=`_inputArea_u2tvr_196`,v=`_fieldContainer_u2tvr_209`,y=`_field_u2tvr_209`,b=`_sendButton_u2tvr_244`,x=`_attachButton_u2tvr_271`,S=`_avatar_u2tvr_293`,C=`_sm_u2tvr_303`,w=`_md_u2tvr_308`,T=`_lg_u2tvr_313`,E=`_s1_u2tvr_321`,D=`_s3_u2tvr_324`,O=`_s5_u2tvr_327`,k=`_s7_u2tvr_330`,A=`_s10_u2tvr_333`,j=`_s12_u2tvr_336`,M=`_s14_u2tvr_339`,N=`_s16_u2tvr_342`,P=`_s18_u2tvr_345`,F=`_s20_u2tvr_348`,I=`_s22_u2tvr_351`,L=`_s24_u2tvr_354`,R=`_image_u2tvr_357`,z=`_fallback_u2tvr_362`,B={container:e,messageList:t,message:n,left:r,right:i,contentWrapper:a,primary:o,secondary:s,messageAvatar:c,sender:l,bubble:u,typing:d,typingDot:f,"chat-typing":`_chat-typing_u2tvr_1`,actions:p,hoverOnly:m,hasAvatar:h,timestamp:g,inputArea:_,fieldContainer:v,field:y,sendButton:b,attachButton:x,avatar:S,sm:C,md:w,lg:T,s1:E,s3:D,s5:O,s7:k,s10:A,s12:j,s14:M,s16:N,s18:P,s20:F,s22:I,s24:L,image:R,fallback:z};exports.actions=p,exports.attachButton=x,exports.avatar=S,exports.bubble=u,exports.container=e,exports.contentWrapper=a,exports.default=B,exports.fallback=z,exports.field=y,exports.fieldContainer=v,exports.hasAvatar=h,exports.hoverOnly=m,exports.image=R,exports.inputArea=_,exports.left=r,exports.lg=T,exports.md=w,exports.message=n,exports.messageAvatar=c,exports.messageList=t,exports.primary=o,exports.right=i,exports.s1=E,exports.s10=A,exports.s12=j,exports.s14=M,exports.s16=N,exports.s18=P,exports.s20=F,exports.s22=I,exports.s24=L,exports.s3=D,exports.s5=O,exports.s7=k,exports.secondary=s,exports.sendButton=b,exports.sender=l,exports.sm=C,exports.timestamp=g,exports.typing=d,exports.typingDot=f;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/ai/ChatUI/chat-ui.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_container_u2tvr_3", t = "_messageList_u2tvr_19", n = "_message_u2tvr_19", r = "_left_u2tvr_51", i = "_right_u2tvr_56", a = "_contentWrapper_u2tvr_61", o = "_primary_u2tvr_64", s = "_secondary_u2tvr_67", c = "_messageAvatar_u2tvr_70", l = "_sender_u2tvr_79", u = "_bubble_u2tvr_84", d = "_typing_u2tvr_95", f = "_typingDot_u2tvr_102", p = "_actions_u2tvr_126", m = "_hoverOnly_u2tvr_133", h = "_hasAvatar_u2tvr_151", g = "_timestamp_u2tvr_191", _ = "_inputArea_u2tvr_196", v = "_fieldContainer_u2tvr_209", y = "_field_u2tvr_209", b = "_sendButton_u2tvr_244", x = "_attachButton_u2tvr_271", S = "_avatar_u2tvr_293", C = "_sm_u2tvr_303", w = "_md_u2tvr_308", T = "_lg_u2tvr_313", E = "_s1_u2tvr_321", D = "_s3_u2tvr_324", O = "_s5_u2tvr_327", k = "_s7_u2tvr_330", A = "_s10_u2tvr_333", j = "_s12_u2tvr_336", M = "_s14_u2tvr_339", N = "_s16_u2tvr_342", P = "_s18_u2tvr_345", F = "_s20_u2tvr_348", I = "_s22_u2tvr_351", L = "_s24_u2tvr_354", R = "_image_u2tvr_357", z = "_fallback_u2tvr_362", B = {
|
|
4
4
|
container: e,
|
|
5
5
|
messageList: t,
|
|
6
6
|
message: n,
|
|
@@ -14,7 +14,7 @@ var e = "_container_1ycre_3", t = "_messageList_1ycre_19", n = "_message_1ycre_1
|
|
|
14
14
|
bubble: u,
|
|
15
15
|
typing: d,
|
|
16
16
|
typingDot: f,
|
|
17
|
-
"chat-typing": "_chat-
|
|
17
|
+
"chat-typing": "_chat-typing_u2tvr_1",
|
|
18
18
|
actions: p,
|
|
19
19
|
hoverOnly: m,
|
|
20
20
|
hasAvatar: h,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1m5j6_29`,t=`_header_1m5j6_46`,n=`_lang_1m5j6_54`,r=`_headerActions_1m5j6_67`,i=`_iconButton_1m5j6_72`,a=`_copied_1m5j6_93`,o=`_chevron_1m5j6_99`,s=`_chevronUp_1m5j6_102`,c=`_body_1m5j6_105`,l=`_collapsed_1m5j6_108`,u=`_pre_1m5j6_39`,d=`_code_1m5j6_149`,f=`_line_1m5j6_152`,p=`_lineNumber_1m5j6_155`,m=`_lineContent_1m5j6_164`,h={root:e,header:t,lang:n,headerActions:r,iconButton:i,copied:a,chevron:o,chevronUp:s,body:c,collapsed:l,pre:u,code:d,line:f,lineNumber:p,lineContent:m};exports.body=c,exports.chevron=o,exports.chevronUp=s,exports.code=d,exports.collapsed=l,exports.copied=a,exports.default=h,exports.header=t,exports.headerActions=r,exports.iconButton=i,exports.lang=n,exports.line=f,exports.lineContent=m,exports.lineNumber=p,exports.pre=u,exports.root=e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/ai/CodeBlock/code-block.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1m5j6_29", t = "_header_1m5j6_46", n = "_lang_1m5j6_54", r = "_headerActions_1m5j6_67", i = "_iconButton_1m5j6_72", a = "_copied_1m5j6_93", o = "_chevron_1m5j6_99", s = "_chevronUp_1m5j6_102", c = "_body_1m5j6_105", l = "_collapsed_1m5j6_108", u = "_pre_1m5j6_39", d = "_code_1m5j6_149", f = "_line_1m5j6_152", p = "_lineNumber_1m5j6_155", m = "_lineContent_1m5j6_164", h = {
|
|
4
4
|
root: e,
|
|
5
5
|
header: t,
|
|
6
6
|
lang: n,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/check.cjs"),r=require("../../../icon/close
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/check.cjs"),r=require("../../../icon/close.cjs"),i=require("../../../icon/copy.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./terminal.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u={30:`#2d2d2d`,31:`#e06c75`,32:`#98c379`,33:`#e5c07b`,34:`#61afef`,35:`#c678dd`,36:`#56b6c2`,37:`#abb2bf`,90:`#9aa1ab`,91:`#e06c75`,92:`#98c379`,93:`#e5c07b`,94:`#61afef`,95:`#c678dd`,96:`#56b6c2`,97:`#ffffff`};function d(e){let t=RegExp(`\x1B\\[([0-9;]*)m`,`g`),n=[],r=0,i={},a=0;for(let o of e.matchAll(t)){o.index>r&&n.push((0,l.jsx)(`span`,{style:{color:i.color,fontWeight:i.bold?`bold`:void 0},children:e.slice(r,o.index)},a++));let t=o[1]?o[1].split(`;`).map(Number):[0],s={...i};for(let e of t)e===0?Object.assign(s,{color:void 0,bold:void 0}):e===1?s.bold=!0:u[e]&&(s.color=u[e]);i=s,r=o.index+o[0].length}return r<e.length&&n.push((0,l.jsx)(`span`,{style:{color:i.color,fontWeight:i.bold?`bold`:void 0},children:e.slice(r)},a++)),n.length===1?n[0]:(0,l.jsx)(l.Fragment,{children:n})}var f=s.default.forwardRef(({lines:e=[],title:u,height:f,autoScroll:p=!0,prompt:m=`$`,showCopy:h=!0,onClear:g,className:_,style:v,...y},b)=>{let{t:x}=t.useWimTranslation(`form`),[S,C]=s.default.useState(!1),w=(0,s.useRef)(null);(0,s.useEffect)(()=>{p&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[e,p]);let T=(0,s.useCallback)(async()=>{let t=e.map(e=>e.type===`input`?`${m} ${e.content}`:e.content).join(`
|
|
3
3
|
`);try{await navigator.clipboard.writeText(t),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},[e,m]);return(0,l.jsxs)(`div`,{ref:b,"data-theme":`dark`,className:(0,c.default)(`wim-terminal`,o.default.root,_),style:{...f==null?{}:{height:f},...v},...y,children:[(0,l.jsxs)(`div`,{className:o.default.titleBar,children:[(0,l.jsx)(`span`,{className:o.default.dot,"data-color":`red`,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:o.default.dot,"data-color":`yellow`,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:o.default.dot,"data-color":`green`,"aria-hidden":`true`}),u&&(0,l.jsx)(`span`,{className:o.default.titleText,children:u}),(0,l.jsxs)(`div`,{className:o.default.titleActions,children:[h&&(0,l.jsx)(`button`,{type:`button`,className:(0,c.default)(o.default.titleBtn,S&&o.default.copied),onClick:T,"aria-label":x(S?`terminal.copied_label`:`terminal.copy_label`),children:(0,l.jsx)(a.Icon,{component:S?n.default:i.default,size:`sm`})}),g&&(0,l.jsx)(`button`,{type:`button`,className:o.default.titleBtn,onClick:g,"aria-label":x(`terminal.clear_label`),children:(0,l.jsx)(a.Icon,{component:r.default,size:`sm`})})]})]}),(0,l.jsx)(`div`,{ref:w,className:o.default.body,role:`log`,"aria-live":`polite`,"aria-label":u,tabIndex:0,children:e.map((e,t)=>(0,l.jsxs)(`div`,{className:(0,c.default)(o.default.line,e.type&&o.default[e.type]),children:[e.type===`input`&&(0,l.jsx)(`span`,{className:o.default.prompt,"aria-hidden":`true`,children:m}),(0,l.jsx)(`span`,{className:o.default.content,children:d(e.content)})]},e.id??t))})]})});f.displayName=`Terminal`,exports.Terminal=f;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import t from "../../../icon/check.js";
|
|
4
|
-
import n from "../../../icon/close
|
|
4
|
+
import n from "../../../icon/close.js";
|
|
5
5
|
import r from "../../../icon/copy.js";
|
|
6
6
|
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
7
|
import a from "./terminal.module.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_i7k6g_3`,t=`_elevated_i7k6g_13`,n=`_interactive_i7k6g_17`,r=`_outline_i7k6g_21`,i=`_flat_i7k6g_28`,a=`_glass_i7k6g_36`,o=`_header_i7k6g_58`,s=`_body_i7k6g_58`,c=`_footer_i7k6g_58`,l={root:e,elevated:t,interactive:n,outline:r,flat:i,glass:a,"padding-none":`_padding-none_i7k6g_55`,header:o,body:s,footer:c,"padding-xs":`_padding-xs_i7k6g_61`,"padding-sm":`_padding-sm_i7k6g_67`,"padding-md":`_padding-md_i7k6g_73`,"padding-lg":`_padding-lg_i7k6g_79`,"padding-xl":`_padding-xl_i7k6g_99`,"padding-2xl":`_padding-2xl_i7k6g_105`,"padding-3xl":`_padding-3xl_i7k6g_111`,"radius-none":`_radius-none_i7k6g_120`,"radius-sm":`_radius-sm_i7k6g_123`,"radius-md":`_radius-md_i7k6g_126`,"radius-lg":`_radius-lg_i7k6g_129`,"radius-xl":`_radius-xl_i7k6g_132`,"radius-2xl":`_radius-2xl_i7k6g_135`};exports.body=s,exports.default=l,exports.elevated=t,exports.flat=i,exports.footer=c,exports.glass=a,exports.header=o,exports.interactive=n,exports.outline=r,exports.root=e;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/Card/card.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_i7k6g_3", t = "_elevated_i7k6g_13", n = "_interactive_i7k6g_17", r = "_outline_i7k6g_21", i = "_flat_i7k6g_28", a = "_glass_i7k6g_36", o = "_header_i7k6g_58", s = "_body_i7k6g_58", c = "_footer_i7k6g_58", l = {
|
|
4
4
|
root: e,
|
|
5
5
|
elevated: t,
|
|
6
6
|
interactive: n,
|
|
7
7
|
outline: r,
|
|
8
8
|
flat: i,
|
|
9
9
|
glass: a,
|
|
10
|
-
"padding-none": "_padding-
|
|
10
|
+
"padding-none": "_padding-none_i7k6g_55",
|
|
11
11
|
header: o,
|
|
12
12
|
body: s,
|
|
13
13
|
footer: c,
|
|
14
|
-
"padding-xs": "_padding-
|
|
15
|
-
"padding-sm": "_padding-
|
|
16
|
-
"padding-md": "_padding-
|
|
17
|
-
"padding-lg": "_padding-
|
|
18
|
-
"padding-xl": "_padding-
|
|
19
|
-
"padding-2xl": "_padding-
|
|
20
|
-
"padding-3xl": "_padding-
|
|
21
|
-
"radius-none": "_radius-
|
|
22
|
-
"radius-sm": "_radius-
|
|
23
|
-
"radius-md": "_radius-
|
|
24
|
-
"radius-lg": "_radius-
|
|
25
|
-
"radius-xl": "_radius-
|
|
26
|
-
"radius-2xl": "_radius-
|
|
14
|
+
"padding-xs": "_padding-xs_i7k6g_61",
|
|
15
|
+
"padding-sm": "_padding-sm_i7k6g_67",
|
|
16
|
+
"padding-md": "_padding-md_i7k6g_73",
|
|
17
|
+
"padding-lg": "_padding-lg_i7k6g_79",
|
|
18
|
+
"padding-xl": "_padding-xl_i7k6g_99",
|
|
19
|
+
"padding-2xl": "_padding-2xl_i7k6g_105",
|
|
20
|
+
"padding-3xl": "_padding-3xl_i7k6g_111",
|
|
21
|
+
"radius-none": "_radius-none_i7k6g_120",
|
|
22
|
+
"radius-sm": "_radius-sm_i7k6g_123",
|
|
23
|
+
"radius-md": "_radius-md_i7k6g_126",
|
|
24
|
+
"radius-lg": "_radius-lg_i7k6g_129",
|
|
25
|
+
"radius-xl": "_radius-xl_i7k6g_132",
|
|
26
|
+
"radius-2xl": "_radius-2xl_i7k6g_135"
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
29
|
export { s as body, l as default, t as elevated, i as flat, c as footer, a as glass, o as header, n as interactive, r as outline, e as root };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../Card/Card.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../icon/arrow-down.cjs"),n=require("../../../icon/arrow-right.cjs"),r=require("../../../icon/arrow-up.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../Card/Card.cjs"),o=require("./stats.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u={up:r.default,down:t.default,neutral:n.default},d=({variant:e=`elevated`,className:t,children:n,...r})=>(0,l.jsx)(a.Card,{variant:e,className:(0,c.default)(`wim-stats`,o.default.root,t),padding:`none`,...r,children:(0,l.jsx)(`div`,{className:o.default.inner,children:n})}),f=({className:e,children:t,...n})=>(0,l.jsx)(`div`,{className:(0,c.default)(o.default.label,e),...n,children:t}),p=({className:e,children:t,...n})=>(0,l.jsx)(`div`,{className:(0,c.default)(o.default.value,e),...n,children:t}),m=({className:e,children:t,...n})=>(0,l.jsx)(`div`,{className:(0,c.default)(o.default.description,e),...n,children:t}),h=({direction:e=`up`,className:t,children:n,...r})=>(0,l.jsxs)(`div`,{className:(0,c.default)(o.default.trend,o.default[e],t),...r,children:[(0,l.jsx)(`span`,{className:o.default.trendIcon,"aria-hidden":`true`,children:(0,l.jsx)(i.Icon,{component:u[e],size:`sm`})}),(0,l.jsx)(`span`,{className:o.default.trendValue,children:n})]});d.displayName=`Stats`,f.displayName=`Stats.Label`,p.displayName=`Stats.Value`,m.displayName=`Stats.Description`,h.displayName=`Stats.Trend`,d.Label=f,d.Value=p,d.Description=m,d.Trend=h,exports.Stats=d,exports.default=d,exports.StatsDescription=m,exports.StatsLabel=f,exports.StatsTrend=h,exports.StatsValue=p;
|
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import t from "
|
|
2
|
+
import e from "../../../icon/arrow-down.js";
|
|
3
|
+
import t from "../../../icon/arrow-right.js";
|
|
4
|
+
import n from "../../../icon/arrow-up.js";
|
|
5
|
+
import { Icon as r } from "../../media/Icon/Icon.js";
|
|
6
|
+
import { Card as i } from "../Card/Card.js";
|
|
7
|
+
import a from "./stats.module.js";
|
|
4
8
|
import "react";
|
|
5
|
-
import
|
|
6
|
-
import { jsx as
|
|
9
|
+
import o from "classnames";
|
|
10
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
11
|
//#region src/components/data-display/Stats/Stats.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
var l = {
|
|
13
|
+
up: n,
|
|
14
|
+
down: e,
|
|
15
|
+
neutral: t
|
|
16
|
+
}, u = ({ variant: e = "elevated", className: t, children: n, ...r }) => /* @__PURE__ */ s(i, {
|
|
17
|
+
variant: e,
|
|
18
|
+
className: o("wim-stats", a.root, t),
|
|
11
19
|
padding: "none",
|
|
12
|
-
...
|
|
13
|
-
children: /* @__PURE__ */
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
20
|
+
...r,
|
|
21
|
+
children: /* @__PURE__ */ s("div", {
|
|
22
|
+
className: a.inner,
|
|
23
|
+
children: n
|
|
16
24
|
})
|
|
17
|
-
}),
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
20
|
-
children:
|
|
21
|
-
}),
|
|
22
|
-
className:
|
|
23
|
-
...
|
|
24
|
-
children:
|
|
25
|
-
}),
|
|
26
|
-
className:
|
|
27
|
-
...
|
|
28
|
-
children:
|
|
29
|
-
}),
|
|
30
|
-
className:
|
|
31
|
-
...
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
-
className:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
e
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children:
|
|
25
|
+
}), d = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
26
|
+
className: o(a.label, e),
|
|
27
|
+
...n,
|
|
28
|
+
children: t
|
|
29
|
+
}), f = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
30
|
+
className: o(a.value, e),
|
|
31
|
+
...n,
|
|
32
|
+
children: t
|
|
33
|
+
}), p = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
34
|
+
className: o(a.description, e),
|
|
35
|
+
...n,
|
|
36
|
+
children: t
|
|
37
|
+
}), m = ({ direction: e = "up", className: t, children: n, ...i }) => /* @__PURE__ */ c("div", {
|
|
38
|
+
className: o(a.trend, a[e], t),
|
|
39
|
+
...i,
|
|
40
|
+
children: [/* @__PURE__ */ s("span", {
|
|
41
|
+
className: a.trendIcon,
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
children: /* @__PURE__ */ s(r, {
|
|
44
|
+
component: l[e],
|
|
45
|
+
size: "sm"
|
|
46
|
+
})
|
|
47
|
+
}), /* @__PURE__ */ s("span", {
|
|
48
|
+
className: a.trendValue,
|
|
49
|
+
children: n
|
|
42
50
|
})]
|
|
43
51
|
});
|
|
44
|
-
|
|
52
|
+
u.displayName = "Stats", d.displayName = "Stats.Label", f.displayName = "Stats.Value", p.displayName = "Stats.Description", m.displayName = "Stats.Trend", u.Label = d, u.Value = f, u.Description = p, u.Trend = m;
|
|
45
53
|
//#endregion
|
|
46
|
-
export {
|
|
54
|
+
export { u as Stats, u as default, p as StatsDescription, d as StatsLabel, m as StatsTrend, f as StatsValue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_x5cp1_3`,t=`_left_x5cp1_11`,n=`_right_x5cp1_14`,r=`_alternate_x5cp1_17`,i=`_item_x5cp1_20`,a=`_connector_x5cp1_33`,o=`_content_x5cp1_45`,s=`_oppositeContent_x5cp1_48`,c=`_separator_x5cp1_60`,l=`_point_x5cp1_71`,u=`_primary_x5cp1_86`,d=`_secondary_x5cp1_89`,f=`_danger_x5cp1_92`,p=`_success_x5cp1_95`,m=`_icon_x5cp1_98`,h={root:e,left:t,right:n,alternate:r,item:i,connector:a,content:o,oppositeContent:s,separator:c,point:l,primary:u,secondary:d,danger:f,success:p,icon:m};exports.alternate=r,exports.connector=a,exports.content=o,exports.danger=f,exports.default=h,exports.icon=m,exports.item=i,exports.left=t,exports.oppositeContent=s,exports.point=l,exports.primary=u,exports.right=n,exports.root=e,exports.secondary=d,exports.separator=c,exports.success=p;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/Timeline/timeline.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_x5cp1_3", t = "_left_x5cp1_11", n = "_right_x5cp1_14", r = "_alternate_x5cp1_17", i = "_item_x5cp1_20", a = "_connector_x5cp1_33", o = "_content_x5cp1_45", s = "_oppositeContent_x5cp1_48", c = "_separator_x5cp1_60", l = "_point_x5cp1_71", u = "_primary_x5cp1_86", d = "_secondary_x5cp1_89", f = "_danger_x5cp1_92", p = "_success_x5cp1_95", m = "_icon_x5cp1_98", h = {
|
|
4
4
|
root: e,
|
|
5
5
|
left: t,
|
|
6
6
|
right: n,
|
|
7
7
|
alternate: r,
|
|
8
8
|
item: i,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
connector: a,
|
|
10
|
+
content: o,
|
|
11
|
+
oppositeContent: s,
|
|
12
|
+
separator: c,
|
|
13
13
|
point: l,
|
|
14
14
|
primary: u,
|
|
15
15
|
secondary: d,
|
|
@@ -18,4 +18,4 @@ var e = "_root_g3htv_2", t = "_left_g3htv_10", n = "_right_g3htv_13", r = "_alte
|
|
|
18
18
|
icon: m
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
|
-
export { r as alternate,
|
|
21
|
+
export { r as alternate, a as connector, o as content, f as danger, h as default, m as icon, i as item, t as left, s as oppositeContent, l as point, u as primary, n as right, e as root, d as secondary, c as separator, p as success };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1tyu7_283`,t=`_label_1tyu7_288`,n=`_trigger_1tyu7_295`,r=`_disabled_1tyu7_308`,i=`_open_1tyu7_314`,a=`_value_1tyu7_322`,o=`_placeholder_1tyu7_323`,s=`_icon_1tyu7_326`,c=`_clear_1tyu7_346`,l=`_dropdown_1tyu7_358`,u=`_menu_1tyu7_377`,d=`_menuItem_1tyu7_406`,f=`_active_1tyu7_406`,p=`_selected_1tyu7_414`,m={"wim-docs-container":`_wim-docs-container_1tyu7_87`,"wim-t":`_wim-t_1tyu7_250`,"react-flow":`_react-flow_1tyu7_273`,"react-flow__edges":`_react-flow__edges_1tyu7_274`,"react-flow__connectionline":`_react-flow__connectionline_1tyu7_275`,root:e,label:t,trigger:n,disabled:r,open:i,value:a,placeholder:o,icon:s,clear:c,dropdown:l,menu:u,menuItem:d,active:f,selected:p};exports.active=f,exports.clear=c,exports.default=m,exports.disabled=r,exports.dropdown=l,exports.icon=s,exports.label=t,exports.menu=u,exports.menuItem=d,exports.open=i,exports.placeholder=o,exports.root=e,exports.selected=p,exports.trigger=n,exports.value=a;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/Cascader/cascader.module.scss
|
|
3
|
-
var e = "
|
|
4
|
-
"wim-docs-container": "_wim-docs-
|
|
5
|
-
"wim-t": "_wim-
|
|
6
|
-
"react-flow": "_react-
|
|
7
|
-
"react-flow__edges": "_react-
|
|
8
|
-
"react-flow__connectionline": "_react-
|
|
3
|
+
var e = "_root_1tyu7_283", t = "_label_1tyu7_288", n = "_trigger_1tyu7_295", r = "_disabled_1tyu7_308", i = "_open_1tyu7_314", a = "_value_1tyu7_322", o = "_placeholder_1tyu7_323", s = "_icon_1tyu7_326", c = "_clear_1tyu7_346", l = "_dropdown_1tyu7_358", u = "_menu_1tyu7_377", d = "_menuItem_1tyu7_406", f = "_active_1tyu7_406", p = "_selected_1tyu7_414", m = {
|
|
4
|
+
"wim-docs-container": "_wim-docs-container_1tyu7_87",
|
|
5
|
+
"wim-t": "_wim-t_1tyu7_250",
|
|
6
|
+
"react-flow": "_react-flow_1tyu7_273",
|
|
7
|
+
"react-flow__edges": "_react-flow__edges_1tyu7_274",
|
|
8
|
+
"react-flow__connectionline": "_react-flow__connectionline_1tyu7_275",
|
|
9
9
|
root: e,
|
|
10
10
|
label: t,
|
|
11
11
|
trigger: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Button/Button.cjs"),r=require("../FieldTemplate/FieldTemplate.cjs"),i=require("../Input/Input.cjs"),a=require("../../overlay/Dialog/Dialog.cjs"),o=require("./commands.cjs"),s=require("./rich-text-editor.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var ee=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z`}),(0,u.jsx)(`path`,{d:`M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z`})]}),te=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:[(0,u.jsx)(`line`,{x1:`19`,y1:`4`,x2:`10`,y2:`4`}),(0,u.jsx)(`line`,{x1:`14`,y1:`20`,x2:`5`,y2:`20`}),(0,u.jsx)(`line`,{x1:`15`,y1:`4`,x2:`9`,y2:`20`})]}),ne=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3`}),(0,u.jsx)(`line`,{x1:`4`,y1:`21`,x2:`20`,y2:`21`})]}),re=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`}),(0,u.jsx)(`line`,{x1:`4`,y1:`12`,x2:`20`,y2:`12`})]}),ie=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,u.jsx)(`line`,{x1:`9`,y1:`6`,x2:`20`,y2:`6`}),(0,u.jsx)(`line`,{x1:`9`,y1:`12`,x2:`20`,y2:`12`}),(0,u.jsx)(`line`,{x1:`9`,y1:`18`,x2:`20`,y2:`18`}),(0,u.jsx)(`circle`,{cx:`4`,cy:`6`,r:`1.5`,fill:`currentColor`,stroke:`none`}),(0,u.jsx)(`circle`,{cx:`4`,cy:`12`,r:`1.5`,fill:`currentColor`,stroke:`none`}),(0,u.jsx)(`circle`,{cx:`4`,cy:`18`,r:`1.5`,fill:`currentColor`,stroke:`none`})]}),ae=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,u.jsx)(`line`,{x1:`10`,y1:`6`,x2:`21`,y2:`6`}),(0,u.jsx)(`line`,{x1:`10`,y1:`12`,x2:`21`,y2:`12`}),(0,u.jsx)(`line`,{x1:`10`,y1:`18`,x2:`21`,y2:`18`}),(0,u.jsx)(`text`,{x:`1`,y:`8`,fontSize:`7`,fill:`currentColor`,stroke:`none`,fontWeight:`bold`,children:`1.`}),(0,u.jsx)(`text`,{x:`1`,y:`14`,fontSize:`7`,fill:`currentColor`,stroke:`none`,fontWeight:`bold`,children:`2.`}),(0,u.jsx)(`text`,{x:`1`,y:`20`,fontSize:`7`,fill:`currentColor`,stroke:`none`,fontWeight:`bold`,children:`3.`})]}),oe=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),(0,u.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})]}),se=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.72`}),(0,u.jsx)(`path`,{d:`M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`}),(0,u.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`5`}),(0,u.jsx)(`line`,{x1:`2`,y1:`8`,x2:`5`,y2:`8`}),(0,u.jsx)(`line`,{x1:`16`,y1:`19`,x2:`16`,y2:`22`}),(0,u.jsx)(`line`,{x1:`19`,y1:`16`,x2:`22`,y2:`16`})]}),ce=()=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M20 20H7L3 16l10-10 7 7-3.5 3.5`}),(0,u.jsx)(`line`,{x1:`6`,y1:`7`,x2:`17`,y2:`18`})]}),le=[`bold`,`italic`,`underline`,`strikethrough`,`separator`,`h1`,`h2`,`h3`,`separator`,`ul`,`ol`,`separator`,`link`,`unlink`,`separator`,`removeFormat`],d=c.default.memo(({onClick:e,active:t,disabled:n,title:r,children:i})=>(0,u.jsx)(`button`,{type:`button`,className:(0,l.default)(s.default.toolbarBtn,t&&s.default.active),onClick:e,disabled:n,title:r,"aria-label":r,"aria-pressed":t,tabIndex:-1,children:i}));d.displayName=`ToolbarButton`;var f=({value:e,defaultValue:f=``,onChange:p,placeholder:m,disabled:ue,intent:de=`default`,variant:fe=`outline`,fullWidth:h=!1,width:g,minHeight:_=200,label:v,error:y,required:pe,layout:me,className:he,id:ge,toolbar:_e=le,labels:ve={},"aria-label":ye,"aria-labelledby":be})=>{let{t:b}=t.useWimTranslation(`components`),{bold:xe=b(`a11y.rte_bold`),italic:x=b(`a11y.rte_italic`),underline:S=b(`a11y.rte_underline`),strikethrough:C=b(`a11y.rte_strikethrough`),h1:w=b(`a11y.rte_h1`),h2:T=b(`a11y.rte_h2`),h3:E=b(`a11y.rte_h3`),ul:D=b(`a11y.rte_ul`),ol:O=b(`a11y.rte_ol`),link:k=b(`a11y.rte_link`),unlink:A=b(`a11y.rte_unlink`),removeFormat:j=b(`a11y.rte_remove_format`),toolbar:Se=b(`a11y.rte_toolbar`),linkPrompt:Ce=b(`a11y.rte_link_prompt`),linkApply:we=b(`a11y.rte_link_apply`),linkCancel:Te=b(`a11y.rte_link_cancel`)}=ve,M=c.default.useRef(null),N=c.default.useRef(!1),P=c.default.useRef(e??f),[F,Ee]=c.default.useState(new Set),De=c.default.useId(),I=ge||`wim-rte-${De}`,L=y?`${I}-error`:void 0,Oe=v?`${I}-label`:void 0,R=ue,ke=y?`danger`:de,Ae=typeof g==`string`&&[`xs`,`sm`,`md`,`lg`,`xl`].includes(g),je=g!==void 0&&!Ae&&!h,z=Ae&&!h?g:void 0,Me=z?s.default[`width${z.charAt(0).toUpperCase()}${z.slice(1)}`]:void 0,B=c.default.useRef(e===void 0?f:e),V=c.default.useCallback(()=>{M.current&&Ee(o.getActiveFormats(M.current))},[]),H=c.default.useRef([]),U=c.default.useRef(-1),W=c.default.useRef(void 0),G=c.default.useCallback(e=>{let t=H.current,n=U.current;if(t[n]===e)return;let r=[...t.slice(0,n+1),e];r.length>100&&(r=r.slice(1)),H.current=r,U.current=r.length-1},[]),K=c.default.useCallback(()=>{W.current!==void 0&&(clearTimeout(W.current),W.current=void 0,G(P.current))},[G]),q=c.default.useCallback(e=>{K();let t=H.current,n=U.current+e;if(n<0||n>=t.length||!M.current)return;U.current=n;let r=t[n];M.current.innerHTML=r,P.current=r,p?.(r);let i=document.createRange();i.selectNodeContents(M.current),i.collapse(!1);let a=window.getSelection();a?.removeAllRanges(),a?.addRange(i),V()},[K,p,V]),J=c.default.useCallback(e=>{if(R||!M.current)return;let t=M.current,n=o.getEditorRange(t)?.cloneRange()??null;if(t.focus(),n){let e=window.getSelection();e?.removeAllRanges(),e?.addRange(n)}K(),G(t.innerHTML),e(t),V();let r=t.innerHTML;P.current=r,G(r),p?.(r)},[R,K,G,p,V]),Ne=c.default.useCallback(()=>{J(e=>o.removeAllFormatting(e))},[J]),[Pe,Y]=c.default.useState(!1),[X,Fe]=c.default.useState(`https://`),Z=c.default.useRef(null),Q=c.default.useCallback(()=>{if(R||!M.current)return;M.current.focus();let e=o.getEditorRange(M.current);Z.current=e?e.cloneRange():null;let t=e?.toString()??``;Fe(t.startsWith(`http`)?t:`https://`),Y(!0)},[R]),Ie=c.default.useCallback(()=>{let e=X.trim();if(Y(!1),!e||!M.current)return;let t=window.getSelection();if(t?.removeAllRanges(),Z.current)t?.addRange(Z.current);else{let e=document.createRange();e.selectNodeContents(M.current),e.collapse(!1),t?.addRange(e)}J(t=>o.createLink(t,e))},[X,J]),$=c.default.useCallback(()=>{if(N.current)return;let e=M.current?.innerHTML??``;e!==P.current&&(P.current=e,p?.(e),W.current!==void 0&&clearTimeout(W.current),W.current=setTimeout(()=>{W.current=void 0,G(P.current)},400)),V()},[p,G,V]),Le=c.default.useCallback(e=>{let t=e.nativeEvent.inputType;t===`historyUndo`?(e.preventDefault(),q(-1)):t===`historyRedo`&&(e.preventDefault(),q(1))},[q]),Re=c.default.useCallback(e=>{if(!(e.ctrlKey||e.metaKey))return;let t=e.key.toLowerCase();t===`z`?(e.preventDefault(),q(e.shiftKey?1:-1)):t===`y`&&(e.preventDefault(),q(1))},[q]),ze=c.default.useCallback(()=>{V()},[V]),Be=c.default.useCallback(()=>{V()},[V]),Ve=c.default.useCallback(()=>{N.current=!0},[]),He=c.default.useCallback(()=>{N.current=!1,$()},[$]),Ue=c.default.useCallback(e=>{e.preventDefault()},[]);c.default.useEffect(()=>{M.current&&(M.current.innerHTML=B.current,P.current=B.current,H.current=[B.current],U.current=0)},[]),c.default.useEffect(()=>{e!==void 0&&M.current&&M.current.innerHTML!==e&&(M.current.innerHTML=e,P.current=e)},[e]);let We=c.default.useCallback((e,t)=>{if(e===`separator`)return(0,u.jsx)(`span`,{className:s.default.toolbarSep,"aria-hidden":`true`},`sep-${t}`);let n={disabled:R,active:F.has(e)};switch(e){case`bold`:return(0,u.jsx)(d,{...n,title:xe,onClick:()=>J(e=>o.toggleInline(e,`bold`)),children:(0,u.jsx)(ee,{})},`bold`);case`italic`:return(0,u.jsx)(d,{...n,title:x,onClick:()=>J(e=>o.toggleInline(e,`italic`)),children:(0,u.jsx)(te,{})},`italic`);case`underline`:return(0,u.jsx)(d,{...n,title:S,onClick:()=>J(e=>o.toggleInline(e,`underline`)),children:(0,u.jsx)(ne,{})},`underline`);case`strikethrough`:return(0,u.jsx)(d,{...n,title:C,onClick:()=>J(e=>o.toggleInline(e,`strikethrough`)),children:(0,u.jsx)(re,{})},`strikethrough`);case`h1`:return(0,u.jsx)(d,{...n,active:F.has(`h1`),title:w,onClick:()=>J(e=>o.setBlock(e,`h1`)),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`H1`})},`h1`);case`h2`:return(0,u.jsx)(d,{...n,active:F.has(`h2`),title:T,onClick:()=>J(e=>o.setBlock(e,`h2`)),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`H2`})},`h2`);case`h3`:return(0,u.jsx)(d,{...n,active:F.has(`h3`),title:E,onClick:()=>J(e=>o.setBlock(e,`h3`)),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`H3`})},`h3`);case`ul`:return(0,u.jsx)(d,{...n,title:D,onClick:()=>J(e=>o.toggleList(e,`ul`)),children:(0,u.jsx)(ie,{})},`ul`);case`ol`:return(0,u.jsx)(d,{...n,title:O,onClick:()=>J(e=>o.toggleList(e,`ol`)),children:(0,u.jsx)(ae,{})},`ol`);case`link`:return(0,u.jsx)(d,{...n,title:k,onClick:Q,children:(0,u.jsx)(oe,{})},`link`);case`unlink`:return(0,u.jsx)(d,{...n,title:A,onClick:()=>J(e=>o.removeLink(e)),children:(0,u.jsx)(se,{})},`unlink`);case`removeFormat`:return(0,u.jsx)(d,{...n,title:j,onClick:Ne,children:(0,u.jsx)(ce,{})},`removeFormat`);default:return null}},[F,R,xe,x,S,C,w,T,E,D,O,k,A,j,J,Q,Ne]);return(0,u.jsx)(r.FieldTemplate,{label:v,error:y,required:pe,layout:me,labelId:Oe,errorId:L,className:he,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`wim-rich-text-editor`,s.default.root,s.default[ke],R&&s.default.disabled,s.default[fe],h&&s.default.fullWidth,je&&s.default.hasCustomWidth,Me),style:je?{"--wim-input-width":typeof g==`number`?`${g}px`:g}:void 0,children:[(0,u.jsx)(`div`,{className:s.default.toolbar,role:`toolbar`,"aria-label":Se,"aria-controls":I,onMouseDown:Ue,children:_e.map((e,t)=>We(e,t))}),(0,u.jsx)(`div`,{ref:M,id:I,className:s.default.content,contentEditable:!R,suppressContentEditableWarning:!0,role:`textbox`,"aria-multiline":!0,"aria-label":ye??(v||be?void 0:b(`a11y.rte_editor`)),"aria-labelledby":be??(v?Oe:void 0),"aria-invalid":ke===`danger`,"aria-describedby":L,"aria-required":pe,"aria-disabled":R,"aria-placeholder":m,"data-placeholder":m,tabIndex:R?-1:0,style:{minHeight:typeof _==`number`?`${_}px`:_,outline:`none`},onInput:$,onBeforeInput:Le,onKeyDown:Re,onKeyUp:ze,onMouseUp:Be,onCompositionStart:Ve,onCompositionEnd:He}),(0,u.jsx)(a.Dialog,{open:Pe,onOpenChange:Y,children:(0,u.jsxs)(a.DialogContent,{children:[(0,u.jsx)(a.DialogHeader,{children:(0,u.jsx)(a.DialogTitle,{children:k})}),(0,u.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),Ie()},children:[(0,u.jsx)(i.Input,{label:Ce,type:`url`,value:X,onChange:e=>Fe(e.target.value),fullWidth:!0}),(0,u.jsxs)(a.DialogFooter,{children:[(0,u.jsx)(a.DialogClose,{asChild:!0,children:(0,u.jsx)(n.Button,{variant:`ghost`,type:`button`,children:Te})}),(0,u.jsx)(n.Button,{variant:`solid`,type:`submit`,children:we})]})]})]})})]})})};f.displayName=`RichTextEditor`,exports.RichTextEditor=f;
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/bold.cjs"),r=require("../../../icon/eraser.cjs"),i=require("../../../icon/italic.cjs"),a=require("../../../icon/link.cjs"),ee=require("../../../icon/list-ordered.cjs"),te=require("../../../icon/list.cjs"),ne=require("../../../icon/strikethrough.cjs"),re=require("../../../icon/underline.cjs"),ie=require("../../../icon/unlink.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("../Button/Button.cjs"),ae=require("../FieldTemplate/FieldTemplate.cjs"),oe=require("../Input/Input.cjs"),c=require("../../overlay/Dialog/Dialog.cjs"),l=require("./commands.cjs"),u=require("./rich-text-editor.module.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("classnames");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var se=[`bold`,`italic`,`underline`,`strikethrough`,`separator`,`h1`,`h2`,`h3`,`separator`,`ul`,`ol`,`separator`,`link`,`unlink`,`separator`,`removeFormat`],m=d.default.memo(({onClick:e,active:t,disabled:n,title:r,children:i})=>(0,p.jsx)(`button`,{type:`button`,className:(0,f.default)(u.default.toolbarBtn,t&&u.default.active),onClick:e,disabled:n,title:r,"aria-label":r,"aria-pressed":t,tabIndex:-1,children:i}));m.displayName=`ToolbarButton`;var h=({value:e,defaultValue:h=``,onChange:g,placeholder:ce,disabled:le,intent:ue=`default`,variant:de=`outline`,fullWidth:_=!1,width:v,minHeight:y=200,label:b,error:x,required:S,layout:fe,className:pe,id:me,toolbar:he=se,labels:ge={},"aria-label":_e,"aria-labelledby":C})=>{let{t:w}=t.useWimTranslation(`components`),{bold:ve=w(`a11y.rte_bold`),italic:T=w(`a11y.rte_italic`),underline:E=w(`a11y.rte_underline`),strikethrough:ye=w(`a11y.rte_strikethrough`),h1:be=w(`a11y.rte_h1`),h2:xe=w(`a11y.rte_h2`),h3:Se=w(`a11y.rte_h3`),ul:Ce=w(`a11y.rte_ul`),ol:we=w(`a11y.rte_ol`),link:D=w(`a11y.rte_link`),unlink:Te=w(`a11y.rte_unlink`),removeFormat:O=w(`a11y.rte_remove_format`),toolbar:Ee=w(`a11y.rte_toolbar`),linkPrompt:De=w(`a11y.rte_link_prompt`),linkApply:Oe=w(`a11y.rte_link_apply`),linkCancel:ke=w(`a11y.rte_link_cancel`)}=ge,k=d.default.useRef(null),A=d.default.useRef(!1),j=d.default.useRef(e??h),[M,Ae]=d.default.useState(new Set),je=d.default.useId(),N=me||`wim-rte-${je}`,P=x?`${N}-error`:void 0,F=b?`${N}-label`:void 0,I=le,L=x?`danger`:ue,R=typeof v==`string`&&[`xs`,`sm`,`md`,`lg`,`xl`].includes(v),z=v!==void 0&&!R&&!_,B=R&&!_?v:void 0,Me=B?u.default[`width${B.charAt(0).toUpperCase()}${B.slice(1)}`]:void 0,V=d.default.useRef(e===void 0?h:e),H=d.default.useCallback(()=>{k.current&&Ae(l.getActiveFormats(k.current))},[]),U=d.default.useRef([]),W=d.default.useRef(-1),G=d.default.useRef(void 0),K=d.default.useCallback(e=>{let t=U.current,n=W.current;if(t[n]===e)return;let r=[...t.slice(0,n+1),e];r.length>100&&(r=r.slice(1)),U.current=r,W.current=r.length-1},[]),q=d.default.useCallback(()=>{G.current!==void 0&&(clearTimeout(G.current),G.current=void 0,K(j.current))},[K]),J=d.default.useCallback(e=>{q();let t=U.current,n=W.current+e;if(n<0||n>=t.length||!k.current)return;W.current=n;let r=t[n];k.current.innerHTML=r,j.current=r,g?.(r);let i=document.createRange();i.selectNodeContents(k.current),i.collapse(!1);let a=window.getSelection();a?.removeAllRanges(),a?.addRange(i),H()},[q,g,H]),Y=d.default.useCallback(e=>{if(I||!k.current)return;let t=k.current,n=l.getEditorRange(t)?.cloneRange()??null;if(t.focus(),n){let e=window.getSelection();e?.removeAllRanges(),e?.addRange(n)}q(),K(t.innerHTML),e(t),H();let r=t.innerHTML;j.current=r,K(r),g?.(r)},[I,q,K,g,H]),Ne=d.default.useCallback(()=>{Y(e=>l.removeAllFormatting(e))},[Y]),[Pe,X]=d.default.useState(!1),[Z,Fe]=d.default.useState(`https://`),Q=d.default.useRef(null),Ie=d.default.useCallback(()=>{if(I||!k.current)return;k.current.focus();let e=l.getEditorRange(k.current);Q.current=e?e.cloneRange():null;let t=e?.toString()??``;Fe(t.startsWith(`http`)?t:`https://`),X(!0)},[I]),Le=d.default.useCallback(()=>{let e=Z.trim();if(X(!1),!e||!k.current)return;let t=window.getSelection();if(t?.removeAllRanges(),Q.current)t?.addRange(Q.current);else{let e=document.createRange();e.selectNodeContents(k.current),e.collapse(!1),t?.addRange(e)}Y(t=>l.createLink(t,e))},[Z,Y]),$=d.default.useCallback(()=>{if(A.current)return;let e=k.current?.innerHTML??``;e!==j.current&&(j.current=e,g?.(e),G.current!==void 0&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=void 0,K(j.current)},400)),H()},[g,K,H]),Re=d.default.useCallback(e=>{let t=e.nativeEvent.inputType;t===`historyUndo`?(e.preventDefault(),J(-1)):t===`historyRedo`&&(e.preventDefault(),J(1))},[J]),ze=d.default.useCallback(e=>{if(!(e.ctrlKey||e.metaKey))return;let t=e.key.toLowerCase();t===`z`?(e.preventDefault(),J(e.shiftKey?1:-1)):t===`y`&&(e.preventDefault(),J(1))},[J]),Be=d.default.useCallback(()=>{H()},[H]),Ve=d.default.useCallback(()=>{H()},[H]),He=d.default.useCallback(()=>{A.current=!0},[]),Ue=d.default.useCallback(()=>{A.current=!1,$()},[$]),We=d.default.useCallback(e=>{e.preventDefault()},[]);d.default.useEffect(()=>{k.current&&(k.current.innerHTML=V.current,j.current=V.current,U.current=[V.current],W.current=0)},[]),d.default.useEffect(()=>{e!==void 0&&k.current&&k.current.innerHTML!==e&&(k.current.innerHTML=e,j.current=e)},[e]);let Ge=d.default.useCallback((e,t)=>{if(e===`separator`)return(0,p.jsx)(`span`,{className:u.default.toolbarSep,"aria-hidden":`true`},`sep-${t}`);let s={disabled:I,active:M.has(e)};switch(e){case`bold`:return(0,p.jsx)(m,{...s,title:ve,onClick:()=>Y(e=>l.toggleInline(e,`bold`)),children:(0,p.jsx)(o.Icon,{component:n.default,size:`sm`})},`bold`);case`italic`:return(0,p.jsx)(m,{...s,title:T,onClick:()=>Y(e=>l.toggleInline(e,`italic`)),children:(0,p.jsx)(o.Icon,{component:i.default,size:`sm`})},`italic`);case`underline`:return(0,p.jsx)(m,{...s,title:E,onClick:()=>Y(e=>l.toggleInline(e,`underline`)),children:(0,p.jsx)(o.Icon,{component:re.default,size:`sm`})},`underline`);case`strikethrough`:return(0,p.jsx)(m,{...s,title:ye,onClick:()=>Y(e=>l.toggleInline(e,`strikethrough`)),children:(0,p.jsx)(o.Icon,{component:ne.default,size:`sm`})},`strikethrough`);case`h1`:return(0,p.jsx)(m,{...s,active:M.has(`h1`),title:be,onClick:()=>Y(e=>l.setBlock(e,`h1`)),children:(0,p.jsx)(`span`,{"aria-hidden":`true`,children:`H1`})},`h1`);case`h2`:return(0,p.jsx)(m,{...s,active:M.has(`h2`),title:xe,onClick:()=>Y(e=>l.setBlock(e,`h2`)),children:(0,p.jsx)(`span`,{"aria-hidden":`true`,children:`H2`})},`h2`);case`h3`:return(0,p.jsx)(m,{...s,active:M.has(`h3`),title:Se,onClick:()=>Y(e=>l.setBlock(e,`h3`)),children:(0,p.jsx)(`span`,{"aria-hidden":`true`,children:`H3`})},`h3`);case`ul`:return(0,p.jsx)(m,{...s,title:Ce,onClick:()=>Y(e=>l.toggleList(e,`ul`)),children:(0,p.jsx)(o.Icon,{component:te.default,size:`sm`})},`ul`);case`ol`:return(0,p.jsx)(m,{...s,title:we,onClick:()=>Y(e=>l.toggleList(e,`ol`)),children:(0,p.jsx)(o.Icon,{component:ee.default,size:`sm`})},`ol`);case`link`:return(0,p.jsx)(m,{...s,title:D,onClick:Ie,children:(0,p.jsx)(o.Icon,{component:a.default,size:`sm`})},`link`);case`unlink`:return(0,p.jsx)(m,{...s,title:Te,onClick:()=>Y(e=>l.removeLink(e)),children:(0,p.jsx)(o.Icon,{component:ie.default,size:`sm`})},`unlink`);case`removeFormat`:return(0,p.jsx)(m,{...s,title:O,onClick:Ne,children:(0,p.jsx)(o.Icon,{component:r.default,size:`sm`})},`removeFormat`);default:return null}},[M,I,ve,T,E,ye,be,xe,Se,Ce,we,D,Te,O,Y,Ie,Ne]);return(0,p.jsx)(ae.FieldTemplate,{label:b,error:x,required:S,layout:fe,labelId:F,errorId:P,className:pe,children:(0,p.jsxs)(`div`,{className:(0,f.default)(`wim-rich-text-editor`,u.default.root,u.default[L],I&&u.default.disabled,u.default[de],_&&u.default.fullWidth,z&&u.default.hasCustomWidth,Me),style:z?{"--wim-input-width":typeof v==`number`?`${v}px`:v}:void 0,children:[(0,p.jsx)(`div`,{className:u.default.toolbar,role:`toolbar`,"aria-label":Ee,"aria-controls":N,onMouseDown:We,children:he.map((e,t)=>Ge(e,t))}),(0,p.jsx)(`div`,{ref:k,id:N,className:u.default.content,contentEditable:!I,suppressContentEditableWarning:!0,role:`textbox`,"aria-multiline":!0,"aria-label":_e??(b||C?void 0:w(`a11y.rte_editor`)),"aria-labelledby":C??(b?F:void 0),"aria-invalid":L===`danger`,"aria-describedby":P,"aria-required":S,"aria-disabled":I,"aria-placeholder":ce,"data-placeholder":ce,tabIndex:I?-1:0,style:{minHeight:typeof y==`number`?`${y}px`:y,outline:`none`},onInput:$,onBeforeInput:Re,onKeyDown:ze,onKeyUp:Be,onMouseUp:Ve,onCompositionStart:He,onCompositionEnd:Ue}),(0,p.jsx)(c.Dialog,{open:Pe,onOpenChange:X,children:(0,p.jsxs)(c.DialogContent,{children:[(0,p.jsx)(c.DialogHeader,{children:(0,p.jsx)(c.DialogTitle,{children:D})}),(0,p.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),Le()},children:[(0,p.jsx)(oe.Input,{label:De,type:`url`,value:Z,onChange:e=>Fe(e.target.value),fullWidth:!0}),(0,p.jsxs)(c.DialogFooter,{children:[(0,p.jsx)(c.DialogClose,{asChild:!0,children:(0,p.jsx)(s.Button,{variant:`ghost`,type:`button`,children:ke})}),(0,p.jsx)(s.Button,{variant:`solid`,type:`submit`,children:Oe})]})]})]})})]})})};h.displayName=`RichTextEditor`,exports.RichTextEditor=h;
|