@squiz/formatted-text-editor 1.21.1-alpha.3 → 1.21.1-alpha.4
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/lib/EditorToolbar/Toolbar.js +3 -1
- package/lib/EditorToolbar/Tools/Bold/BoldButton.js +2 -2
- package/lib/EditorToolbar/Tools/Image/Form/ImageForm.d.ts +17 -0
- package/lib/EditorToolbar/Tools/Image/Form/ImageForm.js +84 -0
- package/lib/EditorToolbar/Tools/Image/ImageButton.d.ts +2 -0
- package/lib/EditorToolbar/Tools/Image/ImageButton.js +67 -0
- package/lib/EditorToolbar/Tools/Image/ImageModal.d.ts +8 -0
- package/lib/EditorToolbar/Tools/Image/ImageModal.js +19 -0
- package/lib/EditorToolbar/Tools/Italic/ItalicButton.js +2 -2
- package/lib/EditorToolbar/Tools/Link/Form/LinkForm.js +5 -5
- package/lib/EditorToolbar/Tools/Link/LinkButton.js +2 -2
- package/lib/EditorToolbar/Tools/Link/RemoveLinkButton.js +2 -2
- package/lib/EditorToolbar/Tools/Redo/RedoButton.js +2 -2
- package/lib/EditorToolbar/Tools/TextAlign/CenterAlign/CenterAlignButton.js +2 -2
- package/lib/EditorToolbar/Tools/TextAlign/JustifyAlign/JustifyAlignButton.js +2 -2
- package/lib/EditorToolbar/Tools/TextAlign/LeftAlign/LeftAlignButton.js +2 -2
- package/lib/EditorToolbar/Tools/TextAlign/RightAlign/RightAlignButton.js +2 -2
- package/lib/EditorToolbar/Tools/Underline/UnderlineButton.js +2 -2
- package/lib/EditorToolbar/Tools/Undo/UndoButton.js +2 -2
- package/lib/Extensions/Extensions.d.ts +2 -1
- package/lib/Extensions/Extensions.js +2 -0
- package/lib/Extensions/ImageExtension/ImageExtension.d.ts +3 -0
- package/lib/Extensions/ImageExtension/ImageExtension.js +7 -0
- package/lib/index.css +128 -74
- package/lib/ui/Button/Button.d.ts +11 -0
- package/lib/ui/Button/Button.js +14 -0
- package/lib/ui/Fields/Input/Input.d.ts +4 -0
- package/lib/ui/{Inputs/Text/TextInput.js → Fields/Input/Input.js} +4 -4
- package/package.json +4 -3
- package/src/Editor/_editor.scss +2 -49
- package/src/EditorToolbar/Toolbar.tsx +2 -0
- package/src/EditorToolbar/Tools/Bold/BoldButton.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Bold/BoldButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Image/Form/ImageForm.spec.tsx +23 -0
- package/src/EditorToolbar/Tools/Image/Form/ImageForm.tsx +92 -0
- package/src/EditorToolbar/Tools/Image/ImageButton.spec.tsx +79 -0
- package/src/EditorToolbar/Tools/Image/ImageButton.tsx +57 -0
- package/src/EditorToolbar/Tools/Image/ImageModal.spec.tsx +83 -0
- package/src/EditorToolbar/Tools/Image/ImageModal.tsx +29 -0
- package/src/EditorToolbar/Tools/Italic/ItalicButton.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Italic/ItalicButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Link/Form/LinkForm.tsx +5 -5
- package/src/EditorToolbar/Tools/Link/LinkButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Link/RemoveLinkButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Redo/RedoButton.tsx +2 -2
- package/src/EditorToolbar/Tools/TextAlign/CenterAlign/CenterAlignButton.tsx +2 -2
- package/src/EditorToolbar/Tools/TextAlign/JustifyAlign/JustifyAlignButton.tsx +2 -2
- package/src/EditorToolbar/Tools/TextAlign/LeftAlign/LeftAlignButton.tsx +2 -2
- package/src/EditorToolbar/Tools/TextAlign/RightAlign/RightAlignButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Underline/Underline.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Underline/UnderlineButton.tsx +2 -2
- package/src/EditorToolbar/Tools/Undo/UndoButton.tsx +2 -2
- package/src/EditorToolbar/_floating-toolbar.scss +6 -0
- package/src/EditorToolbar/_toolbar.scss +11 -5
- package/src/Extensions/Extensions.ts +2 -0
- package/src/Extensions/ImageExtension/ImageExtension.ts +3 -0
- package/src/index.scss +2 -2
- package/src/ui/Button/Button.spec.tsx +44 -0
- package/src/ui/Button/Button.tsx +31 -0
- package/src/ui/{_buttons.scss → Button/_button.scss} +19 -1
- package/src/ui/{Inputs/Text/TextInput.spec.tsx → Fields/Input/Input.spec.tsx} +8 -8
- package/src/ui/{Inputs/Text/TextInput.tsx → Fields/Input/Input.tsx} +4 -4
- package/src/ui/_typography.scss +46 -0
- package/lib/ui/Inputs/Text/TextInput.d.ts +0 -4
- package/lib/ui/ToolbarButton/ToolbarButton.d.ts +0 -10
- package/lib/ui/ToolbarButton/ToolbarButton.js +0 -10
- package/src/ui/ToolbarButton/ToolbarButton.tsx +0 -26
- package/src/ui/ToolbarButton/_toolbar-button.scss +0 -17
- /package/lib/ui/{Inputs → Fields}/Select/Select.d.ts +0 -0
- /package/lib/ui/{Inputs → Fields}/Select/Select.js +0 -0
- /package/src/ui/{Inputs → Fields}/Select/Select.spec.tsx +0 -0
- /package/src/ui/{Inputs → Fields}/Select/Select.tsx +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
import React, { ForwardedRef, forwardRef, InputHTMLAttributes } from 'react';
|
2
2
|
|
3
|
-
type
|
3
|
+
type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
4
4
|
label?: string;
|
5
5
|
};
|
6
6
|
|
7
|
-
const
|
7
|
+
const InputInternal = ({ name, label, type = 'text', ...rest }: InputProps, ref: ForwardedRef<HTMLInputElement>) => {
|
8
8
|
return (
|
9
9
|
<>
|
10
10
|
{label && (
|
@@ -12,9 +12,9 @@ const TextInputInternal = ({ name, label, ...rest }: TextInputProps, ref: Forwar
|
|
12
12
|
{label}
|
13
13
|
</label>
|
14
14
|
)}
|
15
|
-
<input ref={ref} id={name} name={name} type=
|
15
|
+
<input ref={ref} id={name} name={name} type={type} className="squiz-fte-form-control" {...rest} />
|
16
16
|
</>
|
17
17
|
);
|
18
18
|
};
|
19
19
|
|
20
|
-
export const
|
20
|
+
export const Input = forwardRef(InputInternal);
|
@@ -0,0 +1,46 @@
|
|
1
|
+
a {
|
2
|
+
@apply text-blue-300;
|
3
|
+
text-decoration: underline;
|
4
|
+
}
|
5
|
+
|
6
|
+
h1 {
|
7
|
+
font-size: 1.625rem;
|
8
|
+
font-weight: 600;
|
9
|
+
letter-spacing: -0.2px;
|
10
|
+
line-height: 2rem;
|
11
|
+
}
|
12
|
+
|
13
|
+
h2 {
|
14
|
+
font-size: 1.25rem;
|
15
|
+
font-weight: 600;
|
16
|
+
letter-spacing: -0.5px;
|
17
|
+
line-height: 1.5rem;
|
18
|
+
}
|
19
|
+
|
20
|
+
h3 {
|
21
|
+
font-size: 1.125rem;
|
22
|
+
font-weight: 600;
|
23
|
+
letter-spacing: -0.2px;
|
24
|
+
line-height: 1.375rem;
|
25
|
+
}
|
26
|
+
|
27
|
+
h4 {
|
28
|
+
font-size: 1rem;
|
29
|
+
font-weight: 700;
|
30
|
+
letter-spacing: -0.2px;
|
31
|
+
line-height: 1.25rem;
|
32
|
+
}
|
33
|
+
|
34
|
+
h5 {
|
35
|
+
font-size: 1rem;
|
36
|
+
font-weight: 600;
|
37
|
+
letter-spacing: -0.2px;
|
38
|
+
line-height: 1.25rem;
|
39
|
+
}
|
40
|
+
|
41
|
+
h6 {
|
42
|
+
font-size: 0.875rem;
|
43
|
+
font-weight: 600;
|
44
|
+
letter-spacing: -0.2px;
|
45
|
+
line-height: 1.25rem;
|
46
|
+
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { ReactElement } from 'react';
|
2
|
-
type ToolbarButtonProps = {
|
3
|
-
handleOnClick: () => void;
|
4
|
-
isDisabled?: boolean;
|
5
|
-
isActive: boolean;
|
6
|
-
icon: ReactElement;
|
7
|
-
label: string;
|
8
|
-
};
|
9
|
-
declare const ToolbarButton: ({ handleOnClick, isDisabled, isActive, icon, label }: ToolbarButtonProps) => JSX.Element;
|
10
|
-
export default ToolbarButton;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const react_1 = __importDefault(require("react"));
|
7
|
-
const ToolbarButton = ({ handleOnClick, isDisabled, isActive, icon, label }) => {
|
8
|
-
return (react_1.default.createElement("button", { "aria-label": label, title: label, type: "button", onClick: handleOnClick, disabled: isDisabled, className: `squiz-fte-btn toolbar-button ${isActive ? 'is-active' : ''}` }, icon));
|
9
|
-
};
|
10
|
-
exports.default = ToolbarButton;
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import React, { ReactElement } from 'react';
|
2
|
-
|
3
|
-
type ToolbarButtonProps = {
|
4
|
-
handleOnClick: () => void;
|
5
|
-
isDisabled?: boolean;
|
6
|
-
isActive: boolean;
|
7
|
-
icon: ReactElement;
|
8
|
-
label: string;
|
9
|
-
};
|
10
|
-
|
11
|
-
const ToolbarButton = ({ handleOnClick, isDisabled, isActive, icon, label }: ToolbarButtonProps) => {
|
12
|
-
return (
|
13
|
-
<button
|
14
|
-
aria-label={label}
|
15
|
-
title={label}
|
16
|
-
type="button"
|
17
|
-
onClick={handleOnClick}
|
18
|
-
disabled={isDisabled}
|
19
|
-
className={`squiz-fte-btn toolbar-button ${isActive ? 'is-active' : ''}`}
|
20
|
-
>
|
21
|
-
{icon}
|
22
|
-
</button>
|
23
|
-
);
|
24
|
-
};
|
25
|
-
|
26
|
-
export default ToolbarButton;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
.toolbar-button {
|
2
|
-
@apply bg-white text-gray-600 p-1;
|
3
|
-
|
4
|
-
~ .toolbar-button {
|
5
|
-
margin-left: 2px;
|
6
|
-
}
|
7
|
-
|
8
|
-
&:hover,
|
9
|
-
&:focus {
|
10
|
-
background-color: rgba(black, 0.04);
|
11
|
-
}
|
12
|
-
|
13
|
-
&.is-active,
|
14
|
-
&:active {
|
15
|
-
@apply text-blue-300 bg-blue-100;
|
16
|
-
}
|
17
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|