@atlaskit/renderer 101.0.3 → 101.1.1

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 (232) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/actions/package.json +8 -1
  3. package/consts/package.json +8 -1
  4. package/dist/cjs/analytics/unsupported-content.js +1 -1
  5. package/dist/cjs/messages.js +4 -17
  6. package/dist/cjs/react/nodes/codeBlockCopyButton.js +1 -1
  7. package/dist/cjs/react/nodes/table/colgroup.js +5 -34
  8. package/dist/cjs/react/nodes/table.js +3 -3
  9. package/dist/cjs/render-document.js +1 -1
  10. package/dist/cjs/ui/Renderer/index.js +66 -5
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/analytics/unsupported-content.js +1 -1
  13. package/dist/es2019/messages.js +2 -14
  14. package/dist/es2019/react/nodes/codeBlockCopyButton.js +1 -1
  15. package/dist/es2019/react/nodes/table/colgroup.js +5 -30
  16. package/dist/es2019/react/nodes/table.js +2 -2
  17. package/dist/es2019/render-document.js +1 -1
  18. package/dist/es2019/ui/Renderer/index.js +70 -6
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/analytics/unsupported-content.js +1 -1
  21. package/dist/esm/messages.js +2 -14
  22. package/dist/esm/react/nodes/codeBlockCopyButton.js +1 -1
  23. package/dist/esm/react/nodes/table/colgroup.js +5 -29
  24. package/dist/esm/react/nodes/table.js +2 -2
  25. package/dist/esm/render-document.js +1 -1
  26. package/dist/esm/ui/Renderer/index.js +68 -6
  27. package/dist/esm/version.json +1 -1
  28. package/dist/types/messages.d.ts +0 -12
  29. package/dist/types/react/nodes/table/colgroup.d.ts +0 -6
  30. package/dist/types/ui/Renderer/index.d.ts +1 -0
  31. package/dist/types-ts4.0/actions/index.d.ts +61 -0
  32. package/dist/types-ts4.0/actions/matches-utils.d.ts +7 -0
  33. package/dist/types-ts4.0/actions.d.ts +3 -0
  34. package/dist/types-ts4.0/analytics/analyticsContext.d.ts +6 -0
  35. package/dist/types-ts4.0/analytics/enums.d.ts +56 -0
  36. package/dist/types-ts4.0/analytics/events.d.ts +110 -0
  37. package/dist/types-ts4.0/analytics/unsupported-content.d.ts +10 -0
  38. package/dist/types-ts4.0/consts.d.ts +12 -0
  39. package/dist/types-ts4.0/i18n/cs.d.ts +20 -0
  40. package/dist/types-ts4.0/i18n/da.d.ts +20 -0
  41. package/dist/types-ts4.0/i18n/de.d.ts +20 -0
  42. package/dist/types-ts4.0/i18n/en.d.ts +20 -0
  43. package/dist/types-ts4.0/i18n/en_GB.d.ts +20 -0
  44. package/dist/types-ts4.0/i18n/en_ZZ.d.ts +20 -0
  45. package/dist/types-ts4.0/i18n/es.d.ts +20 -0
  46. package/dist/types-ts4.0/i18n/et.d.ts +8 -0
  47. package/dist/types-ts4.0/i18n/fi.d.ts +20 -0
  48. package/dist/types-ts4.0/i18n/fr.d.ts +20 -0
  49. package/dist/types-ts4.0/i18n/hu.d.ts +20 -0
  50. package/dist/types-ts4.0/i18n/index.d.ts +31 -0
  51. package/dist/types-ts4.0/i18n/it.d.ts +20 -0
  52. package/dist/types-ts4.0/i18n/ja.d.ts +20 -0
  53. package/dist/types-ts4.0/i18n/ko.d.ts +20 -0
  54. package/dist/types-ts4.0/i18n/nb.d.ts +20 -0
  55. package/dist/types-ts4.0/i18n/nl.d.ts +20 -0
  56. package/dist/types-ts4.0/i18n/pl.d.ts +20 -0
  57. package/dist/types-ts4.0/i18n/pt_BR.d.ts +20 -0
  58. package/dist/types-ts4.0/i18n/pt_PT.d.ts +8 -0
  59. package/dist/types-ts4.0/i18n/ru.d.ts +20 -0
  60. package/dist/types-ts4.0/i18n/sk.d.ts +8 -0
  61. package/dist/types-ts4.0/i18n/sv.d.ts +20 -0
  62. package/dist/types-ts4.0/i18n/th.d.ts +20 -0
  63. package/dist/types-ts4.0/i18n/tr.d.ts +20 -0
  64. package/dist/types-ts4.0/i18n/uk.d.ts +20 -0
  65. package/dist/types-ts4.0/i18n/vi.d.ts +20 -0
  66. package/dist/types-ts4.0/i18n/zh.d.ts +20 -0
  67. package/dist/types-ts4.0/i18n/zh_TW.d.ts +20 -0
  68. package/dist/types-ts4.0/index.d.ts +11 -0
  69. package/dist/types-ts4.0/messages.d.ts +61 -0
  70. package/dist/types-ts4.0/react/hooks/use-bidi-warnings.d.ts +10 -0
  71. package/dist/types-ts4.0/react/hooks/use-in-viewport.d.ts +5 -0
  72. package/dist/types-ts4.0/react/hooks/use-observed-width.d.ts +3 -0
  73. package/dist/types-ts4.0/react/index.d.ts +118 -0
  74. package/dist/types-ts4.0/react/marks/alignment.d.ts +4 -0
  75. package/dist/types-ts4.0/react/marks/annotation.d.ts +6 -0
  76. package/dist/types-ts4.0/react/marks/breakout.d.ts +6 -0
  77. package/dist/types-ts4.0/react/marks/code.d.ts +16 -0
  78. package/dist/types-ts4.0/react/marks/confluence-inline-comment.d.ts +8 -0
  79. package/dist/types-ts4.0/react/marks/data-consumer.d.ts +4 -0
  80. package/dist/types-ts4.0/react/marks/em.d.ts +3 -0
  81. package/dist/types-ts4.0/react/marks/fragment.d.ts +4 -0
  82. package/dist/types-ts4.0/react/marks/indentation.d.ts +4 -0
  83. package/dist/types-ts4.0/react/marks/index.d.ts +21 -0
  84. package/dist/types-ts4.0/react/marks/link.d.ts +9 -0
  85. package/dist/types-ts4.0/react/marks/strike.d.ts +3 -0
  86. package/dist/types-ts4.0/react/marks/strong.d.ts +3 -0
  87. package/dist/types-ts4.0/react/marks/subsup.d.ts +4 -0
  88. package/dist/types-ts4.0/react/marks/textColor.d.ts +4 -0
  89. package/dist/types-ts4.0/react/marks/underline.d.ts +3 -0
  90. package/dist/types-ts4.0/react/marks/unsupportedMark.d.ts +3 -0
  91. package/dist/types-ts4.0/react/marks/unsupportedNodeAttribute.d.ts +3 -0
  92. package/dist/types-ts4.0/react/nodes/blockCard.d.ts +10 -0
  93. package/dist/types-ts4.0/react/nodes/blockquote.d.ts +2 -0
  94. package/dist/types-ts4.0/react/nodes/bodiedExtension.d.ts +23 -0
  95. package/dist/types-ts4.0/react/nodes/bulletList.d.ts +5 -0
  96. package/dist/types-ts4.0/react/nodes/caption.d.ts +4 -0
  97. package/dist/types-ts4.0/react/nodes/codeBlock/codeBlock.d.ts +14 -0
  98. package/dist/types-ts4.0/react/nodes/codeBlock/components/codeBlockContainer.d.ts +12 -0
  99. package/dist/types-ts4.0/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +9 -0
  100. package/dist/types-ts4.0/react/nodes/codeBlock/windowedCodeBlock.d.ts +4 -0
  101. package/dist/types-ts4.0/react/nodes/codeBlockCopyButton.d.ts +9 -0
  102. package/dist/types-ts4.0/react/nodes/date.d.ts +11 -0
  103. package/dist/types-ts4.0/react/nodes/decisionItem.d.ts +3 -0
  104. package/dist/types-ts4.0/react/nodes/decisionList.d.ts +7 -0
  105. package/dist/types-ts4.0/react/nodes/doc.d.ts +3 -0
  106. package/dist/types-ts4.0/react/nodes/embedCard.d.ts +17 -0
  107. package/dist/types-ts4.0/react/nodes/emoji.d.ts +10 -0
  108. package/dist/types-ts4.0/react/nodes/extension.d.ts +112 -0
  109. package/dist/types-ts4.0/react/nodes/fallback.d.ts +16 -0
  110. package/dist/types-ts4.0/react/nodes/hardBreak.d.ts +6 -0
  111. package/dist/types-ts4.0/react/nodes/heading-anchor.d.ts +14 -0
  112. package/dist/types-ts4.0/react/nodes/heading.d.ts +14 -0
  113. package/dist/types-ts4.0/react/nodes/index.d.ts +94 -0
  114. package/dist/types-ts4.0/react/nodes/inline.d.ts +1 -0
  115. package/dist/types-ts4.0/react/nodes/inlineCard.d.ts +65 -0
  116. package/dist/types-ts4.0/react/nodes/inlineExtension.d.ts +16 -0
  117. package/dist/types-ts4.0/react/nodes/layoutColumn.d.ts +6 -0
  118. package/dist/types-ts4.0/react/nodes/layoutSection.d.ts +2 -0
  119. package/dist/types-ts4.0/react/nodes/listItem.d.ts +2 -0
  120. package/dist/types-ts4.0/react/nodes/media.d.ts +27 -0
  121. package/dist/types-ts4.0/react/nodes/mediaGroup.d.ts +29 -0
  122. package/dist/types-ts4.0/react/nodes/mediaInline.d.ts +20 -0
  123. package/dist/types-ts4.0/react/nodes/mediaSingle/index.d.ts +23 -0
  124. package/dist/types-ts4.0/react/nodes/mediaSingle/styles.d.ts +2 -0
  125. package/dist/types-ts4.0/react/nodes/mention.d.ts +13 -0
  126. package/dist/types-ts4.0/react/nodes/orderedList.d.ts +6 -0
  127. package/dist/types-ts4.0/react/nodes/panel.d.ts +17 -0
  128. package/dist/types-ts4.0/react/nodes/paragraph.d.ts +3 -0
  129. package/dist/types-ts4.0/react/nodes/placeholder.d.ts +6 -0
  130. package/dist/types-ts4.0/react/nodes/rule.d.ts +2 -0
  131. package/dist/types-ts4.0/react/nodes/status.d.ts +10 -0
  132. package/dist/types-ts4.0/react/nodes/table/colgroup.d.ts +3 -0
  133. package/dist/types-ts4.0/react/nodes/table/sticky.d.ts +38 -0
  134. package/dist/types-ts4.0/react/nodes/table/table.d.ts +7 -0
  135. package/dist/types-ts4.0/react/nodes/table/types.d.ts +7 -0
  136. package/dist/types-ts4.0/react/nodes/table.d.ts +269 -0
  137. package/dist/types-ts4.0/react/nodes/tableCell.d.ts +81 -0
  138. package/dist/types-ts4.0/react/nodes/tableRow.d.ts +24 -0
  139. package/dist/types-ts4.0/react/nodes/task-item-with-providers.d.ts +29 -0
  140. package/dist/types-ts4.0/react/nodes/taskItem.d.ts +19 -0
  141. package/dist/types-ts4.0/react/nodes/taskList.d.ts +8 -0
  142. package/dist/types-ts4.0/react/nodes/text-wrapper.d.ts +8 -0
  143. package/dist/types-ts4.0/react/nodes/unknownBlock.d.ts +2 -0
  144. package/dist/types-ts4.0/react/renderer-node.d.ts +4 -0
  145. package/dist/types-ts4.0/react/types.d.ts +57 -0
  146. package/dist/types-ts4.0/react/utils/clipboard.d.ts +1 -0
  147. package/dist/types-ts4.0/react/utils/element-selection.d.ts +9 -0
  148. package/dist/types-ts4.0/react/utils/getCardClickHandler.d.ts +2 -0
  149. package/dist/types-ts4.0/react/utils/inject-props.d.ts +6 -0
  150. package/dist/types-ts4.0/react/utils/links.d.ts +3 -0
  151. package/dist/types-ts4.0/react/utils/lists.d.ts +2 -0
  152. package/dist/types-ts4.0/react/utils/performance/RenderTracking.d.ts +15 -0
  153. package/dist/types-ts4.0/react/utils/use-select-all-trap.d.ts +2 -0
  154. package/dist/types-ts4.0/render-document.d.ts +23 -0
  155. package/dist/types-ts4.0/renderer-context.d.ts +9 -0
  156. package/dist/types-ts4.0/serializer.d.ts +4 -0
  157. package/dist/types-ts4.0/steps/index.d.ts +14 -0
  158. package/dist/types-ts4.0/text/index.d.ts +8 -0
  159. package/dist/types-ts4.0/text/nodes/blockquote.d.ts +3 -0
  160. package/dist/types-ts4.0/text/nodes/bulletList.d.ts +3 -0
  161. package/dist/types-ts4.0/text/nodes/date.d.ts +3 -0
  162. package/dist/types-ts4.0/text/nodes/decisionItem.d.ts +3 -0
  163. package/dist/types-ts4.0/text/nodes/hardBreak.d.ts +3 -0
  164. package/dist/types-ts4.0/text/nodes/heading.d.ts +3 -0
  165. package/dist/types-ts4.0/text/nodes/index.d.ts +6 -0
  166. package/dist/types-ts4.0/text/nodes/inlineCard.d.ts +3 -0
  167. package/dist/types-ts4.0/text/nodes/listItem.d.ts +3 -0
  168. package/dist/types-ts4.0/text/nodes/mediaGroup.d.ts +3 -0
  169. package/dist/types-ts4.0/text/nodes/mention.d.ts +3 -0
  170. package/dist/types-ts4.0/text/nodes/orderedList.d.ts +3 -0
  171. package/dist/types-ts4.0/text/nodes/panel.d.ts +3 -0
  172. package/dist/types-ts4.0/text/nodes/paragraph.d.ts +3 -0
  173. package/dist/types-ts4.0/text/nodes/rule.d.ts +3 -0
  174. package/dist/types-ts4.0/text/nodes/status.d.ts +3 -0
  175. package/dist/types-ts4.0/text/nodes/table.d.ts +3 -0
  176. package/dist/types-ts4.0/text/nodes/taskItem.d.ts +3 -0
  177. package/dist/types-ts4.0/text/nodes/unknown.d.ts +3 -0
  178. package/dist/types-ts4.0/text-serializer.d.ts +1 -0
  179. package/dist/types-ts4.0/types/i18n.d.ts +5 -0
  180. package/dist/types-ts4.0/types/mediaOptions.d.ts +12 -0
  181. package/dist/types-ts4.0/types/smartLinksOptions.d.ts +3 -0
  182. package/dist/types-ts4.0/ui/Expand.d.ts +21 -0
  183. package/dist/types-ts4.0/ui/ExtensionRenderer.d.ts +40 -0
  184. package/dist/types-ts4.0/ui/MediaCard.d.ts +77 -0
  185. package/dist/types-ts4.0/ui/Renderer/ErrorBoundary.d.ts +24 -0
  186. package/dist/types-ts4.0/ui/Renderer/breakout-ssr.d.ts +11 -0
  187. package/dist/types-ts4.0/ui/Renderer/click-to-edit.d.ts +6 -0
  188. package/dist/types-ts4.0/ui/Renderer/index.d.ts +33 -0
  189. package/dist/types-ts4.0/ui/Renderer/style.d.ts +14 -0
  190. package/dist/types-ts4.0/ui/Renderer/truncated-wrapper.d.ts +12 -0
  191. package/dist/types-ts4.0/ui/Renderer/types.d.ts +16 -0
  192. package/dist/types-ts4.0/ui/RendererActionsContext/WithRendererActions.d.ts +6 -0
  193. package/dist/types-ts4.0/ui/RendererActionsContext/index.d.ts +9 -0
  194. package/dist/types-ts4.0/ui/SmartCardStorage.d.ts +60 -0
  195. package/dist/types-ts4.0/ui/SortingIcon.d.ts +20 -0
  196. package/dist/types-ts4.0/ui/TaskItemsFormatContext/TaskItemsFormatContext.d.ts +15 -0
  197. package/dist/types-ts4.0/ui/TaskItemsFormatContext/index.d.ts +2 -0
  198. package/dist/types-ts4.0/ui/active-header-id-provider.d.ts +18 -0
  199. package/dist/types-ts4.0/ui/annotations/context.d.ts +27 -0
  200. package/dist/types-ts4.0/ui/annotations/draft/component.d.ts +20 -0
  201. package/dist/types-ts4.0/ui/annotations/draft/dom.d.ts +7 -0
  202. package/dist/types-ts4.0/ui/annotations/draft/index.d.ts +2 -0
  203. package/dist/types-ts4.0/ui/annotations/draft/position.d.ts +2 -0
  204. package/dist/types-ts4.0/ui/annotations/draft/text.d.ts +11 -0
  205. package/dist/types-ts4.0/ui/annotations/element/index.d.ts +10 -0
  206. package/dist/types-ts4.0/ui/annotations/element/mark.d.ts +14 -0
  207. package/dist/types-ts4.0/ui/annotations/hooks/index.d.ts +3 -0
  208. package/dist/types-ts4.0/ui/annotations/hooks/use-events.d.ts +18 -0
  209. package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +1 -0
  210. package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comments-filter.d.ts +9 -0
  211. package/dist/types-ts4.0/ui/annotations/hooks/use-load-annotations.d.ts +6 -0
  212. package/dist/types-ts4.0/ui/annotations/hooks/user-selection.d.ts +9 -0
  213. package/dist/types-ts4.0/ui/annotations/hooks/utils.d.ts +2 -0
  214. package/dist/types-ts4.0/ui/annotations/index.d.ts +5 -0
  215. package/dist/types-ts4.0/ui/annotations/selection/index.d.ts +1 -0
  216. package/dist/types-ts4.0/ui/annotations/selection/mounter.d.ts +20 -0
  217. package/dist/types-ts4.0/ui/annotations/selection/range-validator.d.ts +13 -0
  218. package/dist/types-ts4.0/ui/annotations/selection/wrapper.d.ts +8 -0
  219. package/dist/types-ts4.0/ui/annotations/types.d.ts +22 -0
  220. package/dist/types-ts4.0/ui/annotations/view/index.d.ts +7 -0
  221. package/dist/types-ts4.0/ui/index.d.ts +1 -0
  222. package/dist/types-ts4.0/ui/renderer-props.d.ts +100 -0
  223. package/dist/types-ts4.0/use-feature-flags.d.ts +2 -0
  224. package/dist/types-ts4.0/utils.d.ts +24 -0
  225. package/messages/package.json +8 -1
  226. package/package.json +25 -18
  227. package/render-document/package.json +8 -1
  228. package/renderer-context/package.json +8 -1
  229. package/serializer/package.json +8 -1
  230. package/text-serializer/package.json +8 -1
  231. package/use-feature-flags/package.json +8 -1
  232. package/utils/package.json +8 -1
