@pega/cosmos-react-rte 2.0.0-dev.18.0 → 2.0.0-dev.20.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.
Files changed (35) hide show
  1. package/lib/components/RichTextEditor/DecoratorComponents/CodeBlock.js +1 -1
  2. package/lib/components/RichTextEditor/DecoratorComponents/CodeBlock.js.map +1 -1
  3. package/lib/components/RichTextEditor/DecoratorComponents/Image.js +1 -1
  4. package/lib/components/RichTextEditor/DecoratorComponents/Image.js.map +1 -1
  5. package/lib/components/RichTextEditor/DecoratorComponents/Link.js +1 -1
  6. package/lib/components/RichTextEditor/DecoratorComponents/Link.js.map +1 -1
  7. package/lib/components/RichTextEditor/DecoratorComponents/Table.js +4 -4
  8. package/lib/components/RichTextEditor/DecoratorComponents/Table.js.map +1 -1
  9. package/lib/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  10. package/lib/components/RichTextEditor/RichTextEditor.js +22 -20
  11. package/lib/components/RichTextEditor/RichTextEditor.js.map +1 -1
  12. package/lib/components/RichTextEditor/RichTextViewer.js +1 -1
  13. package/lib/components/RichTextEditor/RichTextViewer.js.map +1 -1
  14. package/lib/components/RichTextEditor/Toolbar/AnchorButton.js +5 -5
  15. package/lib/components/RichTextEditor/Toolbar/AnchorButton.js.map +1 -1
  16. package/lib/components/RichTextEditor/Toolbar/ImageButton.js +2 -2
  17. package/lib/components/RichTextEditor/Toolbar/ImageButton.js.map +1 -1
  18. package/lib/components/RichTextEditor/Toolbar/IndentButton.js +1 -1
  19. package/lib/components/RichTextEditor/Toolbar/IndentButton.js.map +1 -1
  20. package/lib/components/RichTextEditor/Toolbar/TableButton.js +2 -2
  21. package/lib/components/RichTextEditor/Toolbar/TableButton.js.map +1 -1
  22. package/lib/components/RichTextEditor/Toolbar/TextSelect.d.ts.map +1 -1
  23. package/lib/components/RichTextEditor/Toolbar/TextSelect.js +26 -11
  24. package/lib/components/RichTextEditor/Toolbar/TextSelect.js.map +1 -1
  25. package/lib/components/RichTextEditor/Toolbar/Toolbar.js +7 -7
  26. package/lib/components/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  27. package/lib/components/RichTextEditor/Toolbar/ToolbarButton.js +2 -2
  28. package/lib/components/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  29. package/lib/components/RichTextEditor/utils/EditorCommands.d.ts +1 -1
  30. package/lib/components/RichTextEditor/utils/EditorCommands.d.ts.map +1 -1
  31. package/lib/components/RichTextEditor/utils/EditorCommands.js +2 -0
  32. package/lib/components/RichTextEditor/utils/EditorCommands.js.map +1 -1
  33. package/lib/components/RichTextEditor/utils/renderers.js +19 -19
  34. package/lib/components/RichTextEditor/utils/renderers.js.map +1 -1
  35. package/package.json +3 -3
