@pega/cosmos-react-rte 2.0.0-rc.2 → 2.0.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageButton.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ImageButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAU,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageButton.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ImageButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAU,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAsB,YAAY,EAAW,MAAM,yBAAyB,CAAC;AAapF,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,YAAY,CAmCjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { hideVisually } from 'polished';
|
|
4
5
|
import { Icon, registerIcon, useI18n } from '@pega/cosmos-react-core';
|
|
5
6
|
import * as pictureIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/picture.icon';
|
|
6
7
|
import { useRTEContext } from '../RichTextEditor.context';
|
|
7
8
|
import ToolbarButton from './ToolbarButton';
|
|
8
9
|
registerIcon(pictureIcon);
|
|
9
10
|
const StyledImageInput = styled.input `
|
|
10
|
-
|
|
11
|
-
width: 0;
|
|
11
|
+
${hideVisually}
|
|
12
12
|
`;
|
|
13
13
|
const ImageButton = ({ ...props }) => {
|
|
14
14
|
const t = useI18n();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageButton.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ImageButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageButton.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ImageButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,YAAY,CAAC,WAAW,CAAC,CAAC;AAE1B,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAA;IACjC,YAAY;CACf,CAAC;AAEF,MAAM,WAAW,GAAqB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEpD,MAAM,kBAAkB,GAAG,CAAC,CAAgC,EAAE,EAAE;QAC9D,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE;YAClB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAE5B,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,YAAY,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;aACjC;SACF;IACH,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,gBAAgB,IACf,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,SAAS,EAChB,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,kBAAkB,WAC5B,EACF,KAAC,aAAa,IACZ,OAAO,EAAE,GAAG,EAAE;oBACZ,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBACjC,CAAC,EACD,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,EACvB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,KACjB,KAAK,YAET,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,WAAG,WACT,YACf,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { ChangeEvent, FC, useRef } from 'react';\nimport styled from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport { Icon, registerIcon, ForwardProps, useI18n } from '@pega/cosmos-react-core';\nimport * as pictureIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/picture.icon';\n\nimport { useRTEContext } from '../RichTextEditor.context';\n\nimport ToolbarButton from './ToolbarButton';\n\nregisterIcon(pictureIcon);\n\nconst StyledImageInput = styled.input`\n ${hideVisually}\n`;\n\nconst ImageButton: FC<ForwardProps> = ({ ...props }) => {\n const t = useI18n();\n const { addImage } = useRTEContext();\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const onImageInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files) {\n addImage(e.target.files[0]);\n\n if (fileInputRef.current) {\n fileInputRef.current.value = '';\n }\n }\n };\n\n return (\n <>\n <StyledImageInput\n type='file'\n accept='image/*'\n ref={fileInputRef}\n onChange={onImageInputChange}\n />\n <ToolbarButton\n onClick={() => {\n fileInputRef?.current?.click();\n }}\n tooltip={t('rte_image')}\n label={t('rte_image')}\n {...props}\n >\n <Icon name='picture' />\n </ToolbarButton>\n </>\n );\n};\n\nexport default ImageButton;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-rte",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "2.0.0
|
|
24
|
-
"@popperjs/core": "^2.
|
|
23
|
+
"@pega/cosmos-react-core": "2.0.0",
|
|
24
|
+
"@popperjs/core": "^2.11.0",
|
|
25
25
|
"dompurify": "^2.3.1",
|
|
26
26
|
"marked": "^2.0.3",
|
|
27
27
|
"parse5": "^6.0.1",
|