@npm-questionpro/wick-ui-editor 2.0.0-next.9 → 2.1.0-rc.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/README.md +61 -23
- package/dist/html.d.ts +1 -0
- package/dist/sanitize-BZ0U7q7z.js +213 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-editor/es/html.js +88 -0
- package/dist/wick-ui-editor/es/index.js +803 -845
- package/package.json +17 -23
- package/dist/html-Ccb8eKR4.js +0 -7158
- package/dist/standalone-DSxjHhed.js +0 -3574
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @npm-questionpro/wick-ui-editor
|
|
2
2
|
|
|
3
|
-
A rich text editor component built with React and TipTap. Part of the Wick UI
|
|
4
|
-
design system.
|
|
3
|
+
A rich text editor component built with React and TipTap. Part of the Wick UI design system.
|
|
5
4
|
|
|
6
5
|
[](https://www.npmjs.com/package/@npm-questionpro/wick-ui-editor)
|
|
7
6
|
[](https://opensource.org/licenses/ISC)
|
|
@@ -19,42 +18,81 @@ pnpm add @npm-questionpro/wick-ui-editor
|
|
|
19
18
|
yarn add @npm-questionpro/wick-ui-editor
|
|
20
19
|
```
|
|
21
20
|
|
|
21
|
+
Standalone — no dependency on `@npm-questionpro/wick-ui-lib` or `@npm-questionpro/wick-ui-icon`.
|
|
22
|
+
|
|
22
23
|
## Usage
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
```tsx
|
|
26
|
+
import {WuContentEditor} from '@npm-questionpro/wick-ui-editor'
|
|
27
|
+
import '@npm-questionpro/wick-ui-editor/dist/style.css'
|
|
28
|
+
|
|
29
|
+
function App() {
|
|
30
|
+
return <WuContentEditor defaultValue="<p>Start typing...</p>" onUpdate={html => console.log(html)} />
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### HTML Source Mode (opt-in)
|
|
35
|
+
|
|
36
|
+
Raw-HTML editing (with syntax highlighting via shiki and formatting via prettier) is a separate subpath so its weight
|
|
37
|
+
never reaches apps that don't use it. Both libraries are regular dependencies — nothing extra to install — and they are
|
|
38
|
+
loaded lazily at runtime, only when HTML Source Mode is opened.
|
|
25
39
|
|
|
26
40
|
```tsx
|
|
27
41
|
import {WuContentEditor} from '@npm-questionpro/wick-ui-editor'
|
|
42
|
+
import {WuHtmlSource} from '@npm-questionpro/wick-ui-editor/html'
|
|
28
43
|
|
|
29
44
|
function App() {
|
|
30
|
-
return
|
|
31
|
-
<WuContentEditor
|
|
32
|
-
defaultValue="<p>Start typing...</p>"
|
|
33
|
-
onUpdate={html => console.log(html)}
|
|
34
|
-
/>
|
|
35
|
-
)
|
|
45
|
+
return <WuContentEditor htmlSource={WuHtmlSource} />
|
|
36
46
|
}
|
|
37
47
|
```
|
|
38
48
|
|
|
49
|
+
Without `htmlSource`, the `html` toolbar button is hidden and `isHtml`/`setIsHtml` have no effect.
|
|
50
|
+
|
|
51
|
+
### Theming
|
|
52
|
+
|
|
53
|
+
The editor styles itself with `--we-*` tokens that resolve to the host's `--wu-*` theme values (from wick-ui-lib) when
|
|
54
|
+
present, and fall back to built-in defaults otherwise. No setup needed either way.
|
|
55
|
+
|
|
39
56
|
## Props
|
|
40
57
|
|
|
41
|
-
| Prop | Type
|
|
42
|
-
| ----------------------- |
|
|
43
|
-
| `defaultValue` | `string`
|
|
44
|
-
| `onUpdate` | `(html: string) => void`
|
|
45
|
-
| `readonly` | `boolean`
|
|
46
|
-
| `renderHtml` | `boolean`
|
|
47
|
-
| `toolbarPosition` | `'top' \| 'bottom'`
|
|
48
|
-
| `toolbarItems` | `IToolbarExtensionKey[]`
|
|
49
|
-
| `hideToolbar` | `boolean`
|
|
50
|
-
| `customFonts` | `string[]`
|
|
51
|
-
| `customToolbarChildren` | `ReactNode`
|
|
52
|
-
| `
|
|
58
|
+
| Prop | Type | Default | Description |
|
|
59
|
+
| ----------------------- | ------------------------- | ----------- | ------------------------------------- |
|
|
60
|
+
| `defaultValue` | `string` | `undefined` | Initial HTML content (auto-sanitized) |
|
|
61
|
+
| `onUpdate` | `(html: string) => void` | `undefined` | Fires when content changes |
|
|
62
|
+
| `readonly` | `boolean` | `false` | Disable editing |
|
|
63
|
+
| `renderHtml` | `boolean` | `false` | Render raw HTML in read-only mode |
|
|
64
|
+
| `toolbarPosition` | `'top' \| 'bottom'` | `'top'` | Toolbar placement |
|
|
65
|
+
| `toolbarItems` | `IToolbarExtensionKey[]` | all | Toolbar buttons to show |
|
|
66
|
+
| `hideToolbar` | `boolean` | `false` | Hide the toolbar |
|
|
67
|
+
| `customFonts` | `string[]` | `undefined` | Extra font families in font picker |
|
|
68
|
+
| `customToolbarChildren` | `ReactNode` | `undefined` | Custom elements appended to toolbar |
|
|
69
|
+
| `htmlSource` | `ComponentType` | `undefined` | HTML Source view (see above) |
|
|
70
|
+
| `isHtml` / `setIsHtml` | `boolean` / `(b) => void` | `undefined` | Controlled HTML Source Mode |
|
|
71
|
+
| `className` | `string` | `undefined` | Class on the root container |
|
|
72
|
+
|
|
73
|
+
## Migrating from v1
|
|
74
|
+
|
|
75
|
+
### HTML source mode now requires `htmlSource`
|
|
76
|
+
|
|
77
|
+
`isHtml`/`setIsHtml` are no-ops without the new prop. Pass the source view explicitly:
|
|
78
|
+
|
|
79
|
+
```diff
|
|
80
|
+
+ import {WuHtmlSource} from '@npm-questionpro/wick-ui-editor/html'
|
|
81
|
+
|
|
82
|
+
<WuContentEditor
|
|
83
|
+
+ htmlSource={WuHtmlSource}
|
|
84
|
+
isHtml={isHtml}
|
|
85
|
+
setIsHtml={setIsHtml}
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If you don't use HTML source mode, remove `isHtml` and `setIsHtml`.
|
|
90
|
+
|
|
91
|
+
---
|
|
53
92
|
|
|
54
93
|
## Documentation
|
|
55
94
|
|
|
56
|
-
Full documentation and interactive examples:
|
|
57
|
-
[wick-ui-lib.pages.dev](https://wick-ui-lib.pages.dev)
|
|
95
|
+
Full documentation and interactive examples: [wick-ui-lib.pages.dev](https://wick-ui-lib.pages.dev)
|
|
58
96
|
|
|
59
97
|
## License
|
|
60
98
|
|
package/dist/html.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { }
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
3
|
+
import r from "dompurify";
|
|
4
|
+
var t = ({ d: q, ...v }) => /* @__PURE__ */ T("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 -960 960 960",
|
|
7
|
+
width: "1em",
|
|
8
|
+
height: "1em",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
...v,
|
|
13
|
+
children: /* @__PURE__ */ T("path", { d: q })
|
|
14
|
+
}), o = (q) => /* @__PURE__ */ T(t, {
|
|
15
|
+
d: "M370-192q-45 0-75.5-30.5T264-298v-364q0-45 30.5-75.5T370-768h128q71 0 124.5 43T676-614q0 38-19 70.5T604-494v6q43 13 67.5 50t24.5 82q0 72-58 118t-134 46H370Zm10-104h116q32 0 57-20t25-51q0-31-25-51t-57-20H380v142Zm0-240h108q29 0 51.5-18t22.5-47q0-29-22.5-47T488-666H380v130Z",
|
|
16
|
+
...q
|
|
17
|
+
}), s = (q) => /* @__PURE__ */ T(t, {
|
|
18
|
+
d: "M251-191q-26.46 0-44.73-18.27Q188-227.54 188-254q0-26.46 18.27-44.73Q224.54-317 251-317h101l108-324h-92q-26.46 0-44.73-18.27Q305-677.54 305-704q0-26.46 18.27-44.73Q341.54-767 368-767h300q26.46 0 44.73 18.27Q731-730.46 731-704q0 26.46-18.27 44.73Q694.46-641 668-641h-81L479-317h72q26.46 0 44.73 18.27Q614-280.46 614-254q0 26.46-18.27 44.73Q577.46-191 551-191H251Z",
|
|
19
|
+
...q
|
|
20
|
+
}), m = (q) => /* @__PURE__ */ T(t, {
|
|
21
|
+
d: "M240-66q-26 0-44.5-18.5T177-129q0-26 18.5-44.5T240-192h480q26 0 44.5 18.5T783-129q0 26-18.5 44.5T720-66H240Zm240-206q-112 0-174-69t-62-184v-219q0-31 22-52.5t53-21.5q31 0 52.5 21.5T393-744v225q0 45 22 74t65 29q43 0 65-29t22-74v-225q0-31 22-52.5t53-21.5q31 0 52.5 21.5T716-744v219q0 115-62 184t-174 69Z",
|
|
22
|
+
...q
|
|
23
|
+
}), Q = (q) => /* @__PURE__ */ T(t, {
|
|
24
|
+
d: "M91.14-392q-18.33 0-30.74-13Q48-418 48-436.19q0-18.2 13-30.5Q74-479 92.33-479h776.53q18.33 0 30.74 12.31 12.4 12.3 12.4 30.5Q912-418 899-405t-31.33 13H91.14ZM411-559v-136H237q-29 0-48.5-20.18-19.5-20.17-19.5-49 0-28.82 19.5-48.32T237-832h487q29 0 48.5 19.5t19.5 48.32q0 28.83-19.5 49Q753-695 724-695H550v136H411Zm0 247h139v115q0 28.75-20.38 48.87Q509.24-128 480.12-128T431-148.42q-20-20.41-20-49.58v-114Z",
|
|
25
|
+
...q
|
|
26
|
+
}), n = (q) => /* @__PURE__ */ T(t, {
|
|
27
|
+
d: "M101 0Q79 0 63.5-15.5T48-53v-100q0-22 15.5-37.5T101-206h758q22 0 37.5 15.5T912-153v100q0 22-15.5 37.5T859 0H101Zm186-286q-32 0-50.5-26t-7.5-56l165-460q7-20 24-32t38-12h48q21 0 38 12t24 32l167 464q11 29-6.5 53.5T678-286q-20 0-36-12t-22-31l-30-93H376l-32 95q-6 18-21.5 29.5T287-286Zm125-244h138l-68-212h-4l-66 212Z",
|
|
28
|
+
...q
|
|
29
|
+
}), i = (q) => /* @__PURE__ */ T(t, {
|
|
30
|
+
d: "M178 46q-44 0-75-30.5T72-60q0-45 30.5-75.5T178-166h604q44 0 75 30.5T888-60q0 45-30.5 75.5T782 46H178Zm-55-345v-150q0-11 4-20t12-17l453-451q12-11 26.5-17t29.5-6q15 0 30 5.5t26 17.5l110 111q11 12 17 26.5t6 29.5q0 15-6 29.5T814-714L363-261q-8 8-17 11.5t-20 3.5H176q-22 0-37.5-15.5T123-299Zm524-395 76-76-76-76-76 76 76 76Z",
|
|
31
|
+
...q
|
|
32
|
+
}), d = (q) => /* @__PURE__ */ T(t, {
|
|
33
|
+
d: "m245-297 49-85q-74-8-117-60t-43-118q0-75 52.5-127.5T314-740q75 0 127.5 52.5T494-560q0 26-6 46.5T470-472L337-244q-7 12-19.5 19t-26.5 7q-31 0-46-26.5t0-52.5Zm373 0 48-85q-74-8-117-60t-43-118q0-75 52.5-127.5T686-740q75 0 127.5 52.5T866-560q0 26-6 46.5T842-472L711-245q-7 12-19.5 19.5T665-218q-31 0-46.5-26.5T618-297Z",
|
|
34
|
+
...q
|
|
35
|
+
}), c = (q) => /* @__PURE__ */ T(t, {
|
|
36
|
+
d: "m206-480 148 148q16 16 16 37.5T354-257q-16 16-37.5 16T279-257L92-444q-8.18-7.93-11.59-17.18T77-481q0-10.57 3.41-19.82T92-518l187-187q16-16 38-16t38 16q16 16 16 38t-16 38L206-480Zm550-4L607-633q-15-15-14.5-36.5T608-706q15-15 36.5-15t36.5 15l187 188q8.18 7.93 11.59 17.18T883-481q0 10.57-3.41 19.82T868-444L682-258q-16.36 16-38.18 15.5T606-259q-16-16-15.5-38t16.5-38l149-149Z",
|
|
37
|
+
...q
|
|
38
|
+
}), M = (q) => /* @__PURE__ */ T(t, {
|
|
39
|
+
d: "M-19-388v-184q0-16.47 10.77-27.23Q2.53-610 19-610t27.23 10.77Q57-588.47 57-572v44h68v-44q0-16.47 10.77-27.23Q146.53-610 163-610t27.23 10.77Q201-588.47 201-572v184q0 16.47-10.77 27.23Q179.47-350 163-350t-27.23-10.77Q125-371.53 125-388v-64H57v64q0 16.47-10.77 27.23Q35.47-350 19-350t-27.23-10.77Q-19-371.53-19-388Zm318 0v-144h-33q-16 0-27.5-11.07t-11.5-28Q227-588 238.05-599T266-610h142q16 0 27.5 11.07t11.5 28Q447-554 435.95-543T408-532h-33v144q0 16.47-10.77 27.23Q353.47-350 337-350t-27.23-10.77Q299-371.53 299-388Zm169-1v-175q0-19.55 13.8-32.78Q495.6-610 516-610h204q20.4 0 34.2 13.22Q768-583.55 768-564v175q0 16-11.07 27.5t-28 11.5Q712-350 701-361.05T690-389v-143h-44v114q0 11-7.93 19.5-7.94 8.5-20.07 8.5-11 0-19.5-8.5T590-418v-114h-44v143q0 16-11.07 27.5t-28 11.5Q490-350 479-361.05T468-389Zm370 39q-17.33 0-28.67-11.33Q798-372.67 798-390v-181q0-16 11.07-27.5t28-11.5Q854-610 865-598.95T876-571v143h63q16 0 27.5 11.07t11.5 28Q978-372 966.95-361T939-350H838Z",
|
|
40
|
+
...q
|
|
41
|
+
}), u = (q) => /* @__PURE__ */ T(t, {
|
|
42
|
+
d: "M651-128q-22.1 0-37.05-15.5Q599-159 599-181.07t15.5-37Q630-233 652-233h22q22 0 37.5-15.5T727-286v-62q0-43.7 25-79.35Q777-463 819-478v-12q-42-8-67-43t-25-79v-62q0-22-15.5-37.5T674-727h-23q-22.1 0-37.05-15.5Q599-758 599-780.07t15.5-37Q630-832 652-832h43q57.08 0 97.04 40.25Q832-751.5 832-694v62q0 22 14.09 37.5Q860.17-579 881-579q13.17 0 22.09 8.91Q912-561.17 912-548v136q0 13.17-8.91 22.09Q894.17-381 881-381q-20.83 0-34.91 15.5Q832-350 832-328v62q0 57.5-39.96 97.75T695-128h-44Zm-386 0q-57.08 0-97.04-40.25Q128-208.5 128-266v-62q0-22-15.53-37.5Q96.95-381 74-381q-11.05 0-18.53-7.48Q48-395.95 48-407v-146q0-11.05 7.47-18.53Q62.95-579 74-579q22.95 0 38.47-15.5Q128-610 128-632v-62q0-57.5 39.96-97.75T265-832h44q22.1 0 37.05 14.93 14.95 14.93 14.95 37t-14.95 37.57Q331.1-727 309-727h-23q-22 0-37.5 15.5T233-674v62q0 44-25 79t-67 43v12q42 15 67 50.65T233-348v62q0 22 15.5 37.5T286-233h23q22.1 0 37.05 14.93 14.95 14.93 14.95 37t-14.95 37.57Q331.1-128 309-128h-44Z",
|
|
43
|
+
...q
|
|
44
|
+
}), I = (q) => /* @__PURE__ */ T(t, {
|
|
45
|
+
d: "M813-128q-22 0-37.5-15.5T760-181v-54q0-22 15.5-37.5T813-288h87v-40H790q-13 0-21.5-8.5T760-358q0-13 8.5-21.5T790-388h117q22 0 37.5 15.5T960-335v54q0 22-15.5 37.5T907-228h-87v40h110q13 0 21.5 8.5T960-158q0 13-8.5 21.5T930-128H813ZM315-228q-35 0-52-30.5t1-59.5l136-224-123-202q-18-29-1-58.5t51-29.5q16 0 29 7.5t21 21.5l96 161 95-161q8-14 21.5-21.5T619-832q35 0 53 31t-1 61L549-542l135 222q18 30 1 61t-52 31q-16 0-30.5-8T580-258L473-437 365-256q-8 14-21 21t-29 7Z",
|
|
46
|
+
...q
|
|
47
|
+
}), L = (q) => /* @__PURE__ */ T(t, {
|
|
48
|
+
d: "M813-572q-22 0-37.5-15.5T760-625v-54q0-22 15.5-37.5T813-732h87v-40H790q-13 0-21.5-8.5T760-802q0-13 8.5-21.5T790-832h117q22 0 37.5 15.5T960-779v54q0 22-15.5 37.5T907-672h-87v40h110q13 0 21.5 8.5T960-602q0 13-8.5 21.5T930-572H813ZM315-128q-35 0-52-30.5t1-59.5l136-224-123-202q-18-29-1-58.5t51-29.5q16 0 29 7.5t21 21.5l96 161 95-161q8-14 21.5-21.5T619-732q35 0 53 31t-1 61L549-442l135 222q18 30 1 61t-52 31q-16 0-30.5-8T580-158L473-337 365-156q-8 14-21 21t-29 7Z",
|
|
49
|
+
...q
|
|
50
|
+
}), p = (q) => /* @__PURE__ */ T(t, {
|
|
51
|
+
d: "M200-94q-44 0-75-31t-31-75v-560q0-44 31-75t75-31h560q44 0 75 31t31 75v560q0 44-31 75t-75 31H200Zm75-170h410q17 0 24-14.5t-3-27.5L593-458q-8-11-21-10.5T551-457L450-322l-71-94q-8-11-21-11t-21 11l-83 110q-10 13-3 27.5t24 14.5Z",
|
|
52
|
+
...q
|
|
53
|
+
}), g = (q) => /* @__PURE__ */ T(t, {
|
|
54
|
+
d: "M274-254q-94 0-160-66T48-480q0-94 66-160t160-66h121q22 0 37.5 15.5T448-653q0 22-15.5 37.5T395-600H274q-50 0-85 35t-35 85q0 50 35 85t85 35h121q22 0 37.5 15.5T448-307q0 22-15.5 37.5T395-254H274Zm83-174q-22 0-37.5-15.5T304-481q0-22 15.5-37.5T357-534h246q22 0 37.5 15.5T656-481q0 22-15.5 37.5T603-428H357Zm208 174q-22 0-37.5-15.5T512-307q0-22 15.5-37.5T565-360h121q50 0 85-35t35-85q0-50-35-85t-85-35H565q-22 0-37.5-15.5T512-653q0-22 15.5-37.5T565-706h121q94 0 160 66t66 160q0 94-66 160t-160 66H565Z",
|
|
55
|
+
...q
|
|
56
|
+
}), f = (q) => /* @__PURE__ */ T(t, {
|
|
57
|
+
d: "M88-193v-574q0-44 30.5-74.5T193-872h574q44 0 74.5 30.5T872-767v573q0 43.73-30.5 74.86Q811-88 767-88H193q-44 0-74.5-30.5T88-193Zm106-453h572v-120H194v120Zm225 226h122v-120H419v120Zm0 226h122v-120H419v120ZM194-420h120v-120H194v120Zm452 0h120v-120H646v120ZM194-194h120v-120H194v120Zm452 0h120v-120H646v120Z",
|
|
58
|
+
...q
|
|
59
|
+
}), A = (q) => /* @__PURE__ */ T(t, {
|
|
60
|
+
d: "M531-535 430-636l-20-20-20-20q-25-25-11-57.5t49-32.5h313q27 0 46 19t19 46q0 27-19 46t-46 19H574l-43 101ZM765-83 466-382l-64 151q-8 18-24 28.5T342-192q-35 0-54-29t-5-61l84-198L83-765q-12-12-12-29t12-29q12-12 29-12t29 12l682 682q12 12 12 29t-12 29q-12 12-29 12t-29-12Z",
|
|
61
|
+
...q
|
|
62
|
+
}), w = (q) => /* @__PURE__ */ T(t, {
|
|
63
|
+
d: "M141-88q-22 0-37.5-15.5T88-142q0-23 15.5-38t38.5-15h677q22 0 37.5 15t15.5 38q0 23-15.5 38.5T818-88H141Zm0-171q-22 0-37.5-15.5T88-312q0-22 15.5-37.5T141-365h438q22 0 37.5 15.5T632-312q0 22-15.5 37.5T579-259H141Zm0-168q-22 0-37.5-15.5T88-480q0-22 15.5-37.5T141-533h678q22 0 37.5 15.5T872-480q0 22-15.5 37.5T819-427H141Zm0-170q-22 0-37.5-15.5T88-650q0-22 15.5-37.5T141-703h438q22 0 37.5 15.5T632-650q0 22-15.5 37.5T579-597H141Zm0-169q-22 0-37.5-15.5T88-819q0-22 15.5-37.5T141-872h678q22 0 37.5 15.5T872-819q0 22-15.5 37.5T819-766H141Z",
|
|
64
|
+
...q
|
|
65
|
+
}), b = (q) => /* @__PURE__ */ T(t, {
|
|
66
|
+
d: "M141-88q-22 0-37.5-15.5T88-142q0-23 15.5-38t38.5-15h677q22 0 37.5 15t15.5 38q0 23-15.5 38.5T818-88H141Zm160-171q-22 0-37.5-15.5T248-312q0-22 15.5-37.5T301-365h358q22 0 37.5 15.5T712-312q0 22-15.5 37.5T659-259H301ZM141-427q-22 0-37.5-15.5T88-480q0-22 15.5-37.5T141-533h678q22 0 37.5 15.5T872-480q0 22-15.5 37.5T819-427H141Zm160-170q-22 0-37.5-15.5T248-650q0-22 15.5-37.5T301-703h358q22 0 37.5 15.5T712-650q0 22-15.5 37.5T659-597H301ZM141-766q-22 0-37.5-15.5T88-819q0-22 15.5-37.5T141-872h678q22 0 37.5 15.5T872-819q0 22-15.5 37.5T819-766H141Z",
|
|
67
|
+
...q
|
|
68
|
+
}), C = (q) => /* @__PURE__ */ T(t, {
|
|
69
|
+
d: "M141-765q-22 0-37.5-15.5T88-819q0-23 15.5-38t38.5-15h677q22 0 37.5 15t15.5 38q0 23-15.5 38.5T818-765H141Zm240 170q-22 0-37.5-15.5T328-648q0-22 15.5-37.5T381-701h438q22 0 37.5 15.5T872-648q0 22-15.5 37.5T819-595H381ZM141-427q-22 0-37.5-15.5T88-480q0-22 15.5-37.5T141-533h678q22 0 37.5 15.5T872-480q0 22-15.5 37.5T819-427H141Zm240 170q-22 0-37.5-15.5T328-310q0-22 15.5-37.5T381-363h438q22 0 37.5 15.5T872-310q0 22-15.5 37.5T819-257H381ZM141-88q-22 0-37.5-15.5T88-141q0-22 15.5-37.5T141-194h678q22 0 37.5 15.5T872-141q0 22-15.5 37.5T819-88H141Z",
|
|
70
|
+
...q
|
|
71
|
+
}), k = (q) => /* @__PURE__ */ T(t, {
|
|
72
|
+
d: "M141-88q-22 0-37.5-15.5T88-142q0-23 15.5-38t38.5-15h677q22 0 37.5 15t15.5 38q0 23-15.5 38.5T818-88H141Zm0-171q-22 0-37.5-15.5T88-312q0-22 15.5-37.5T141-365h678q22 0 37.5 15.5T872-312q0 22-15.5 37.5T819-259H141Zm0-168q-22 0-37.5-15.5T88-480q0-22 15.5-37.5T141-533h678q22 0 37.5 15.5T872-480q0 22-15.5 37.5T819-427H141Zm0-170q-22 0-37.5-15.5T88-650q0-22 15.5-37.5T141-703h678q22 0 37.5 15.5T872-650q0 22-15.5 37.5T819-597H141Zm0-169q-22 0-37.5-15.5T88-819q0-22 15.5-37.5T141-872h678q22 0 37.5 15.5T872-819q0 22-15.5 37.5T819-766H141Z",
|
|
73
|
+
...q
|
|
74
|
+
}), x = (q) => /* @__PURE__ */ T(t, {
|
|
75
|
+
d: "M413-128q-22 0-37.5-15.5T360-181v-225h-32q-85-5-142.5-66.5T128-619q0-89 62-151t151-62h358q22 0 37.5 15.5T752-779q0 22-15.5 37.5T699-726h-47v545q0 22-15.5 37.5T599-128q-22 0-37.5-15.5T546-181v-545h-80v545q0 22-15.5 37.5T413-128Z",
|
|
76
|
+
...q
|
|
77
|
+
}), S = (q) => /* @__PURE__ */ T(t, {
|
|
78
|
+
d: "M240-267q-22 0-37.5-15.5T187-320v-320q0-22 15.5-37.5T240-693q22 0 37.5 15.5T293-640v107h134v-107q0-22 15.5-37.5T480-693q22 0 37.5 15.5T533-640v320q0 22-15.5 37.5T480-267q-22 0-37.5-15.5T427-320v-107H293v107q0 22-15.5 37.5T240-267Zm506 0q-22 0-37.5-15.5T693-320v-267h-27q-22 0-37.5-15.5T613-640q0-22 15.5-37.5T666-693h80q22 0 37.5 15.5T799-640v320q0 22-15.5 37.5T746-267Z",
|
|
79
|
+
...q
|
|
80
|
+
}), D = (q) => /* @__PURE__ */ T(t, {
|
|
81
|
+
d: "M160-267q-22 0-37.5-15.5T107-320v-320q0-22 15.5-37.5T160-693q22 0 37.5 15.5T213-640v107h134v-107q0-22 15.5-37.5T400-693q22 0 37.5 15.5T453-640v320q0 22-15.5 37.5T400-267q-22 0-37.5-15.5T347-320v-107H213v107q0 22-15.5 37.5T160-267Zm426 0q-22 0-37.5-15.5T533-320v-107q0-45 30.5-75.5T639-533h134v-54H586q-22 0-37.5-15.5T533-640q0-22 15.5-37.5T586-693h187q45 0 75.5 30.5T879-587v54q0 45-30.5 75.5T773-427H639v54h187q22 0 37.5 15.5T879-320q0 22-15.5 37.5T826-267H586Z",
|
|
82
|
+
...q
|
|
83
|
+
}), O = (q) => /* @__PURE__ */ T(t, {
|
|
84
|
+
d: "M160-267q-22 0-37.5-15.5T107-320v-320q0-22 15.5-37.5T160-693q22 0 37.5 15.5T213-640v107h134v-107q0-22 15.5-37.5T400-693q22 0 37.5 15.5T453-640v320q0 22-15.5 37.5T400-267q-22 0-37.5-15.5T347-320v-107H213v107q0 22-15.5 37.5T160-267Zm400 0q-22 0-37.5-15.5T507-320q0-22 15.5-37.5T560-373h187v-54H640q-22 0-37.5-15.5T587-480q0-22 15.5-37.5T640-533h107v-54H560q-22 0-37.5-15.5T507-640q0-22 15.5-37.5T560-693h187q45 0 75.5 30.5T853-587v214q0 45-30.5 75.5T747-267H560Z",
|
|
85
|
+
...q
|
|
86
|
+
}), _ = (q) => /* @__PURE__ */ T(t, {
|
|
87
|
+
d: "M160-267q-22 0-37.5-15.5T107-320v-320q0-22 15.5-37.5T160-693q22 0 37.5 15.5T213-640v107h134v-107q0-22 15.5-37.5T400-693q22 0 37.5 15.5T453-640v320q0 22-15.5 37.5T400-267q-22 0-37.5-15.5T347-320v-107H213v107q0 22-15.5 37.5T160-267Zm626 0q-22 0-37.5-15.5T733-320v-67H586q-22 0-37.5-15.5T533-440v-200q0-22 15.5-37.5T586-693q22 0 37.5 15.5T639-640v147h94v-147q0-22 15.5-37.5T786-693q22 0 37.5 15.5T839-640v147h27q22 0 37.5 15.5T919-440q0 22-15.5 37.5T866-387h-27v67q0 22-15.5 37.5T786-267Z",
|
|
88
|
+
...q
|
|
89
|
+
}), y = (q) => /* @__PURE__ */ T(t, {
|
|
90
|
+
d: "M418-182q-22 0-37.5-15.5T365-235q0-22 15.5-37.5T418-288h400q22 0 37.5 15.5T871-235q0 22-15.5 37.5T818-182H418Zm0-246q-22 0-37.5-15.5T365-481q0-22 15.5-37.5T418-534h400q22 0 37.5 15.5T871-481q0 22-15.5 37.5T818-428H418Zm0-244q-22 0-37.5-15.5T365-725q0-22 15.5-37.5T418-778h400q22 0 37.5 15.5T871-725q0 22-15.5 37.5T818-672H418ZM186.88-136Q146-136 117-165.12q-29-29.11-29-70Q88-276 117.12-305q29.11-29 70-29Q228-334 257-304.88q29 29.11 29 70Q286-194 256.88-165q-29.11 29-70 29Zm0-246Q146-382 117-411.12q-29-29.11-29-70Q88-522 117.12-551q29.11-29 70-29Q228-580 257-550.88q29 29.11 29 70Q286-440 256.88-411q-29.11 29-70 29Zm0-244Q146-626 117-655.12q-29-29.11-29-70Q88-766 117.12-795q29.11-29 70-29Q228-824 257-794.88q29 29.11 29 70Q286-684 256.88-655q-29.11 29-70 29Z",
|
|
91
|
+
...q
|
|
92
|
+
}), B = (q) => /* @__PURE__ */ T(t, {
|
|
93
|
+
d: "M165-48q-14 0-24.5-10.5T130-83q0-14 10.5-24.5T165-118h65v-25h-30q-13 0-21.5-8.5T170-173q0-13 8.5-21.5T200-203h30v-25h-65q-14 0-24.5-10.5T130-263q0-14 10.5-24.5T165-298h90q19.13 0 32.06 12.94Q300-272.13 300-253v35q0 19.12-12.94 32.06Q274.13-173 255-173q19.13 0 32.06 12.94Q300-147.13 300-128v35q0 19.12-12.94 32.06Q274.13-48 255-48h-90Zm5-307q-17.33 0-28.67-11.33Q130-377.67 130-395v-70q0-19.13 12.94-32.06Q155.88-510 175-510h55v-25h-65q-14 0-24.5-10.5T130-570q0-14 10.5-24.5T165-605h90q19.13 0 32.06 12.94Q300-579.13 300-560v65q0 19.12-12.94 32.06Q274.13-450 255-450h-55v25h65q14 0 24.5 10.5T300-390q0 14-10.5 24.5T265-355h-95Zm55-308q-14 0-24.5-10.5T190-698v-155h-30q-13 0-21.5-8.5T130-883q0-13 8.5-21.5T160-913h60q17.33 0 28.67 11.33Q260-890.33 260-873v175q0 14-10.5 24.5T225-663Zm208 479q-22 0-37.5-15.5T380-237q0-22 15.5-37.5T433-290h386q22 0 37.5 15.5T872-237q0 22-15.5 37.5T819-184H433Zm0-244q-22 0-37.5-15.5T380-481q0-22 15.5-37.5T433-534h386q22 0 37.5 15.5T872-481q0 22-15.5 37.5T819-428H433Zm0-244q-22 0-37.5-15.5T380-725q0-22 15.5-37.5T433-778h386q22 0 37.5 15.5T872-725q0 22-15.5 37.5T819-672H433Z",
|
|
94
|
+
...q
|
|
95
|
+
}), E = (q) => /* @__PURE__ */ T(t, {
|
|
96
|
+
d: "m206-331 133-133q16-16 37-15.5t37 16.5q15 16 15 37.5T413-389L244-220q-16 16-37.5 16T169-220l-85-85q-15-15-15-37t15-37q15-15 37-15t37 15l48 48Zm0-320 133-133q16-16 37-15.5t37 16.5q15 16 15 37.5T413-709L244-540q-16 16-37.5 16T169-540l-85-85q-15-15-15-37t15-37q15-15 37-15t37 15l48 48Zm357 384q-22 0-37.5-15.5T510-320q0-22 15.5-37.5T563-373h296q22 0 37.5 15.5T912-320q0 22-15.5 37.5T859-267H563Zm0-320q-22 0-37.5-15.5T510-640q0-22 15.5-37.5T563-693h296q22 0 37.5 15.5T912-640q0 22-15.5 37.5T859-587H563Z",
|
|
97
|
+
...q
|
|
98
|
+
}), R = (q) => /* @__PURE__ */ T(t, {
|
|
99
|
+
d: "M427-428H221q-22 0-37.5-15.5T168-481q0-22 15.5-37.5T221-534h206v-206q0-22 15.5-37.5T480-793q22 0 37.5 15.5T533-740v206h206q22 0 37.5 15.5T792-481q0 22-15.5 37.5T739-428H533v206q0 22-15.5 37.5T480-169q-22 0-37.5-15.5T427-222v-206Z",
|
|
100
|
+
...q
|
|
101
|
+
}), j = ({ width: q = 14, height: v = 14, ...h }) => /* @__PURE__ */ T("svg", {
|
|
102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103
|
+
width: q,
|
|
104
|
+
height: v,
|
|
105
|
+
viewBox: "0 0 14 14",
|
|
106
|
+
fill: "none",
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
...h,
|
|
109
|
+
children: /* @__PURE__ */ T("path", {
|
|
110
|
+
d: "M1 1l12 12M13 1L1 13",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
strokeWidth: "1.75",
|
|
113
|
+
strokeLinecap: "round"
|
|
114
|
+
})
|
|
115
|
+
}), W = (q) => /* @__PURE__ */ T(t, {
|
|
116
|
+
d: "M276-88q-45 0-75.5-30.5T170-194v-530q-22 0-37.5-15.5T117-777q0-22 15.5-37.5T170-830h188q0-20 14-34t34-14h150q20 0 34 14t14 34h188q22 0 37.5 15.5T845-777q0 22-15.5 37.5T792-724v530q0 45-30.5 75.5T686-88H276Zm116-187q22 0 37.5-15.5T445-328v-262q0-22-15.5-37.5T392-643q-22 0-37.5 15.5T339-590v262q0 22 15.5 37.5T392-275Zm178 0q22 0 37.5-15.5T623-328v-262q0-22-15.5-37.5T570-643q-22 0-37.5 15.5T517-590v262q0 22 15.5 37.5T570-275Z",
|
|
117
|
+
...q
|
|
118
|
+
}), a = r();
|
|
119
|
+
a.setConfig({
|
|
120
|
+
USE_PROFILES: { html: !0 },
|
|
121
|
+
ALLOWED_TAGS: [
|
|
122
|
+
"div",
|
|
123
|
+
"p",
|
|
124
|
+
"br",
|
|
125
|
+
"strong",
|
|
126
|
+
"b",
|
|
127
|
+
"em",
|
|
128
|
+
"i",
|
|
129
|
+
"u",
|
|
130
|
+
"s",
|
|
131
|
+
"code",
|
|
132
|
+
"pre",
|
|
133
|
+
"blockquote",
|
|
134
|
+
"h1",
|
|
135
|
+
"h2",
|
|
136
|
+
"h3",
|
|
137
|
+
"h4",
|
|
138
|
+
"h5",
|
|
139
|
+
"h6",
|
|
140
|
+
"ul",
|
|
141
|
+
"ol",
|
|
142
|
+
"li",
|
|
143
|
+
"a",
|
|
144
|
+
"img",
|
|
145
|
+
"table",
|
|
146
|
+
"thead",
|
|
147
|
+
"tbody",
|
|
148
|
+
"tr",
|
|
149
|
+
"th",
|
|
150
|
+
"td",
|
|
151
|
+
"sup",
|
|
152
|
+
"sub"
|
|
153
|
+
],
|
|
154
|
+
ALLOWED_ATTR: [
|
|
155
|
+
"href",
|
|
156
|
+
"target",
|
|
157
|
+
"rel",
|
|
158
|
+
"src",
|
|
159
|
+
"alt",
|
|
160
|
+
"title",
|
|
161
|
+
"width",
|
|
162
|
+
"height",
|
|
163
|
+
"colspan",
|
|
164
|
+
"rowspan",
|
|
165
|
+
"data-*",
|
|
166
|
+
"style",
|
|
167
|
+
"class"
|
|
168
|
+
],
|
|
169
|
+
ALLOW_DATA_ATTR: !0
|
|
170
|
+
});
|
|
171
|
+
a.addHook("uponSanitizeAttribute", (q, v) => {
|
|
172
|
+
if (v.attrName === "style") {
|
|
173
|
+
const h = v.attrValue.toLowerCase();
|
|
174
|
+
(h.includes("expression") || h.includes("javascript:") || h.includes("url(")) && (v.keepAttr = !1);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
function z(q) {
|
|
178
|
+
return q ? a.sanitize(q) : "";
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
f as A,
|
|
182
|
+
y as C,
|
|
183
|
+
Q as D,
|
|
184
|
+
d as E,
|
|
185
|
+
m as M,
|
|
186
|
+
I as O,
|
|
187
|
+
g as S,
|
|
188
|
+
x as T,
|
|
189
|
+
O as _,
|
|
190
|
+
w as a,
|
|
191
|
+
p as b,
|
|
192
|
+
o as c,
|
|
193
|
+
j as d,
|
|
194
|
+
c as f,
|
|
195
|
+
D as g,
|
|
196
|
+
S as h,
|
|
197
|
+
k as i,
|
|
198
|
+
n as j,
|
|
199
|
+
L as k,
|
|
200
|
+
E as l,
|
|
201
|
+
W as m,
|
|
202
|
+
R as n,
|
|
203
|
+
C as o,
|
|
204
|
+
u as p,
|
|
205
|
+
b as r,
|
|
206
|
+
i as s,
|
|
207
|
+
z as t,
|
|
208
|
+
A as u,
|
|
209
|
+
_ as v,
|
|
210
|
+
B as w,
|
|
211
|
+
s as x,
|
|
212
|
+
M as y
|
|
213
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import "https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap";._wuContentEditor_cl3h6_7 img{margin:0;display:inline-block}._wuContentEditor_cl3h6_7 [data-resize-handle]{z-index:9;background:#00000080;border:1px solid #fffc;border-radius:2px;position:absolute}._wuContentEditor_cl3h6_7 [data-resize-handle]:hover{background:#000c}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom-left],._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom-right],._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top-left],._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top-right]{width:8px;height:8px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top-left]{cursor:nwse-resize;top:0;left:-4px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top-right]{cursor:nesw-resize;top:-4px;right:-4px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom-left]{cursor:nesw-resize;bottom:-4px;left:-4px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom-right]{cursor:nwse-resize;bottom:-4px;right:-4px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom],._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top]{height:6px;left:8px;right:8px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=top]{cursor:ns-resize;top:-3px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=bottom]{cursor:ns-resize;bottom:-3px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=left],._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=right]{width:6px;top:8px;bottom:8px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=left]{cursor:ew-resize;left:-3px}._wuContentEditor_cl3h6_7 [data-resize-handle][data-resize-handle=right]{cursor:ew-resize;right:-3px}:scope [data-resize-state=true] [data-resize-wrapper]{border-radius:.125rem;outline:1px solid #00000040}[data-resize-wrapper]{display:inline-block!important}._wuContentEditorTable_cl3h6_1{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px;display:grid}._wuContentEditorTable_cl3h6_1 button{justify-content:flex-start;align-items:center;font-size:12px;display:flex}._wuContentEditor_cl3h6_7 table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;overflow:hidden}._wuContentEditor_cl3h6_7 table td,._wuContentEditor_cl3h6_7 table th{box-sizing:border-box;vertical-align:top;border:1px solid #e6e6e6;min-width:1em;padding:6px 8px;position:relative}:is(._wuContentEditor_cl3h6_7 table td,._wuContentEditor_cl3h6_7 table th)>*{margin-bottom:0}._wuContentEditor_cl3h6_7 table th{text-align:left;background-color:#f5f5f5;font-weight:700}._wuContentEditor_cl3h6_7 table ._selectedCell_cl3h6_1:after{content:"";pointer-events:none;z-index:2;background:green;position:absolute;inset:0}._wuContentEditor_cl3h6_7 table ._column-resize-handle_cl3h6_1{pointer-events:none;background-color:#00f;width:4px;position:absolute;top:0;bottom:-2px;right:-2px}._wuContentEditor_cl3h6_7 ._tableWrapper_cl3h6_1{scrollbar-color:rgb(var(--wu-gray-20)) transparent;scrollbar-width:thin;margin:1.5rem 0;overflow-x:auto}._wuContentEditor_cl3h6_7 ._tableWrapper_cl3h6_1::-webkit-scrollbar{width:6px;height:6px}._wuContentEditor_cl3h6_7 ._tableWrapper_cl3h6_1::-webkit-scrollbar-track{background:0 0}._wuContentEditor_cl3h6_7 ._tableWrapper_cl3h6_1::-webkit-scrollbar-thumb{background-color:rgb(var(--wu-gray-20));border-radius:4px}._wuContentEditor_cl3h6_7 ._tableWrapper_cl3h6_1::-webkit-scrollbar-corner{background:0 0}._wuContentEditor_cl3h6_7 ._resize-cursor_cl3h6_1{cursor:ew-resize;cursor:col-resize}._wuContentEditor_cl3h6_7 ol,._wuContentEditor_cl3h6_7 ul{all:unset;box-sizing:border-box;display:revert}._wuContentEditor_cl3h6_7 ul{list-style-type:disc}._wuContentEditor_cl3h6_7 ol,._wuContentEditor_cl3h6_7 ul{padding-left:2rem}._wuContentEditor_cl3h6_7 ol{list-style-type:decimal}._wuContentEditor_cl3h6_7 ul[data-type=taskList]{padding-left:1rem;list-style-type:none}._wuContentEditor_cl3h6_7 ul[data-type=taskList] li{justify-content:flex-start;align-items:center;gap:8px;display:flex}._wuContentEditor_cl3h6_7 ul[data-type=taskList] li label{position:relative;top:2px}._wuContentEditor_cl3h6_7 h1{font-size:2rem;line-height:40px}._wuContentEditor_cl3h6_7 h1,._wuContentEditor_cl3h6_7 h2{font-weight:400}._wuContentEditor_cl3h6_7 h2{font-size:1.5rem}._wuContentEditor_cl3h6_7 h2,._wuContentEditor_cl3h6_7 h3{line-height:32px}._wuContentEditor_cl3h6_7 h3{font-size:1.25rem}._wuContentEditor_cl3h6_7 h3,._wuContentEditor_cl3h6_7 h4{font-weight:500}._wuContentEditor_cl3h6_7 h4{font-size:1.125rem;line-height:24px}._wuContentEditorContainer_cl3h6_7{--blue-p:rgb(var(--wu-blue-p));--blue-q:rgb(var(--wu-blue-q));--gray-20:rgb(var(--wu-gray-20));--gray-10:#ddd;border:1px solid var(--gray-10);scrollbar-color:var(--gray-20) transparent;scrollbar-width:thin;background-color:#fff;border-radius:8px;flex-direction:column;min-height:160px;line-height:1.5;display:flex;position:relative;overflow:auto}._wuContentEditorContainer_cl3h6_7[data-position=bottom]{flex-direction:column-reverse}._wuContentEditorContainer_cl3h6_7::-webkit-scrollbar{width:6px;height:6px}._wuContentEditorContainer_cl3h6_7::-webkit-scrollbar-track{background:0 0}._wuContentEditorContainer_cl3h6_7::-webkit-scrollbar-thumb{background-color:var(--gray-20);border-radius:4px}._wuContentEditorContainer_cl3h6_7::-webkit-scrollbar-corner{background:0 0}._wuContentEditorContainer_cl3h6_7 :focus{outline:none}._wuContentEditorContainer_cl3h6_7 a{color:var(--blue-p);font-weight:400;text-decoration:underline}._wuContentEditorContainer_cl3h6_7 blockquote{background-color:rgb(var(--wu-blue-p)/10%);border-left:4px solid rgb(var(--wu-blue-p)/50%);border-radius:0 8px 8px 0;margin:1.5rem 0;padding:1rem;font-style:italic}._wuContentEditorContainer_cl3h6_7 code{background-color:var(--gray-20);color:var(--blue-q);border-radius:2px;padding:4px;font-family:JetBrains Mono,monospace;font-size:.75em}._wuContentEditorContainer_cl3h6_7 code:after,._wuContentEditorContainer_cl3h6_7 code:before{content:""}._wuContentEditorToolbar_cl3h6_82{border-color:var(--gray-10);z-index:10;background-color:#fff;justify-content:start;align-items:center;gap:.25rem;padding:.5rem;display:flex;position:sticky}._wuContentEditorToolbar_cl3h6_82[data-position=top]{border-width:0 0 1px;top:0}._wuContentEditorToolbar_cl3h6_82[data-position=bottom]{border-width:1px 0 0;bottom:0}._wuContentEditor_cl3h6_7{flex-grow:1;padding:1rem;overflow:auto}._wuContentEditorAction_cl3h6_110{cursor:pointer;border-radius:.25rem;justify-content:center;align-items:center;width:1.5rem;height:1.5rem;font-size:1.125rem;line-height:1.75rem;display:flex}._wuContentEditorAction_cl3h6_110:hover{background-color:rgb(var(--wu-blue-p)/15%)}._wuContentEditorAction_cl3h6_110[data-active=true]{background-color:rgb(var(--wu-blue-p)/5%);color:rgb(var(--wu-blue-p))}._wuContentEditorAction_cl3h6_110 input{width:0;height:0}._wuContentEditorDropdown_cl3h6_136{border:1px solid rgb(var(--wu-blue-p));background-color:#fff;border-radius:.25rem;display:flex}._wuContentEditorDropdown_cl3h6_136[data-inline]{gap:.25rem;padding:.25rem}._wuContentEditorDropdown_cl3h6_136[data-block]{flex-direction:column}._wuContentEditorDropdown_cl3h6_136[data-block] ._wuContentEditorDropdownItem_cl3h6_150{cursor:pointer;padding:.25rem .5rem;font-size:12px}._wuContentEditorDropdown_cl3h6_136[data-block] ._wuContentEditorDropdownItem_cl3h6_150:hover{background-color:rgb(var(--wu-blue-p)/5%)}._wuContentEditorFontSize_cl3h6_162{gap:.25rem;display:flex}._wuContentEditorFontSize_cl3h6_162 input{text-align:center;border-style:solid;border-width:1px;border-radius:.25rem;width:2.5rem;height:1.5rem}._wuContentEditorModal_cl3h6_176{border-radius:12px 12px 0 0}._wuCodeEditor_cl3h6_180{--font-size:12px;--line-height:24px;--font-family:"JetBrains Mono",monospace;width:100%;min-width:fit-content;position:relative;overflow:auto}._wuCodeEditor_cl3h6_180 ._wuFormatCode_cl3h6_190{opacity:.5;z-index:10;padding:0;font-size:1rem;position:absolute;top:0;right:0}._wuCodeEditor_cl3h6_180 ._wuFormatCode_cl3h6_190:hover{opacity:1}._wuCodeEditorPreview_cl3h6_205{pointer-events:none;-webkit-user-select:none;user-select:none}._wuCodeEditorPreview_cl3h6_205 pre code{font-size:var(--font-size);line-height:var(--line-height);background:0 0;padding:0}._wuCodeEditorPreview_cl3h6_205 pre code span{font-family:var(--font-family)!important}._wuCodeEditorInput_cl3h6_222{caret-color:#000;color:#0000;font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);resize:none;white-space:pre;background:0 0;border:none;outline:none;position:absolute;inset:0;overflow:hidden}
|
|
1
|
+
._container_15x9c_1{flex-grow:1;padding:1rem;overflow:auto}._editor_15x9c_7{--font-size:12px;--line-height:24px;--font-family:"JetBrains Mono",monospace;width:100%;min-width:fit-content;position:relative;overflow:auto}._formatBtn_15x9c_18{border-radius:var(--we-radius);cursor:pointer;opacity:.4;height:1.5rem;transition:opacity var(--we-speed) ease-in-out;z-index:10;background:0 0;border:none;justify-content:center;align-items:center;width:1.5rem;padding:0;font-size:1rem;display:flex;position:absolute;top:.25rem;right:.25rem}._formatBtn_15x9c_18:hover{opacity:1}._formatBtn_15x9c_18:disabled{cursor:not-allowed}._preview_15x9c_48{pointer-events:none;-webkit-user-select:none;user-select:none}._preview_15x9c_48 pre code{font-size:var(--font-size);line-height:var(--line-height);background:0 0;padding:0}._preview_15x9c_48 pre code span{font-family:var(--font-family)!important}._input_15x9c_64{caret-color:var(--we-fg);color:#0000;font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);resize:none;white-space:pre;background:0 0;border:none;outline:none;position:absolute;inset:0;overflow:hidden}._input_15x9c_64:disabled{cursor:not-allowed}._dropdown_k3z4n_1{background-color:var(--we-bg);border:1px solid var(--we-primary);border-radius:var(--we-radius);color:var(--we-fg);z-index:51;display:flex}._dropdown_k3z4n_1[data-inline]{gap:.25rem;padding:.25rem}._dropdown_k3z4n_1[data-block]{flex-direction:column}._dropdown_k3z4n_1[data-block] ._dropdownItem_k3z4n_17{cursor:pointer;padding:.25rem .5rem;font-size:12px}._dropdown_k3z4n_1[data-block] ._dropdownItem_k3z4n_17:hover{background-color:color-mix(in srgb,var(--we-primary) 5%,transparent)}._item_wqnwe_1{border-radius:var(--we-radius);cursor:pointer;height:1.5rem;transition:background-color var(--we-speed) ease-in-out;justify-content:center;align-items:center;width:1.5rem;font-size:1.125rem;line-height:1.75rem;display:flex}._item_wqnwe_1:hover,._item_wqnwe_1[data-active=true]{background-color:oklch(from var(--we-primary) l c h/10%)}._item_wqnwe_1[data-active=true]{color:var(--we-primary)}._item_wqnwe_1 input{width:0;height:0}._wuContentEditor_1w25e_3 img{margin:0;display:inline-block}._wuContentEditor_1w25e_3 [data-resize-handle]{z-index:9;background:#00000080;border:1px solid #fffc;border-radius:2px;position:absolute}._wuContentEditor_1w25e_3 [data-resize-handle]:hover{background:#000c}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom-left],._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom-right],._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top-left],._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top-right]{width:8px;height:8px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top-left]{cursor:nwse-resize;top:0;left:-4px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top-right]{cursor:nesw-resize;top:-4px;right:-4px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom-left]{cursor:nesw-resize;bottom:-4px;left:-4px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom-right]{cursor:nwse-resize;bottom:-4px;right:-4px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom],._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top]{height:6px;left:8px;right:8px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=top]{cursor:ns-resize;top:-3px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=bottom]{cursor:ns-resize;bottom:-3px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=left],._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=right]{width:6px;top:8px;bottom:8px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=left]{cursor:ew-resize;left:-3px}._wuContentEditor_1w25e_3 [data-resize-handle][data-resize-handle=right]{cursor:ew-resize;right:-3px}:scope [data-resize-state=true] [data-resize-wrapper]{border-radius:.125rem;outline:1px solid #00000040}[data-resize-wrapper]{display:inline-block!important}._wuContentEditor_1w25e_3 ol,._wuContentEditor_1w25e_3 ul{all:unset;box-sizing:border-box;display:revert}._wuContentEditor_1w25e_3 ul{list-style-type:disc}._wuContentEditor_1w25e_3 ol,._wuContentEditor_1w25e_3 ul{padding-left:2rem}._wuContentEditor_1w25e_3 ol{list-style-type:decimal}._wuContentEditor_1w25e_3 ul[data-type=taskList]{padding-left:1rem;list-style-type:none}._wuContentEditor_1w25e_3 ul[data-type=taskList] li{justify-content:flex-start;align-items:center;gap:8px;display:flex}._wuContentEditor_1w25e_3 ul[data-type=taskList] li label{position:relative;top:2px}._wuContentEditor_1w25e_3 table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;overflow:hidden}._wuContentEditor_1w25e_3 table td,._wuContentEditor_1w25e_3 table th{box-sizing:border-box;vertical-align:top;border:1px solid #e6e6e6;min-width:1em;padding:6px 8px;position:relative}:is(._wuContentEditor_1w25e_3 table td,._wuContentEditor_1w25e_3 table th)>*{margin-bottom:0}._wuContentEditor_1w25e_3 table th{text-align:left;background-color:#f5f5f5;font-weight:700}._wuContentEditor_1w25e_3 table ._selectedCell_1w25e_1:after{content:"";pointer-events:none;z-index:2;background:green;position:absolute;inset:0}._wuContentEditor_1w25e_3 table ._column-resize-handle_1w25e_1{pointer-events:none;background-color:#00f;width:4px;position:absolute;top:0;bottom:-2px;right:-2px}._wuContentEditor_1w25e_3 ._tableWrapper_1w25e_1{scrollbar-color:var(--we-muted) transparent;scrollbar-width:thin;margin:1.5rem 0;overflow-x:auto}._wuContentEditor_1w25e_3 ._tableWrapper_1w25e_1::-webkit-scrollbar{width:6px;height:6px}._wuContentEditor_1w25e_3 ._tableWrapper_1w25e_1::-webkit-scrollbar-track{background:0 0}._wuContentEditor_1w25e_3 ._tableWrapper_1w25e_1::-webkit-scrollbar-thumb{background-color:var(--we-muted);border-radius:4px}._wuContentEditor_1w25e_3 ._tableWrapper_1w25e_1::-webkit-scrollbar-corner{background:0 0}._wuContentEditor_1w25e_3 ._resize-cursor_1w25e_1{cursor:ew-resize;cursor:col-resize}._wuContentEditor_1w25e_3 a{color:var(--we-primary);cursor:pointer;text-underline-offset:2px;transition:color var(--we-speed) ease-in-out;text-decoration:underline}._wuContentEditor_1w25e_3 a:hover{color:var(--we-secondary)}._wuContentEditor_1w25e_3 h1{font-size:2rem;line-height:40px}._wuContentEditor_1w25e_3 h1,._wuContentEditor_1w25e_3 h2{font-weight:400}._wuContentEditor_1w25e_3 h2{font-size:1.5rem}._wuContentEditor_1w25e_3 h2,._wuContentEditor_1w25e_3 h3{line-height:32px}._wuContentEditor_1w25e_3 h3{font-size:1.25rem}._wuContentEditor_1w25e_3 h3,._wuContentEditor_1w25e_3 h4{font-weight:500}._wuContentEditor_1w25e_3 h4{font-size:1.125rem;line-height:24px}:root{--we-bg:var(--wu-bg,oklch(100% 0 0));--we-fg:var(--wu-fg,oklch(47.8% .0244 255));--we-primary:var(--wu-primary,oklch(61.6% .1696 251.2));--we-primary-fg:var(--wu-primary-fg,oklch(100% 0 0));--we-secondary:var(--wu-secondary,oklch(35.4% .1335 266.3));--we-secondary-fg:var(--wu-secondary-fg,oklch(100% 0 0));--we-accent:var(--wu-accent,oklch(72.3% .1755 56.7));--we-accent-fg:var(--wu-accent-fg,oklch(100% 0 0));--we-muted:var(--wu-muted,oklch(0% 0 0/.06));--we-muted-fg:var(--wu-muted-fg,oklch(68.9% 0 0));--we-error:var(--wu-error,oklch(53.1% .2178 29.2));--we-error-fg:var(--wu-error-fg,oklch(100% 0 0));--we-border:var(--wu-muted,oklch(0% 0 0/.06));--we-radius:var(--wu-radius,.25rem);--we-shadow:var(--wu-shadow,0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a);--we-speed:var(--wu-speed,.3s)}._wuContentEditor_1w25e_3 code{background-color:var(--we-muted);color:var(--we-secondary);border-radius:2px;padding:4px;font-family:JetBrains Mono,monospace;font-size:.75em}._wuContentEditor_1w25e_3 code:after,._wuContentEditor_1w25e_3 code:before{content:""}._wuContentEditor_1w25e_3 blockquote{background-color:oklch(from var(--we-primary) l c h/5%);border-left:4px solid oklch(from var(--we-primary) l c h/50%);border-radius:0 8px 8px 0;margin:1rem 0;padding:.5rem;font-style:italic}._wuContentEditorRoot_1w25e_3{border:1px solid var(--we-border);border-radius:var(--we-radius);flex-direction:column;min-height:160px;display:flex}._wuContentEditorRoot_1w25e_3 :focus{outline:none}._wuContentEditorRoot_1w25e_3[data-position=bottom]{flex-direction:column-reverse}._wuContentEditorRoot_1w25e_3[data-position=bottom] ._wuContentEditorToolbar_1w25e_17{border-bottom:none;border-top:1px solid var(--we-border);top:auto;bottom:0}._wuContentEditorToolbar_1w25e_17{border-bottom:1px solid var(--we-border);border-top:none;justify-content:flex-start;align-items:center;gap:.25rem;padding:.5rem;display:flex;position:sticky;top:0;overflow-x:auto}._wuContentEditorToolbar_1w25e_17 ._fontSize_1w25e_38{gap:.5rem;display:flex}._wuContentEditorToolbar_1w25e_17 ._fontSize_1w25e_38 input{border:1px solid var(--we-border);border-radius:var(--we-radius);text-align:center;width:2.5rem;height:1.5rem}._wuContentEditorToolbar_1w25e_17 ._fontSize_1w25e_38 input:focus{outline:none}._wuContentEditorTable_1w25e_56{grid-template-columns:repeat(2,1fr);gap:.5rem;display:grid}._wuContentEditor_1w25e_3{flex-grow:1;padding:1rem;overflow:auto}._button_583n5_1{--btn-hue:var(--we-primary);--btn-bg:var(--btn-hue);--btn-text:var(--we-primary-fg);--btn-bg-hover:color-mix(in oklab,var(--btn-hue),#000 18.5%);--btn-hue-60:oklch(from var(--btn-hue) l c h/60%);background-color:var(--btn-bg);border-radius:var(--we-radius);block-size:2rem;color:var(--btn-text);cursor:pointer;min-inline-size:6.5rem;transition:background-color var(--we-speed) ease-in-out,color var(--we-speed) ease-in-out;border:1px solid #0000;justify-content:center;align-items:center;gap:.25rem;padding-block:.375rem;padding-inline:.5rem;font-size:.875rem;line-height:1.15;display:inline-flex}._button_583n5_1:hover:not(:disabled){--btn-bg:var(--btn-bg-hover)}._button_583n5_1:focus{outline:none}._button_583n5_1:focus-visible{outline:2px solid var(--btn-hue-60);outline-offset:2px}._button_583n5_1[data-color=error]{--btn-hue:var(--we-error)}._button_583n5_1[data-variant=secondary]{--btn-bg:transparent;--btn-text:var(--btn-hue)}._button_583n5_1[data-variant=secondary]:hover:not(:disabled){--btn-bg:var(--we-muted);--btn-text:var(--btn-bg-hover)}._button_583n5_1:disabled{--btn-bg:var(--we-muted);--btn-text:var(--we-muted-fg);cursor:not-allowed;pointer-events:none}._button_583n5_1:disabled[data-variant=secondary]{--btn-bg:transparent}._dialog_1k05x_1{background-color:var(--we-bg);border:2px solid var(--we-primary);border-radius:calc(var(--we-radius)*4);color:var(--we-fg);max-width:calc(100vw - 3rem);min-height:10rem;transition:all var(--we-speed) ease-in-out;z-index:100;flex-direction:column;gap:2rem;width:24rem;padding:1.5rem;display:flex;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}._dialog_1k05x_1[data-ending-style],._dialog_1k05x_1[data-starting-style]{opacity:0;transform:translate(-50%,-50%)scale(.98)}._backdrop_1k05x_27{pointer-events:all;min-height:100dvh;transition:all var(--we-speed) ease-in-out;z-index:99;background-color:#0003;position:fixed;inset:0}@supports (-webkit-touch-callout:none){._backdrop_1k05x_27{position:absolute}}._backdrop_1k05x_27[data-ending-style],._backdrop_1k05x_27[data-starting-style]{opacity:0}._content_1k05x_46{flex-direction:column;gap:1rem;display:flex}._footer_1k05x_52{justify-content:flex-end;align-items:center;gap:.5rem;display:flex}._close_1k05x_59{border-radius:var(--we-radius);color:var(--we-muted-fg);cursor:pointer;height:1.5rem;transition:color var(--we-speed) ease-in-out;background:0 0;border:none;justify-content:center;align-items:center;width:1.5rem;padding:0;display:flex;position:absolute;top:.75rem;right:.75rem}._close_1k05x_59:hover{color:var(--we-fg)}._group_56lao_1{flex-direction:column;gap:.25rem;width:100%;display:flex}._label_56lao_8{color:var(--we-fg);font-size:.75rem;font-weight:500}._input_56lao_14{background:var(--we-muted);border:none;border-bottom:1px solid var(--we-border);color:var(--we-fg);height:2rem;transition:border-color var(--we-speed) ease-in-out;border-radius:0;width:100%;padding:0 .5rem;font-size:.75rem;font-weight:400}._input_56lao_14::placeholder{color:var(--we-muted-fg);font-weight:300}._input_56lao_14:hover{border-bottom-color:var(--we-muted-fg)}._input_56lao_14:focus{border-bottom-color:var(--we-primary);outline:none}._input_56lao_14:disabled{color:var(--we-muted-fg);cursor:not-allowed}._input_56lao_14:disabled:hover{border-bottom-color:var(--we-border)}._label_1kiov_1{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:.75rem;width:fit-content;font-size:.8125rem;display:flex}._root_1kiov_11{cursor:pointer;height:.5rem;transition:background-color var(--we-speed) ease-in-out;background-color:oklch(93.1% 0 0);border:none;border-radius:9999px;flex-shrink:0;align-items:center;width:2rem;padding:0;display:inline-flex}._root_1kiov_11[data-checked]{background-color:oklch(88.2% 0 0)}._root_1kiov_11:hover{background-color:var(--we-muted-fg)}._root_1kiov_11:focus-visible{outline:2px solid oklch(from var(--we-primary) l c h/60%);outline-offset:2px}._root_1kiov_11:disabled{cursor:not-allowed;opacity:.5}._thumb_1kiov_44{background-color:var(--we-muted-fg);height:1rem;transition:transform var(--we-speed) ease-in-out,background-color var(--we-speed) ease-in-out;border-radius:9999px;width:1rem;display:block;box-shadow:0 1px 3px #0003}._thumb_1kiov_44[data-checked]{background-color:var(--we-primary);transform:translate(1rem)}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { p as x, t as F } from "../../sanitize-BZ0U7q7z.js";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { Fragment as _, jsx as a, jsxs as E } from "react/jsx-runtime";
|
|
4
|
+
var I = "_container_15x9c_1", k = "_editor_15x9c_7", D = "_formatBtn_15x9c_18", N = "_preview_15x9c_48", R = "_input_15x9c_64", s = {
|
|
5
|
+
container: I,
|
|
6
|
+
editor: k,
|
|
7
|
+
formatBtn: D,
|
|
8
|
+
preview: N,
|
|
9
|
+
input: R
|
|
10
|
+
}, u = null;
|
|
11
|
+
function T() {
|
|
12
|
+
return u || (u = import("shiki").then(({ createHighlighter: o }) => o({
|
|
13
|
+
themes: ["github-light"],
|
|
14
|
+
langs: ["html"]
|
|
15
|
+
}))), u;
|
|
16
|
+
}
|
|
17
|
+
function P({ defaultValue: o, onUpdate: h, readonly: v }) {
|
|
18
|
+
const [n, c] = r.useState(o || ""), [H, b] = r.useState(""), [w, d] = r.useState(!1), [C, g] = r.useState(!1), f = r.useRef(!1), l = r.useCallback(async (t) => {
|
|
19
|
+
try {
|
|
20
|
+
const [{ format: e }, { default: i }] = await Promise.all([import("prettier/standalone"), import("prettier/plugins/html")]), m = await e(t, {
|
|
21
|
+
parser: "html",
|
|
22
|
+
plugins: [i],
|
|
23
|
+
htmlWhitespaceSensitivity: "css",
|
|
24
|
+
printWidth: 80
|
|
25
|
+
});
|
|
26
|
+
return d(!1), m;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return console.error("Format error:", e), d(!0), t;
|
|
29
|
+
}
|
|
30
|
+
}, []), p = r.useCallback((t) => {
|
|
31
|
+
T().then((e) => {
|
|
32
|
+
b(e.codeToHtml(t || " ", {
|
|
33
|
+
lang: "html",
|
|
34
|
+
theme: "github-light"
|
|
35
|
+
}));
|
|
36
|
+
}).catch((e) => console.error("Highlight error:", e));
|
|
37
|
+
}, []);
|
|
38
|
+
r.useEffect(() => {
|
|
39
|
+
p(n), h?.(F(n));
|
|
40
|
+
}, [
|
|
41
|
+
n,
|
|
42
|
+
p,
|
|
43
|
+
h
|
|
44
|
+
]), r.useEffect(() => {
|
|
45
|
+
f.current || !o || (f.current = !0, l(o).then(c));
|
|
46
|
+
}, [o, l]);
|
|
47
|
+
const S = async (t) => {
|
|
48
|
+
t.preventDefault(), g(!0), c(await l(n)), g(!1);
|
|
49
|
+
}, y = (t) => {
|
|
50
|
+
if (t.key === "Tab") {
|
|
51
|
+
t.preventDefault();
|
|
52
|
+
const e = t.currentTarget, i = e.selectionStart, m = e.selectionEnd;
|
|
53
|
+
c(n.substring(0, i) + " " + n.substring(m)), requestAnimationFrame(() => {
|
|
54
|
+
e.selectionStart = i + 2, e.selectionEnd = i + 2;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ a(_, { children: C ? /* @__PURE__ */ a(_, { children: "Formatting..." }) : /* @__PURE__ */ a("div", {
|
|
59
|
+
className: s.container,
|
|
60
|
+
children: /* @__PURE__ */ E("div", {
|
|
61
|
+
className: s.editor,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ a("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
title: "Format code",
|
|
66
|
+
onClick: S,
|
|
67
|
+
className: s.formatBtn,
|
|
68
|
+
style: { color: w ? "var(--we-error)" : "" },
|
|
69
|
+
children: /* @__PURE__ */ a(x, {})
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ a("div", {
|
|
72
|
+
dangerouslySetInnerHTML: { __html: H },
|
|
73
|
+
className: s.preview
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ a("textarea", {
|
|
76
|
+
value: n,
|
|
77
|
+
onChange: (t) => c(t.target.value),
|
|
78
|
+
onKeyDown: y,
|
|
79
|
+
className: s.input,
|
|
80
|
+
disabled: v
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
}) });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
P as WuHtmlSource
|
|
88
|
+
};
|