ish-ui 1.0.11 → 1.0.13
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/dynamicSizeList/DynamicSizeList.d.ts +2 -6
- package/dist/dynamicSizeList/DynamicSizeList.js +0 -2
- package/dist/formFields/EditInPlaceMoneyField.js +2 -2
- package/dist/formFields/EditInPlacePhoneField.js +3 -3
- package/dist/markdownEditor/index.d.ts +0 -1
- package/dist/markdownEditor/index.js +0 -1
- package/dist/model/Fields.d.ts +4 -5
- package/dist/tagsInput/AddTagMenu.d.ts +1 -0
- package/dist/tagsInput/AddTagMenu.js +2 -2
- package/dist/tagsInput/AddTagMenuItem.d.ts +2 -1
- package/dist/tagsInput/AddTagMenuItem.js +6 -3
- package/dist/tagsInput/TagInputList.d.ts +4 -2
- package/dist/tagsInput/TagInputList.js +10 -15
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +18 -14
- package/dist/markdownEditor/style.d.ts +0 -1
- package/dist/markdownEditor/style.js +0 -185
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
itemCount: number;
|
|
5
|
-
width: number;
|
|
6
|
-
estimatedItemSize: number;
|
|
7
|
-
children: any;
|
|
2
|
+
import { VariableSizeListProps } from 'react-window';
|
|
3
|
+
interface Props extends Omit<VariableSizeListProps, 'itemSize'> {
|
|
8
4
|
listRef?: any;
|
|
9
5
|
}
|
|
10
6
|
declare class DynamicSizeList extends React.Component<Props> {
|
|
@@ -16,8 +16,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
16
16
|
}
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
|
-
// Temporary implementation
|
|
20
|
-
// TODO: Remove component when native DynamicSizeList will be included in react-window v.2
|
|
21
19
|
import React from 'react';
|
|
22
20
|
import { VariableSizeList } from 'react-window';
|
|
23
21
|
class ItemMeasurer extends React.Component {
|
|
@@ -17,7 +17,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import React, { useCallback } from 'react';
|
|
20
|
-
import
|
|
20
|
+
import NumberFormat from 'react-number-format';
|
|
21
21
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
22
22
|
import clsx from 'clsx';
|
|
23
23
|
import EditInPlaceField from './EditInPlaceField';
|
|
@@ -27,7 +27,7 @@ const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
|
27
27
|
const onValueChange = useCallback(values => {
|
|
28
28
|
onChange(normalizeNumber(values.value));
|
|
29
29
|
}, []);
|
|
30
|
-
return (React.createElement(
|
|
30
|
+
return (React.createElement(NumberFormat, Object.assign({}, other, { getInputRef: ref, onValueChange: onValueChange, allowNegative: allowNegative, decimalScale: 2, thousandSeparator: true })));
|
|
31
31
|
});
|
|
32
32
|
const preformatDisplayValue = value => value || value === 0 ? formatCurrency(value, '') : value;
|
|
33
33
|
function EditInPlaceMoneyField(_a) {
|
|
@@ -17,7 +17,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
20
|
-
import
|
|
20
|
+
import NumberFormat from 'react-number-format';
|
|
21
21
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
22
22
|
import PhoneIcon from '@mui/icons-material/Phone';
|
|
23
23
|
import debounce from 'lodash.debounce';
|
|
@@ -26,7 +26,7 @@ import { getPhoneMask } from '../utils';
|
|
|
26
26
|
const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
27
27
|
const { onChange } = props, other = __rest(props, ["onChange"]);
|
|
28
28
|
const inputRef = useRef();
|
|
29
|
-
const [format, setFormat] = useState(
|
|
29
|
+
const [format, setFormat] = useState('');
|
|
30
30
|
const [prefix, setPrefix] = useState(undefined);
|
|
31
31
|
const processFormat = useCallback(debounce(data => {
|
|
32
32
|
setFormat(getPhoneMask(data.value));
|
|
@@ -59,7 +59,7 @@ const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
|
59
59
|
ref = input;
|
|
60
60
|
inputRef.current = input;
|
|
61
61
|
};
|
|
62
|
-
return (React.createElement(
|
|
62
|
+
return (React.createElement(NumberFormat, Object.assign({}, other, { getInputRef: getInputRef, onKeyPress: onKeyPress, prefix: prefix, onValueChange: onValueChange, format: format, type: "text" })));
|
|
63
63
|
});
|
|
64
64
|
function EditInPlacePhoneField(_a) {
|
|
65
65
|
var { InputProps, className } = _a, restProps = __rest(_a, ["InputProps", "className"]);
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
7
|
*/
|
|
8
8
|
export * from './utils/index';
|
|
9
|
-
export * from './style';
|
|
10
9
|
export * from './HtmlEditor';
|
|
11
10
|
export * from './WysiwygEditor';
|
|
12
11
|
export { default as HtmlEditor } from './HtmlEditor';
|
package/dist/model/Fields.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export interface ColoredCheckboxFieldProps<IP, MP> {
|
|
|
70
70
|
};
|
|
71
71
|
meta?: Partial<MP>;
|
|
72
72
|
color: string;
|
|
73
|
-
label?:
|
|
73
|
+
label?: ReactNode;
|
|
74
74
|
className?: string;
|
|
75
75
|
disabled?: boolean;
|
|
76
76
|
}
|
|
@@ -111,7 +111,7 @@ export interface EditInPlaceDateTimeFieldProps<IP, MP> {
|
|
|
111
111
|
fieldClasses?: FieldClasses;
|
|
112
112
|
onKeyPress?: AnyArgFunction;
|
|
113
113
|
labelAdornment?: ReactNode;
|
|
114
|
-
processActionId?:
|
|
114
|
+
processActionId?: boolean;
|
|
115
115
|
formatDate?: string;
|
|
116
116
|
formatTime?: string;
|
|
117
117
|
formatDateTime?: string;
|
|
@@ -220,10 +220,10 @@ export interface CheckboxFieldProps<IP> {
|
|
|
220
220
|
export interface TagsFieldProps<T, IP, MP> extends EditInPlaceFieldProps<IP, MP> {
|
|
221
221
|
tags: T[];
|
|
222
222
|
showConfirm?: ShowConfirmCaller;
|
|
223
|
-
classes?: any;
|
|
224
223
|
validateEntity?: string;
|
|
224
|
+
allowParentSelect?: boolean;
|
|
225
225
|
}
|
|
226
|
-
interface FormFieldBaseProps {
|
|
226
|
+
export interface FormFieldBaseProps {
|
|
227
227
|
required?: boolean;
|
|
228
228
|
format?: AnyArgFunction;
|
|
229
229
|
onClick?: AnyArgFunction;
|
|
@@ -248,4 +248,3 @@ export type FormFieldProps = ({
|
|
|
248
248
|
} & FormFieldBaseProps & TagsFieldProps<TagLike, FieldInputProps, FieldMetaProps>) | ({
|
|
249
249
|
type: 'stub';
|
|
250
250
|
});
|
|
251
|
-
export {};
|
|
@@ -22,7 +22,7 @@ const styles = theme => ({
|
|
|
22
22
|
borderRadius: '100%'
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
function AddTagMenu({ classes, tags, handleAdd, activeTag, setActiveTag }) {
|
|
25
|
+
function AddTagMenu({ classes, tags, handleAdd, activeTag, setActiveTag, allowParentSelect }) {
|
|
26
26
|
const handleBack = () => {
|
|
27
27
|
setActiveTag(prev => prev.parent);
|
|
28
28
|
};
|
|
@@ -31,6 +31,6 @@ function AddTagMenu({ classes, tags, handleAdd, activeTag, setActiveTag }) {
|
|
|
31
31
|
React.createElement("span", { className: clsx('d-flex textSecondaryColor', classes.backContainer) },
|
|
32
32
|
React.createElement(KeyboardArrowLeft, { color: "inherit" }),
|
|
33
33
|
"Back"))),
|
|
34
|
-
(activeTag ? activeTag.children : tags).map(t => (React.createElement(AddTagMenuItem, { key: t.tagBody.id, tag: t, classes: classes, setActiveTag: setActiveTag, handleAdd: handleAdd })))));
|
|
34
|
+
(activeTag ? activeTag.children : tags).map(t => (React.createElement(AddTagMenuItem, { key: t.tagBody.id, tag: t, classes: classes, setActiveTag: setActiveTag, handleAdd: handleAdd, allowParentSelect: allowParentSelect })))));
|
|
35
35
|
}
|
|
36
36
|
export default withStyles(styles)(AddTagMenu);
|
|
@@ -5,6 +5,7 @@ interface Props<T> {
|
|
|
5
5
|
setActiveTag: (tag: MenuTag<T>) => void;
|
|
6
6
|
handleAdd: (tag: MenuTag<T>) => void;
|
|
7
7
|
tag: MenuTag<T>;
|
|
8
|
+
allowParentSelect?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare function AddTagMenuItem<T extends TagLike>({ setActiveTag, tag, classes, handleAdd }: Props<T>): React.JSX.Element;
|
|
10
|
+
declare function AddTagMenuItem<T extends TagLike>({ setActiveTag, tag, classes, handleAdd, allowParentSelect }: Props<T>): React.JSX.Element;
|
|
10
11
|
export default AddTagMenuItem;
|
|
@@ -10,7 +10,8 @@ import clsx from 'clsx';
|
|
|
10
10
|
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
|
|
11
11
|
import Checkbox from '@mui/material/Checkbox';
|
|
12
12
|
import MenuItem from '@mui/material/MenuItem';
|
|
13
|
-
|
|
13
|
+
import { IconButton } from '@mui/material';
|
|
14
|
+
function AddTagMenuItem({ setActiveTag, tag, classes, handleAdd, allowParentSelect }) {
|
|
14
15
|
const openSubmenu = () => {
|
|
15
16
|
setActiveTag(tag);
|
|
16
17
|
};
|
|
@@ -18,9 +19,11 @@ function AddTagMenuItem({ setActiveTag, tag, classes, handleAdd }) {
|
|
|
18
19
|
handleAdd(tag);
|
|
19
20
|
};
|
|
20
21
|
const hasChildren = Boolean(tag.children.length);
|
|
21
|
-
return (React.createElement(MenuItem, { classes: { root: classes.listItem }, onClick: hasChildren ? openSubmenu : toggleChecked },
|
|
22
|
+
return (React.createElement(MenuItem, { classes: { root: classes.listItem }, onClick: allowParentSelect ? null : (hasChildren ? openSubmenu : toggleChecked), disableRipple: allowParentSelect },
|
|
22
23
|
React.createElement("div", { className: clsx(classes.tagColorDotSmall, 'mr-1'), style: { background: '#' + tag.tagBody.color } }),
|
|
23
24
|
React.createElement("span", { className: "mr-2 flex-fill" }, tag.tagBody.name),
|
|
24
|
-
hasChildren
|
|
25
|
+
(allowParentSelect || !hasChildren) && React.createElement(Checkbox, { onClick: toggleChecked, classes: { root: 'smallIconButton' }, checked: tag.active }),
|
|
26
|
+
hasChildren && React.createElement(IconButton, { size: "small", onClick: openSubmenu },
|
|
27
|
+
React.createElement(KeyboardArrowRight, { className: clsx('d-flex textSecondaryColor', classes.proceedIcon) }))));
|
|
25
28
|
}
|
|
26
29
|
export default AddTagMenuItem;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldInputProps, FieldMetaProps, TagLike, TagsFieldProps } from '../model';
|
|
3
|
+
declare function TagInputList<T extends TagLike, IP extends FieldInputProps, MP extends FieldMetaProps>({ input, tags, placeholder, labelAdornment, meta, label, disabled, className, warning, allowParentSelect, fieldClasses }: TagsFieldProps<T, IP, MP>): React.JSX.Element;
|
|
4
|
+
export default TagInputList;
|
|
@@ -19,8 +19,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import { InputAdornment, MenuItem, Select } from '@mui/material';
|
|
21
21
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
22
|
-
import createStyles from '@mui/styles/createStyles';
|
|
23
|
-
import withStyles from '@mui/styles/withStyles';
|
|
24
22
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
25
23
|
import clsx from 'clsx';
|
|
26
24
|
import { Edit } from '@mui/icons-material';
|
|
@@ -30,8 +28,8 @@ import EditInPlaceFieldBase from '../formFields/EditInPlaceFieldBase';
|
|
|
30
28
|
import { getAllMenuTags, getHighlightedPartLabel, getMenuTags } from '../utils';
|
|
31
29
|
import { stubComponent } from '../utils/stubs';
|
|
32
30
|
import getCaretCoordinates from '../utils/DOM/getCaretCoordinates';
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
import { makeAppStyles } from '../styles';
|
|
32
|
+
const useStyles = makeAppStyles((theme) => (Object.assign(Object.assign({}, selectStyles(theme)), { inputEndAdornment: {
|
|
35
33
|
visibility: 'hidden',
|
|
36
34
|
display: 'flex',
|
|
37
35
|
color: theme.palette.primary.main,
|
|
@@ -39,20 +37,16 @@ const styles = theme => createStyles({
|
|
|
39
37
|
alignSelf: 'flex-end',
|
|
40
38
|
marginBottom: '4px',
|
|
41
39
|
opacity: 0.5
|
|
42
|
-
},
|
|
43
|
-
tagColorDotSmall: {
|
|
40
|
+
}, tagColorDotSmall: {
|
|
44
41
|
width: theme.spacing(2),
|
|
45
42
|
minWidth: theme.spacing(2),
|
|
46
43
|
height: theme.spacing(2),
|
|
47
44
|
minHeight: theme.spacing(2),
|
|
48
45
|
background: 'red',
|
|
49
46
|
borderRadius: '100%'
|
|
50
|
-
},
|
|
51
|
-
listbox: {
|
|
47
|
+
}, listbox: {
|
|
52
48
|
whiteSpace: 'break-spaces'
|
|
53
|
-
},
|
|
54
|
-
invalid: {}
|
|
55
|
-
});
|
|
49
|
+
}, invalid: {} })));
|
|
56
50
|
const endTagRegex = /#\s*[^\w\d]*$/;
|
|
57
51
|
const getCurrentInputString = (input, formTagIds = [], allMenuTags = []) => {
|
|
58
52
|
let substr = input;
|
|
@@ -90,12 +84,13 @@ const getInputString = (tagIds, allTags) => ((tagIds === null || tagIds === void
|
|
|
90
84
|
return (tag ? `${acc}#${tag.name} ` : acc);
|
|
91
85
|
}, '')
|
|
92
86
|
: '');
|
|
93
|
-
function TagInputList({ input, tags,
|
|
87
|
+
function TagInputList({ input, tags, placeholder, labelAdornment, meta, label = 'Tags', disabled, className, warning, allowParentSelect, fieldClasses = {} }) {
|
|
94
88
|
const [menuIsOpen, setMenuIsOpen] = useState(false);
|
|
95
89
|
const [activeTag, setActiveTag] = useState(null);
|
|
96
90
|
const [isEditing, setIsEditing] = useState(false);
|
|
97
91
|
const [inputValue, setInputValue] = useState('');
|
|
98
92
|
const [currentInputString, setCurrentInputString] = useState('');
|
|
93
|
+
const classes = useStyles();
|
|
99
94
|
const InputValueForRender = useMemo(() => {
|
|
100
95
|
var _a;
|
|
101
96
|
if (!inputValue || !tags || !tags.length)
|
|
@@ -248,7 +243,7 @@ function TagInputList({ input, tags, classes, placeholder, labelAdornment, meta,
|
|
|
248
243
|
React.createElement(ClickAwayListener, { onClickAway: onTagListBlur }, params.children)));
|
|
249
244
|
}, [allMenuTags, inputValue, currentInputString, inputNode.current, tagMenuNode.current, input.value]);
|
|
250
245
|
const listboxAdapter = useCallback(params => (React.createElement("div", { className: params.className, ref: tagMenuNode },
|
|
251
|
-
React.createElement(AddTagMenu, { tags: menuTags, handleAdd: onTagAdd, activeTag: activeTag, setActiveTag: setActiveTag }))), [menuTags, activeTag, setActiveTag, onTagAdd]);
|
|
246
|
+
React.createElement(AddTagMenu, { tags: menuTags, handleAdd: onTagAdd, activeTag: activeTag, setActiveTag: setActiveTag, allowParentSelect: allowParentSelect }))), [menuTags, activeTag, setActiveTag, onTagAdd]);
|
|
252
247
|
return (React.createElement("div", { className: className, id: input.name },
|
|
253
248
|
React.createElement("div", { className: clsx('relative', {
|
|
254
249
|
'pointer-events-none': disabled
|
|
@@ -271,8 +266,8 @@ function TagInputList({ input, tags, classes, placeholder, labelAdornment, meta,
|
|
|
271
266
|
inputProps.ref.current = ref === null || ref === void 0 ? void 0 : ref.node;
|
|
272
267
|
}, onFocus: edit, value: "stub", className: classes.inputWrapper, classes: { select: 'd-flex flex-wrap cursor-text' }, endAdornment: React.createElement(InputAdornment, { position: "end", className: classes.inputEndAdornment },
|
|
273
268
|
React.createElement(Edit, null)), IconComponent: stubComponent },
|
|
274
|
-
React.createElement(MenuItem, { value: "stub" }, InputValueForRender || React.createElement("span", { className: "placeholderContent" },
|
|
269
|
+
React.createElement(MenuItem, { value: "stub" }, InputValueForRender || React.createElement("span", { className: "placeholderContent" }, placeholder || 'No value')))
|
|
275
270
|
: null })));
|
|
276
271
|
}, popupIcon: stubComponent(), disableListWrap: true, openOnFocus: true }))));
|
|
277
272
|
}
|
|
278
|
-
export default
|
|
273
|
+
export default TagInputList;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ish-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "UI elements for onCourse and other ish apps",
|
|
5
5
|
"main": "main.ts",
|
|
6
6
|
"devDependencies": {
|
|
7
|
+
"@ckeditor/ckeditor5-dev-utils": "^30.5.0",
|
|
7
8
|
"@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
|
|
8
9
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
|
|
9
10
|
"@types/node": "^18.11.5",
|
|
@@ -57,34 +58,38 @@
|
|
|
57
58
|
"@ckeditor/ckeditor5-source-editing": "35.1.0",
|
|
58
59
|
"@ckeditor/ckeditor5-table": "35.1.0",
|
|
59
60
|
"@ckeditor/ckeditor5-theme-lark": "35.1.0",
|
|
60
|
-
"@emotion/cache": "
|
|
61
|
-
"@emotion/react": "
|
|
62
|
-
"@emotion/styled": "
|
|
61
|
+
"@emotion/cache": "11.10.8",
|
|
62
|
+
"@emotion/react": "11.10.8",
|
|
63
|
+
"@emotion/styled": "11.10.8",
|
|
63
64
|
"@fortawesome/fontawesome-svg-core": "latest",
|
|
64
65
|
"@fortawesome/free-regular-svg-icons": "latest",
|
|
65
66
|
"@fortawesome/free-solid-svg-icons": "latest",
|
|
66
67
|
"@fortawesome/react-fontawesome": "latest",
|
|
67
|
-
"@mui/icons-material": "
|
|
68
|
-
"@mui/lab": "
|
|
69
|
-
"@mui/material": "
|
|
70
|
-
"@mui/styles": "
|
|
71
|
-
"@mui/
|
|
68
|
+
"@mui/icons-material": "5.10.16",
|
|
69
|
+
"@mui/lab": "^5.0.0-alpha.99",
|
|
70
|
+
"@mui/material": "5.10.17",
|
|
71
|
+
"@mui/styles": "5.10.16",
|
|
72
|
+
"@mui/system": "^5.14.1",
|
|
73
|
+
"@mui/x-date-pickers": "^5.0.0",
|
|
72
74
|
"autosuggest-highlight": "^3.3.4",
|
|
73
75
|
"date-fns": "^2.30.0",
|
|
74
76
|
"date-fns-tz": "^2.0.0",
|
|
75
77
|
"decimal.js-light": "^2.5.1",
|
|
76
78
|
"lodash.debounce": "^4.0.8",
|
|
77
|
-
"re-resizable": "^6.9.
|
|
79
|
+
"re-resizable": "^6.9.11",
|
|
78
80
|
"react": "^18.2.0",
|
|
79
81
|
"react-ace": "^10.1.0",
|
|
80
82
|
"react-color": "^2.19.3",
|
|
81
83
|
"react-dom": "^18.2.0",
|
|
82
84
|
"react-dropzone": "^14.2.3",
|
|
83
|
-
"react-number-format": "
|
|
85
|
+
"react-number-format": "4.9.3",
|
|
84
86
|
"react-window": "^1.8.9",
|
|
85
87
|
"react-window-infinite-loader": "^1.0.9",
|
|
86
88
|
"redux": "^4.2.1"
|
|
87
89
|
},
|
|
90
|
+
"resolutions": {
|
|
91
|
+
"@mui/styles/react": "^18.2.0"
|
|
92
|
+
},
|
|
88
93
|
"scripts": {
|
|
89
94
|
"test": "exit 0",
|
|
90
95
|
"start": "cross-env NODE_ENV=development webpack serve --config tools/webpack/webpack.config.dev.js",
|
|
@@ -96,13 +101,12 @@
|
|
|
96
101
|
"type": "git",
|
|
97
102
|
"url": "git+https://github.com/ishgroup/ish-ui.git"
|
|
98
103
|
},
|
|
99
|
-
"author": "
|
|
100
|
-
"license": "ISC",
|
|
104
|
+
"author": "ishgroup",
|
|
101
105
|
"bugs": {
|
|
102
106
|
"url": "https://github.com/ishgroup/ish-ui/issues"
|
|
103
107
|
},
|
|
104
108
|
"homepage": "https://github.com/ishgroup/ish-ui#readme",
|
|
105
109
|
"publishConfig": {
|
|
106
|
-
"@
|
|
110
|
+
"@ishgroup:registry": "https://npm.pkg.github.com"
|
|
107
111
|
}
|
|
108
112
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"@global" | "readonly" | "editable" | "textField" | "hoverIcon" | "editorArea" | "previewFrame">;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright ish group pty ltd 2022.
|
|
3
|
-
*
|
|
4
|
-
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
-
*
|
|
6
|
-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
-
*/
|
|
8
|
-
import { makeStyles } from '@mui/styles';
|
|
9
|
-
export const useStyles = makeStyles((theme) => ({
|
|
10
|
-
hoverIcon: {
|
|
11
|
-
opacity: 0.5,
|
|
12
|
-
visibility: 'hidden',
|
|
13
|
-
marginLeft: theme.spacing(1)
|
|
14
|
-
},
|
|
15
|
-
editable: {
|
|
16
|
-
display: 'inline-flex',
|
|
17
|
-
cursor: 'text',
|
|
18
|
-
color: theme.palette.text.primaryEditable,
|
|
19
|
-
minHeight: '32px',
|
|
20
|
-
padding: '4px 0 4px',
|
|
21
|
-
marginTop: theme.spacing(2),
|
|
22
|
-
fontWeight: 400,
|
|
23
|
-
justifyContent: 'space-between',
|
|
24
|
-
alignItems: 'flex-end',
|
|
25
|
-
'&:hover $hoverIcon': {
|
|
26
|
-
visibility: 'visible'
|
|
27
|
-
},
|
|
28
|
-
'&:before': {
|
|
29
|
-
borderBottom: '1px solid transparent',
|
|
30
|
-
left: 0,
|
|
31
|
-
bottom: '4px',
|
|
32
|
-
content: '\' \'',
|
|
33
|
-
position: 'absolute',
|
|
34
|
-
right: 0,
|
|
35
|
-
transition: theme.transitions.create('border-bottom-color', {
|
|
36
|
-
duration: theme.transitions.duration.standard,
|
|
37
|
-
easing: theme.transitions.easing.easeInOut
|
|
38
|
-
}),
|
|
39
|
-
pointerEvents: 'none'
|
|
40
|
-
},
|
|
41
|
-
'&:hover:before': {
|
|
42
|
-
borderBottom: `1px solid ${theme.palette.primary.main}`
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
editorArea: {
|
|
46
|
-
'&#editorRoot': {
|
|
47
|
-
'& .ck-dropdown__button .ck-button__label': {
|
|
48
|
-
fontSize: '14px'
|
|
49
|
-
},
|
|
50
|
-
cursor: 'text',
|
|
51
|
-
overflowY: 'auto',
|
|
52
|
-
position: 'relative',
|
|
53
|
-
'& .ck-list__item .ck-button': {
|
|
54
|
-
height: 'unset',
|
|
55
|
-
padding: '5px 10px'
|
|
56
|
-
},
|
|
57
|
-
'& .ck-list__item .ck-heading_heading3': {
|
|
58
|
-
fontSize: '15px'
|
|
59
|
-
},
|
|
60
|
-
'& .ck-list__item .ck-heading_heading4': {
|
|
61
|
-
fontSize: '14px'
|
|
62
|
-
},
|
|
63
|
-
'& .ck-toolbar': {
|
|
64
|
-
height: '45px',
|
|
65
|
-
background: theme.table.contrastRow.main
|
|
66
|
-
},
|
|
67
|
-
'& .ck-list__item': {
|
|
68
|
-
fontSize: '15px'
|
|
69
|
-
},
|
|
70
|
-
'& .ck-dropdown': {
|
|
71
|
-
fontSize: '15px'
|
|
72
|
-
},
|
|
73
|
-
'& .ck.ck-dropdown .ck-button__label': {
|
|
74
|
-
fontFamily: 'Inter, sans-serif',
|
|
75
|
-
overflow: 'visible',
|
|
76
|
-
width: '120px'
|
|
77
|
-
},
|
|
78
|
-
'& .content-mode-wrapper': {
|
|
79
|
-
position: 'absolute',
|
|
80
|
-
right: '10px',
|
|
81
|
-
top: '6px',
|
|
82
|
-
padding: '5px',
|
|
83
|
-
zIndex: 1000,
|
|
84
|
-
'& .content-mode': {
|
|
85
|
-
maxWidth: '85px',
|
|
86
|
-
border: 0,
|
|
87
|
-
boxShadow: 'none',
|
|
88
|
-
backgroundColor: 'black',
|
|
89
|
-
color: 'white',
|
|
90
|
-
padding: '2px',
|
|
91
|
-
fontSize: '9px',
|
|
92
|
-
'&:hover': {
|
|
93
|
-
backgroundColor: theme.palette.primary.main,
|
|
94
|
-
color: theme.palette.primary.contrastText,
|
|
95
|
-
},
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
'& .ck-editor': {
|
|
99
|
-
'& .ck-content': {
|
|
100
|
-
resize: 'vertical',
|
|
101
|
-
maxHeight: '80vh',
|
|
102
|
-
minHeight: '200px',
|
|
103
|
-
fontFamily: 'Inter, sans-serif',
|
|
104
|
-
fontWeight: 400,
|
|
105
|
-
fontSize: '14px',
|
|
106
|
-
color: 'black'
|
|
107
|
-
},
|
|
108
|
-
'& .ck-content .table': {
|
|
109
|
-
marginLeft: 0
|
|
110
|
-
},
|
|
111
|
-
'& .ck-toolbar': {
|
|
112
|
-
padding: '3px'
|
|
113
|
-
},
|
|
114
|
-
'& .ck-source-editing-button': {
|
|
115
|
-
marginLeft: 'auto',
|
|
116
|
-
marginRight: '44px'
|
|
117
|
-
},
|
|
118
|
-
'& .ck-source-editing-button > *': {
|
|
119
|
-
visibility: 'hidden'
|
|
120
|
-
},
|
|
121
|
-
'& .ck-source-editing-button .ck_source_edit_custom': {
|
|
122
|
-
visibility: 'visible'
|
|
123
|
-
},
|
|
124
|
-
'& .ck-source-editing-button .ck_code_icon_custom': {
|
|
125
|
-
width: '24px'
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
'&.ace-wrapper': {
|
|
129
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
130
|
-
paddingTop: '44px',
|
|
131
|
-
background: theme.table.contrastRow.main,
|
|
132
|
-
'& .ace_editor': {
|
|
133
|
-
borderTop: `1px solid ${theme.palette.divider}`
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
previewFrame: {
|
|
139
|
-
width: '100%',
|
|
140
|
-
maxHeight: '300px',
|
|
141
|
-
overflow: 'auto',
|
|
142
|
-
fontSize: '16px',
|
|
143
|
-
'& > div': {
|
|
144
|
-
width: '100%'
|
|
145
|
-
},
|
|
146
|
-
'& h1,h2,h3,h4': {
|
|
147
|
-
all: 'revert'
|
|
148
|
-
},
|
|
149
|
-
'& table': {
|
|
150
|
-
marginLeft: 0,
|
|
151
|
-
marginRight: 'auto',
|
|
152
|
-
borderCollapse: 'collapse',
|
|
153
|
-
borderSpacing: 0,
|
|
154
|
-
border: '1px double #b3b3b3',
|
|
155
|
-
'& th': {
|
|
156
|
-
textAlign: 'left',
|
|
157
|
-
fontWeight: 700,
|
|
158
|
-
background: 'hsla(0,0%,0%,5%)',
|
|
159
|
-
minWidth: '2em',
|
|
160
|
-
padding: '0.4em',
|
|
161
|
-
border: '1px solid #bfbfbf'
|
|
162
|
-
},
|
|
163
|
-
'& td': {
|
|
164
|
-
minWidth: '2em',
|
|
165
|
-
padding: '0.4em',
|
|
166
|
-
border: '1px solid #bfbfbf'
|
|
167
|
-
},
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
readonly: {
|
|
171
|
-
fontWeight: 300,
|
|
172
|
-
pointerEvents: 'none'
|
|
173
|
-
},
|
|
174
|
-
textField: {
|
|
175
|
-
paddingLeft: '0',
|
|
176
|
-
// @ts-ignore
|
|
177
|
-
paddingBottom: `${theme.spacing(2) - 3}`,
|
|
178
|
-
margin: 0
|
|
179
|
-
},
|
|
180
|
-
'@global': {
|
|
181
|
-
'.ck.ck-balloon-panel.ck-balloon-panel_visible': {
|
|
182
|
-
zIndex: 2000
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}));
|