@appquality/unguess-design-system 2.10.63 → 2.10.66
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
# v2.10.66 (Fri Jul 29 2022)
|
|
2
|
+
|
|
3
|
+
#### ⚠️ Pushed to `master`
|
|
4
|
+
|
|
5
|
+
- Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- chore(theme): update dangerHue shade ([@cannarocks](https://github.com/cannarocks))
|
|
7
|
+
|
|
8
|
+
#### Authors: 1
|
|
9
|
+
|
|
10
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v2.10.65 (Fri Jul 29 2022)
|
|
15
|
+
|
|
16
|
+
#### ⚠️ Pushed to `master`
|
|
17
|
+
|
|
18
|
+
- Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
|
|
19
|
+
- feat(editor): Add validation support ([@cannarocks](https://github.com/cannarocks))
|
|
20
|
+
|
|
21
|
+
#### Authors: 1
|
|
22
|
+
|
|
23
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# v2.10.64 (Wed Jul 27 2022)
|
|
28
|
+
|
|
29
|
+
#### ⚠️ Pushed to `master`
|
|
30
|
+
|
|
31
|
+
- Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
|
|
32
|
+
- fix(editor): remove min height when editable is false ([@cannarocks](https://github.com/cannarocks))
|
|
33
|
+
|
|
34
|
+
#### Authors: 1
|
|
35
|
+
|
|
36
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
1
40
|
# v2.10.63 (Wed Jul 27 2022)
|
|
2
41
|
|
|
3
42
|
#### ⚠️ Pushed to `master`
|
package/build/index.js
CHANGED
|
@@ -257,7 +257,7 @@ var components = __assign(__assign({}, reactTheming.DEFAULT_THEME.components), {
|
|
|
257
257
|
imgMaxHeight: "214px",
|
|
258
258
|
} });
|
|
259
259
|
|
|
260
|
-
var theme = __assign(__assign({}, reactTheming.DEFAULT_THEME), { colors: __assign(__assign({}, reactTheming.DEFAULT_THEME.colors), { primaryHue: palette.blue[600], warningHue: palette.yellow[600], successHue: palette.teal["M600"], dangerHue: palette.red[
|
|
260
|
+
var theme = __assign(__assign({}, reactTheming.DEFAULT_THEME), { colors: __assign(__assign({}, reactTheming.DEFAULT_THEME.colors), { primaryHue: palette.blue[600], warningHue: palette.yellow[600], successHue: palette.teal["M600"], dangerHue: palette.red[600], accentHue: palette.water[600] }), palette: palette, fonts: __assign(__assign({}, reactTheming.DEFAULT_THEME.fonts), { system: '"Poppins",sans-serif,Helvetica,Arial,sans-serif' }), fontWeights: __assign(__assign({}, reactTheming.DEFAULT_THEME.fontWeights), { semibold: 500 }), gradients: gradients, borderRadii: __assign(__assign({}, reactTheming.DEFAULT_THEME.borderRadii), { lg: "8px", xl: "16px", xxl: "32px" }), components: components, shadows: __assign(__assign({}, reactTheming.DEFAULT_THEME.shadows), { boxShadow: boxShadow }) });
|
|
261
261
|
|
|
262
262
|
var GlobalStyle = styled.createGlobalStyle(templateObject_1$1e || (templateObject_1$1e = __makeTemplateObject(["\n ::-webkit-scrollbar-track:hover {\n border-left: solid 1px ", ";\n border-right: solid 1px ", ";\n }\n\n ::-webkit-scrollbar {\n width: 10px;\n }\n\n ::-webkit-scrollbar-track {\n border: solid 2px transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px ", ";\n border: solid 2px transparent;\n border-radius: 25px;\n }\n\n /* This stuff is for Firefox */\n * {\n scrollbar-color: ", " #FFFFFF;\n scrollbar-width: thin;\n }\n\n html {\n overflow-y: auto;\n }\n\n body {\n font-family: ", ";\n margin: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n \n svg {\n max-height: 100%;\n }\n\n"], ["\n ::-webkit-scrollbar-track:hover {\n border-left: solid 1px ", ";\n border-right: solid 1px ", ";\n }\n\n ::-webkit-scrollbar {\n width: 10px;\n }\n\n ::-webkit-scrollbar-track {\n border: solid 2px transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px ", ";\n border: solid 2px transparent;\n border-radius: 25px;\n }\n\n /* This stuff is for Firefox */\n * {\n scrollbar-color: ", " #FFFFFF;\n scrollbar-width: thin;\n }\n\n html {\n overflow-y: auto;\n }\n\n body {\n font-family: ", ";\n margin: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n \n svg {\n max-height: 100%;\n }\n\n"])), theme.palette.grey["200"], theme.palette.grey["200"], theme.palette.blue["200"], theme.palette.blue["200"], theme.fonts.system);
|
|
263
263
|
var templateObject_1$1e;
|
|
@@ -1244,13 +1244,24 @@ var Header$1 = styled__default["default"].div(templateObject_1$T || (templateObj
|
|
|
1244
1244
|
var theme = _a.theme;
|
|
1245
1245
|
return theme.palette.grey[300];
|
|
1246
1246
|
});
|
|
1247
|
-
var Title$2 = styled__default["default"](MD)(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n
|
|
1248
|
-
var theme = _a.theme;
|
|
1249
|
-
|
|
1247
|
+
var Title$2 = styled__default["default"](MD)(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
1248
|
+
var validation = _a.validation, theme = _a.theme;
|
|
1249
|
+
if (validation === "success") {
|
|
1250
|
+
return "color: ".concat(theme.colors.successHue, ";");
|
|
1251
|
+
}
|
|
1252
|
+
else if (validation === "warning") {
|
|
1253
|
+
return "color: ".concat(theme.colors.warningHue, ";");
|
|
1254
|
+
}
|
|
1255
|
+
else if (validation === "error") {
|
|
1256
|
+
return "color: ".concat(theme.palette.dangerHue, ";");
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
return "color: ".concat(theme.colors.primaryHue, ";");
|
|
1260
|
+
}
|
|
1250
1261
|
});
|
|
1251
|
-
var EditorHeader = function (
|
|
1252
|
-
var title =
|
|
1253
|
-
return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title$2, __assign({ isBold: true }, { children: title || "Write" })) }));
|
|
1262
|
+
var EditorHeader = function (props) {
|
|
1263
|
+
var title = props.title, validation = props.validation;
|
|
1264
|
+
return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title$2, __assign({ isBold: true, validation: validation }, { children: title || "Write" })) }));
|
|
1254
1265
|
};
|
|
1255
1266
|
var templateObject_1$T, templateObject_2$n;
|
|
1256
1267
|
|
|
@@ -1268,15 +1279,26 @@ var EditorFooter = function (_a) {
|
|
|
1268
1279
|
};
|
|
1269
1280
|
var templateObject_1$S, templateObject_2$m;
|
|
1270
1281
|
|
|
1271
|
-
var EditorContainer = styled__default["default"].div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n border: 2px solid
|
|
1272
|
-
var theme = _a.theme;
|
|
1273
|
-
return theme.colors.primaryHue;
|
|
1274
|
-
}, function (_a) {
|
|
1282
|
+
var EditorContainer = styled__default["default"].div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n border: 2px solid;\n border-radius: ", ";\n &:focus-within {\n outline: ", ";\n outline-style: solid;\n }\n\n ", "\n\n ", "\n\n .ProseMirror {\n padding: ", ";\n background-color: #fff;\n min-height: 100px;\n outline: none;\n\n ", "\n\n ", "\n }\n"], ["\n border: 2px solid;\n border-radius: ", ";\n &:focus-within {\n outline: ", ";\n outline-style: solid;\n }\n\n ", "\n\n ", "\n\n .ProseMirror {\n padding: ", ";\n background-color: #fff;\n min-height: 100px;\n outline: none;\n\n ", "\n\n ", "\n }\n"])), function (_a) {
|
|
1275
1283
|
var theme = _a.theme;
|
|
1276
1284
|
return theme.borderRadii.md;
|
|
1277
1285
|
}, function (_a) {
|
|
1278
1286
|
var theme = _a.theme;
|
|
1279
1287
|
return theme.palette.blue["300"];
|
|
1288
|
+
}, function (_a) {
|
|
1289
|
+
var validation = _a.validation, theme = _a.theme;
|
|
1290
|
+
if (validation === "success") {
|
|
1291
|
+
return "border-color: ".concat(theme.colors.successHue, ";");
|
|
1292
|
+
}
|
|
1293
|
+
else if (validation === "warning") {
|
|
1294
|
+
return "border-color: ".concat(theme.colors.warningHue, ";");
|
|
1295
|
+
}
|
|
1296
|
+
else if (validation === "error") {
|
|
1297
|
+
return "border-color: ".concat(theme.colors.dangerHue, ";");
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
return "border-color: ".concat(theme.colors.primaryHue, ";");
|
|
1301
|
+
}
|
|
1280
1302
|
}, function (_a) {
|
|
1281
1303
|
var editable = _a.editable;
|
|
1282
1304
|
return !editable &&
|
|
@@ -1287,7 +1309,7 @@ var EditorContainer = styled__default["default"].div(templateObject_1$R || (temp
|
|
|
1287
1309
|
}, editorStyle, function (_a) {
|
|
1288
1310
|
var editable = _a.editable;
|
|
1289
1311
|
return !editable &&
|
|
1290
|
-
"\n background: transparent;\n border: none;\n outline: none;\n padding: 0;\n ";
|
|
1312
|
+
"\n background: transparent;\n border: none;\n outline: none;\n padding: 0;\n min-height: 0;\n ";
|
|
1291
1313
|
});
|
|
1292
1314
|
/**
|
|
1293
1315
|
* Editor is a wrapper around TipTap/ProseMirror
|
|
@@ -1338,7 +1360,7 @@ var Editor = function (_a) {
|
|
|
1338
1360
|
var editor = _a.editor;
|
|
1339
1361
|
return setActiveEditor(editor);
|
|
1340
1362
|
});
|
|
1341
|
-
return (jsxRuntime.jsxs(EditorContainer, __assign({ editable: isEditable }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: __assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
|
|
1363
|
+
return (jsxRuntime.jsxs(EditorContainer, __assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: __assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
|
|
1342
1364
|
};
|
|
1343
1365
|
var templateObject_1$R;
|
|
1344
1366
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { PlaceholderOptions } from "@tiptap/extension-placeholder";
|
|
2
2
|
import { BubbleMenuProps, Editor, EditorOptions } from "@tiptap/react";
|
|
3
|
+
declare type validationStatus = "success" | "warning" | "error";
|
|
3
4
|
export interface EditorArgs extends Partial<EditorOptions> {
|
|
4
5
|
placeholderOptions?: Partial<PlaceholderOptions>;
|
|
5
6
|
hasInlineMenu?: boolean;
|
|
6
7
|
bubbleOptions?: any;
|
|
7
8
|
headerTitle?: string;
|
|
8
9
|
footerSaveText?: string;
|
|
10
|
+
/** Applies validation state styling */
|
|
11
|
+
validation?: validationStatus;
|
|
9
12
|
onSave?: (editor: Editor) => void;
|
|
10
13
|
}
|
|
14
|
+
export interface EditorHeaderArgs {
|
|
15
|
+
title?: string;
|
|
16
|
+
validation?: validationStatus;
|
|
17
|
+
}
|
|
11
18
|
export interface FloatingMenuArgs extends Partial<BubbleMenuProps> {
|
|
12
19
|
}
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}) => JSX.Element;
|
|
1
|
+
import { EditorHeaderArgs } from "./_types";
|
|
2
|
+
export declare const EditorHeader: (props: EditorHeaderArgs) => JSX.Element;
|
|
@@ -8,5 +8,6 @@ export declare const Default: Story<EditorStoryArgs>;
|
|
|
8
8
|
export declare const Placeholder: Story<EditorStoryArgs>;
|
|
9
9
|
export declare const BubbleMenu: Story<EditorStoryArgs>;
|
|
10
10
|
export declare const ReadOnly: Story<EditorStoryArgs>;
|
|
11
|
+
export declare const Validation: Story<EditorStoryArgs>;
|
|
11
12
|
declare const _default: ComponentMeta<({ onSave, headerTitle, footerSaveText, placeholderOptions, ...props }: import("react").PropsWithChildren<EditorArgs>) => JSX.Element | null>;
|
|
12
13
|
export default _default;
|