@@ -0,0 +1,3 @@
1
+ export { useHasFocusEvent, useAnnotationClickEvent } from './use-events';
2
+ export { useInlineCommentsFilter } from './use-inline-comments-filter';
3
+ export { useInlineCommentSubscriberContext } from './use-inline-comment-subscriber';
@@ -0,0 +1,18 @@
1
+ import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/types';
2
+ import type { InlineCommentViewComponentProps } from '@atlaskit/editor-common/types';
3
+ import { AnnotationMarkStates, AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
4
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
+ declare type ListenEventProps = {
6
+ id: AnnotationId;
7
+ updateSubscriber: AnnotationUpdateEmitter | null;
8
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
9
+ };
10
+ declare type UseAnnotationUpdateSatteByEventProps = {
11
+ type: AnnotationTypes;
12
+ updateSubscriber: AnnotationUpdateEmitter | null;
13
+ };
14
+ export declare const useAnnotationStateByTypeEvent: ({ type, updateSubscriber, }: UseAnnotationUpdateSatteByEventProps) => Record<string, AnnotationMarkStates | null>;
15
+ export declare const useHasFocusEvent: ({ id, updateSubscriber, }: ListenEventProps) => boolean;
16
+ declare type AnnotationsWithClickTarget = Pick<InlineCommentViewComponentProps, 'annotations' | 'clickElementTarget'> | null;
17
+ export declare const useAnnotationClickEvent: (props: Pick<ListenEventProps, 'updateSubscriber' | 'createAnalyticsEvent'>) => AnnotationsWithClickTarget;
18
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useInlineCommentSubscriberContext: () => import("@atlaskit/editor-common/types").AnnotationUpdateEmitter | null;
@@ -0,0 +1,9 @@
1
+ import { AnnotationId, AnnotationMarkStates } from '@atlaskit/adf-schema';
2
+ declare type Props = {
3
+ annotationIds: AnnotationId[];
4
+ filter: {
5
+ state: AnnotationMarkStates;
6
+ };
7
+ };
8
+ export declare const useInlineCommentsFilter: ({ annotationIds, filter: { state: stateFilter }, }: Props) => string[];
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
+ declare type Props = {
3
+ adfDocument: JSONDocNode;
4
+ };
5
+ export declare const useLoadAnnotations: ({ adfDocument }: Props) => void;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ rendererRef: React.RefObject<HTMLDivElement>;
4
+ };
5
+ export declare const useUserSelectionRange: (props: Props) => [
6
+ Range | null,
7
+ () => void
8
+ ];
9
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Exists in its own module to allow mocking in unit tests */
2
+ export declare const isRangeInsideOfRendererContainer: (rendererDOM: HTMLElement, range: Range) => boolean;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { AnnotationsWrapperProps } from './types';
3
+ export declare const AnnotationsWrapper: React.FC<AnnotationsWrapperProps>;
4
+ export { TextWithAnnotationDraft } from './draft';
5
+ export { MarkElement as AnnotationMark } from './element';
@@ -0,0 +1 @@
1
+ export { Wrapper as SelectionComponentWrapper } from './wrapper';
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AnnotationByMatches, InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
3
+ import { ApplyAnnotation } from '../../../actions/index';
4
+ import { Position } from '../types';
5
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
6
+ declare type Props = {
7
+ range: Range;
8
+ component: React.ComponentType<InlineCommentSelectionComponentProps>;
9
+ wrapperDOM: React.RefObject<HTMLDivElement>;
10
+ documentPosition: Position | false;
11
+ isAnnotationAllowed: boolean;
12
+ onClose: () => void;
13
+ applyAnnotation: ApplyAnnotation;
14
+ applyAnnotationDraftAt: (position: Position) => void;
15
+ clearAnnotationDraft: () => void;
16
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
17
+ generateIndexMatch?: (pos: Position) => false | AnnotationByMatches;
18
+ };
19
+ export declare const SelectionInlineCommentMounter: React.FC<Props>;
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Position } from '../types';
3
+ import type { InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
4
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
+ declare type Props = {
6
+ selectionComponent: React.ComponentType<InlineCommentSelectionComponentProps>;
7
+ rendererRef: React.RefObject<HTMLDivElement>;
8
+ applyAnnotationDraftAt: (position: Position) => void;
9
+ clearAnnotationDraft: () => void;
10
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
11
+ };
12
+ export declare const SelectionRangeValidator: React.FC<Props>;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ declare type Props = {
4
+ rendererRef: React.RefObject<HTMLDivElement>;
5
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
6
+ };
7
+ export declare const Wrapper: (props: React.PropsWithChildren<Props>) => JSX.Element;
8
+ export {};
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { JSONDocNode } from '@atlaskit/editor-json-transformer';
3
+ import type { AnnotationProviders } from '@atlaskit/editor-common/types';
4
+ export declare enum InsertDraftPosition {
5
+ AROUND_TEXT = "AROUND_TEXT",
6
+ START = "START",
7
+ END = "END",
8
+ INSIDE = "INSIDE"
9
+ }
10
+ export declare type Position = {
11
+ from: number;
12
+ to: number;
13
+ };
14
+ export declare type AnnotationsWrapperProps = {
15
+ adfDocument: JSONDocNode;
16
+ annotationProvider: AnnotationProviders | null | undefined;
17
+ rendererRef: React.RefObject<HTMLDivElement>;
18
+ };
19
+ export declare type TextPosition = {
20
+ start: number;
21
+ end: number;
22
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ declare type Props = {
4
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
5
+ };
6
+ declare const AnnotationView: React.FC<Props>;
7
+ export { AnnotationView };
@@ -0,0 +1 @@
1
+ export { default as Renderer } from './Renderer';
@@ -0,0 +1,100 @@
1
+ /// <reference types="react" />
2
+ import { Schema } from 'prosemirror-model';
3
+ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
4
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { ADFStage } from '@atlaskit/editor-common/validator';
6
+ import type { AnnotationProviders } from '@atlaskit/editor-common/types';
7
+ import type { EventHandlers } from '@atlaskit/editor-common/ui';
8
+ import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
9
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
10
+ import { RendererContext } from '../';
11
+ import { RenderOutputStat } from '../render-document';
12
+ import { RendererAppearance, StickyHeaderProps, HeadingAnchorLinksProps, NodeComponentsProps } from './Renderer/types';
13
+ import { MediaOptions } from '../types/mediaOptions';
14
+ import { SmartLinksOptions } from '../types/smartLinksOptions';
15
+ import { ACTION_SUBJECT } from '../analytics/enums';
16
+ export interface RawObjectFeatureFlags {
17
+ ['renderer-render-tracking']: string;
18
+ }
19
+ export interface NormalizedObjectFeatureFlags {
20
+ rendererRenderTracking: {
21
+ [ACTION_SUBJECT.RENDERER]: {
22
+ enabled: boolean;
23
+ useShallow: boolean;
24
+ };
25
+ };
26
+ }
27
+ export interface RendererProps {
28
+ document: any;
29
+ dataProviders?: ProviderFactory;
30
+ eventHandlers?: EventHandlers;
31
+ extensionHandlers?: ExtensionHandlers;
32
+ enableSsrInlineScripts?: boolean;
33
+ onComplete?: (stat: RenderOutputStat) => void;
34
+ onError?: (error: any) => void;
35
+ portal?: HTMLElement;
36
+ rendererContext?: RendererContext;
37
+ schema?: Schema;
38
+ appearance?: RendererAppearance;
39
+ adfStage?: ADFStage;
40
+ disableHeadingIDs?: boolean;
41
+ disableActions?: boolean;
42
+ allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
43
+ allowPlaceholderText?: boolean;
44
+ maxHeight?: number;
45
+ fadeOutHeight?: number;
46
+ truncated?: boolean;
47
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
48
+ allowColumnSorting?: boolean;
49
+ shouldOpenMediaViewer?: boolean;
50
+ allowAltTextOnImages?: boolean;
51
+ stickyHeaders?: StickyHeaderProps;
52
+ media?: MediaOptions;
53
+ smartLinks?: SmartLinksOptions;
54
+ allowAnnotations?: boolean;
55
+ annotationProvider?: AnnotationProviders | null;
56
+ innerRef?: React.RefObject<HTMLDivElement>;
57
+ useSpecBasedValidator?: boolean;
58
+ allowCopyToClipboard?: boolean;
59
+ allowCustomPanels?: boolean;
60
+ analyticsEventSeverityTracking?: {
61
+ enabled: boolean;
62
+ severityNormalThreshold: number;
63
+ severityDegradedThreshold: number;
64
+ };
65
+ allowUgcScrubber?: boolean;
66
+ allowSelectAllTrap?: boolean;
67
+ unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
68
+ nodeComponents?: NodeComponentsProps;
69
+ /**
70
+ * @default undefined
71
+ * @description
72
+ * Short lived feature flags for experiments and gradual rollouts
73
+ * Flags are expected to follow these rules or they are filtered out
74
+ *
75
+ * 1. cased in kebab-case (match [a-z-])
76
+ * 2. have boolean values or object {} values
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * (<Renderer featureFlags={{ 'my-feature': true }} />);
81
+ * getFeatureFlags()?.myFeature === true;
82
+ * ```
83
+ *
84
+ * @example
85
+ * ```tsx
86
+ * (<Renderer featureFlags={{ 'my-feature': 'thing' }} />);
87
+ * getFeatureFlags()?.myFeature === undefined;
88
+ * ```
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * (<Renderer featureFlags={{ 'product.my-feature': false }} />);
93
+ * getFeatureFlags()?.myFeature === undefined;
94
+ * getFeatureFlags()?.productMyFeature === undefined;
95
+ * ```
96
+ */
97
+ featureFlags?: {
98
+ [featureFlag: string]: boolean;
99
+ } | Partial<RawObjectFeatureFlags>;
100
+ }
@@ -0,0 +1,2 @@
1
+ import { RendererContextProps } from './renderer-context';
2
+ export declare const useFeatureFlags: () => RendererContextProps['featureFlags'] | undefined;
@@ -0,0 +1,24 @@
1
+ import type { Schema } from 'prosemirror-model';
2
+ import type { ADNode } from '@atlaskit/editor-common/validator';
3
+ import type { EventHandlers } from '@atlaskit/editor-common/ui';
4
+ import type { Transformer } from '@atlaskit/editor-common/types';
5
+ import type { Node as PMNode } from 'prosemirror-model';
6
+ import type { RendererAppearance } from './ui/Renderer/types';
7
+ export declare type TransformerProvider<T> = (schema: Schema) => Transformer<T>;
8
+ export declare class ADFEncoder<T> {
9
+ encode: (value: T) => any;
10
+ constructor(createTransformerWithSchema: TransformerProvider<T>);
11
+ }
12
+ export declare const getText: (node: PMNode | ADNode) => string;
13
+ export declare const getEventHandler: (eventHandlers?: EventHandlers | undefined, type?: keyof EventHandlers | undefined, eventName?: string) => any;
14
+ export declare const getPlatform: (rendererAppearance: RendererAppearance) => "mobile" | "web";
15
+ /**
16
+ * Traverse through parent elements of element. Return element for which evaluate(element) returns
17
+ * true. If topElement is reached before evaluate returns true, return false. Does not run evaluate
18
+ * on topElement.
19
+ * @param element Starting HTMLElement
20
+ * @param topElement HTMLElement to end search at. evaluate is not called on this element
21
+ * @param evaluate Function which returns true or false based on the given element. eg: Checks if
22
+ * element has desired classname.
23
+ */
24
+ export declare function findInTree(element: HTMLElement, topElement: HTMLElement, evaluate: (element: HTMLElement) => boolean): boolean;
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/messages.js",
5
5
  "module:es2019": "../dist/es2019/messages.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/messages.d.ts"
7
+ "types": "../dist/types/messages.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/messages.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "101.0.3",
3
+ "version": "101.1.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.ts",
17
24
  "atlassian": {
@@ -24,27 +31,27 @@
24
31
  }
25
32
  },
26
33
  "dependencies": {
27
- "@atlaskit/adf-schema": "^23.3.0",
34
+ "@atlaskit/adf-schema": "^24.0.0",
28
35
  "@atlaskit/adf-utils": "^17.1.0",
29
36
  "@atlaskit/analytics-listeners": "^8.3.0",
30
37
  "@atlaskit/analytics-namespaced-context": "^6.5.0",
31
38
  "@atlaskit/analytics-next": "^8.2.0",
32
39
  "@atlaskit/button": "^16.3.0",
33
40
  "@atlaskit/code": "^14.3.0",
34
- "@atlaskit/editor-common": "^69.1.0",
35
- "@atlaskit/editor-json-transformer": "^8.7.0",
36
- "@atlaskit/editor-shared-styles": "^2.1.0",
41
+ "@atlaskit/editor-common": "^69.3.0",
42
+ "@atlaskit/editor-json-transformer": "^8.8.0",
43
+ "@atlaskit/editor-shared-styles": "^2.2.0",
37
44
  "@atlaskit/icon": "^21.10.0",
38
45
  "@atlaskit/media-card": "^74.1.0",
39
46
  "@atlaskit/media-client": "^17.1.0",
40
47
  "@atlaskit/media-common": "^2.16.0",
41
48
  "@atlaskit/media-filmstrip": "^45.0.0",
42
49
  "@atlaskit/media-ui": "^22.1.0",
43
- "@atlaskit/media-viewer": "^47.0.0",
44
- "@atlaskit/smart-card": "^22.0.0",
50
+ "@atlaskit/media-viewer": "^47.1.0",
51
+ "@atlaskit/smart-card": "^22.2.0",
45
52
  "@atlaskit/status": "^1.1.0",
46
- "@atlaskit/task-decision": "^17.4.0",
47
- "@atlaskit/theme": "^12.1.0",
53
+ "@atlaskit/task-decision": "^17.5.0",
54
+ "@atlaskit/theme": "^12.2.0",
48
55
  "@atlaskit/tokens": "^0.10.0",
49
56
  "@atlaskit/tooltip": "^17.5.0",
50
57
  "@babel/runtime": "^7.0.0",
@@ -59,8 +66,8 @@
59
66
  "uuid": "^3.1.0"
60
67
  },
61
68
  "peerDependencies": {
62
- "@atlaskit/link-provider": "^1.2.4",
63
- "@atlaskit/media-core": "^33.0.2",
69
+ "@atlaskit/link-provider": "^1.2.9",
70
+ "@atlaskit/media-core": "^33.0.3",
64
71
  "react": "^16.8.0",
65
72
  "react-dom": "^16.8.0",
66
73
  "styled-components": "^3.2.6"
@@ -70,24 +77,24 @@
70
77
  "@atlaskit/avatar": "^21.0.0",
71
78
  "@atlaskit/css-reset": "^6.3.0",
72
79
  "@atlaskit/docs": "*",
73
- "@atlaskit/editor-core": "^172.0.0",
74
- "@atlaskit/editor-test-helpers": "^17.1.0",
80
+ "@atlaskit/editor-core": "^172.2.0",
81
+ "@atlaskit/editor-test-helpers": "^17.2.0",
75
82
  "@atlaskit/link-provider": "^1.0.0",
76
- "@atlaskit/logo": "^13.8.0",
83
+ "@atlaskit/logo": "^13.9.0",
77
84
  "@atlaskit/media-core": "^33.0.0",
78
85
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
79
86
  "@atlaskit/media-test-helpers": "^30.0.0",
80
87
  "@atlaskit/mention": "^21.0.0",
81
88
  "@atlaskit/navigation-next": "^9.0.0",
82
- "@atlaskit/profilecard": "^16.12.0",
83
- "@atlaskit/radio": "^5.3.0",
89
+ "@atlaskit/profilecard": "^17.2.0",
90
+ "@atlaskit/radio": "^5.4.0",
84
91
  "@atlaskit/range": "^6.0.0",
85
92
  "@atlaskit/ssr": "*",
86
93
  "@atlaskit/util-data-test": "^17.5.0",
87
94
  "@atlaskit/visual-regression": "*",
88
95
  "@atlaskit/webdriver-runner": "*",
89
96
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
90
- "@testing-library/react": "^8.0.1",
97
+ "@testing-library/react": "^12.1.5",
91
98
  "@types/prosemirror-model": "^1.11.0",
92
99
  "@types/prosemirror-transform": "^1.1.0",
93
100
  "@types/react-loadable": "^5.4.1",
@@ -103,7 +110,7 @@
103
110
  "react-test-renderer": "^16.8.0",
104
111
  "rxjs": "^5.5.0",
105
112
  "sinon": "^2.2.0",
106
- "typescript": "4.3.5",
113
+ "typescript": "4.5.5",
107
114
  "worker-plugin": "^4.0.2"
108
115
  },
109
116
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/render-document.js",
5
5
  "module:es2019": "../dist/es2019/render-document.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/render-document.d.ts"
7
+ "types": "../dist/types/render-document.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/render-document.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/renderer-context.js",
5
5
  "module:es2019": "../dist/es2019/renderer-context.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/renderer-context.d.ts"
7
+ "types": "../dist/types/renderer-context.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/renderer-context.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/serializer.js",
5
5
  "module:es2019": "../dist/es2019/serializer.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/serializer.d.ts"
7
+ "types": "../dist/types/serializer.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/serializer.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/text-serializer.js",
5
5
  "module:es2019": "../dist/es2019/text-serializer.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/text-serializer.d.ts"
7
+ "types": "../dist/types/text-serializer.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/text-serializer.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/use-feature-flags.js",
5
5
  "module:es2019": "../dist/es2019/use-feature-flags.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/use-feature-flags.d.ts"
7
+ "types": "../dist/types/use-feature-flags.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/use-feature-flags.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/utils.js",
5
5
  "module:es2019": "../dist/es2019/utils.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/utils.d.ts"
7
+ "types": "../dist/types/utils.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/utils.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }