@contentful/field-editor-rich-text 1.0.0-alpha.3 → 1.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +410 -0
  2. package/LICENSE +1 -1
  3. package/README.md +9 -20
  4. package/dist/RichTextEditor.d.ts +14 -24
  5. package/dist/Toolbar/index.d.ts +6 -14
  6. package/dist/dialogs/HypelinkDialog/HyperlinkDialog.d.ts +54 -0
  7. package/dist/dialogs/openRichTextDialog.d.ts +1 -0
  8. package/dist/dialogs/renderRichTextDialog.d.ts +1 -0
  9. package/dist/field-editor-rich-text.cjs.development.js +3513 -1840
  10. package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
  11. package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
  12. package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
  13. package/dist/field-editor-rich-text.esm.js +3515 -1842
  14. package/dist/field-editor-rich-text.esm.js.map +1 -1
  15. package/dist/helpers/getLinkedContentTypeIdsForNodeType.d.ts +1 -1
  16. package/dist/helpers/newEntitySelectorConfigFromRichTextField.d.ts +1 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/plugins/Bold/index.d.ts +4 -4
  19. package/dist/plugins/Code/index.d.ts +4 -4
  20. package/dist/plugins/CommandPalette/CommandMark.d.ts +2 -3
  21. package/dist/plugins/CommandPalette/CommandPalette.d.ts +0 -4
  22. package/dist/plugins/CommandPalette/CommandPaletteService.d.ts +16 -8
  23. package/dist/plugins/CommandPalette/CommandPanel/CommandPanelMenu.d.ts +4 -9
  24. package/dist/plugins/CommandPalette/CommandPanel/InViewport/InViewport.d.ts +37 -0
  25. package/dist/plugins/CommandPalette/CommandPanel/index.d.ts +5 -19
  26. package/dist/plugins/CommandPalette/Util.d.ts +1 -1
  27. package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.d.ts +4 -13
  28. package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.styles.d.ts +3 -0
  29. package/dist/plugins/EmbeddedEntityBlock/FetchingWrappedAssetCard.d.ts +15 -0
  30. package/dist/plugins/EmbeddedEntityBlock/FetchingWrappedEntryCard.d.ts +15 -0
  31. package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +4 -4
  32. package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -2
  33. package/dist/plugins/EmbeddedEntityBlock/index.d.ts +2 -3
  34. package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.d.ts +5 -13
  35. package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.styles.d.ts +4 -0
  36. package/dist/plugins/EmbeddedEntryInline/FetchingWrappedInlineEntryCard.d.ts +14 -0
  37. package/dist/plugins/EmbeddedEntryInline/ToolbarIcon.d.ts +4 -4
  38. package/dist/plugins/EmbeddedEntryInline/Utils.d.ts +1 -1
  39. package/dist/plugins/EmbeddedEntryInline/index.d.ts +2 -3
  40. package/dist/plugins/EntryEmbedDropdown/index.d.ts +3 -4
  41. package/dist/plugins/Heading/HeadingDropdown.d.ts +12 -13
  42. package/dist/plugins/Heading/HeadingDropdownItem.d.ts +57 -0
  43. package/dist/plugins/Heading/Paragraph.d.ts +57 -1
  44. package/dist/plugins/Heading/index.d.ts +336 -6
  45. package/dist/plugins/Hr/index.d.ts +4 -4
  46. package/dist/plugins/Hyperlink/Hyperlink.d.ts +11 -23
  47. package/dist/plugins/Hyperlink/ToolbarIcon.d.ts +3 -4
  48. package/dist/plugins/Hyperlink/Util.d.ts +4 -4
  49. package/dist/plugins/Hyperlink/styles.d.ts +5 -0
  50. package/dist/plugins/Hyperlink/truncate.d.ts +1 -0
  51. package/dist/plugins/Hyperlink/useRequestStatus.d.ts +6 -0
  52. package/dist/plugins/Italic/index.d.ts +4 -4
  53. package/dist/plugins/List/ToolbarDecorator.d.ts +6 -6
  54. package/dist/plugins/List/index.d.ts +8 -8
  55. package/dist/plugins/Quote/index.d.ts +4 -4
  56. package/dist/plugins/Underlined/index.d.ts +4 -4
  57. package/dist/plugins/shared/BlockSelectDecorator.d.ts +6 -6
  58. package/dist/plugins/shared/BlockToggleDecorator.d.ts +6 -6
  59. package/dist/plugins/shared/MarkToggleDecorator.d.ts +6 -6
  60. package/dist/plugins/shared/PluginApi.d.ts +10 -5
  61. package/dist/plugins/shared/ToolbarDropdownListItem.d.ts +3 -4
  62. package/dist/plugins/shared/ToolbarIcon.d.ts +5 -5
  63. package/dist/plugins/shared/Util.d.ts +1 -0
  64. package/package.json +22 -11
  65. package/dist/plugins/Heading/Heading1.d.ts +0 -2
  66. package/dist/plugins/Heading/Heading2.d.ts +0 -2
  67. package/dist/plugins/Heading/Heading3.d.ts +0 -2
  68. package/dist/plugins/Heading/Heading4.d.ts +0 -2
  69. package/dist/plugins/Heading/Heading5.d.ts +0 -2
  70. package/dist/plugins/Heading/Heading6.d.ts +0 -2
