@atlaskit/renderer 97.0.0 → 99.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.
- package/CHANGELOG.md +28 -0
- package/dist/cjs/react/hooks/use-bidi-warnings.js +45 -0
- package/dist/cjs/react/hooks/use-in-viewport.js +63 -0
- package/dist/cjs/react/index.js +5 -2
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +49 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +55 -0
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +82 -0
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +103 -0
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +24 -27
- package/dist/cjs/react/nodes/heading.js +15 -18
- package/dist/cjs/react/nodes/index.js +34 -5
- package/dist/cjs/react/nodes/layoutColumn.js +7 -2
- package/dist/cjs/react/utils/clipboard.js +24 -0
- package/dist/cjs/ui/Renderer/index.js +12 -7
- package/dist/cjs/ui/Renderer/style.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/hooks/use-bidi-warnings.js +28 -0
- package/dist/es2019/react/hooks/use-in-viewport.js +25 -0
- package/dist/es2019/react/index.js +5 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +33 -0
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +44 -0
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +58 -0
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +58 -0
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +24 -28
- package/dist/es2019/react/nodes/heading.js +16 -20
- package/dist/es2019/react/nodes/index.js +22 -5
- package/dist/es2019/react/nodes/layoutColumn.js +7 -3
- package/dist/es2019/react/utils/clipboard.js +9 -0
- package/dist/es2019/ui/Renderer/index.js +9 -4
- package/dist/es2019/ui/Renderer/style.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/hooks/use-bidi-warnings.js +29 -0
- package/dist/esm/react/hooks/use-in-viewport.js +51 -0
- package/dist/esm/react/index.js +5 -2
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +32 -0
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +40 -0
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +57 -0
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +80 -0
- package/dist/esm/react/nodes/codeBlockCopyButton.js +24 -27
- package/dist/esm/react/nodes/heading.js +15 -18
- package/dist/esm/react/nodes/index.js +33 -5
- package/dist/esm/react/nodes/layoutColumn.js +8 -3
- package/dist/esm/react/utils/clipboard.js +15 -0
- package/dist/esm/ui/Renderer/index.js +12 -6
- package/dist/esm/ui/Renderer/style.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/react/hooks/use-bidi-warnings.d.ts +10 -0
- package/dist/types/react/hooks/use-in-viewport.d.ts +5 -0
- package/dist/types/react/index.d.ts +5 -1
- package/dist/types/react/nodes/{codeBlock.d.ts → codeBlock/codeBlock.d.ts} +1 -1
- package/dist/types/react/nodes/codeBlock/components/codeBlockContainer.d.ts +12 -0
- package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +9 -0
- package/dist/types/react/nodes/codeBlock/windowedCodeBlock.d.ts +4 -0
- package/dist/types/react/nodes/index.d.ts +8 -5
- package/dist/types/react/utils/clipboard.d.ts +1 -0
- package/dist/types/ui/Renderer/types.d.ts +4 -0
- package/dist/types/ui/renderer-props.d.ts +2 -1
- package/package.json +16 -15
- package/report.api.md +590 -119
- package/dist/cjs/react/nodes/codeBlock.js +0 -74
- package/dist/cjs/react/nodes/copy-text-provider.js +0 -174
- package/dist/es2019/react/nodes/codeBlock.js +0 -59
- package/dist/es2019/react/nodes/copy-text-provider.js +0 -93
- package/dist/esm/react/nodes/codeBlock.js +0 -55
- package/dist/esm/react/nodes/copy-text-provider.js +0 -140
- package/dist/types/react/nodes/copy-text-provider.d.ts +0 -20
package/report.api.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
````ts
|
|
6
6
|
/// <reference types="react" />
|
|
7
7
|
|
|
8
8
|
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
@@ -29,37 +29,291 @@ import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/u
|
|
|
29
29
|
import type { UnsupportedContentPayload } from '@atlaskit/editor-common/utils';
|
|
30
30
|
import { UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/src/utils/analytics';
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
declare enum ACTION {
|
|
33
|
+
STARTED = 'started',
|
|
34
|
+
RENDERED = 'rendered',
|
|
35
|
+
RE_RENDERED = 'reRendered',
|
|
36
|
+
RENDERER_TTI = 'tti',
|
|
37
|
+
CRASHED = 'unhandledErrorCaught',
|
|
38
|
+
INVALID_PROSEMIRROR_DOCUMENT = 'invalidProsemirrorDocument',
|
|
39
|
+
SELECT_ALL_CAUGHT = 'selectAllCaught',
|
|
40
|
+
SELECT_ALL_ESCAPED = 'selectAllEscaped',
|
|
41
|
+
CLICKED = 'clicked',
|
|
42
|
+
VIEWED = 'viewed',
|
|
43
|
+
VISITED = 'visited',
|
|
44
|
+
SORT_COLUMN = 'sortedColumn',
|
|
45
|
+
SORT_COLUMN_NOT_ALLOWED = 'sortColumnNotAllowed',
|
|
46
|
+
TOGGLE_EXPAND = 'toggleExpand',
|
|
47
|
+
INSERTED = 'inserted',
|
|
48
|
+
OPENED = 'opened',
|
|
49
|
+
CLOSED = 'closed',
|
|
50
|
+
DELETED = 'deleted',
|
|
51
|
+
EDITED = 'edited',
|
|
52
|
+
RESOLVED = 'resolved',
|
|
53
|
+
CREATE_NOT_ALLOWED = 'createNotAllowed',
|
|
54
|
+
UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = 'unsupportedContentLevelsTrackingSucceeded',
|
|
55
|
+
UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = 'unsupportedContentLevelsTrackingErrored',
|
|
56
|
+
MEDIA_LINK_TRANSFORMED = 'mediaLinkTransformed',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare enum ACTION_SUBJECT {
|
|
60
|
+
RENDERER = 'renderer',
|
|
61
|
+
BUTTON = 'button',
|
|
62
|
+
ANCHOR_LINK = 'anchorLink',
|
|
63
|
+
TABLE = 'table',
|
|
64
|
+
EXPAND = 'expand',
|
|
65
|
+
NESTED_EXPAND = 'nestedExpand',
|
|
66
|
+
MEDIA_SINGLE = 'mediaSingle',
|
|
67
|
+
LINK = 'link',
|
|
68
|
+
ANNOTATION = 'annotation',
|
|
69
|
+
MEDIA = 'media',
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare enum ACTION_SUBJECT_ID {
|
|
73
|
+
HEADING_ANCHOR_LINK = 'headingAnchorLink',
|
|
74
|
+
LINK = 'link',
|
|
75
|
+
INLINE_COMMENT = 'inlineComment',
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare class ADFEncoder<T> {
|
|
36
79
|
encode: (value: T) => any;
|
|
80
|
+
constructor(createTransformerWithSchema: TransformerProvider<T>);
|
|
37
81
|
}
|
|
38
82
|
|
|
39
|
-
|
|
40
|
-
|
|
83
|
+
declare type AEP<
|
|
84
|
+
Action,
|
|
85
|
+
ActionSubject,
|
|
86
|
+
ActionSubjectID,
|
|
87
|
+
Attributes,
|
|
88
|
+
EventType
|
|
89
|
+
> = {
|
|
90
|
+
action: Action;
|
|
91
|
+
actionSubject: ActionSubject;
|
|
92
|
+
actionSubjectId?: ActionSubjectID;
|
|
93
|
+
attributes?: Attributes;
|
|
94
|
+
eventType: EventType;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare type AnalyticsEventPayload<T = void> =
|
|
98
|
+
| RendererStartAEP
|
|
99
|
+
| RendererRenderedAEP
|
|
100
|
+
| RendererReRenderedAEP<T>
|
|
101
|
+
| ComponentCrashErrorAEP
|
|
102
|
+
| RendererUnsupportedContentLevelsTrackingSucceeded
|
|
103
|
+
| RendererUnsupportedContentLevelsTrackingErrored
|
|
104
|
+
| RendererSelectAllCaughtAEP
|
|
105
|
+
| RendererSelectAllEscapedAEP
|
|
106
|
+
| HeadingAnchorLinkButtonAEP
|
|
107
|
+
| AnchorLinkAEP
|
|
108
|
+
| TableSortColumnNotAllowedAEP
|
|
109
|
+
| TableSortColumnAEP
|
|
110
|
+
| VisitLinkAEP
|
|
111
|
+
| VisitMediaLinkAEP
|
|
112
|
+
| ExpandAEP
|
|
113
|
+
| UnsupportedContentPayload
|
|
114
|
+
| UnsupportedContentTooltipPayload
|
|
115
|
+
| AnnotationAEP
|
|
116
|
+
| AnnotationDeleteAEP
|
|
117
|
+
| MediaLnkTransformedAEP
|
|
118
|
+
| InvalidProsemirrorDocumentErrorAEP
|
|
119
|
+
| RendererTTIAEP;
|
|
120
|
+
|
|
121
|
+
declare type AnchorLinkAEP = UIAEP<
|
|
122
|
+
ACTION.VIEWED,
|
|
123
|
+
ACTION_SUBJECT.ANCHOR_LINK,
|
|
124
|
+
undefined,
|
|
125
|
+
{
|
|
126
|
+
platform: PLATFORM.WEB;
|
|
127
|
+
mode: MODE.RENDERER;
|
|
128
|
+
}
|
|
129
|
+
>;
|
|
130
|
+
|
|
131
|
+
declare type AnnotationActionType =
|
|
132
|
+
| ACTION.INSERTED
|
|
133
|
+
| ACTION.CLOSED
|
|
134
|
+
| ACTION.EDITED
|
|
135
|
+
| ACTION.DELETED
|
|
136
|
+
| ACTION.OPENED
|
|
137
|
+
| ACTION.RESOLVED
|
|
138
|
+
| ACTION.VIEWED
|
|
139
|
+
| ACTION.CREATE_NOT_ALLOWED;
|
|
140
|
+
|
|
141
|
+
declare type AnnotationAEP = AEP<
|
|
142
|
+
AnnotationActionType,
|
|
143
|
+
ACTION_SUBJECT.ANNOTATION,
|
|
144
|
+
ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
145
|
+
AnnotationAEPAttributes,
|
|
146
|
+
undefined
|
|
147
|
+
>;
|
|
148
|
+
|
|
149
|
+
declare type AnnotationAEPAttributes =
|
|
150
|
+
| AnnotationDraftAEPAttributes
|
|
151
|
+
| AnnotationResolvedAEPAttributes;
|
|
152
|
+
|
|
153
|
+
declare type AnnotationDeleteAEP = AEP<
|
|
154
|
+
AnnotationActionType,
|
|
155
|
+
ACTION_SUBJECT.ANNOTATION,
|
|
156
|
+
ACTION_SUBJECT_ID,
|
|
157
|
+
undefined,
|
|
158
|
+
EVENT_TYPE.TRACK
|
|
159
|
+
>;
|
|
160
|
+
|
|
161
|
+
declare type AnnotationDraftAEPAttributes = {
|
|
162
|
+
overlap?: number;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
declare type AnnotationResolvedAEPAttributes = {
|
|
166
|
+
method?: RESOLVE_METHOD;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
declare type ButtonAEP<ActionSubjectID, Attributes> = UIAEP<
|
|
170
|
+
ACTION.CLICKED,
|
|
171
|
+
ACTION_SUBJECT.BUTTON,
|
|
172
|
+
ActionSubjectID,
|
|
173
|
+
Attributes
|
|
174
|
+
>;
|
|
175
|
+
|
|
176
|
+
declare type ComponentCrashErrorAEP = AEP<
|
|
177
|
+
ACTION.CRASHED,
|
|
178
|
+
ACTION_SUBJECT.RENDERER,
|
|
179
|
+
ACTION_SUBJECT_ID,
|
|
180
|
+
{
|
|
181
|
+
platform: PLATFORM.WEB;
|
|
182
|
+
errorMessage?: string;
|
|
183
|
+
errorStack?: string;
|
|
184
|
+
componentStack?: string;
|
|
185
|
+
errorRethrown?: boolean;
|
|
186
|
+
},
|
|
187
|
+
EVENT_TYPE.OPERATIONAL
|
|
188
|
+
>;
|
|
41
189
|
|
|
42
|
-
|
|
43
|
-
|
|
190
|
+
declare type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
|
|
191
|
+
|
|
192
|
+
declare enum EVENT_TYPE {
|
|
193
|
+
OPERATIONAL = 'operational',
|
|
194
|
+
SCREEN = 'screen',
|
|
195
|
+
TRACK = 'track',
|
|
196
|
+
UI = 'ui',
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare type ExpandAEP = AEP<
|
|
200
|
+
ACTION.TOGGLE_EXPAND,
|
|
201
|
+
ACTION_SUBJECT.EXPAND | ACTION_SUBJECT.NESTED_EXPAND,
|
|
202
|
+
undefined,
|
|
203
|
+
{
|
|
204
|
+
platform: PLATFORM.WEB;
|
|
205
|
+
mode: MODE.RENDERER;
|
|
206
|
+
expanded: boolean;
|
|
207
|
+
},
|
|
208
|
+
EVENT_TYPE.TRACK
|
|
209
|
+
>;
|
|
210
|
+
|
|
211
|
+
declare type HeadingAnchorLinkButtonAEP = ButtonAEP<
|
|
212
|
+
ACTION_SUBJECT_ID.HEADING_ANCHOR_LINK,
|
|
213
|
+
undefined
|
|
214
|
+
>;
|
|
215
|
+
|
|
216
|
+
declare type HeadingAnchorLinksConfig = {
|
|
217
|
+
activeHeadingId?: string;
|
|
218
|
+
allowNestedHeaderLinks?: boolean;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare type HeadingAnchorLinksProps =
|
|
222
|
+
| boolean
|
|
223
|
+
| HeadingAnchorLinksConfig;
|
|
224
|
+
|
|
225
|
+
declare type InvalidProsemirrorDocumentErrorAEP = AEP<
|
|
226
|
+
ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
227
|
+
ACTION_SUBJECT.RENDERER,
|
|
228
|
+
ACTION_SUBJECT_ID,
|
|
229
|
+
{
|
|
230
|
+
platform: PLATFORM.WEB;
|
|
231
|
+
errorStack?: string;
|
|
232
|
+
},
|
|
233
|
+
EVENT_TYPE.OPERATIONAL
|
|
234
|
+
>;
|
|
235
|
+
|
|
236
|
+
declare type MediaLnkTransformedAEP = AEP<
|
|
237
|
+
ACTION.MEDIA_LINK_TRANSFORMED,
|
|
238
|
+
ACTION_SUBJECT.RENDERER,
|
|
239
|
+
undefined,
|
|
240
|
+
undefined,
|
|
241
|
+
EVENT_TYPE.OPERATIONAL
|
|
242
|
+
>;
|
|
243
|
+
|
|
244
|
+
declare interface MediaOptions {
|
|
245
|
+
allowLinking?: boolean;
|
|
246
|
+
enableDownloadButton?: boolean;
|
|
247
|
+
featureFlags?: MediaFeatureFlags;
|
|
248
|
+
ssr?: MediaSSR;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare type MediaSSR = {
|
|
44
252
|
mode: SSR;
|
|
45
253
|
config: MediaClientConfig;
|
|
46
254
|
};
|
|
47
255
|
|
|
48
|
-
|
|
49
|
-
|
|
256
|
+
declare enum MODE {
|
|
257
|
+
RENDERER = 'renderer',
|
|
258
|
+
EDITOR = 'editor',
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
declare interface ParentInfo {
|
|
262
|
+
parentIsIncompleteTask: boolean;
|
|
263
|
+
path: Array<Node_2>;
|
|
264
|
+
pos: number;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare enum PLATFORM {
|
|
268
|
+
NATIVE = 'mobileNative',
|
|
269
|
+
HYBRID = 'mobileHybrid',
|
|
270
|
+
WEB = 'web',
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare interface RawObjectFeatureFlags {
|
|
274
|
+
['renderer-render-tracking']: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export declare const ReactRenderer: (props: RendererProps) => jsx.JSX.Element;
|
|
50
278
|
|
|
51
|
-
|
|
52
|
-
|
|
279
|
+
export declare class ReactSerializer implements Serializer<JSX.Element> {
|
|
280
|
+
private providers?;
|
|
281
|
+
private eventHandlers?;
|
|
282
|
+
private extensionHandlers?;
|
|
283
|
+
private portal?;
|
|
284
|
+
private rendererContext?;
|
|
285
|
+
private appearance?;
|
|
286
|
+
private disableHeadingIDs?;
|
|
287
|
+
private disableActions?;
|
|
288
|
+
private headingIds;
|
|
289
|
+
/**
|
|
290
|
+
* The reason we have this extra array here is because we need to generate the same unique
|
|
291
|
+
* heading id for 2 different nodes: headers and expands (check the implementation of
|
|
292
|
+
* `getUniqueHeadingId` for more info).
|
|
293
|
+
*
|
|
294
|
+
* We will eventually need to refactor the current approach to generate unique ids
|
|
295
|
+
* for headers under this ticket -> https://product-fabric.atlassian.net/browse/ED-9668
|
|
296
|
+
*/
|
|
297
|
+
private expandHeadingIds;
|
|
298
|
+
private allowHeadingAnchorLinks?;
|
|
299
|
+
private allowColumnSorting?;
|
|
300
|
+
private allowCopyToClipboard?;
|
|
301
|
+
private allowPlaceholderText?;
|
|
302
|
+
private allowCustomPanels?;
|
|
303
|
+
private fireAnalyticsEvent?;
|
|
304
|
+
private shouldOpenMediaViewer?;
|
|
305
|
+
private allowAltTextOnImages?;
|
|
306
|
+
private stickyHeaders?;
|
|
307
|
+
private allowMediaLinking?;
|
|
308
|
+
private startPos;
|
|
309
|
+
private surroundTextNodesWithTextWrapper;
|
|
310
|
+
private media?;
|
|
311
|
+
private smartLinks?;
|
|
312
|
+
private allowAnnotations;
|
|
313
|
+
private allowSelectAllTrap?;
|
|
53
314
|
constructor(init: ReactSerializerInit);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// (undocumented)
|
|
57
|
-
static fromSchema(_: unknown, init: ReactSerializerInit): ReactSerializer;
|
|
58
|
-
// (undocumented)
|
|
59
|
-
static getChildNodes(fragment: Fragment): (Node_2 | TextWrapper)[];
|
|
60
|
-
// (undocumented)
|
|
61
|
-
static getMarks(node: Node_2): Mark[];
|
|
62
|
-
// (undocumented)
|
|
315
|
+
private resetState;
|
|
316
|
+
private getNodeProps;
|
|
63
317
|
serializeFragment(
|
|
64
318
|
fragment: Fragment,
|
|
65
319
|
props?: any,
|
|
@@ -67,10 +321,66 @@ export class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
67
321
|
key?: string,
|
|
68
322
|
parentInfo?: ParentInfo,
|
|
69
323
|
): JSX.Element | null;
|
|
324
|
+
private serializeFragmentChild;
|
|
325
|
+
private withMediaMarkProps;
|
|
326
|
+
private serializeTextWrapper;
|
|
327
|
+
private serializeMark;
|
|
328
|
+
private renderNode;
|
|
329
|
+
private renderMark;
|
|
330
|
+
private getTableChildrenProps;
|
|
331
|
+
private getTableProps;
|
|
332
|
+
private getDateProps;
|
|
333
|
+
private getMediaSingleProps;
|
|
334
|
+
private getMediaProps;
|
|
335
|
+
private getEmbedCardProps;
|
|
336
|
+
private getMediaGroupProps;
|
|
337
|
+
private getMediaInlineProps;
|
|
338
|
+
private getTaskItemProps;
|
|
339
|
+
private getHardBreakProps;
|
|
340
|
+
private getCodeBlockProps;
|
|
341
|
+
private getPanelProps;
|
|
342
|
+
private getUnsupportedContentProps;
|
|
343
|
+
private getProps;
|
|
344
|
+
private headingAnchorSupported;
|
|
345
|
+
private getHeadingProps;
|
|
346
|
+
private getExpandProps;
|
|
347
|
+
private getHeadingId;
|
|
348
|
+
private getUniqueHeadingId;
|
|
349
|
+
private getAnnotationMarkProps;
|
|
350
|
+
private getMarkProps;
|
|
351
|
+
static getChildNodes(fragment: Fragment): (Node_2 | TextWrapper)[];
|
|
352
|
+
static getMarks(node: Node_2): Mark[];
|
|
353
|
+
static buildMarkStructure(content: Node_2[]): Mark<any>[];
|
|
354
|
+
static fromSchema(_: unknown, init: ReactSerializerInit): ReactSerializer;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare interface ReactSerializerInit {
|
|
358
|
+
providers?: ProviderFactory;
|
|
359
|
+
eventHandlers?: EventHandlers;
|
|
360
|
+
extensionHandlers?: ExtensionHandlers;
|
|
361
|
+
portal?: HTMLElement;
|
|
362
|
+
objectContext?: RendererContext;
|
|
363
|
+
appearance?: RendererAppearance;
|
|
364
|
+
disableHeadingIDs?: boolean;
|
|
365
|
+
disableActions?: boolean;
|
|
366
|
+
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
367
|
+
allowColumnSorting?: boolean;
|
|
368
|
+
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
369
|
+
shouldOpenMediaViewer?: boolean;
|
|
370
|
+
allowAltTextOnImages?: boolean;
|
|
371
|
+
stickyHeaders?: StickyHeaderConfig;
|
|
372
|
+
allowMediaLinking?: boolean;
|
|
373
|
+
surroundTextNodesWithTextWrapper?: boolean;
|
|
374
|
+
media?: MediaOptions;
|
|
375
|
+
smartLinks?: SmartLinksOptions;
|
|
376
|
+
allowCopyToClipboard?: boolean;
|
|
377
|
+
allowPlaceholderText?: boolean;
|
|
378
|
+
allowCustomPanels?: boolean;
|
|
379
|
+
allowAnnotations?: boolean;
|
|
380
|
+
allowSelectAllTrap?: boolean;
|
|
70
381
|
}
|
|
71
382
|
|
|
72
|
-
|
|
73
|
-
export const renderDocument: <T>(
|
|
383
|
+
export declare const renderDocument: <T>(
|
|
74
384
|
doc: any,
|
|
75
385
|
serializer: Serializer<T>,
|
|
76
386
|
schema?: Schema,
|
|
@@ -84,126 +394,211 @@ export const renderDocument: <T>(
|
|
|
84
394
|
appearance?: RendererAppearance,
|
|
85
395
|
) => RenderOutput<T | null>;
|
|
86
396
|
|
|
87
|
-
|
|
88
|
-
export type RendererAppearance =
|
|
397
|
+
export declare type RendererAppearance =
|
|
89
398
|
| 'comment'
|
|
90
399
|
| 'full-page'
|
|
91
400
|
| 'full-width'
|
|
92
401
|
| 'mobile'
|
|
93
402
|
| undefined;
|
|
94
403
|
|
|
95
|
-
|
|
96
|
-
export interface RendererContext {
|
|
97
|
-
// (undocumented)
|
|
98
|
-
adDoc?: any;
|
|
99
|
-
// (undocumented)
|
|
100
|
-
containerAri?: string;
|
|
101
|
-
// (undocumented)
|
|
404
|
+
export declare interface RendererContext {
|
|
102
405
|
objectAri?: string;
|
|
103
|
-
|
|
406
|
+
containerAri?: string;
|
|
407
|
+
adDoc?: any;
|
|
104
408
|
schema?: Schema;
|
|
105
409
|
}
|
|
106
410
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
411
|
+
export declare interface RendererProps {
|
|
412
|
+
document: any;
|
|
413
|
+
dataProviders?: ProviderFactory;
|
|
414
|
+
eventHandlers?: EventHandlers;
|
|
415
|
+
extensionHandlers?: ExtensionHandlers;
|
|
416
|
+
enableSsrInlineScripts?: boolean;
|
|
417
|
+
onComplete?: (stat: RenderOutputStat) => void;
|
|
418
|
+
onError?: (error: any) => void;
|
|
419
|
+
portal?: HTMLElement;
|
|
420
|
+
rendererContext?: RendererContext;
|
|
421
|
+
schema?: Schema;
|
|
422
|
+
appearance?: RendererAppearance;
|
|
110
423
|
adfStage?: ADFStage;
|
|
111
|
-
|
|
424
|
+
disableHeadingIDs?: boolean;
|
|
425
|
+
disableActions?: boolean;
|
|
426
|
+
/** @deprecated [ED-14507] allowDynamicTextSizing is no longer in use */
|
|
427
|
+
allowDynamicTextSizing?: boolean;
|
|
428
|
+
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
429
|
+
allowPlaceholderText?: boolean;
|
|
430
|
+
maxHeight?: number;
|
|
431
|
+
fadeOutHeight?: number;
|
|
432
|
+
truncated?: boolean;
|
|
433
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
434
|
+
allowColumnSorting?: boolean;
|
|
435
|
+
shouldOpenMediaViewer?: boolean;
|
|
112
436
|
allowAltTextOnImages?: boolean;
|
|
113
|
-
|
|
437
|
+
stickyHeaders?: StickyHeaderProps;
|
|
438
|
+
media?: MediaOptions;
|
|
439
|
+
smartLinks?: SmartLinksOptions;
|
|
114
440
|
allowAnnotations?: boolean;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
441
|
+
annotationProvider?: AnnotationProviders | null;
|
|
442
|
+
innerRef?: React.RefObject<HTMLDivElement>;
|
|
443
|
+
useSpecBasedValidator?: boolean;
|
|
118
444
|
allowCopyToClipboard?: boolean;
|
|
119
|
-
// (undocumented)
|
|
120
445
|
allowCustomPanels?: boolean;
|
|
121
|
-
// @deprecated (undocumented)
|
|
122
|
-
allowDynamicTextSizing?: boolean;
|
|
123
|
-
// (undocumented)
|
|
124
|
-
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
125
|
-
// (undocumented)
|
|
126
|
-
allowPlaceholderText?: boolean;
|
|
127
|
-
// (undocumented)
|
|
128
|
-
allowSelectAllTrap?: boolean;
|
|
129
|
-
// (undocumented)
|
|
130
|
-
allowUgcScrubber?: boolean;
|
|
131
|
-
// (undocumented)
|
|
132
446
|
analyticsEventSeverityTracking?: {
|
|
133
447
|
enabled: boolean;
|
|
134
448
|
severityNormalThreshold: number;
|
|
135
449
|
severityDegradedThreshold: number;
|
|
136
450
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
451
|
+
allowUgcScrubber?: boolean;
|
|
452
|
+
allowSelectAllTrap?: boolean;
|
|
453
|
+
unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
|
|
454
|
+
/**
|
|
455
|
+
* @default undefined
|
|
456
|
+
* @description
|
|
457
|
+
* Short lived feature flags for experiments and gradual rollouts
|
|
458
|
+
* Flags are expected to follow these rules or they are filtered out
|
|
459
|
+
*
|
|
460
|
+
* 1. cased in kebab-case (match [a-z-])
|
|
461
|
+
* 2. have boolean values or object {} values
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```tsx
|
|
465
|
+
* (<Renderer featureFlags={{ 'my-feature': true }} />);
|
|
466
|
+
* getFeatureFlags()?.myFeature === true;
|
|
467
|
+
* ```
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```tsx
|
|
471
|
+
* (<Renderer featureFlags={{ 'my-feature': 'thing' }} />);
|
|
472
|
+
* getFeatureFlags()?.myFeature === undefined;
|
|
473
|
+
* ```
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```tsx
|
|
477
|
+
* (<Renderer featureFlags={{ 'product.my-feature': false }} />);
|
|
478
|
+
* getFeatureFlags()?.myFeature === undefined;
|
|
479
|
+
* getFeatureFlags()?.productMyFeature === undefined;
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
159
482
|
featureFlags?:
|
|
160
483
|
| {
|
|
161
484
|
[featureFlag: string]: boolean;
|
|
162
485
|
}
|
|
163
486
|
| Partial<RawObjectFeatureFlags>;
|
|
164
|
-
// (undocumented)
|
|
165
|
-
innerRef?: React.RefObject<HTMLDivElement>;
|
|
166
|
-
// (undocumented)
|
|
167
|
-
maxHeight?: number;
|
|
168
|
-
// (undocumented)
|
|
169
|
-
media?: MediaOptions;
|
|
170
|
-
// (undocumented)
|
|
171
|
-
onComplete?: (stat: RenderOutputStat) => void;
|
|
172
|
-
// (undocumented)
|
|
173
|
-
onError?: (error: any) => void;
|
|
174
|
-
// (undocumented)
|
|
175
|
-
portal?: HTMLElement;
|
|
176
|
-
// (undocumented)
|
|
177
|
-
rendererContext?: RendererContext;
|
|
178
|
-
// (undocumented)
|
|
179
|
-
schema?: Schema;
|
|
180
|
-
// (undocumented)
|
|
181
|
-
shouldOpenMediaViewer?: boolean;
|
|
182
|
-
// (undocumented)
|
|
183
|
-
smartLinks?: SmartLinksOptions;
|
|
184
|
-
// (undocumented)
|
|
185
|
-
stickyHeaders?: StickyHeaderProps;
|
|
186
|
-
// (undocumented)
|
|
187
|
-
truncated?: boolean;
|
|
188
|
-
// (undocumented)
|
|
189
|
-
unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
|
|
190
|
-
// (undocumented)
|
|
191
|
-
useSpecBasedValidator?: boolean;
|
|
192
487
|
}
|
|
193
488
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
489
|
+
declare type RendererRenderedAEP = AEP<
|
|
490
|
+
ACTION.RENDERED,
|
|
491
|
+
ACTION_SUBJECT.RENDERER,
|
|
492
|
+
undefined,
|
|
493
|
+
{
|
|
494
|
+
platform: PLATFORM.WEB;
|
|
495
|
+
duration: number;
|
|
496
|
+
ttfb?: number;
|
|
497
|
+
nodes: Record<string, number>;
|
|
498
|
+
severity?: SEVERITY;
|
|
499
|
+
},
|
|
500
|
+
EVENT_TYPE.OPERATIONAL
|
|
501
|
+
>;
|
|
502
|
+
|
|
503
|
+
declare type RendererReRenderedAEP<Props> = AEP<
|
|
504
|
+
ACTION.RE_RENDERED,
|
|
505
|
+
ACTION_SUBJECT.RENDERER,
|
|
506
|
+
undefined,
|
|
507
|
+
{
|
|
508
|
+
propsDifference: PropsDifference<Props> | ShallowPropsDifference<Props>;
|
|
509
|
+
count: number;
|
|
510
|
+
componentId?: string;
|
|
511
|
+
},
|
|
512
|
+
EVENT_TYPE.OPERATIONAL
|
|
513
|
+
>;
|
|
514
|
+
|
|
515
|
+
declare type RendererSelectAllCaughtAEP = AEP<
|
|
516
|
+
ACTION.SELECT_ALL_CAUGHT,
|
|
517
|
+
ACTION_SUBJECT.RENDERER,
|
|
518
|
+
undefined,
|
|
519
|
+
{
|
|
520
|
+
platform: PLATFORM.WEB;
|
|
521
|
+
},
|
|
522
|
+
EVENT_TYPE.TRACK
|
|
523
|
+
>;
|
|
524
|
+
|
|
525
|
+
declare type RendererSelectAllEscapedAEP = AEP<
|
|
526
|
+
ACTION.SELECT_ALL_ESCAPED,
|
|
527
|
+
ACTION_SUBJECT.RENDERER,
|
|
528
|
+
undefined,
|
|
529
|
+
{
|
|
530
|
+
platform: PLATFORM.WEB;
|
|
531
|
+
},
|
|
532
|
+
EVENT_TYPE.TRACK
|
|
533
|
+
>;
|
|
534
|
+
|
|
535
|
+
declare type RendererStartAEP = AEP<
|
|
536
|
+
ACTION.STARTED,
|
|
537
|
+
ACTION_SUBJECT.RENDERER,
|
|
538
|
+
undefined,
|
|
539
|
+
{
|
|
540
|
+
platform: PLATFORM.WEB;
|
|
541
|
+
},
|
|
542
|
+
EVENT_TYPE.UI
|
|
543
|
+
>;
|
|
544
|
+
|
|
545
|
+
declare type RendererTTIAEP = AEP<
|
|
546
|
+
ACTION.RENDERER_TTI,
|
|
547
|
+
ACTION_SUBJECT.RENDERER,
|
|
548
|
+
undefined,
|
|
549
|
+
{
|
|
550
|
+
tti: number;
|
|
551
|
+
ttiFromInvocation: number;
|
|
552
|
+
canceled: boolean;
|
|
553
|
+
},
|
|
554
|
+
EVENT_TYPE.OPERATIONAL
|
|
555
|
+
>;
|
|
556
|
+
|
|
557
|
+
declare type RendererUnsupportedContentLevelsTrackingErrored = AEP<
|
|
558
|
+
ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED,
|
|
559
|
+
ACTION_SUBJECT.RENDERER,
|
|
560
|
+
undefined,
|
|
561
|
+
{
|
|
562
|
+
platform: PLATFORM.WEB;
|
|
563
|
+
error: string;
|
|
564
|
+
},
|
|
565
|
+
EVENT_TYPE.OPERATIONAL
|
|
566
|
+
>;
|
|
567
|
+
|
|
568
|
+
declare type RendererUnsupportedContentLevelsTrackingSucceeded = AEP<
|
|
569
|
+
ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED,
|
|
570
|
+
ACTION_SUBJECT.RENDERER,
|
|
571
|
+
undefined,
|
|
572
|
+
{
|
|
573
|
+
appearance?: string;
|
|
574
|
+
platform: PLATFORM.WEB;
|
|
575
|
+
unsupportedContentLevelSeverity: UNSUPPORTED_CONTENT_LEVEL_SEVERITY;
|
|
576
|
+
unsupportedContentLevelPercentage: number;
|
|
577
|
+
unsupportedNodesCount: number;
|
|
578
|
+
supportedNodesCount: number;
|
|
579
|
+
},
|
|
580
|
+
EVENT_TYPE.OPERATIONAL
|
|
581
|
+
>;
|
|
582
|
+
|
|
583
|
+
declare interface RenderOutput<T> {
|
|
584
|
+
result: T;
|
|
585
|
+
stat: RenderOutputStat;
|
|
586
|
+
pmDoc?: Node_2;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export declare interface RenderOutputStat {
|
|
197
590
|
buildTreeTime?: number;
|
|
198
|
-
// (undocumented)
|
|
199
591
|
sanitizeTime: number;
|
|
200
|
-
// (undocumented)
|
|
201
592
|
serializeTime?: number;
|
|
202
593
|
}
|
|
203
594
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
595
|
+
declare enum RESOLVE_METHOD {
|
|
596
|
+
COMPONENT = 'component',
|
|
597
|
+
CONSUMER = 'consumer',
|
|
598
|
+
ORPHANED = 'orphaned',
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export declare interface Serializer<T> {
|
|
207
602
|
serializeFragment(
|
|
208
603
|
fragment: Fragment,
|
|
209
604
|
props?: any,
|
|
@@ -212,14 +607,90 @@ export interface Serializer<T> {
|
|
|
212
607
|
): T | null;
|
|
213
608
|
}
|
|
214
609
|
|
|
215
|
-
|
|
216
|
-
|
|
610
|
+
declare interface SmartLinksOptions {
|
|
611
|
+
ssr?: boolean;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare type StickyHeaderConfig = {
|
|
615
|
+
offsetTop?: number;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
declare type StickyHeaderProps =
|
|
619
|
+
| boolean
|
|
620
|
+
| ({
|
|
621
|
+
show?: boolean;
|
|
622
|
+
} & StickyHeaderConfig);
|
|
623
|
+
|
|
624
|
+
declare type TableSortColumnAEP = AEP<
|
|
625
|
+
ACTION.SORT_COLUMN,
|
|
626
|
+
ACTION_SUBJECT.TABLE,
|
|
627
|
+
undefined,
|
|
628
|
+
{
|
|
629
|
+
platform: PLATFORM.WEB;
|
|
630
|
+
mode: MODE.RENDERER;
|
|
631
|
+
sortOrder: SortOrder;
|
|
632
|
+
columnIndex: number;
|
|
633
|
+
},
|
|
634
|
+
EVENT_TYPE.TRACK
|
|
635
|
+
>;
|
|
636
|
+
|
|
637
|
+
declare type TableSortColumnNotAllowedAEP = AEP<
|
|
638
|
+
ACTION.SORT_COLUMN_NOT_ALLOWED,
|
|
639
|
+
ACTION_SUBJECT.TABLE,
|
|
640
|
+
undefined,
|
|
641
|
+
{
|
|
642
|
+
platform: PLATFORM.WEB;
|
|
643
|
+
mode: MODE.RENDERER;
|
|
644
|
+
},
|
|
645
|
+
EVENT_TYPE.TRACK
|
|
646
|
+
>;
|
|
647
|
+
|
|
648
|
+
export declare class TextSerializer implements Serializer<string> {
|
|
649
|
+
private schema;
|
|
217
650
|
constructor(schema: Schema);
|
|
218
|
-
// (undocumented)
|
|
219
|
-
static fromSchema(schema?: Schema): TextSerializer;
|
|
220
|
-
// (undocumented)
|
|
221
651
|
serializeFragment(fragment: Fragment): string;
|
|
652
|
+
static fromSchema(schema?: Schema): TextSerializer;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
declare interface TextWrapper {
|
|
656
|
+
type: {
|
|
657
|
+
name: 'textWrapper';
|
|
658
|
+
};
|
|
659
|
+
content: Node_2[];
|
|
660
|
+
nodeSize: number;
|
|
222
661
|
}
|
|
223
662
|
|
|
224
|
-
|
|
225
|
-
|
|
663
|
+
declare type TransformerProvider<T> = (schema: Schema) => Transformer_2<T>;
|
|
664
|
+
|
|
665
|
+
declare type UIAEP<Action, ActionSubject, ActionSubjectID, Attributes> = AEP<
|
|
666
|
+
Action,
|
|
667
|
+
ActionSubject,
|
|
668
|
+
ActionSubjectID,
|
|
669
|
+
Attributes,
|
|
670
|
+
EVENT_TYPE.UI
|
|
671
|
+
>;
|
|
672
|
+
|
|
673
|
+
declare type VisitLinkAEP = AEP<
|
|
674
|
+
ACTION.VISITED,
|
|
675
|
+
ACTION_SUBJECT.LINK,
|
|
676
|
+
undefined,
|
|
677
|
+
{
|
|
678
|
+
platform: PLATFORM.WEB;
|
|
679
|
+
mode: MODE.RENDERER;
|
|
680
|
+
},
|
|
681
|
+
EVENT_TYPE.TRACK
|
|
682
|
+
>;
|
|
683
|
+
|
|
684
|
+
declare type VisitMediaLinkAEP = AEP<
|
|
685
|
+
ACTION.VISITED,
|
|
686
|
+
ACTION_SUBJECT.MEDIA,
|
|
687
|
+
ACTION_SUBJECT_ID.LINK,
|
|
688
|
+
{
|
|
689
|
+
platform: PLATFORM.WEB;
|
|
690
|
+
mode: MODE.RENDERER;
|
|
691
|
+
},
|
|
692
|
+
EVENT_TYPE.TRACK
|
|
693
|
+
>;
|
|
694
|
+
|
|
695
|
+
export {};
|
|
696
|
+
````
|