@atlaskit/editor-common 74.13.0 → 74.14.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 +6 -0
- package/dist/cjs/card/LinkToolbarButtonGroup.js +63 -0
- package/dist/cjs/card/index.js +18 -1
- package/dist/cjs/card/link-toolbar-button-group-options.js +52 -0
- package/dist/cjs/card/types.js +5 -0
- package/dist/cjs/card/ui/assets/card.js +30 -0
- package/dist/cjs/card/ui/assets/embed.js +30 -0
- package/dist/cjs/card/ui/assets/inline.js +30 -0
- package/dist/cjs/card/ui/assets/url.js +32 -0
- package/dist/cjs/messages/card.js +90 -0
- package/dist/cjs/messages/index.js +7 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/index.js +39 -1
- package/dist/cjs/styles/shared/embedCard.js +16 -0
- package/dist/cjs/styles/shared/smartCard.js +19 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/LinkToolbarButtonGroup.js +61 -0
- package/dist/es2019/card/index.js +4 -1
- package/dist/es2019/card/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/card/types.js +1 -0
- package/dist/es2019/card/ui/assets/card.js +22 -0
- package/dist/es2019/card/ui/assets/embed.js +22 -0
- package/dist/es2019/card/ui/assets/inline.js +22 -0
- package/dist/es2019/card/ui/assets/url.js +24 -0
- package/dist/es2019/messages/card.js +83 -0
- package/dist/es2019/messages/index.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/index.js +3 -1
- package/dist/es2019/styles/shared/embedCard.js +27 -0
- package/dist/es2019/styles/shared/smartCard.js +131 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/LinkToolbarButtonGroup.js +56 -0
- package/dist/esm/card/index.js +4 -1
- package/dist/esm/card/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/card/types.js +1 -0
- package/dist/esm/card/ui/assets/card.js +22 -0
- package/dist/esm/card/ui/assets/embed.js +22 -0
- package/dist/esm/card/ui/assets/inline.js +22 -0
- package/dist/esm/card/ui/assets/url.js +24 -0
- package/dist/esm/messages/card.js +83 -0
- package/dist/esm/messages/index.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/index.js +3 -1
- package/dist/esm/styles/shared/embedCard.js +6 -0
- package/dist/esm/styles/shared/smartCard.js +9 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/LinkToolbarButtonGroup.d.ts +16 -0
- package/dist/types/card/index.d.ts +4 -0
- package/dist/types/card/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/card/types.d.ts +27 -0
- package/dist/types/card/ui/assets/card.d.ts +3 -0
- package/dist/types/card/ui/assets/embed.d.ts +3 -0
- package/dist/types/card/ui/assets/inline.d.ts +3 -0
- package/dist/types/card/ui/assets/url.d.ts +3 -0
- package/dist/types/messages/card.d.ts +82 -0
- package/dist/types/messages/index.d.ts +1 -0
- package/dist/types/styles/index.d.ts +2 -0
- package/dist/types/styles/shared/embedCard.d.ts +3 -0
- package/dist/types/styles/shared/smartCard.d.ts +3 -0
- package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +16 -0
- package/dist/types-ts4.5/card/index.d.ts +4 -0
- package/dist/types-ts4.5/card/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types-ts4.5/card/types.d.ts +27 -0
- package/dist/types-ts4.5/card/ui/assets/card.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/assets/embed.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/assets/inline.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/assets/url.d.ts +3 -0
- package/dist/types-ts4.5/messages/card.d.ts +82 -0
- package/dist/types-ts4.5/messages/index.d.ts +1 -0
- package/dist/types-ts4.5/styles/index.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/embedCard.d.ts +3 -0
- package/dist/types-ts4.5/styles/shared/smartCard.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var messages = defineMessages({
|
|
3
|
+
url: {
|
|
4
|
+
id: 'fabric.editor.url',
|
|
5
|
+
defaultMessage: 'Display URL',
|
|
6
|
+
description: 'Convert the card to become a regular text-based hyperlink.'
|
|
7
|
+
},
|
|
8
|
+
block: {
|
|
9
|
+
id: 'fabric.editor.displayBlock',
|
|
10
|
+
defaultMessage: 'Display card',
|
|
11
|
+
description: 'Display link as a card with a rich preview similar to in a Facebook feed with page title, description, and potentially an image.'
|
|
12
|
+
},
|
|
13
|
+
inline: {
|
|
14
|
+
id: 'fabric.editor.displayInline',
|
|
15
|
+
defaultMessage: 'Display inline',
|
|
16
|
+
description: 'Display link with the title only.'
|
|
17
|
+
},
|
|
18
|
+
embed: {
|
|
19
|
+
id: 'fabric.editor.displayEmbed',
|
|
20
|
+
defaultMessage: 'Display embed',
|
|
21
|
+
description: 'Display link as an embedded object'
|
|
22
|
+
},
|
|
23
|
+
link: {
|
|
24
|
+
id: 'fabric.editor.displayLink',
|
|
25
|
+
defaultMessage: 'Display as text',
|
|
26
|
+
description: 'Convert the card to become a regular text-based hyperlink.'
|
|
27
|
+
},
|
|
28
|
+
card: {
|
|
29
|
+
id: 'fabric.editor.cardFloatingControls',
|
|
30
|
+
defaultMessage: 'Card options',
|
|
31
|
+
description: 'Options to change card type'
|
|
32
|
+
},
|
|
33
|
+
blockCardUnavailable: {
|
|
34
|
+
id: 'fabric.editor.blockCardUnavailable',
|
|
35
|
+
defaultMessage: 'The inline link is inside {node} and cannot have its view changed',
|
|
36
|
+
description: 'Warning message to show the user that this node cannot change its view'
|
|
37
|
+
},
|
|
38
|
+
displayOptionUnavailableInParentNode: {
|
|
39
|
+
id: 'fabric.editor.displayOptionUnavailableInParentNode',
|
|
40
|
+
defaultMessage: "This display option isn't available inside {node}",
|
|
41
|
+
description: 'Warning message to show the user that this node option is not available inside a parent node type'
|
|
42
|
+
},
|
|
43
|
+
urlTitle: {
|
|
44
|
+
id: 'fabric.editor.urlTitle',
|
|
45
|
+
defaultMessage: 'URL',
|
|
46
|
+
description: 'Title for option to convert the card to become a regular text-based hyperlink.'
|
|
47
|
+
},
|
|
48
|
+
blockTitle: {
|
|
49
|
+
id: 'fabric.editor.blockTitle',
|
|
50
|
+
defaultMessage: 'Card',
|
|
51
|
+
description: 'Title for option to display link in the card view.'
|
|
52
|
+
},
|
|
53
|
+
inlineTitle: {
|
|
54
|
+
id: 'fabric.editor.inlineTitle',
|
|
55
|
+
defaultMessage: 'Inline',
|
|
56
|
+
description: 'Title for option to display link in the inline view.'
|
|
57
|
+
},
|
|
58
|
+
embedTitle: {
|
|
59
|
+
id: 'fabric.editor.embedTitle',
|
|
60
|
+
defaultMessage: 'Embed',
|
|
61
|
+
description: 'Title for option to display link as an embedded object.'
|
|
62
|
+
},
|
|
63
|
+
urlDescription: {
|
|
64
|
+
id: 'fabric.editor.urlDescription',
|
|
65
|
+
defaultMessage: 'Display link as URL',
|
|
66
|
+
description: 'Description for option to convert the card to become a regular text-based hyperlink.'
|
|
67
|
+
},
|
|
68
|
+
blockDescription: {
|
|
69
|
+
id: 'fabric.editor.blockDescription',
|
|
70
|
+
defaultMessage: 'Display more information about a link, including a summary and actions',
|
|
71
|
+
description: 'Description for option to display link in the card view.'
|
|
72
|
+
},
|
|
73
|
+
inlineDescription: {
|
|
74
|
+
id: 'fabric.editor.inlineDescription',
|
|
75
|
+
defaultMessage: 'Display link as inline text',
|
|
76
|
+
description: 'Description for option to display link in the inline view.'
|
|
77
|
+
},
|
|
78
|
+
embedDescription: {
|
|
79
|
+
id: 'fabric.editor.ecombedDescription',
|
|
80
|
+
defaultMessage: 'Display an interactive preview of a link',
|
|
81
|
+
description: 'Description for option to display link as an embedded object.'
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -6,6 +6,7 @@ export { unsupportedContentMessages } from './unsupportedContent';
|
|
|
6
6
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
7
7
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
8
8
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
9
|
+
export { messages as cardMessages } from './card';
|
|
9
10
|
export default defineMessages({
|
|
10
11
|
layoutFixedWidth: {
|
|
11
12
|
id: 'fabric.editor.layoutFixedWidth',
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "74.
|
|
9
|
+
var packageVersion = "74.14.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -23,4 +23,6 @@ export { CodeBlockSharedCssClassName, codeBlockSharedStyles, codeBlockInListSafa
|
|
|
23
23
|
export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
|
|
24
24
|
export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
|
|
25
25
|
export { resizerStyles } from './shared/resizer';
|
|
26
|
-
export { gridStyles, GRID_GUTTER } from './shared/grid';
|
|
26
|
+
export { gridStyles, GRID_GUTTER } from './shared/grid';
|
|
27
|
+
export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME } from './shared/smartCard';
|
|
28
|
+
export { embedCardStyles, embedSpacingStyles, editIconStyles } from './shared/embedCard';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
export var embedCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n .embedCardView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n }\n\n .embedCardView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .embedCardView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .embedCardView-content-wrap[layout='wrap-right']\n + .embedCardView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n }\n"])));
|
|
5
|
+
export var embedSpacingStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0 10px;\n"])));
|
|
6
|
+
export var editIconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 20px;\n"])));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { N0, N20, N40 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { SmartCardSharedCssClassName } from './smart-card';
|
|
7
|
+
export var DATASOURCE_INNER_CONTAINER_CLASSNAME = 'datasourceView-content-inner-wrap';
|
|
8
|
+
export var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
|
|
9
|
+
export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n margin-bottom: -0.5em;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", ".", " {\n max-width: 100%;\n display: flex;\n justify-content: center;\n\n .", " {\n cursor: pointer;\n background-color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n }\n\n &.", " {\n .", " {\n ", "\n }\n }\n\n &.danger {\n .", " {\n box-shadow: 0 0 0 1px\n ", ";\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n\n .", " {\n padding: 0;\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.DATASOURCE_CONTAINER, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(N0, ")"), "var(--ds-border-radius-100, ".concat(akEditorRuleBorderRadius, ")"), "var(--ds-border, ".concat(N40, ")"), akEditorSelectedNodeClassName, DATASOURCE_INNER_CONTAINER_CLASSNAME, getSelectionStyles([SelectionStyle.BoxShadow]), DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.
|
|
21
|
+
var packageVersion = "74.14.0";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
4
|
+
export interface ButtonOptionProps {
|
|
5
|
+
title: string;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
testId: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
tooltipContent?: string | null;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
icon: (props: GlyphProps) => JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export interface LinkToolbarButtonGroupProps {
|
|
14
|
+
options: ButtonOptionProps[];
|
|
15
|
+
}
|
|
16
|
+
export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export type { CardOptions } from './cardOptions';
|
|
2
2
|
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata, } from './utils';
|
|
3
3
|
export { default as buildLayoutButtons } from './MediaAndEmbedsToolbar';
|
|
4
|
+
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, } from './types';
|
|
5
|
+
export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
6
|
+
export { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
7
|
+
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { Command } from '../types';
|
|
3
|
+
import type { ButtonOptionProps } from './LinkToolbarButtonGroup';
|
|
4
|
+
import type { OptionConfig } from './types';
|
|
5
|
+
export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Node } from 'prosemirror-model';
|
|
2
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
3
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { ACTION, EditorAnalyticsAPI, INPUT_METHOD } from '../analytics';
|
|
5
|
+
import type { CardAppearance } from '../provider-factory';
|
|
6
|
+
import type { Command } from '../types';
|
|
7
|
+
export interface OptionConfig {
|
|
8
|
+
appearance?: CardAppearance;
|
|
9
|
+
title: string;
|
|
10
|
+
onClick: Command;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
testId: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
18
|
+
export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
|
|
19
|
+
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
20
|
+
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
21
|
+
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
22
|
+
export type CardPluginActions = {
|
|
23
|
+
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
24
|
+
hideLinkToolbar: HideLinkToolbarAction;
|
|
25
|
+
changeSelectedCardToLink: ChangeSelectedCardToLink;
|
|
26
|
+
setSelectedCardAppearance: SetSelectedCardAppearance;
|
|
27
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
url: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
block: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
inline: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
embed: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
link: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
card: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
blockCardUnavailable: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
displayOptionUnavailableInParentNode: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
urlTitle: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
blockTitle: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
inlineTitle: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
embedTitle: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
urlDescription: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
blockDescription: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
inlineDescription: {
|
|
73
|
+
id: string;
|
|
74
|
+
defaultMessage: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
embedDescription: {
|
|
78
|
+
id: string;
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -5,6 +5,7 @@ export { unsupportedContentMessages } from './unsupportedContent';
|
|
|
5
5
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
6
6
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
7
7
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
8
|
+
export { messages as cardMessages } from './card';
|
|
8
9
|
declare const _default: {
|
|
9
10
|
layoutFixedWidth: {
|
|
10
11
|
id: string;
|
|
@@ -24,3 +24,5 @@ export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
|
|
|
24
24
|
export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
|
|
25
25
|
export { resizerStyles } from './shared/resizer';
|
|
26
26
|
export { gridStyles, GRID_GUTTER } from './shared/grid';
|
|
27
|
+
export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME, } from './shared/smartCard';
|
|
28
|
+
export { embedCardStyles, embedSpacingStyles, editIconStyles, } from './shared/embedCard';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
2
|
+
export declare const FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = "card-floating-toolbar--link-picker";
|
|
3
|
+
export declare const smartCardStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
4
|
+
export interface ButtonOptionProps {
|
|
5
|
+
title: string;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
testId: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
tooltipContent?: string | null;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
icon: (props: GlyphProps) => JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export interface LinkToolbarButtonGroupProps {
|
|
14
|
+
options: ButtonOptionProps[];
|
|
15
|
+
}
|
|
16
|
+
export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export type { CardOptions } from './cardOptions';
|
|
2
2
|
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata, } from './utils';
|
|
3
3
|
export { default as buildLayoutButtons } from './MediaAndEmbedsToolbar';
|
|
4
|
+
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, } from './types';
|
|
5
|
+
export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
6
|
+
export { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
7
|
+
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { Command } from '../types';
|
|
3
|
+
import type { ButtonOptionProps } from './LinkToolbarButtonGroup';
|
|
4
|
+
import type { OptionConfig } from './types';
|
|
5
|
+
export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Node } from 'prosemirror-model';
|
|
2
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
3
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { ACTION, EditorAnalyticsAPI, INPUT_METHOD } from '../analytics';
|
|
5
|
+
import type { CardAppearance } from '../provider-factory';
|
|
6
|
+
import type { Command } from '../types';
|
|
7
|
+
export interface OptionConfig {
|
|
8
|
+
appearance?: CardAppearance;
|
|
9
|
+
title: string;
|
|
10
|
+
onClick: Command;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
testId: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
18
|
+
export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
|
|
19
|
+
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
20
|
+
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
21
|
+
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
22
|
+
export type CardPluginActions = {
|
|
23
|
+
queueCardsFromChangedTr: QueueCardsFromTransactionAction;
|
|
24
|
+
hideLinkToolbar: HideLinkToolbarAction;
|
|
25
|
+
changeSelectedCardToLink: ChangeSelectedCardToLink;
|
|
26
|
+
setSelectedCardAppearance: SetSelectedCardAppearance;
|
|
27
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
url: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
block: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
inline: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
embed: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
link: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
card: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
blockCardUnavailable: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
displayOptionUnavailableInParentNode: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
urlTitle: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
blockTitle: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
inlineTitle: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
embedTitle: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
urlDescription: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
blockDescription: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
inlineDescription: {
|
|
73
|
+
id: string;
|
|
74
|
+
defaultMessage: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
embedDescription: {
|
|
78
|
+
id: string;
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -5,6 +5,7 @@ export { unsupportedContentMessages } from './unsupportedContent';
|
|
|
5
5
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
6
6
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
7
7
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
8
|
+
export { messages as cardMessages } from './card';
|
|
8
9
|
declare const _default: {
|
|
9
10
|
layoutFixedWidth: {
|
|
10
11
|
id: string;
|
|
@@ -24,3 +24,5 @@ export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
|
|
|
24
24
|
export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
|
|
25
25
|
export { resizerStyles } from './shared/resizer';
|
|
26
26
|
export { gridStyles, GRID_GUTTER } from './shared/grid';
|
|
27
|
+
export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME, } from './shared/smartCard';
|
|
28
|
+
export { embedCardStyles, embedSpacingStyles, editIconStyles, } from './shared/embedCard';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
2
|
+
export declare const FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = "card-floating-toolbar--link-picker";
|
|
3
|
+
export declare const smartCardStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.14.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
|
-
"@atlaskit/editor-core": "^185.
|
|
140
|
+
"@atlaskit/editor-core": "^185.7.0",
|
|
141
141
|
"@atlaskit/editor-json-transformer": "^8.9.0",
|
|
142
142
|
"@atlaskit/editor-plugin-analytics": "^0.0.3",
|
|
143
143
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.3",
|