@@ -1,13 +1,13 @@
1
1
  export function toggleChange(editor: any, type: any): boolean;
2
- declare function _default({ type, title, icon, applyChange, isActive }: {
2
+ declare function _default({ type, title, children, applyChange, isActive }: {
3
3
  type: any;
4
4
  title: any;
5
- icon: any;
5
+ children: any;
6
6
  applyChange?: ((editor: any, type: any) => boolean) | undefined;
7
7
  isActive?: ((editor: any, type: any) => any) | undefined;
8
8
  }): (Block: any) => {
9
- new (props: Readonly<any>): {
10
- handleToggle: (e: any) => void;
9
+ new (props: any): {
10
+ handleToggle: (event: any) => any;
11
11
  render(): JSX.Element;
12
12
  context: any;
13
13
  setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
@@ -32,8 +32,8 @@ declare function _default({ type, title, icon, applyChange, isActive }: {
32
32
  componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
33
33
  UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
34
34
  };
35
- new (props: any, context?: any): {
36
- handleToggle: (e: any) => void;
35
+ new (props: any, context: any): {
36
+ handleToggle: (event: any) => any;
37
37
  render(): JSX.Element;
38
38
  context: any;
39
39
  setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
@@ -1,10 +1,10 @@
1
- declare function _default({ type, title, icon }: {
1
+ declare function _default({ type, title, children }: {
2
2
  type: any;
3
3
  title: any;
4
- icon: any;
4
+ children: any;
5
5
  }): (Mark: any) => {
6
- new (props: Readonly<any>): {
7
- handleToggle: (e: any) => void;
6
+ new (props: any): {
7
+ handleToggle: (event: any) => any;
8
8
  render(): JSX.Element;
9
9
  context: any;
10
10
  setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
@@ -29,8 +29,8 @@ declare function _default({ type, title, icon }: {
29
29
  componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
30
30
  UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
31
31
  };
32
- new (props: any, context?: any): {
33
- handleToggle: (e: any) => void;
32
+ new (props: any, context: any): {
33
+ handleToggle: (event: any) => any;
34
34
  render(): JSX.Element;
35
35
  context: any;
36
36
  setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
@@ -3,15 +3,18 @@
3
3
  * @type {object}
4
4
  */
5
5
  export const actionOrigin: object;
6
- export function createRichTextAPI({ widgetAPI, onAction, customRenderers }: any): {
7
- widgetAPI: {
8
- object: any;
6
+ export function createRichTextAPI({ sdk, onAction }: object): {
7
+ sdk: {
8
+ object;
9
9
  };
10
10
  logViewportAction: {
11
- function: any;
11
+ function;
12
12
  };
13
13
  createActionLogger: {
14
- function: any;
14
+ function;
15
+ };
16
+ createActionLogger: {
17
+ function;
15
18
  };
16
19
  };
17
20
  /**
@@ -24,3 +27,5 @@ export const EDITOR_PLUGIN_PROP_TYPES: object;
24
27
  * @type {object}
25
28
  */
26
29
  export const TOOLBAR_PLUGIN_PROP_TYPES: object;
30
+ declare function createActionLogger(onAction: any, origin: any): (name: any, data: any) => void;
31
+ export {};
@@ -6,10 +6,9 @@ export default class ToolbarDropdownListItem extends React.Component<any, any, a
6
6
  type: PropTypes.Requireable<string>;
7
7
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
8
  };
9
- constructor(props: Readonly<any>);
10
- constructor(props: any, context?: any);
11
- handleMouseDown: (event: any) => void;
12
- render(): JSX.Element;
9
+ constructor(props: any);
10
+ constructor(props: any, context: any);
11
+ handleClick: (event: any) => void;
13
12
  }
14
13
  import React from "react";
15
14
  import PropTypes from "prop-types";
@@ -3,14 +3,14 @@ export default class ToolbarIcon extends React.Component<any, any, any> {
3
3
  isActive: PropTypes.Validator<boolean>;
4
4
  disabled: PropTypes.Validator<boolean>;
5
5
  onToggle: PropTypes.Validator<(...args: any[]) => any>;
6
- icon: PropTypes.Validator<string>;
6
+ children: PropTypes.Validator<any>;
7
7
  title: PropTypes.Validator<string>;
8
8
  type: PropTypes.Requireable<string>;
9
+ className: PropTypes.Requireable<string>;
9
10
  };
10
- constructor(props: Readonly<any>);
11
- constructor(props: any, context?: any);
12
- handleMouseDown: (event: any) => void;
13
- render(): JSX.Element;
11
+ constructor(props: any);
12
+ constructor(props: any, context: any);
13
+ handleClick: (event: any) => void;
14
14
  }
15
15
  import React from "react";
16
16
  import PropTypes from "prop-types";
@@ -0,0 +1 @@
1
+ export function toolbarActionHandlerWithSafeAutoFocus(component: any, customHandler: any): (event: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "./dist/index.js",
6
6
  "module": "dist/field-editor-rich-text.esm.js",
@@ -23,19 +23,20 @@
23
23
  "lint": "eslint ./src --ext .js,.jsx,.ts,.tsx"
24
24
  },
25
25
  "dependencies": {
26
- "@contentful/contentful-slatejs-adapter": "^14.1.0",
27
- "@contentful/field-editor-shared": "^0.6.2",
28
- "@contentful/field-editor-test-utils": "^0.2.3",
29
- "@contentful/forma-36-react-components": "^3.18.4",
30
- "@contentful/forma-36-tokens": "^0.4.5",
26
+ "@contentful/contentful-slatejs-adapter": "14.1.2",
27
+ "@contentful/f36-components": "beta",
28
+ "@contentful/f36-icons": "beta",
29
+ "@contentful/f36-tokens": "beta",
30
+ "@contentful/field-editor-reference": "^4.0.0",
31
+ "@contentful/field-editor-shared": "^1.0.0",
31
32
  "@contentful/rich-text-plain-text-renderer": "^14.0.0",
32
33
  "@contentful/rich-text-types": "^14.0.1",
33
34
  "@productboard/slate-edit-list": "^0.19.1",
34
35
  "@wikifactory/slate-trailing-block": "^0.6.0",
35
36
  "classnames": "^2.2.6",
36
37
  "detect-browser": "^3.0.1",
37
- "emotion": "10.0.17",
38
- "fast-deep-equal": "^2.0.1",
38
+ "emotion": "^10.0.17",
39
+ "fast-deep-equal": "^3.1.1",
39
40
  "immutable": "^3.8.2",
40
41
  "lodash": "^4.17.15",
41
42
  "lodash-es": "^4.17.15",
@@ -49,9 +50,19 @@
49
50
  "react": ">=16.8.0"
50
51
  },
51
52
  "devDependencies": {
52
- "@contentful/rich-text-react-renderer": "^13.4.0",
53
+ "@babel/core": "^7.9.6",
54
+ "@babel/plugin-proposal-class-properties": "^7.8.3",
55
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
56
+ "@babel/plugin-proposal-optional-chaining": "^7.9.0",
57
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
58
+ "@babel/plugin-transform-runtime": "^7.9.6",
59
+ "@babel/preset-env": "7.12.11",
60
+ "@babel/preset-react": "7.13.13",
61
+ "@contentful/field-editor-test-utils": "^1.0.0",
62
+ "@contentful/rich-text-react-renderer": "^14.1.1",
53
63
  "enzyme": "^3.11.0",
54
- "enzyme-adapter-react-16": "^1.15.2"
64
+ "enzyme-adapter-react-16": "^1.15.2",
65
+ "jest": "26.6.3"
55
66
  },
56
- "gitHead": "27a662516c540754f9a8fd32c4f75e15f2ad4afc"
67
+ "gitHead": "538c2239a48991e4bb281d4d07d8ede3413492a5"
57
68
  }
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare var _default: any;
2
- export default _default;