dishui 0.0.105 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.release-verified.json +2 -2
- package/dist/components/ChoicePicker/index.js +8 -6
- package/dist/components/ChoicePicker/index.js.map +1 -1
- package/dist/components/Column/index.d.ts +3 -2
- package/dist/components/Column/index.js +5 -17
- package/dist/components/Column/index.js.map +1 -1
- package/dist/components/ConfirmDialog/index.d.ts +20 -0
- package/dist/components/ConfirmDialog/index.js +84 -0
- package/dist/components/ConfirmDialog/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.js +28 -26
- package/dist/components/DateTimeInput/index.js.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.js +2 -1
- package/dist/components/MultipleChoice/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +3 -2
- package/dist/components/Row/index.js +5 -17
- package/dist/components/Row/index.js.map +1 -1
- package/dist/components/Tab/index.js +80 -0
- package/dist/components/Tab/index.js.map +1 -0
- package/dist/components/Tabs/index.js +28 -33
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tabNavigation.d.ts +2 -0
- package/dist/components/Tabs/tabNavigation.js +14 -0
- package/dist/components/Tabs/tabNavigation.js.map +1 -0
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.d.ts +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +25 -26
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +8 -11
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +184 -182
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +26 -26
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +13 -11
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +73 -83
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +73 -49
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.d.ts +1 -0
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +12 -14
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +113 -113
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/css.d.ts +1 -0
- package/dist/dishui.css +1 -1
- package/dist/index-nostyled.d.ts +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +113 -111
- package/dist/layouts/Sidebar.js +201 -107
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/utils/flexLayout.d.ts +5 -0
- package/dist/utils/flexLayout.js +19 -0
- package/dist/utils/flexLayout.js.map +1 -0
- package/package.json +63 -57
|
@@ -1,36 +1,88 @@
|
|
|
1
1
|
import { useAnchoredDropdown as e } from "./useAnchoredDropdown.js";
|
|
2
2
|
import { useEffect as t, useId as n, useRef as r, useState as i } from "react";
|
|
3
3
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as s } from "react-dom";
|
|
4
5
|
//#region src/components/pro/RichTextEditor/Toolbar/ColorPicker.tsx
|
|
5
|
-
var
|
|
6
|
-
let [
|
|
7
|
-
|
|
6
|
+
var c = /* @__PURE__ */ "#000000.#434343.#666666.#999999.#cccccc.#eeeeee.#ffffff.#ff0000.#ff4500.#ff8c00.#ffd700.#32cd32.#00bfff.#8a2be2.#ff69b4.#dc143c.#ff6347.#ffa500.#9acd32.#20b2aa.#4169e1.#9370db.#db7093.#b22222.#d2691e.#daa520.#228b22.#008b8b.#191970.#4b0082".split("."), l = ({ value: l, onChange: u, title: d, icon: f, kind: p = "text", buttonClassName: m = "rte-toolbar__btn", portalOwner: h }) => {
|
|
7
|
+
let [g, _] = i(!1), [v, y] = i({}), b = r(null), x = r(null), S = r(null), C = n(), w = e(g, x, S), T = d || (p === "text" ? "Text color" : "Highlight color"), E = `${T}: ${l || (p === "text" ? "Default" : "None")}`;
|
|
8
|
+
t(() => {
|
|
8
9
|
let e = (e) => {
|
|
9
|
-
|
|
10
|
+
b.current && !b.current.contains(e.target) && !S.current?.contains(e.target) && _(!1);
|
|
10
11
|
};
|
|
11
12
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
12
|
-
}, [])
|
|
13
|
-
|
|
13
|
+
}, [b, S]);
|
|
14
|
+
let D = g && /* @__PURE__ */ o("div", {
|
|
15
|
+
ref: S,
|
|
16
|
+
id: C,
|
|
17
|
+
"data-rte-palette-owner": h,
|
|
18
|
+
className: "rte-toolbar__color-dropdown",
|
|
19
|
+
role: "group",
|
|
20
|
+
"aria-label": T,
|
|
21
|
+
style: {
|
|
22
|
+
...w,
|
|
23
|
+
...v
|
|
24
|
+
},
|
|
25
|
+
children: [c.map((e) => /* @__PURE__ */ a("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
className: `rte-toolbar__color-swatch ${e === l ? "rte-toolbar__color-swatch--active" : ""}`,
|
|
28
|
+
style: { backgroundColor: e },
|
|
29
|
+
onMouseDown: h ? (e) => e.preventDefault() : void 0,
|
|
30
|
+
onClick: () => {
|
|
31
|
+
u(e), _(!1);
|
|
32
|
+
},
|
|
33
|
+
title: `${T}: ${e}`,
|
|
34
|
+
"aria-label": `${T}: ${e}`,
|
|
35
|
+
"aria-pressed": e.toLowerCase() === l.toLowerCase()
|
|
36
|
+
}, e)), /* @__PURE__ */ a("button", {
|
|
37
|
+
type: "button",
|
|
38
|
+
className: "rte-toolbar__color-clear",
|
|
39
|
+
onMouseDown: h ? (e) => e.preventDefault() : void 0,
|
|
40
|
+
onClick: () => {
|
|
41
|
+
u(""), _(!1);
|
|
42
|
+
},
|
|
43
|
+
title: `Clear ${T}`,
|
|
44
|
+
"aria-label": `Clear ${T}`,
|
|
45
|
+
"aria-pressed": !l,
|
|
46
|
+
children: "Clear"
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
return /* @__PURE__ */ o("div", {
|
|
50
|
+
ref: b,
|
|
14
51
|
className: "rte-toolbar__color-picker",
|
|
15
52
|
onBlur: (e) => {
|
|
16
|
-
e.currentTarget.contains(e.relatedTarget)
|
|
53
|
+
!e.currentTarget.contains(e.relatedTarget) && !S.current?.contains(e.relatedTarget) && _(!1);
|
|
17
54
|
},
|
|
18
55
|
onKeyDown: (e) => {
|
|
19
|
-
e.key === "Escape" &&
|
|
56
|
+
e.key === "Escape" && g && (e.preventDefault(), e.stopPropagation(), _(!1), x.current?.focus());
|
|
20
57
|
},
|
|
21
58
|
children: [/* @__PURE__ */ a("button", {
|
|
22
59
|
type: "button",
|
|
23
|
-
ref:
|
|
24
|
-
className: `${
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
ref: x,
|
|
61
|
+
className: `${m} rte-toolbar__color-trigger`,
|
|
62
|
+
onMouseDown: h ? (e) => e.preventDefault() : void 0,
|
|
63
|
+
onClick: (e) => {
|
|
64
|
+
if (h && !g) {
|
|
65
|
+
let t = getComputedStyle(e.currentTarget), n = {};
|
|
66
|
+
for (let e of [
|
|
67
|
+
"--rte-bg",
|
|
68
|
+
"--rte-text",
|
|
69
|
+
"--rte-border",
|
|
70
|
+
"--rte-placeholder",
|
|
71
|
+
"--rte-active-color",
|
|
72
|
+
"--rte-toolbar-btn-hover"
|
|
73
|
+
]) n[e] = t.getPropertyValue(e);
|
|
74
|
+
y(n);
|
|
75
|
+
}
|
|
76
|
+
_(!g);
|
|
77
|
+
},
|
|
78
|
+
title: E,
|
|
79
|
+
"aria-label": E,
|
|
80
|
+
"aria-expanded": g,
|
|
81
|
+
"aria-controls": g ? C : void 0,
|
|
30
82
|
children: /* @__PURE__ */ o("span", {
|
|
31
|
-
className: `rte-toolbar__color-icon rte-toolbar__color-icon--${
|
|
83
|
+
className: `rte-toolbar__color-icon rte-toolbar__color-icon--${p}`,
|
|
32
84
|
"aria-hidden": "true",
|
|
33
|
-
children: [
|
|
85
|
+
children: [f || (p === "text" ? /* @__PURE__ */ a("span", {
|
|
34
86
|
className: "rte-toolbar__color-letter",
|
|
35
87
|
children: "A"
|
|
36
88
|
}) : /* @__PURE__ */ a("svg", {
|
|
@@ -44,42 +96,14 @@ var s = /* @__PURE__ */ "#000000.#434343.#666666.#999999.#cccccc.#eeeeee.#ffffff
|
|
|
44
96
|
strokeLinejoin: "round",
|
|
45
97
|
children: /* @__PURE__ */ a("path", { d: "m14 3 7 7-9 9-7-7zM5 12l-2 7 2 2 7-2M14 7l3 3M3 21h6" })
|
|
46
98
|
})), /* @__PURE__ */ a("span", {
|
|
47
|
-
className: `rte-toolbar__color-indicator${
|
|
48
|
-
style: { backgroundColor:
|
|
99
|
+
className: `rte-toolbar__color-indicator${l ? "" : " rte-toolbar__color-indicator--empty"}`,
|
|
100
|
+
style: { backgroundColor: l || void 0 }
|
|
49
101
|
})]
|
|
50
102
|
})
|
|
51
|
-
}),
|
|
52
|
-
ref: v,
|
|
53
|
-
id: y,
|
|
54
|
-
className: "rte-toolbar__color-dropdown",
|
|
55
|
-
role: "group",
|
|
56
|
-
"aria-label": x,
|
|
57
|
-
style: b,
|
|
58
|
-
children: [s.map((e) => /* @__PURE__ */ a("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
className: `rte-toolbar__color-swatch ${e === c ? "rte-toolbar__color-swatch--active" : ""}`,
|
|
61
|
-
style: { backgroundColor: e },
|
|
62
|
-
onClick: () => {
|
|
63
|
-
l(e), h(!1);
|
|
64
|
-
},
|
|
65
|
-
title: `${x}: ${e}`,
|
|
66
|
-
"aria-label": `${x}: ${e}`,
|
|
67
|
-
"aria-pressed": e.toLowerCase() === c.toLowerCase()
|
|
68
|
-
}, e)), /* @__PURE__ */ a("button", {
|
|
69
|
-
type: "button",
|
|
70
|
-
className: "rte-toolbar__color-clear",
|
|
71
|
-
onClick: () => {
|
|
72
|
-
l(""), h(!1);
|
|
73
|
-
},
|
|
74
|
-
title: `Clear ${x}`,
|
|
75
|
-
"aria-label": `Clear ${x}`,
|
|
76
|
-
"aria-pressed": !c,
|
|
77
|
-
children: "Clear"
|
|
78
|
-
})]
|
|
79
|
-
})]
|
|
103
|
+
}), h && typeof document < "u" ? s(D, document.body) : D]
|
|
80
104
|
});
|
|
81
105
|
};
|
|
82
106
|
//#endregion
|
|
83
|
-
export {
|
|
107
|
+
export { l as ColorPicker };
|
|
84
108
|
|
|
85
109
|
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/ColorPicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useId } from 'react';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface ColorPickerProps {\n value: string;\n onChange: (color: string) => void;\n title?: string;\n icon?: React.ReactNode;\n kind?: 'text' | 'highlight';\n /** Button class; defaults to the classic toolbar button. Bubble toolbar passes its own. */\n buttonClassName?: string;\n}\n\nconst COLORS = [\n '#000000', '#434343', '#666666', '#999999', '#cccccc', '#eeeeee', '#ffffff',\n '#ff0000', '#ff4500', '#ff8c00', '#ffd700', '#32cd32', '#00bfff', '#8a2be2',\n '#ff69b4', '#dc143c', '#ff6347', '#ffa500', '#9acd32', '#20b2aa', '#4169e1',\n '#9370db', '#db7093', '#b22222', '#d2691e', '#daa520', '#228b22', '#008b8b',\n '#191970', '#4b0082',\n];\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({ value, onChange, title, icon, kind = 'text', buttonClassName = 'rte-toolbar__btn' }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const paletteRef = useRef<HTMLDivElement>(null);\n const paletteId = useId();\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, paletteRef);\n const label = title || (kind === 'text' ? 'Text color' : 'Highlight color');\n const description = `${label}: ${value || (kind === 'text' ? 'Default' : 'None')}`;\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, []);\n\n return (\n <div ref={ref} className=\"rte-toolbar__color-picker\"\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) setIsOpen(false);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Escape' && isOpen) {\n event.preventDefault();\n event.stopPropagation();\n setIsOpen(false);\n triggerRef.current?.focus();\n }\n }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`${buttonClassName} rte-toolbar__color-trigger`}\n
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/ColorPicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useId } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface ColorPickerProps {\n value: string;\n onChange: (color: string) => void;\n title?: string;\n icon?: React.ReactNode;\n kind?: 'text' | 'highlight';\n /** Button class; defaults to the classic toolbar button. Bubble toolbar passes its own. */\n buttonClassName?: string;\n /** Portals the palette outside scroll-clipped bubble toolbars. */\n portalOwner?: string;\n}\n\nconst COLORS = [\n '#000000', '#434343', '#666666', '#999999', '#cccccc', '#eeeeee', '#ffffff',\n '#ff0000', '#ff4500', '#ff8c00', '#ffd700', '#32cd32', '#00bfff', '#8a2be2',\n '#ff69b4', '#dc143c', '#ff6347', '#ffa500', '#9acd32', '#20b2aa', '#4169e1',\n '#9370db', '#db7093', '#b22222', '#d2691e', '#daa520', '#228b22', '#008b8b',\n '#191970', '#4b0082',\n];\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({ value, onChange, title, icon, kind = 'text', buttonClassName = 'rte-toolbar__btn', portalOwner }) => {\n const [isOpen, setIsOpen] = useState(false);\n const [paletteTheme, setPaletteTheme] = useState<React.CSSProperties>({});\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const paletteRef = useRef<HTMLDivElement>(null);\n const paletteId = useId();\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, paletteRef);\n const label = title || (kind === 'text' ? 'Text color' : 'Highlight color');\n const description = `${label}: ${value || (kind === 'text' ? 'Default' : 'None')}`;\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node) && !paletteRef.current?.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, [ref, paletteRef]);\n\n const palette = isOpen && (\n <div ref={paletteRef} id={paletteId} data-rte-palette-owner={portalOwner}\n className=\"rte-toolbar__color-dropdown\" role=\"group\" aria-label={label}\n style={{ ...dropdownStyle, ...paletteTheme }}>\n {COLORS.map((color) => (\n <button key={color} type=\"button\"\n className={`rte-toolbar__color-swatch ${color === value ? 'rte-toolbar__color-swatch--active' : ''}`}\n style={{ backgroundColor: color }}\n onMouseDown={portalOwner ? event => event.preventDefault() : undefined}\n onClick={() => { onChange(color); setIsOpen(false); }}\n title={`${label}: ${color}`} aria-label={`${label}: ${color}`}\n aria-pressed={color.toLowerCase() === value.toLowerCase()} />\n ))}\n <button type=\"button\" className=\"rte-toolbar__color-clear\"\n onMouseDown={portalOwner ? event => event.preventDefault() : undefined}\n onClick={() => { onChange(''); setIsOpen(false); }}\n title={`Clear ${label}`} aria-label={`Clear ${label}`} aria-pressed={!value}>Clear</button>\n </div>\n );\n\n return (\n <div ref={ref} className=\"rte-toolbar__color-picker\"\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget) && !paletteRef.current?.contains(event.relatedTarget)) setIsOpen(false);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Escape' && isOpen) {\n event.preventDefault();\n event.stopPropagation();\n setIsOpen(false);\n triggerRef.current?.focus();\n }\n }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`${buttonClassName} rte-toolbar__color-trigger`}\n onMouseDown={portalOwner ? event => event.preventDefault() : undefined}\n onClick={event => {\n if (portalOwner && !isOpen) {\n const computed = getComputedStyle(event.currentTarget);\n const variables: Record<string, string> = {};\n for (const name of ['--rte-bg', '--rte-text', '--rte-border', '--rte-placeholder', '--rte-active-color', '--rte-toolbar-btn-hover']) {\n variables[name] = computed.getPropertyValue(name);\n }\n setPaletteTheme(variables);\n }\n setIsOpen(!isOpen);\n }}\n title={description}\n aria-label={description}\n aria-expanded={isOpen}\n aria-controls={isOpen ? paletteId : undefined}\n >\n <span className={`rte-toolbar__color-icon rte-toolbar__color-icon--${kind}`} aria-hidden=\"true\">\n {icon || (kind === 'text' ? <span className=\"rte-toolbar__color-letter\">A</span> : (\n <svg width=\"18\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"m14 3 7 7-9 9-7-7zM5 12l-2 7 2 2 7-2M14 7l3 3M3 21h6\" />\n </svg>\n ))}\n <span\n className={`rte-toolbar__color-indicator${value ? '' : ' rte-toolbar__color-indicator--empty'}`}\n style={{ backgroundColor: value || undefined }}\n />\n </span>\n </button>\n {portalOwner && typeof document !== 'undefined' ? createPortal(palette, document.body) : palette}\n </div>\n );\n};\n"],"mappings":";;;;;AAgBA,IAAM,IAAS,2QAMf,GAEa,KAA2C,EAAE,UAA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AAQ,gBAAe;KACrI,UAAA,kBAAC,QAAD,EAAM,GAAE,uDAAwD,CAAA;IAC7D,CAAA,IAEP,kBAAC,QAAD;KACE,WAAW,+BAA+B,IAAQ,KAAK;KACvD,OAAO,EAAE,iBAAiB,KAAS,KAAA,EAAU;IAC9C,CAAA,CACG;;EACA,CAAA,GACP,KAAe,OAAO,WAAa,MAAc,EAAa,GAAS,SAAS,IAAI,IAAI,CACtF;;AAET"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import e from "../../../Select/index.js";
|
|
1
2
|
import "react";
|
|
2
|
-
import { jsx as
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/pro/RichTextEditor/Toolbar/SelectDropdown.tsx
|
|
4
|
-
var
|
|
5
|
+
var n = [
|
|
5
6
|
{
|
|
6
7
|
label: "Default",
|
|
7
8
|
value: ""
|
|
@@ -42,7 +43,7 @@ var t = [
|
|
|
42
43
|
label: "Comic Sans MS",
|
|
43
44
|
value: "Comic Sans MS, cursive"
|
|
44
45
|
}
|
|
45
|
-
],
|
|
46
|
+
], r = [
|
|
46
47
|
{
|
|
47
48
|
label: "Default",
|
|
48
49
|
value: ""
|
|
@@ -99,18 +100,15 @@ var t = [
|
|
|
99
100
|
label: "72px",
|
|
100
101
|
value: "72px"
|
|
101
102
|
}
|
|
102
|
-
],
|
|
103
|
-
className:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
value: t.value,
|
|
110
|
-
children: t.label
|
|
111
|
-
}, t.value))
|
|
103
|
+
], i = ({ value: n, options: r, onChange: i, title: a, width: o = 110, className: s = "rte-toolbar__select" }) => /* @__PURE__ */ t(e, {
|
|
104
|
+
className: s,
|
|
105
|
+
style: { width: o },
|
|
106
|
+
options: r,
|
|
107
|
+
value: n,
|
|
108
|
+
onChange: (e) => i(String(e)),
|
|
109
|
+
"aria-label": a ?? "Formatting option"
|
|
112
110
|
});
|
|
113
111
|
//#endregion
|
|
114
|
-
export {
|
|
112
|
+
export { n as FONT_FAMILIES, r as FONT_SIZES, i as SelectDropdown };
|
|
115
113
|
|
|
116
114
|
//# sourceMappingURL=SelectDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/SelectDropdown.tsx"],"sourcesContent":["import React from 'react';\n\nexport const FONT_FAMILIES = [\n { label: 'Default', value: '' },\n { label: 'Arial', value: 'Arial, sans-serif' },\n { label: 'Helvetica', value: 'Helvetica, sans-serif' },\n { label: 'Georgia', value: 'Georgia, serif' },\n { label: 'Times New Roman', value: 'Times New Roman, serif' },\n { label: 'Courier New', value: 'Courier New, monospace' },\n { label: 'Verdana', value: 'Verdana, sans-serif' },\n { label: 'Trebuchet MS', value: 'Trebuchet MS, sans-serif' },\n { label: 'Impact', value: 'Impact, sans-serif' },\n { label: 'Comic Sans MS', value: 'Comic Sans MS, cursive' },\n];\n\nexport const FONT_SIZES = [\n { label: 'Default', value: '' },\n { label: '10px', value: '10px' },\n { label: '12px', value: '12px' },\n { label: '14px', value: '14px' },\n { label: '16px', value: '16px' },\n { label: '18px', value: '18px' },\n { label: '20px', value: '20px' },\n { label: '24px', value: '24px' },\n { label: '28px', value: '28px' },\n { label: '32px', value: '32px' },\n { label: '36px', value: '36px' },\n { label: '48px', value: '48px' },\n { label: '64px', value: '64px' },\n { label: '72px', value: '72px' },\n];\n\ninterface SelectDropdownProps {\n value: string;\n options: { label: string; value: string }[];\n onChange: (value: string) => void;\n title?: string;\n width?: number;\n}\n\nexport const SelectDropdown: React.FC<SelectDropdownProps> = ({ value, options, onChange, title, width = 110 }) => (\n <
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/SelectDropdown.tsx"],"sourcesContent":["import React from 'react';\nimport Select from '../../../Select';\n\nexport const FONT_FAMILIES = [\n { label: 'Default', value: '' },\n { label: 'Arial', value: 'Arial, sans-serif' },\n { label: 'Helvetica', value: 'Helvetica, sans-serif' },\n { label: 'Georgia', value: 'Georgia, serif' },\n { label: 'Times New Roman', value: 'Times New Roman, serif' },\n { label: 'Courier New', value: 'Courier New, monospace' },\n { label: 'Verdana', value: 'Verdana, sans-serif' },\n { label: 'Trebuchet MS', value: 'Trebuchet MS, sans-serif' },\n { label: 'Impact', value: 'Impact, sans-serif' },\n { label: 'Comic Sans MS', value: 'Comic Sans MS, cursive' },\n];\n\nexport const FONT_SIZES = [\n { label: 'Default', value: '' },\n { label: '10px', value: '10px' },\n { label: '12px', value: '12px' },\n { label: '14px', value: '14px' },\n { label: '16px', value: '16px' },\n { label: '18px', value: '18px' },\n { label: '20px', value: '20px' },\n { label: '24px', value: '24px' },\n { label: '28px', value: '28px' },\n { label: '32px', value: '32px' },\n { label: '36px', value: '36px' },\n { label: '48px', value: '48px' },\n { label: '64px', value: '64px' },\n { label: '72px', value: '72px' },\n];\n\ninterface SelectDropdownProps {\n value: string;\n options: { label: string; value: string }[];\n onChange: (value: string) => void;\n title?: string;\n width?: number;\n className?: string;\n}\n\nexport const SelectDropdown: React.FC<SelectDropdownProps> = ({ value, options, onChange, title, width = 110, className = 'rte-toolbar__select' }) => (\n <Select\n className={className}\n style={{ width }}\n options={options}\n value={value}\n onChange={(next) => onChange(String(next))}\n aria-label={title ?? 'Formatting option'}\n />\n);\n"],"mappings":";;;;AAGA,IAAa,IAAgB;CAC3B;EAAE,OAAO;EAAW,OAAO;CAAG;CAC9B;EAAE,OAAO;EAAS,OAAO;CAAoB;CAC7C;EAAE,OAAO;EAAa,OAAO;CAAwB;CACrD;EAAE,OAAO;EAAW,OAAO;CAAiB;CAC5C;EAAE,OAAO;EAAmB,OAAO;CAAyB;CAC5D;EAAE,OAAO;EAAe,OAAO;CAAyB;CACxD;EAAE,OAAO;EAAW,OAAO;CAAsB;CACjD;EAAE,OAAO;EAAgB,OAAO;CAA2B;CAC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