@@ -5,42 +5,42 @@ import { Table, TableRow, TableCell, TableBody } from '../DecoratorComponents/Ta
5
5
  export const nodeRenderer = (props) => {
6
6
  switch (props.element.type) {
7
7
  case 'heading-1':
8
- return (_jsx(Text, Object.assign({ variant: 'h1' }, props.attributes, { children: props.children }), void 0));
8
+ return (_jsx(Text, { variant: 'h1', ...props.attributes, children: props.children }, void 0));
9
9
  case 'heading-2':
10
- return (_jsx(Text, Object.assign({ variant: 'h2' }, props.attributes, { children: props.children }), void 0));
10
+ return (_jsx(Text, { variant: 'h2', ...props.attributes, children: props.children }, void 0));
11
11
  case 'heading-3':
12
- return (_jsx(Text, Object.assign({ variant: 'h3' }, props.attributes, { children: props.children }), void 0));
12
+ return (_jsx(Text, { variant: 'h3', ...props.attributes, children: props.children }, void 0));
13
13
  case 'heading-4':
14
- return (_jsx(Text, Object.assign({ variant: 'h4' }, props.attributes, { children: props.children }), void 0));
14
+ return (_jsx(Text, { variant: 'h4', ...props.attributes, children: props.children }, void 0));
15
15
  case 'ordered-list':
16
- return _jsx("ol", Object.assign({}, props.attributes, { children: props.children }), void 0);
16
+ return _jsx("ol", { ...props.attributes, children: props.children }, void 0);
17
17
  case 'unordered-list':
18
- return _jsx("ul", Object.assign({}, props.attributes, { children: props.children }), void 0);
18
+ return _jsx("ul", { ...props.attributes, children: props.children }, void 0);
19
19
  case 'list-item':
20
- return (_jsx("li", Object.assign({}, props.attributes, { "data-order": props.element.order, "data-level": props.element.level, "data-id": props.element.id, "data-parent-id": props.element.parentId }, { children: props.children }), void 0));
20
+ return (_jsx("li", { ...props.attributes, "data-order": props.element.order, "data-level": props.element.level, "data-id": props.element.id, "data-parent-id": props.element.parentId, children: props.children }, void 0));
21
21
  case 'custom': {
22
22
  const CustomComponent = props.element.component;
23
- return _jsx(CustomComponent, Object.assign({}, props.attributes, { children: props.element.content }), void 0);
23
+ return _jsx(CustomComponent, { ...props.attributes, children: props.element.content }, void 0);
24
24
  }
25
25
  case 'override': {
26
26
  return props.element.component;
27
27
  }
28
28
  case 'table':
29
- return _jsx(Table, Object.assign({}, props.attributes, { children: props.children }), void 0);
29
+ return _jsx(Table, { ...props.attributes, children: props.children }, void 0);
30
30
  case 'table-body':
31
- return _jsx(TableBody, Object.assign({}, props.attributes, { children: props.children }), void 0);
31
+ return _jsx(TableBody, { ...props.attributes, children: props.children }, void 0);
32
32
  case 'table-row':
33
- return _jsx(TableRow, Object.assign({}, props.attributes, { children: props.children }), void 0);
33
+ return _jsx(TableRow, { ...props.attributes, children: props.children }, void 0);
34
34
  case 'table-cell':
35
- return _jsx(TableCell, Object.assign({}, props.attributes, { children: props.children }), void 0);
35
+ return _jsx(TableCell, { ...props.attributes, children: props.children }, void 0);
36
36
  case 'paragraph':
37
- return (_jsx("div", { children: _jsx(Text, Object.assign({}, props.attributes, { children: props.children }), void 0) }, void 0));
37
+ return (_jsx("div", { children: _jsx(Text, { ...props.attributes, children: props.children }, void 0) }, void 0));
38
38
  case 'image':
39
- return (_jsxs("div", Object.assign({}, props.attributes, { children: [_jsx(Image, { src: props.element.src, alt: props.element.alt }, void 0), props.children] }), void 0));
39
+ return (_jsxs("div", { ...props.attributes, children: [_jsx(Image, { src: props.element.src, alt: props.element.alt }, void 0), props.children] }, void 0));
40
40
  case 'image-placeholder':
41
- return _jsx("div", Object.assign({}, props.attributes, { children: props.children }), void 0);
41
+ return _jsx("div", { ...props.attributes, children: props.children }, void 0);
42
42
  default: {
43
- return _jsx("span", Object.assign({}, props.attributes, { children: props.children }), void 0);
43
+ return _jsx("span", { ...props.attributes, children: props.children }, void 0);
44
44
  }
45
45
  }
46
46
  };
