@webiny/lexical-editor-actions 0.0.0-unstable.0156a4c312

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const LexicalEditorActions: () => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { FontColorAction, TextAlignmentAction } from "@webiny/lexical-editor";
2
+ import react from "react";
3
+ import { LexicalColorPickerDropdown } from "./components/LexicalColorPickerDropdown.js";
4
+ import { TextAlignmentDropdown } from "./components/TextAlignmentDropdown.js";
5
+ const LexicalEditorActions = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(FontColorAction.ColorPicker, {
6
+ element: /*#__PURE__*/ react.createElement(LexicalColorPickerDropdown, null)
7
+ }), /*#__PURE__*/ react.createElement(TextAlignmentAction.TextAlignmentDropDown, {
8
+ element: /*#__PURE__*/ react.createElement(TextAlignmentDropdown, null)
9
+ }));
10
+ export { LexicalEditorActions };
11
+
12
+ //# sourceMappingURL=LexicalEditorActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LexicalEditorActions.js","sources":["../src/LexicalEditorActions.tsx"],"sourcesContent":["import { TextAlignmentAction } from \"@webiny/lexical-editor\";\nimport React from \"react\";\nimport { LexicalColorPickerDropdown } from \"~/components/LexicalColorPickerDropdown.js\";\nimport { FontColorAction } from \"@webiny/lexical-editor\";\nimport { TextAlignmentDropdown } from \"~/components/TextAlignmentDropdown.js\";\n\n/*\n * Lexical editor configuration and components with global composition scope\n */\nexport const LexicalEditorActions = () => {\n return (\n <>\n <FontColorAction.ColorPicker element={<LexicalColorPickerDropdown />} />\n <TextAlignmentAction.TextAlignmentDropDown element={<TextAlignmentDropdown />} />\n </>\n );\n};\n"],"names":["LexicalEditorActions","FontColorAction","LexicalColorPickerDropdown","TextAlignmentAction","TextAlignmentDropdown"],"mappings":";;;;AASO,MAAMA,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,gBAAgB,WAAW;QAAC,uBAAS,oBAACC,4BAA0BA;sBACjE,oBAACC,oBAAoB,qBAAqB;QAAC,uBAAS,oBAACC,uBAAqBA"}
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @webiny/lexical-editor-actions
2
+
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
6
+
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
8
+
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ interface LexicalColorPickerProps {
3
+ value: string;
4
+ onChange?: (color: string) => void;
5
+ onChangeComplete: (color: string, name?: string) => void;
6
+ handlerClassName?: string;
7
+ allowCustomColor?: boolean;
8
+ }
9
+ export declare const LexicalColorPicker: ({ value, onChange, onChangeComplete, allowCustomColor }: LexicalColorPickerProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,123 @@
1
+ import react, { useCallback, useEffect, useMemo, useState } from "react";
2
+ import { ChromePicker } from "react-color";
3
+ import { Tooltip } from "@webiny/admin-ui";
4
+ import { ReactComponent } from "./round-color_lens-24px.js";
5
+ import { useRichTextEditor } from "@webiny/lexical-editor";
6
+ const RESET_COLOR = "inherit";
7
+ const BG_FALLBACK = "var(--color-neutral-base)";
8
+ const BORDER_FALLBACK = "var(--border-color-neutral-dimmed-darker)";
9
+ const withColorFallback = (color, fallback)=>{
10
+ const trimmed = color.trim();
11
+ return /^var\(\s*--[^,()]+\)$/.test(trimmed) ? trimmed.replace(/\)$/, `, ${fallback})`) : trimmed;
12
+ };
13
+ const colorPickerClass = "flex flex-wrap gap-[6px] p-sm max-w-[132px] bg-neutral-base";
14
+ const colorPickerExpandedClass = "flex flex-wrap gap-[6px] p-sm w-[257px] bg-neutral-base";
15
+ const swatchClass = "flex items-center justify-center size-4 rounded-[2px] cursor-pointer transition-transform hover:scale-110 border-2 border-neutral-dimmed-darker";
16
+ const iconPaletteClass = "size-4 text-neutral-strong";
17
+ const noColorSwatchClass = `${swatchClass} bg-neutral-base relative overflow-hidden`;
18
+ const noColorSwatchStyle = {
19
+ borderColor: "var(--border-color-neutral-muted)"
20
+ };
21
+ const noColorLineStyle = {
22
+ background: "linear-gradient(45deg, transparent 44%, var(--border-color-neutral-muted) 44%, var(--border-color-neutral-muted) 56%, transparent 56%)"
23
+ };
24
+ const chromePickerClass = "mx-auto mt-sm shadow-none!";
25
+ const showPickerStyle = {
26
+ display: "block"
27
+ };
28
+ const hidePickerStyle = {
29
+ display: "none"
30
+ };
31
+ const LexicalColorPicker = ({ value, onChange, onChangeComplete, allowCustomColor })=>{
32
+ const [showPicker, setShowPicker] = useState(false);
33
+ const [actualSelectedColor, setActualSelectedColor] = useState(value || "#fff");
34
+ const [isThemeColor, setIsThemeColor] = useState(false);
35
+ useEffect(()=>{
36
+ if (value) setActualSelectedColor(value);
37
+ }, [
38
+ value
39
+ ]);
40
+ const getColorValue = useCallback((rgb, alpha)=>`rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha ?? rgb.a})`, []);
41
+ const onColorChange = useCallback((color, event)=>{
42
+ event.preventDefault();
43
+ const customColor = getColorValue(color.rgb, 0 === color.rgb.a ? 1 : color.rgb.a);
44
+ setActualSelectedColor(customColor);
45
+ if ("function" == typeof onChange) onChange(customColor);
46
+ }, [
47
+ onChange
48
+ ]);
49
+ const onColorChangeComplete = useCallback(({ rgb }, event)=>{
50
+ event.preventDefault();
51
+ const color = getColorValue(rgb, 0 === rgb.a ? 1 : rgb.a);
52
+ setActualSelectedColor(color);
53
+ onChangeComplete(color);
54
+ }, [
55
+ onChangeComplete
56
+ ]);
57
+ const togglePicker = useCallback((e)=>{
58
+ e.stopPropagation();
59
+ setShowPicker((state)=>!state);
60
+ }, []);
61
+ const { theme } = useRichTextEditor();
62
+ const themeColors = useMemo(()=>theme?.colors ?? [], []);
63
+ useEffect(()=>{
64
+ const isThemeColor = themeColors.some((color)=>color.value === value);
65
+ setIsThemeColor(isThemeColor);
66
+ }, [
67
+ themeColors,
68
+ value
69
+ ]);
70
+ return /*#__PURE__*/ react.createElement("div", {
71
+ className: showPicker ? colorPickerExpandedClass : colorPickerClass
72
+ }, themeColors.map((color)=>/*#__PURE__*/ react.createElement(Tooltip, {
73
+ key: color.id,
74
+ content: /*#__PURE__*/ react.createElement("span", null, color.label),
75
+ side: "bottom",
76
+ trigger: /*#__PURE__*/ react.createElement("button", {
77
+ className: swatchClass,
78
+ style: {
79
+ backgroundColor: withColorFallback(color.value, BG_FALLBACK),
80
+ borderColor: withColorFallback(color.value, BORDER_FALLBACK)
81
+ },
82
+ onClick: ()=>{
83
+ onChangeComplete(color.value, color.id);
84
+ }
85
+ })
86
+ })), allowCustomColor ? /*#__PURE__*/ react.createElement(Tooltip, {
87
+ content: /*#__PURE__*/ react.createElement("span", null, "Color picker"),
88
+ side: "bottom",
89
+ trigger: /*#__PURE__*/ react.createElement("button", {
90
+ className: swatchClass,
91
+ style: {
92
+ backgroundColor: isThemeColor ? "#fff" : value,
93
+ borderColor: "var(--border-color-neutral-dimmed-darker)"
94
+ },
95
+ onClick: togglePicker
96
+ }, /*#__PURE__*/ react.createElement(ReactComponent, {
97
+ className: iconPaletteClass
98
+ }))
99
+ }) : null, /*#__PURE__*/ react.createElement(Tooltip, {
100
+ content: /*#__PURE__*/ react.createElement("span", null, "No color"),
101
+ side: "bottom",
102
+ trigger: /*#__PURE__*/ react.createElement("button", {
103
+ className: noColorSwatchClass,
104
+ style: noColorSwatchStyle,
105
+ onClick: ()=>onChangeComplete(RESET_COLOR)
106
+ }, /*#__PURE__*/ react.createElement("span", {
107
+ className: "absolute inset-0",
108
+ style: noColorLineStyle
109
+ }))
110
+ }), /*#__PURE__*/ react.createElement("div", {
111
+ className: "w-full",
112
+ style: showPicker ? showPickerStyle : hidePickerStyle
113
+ }, /*#__PURE__*/ react.createElement(ChromePicker, {
114
+ className: chromePickerClass,
115
+ color: actualSelectedColor,
116
+ disableAlpha: true,
117
+ onChange: onColorChange,
118
+ onChangeComplete: onColorChangeComplete
119
+ })));
120
+ };
121
+ export { LexicalColorPicker };
122
+
123
+ //# sourceMappingURL=LexicalColorPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/LexicalColorPicker/LexicalColorPicker.js","sources":["../../../src/components/LexicalColorPicker/LexicalColorPicker.tsx"],"sourcesContent":["import type { SyntheticEvent } from \"react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { ColorResult, RGBColor } from \"react-color\";\nimport { ChromePicker } from \"react-color\";\nimport { Tooltip } from \"@webiny/admin-ui\";\n\n// Icons\nimport { ReactComponent as IconPalette } from \"./round-color_lens-24px.svg\";\nimport { useRichTextEditor } from \"@webiny/lexical-editor\";\n\n// Applied to reset the font color back to the theme/inherited default.\nconst RESET_COLOR = \"inherit\";\n\n// Some theme colors are bare CSS vars (e.g. `var(--wa-theme-color3)`) that may be undefined,\n// which renders black. Inject a fallback so an undefined color renders as a white swatch with\n// a gray border (bg falls back to white, border to gray) instead.\nconst BG_FALLBACK = \"var(--color-neutral-base)\";\nconst BORDER_FALLBACK = \"var(--border-color-neutral-dimmed-darker)\";\nconst withColorFallback = (color: string, fallback: string): string => {\n const trimmed = color.trim();\n return /^var\\(\\s*--[^,()]+\\)$/.test(trimmed)\n ? trimmed.replace(/\\)$/, `, ${fallback})`)\n : trimmed;\n};\n\n// Color menu (Figma Webiny DS): square 16px swatches, 2px radius, 6px gap, 8px padding.\n// max-w keeps ~5 swatches per row and lets it wrap for larger palettes.\nconst colorPickerClass = \"flex flex-wrap gap-[6px] p-sm max-w-[132px] bg-neutral-base\";\n// When the custom ChromePicker is open (allowCustomColors), the compact max-w would clip the\n// picker (the dropdown has overflow:hidden), so widen to fit the picker's natural ~225px width.\nconst colorPickerExpandedClass = \"flex flex-wrap gap-[6px] p-sm w-[257px] bg-neutral-base\";\n\nconst swatchClass =\n \"flex items-center justify-center size-4 rounded-[2px] cursor-pointer transition-transform hover:scale-110 \" +\n // 2px border (Figma DS) so light/white swatches stay visible.\n \"border-2 border-neutral-dimmed-darker\";\n\nconst iconPaletteClass = \"size-4 text-neutral-strong\";\n\n// \"No color\" swatch: bordered square with a diagonal line, resets the font color.\nconst noColorSwatchClass = `${swatchClass} bg-neutral-base relative overflow-hidden`;\n// No-color border is neutral-muted (Figma), applied inline to win over swatchClass's color.\nconst noColorSwatchStyle: React.CSSProperties = {\n borderColor: \"var(--border-color-neutral-muted)\"\n};\nconst noColorLineStyle: React.CSSProperties = {\n background:\n \"linear-gradient(45deg, transparent 44%, var(--border-color-neutral-muted) 44%, var(--border-color-neutral-muted) 56%, transparent 56%)\"\n};\n\n// Natural width, centered on its own full-width row below the swatches, with a top gap.\nconst chromePickerClass = \"mx-auto mt-sm shadow-none!\";\n\ninterface LexicalColorPickerProps {\n value: string;\n onChange?: (color: string) => void;\n onChangeComplete: (color: string, name?: string) => void;\n handlerClassName?: string;\n allowCustomColor?: boolean;\n}\n\nconst showPickerStyle = { display: \"block\" };\nconst hidePickerStyle = { display: \"none\" };\n\nexport const LexicalColorPicker = ({\n value,\n onChange,\n onChangeComplete,\n allowCustomColor\n}: LexicalColorPickerProps) => {\n const [showPicker, setShowPicker] = useState(false);\n // Either a custom color or a color coming from the theme object.\n const [actualSelectedColor, setActualSelectedColor] = useState(value || \"#fff\");\n const [isThemeColor, setIsThemeColor] = useState(false);\n\n useEffect(() => {\n if (value) {\n setActualSelectedColor(value);\n }\n }, [value]);\n\n const getColorValue = useCallback((rgb: RGBColor, alpha?: number) => {\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha ?? rgb.a})`;\n }, []);\n\n const onColorChange = useCallback(\n (color: Pick<ColorResult, \"rgb\">, event: React.SyntheticEvent) => {\n event.preventDefault();\n // controls of the picker are updated as user moves the mouse\n const customColor = getColorValue(color.rgb, color.rgb.a === 0 ? 1 : color.rgb.a);\n setActualSelectedColor(customColor);\n if (typeof onChange === \"function\") {\n onChange(customColor);\n }\n },\n [onChange]\n );\n\n const onColorChangeComplete = useCallback(\n ({ rgb }: Pick<ColorResult, \"rgb\">, event: React.SyntheticEvent) => {\n event.preventDefault();\n const color = getColorValue(rgb, rgb.a === 0 ? 1 : rgb.a);\n setActualSelectedColor(color);\n onChangeComplete(color);\n },\n [onChangeComplete]\n );\n\n const togglePicker = useCallback((e: SyntheticEvent) => {\n e.stopPropagation();\n setShowPicker(state => !state);\n }, []);\n\n const { theme } = useRichTextEditor();\n\n const themeColors = useMemo(() => theme?.colors ?? [], []);\n\n useEffect(() => {\n const isThemeColor = themeColors.some(color => color.value === value);\n setIsThemeColor(isThemeColor);\n }, [themeColors, value]);\n\n return (\n <div className={showPicker ? colorPickerExpandedClass : colorPickerClass}>\n {themeColors.map(color => {\n return (\n <Tooltip\n key={color.id}\n content={<span>{color.label}</span>}\n side=\"bottom\"\n trigger={\n <button\n className={swatchClass}\n // Border matches the color so there's no gray ring on\n // colored swatches; the gray border only shows for light/white.\n style={{\n backgroundColor: withColorFallback(color.value, BG_FALLBACK),\n borderColor: withColorFallback(color.value, BORDER_FALLBACK)\n }}\n onClick={() => {\n onChangeComplete(color.value, color.id);\n }}\n />\n }\n />\n );\n })}\n\n {allowCustomColor ? (\n <Tooltip\n content={<span>Color picker</span>}\n side=\"bottom\"\n trigger={\n <button\n className={swatchClass}\n style={{\n backgroundColor: isThemeColor ? \"#fff\" : value,\n borderColor: \"var(--border-color-neutral-dimmed-darker)\"\n }}\n onClick={togglePicker}\n >\n <IconPalette className={iconPaletteClass} />\n </button>\n }\n />\n ) : null}\n\n <Tooltip\n content={<span>No color</span>}\n side=\"bottom\"\n trigger={\n <button\n className={noColorSwatchClass}\n style={noColorSwatchStyle}\n onClick={() => onChangeComplete(RESET_COLOR)}\n >\n <span className={\"absolute inset-0\"} style={noColorLineStyle} />\n </button>\n }\n />\n\n <div className={\"w-full\"} style={showPicker ? showPickerStyle : hidePickerStyle}>\n <ChromePicker\n className={chromePickerClass}\n color={actualSelectedColor}\n disableAlpha={true}\n onChange={onColorChange}\n onChangeComplete={onColorChangeComplete}\n />\n </div>\n </div>\n );\n};\n"],"names":["RESET_COLOR","BG_FALLBACK","BORDER_FALLBACK","withColorFallback","color","fallback","trimmed","colorPickerClass","colorPickerExpandedClass","swatchClass","iconPaletteClass","noColorSwatchClass","noColorSwatchStyle","noColorLineStyle","chromePickerClass","showPickerStyle","hidePickerStyle","LexicalColorPicker","value","onChange","onChangeComplete","allowCustomColor","showPicker","setShowPicker","useState","actualSelectedColor","setActualSelectedColor","isThemeColor","setIsThemeColor","useEffect","getColorValue","useCallback","rgb","alpha","onColorChange","event","customColor","onColorChangeComplete","togglePicker","e","state","theme","useRichTextEditor","themeColors","useMemo","Tooltip","IconPalette","ChromePicker"],"mappings":"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"}
@@ -0,0 +1,21 @@
1
+ import __rslib_svgr_url__0__ from "../../static/svg/round-color_lens-24px.a38ca7dc.svg";
2
+ import * as __rspack_external_react from "react";
3
+ const SvgRoundColorLens24Px = (props)=>/*#__PURE__*/ __rspack_external_react.createElement("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ xmlSpace: "preserve",
6
+ width: 24,
7
+ height: 24,
8
+ viewBox: "0 0 24 24",
9
+ ...props
10
+ }, /*#__PURE__*/ __rspack_external_react.createElement("path", {
11
+ fill: "none",
12
+ d: "M0 0h24v24H0z"
13
+ }), /*#__PURE__*/ __rspack_external_react.createElement("path", {
14
+ fill: "currentColor",
15
+ d: "M12 3a9 9 0 0 0 0 18c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
16
+ }));
17
+ const round_color_lens_24px = __rslib_svgr_url__0__;
18
+ export default round_color_lens_24px;
19
+ export { SvgRoundColorLens24Px as ReactComponent };
20
+
21
+ //# sourceMappingURL=round-color_lens-24px.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/LexicalColorPicker/round-color_lens-24px.js","sources":["../../../src/components/LexicalColorPicker/round-color_lens-24px.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgRoundColorLens24Px = props => <svg xmlns=\"http://www.w3.org/2000/svg\" xmlSpace=\"preserve\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><path fill=\"none\" d=\"M0 0h24v24H0z\" /><path fill=\"currentColor\" d=\"M12 3a9 9 0 0 0 0 18c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5\" /></svg>;\nexport { SvgRoundColorLens24Px as ReactComponent };\nexport default \"__RSLIB_SVGR_AUTO_PUBLIC_PATH__static/svg/round-color_lens-24px.a38ca7dc.svg\";"],"names":["SvgRoundColorLens24Px","props"],"mappings":";;AACA,MAAMA,wBAAwBC,CAAAA,QAAAA,WAAAA,GAAS,sCAAC;QAAI,OAAM;QAA6B,UAAS;QAAW,OAAO;QAAI,QAAQ;QAAI,SAAQ;QAAa,GAAGA,KAAK;qBAAE,sCAAC;QAAK,MAAK;QAAO,GAAE;sBAAkB,sCAAC;QAAK,MAAK;QAAe,GAAE;;AAE3N"}
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
4
+ height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
5
+ <g id="Bounding_Boxes">
6
+ <g id="ui_x5F_spec_x5F_header_copy_3">
7
+ </g>
8
+ <rect fill="none" width="24" height="24"/>
9
+ </g>
10
+ <g id="Rounded">
11
+ <g id="ui_x5F_spec_x5F_header_copy_7">
12
+ </g>
13
+ <path fill="currentColor" d="M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9c0.83,0,1.5-0.67,1.5-1.5c0-0.39-0.15-0.74-0.39-1.01c-0.23-0.26-0.38-0.61-0.38-0.99
14
+ c0-0.83,0.67-1.5,1.5-1.5H16c2.76,0,5-2.24,5-5C21,6.58,16.97,3,12,3z M6.5,12C5.67,12,5,11.33,5,10.5S5.67,9,6.5,9S8,9.67,8,10.5
15
+ S7.33,12,6.5,12z M9.5,8C8.67,8,8,7.33,8,6.5S8.67,5,9.5,5S11,5.67,11,6.5S10.33,8,9.5,8z M14.5,8C13.67,8,13,7.33,13,6.5
16
+ S13.67,5,14.5,5S16,5.67,16,6.5S15.33,8,14.5,8z M17.5,12c-0.83,0-1.5-0.67-1.5-1.5S16.67,9,17.5,9S19,9.67,19,10.5
17
+ S18.33,12,17.5,12z"/>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,48 @@
1
+ import __rslib_svgr_url__0__ from "../../static/svg/unselected.2e11574c.svg";
2
+ import * as __rspack_external_react from "react";
3
+ const SvgUnselected = (props)=>/*#__PURE__*/ __rspack_external_react.createElement("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: 22,
6
+ height: 20,
7
+ fill: "none",
8
+ viewBox: "0 0 22 20",
9
+ ...props
10
+ }, /*#__PURE__*/ __rspack_external_react.createElement("rect", {
11
+ width: 20.864,
12
+ height: 18.546,
13
+ x: 0.5,
14
+ y: 0.89,
15
+ fill: "#fff",
16
+ stroke: "#DDD",
17
+ rx: 1
18
+ }), /*#__PURE__*/ __rspack_external_react.createElement("mask", {
19
+ id: "unselected_svg__a",
20
+ width: 22,
21
+ height: 20,
22
+ x: 0,
23
+ y: 0,
24
+ maskUnits: "userSpaceOnUse",
25
+ style: {
26
+ maskType: "alpha"
27
+ }
28
+ }, /*#__PURE__*/ __rspack_external_react.createElement("rect", {
29
+ width: 20.864,
30
+ height: 18.546,
31
+ x: 0.5,
32
+ y: 0.89,
33
+ fill: "#fff",
34
+ stroke: "#fff",
35
+ rx: 1
36
+ })), /*#__PURE__*/ __rspack_external_react.createElement("g", {
37
+ mask: "url(#unselected_svg__a)"
38
+ }, /*#__PURE__*/ __rspack_external_react.createElement("path", {
39
+ stroke: "#BF0000",
40
+ strokeLinecap: "round",
41
+ strokeLinejoin: "round",
42
+ d: "m21 1.412-20 17"
43
+ })));
44
+ const unselected = __rslib_svgr_url__0__;
45
+ export default unselected;
46
+ export { SvgUnselected as ReactComponent };
47
+
48
+ //# sourceMappingURL=unselected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/LexicalColorPicker/unselected.js","sources":["../../../src/components/LexicalColorPicker/unselected.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgUnselected = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={22} height={20} fill=\"none\" viewBox=\"0 0 22 20\" {...props}><rect width={20.864} height={18.546} x={0.5} y={0.89} fill=\"#fff\" stroke=\"#DDD\" rx={1} /><mask id=\"unselected_svg__a\" width={22} height={20} x={0} y={0} maskUnits=\"userSpaceOnUse\" style={{\n maskType: \"alpha\"\n }}><rect width={20.864} height={18.546} x={0.5} y={0.89} fill=\"#fff\" stroke=\"#fff\" rx={1} /></mask><g mask=\"url(#unselected_svg__a)\"><path stroke=\"#BF0000\" strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"m21 1.412-20 17\" /></g></svg>;\nexport { SvgUnselected as ReactComponent };\nexport default \"__RSLIB_SVGR_AUTO_PUBLIC_PATH__static/svg/unselected.2e11574c.svg\";"],"names":["SvgUnselected","props"],"mappings":";;AACA,MAAMA,gBAAgBC,CAAAA,QAAAA,WAAAA,GAAS,sCAAC;QAAI,OAAM;QAA6B,OAAO;QAAI,QAAQ;QAAI,MAAK;QAAO,SAAQ;QAAa,GAAGA,KAAK;qBAAE,sCAAC;QAAK,OAAO;QAAQ,QAAQ;QAAQ,GAAG;QAAK,GAAG;QAAM,MAAK;QAAO,QAAO;QAAO,IAAI;sBAAK,sCAAC;QAAK,IAAG;QAAoB,OAAO;QAAI,QAAQ;QAAI,GAAG;QAAG,GAAG;QAAG,WAAU;QAAiB,OAAO;YAChU,UAAU;QACZ;qBAAG,sCAAC;QAAK,OAAO;QAAQ,QAAQ;QAAQ,GAAG;QAAK,GAAG;QAAM,MAAK;QAAO,QAAO;QAAO,IAAI;uBAAY,sCAAC;QAAE,MAAK;qBAA0B,sCAAC;QAAK,QAAO;QAAU,eAAc;QAAQ,gBAAe;QAAQ,GAAE;;AAE7M"}
@@ -0,0 +1,10 @@
1
+ <svg width="22" height="20" viewBox="0 0 22 20" fill="none"
2
+ xmlns="http://www.w3.org/2000/svg">
3
+ <rect x="0.5" y="0.889587" width="20.8636" height="18.5455" rx="1" fill="white" stroke="#DDDDDD"/>
4
+ <mask id="mask0" maskUnits="userSpaceOnUse" x="0" y="0" width="22" height="20" style="mask-type:alpha">
5
+ <rect x="0.5" y="0.889587" width="20.8636" height="18.5455" rx="1" fill="white" stroke="white"/>
6
+ </mask>
7
+ <g mask="url(#mask0)">
8
+ <path d="M20.9999 1.41229L0.999878 18.4123" stroke="#BF0000" stroke-linecap="round" stroke-linejoin="round"/>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export interface LexicalColorPickerDropdownProps {
3
+ allowCustomColor?: boolean;
4
+ }
5
+ export declare const LexicalColorPickerDropdown: ({ allowCustomColor }: LexicalColorPickerDropdownProps) => React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ import react from "react";
2
+ import { DropDown, useFontColorPicker, useRichTextEditor } from "@webiny/lexical-editor";
3
+ import { LexicalColorPicker } from "./LexicalColorPicker/LexicalColorPicker.js";
4
+ import { ReactComponent } from "@webiny/icons/format_color_text.svg";
5
+ const LexicalColorPickerDropdown = ({ allowCustomColor })=>{
6
+ const { value, applyColor } = useFontColorPicker();
7
+ const { theme } = useRichTextEditor();
8
+ return /*#__PURE__*/ react.createElement(DropDown, {
9
+ buttonClassName: "toolbar-item color-picker",
10
+ buttonAriaLabel: "Formatting options for text color",
11
+ buttonIcon: /*#__PURE__*/ react.createElement(ReactComponent, {
12
+ className: "icon",
13
+ style: value ? {
14
+ fill: value
15
+ } : void 0
16
+ }),
17
+ stopCloseOnClickSelf: true,
18
+ disabled: false,
19
+ showScroll: false
20
+ }, /*#__PURE__*/ react.createElement(LexicalColorPicker, {
21
+ value: value,
22
+ onChangeComplete: applyColor,
23
+ allowCustomColor: allowCustomColor ?? theme.allowCustomColors
24
+ }));
25
+ };
26
+ export { LexicalColorPickerDropdown };
27
+
28
+ //# sourceMappingURL=LexicalColorPickerDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/LexicalColorPickerDropdown.js","sources":["../../src/components/LexicalColorPickerDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFontColorPicker, useRichTextEditor, DropDown } from \"@webiny/lexical-editor\";\nimport { LexicalColorPicker } from \"~/components/LexicalColorPicker/LexicalColorPicker.js\";\nimport { ReactComponent as FontColorIcon } from \"@webiny/icons/format_color_text.svg\";\n\nexport interface LexicalColorPickerDropdownProps {\n allowCustomColor?: boolean;\n}\n\nexport const LexicalColorPickerDropdown = ({\n allowCustomColor\n}: LexicalColorPickerDropdownProps) => {\n const { value, applyColor } = useFontColorPicker();\n const { theme } = useRichTextEditor();\n\n return (\n <DropDown\n buttonClassName=\"toolbar-item color-picker\"\n buttonAriaLabel={\"Formatting options for text color\"}\n buttonIcon={\n // Tint the A icon with the current font color.\n <FontColorIcon className=\"icon\" style={value ? { fill: value } : undefined} />\n }\n stopCloseOnClickSelf={true}\n disabled={false}\n showScroll={false}\n >\n <LexicalColorPicker\n value={value}\n onChangeComplete={applyColor}\n allowCustomColor={allowCustomColor ?? theme.allowCustomColors}\n />\n </DropDown>\n );\n};\n"],"names":["LexicalColorPickerDropdown","allowCustomColor","value","applyColor","useFontColorPicker","theme","useRichTextEditor","DropDown","FontColorIcon","undefined","LexicalColorPicker"],"mappings":";;;;AASO,MAAMA,6BAA6B,CAAC,EACvCC,gBAAgB,EACc;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGC;IAC9B,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAElB,OAAO,WAAP,GACI,oBAACC,UAAQA;QACL,iBAAgB;QAChB,iBAAiB;QACjB,Y,cAEI,oBAACC,gBAAaA;YAAC,WAAU;YAAO,OAAON,QAAQ;gBAAE,MAAMA;YAAM,IAAIO;;QAErE,sBAAsB;QACtB,UAAU;QACV,YAAY;qBAEZ,oBAACC,oBAAkBA;QACf,OAAOR;QACP,kBAAkBC;QAClB,kBAAkBF,oBAAoBI,MAAM,iBAAiB;;AAI7E"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const TextAlignmentDropdown: () => React.JSX.Element;
@@ -0,0 +1,90 @@
1
+ import react from "react";
2
+ import { $isParentElementRTL } from "@lexical/selection";
3
+ import { Divider, DropDown, DropDownItem, useTextAlignmentAction } from "@webiny/lexical-editor";
4
+ import { useDeriveValueFromSelection } from "@webiny/lexical-editor/hooks/useCurrentSelection.js";
5
+ import { ReactComponent } from "@webiny/icons/format_align_left.svg";
6
+ import { ReactComponent as format_align_center_svg_ReactComponent } from "@webiny/icons/format_align_center.svg";
7
+ import { ReactComponent as format_align_right_svg_ReactComponent } from "@webiny/icons/format_align_right.svg";
8
+ import { ReactComponent as format_align_justify_svg_ReactComponent } from "@webiny/icons/format_align_justify.svg";
9
+ import { ReactComponent as format_indent_increase_svg_ReactComponent } from "@webiny/icons/format_indent_increase.svg";
10
+ import { ReactComponent as format_indent_decrease_svg_ReactComponent } from "@webiny/icons/format_indent_decrease.svg";
11
+ const TextAlignmentDropdown = ()=>{
12
+ const { applyTextAlignment, outdentText, indentText, value } = useTextAlignmentAction();
13
+ const isRTL = useDeriveValueFromSelection(({ rangeSelection })=>rangeSelection ? $isParentElementRTL(rangeSelection) : false);
14
+ const alignment = value || "left";
15
+ return /*#__PURE__*/ react.createElement(DropDown, {
16
+ buttonLabel: "Align",
17
+ buttonIcon: /*#__PURE__*/ react.createElement(ReactComponent, {
18
+ className: "icon"
19
+ }),
20
+ buttonClassName: "toolbar-item spaced alignment",
21
+ buttonAriaLabel: "Formatting options for text alignment"
22
+ }, /*#__PURE__*/ react.createElement(DropDownItem, {
23
+ onClick: ()=>{
24
+ applyTextAlignment("left");
25
+ },
26
+ className: "item",
27
+ selected: "left" === alignment
28
+ }, /*#__PURE__*/ react.createElement(ReactComponent, {
29
+ className: "icon"
30
+ }), /*#__PURE__*/ react.createElement("span", {
31
+ className: "text"
32
+ }, "Left Align")), /*#__PURE__*/ react.createElement(DropDownItem, {
33
+ onClick: ()=>{
34
+ applyTextAlignment("center");
35
+ },
36
+ className: "item",
37
+ selected: "center" === alignment
38
+ }, /*#__PURE__*/ react.createElement(format_align_center_svg_ReactComponent, {
39
+ className: "icon"
40
+ }), /*#__PURE__*/ react.createElement("span", {
41
+ className: "text"
42
+ }, "Center Align")), /*#__PURE__*/ react.createElement(DropDownItem, {
43
+ onClick: ()=>{
44
+ applyTextAlignment("right");
45
+ },
46
+ className: "item",
47
+ selected: "right" === alignment
48
+ }, /*#__PURE__*/ react.createElement(format_align_right_svg_ReactComponent, {
49
+ className: "icon"
50
+ }), /*#__PURE__*/ react.createElement("span", {
51
+ className: "text"
52
+ }, "Right Align")), /*#__PURE__*/ react.createElement(DropDownItem, {
53
+ onClick: ()=>{
54
+ applyTextAlignment("justify");
55
+ },
56
+ className: "item",
57
+ selected: "justify" === alignment
58
+ }, /*#__PURE__*/ react.createElement(format_align_justify_svg_ReactComponent, {
59
+ className: "icon"
60
+ }), /*#__PURE__*/ react.createElement("span", {
61
+ className: "text"
62
+ }, "Justify Align")), /*#__PURE__*/ react.createElement(Divider, null), /*#__PURE__*/ react.createElement(DropDownItem, {
63
+ onClick: ()=>{
64
+ outdentText();
65
+ },
66
+ className: "item",
67
+ selected: false
68
+ }, isRTL ? /*#__PURE__*/ react.createElement(format_indent_increase_svg_ReactComponent, {
69
+ className: "icon"
70
+ }) : /*#__PURE__*/ react.createElement(format_indent_decrease_svg_ReactComponent, {
71
+ className: "icon"
72
+ }), /*#__PURE__*/ react.createElement("span", {
73
+ className: "text"
74
+ }, "Outdent")), /*#__PURE__*/ react.createElement(DropDownItem, {
75
+ onClick: ()=>{
76
+ indentText();
77
+ },
78
+ className: "item",
79
+ selected: false
80
+ }, isRTL ? /*#__PURE__*/ react.createElement(format_indent_decrease_svg_ReactComponent, {
81
+ className: "icon"
82
+ }) : /*#__PURE__*/ react.createElement(format_indent_increase_svg_ReactComponent, {
83
+ className: "icon"
84
+ }), /*#__PURE__*/ react.createElement("span", {
85
+ className: "text"
86
+ }, "Indent")));
87
+ };
88
+ export { TextAlignmentDropdown };
89
+
90
+ //# sourceMappingURL=TextAlignmentDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/TextAlignmentDropdown.js","sources":["../../src/components/TextAlignmentDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { $isParentElementRTL } from \"@lexical/selection\";\nimport { Divider, DropDown, DropDownItem, useTextAlignmentAction } from \"@webiny/lexical-editor\";\nimport { useDeriveValueFromSelection } from \"@webiny/lexical-editor/hooks/useCurrentSelection.js\";\nimport { ReactComponent as AlignLeftIcon } from \"@webiny/icons/format_align_left.svg\";\nimport { ReactComponent as AlignCenterIcon } from \"@webiny/icons/format_align_center.svg\";\nimport { ReactComponent as AlignRightIcon } from \"@webiny/icons/format_align_right.svg\";\nimport { ReactComponent as AlignJustifyIcon } from \"@webiny/icons/format_align_justify.svg\";\nimport { ReactComponent as IndentIcon } from \"@webiny/icons/format_indent_increase.svg\";\nimport { ReactComponent as OutdentIcon } from \"@webiny/icons/format_indent_decrease.svg\";\n\nexport const TextAlignmentDropdown = () => {\n const { applyTextAlignment, outdentText, indentText, value } = useTextAlignmentAction();\n\n const isRTL = useDeriveValueFromSelection(({ rangeSelection }) => {\n return rangeSelection ? $isParentElementRTL(rangeSelection) : false;\n });\n\n // Empty format defaults to left alignment.\n const alignment = value || \"left\";\n\n return (\n <DropDown\n buttonLabel=\"Align\"\n buttonIcon={<AlignLeftIcon className=\"icon\" />}\n buttonClassName=\"toolbar-item spaced alignment\"\n buttonAriaLabel=\"Formatting options for text alignment\"\n >\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"left\");\n }}\n className=\"item\"\n selected={alignment === \"left\"}\n >\n <AlignLeftIcon className=\"icon\" />\n <span className=\"text\">Left Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"center\");\n }}\n className=\"item\"\n selected={alignment === \"center\"}\n >\n <AlignCenterIcon className=\"icon\" />\n <span className=\"text\">Center Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"right\");\n }}\n className=\"item\"\n selected={alignment === \"right\"}\n >\n <AlignRightIcon className=\"icon\" />\n <span className=\"text\">Right Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"justify\");\n }}\n className=\"item\"\n selected={alignment === \"justify\"}\n >\n <AlignJustifyIcon className=\"icon\" />\n <span className=\"text\">Justify Align</span>\n </DropDownItem>\n <Divider />\n <DropDownItem\n onClick={() => {\n outdentText();\n }}\n className=\"item\"\n selected={false}\n >\n {isRTL ? <IndentIcon className=\"icon\" /> : <OutdentIcon className=\"icon\" />}\n <span className=\"text\">Outdent</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n indentText();\n }}\n className=\"item\"\n selected={false}\n >\n {isRTL ? <OutdentIcon className=\"icon\" /> : <IndentIcon className=\"icon\" />}\n <span className=\"text\">Indent</span>\n </DropDownItem>\n </DropDown>\n );\n};\n"],"names":["TextAlignmentDropdown","applyTextAlignment","outdentText","indentText","value","useTextAlignmentAction","isRTL","useDeriveValueFromSelection","rangeSelection","$isParentElementRTL","alignment","DropDown","AlignLeftIcon","DropDownItem","AlignCenterIcon","AlignRightIcon","AlignJustifyIcon","Divider","IndentIcon","OutdentIcon"],"mappings":";;;;;;;;;;AAWO,MAAMA,wBAAwB;IACjC,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,UAAU,EAAEC,KAAK,EAAE,GAAGC;IAE/D,MAAMC,QAAQC,4BAA4B,CAAC,EAAEC,cAAc,EAAE,GAClDA,iBAAiBC,oBAAoBD,kBAAkB;IAIlE,MAAME,YAAYN,SAAS;IAE3B,OAAO,WAAP,GACI,oBAACO,UAAQA;QACL,aAAY;QACZ,0BAAY,oBAACC,gBAAaA;YAAC,WAAU;;QACrC,iBAAgB;QAChB,iBAAgB;qBAEhB,oBAACC,cAAYA;QACT,SAAS;YACLZ,mBAAmB;QACvB;QACA,WAAU;QACV,UAAUS,AAAc,WAAdA;qBAEV,oBAACE,gBAAaA;QAAC,WAAU;sBACzB,oBAAC;QAAK,WAAU;OAAO,8BAE3B,oBAACC,cAAYA;QACT,SAAS;YACLZ,mBAAmB;QACvB;QACA,WAAU;QACV,UAAUS,AAAc,aAAdA;qBAEV,oBAACI,wCAAeA;QAAC,WAAU;sBAC3B,oBAAC;QAAK,WAAU;OAAO,gCAE3B,oBAACD,cAAYA;QACT,SAAS;YACLZ,mBAAmB;QACvB;QACA,WAAU;QACV,UAAUS,AAAc,YAAdA;qBAEV,oBAACK,uCAAcA;QAAC,WAAU;sBAC1B,oBAAC;QAAK,WAAU;OAAO,+BAE3B,oBAACF,cAAYA;QACT,SAAS;YACLZ,mBAAmB;QACvB;QACA,WAAU;QACV,UAAUS,AAAc,cAAdA;qBAEV,oBAACM,yCAAgBA;QAAC,WAAU;sBAC5B,oBAAC;QAAK,WAAU;OAAO,iCAE3B,oBAACC,SAAOA,OAAAA,WAAAA,GACR,oBAACJ,cAAYA;QACT,SAAS;YACLX;QACJ;QACA,WAAU;QACV,UAAU;OAETI,QAAQ,WAARA,GAAQ,oBAACY,2CAAUA;QAAC,WAAU;uBAAY,oBAACC,2CAAWA;QAAC,WAAU;sBAClE,oBAAC;QAAK,WAAU;OAAO,2BAE3B,oBAACN,cAAYA;QACT,SAAS;YACLV;QACJ;QACA,WAAU;QACV,UAAU;OAETG,QAAQ,WAARA,GAAQ,oBAACa,2CAAWA;QAAC,WAAU;uBAAY,oBAACD,2CAAUA;QAAC,WAAU;sBAClE,oBAAC;QAAK,WAAU;OAAO;AAIvC"}
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { LexicalEditorActions } from "./LexicalEditorActions.js";
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export { LexicalEditorActions } from "./LexicalEditorActions.js";
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@webiny/lexical-editor-actions",
3
+ "version": "0.0.0-unstable.0156a4c312",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
9
+ "dependencies": {
10
+ "@lexical/selection": "0.53.0",
11
+ "@webiny/admin-ui": "0.0.0-unstable.0156a4c312",
12
+ "@webiny/icons": "0.0.0-unstable.0156a4c312",
13
+ "@webiny/lexical-editor": "0.0.0-unstable.0156a4c312",
14
+ "react": "19.3.1",
15
+ "react-color": "2.19.3",
16
+ "react-dom": "19.3.1"
17
+ },
18
+ "devDependencies": {
19
+ "@types/react-color": "3.0.13",
20
+ "@webiny/build-tools": "0.0.0-unstable.0156a4c312"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "webiny": {
26
+ "publishFrom": "dist"
27
+ }
28
+ }
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
4
+ height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
5
+ <g id="Bounding_Boxes">
6
+ <g id="ui_x5F_spec_x5F_header_copy_3">
7
+ </g>
8
+ <rect fill="none" width="24" height="24"/>
9
+ </g>
10
+ <g id="Rounded">
11
+ <g id="ui_x5F_spec_x5F_header_copy_7">
12
+ </g>
13
+ <path fill="currentColor" d="M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9c0.83,0,1.5-0.67,1.5-1.5c0-0.39-0.15-0.74-0.39-1.01c-0.23-0.26-0.38-0.61-0.38-0.99
14
+ c0-0.83,0.67-1.5,1.5-1.5H16c2.76,0,5-2.24,5-5C21,6.58,16.97,3,12,3z M6.5,12C5.67,12,5,11.33,5,10.5S5.67,9,6.5,9S8,9.67,8,10.5
15
+ S7.33,12,6.5,12z M9.5,8C8.67,8,8,7.33,8,6.5S8.67,5,9.5,5S11,5.67,11,6.5S10.33,8,9.5,8z M14.5,8C13.67,8,13,7.33,13,6.5
16
+ S13.67,5,14.5,5S16,5.67,16,6.5S15.33,8,14.5,8z M17.5,12c-0.83,0-1.5-0.67-1.5-1.5S16.67,9,17.5,9S19,9.67,19,10.5
17
+ S18.33,12,17.5,12z"/>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="22" height="20" viewBox="0 0 22 20" fill="none"
2
+ xmlns="http://www.w3.org/2000/svg">
3
+ <rect x="0.5" y="0.889587" width="20.8636" height="18.5455" rx="1" fill="white" stroke="#DDDDDD"/>
4
+ <mask id="mask0" maskUnits="userSpaceOnUse" x="0" y="0" width="22" height="20" style="mask-type:alpha">
5
+ <rect x="0.5" y="0.889587" width="20.8636" height="18.5455" rx="1" fill="white" stroke="white"/>
6
+ </mask>
7
+ <g mask="url(#mask0)">
8
+ <path d="M20.9999 1.41229L0.999878 18.4123" stroke="#BF0000" stroke-linecap="round" stroke-linejoin="round"/>
9
+ </g>
10
+ </svg>