@atlaskit/editor-common 114.28.0 → 114.30.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 +24 -0
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +7 -3
- package/dist/cjs/extensibility/ExtensionSSRReactContextsProvider.js +24 -0
- package/dist/cjs/extensibility/extensionNodeView.js +4 -2
- package/dist/cjs/messages/layout.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/portal/common.js +33 -8
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +11 -42
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/date.js +1 -2
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +7 -3
- package/dist/es2019/extensibility/ExtensionSSRReactContextsProvider.js +18 -0
- package/dist/es2019/extensibility/extensionNodeView.js +4 -2
- package/dist/es2019/messages/layout.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/portal/common.js +31 -8
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +11 -42
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/date.js +1 -2
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +7 -3
- package/dist/esm/extensibility/ExtensionSSRReactContextsProvider.js +17 -0
- package/dist/esm/extensibility/extensionNodeView.js +4 -2
- package/dist/esm/messages/layout.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/portal/common.js +33 -8
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +11 -42
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/date.js +1 -2
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/card/types.d.ts +21 -5
- package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +3 -1
- package/dist/types/extensibility/ExtensionSSRReactContextsProvider.d.ts +8 -0
- package/dist/types/extensibility/extensionNodeView.d.ts +4 -1
- package/dist/types/messages/layout.d.ts +39 -34
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/card/types.d.ts +21 -5
- package/dist/types-ts4.5/extensibility/ExtensionNodeWrapper.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/ExtensionSSRReactContextsProvider.d.ts +8 -0
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +4 -1
- package/dist/types-ts4.5/messages/layout.d.ts +39 -34
- package/package.json +7 -7
|
@@ -285,6 +285,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
285
285
|
return null;
|
|
286
286
|
}
|
|
287
287
|
return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
|
|
288
|
+
intl: props.intl,
|
|
288
289
|
nodeType: this.node.type.name,
|
|
289
290
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
290
291
|
}, /*#__PURE__*/React.createElement(Extension, {
|
|
@@ -312,7 +313,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
312
313
|
}
|
|
313
314
|
}]);
|
|
314
315
|
}(ReactNodeView);
|
|
315
|
-
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers) {
|
|
316
|
+
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
316
317
|
return function (node, view, getPos) {
|
|
317
318
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
318
319
|
providerFactory: providerFactory,
|
|
@@ -322,7 +323,8 @@ export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, pr
|
|
|
322
323
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
323
324
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
324
325
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
325
|
-
rendererExtensionHandlers: rendererExtensionHandlers
|
|
326
|
+
rendererExtensionHandlers: rendererExtensionHandlers,
|
|
327
|
+
intl: intl
|
|
326
328
|
}).init();
|
|
327
329
|
};
|
|
328
330
|
}
|
|
@@ -89,5 +89,10 @@ export var toolbarMessages = defineMessages({
|
|
|
89
89
|
id: 'fabric.editor.layout.resizeLayout',
|
|
90
90
|
defaultMessage: 'Resize layout',
|
|
91
91
|
description: 'The text is shown as a label on a button or handle when the user can resize the layout columns in the editor.'
|
|
92
|
+
},
|
|
93
|
+
distributeColumns: {
|
|
94
|
+
id: 'fabric.editor.layout.distributeColumns',
|
|
95
|
+
defaultMessage: 'Distribute columns',
|
|
96
|
+
description: 'The text is shown as a label for an option that distributes layout columns evenly.'
|
|
92
97
|
}
|
|
93
98
|
});
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "114.
|
|
13
|
+
var packageVersion = "114.29.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { memo, useLayoutEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
+
import { isSSR } from '../core-utils/is-ssr';
|
|
4
6
|
import { PortalBucket } from './PortalBucket';
|
|
5
7
|
export function createPortalRendererComponent(portalManager) {
|
|
6
8
|
return function PortalRenderer() {
|
|
@@ -47,6 +49,16 @@ export var PortalRenderWrapperInner = function PortalRenderWrapperInner(_ref) {
|
|
|
47
49
|
var PortalRenderWrapper = /*#__PURE__*/memo(PortalRenderWrapperInner);
|
|
48
50
|
PortalRenderWrapper.displayName = 'PortalRenderWrapper';
|
|
49
51
|
|
|
52
|
+
// Tree-shakable renderToStaticMarkup that should work only in SSR
|
|
53
|
+
function getRenderToStaticMarkup() {
|
|
54
|
+
if (process.env.REACT_SSR) {
|
|
55
|
+
return require('react-dom/server').renderToStaticMarkup;
|
|
56
|
+
}
|
|
57
|
+
return function () {
|
|
58
|
+
return '';
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
/**
|
|
51
63
|
* Creates a portal provider for managing multiple React portals. The provider
|
|
52
64
|
* facilitates rendering, removing, and destroying portals managed by a given
|
|
@@ -70,19 +82,32 @@ export var getPortalProviderAPI = function getPortalProviderAPI(portalManager) {
|
|
|
70
82
|
return {
|
|
71
83
|
render: function render(children, container, key, onBeforeReactDomRender) {
|
|
72
84
|
var immediate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
73
|
-
if (
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
if (isSSR() && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
86
|
+
var html = '';
|
|
87
|
+
try {
|
|
88
|
+
var renderToStaticMarkup = getRenderToStaticMarkup();
|
|
89
|
+
var Children = children;
|
|
90
|
+
html = renderToStaticMarkup( /*#__PURE__*/React.createElement(Children, null));
|
|
91
|
+
} catch (_unused) {}
|
|
92
|
+
container.innerHTML = html;
|
|
79
93
|
} else {
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
if (typeof onBeforeReactDomRender === 'function') {
|
|
95
|
+
var portal = /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(PortalRenderWrapper, {
|
|
96
|
+
getChildren: children,
|
|
97
|
+
onBeforeRender: onBeforeReactDomRender
|
|
98
|
+
}), container, key);
|
|
99
|
+
portalsMap.set(key, portalManager.registerPortal(key, portal, immediate));
|
|
100
|
+
} else {
|
|
101
|
+
var _portal = /*#__PURE__*/createPortal(children(), container, key);
|
|
102
|
+
portalsMap.set(key, portalManager.registerPortal(key, _portal, immediate));
|
|
103
|
+
}
|
|
82
104
|
}
|
|
83
105
|
},
|
|
84
106
|
remove: function remove(key) {
|
|
85
107
|
var _portalsMap$get;
|
|
108
|
+
if (isSSR() && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
86
111
|
(_portalsMap$get = portalsMap.get(key)) === null || _portalsMap$get === void 0 || _portalsMap$get();
|
|
87
112
|
portalsMap.delete(key);
|
|
88
113
|
},
|
|
@@ -10,11 +10,8 @@ import React from 'react';
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
|
-
import { flushSync } from 'react-dom';
|
|
14
|
-
import { createRoot } from 'react-dom/client';
|
|
15
13
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
16
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
15
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
19
16
|
import { isSSR } from '../core-utils/is-ssr';
|
|
20
17
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
@@ -75,39 +72,13 @@ function createNodeView(_ref) {
|
|
|
75
72
|
// to the passed dom element (domRef) which means it is automatically
|
|
76
73
|
// "cleaned up" when you do a "re render".
|
|
77
74
|
function renderComponent() {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
var PortalComponent = getPortalChildren({
|
|
87
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
88
|
-
currentNode: currentNode,
|
|
89
|
-
nodeViewParams: nodeViewParams,
|
|
90
|
-
Component: Component,
|
|
91
|
-
extraComponentProps: extraComponentProps
|
|
92
|
-
});
|
|
93
|
-
var rootElement = document.createElement('span');
|
|
94
|
-
var ssrRoot = createRoot(rootElement);
|
|
95
|
-
flushSync(function () {
|
|
96
|
-
ssrRoot.render(jsx(PortalComponent, null));
|
|
97
|
-
});
|
|
98
|
-
html = rootElement.innerHTML;
|
|
99
|
-
ssrRoot.unmount();
|
|
100
|
-
} catch (_unused) {}
|
|
101
|
-
domRef.innerHTML = html;
|
|
102
|
-
} else {
|
|
103
|
-
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
104
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
105
|
-
currentNode: currentNode,
|
|
106
|
-
nodeViewParams: nodeViewParams,
|
|
107
|
-
Component: Component,
|
|
108
|
-
extraComponentProps: extraComponentProps
|
|
109
|
-
}), domRef, key);
|
|
110
|
-
}
|
|
75
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
76
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
77
|
+
currentNode: currentNode,
|
|
78
|
+
nodeViewParams: nodeViewParams,
|
|
79
|
+
Component: Component,
|
|
80
|
+
extraComponentProps: extraComponentProps
|
|
81
|
+
}), domRef, key);
|
|
111
82
|
}
|
|
112
83
|
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
113
84
|
samplingRate = _getPerformanceOption.samplingRate,
|
|
@@ -161,12 +132,10 @@ function createNodeView(_ref) {
|
|
|
161
132
|
return true;
|
|
162
133
|
},
|
|
163
134
|
destroy: function destroy() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
pmPluginFactoryParams.portalProviderAPI.remove(key);
|
|
169
|
-
}
|
|
135
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
136
|
+
// what we have previously rendered using the editor portal
|
|
137
|
+
// provider api.
|
|
138
|
+
pmPluginFactoryParams.portalProviderAPI.remove(key);
|
|
170
139
|
// @ts-expect-error Expect an error as domRef is expected to be
|
|
171
140
|
// of HTMLSpanElement type however once the node view has
|
|
172
141
|
// been destroyed no other consumers should still be using it.
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "114.
|
|
24
|
+
var packageVersion = "114.29.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
package/dist/esm/utils/date.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
|
|
2
2
|
import isBefore from 'date-fns/isBefore';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
var FORMATS = /*#__PURE__*/function (FORMATS) {
|
|
5
4
|
FORMATS["ISO_FORMAT"] = "YYYY-MM-DD";
|
|
6
5
|
FORMATS["LOCALIZED_FORMAT"] = "LOCALIZED_FORMAT";
|
|
@@ -19,7 +18,7 @@ export var timestampToUTCDate = function timestampToUTCDate(timestamp) {
|
|
|
19
18
|
};
|
|
20
19
|
export var todayTimestampInUTC = function todayTimestampInUTC(timeZone) {
|
|
21
20
|
var today = new Date(Date.now());
|
|
22
|
-
if (timeZone
|
|
21
|
+
if (timeZone) {
|
|
23
22
|
var _parts$find, _parts$find2, _parts$find3;
|
|
24
23
|
var parts = new Intl.DateTimeFormat('en-US', {
|
|
25
24
|
timeZone: timeZone,
|
|
@@ -2,7 +2,7 @@ export type { CardOptions, OnClickCallback } from './cardOptions';
|
|
|
2
2
|
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata } from './utils';
|
|
3
3
|
export { default as buildLayoutButtons, alignmentIcons, wrappingIcons, layoutToMessages, buildLayoutDropdown, } from './MediaAndEmbedsToolbar';
|
|
4
4
|
export type { IconMap, LayoutIcon } from './MediaAndEmbedsToolbar';
|
|
5
|
-
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, } from './types';
|
|
5
|
+
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, QueueCardsFromRangeAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, } from './types';
|
|
6
6
|
export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
7
7
|
export { appearancePropsMap, getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
8
8
|
export { getDropdownOption } from './link-toolbar-dropdown-options';
|
|
@@ -18,6 +18,12 @@ export interface OptionConfig {
|
|
|
18
18
|
}
|
|
19
19
|
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
20
20
|
export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
21
|
+
/**
|
|
22
|
+
* Like {@link QueueCardsFromTransactionAction} but scoped to an explicit
|
|
23
|
+
* document range (`from`..`to`) instead of the entire step range of the
|
|
24
|
+
* transaction. Use this when only newly-inserted content should be resolved.
|
|
25
|
+
*/
|
|
26
|
+
export type QueueCardsFromRangeAction = (state: EditorState, tr: Transaction, from: number, to: number, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
21
27
|
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
22
28
|
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
23
29
|
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -74,6 +80,21 @@ export interface EmbedCardTransformers {
|
|
|
74
80
|
embedCardNodeTransformer: EmbedCardNodeTransformer;
|
|
75
81
|
}
|
|
76
82
|
export type CardPluginActions = {
|
|
83
|
+
getEndingToolbarItems: GetEndingToolbarItems;
|
|
84
|
+
getStartingToolbarItems: GetStartingToolbarItems;
|
|
85
|
+
hideLinkToolbar: HideLinkToolbarAction;
|
|
86
|
+
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
87
|
+
/**
|
|
88
|
+
* Like `queueCardsFromChangedTr` but scoped to an explicit document range.
|
|
89
|
+
* Use when only newly-inserted content should be resolved, to avoid
|
|
90
|
+
* accidentally converting pre-existing links in the surrounding document.
|
|
91
|
+
*
|
|
92
|
+
* Optional for backward compatibility — older versions of the card plugin
|
|
93
|
+
* may not expose this action. Callers should fall back to
|
|
94
|
+
* `queueCardsFromChangedTr` when unavailable.
|
|
95
|
+
*/
|
|
96
|
+
queueCardsFromRange?: QueueCardsFromRangeAction;
|
|
97
|
+
registerEmbedCardTransformer: (transformers: EmbedCardTransformers) => void;
|
|
77
98
|
/**
|
|
78
99
|
* Resolves a URL via the Object Resolver Service and returns the canonical
|
|
79
100
|
* expanded URL. Useful for expanding Confluence short-link URLs
|
|
@@ -83,10 +104,5 @@ export type CardPluginActions = {
|
|
|
83
104
|
* usable URL in its response data.
|
|
84
105
|
*/
|
|
85
106
|
resolveShortLinkUrl: (url: string) => Promise<string | undefined>;
|
|
86
|
-
getEndingToolbarItems: GetEndingToolbarItems;
|
|
87
|
-
getStartingToolbarItems: GetStartingToolbarItems;
|
|
88
|
-
hideLinkToolbar: HideLinkToolbarAction;
|
|
89
|
-
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
90
|
-
registerEmbedCardTransformer: (transformers: EmbedCardTransformers) => void;
|
|
91
107
|
setProvider: (provider: Promise<CardProvider>) => Promise<boolean>;
|
|
92
108
|
};
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import type { IntlShape } from 'react-intl';
|
|
8
9
|
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
9
10
|
type Props = {
|
|
10
11
|
children: React.ReactNode;
|
|
12
|
+
intl: IntlShape | undefined;
|
|
11
13
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
12
14
|
nodeType: string;
|
|
13
15
|
};
|
|
@@ -19,5 +21,5 @@ type Props = {
|
|
|
19
21
|
* @param param0
|
|
20
22
|
* @returns
|
|
21
23
|
*/
|
|
22
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
24
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, intl, }: Props) => jsx.JSX.Element;
|
|
23
25
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type IntlShape } from 'react-intl';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
intl: IntlShape | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function ExtensionSSRReactContextsProvider({ children, intl }: Props): ReactNode;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl';
|
|
2
3
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -17,6 +18,7 @@ interface ExtensionNodeViewOptions {
|
|
|
17
18
|
interface ReactExtensionNodeProps {
|
|
18
19
|
extensionHandlers: ExtensionHandlers;
|
|
19
20
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
21
|
+
intl?: IntlShape;
|
|
20
22
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
21
23
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
22
24
|
providerFactory: ProviderFactory;
|
|
@@ -71,6 +73,7 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
71
73
|
render(props: {
|
|
72
74
|
extensionHandlers: ExtensionHandlers;
|
|
73
75
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
76
|
+
intl?: IntlShape;
|
|
74
77
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
75
78
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
76
79
|
providerFactory: ProviderFactory;
|
|
@@ -79,5 +82,5 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
79
82
|
showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean;
|
|
80
83
|
}, forwardRef: ForwardRef): React.JSX.Element;
|
|
81
84
|
}
|
|
82
|
-
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
85
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers, intl?: IntlShape): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
83
86
|
export {};
|
|
@@ -1,92 +1,97 @@
|
|
|
1
1
|
export declare const toolbarMessages: {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
2
|
+
columnOption: {
|
|
4
3
|
defaultMessage: string;
|
|
5
4
|
description: string;
|
|
6
|
-
};
|
|
7
|
-
twoColumns: {
|
|
8
5
|
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
6
|
};
|
|
12
|
-
|
|
13
|
-
id: string;
|
|
7
|
+
controlslayoutPlaceholder: {
|
|
14
8
|
defaultMessage: string;
|
|
15
9
|
description: string;
|
|
16
|
-
};
|
|
17
|
-
twoColumnsAdvancedLayout: {
|
|
18
10
|
id: string;
|
|
11
|
+
};
|
|
12
|
+
distributeColumns: {
|
|
19
13
|
defaultMessage: string;
|
|
20
14
|
description: string;
|
|
21
|
-
};
|
|
22
|
-
threeColumns: {
|
|
23
15
|
id: string;
|
|
16
|
+
};
|
|
17
|
+
fiveColumns: {
|
|
24
18
|
defaultMessage: string;
|
|
25
19
|
description: string;
|
|
26
|
-
};
|
|
27
|
-
threeColumnsAdvancedLayout: {
|
|
28
20
|
id: string;
|
|
21
|
+
};
|
|
22
|
+
floatingToolbarRadioGroupAriaLabel: {
|
|
29
23
|
defaultMessage: string;
|
|
30
24
|
description: string;
|
|
25
|
+
id: string;
|
|
31
26
|
};
|
|
32
27
|
fourColumns: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
33
30
|
id: string;
|
|
31
|
+
};
|
|
32
|
+
layoutPlaceholder: {
|
|
34
33
|
defaultMessage: string;
|
|
35
34
|
description: string;
|
|
35
|
+
id: string;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
leftSidebar: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
38
40
|
id: string;
|
|
41
|
+
};
|
|
42
|
+
resizeLayout: {
|
|
39
43
|
defaultMessage: string;
|
|
40
44
|
description: string;
|
|
45
|
+
id: string;
|
|
41
46
|
};
|
|
42
47
|
rightSidebar: {
|
|
43
|
-
id: string;
|
|
44
48
|
defaultMessage: string;
|
|
45
49
|
description: string;
|
|
46
|
-
};
|
|
47
|
-
leftSidebar: {
|
|
48
50
|
id: string;
|
|
51
|
+
};
|
|
52
|
+
singleColumn: {
|
|
49
53
|
defaultMessage: string;
|
|
50
54
|
description: string;
|
|
51
|
-
};
|
|
52
|
-
threeColumnsWithSidebars: {
|
|
53
55
|
id: string;
|
|
56
|
+
};
|
|
57
|
+
singleColumnAdvancedLayout: {
|
|
54
58
|
defaultMessage: string;
|
|
55
59
|
description: string;
|
|
56
|
-
};
|
|
57
|
-
threeColumnsWithLeftSidebars: {
|
|
58
60
|
id: string;
|
|
61
|
+
};
|
|
62
|
+
threeColumns: {
|
|
59
63
|
defaultMessage: string;
|
|
60
64
|
description: string;
|
|
61
|
-
};
|
|
62
|
-
threeColumnsWithRightSidebars: {
|
|
63
65
|
id: string;
|
|
66
|
+
};
|
|
67
|
+
threeColumnsAdvancedLayout: {
|
|
64
68
|
defaultMessage: string;
|
|
65
69
|
description: string;
|
|
66
|
-
};
|
|
67
|
-
floatingToolbarRadioGroupAriaLabel: {
|
|
68
70
|
id: string;
|
|
71
|
+
};
|
|
72
|
+
threeColumnsWithLeftSidebars: {
|
|
69
73
|
defaultMessage: string;
|
|
70
74
|
description: string;
|
|
71
|
-
};
|
|
72
|
-
layoutPlaceholder: {
|
|
73
75
|
id: string;
|
|
76
|
+
};
|
|
77
|
+
threeColumnsWithRightSidebars: {
|
|
74
78
|
defaultMessage: string;
|
|
75
79
|
description: string;
|
|
76
|
-
};
|
|
77
|
-
controlslayoutPlaceholder: {
|
|
78
80
|
id: string;
|
|
81
|
+
};
|
|
82
|
+
threeColumnsWithSidebars: {
|
|
79
83
|
defaultMessage: string;
|
|
80
84
|
description: string;
|
|
81
|
-
};
|
|
82
|
-
columnOption: {
|
|
83
85
|
id: string;
|
|
86
|
+
};
|
|
87
|
+
twoColumns: {
|
|
84
88
|
defaultMessage: string;
|
|
85
89
|
description: string;
|
|
86
|
-
};
|
|
87
|
-
resizeLayout: {
|
|
88
90
|
id: string;
|
|
91
|
+
};
|
|
92
|
+
twoColumnsAdvancedLayout: {
|
|
89
93
|
defaultMessage: string;
|
|
90
94
|
description: string;
|
|
95
|
+
id: string;
|
|
91
96
|
};
|
|
92
97
|
};
|
|
@@ -2,7 +2,7 @@ export type { CardOptions, OnClickCallback } from './cardOptions';
|
|
|
2
2
|
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata } from './utils';
|
|
3
3
|
export { default as buildLayoutButtons, alignmentIcons, wrappingIcons, layoutToMessages, buildLayoutDropdown, } from './MediaAndEmbedsToolbar';
|
|
4
4
|
export type { IconMap, LayoutIcon } from './MediaAndEmbedsToolbar';
|
|
5
|
-
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, } from './types';
|
|
5
|
+
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, QueueCardsFromRangeAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, } from './types';
|
|
6
6
|
export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
7
7
|
export { appearancePropsMap, getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
8
8
|
export { getDropdownOption } from './link-toolbar-dropdown-options';
|
|
@@ -18,6 +18,12 @@ export interface OptionConfig {
|
|
|
18
18
|
}
|
|
19
19
|
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
20
20
|
export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
21
|
+
/**
|
|
22
|
+
* Like {@link QueueCardsFromTransactionAction} but scoped to an explicit
|
|
23
|
+
* document range (`from`..`to`) instead of the entire step range of the
|
|
24
|
+
* transaction. Use this when only newly-inserted content should be resolved.
|
|
25
|
+
*/
|
|
26
|
+
export type QueueCardsFromRangeAction = (state: EditorState, tr: Transaction, from: number, to: number, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
21
27
|
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
22
28
|
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
23
29
|
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -74,6 +80,21 @@ export interface EmbedCardTransformers {
|
|
|
74
80
|
embedCardNodeTransformer: EmbedCardNodeTransformer;
|
|
75
81
|
}
|
|
76
82
|
export type CardPluginActions = {
|
|
83
|
+
getEndingToolbarItems: GetEndingToolbarItems;
|
|
84
|
+
getStartingToolbarItems: GetStartingToolbarItems;
|
|
85
|
+
hideLinkToolbar: HideLinkToolbarAction;
|
|
86
|
+
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
87
|
+
/**
|
|
88
|
+
* Like `queueCardsFromChangedTr` but scoped to an explicit document range.
|
|
89
|
+
* Use when only newly-inserted content should be resolved, to avoid
|
|
90
|
+
* accidentally converting pre-existing links in the surrounding document.
|
|
91
|
+
*
|
|
92
|
+
* Optional for backward compatibility — older versions of the card plugin
|
|
93
|
+
* may not expose this action. Callers should fall back to
|
|
94
|
+
* `queueCardsFromChangedTr` when unavailable.
|
|
95
|
+
*/
|
|
96
|
+
queueCardsFromRange?: QueueCardsFromRangeAction;
|
|
97
|
+
registerEmbedCardTransformer: (transformers: EmbedCardTransformers) => void;
|
|
77
98
|
/**
|
|
78
99
|
* Resolves a URL via the Object Resolver Service and returns the canonical
|
|
79
100
|
* expanded URL. Useful for expanding Confluence short-link URLs
|
|
@@ -83,10 +104,5 @@ export type CardPluginActions = {
|
|
|
83
104
|
* usable URL in its response data.
|
|
84
105
|
*/
|
|
85
106
|
resolveShortLinkUrl: (url: string) => Promise<string | undefined>;
|
|
86
|
-
getEndingToolbarItems: GetEndingToolbarItems;
|
|
87
|
-
getStartingToolbarItems: GetStartingToolbarItems;
|
|
88
|
-
hideLinkToolbar: HideLinkToolbarAction;
|
|
89
|
-
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
90
|
-
registerEmbedCardTransformer: (transformers: EmbedCardTransformers) => void;
|
|
91
107
|
setProvider: (provider: Promise<CardProvider>) => Promise<boolean>;
|
|
92
108
|
};
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import type { IntlShape } from 'react-intl';
|
|
8
9
|
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
9
10
|
type Props = {
|
|
10
11
|
children: React.ReactNode;
|
|
12
|
+
intl: IntlShape | undefined;
|
|
11
13
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
12
14
|
nodeType: string;
|
|
13
15
|
};
|
|
@@ -19,5 +21,5 @@ type Props = {
|
|
|
19
21
|
* @param param0
|
|
20
22
|
* @returns
|
|
21
23
|
*/
|
|
22
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
24
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, intl, }: Props) => jsx.JSX.Element;
|
|
23
25
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type IntlShape } from 'react-intl';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
intl: IntlShape | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function ExtensionSSRReactContextsProvider({ children, intl }: Props): ReactNode;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl';
|
|
2
3
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -17,6 +18,7 @@ interface ExtensionNodeViewOptions {
|
|
|
17
18
|
interface ReactExtensionNodeProps {
|
|
18
19
|
extensionHandlers: ExtensionHandlers;
|
|
19
20
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
21
|
+
intl?: IntlShape;
|
|
20
22
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
21
23
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
22
24
|
providerFactory: ProviderFactory;
|
|
@@ -71,6 +73,7 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
71
73
|
render(props: {
|
|
72
74
|
extensionHandlers: ExtensionHandlers;
|
|
73
75
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
76
|
+
intl?: IntlShape;
|
|
74
77
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
75
78
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
76
79
|
providerFactory: ProviderFactory;
|
|
@@ -79,5 +82,5 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
79
82
|
showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean;
|
|
80
83
|
}, forwardRef: ForwardRef): React.JSX.Element;
|
|
81
84
|
}
|
|
82
|
-
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
85
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers, intl?: IntlShape): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
83
86
|
export {};
|