@@ -49,7 +49,7 @@ export const leafRenderer = (props) => {
49
49
  let child = props.children;
50
50
  if (props.leaf.searchResult) {
51
51
  const CustomComponent = props.leaf.searchResult.component;
52
- return (_jsx("span", Object.assign({}, props.attributes, { children: _jsx(CustomComponent, Object.assign({}, props.leaf.searchResult.props, { children: child }), void 0) }), void 0));
52
+ return (_jsx("span", { ...props.attributes, children: _jsx(CustomComponent, { ...props.leaf.searchResult.props, children: child }, void 0) }, void 0));
53
53
  }
54
54
  if (props.leaf['line-through']) {
55
55
  child = _jsx("del", { children: child }, void 0);
@@ -61,8 +61,8 @@ export const leafRenderer = (props) => {
61
61
  child = _jsx("strong", { children: child }, void 0);
62
62
  }
63
63
  if (props.leaf.href) {
64
- child = (_jsx(Link, Object.assign({ href: props.leaf.href, target: '_blank' }, { children: child }), void 0));
64
+ child = (_jsx(Link, { href: props.leaf.href, target: '_blank', children: child }, void 0));
65
65
  }
66
- return _jsx("span", Object.assign({}, props.attributes, { children: child }), void 0);
66
+ return _jsx("span", { ...props.attributes, children: child }, void 0);
67
67
  };
68
68
  //# sourceMappingURL=renderers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderers.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/renderers.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErF,oCAAoC;AACpC,MAAM,CAAC,MAAM,YAAY,GAAG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AK,CAAC,IAAI,CAAC,YAAY,EAAE;QAC3B,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;QAC1D,OAAO,CACL,+BAAU,KAAK,CAAC,UAAU,cACxB,KAAC,eAAe,oBAAK,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,cAAG,KAAK,YAAmB,YACxE,CACR,CAAC;KACH;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;QAC9B,KAAK,GAAG,wBAAM,KAAK,WAAO,CAAC;KAC5B;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;QACrB,KAAK,GAAG,uBAAK,KAAK,WAAM,CAAC;KAC1B;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,KAAK,GAAG,2BAAS,KAAK,WAAU,CAAC;KAClC;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,KAAK,GAAG,CACN,KAAC,IAAI,kBAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAC,QAAQ,gBACzC,KAAK,YACD,CACR,CAAC;KACH;IAED,OAAO,+BAAU,KAAK,CAAC,UAAU,cAAG,KAAK,YAAQ,CAAC;AACpD,CAAC,CAAC","sourcesContent":["import { RenderElementProps, RenderLeafProps } from 'slate-react';\n\nimport { Text, Link, Image } from '@pega/cosmos-react-core';\n\nimport { Table, TableRow, TableCell, TableBody } from '../DecoratorComponents/Table';\n\n// Renderer for block level elements\nexport const nodeRenderer = (props: RenderElementProps) => {\n switch (props.element.type) {\n case 'heading-1':\n return (\n <Text variant='h1' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-2':\n return (\n <Text variant='h2' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-3':\n return (\n <Text variant='h3' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-4':\n return (\n <Text variant='h4' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'ordered-list':\n return <ol {...props.attributes}>{props.children}</ol>;\n case 'unordered-list':\n return <ul {...props.attributes}>{props.children}</ul>;\n case 'list-item':\n return (\n <li\n {...props.attributes}\n data-order={props.element.order}\n data-level={props.element.level}\n data-id={props.element.id}\n data-parent-id={props.element.parentId}\n >\n {props.children}\n </li>\n );\n case 'custom': {\n const CustomComponent = props.element.component;\n return <CustomComponent {...props.attributes}>{props.element.content}</CustomComponent>;\n }\n case 'override': {\n return props.element.component;\n }\n case 'table':\n return <Table {...props.attributes}>{props.children}</Table>;\n case 'table-body':\n return <TableBody {...props.attributes}>{props.children}</TableBody>;\n case 'table-row':\n return <TableRow {...props.attributes}>{props.children}</TableRow>;\n case 'table-cell':\n return <TableCell {...props.attributes}>{props.children}</TableCell>;\n case 'paragraph':\n return (\n <div>\n <Text {...props.attributes}>{props.children}</Text>\n </div>\n );\n case 'image':\n return (\n <div {...props.attributes}>\n <Image src={props.element.src} alt={props.element.alt as string} />\n {props.children}\n </div>\n );\n case 'image-placeholder':\n return <div {...props.attributes}>{props.children}</div>;\n default: {\n return <span {...props.attributes}>{props.children}</span>;\n }\n }\n};\n\n// Renderer for inline elements\nexport const leafRenderer = (props: RenderLeafProps) => {\n let child = props.children;\n\n if (props.leaf.searchResult) {\n const CustomComponent = props.leaf.searchResult.component;\n return (\n <span {...props.attributes}>\n <CustomComponent {...props.leaf.searchResult.props}>{child}</CustomComponent>\n </span>\n );\n }\n\n if (props.leaf['line-through']) {\n child = <del>{child}</del>;\n }\n\n if (props.leaf.italic) {\n child = <em>{child}</em>;\n }\n\n if (props.leaf.bold) {\n child = <strong>{child}</strong>;\n }\n\n if (props.leaf.href) {\n child = (\n <Link href={props.leaf.href} target='_blank'>\n {child}\n </Link>\n );\n }\n\n return <span {...props.attributes}>{child}</span>;\n};\n"]}
1
+ {"version":3,"file":"renderers.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/renderers.tsx"],"names":[],"m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,KAAK,CAAC,QAAQ,WAAQ,CAAC;SAC5D;KACF;AACH,CAAC,CAAC;AAEF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,EAAE;IACrD,IAAI,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE3B,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE;QAC3B,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;QAC1D,OAAO,CACL,kBAAU,KAAK,CAAC,UAAU,YACxB,KAAC,eAAe,OAAK,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,YAAG,KAAK,WAAmB,WACxE,CACR,CAAC;KACH;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;QAC9B,KAAK,GAAG,wBAAM,KAAK,WAAO,CAAC;KAC5B;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;QACrB,KAAK,GAAG,uBAAK,KAAK,WAAM,CAAC;KAC1B;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,KAAK,GAAG,2BAAS,KAAK,WAAU,CAAC;KAClC;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,KAAK,GAAG,CACN,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAC,QAAQ,YACzC,KAAK,WACD,CACR,CAAC;KACH;IAED,OAAO,kBAAU,KAAK,CAAC,UAAU,YAAG,KAAK,WAAQ,CAAC;AACpD,CAAC,CAAC","sourcesContent":["import { RenderElementProps, RenderLeafProps } from 'slate-react';\n\nimport { Text, Link, Image } from '@pega/cosmos-react-core';\n\nimport { Table, TableRow, TableCell, TableBody } from '../DecoratorComponents/Table';\n\n// Renderer for block level elements\nexport const nodeRenderer = (props: RenderElementProps) => {\n switch (props.element.type) {\n case 'heading-1':\n return (\n <Text variant='h1' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-2':\n return (\n <Text variant='h2' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-3':\n return (\n <Text variant='h3' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'heading-4':\n return (\n <Text variant='h4' {...props.attributes}>\n {props.children}\n </Text>\n );\n case 'ordered-list':\n return <ol {...props.attributes}>{props.children}</ol>;\n case 'unordered-list':\n return <ul {...props.attributes}>{props.children}</ul>;\n case 'list-item':\n return (\n <li\n {...props.attributes}\n data-order={props.element.order}\n data-level={props.element.level}\n data-id={props.element.id}\n data-parent-id={props.element.parentId}\n >\n {props.children}\n </li>\n );\n case 'custom': {\n const CustomComponent = props.element.component;\n return <CustomComponent {...props.attributes}>{props.element.content}</CustomComponent>;\n }\n case 'override': {\n return props.element.component;\n }\n case 'table':\n return <Table {...props.attributes}>{props.children}</Table>;\n case 'table-body':\n return <TableBody {...props.attributes}>{props.children}</TableBody>;\n case 'table-row':\n return <TableRow {...props.attributes}>{props.children}</TableRow>;\n case 'table-cell':\n return <TableCell {...props.attributes}>{props.children}</TableCell>;\n case 'paragraph':\n return (\n <div>\n <Text {...props.attributes}>{props.children}</Text>\n </div>\n );\n case 'image':\n return (\n <div {...props.attributes}>\n <Image src={props.element.src} alt={props.element.alt as string} />\n {props.children}\n </div>\n );\n case 'image-placeholder':\n return <div {...props.attributes}>{props.children}</div>;\n default: {\n return <span {...props.attributes}>{props.children}</span>;\n }\n }\n};\n\n// Renderer for inline elements\nexport const leafRenderer = (props: RenderLeafProps) => {\n let child = props.children;\n\n if (props.leaf.searchResult) {\n const CustomComponent = props.leaf.searchResult.component;\n return (\n <span {...props.attributes}>\n <CustomComponent {...props.leaf.searchResult.props}>{child}</CustomComponent>\n </span>\n );\n }\n\n if (props.leaf['line-through']) {\n child = <del>{child}</del>;\n }\n\n if (props.leaf.italic) {\n child = <em>{child}</em>;\n }\n\n if (props.leaf.bold) {\n child = <strong>{child}</strong>;\n }\n\n if (props.leaf.href) {\n child = (\n <Link href={props.leaf.href} target='_blank'>\n {child}\n </Link>\n );\n }\n\n return <span {...props.attributes}>{child}</span>;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-rte",
3
- "version": "2.0.0-dev.18.0",
3
+ "version": "2.0.0-dev.20.0",
4
4
  "author": "Pegasystems",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "build": "tsc -b"
21
21
  },
22
22
  "dependencies": {
23
- "@pega/cosmos-react-core": "2.0.0-dev.18.0",
23
+ "@pega/cosmos-react-core": "2.0.0-dev.20.0",
24
24
  "@popperjs/core": "^2.9.2",
25
25
  "dompurify": "^2.3.1",
26
26
  "marked": "^2.0.3",
@@ -46,6 +46,6 @@
46
46
  "@types/marked": "2.0.2",
47
47
  "@types/parse5": "^6.0.0",
48
48
  "enzyme": "^3.11.0",
49
- "typescript": "~4.4.2"
49
+ "typescript": "~4.5.2"
50
50
  }
51
51
  }