@atlaskit/editor-common 74.12.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +1 -1
  3. package/dist/cjs/card/LinkToolbarButtonGroup.js +63 -0
  4. package/dist/cjs/card/index.js +18 -1
  5. package/dist/cjs/card/link-toolbar-button-group-options.js +52 -0
  6. package/dist/cjs/card/types.js +5 -0
  7. package/dist/cjs/card/ui/assets/card.js +30 -0
  8. package/dist/cjs/card/ui/assets/embed.js +30 -0
  9. package/dist/cjs/card/ui/assets/inline.js +30 -0
  10. package/dist/cjs/card/ui/assets/url.js +32 -0
  11. package/dist/cjs/messages/card.js +90 -0
  12. package/dist/cjs/messages/index.js +7 -0
  13. package/dist/cjs/monitoring/error.js +1 -1
  14. package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +0 -1
  15. package/dist/cjs/react-node-view/index.js +0 -1
  16. package/dist/cjs/styles/index.js +39 -1
  17. package/dist/cjs/styles/shared/embedCard.js +16 -0
  18. package/dist/cjs/styles/shared/smartCard.js +19 -0
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/cjs/utils/get-performance-options.js +1 -4
  21. package/dist/cjs/version.json +1 -1
  22. package/dist/cjs/with-plugin-state/index.js +1 -4
  23. package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +1 -0
  24. package/dist/es2019/card/LinkToolbarButtonGroup.js +61 -0
  25. package/dist/es2019/card/index.js +4 -1
  26. package/dist/es2019/card/link-toolbar-button-group-options.js +45 -0
  27. package/dist/es2019/card/types.js +1 -0
  28. package/dist/es2019/card/ui/assets/card.js +22 -0
  29. package/dist/es2019/card/ui/assets/embed.js +22 -0
  30. package/dist/es2019/card/ui/assets/inline.js +22 -0
  31. package/dist/es2019/card/ui/assets/url.js +24 -0
  32. package/dist/es2019/messages/card.js +83 -0
  33. package/dist/es2019/messages/index.js +1 -0
  34. package/dist/es2019/monitoring/error.js +1 -1
  35. package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +0 -1
  36. package/dist/es2019/react-node-view/index.js +0 -1
  37. package/dist/es2019/styles/index.js +3 -1
  38. package/dist/es2019/styles/shared/embedCard.js +27 -0
  39. package/dist/es2019/styles/shared/smartCard.js +131 -0
  40. package/dist/es2019/ui/DropList/index.js +1 -1
  41. package/dist/es2019/utils/get-performance-options.js +1 -4
  42. package/dist/es2019/version.json +1 -1
  43. package/dist/es2019/with-plugin-state/index.js +1 -4
  44. package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +1 -0
  45. package/dist/esm/card/LinkToolbarButtonGroup.js +56 -0
  46. package/dist/esm/card/index.js +4 -1
  47. package/dist/esm/card/link-toolbar-button-group-options.js +45 -0
  48. package/dist/esm/card/types.js +1 -0
  49. package/dist/esm/card/ui/assets/card.js +22 -0
  50. package/dist/esm/card/ui/assets/embed.js +22 -0
  51. package/dist/esm/card/ui/assets/inline.js +22 -0
  52. package/dist/esm/card/ui/assets/url.js +24 -0
  53. package/dist/esm/messages/card.js +83 -0
  54. package/dist/esm/messages/index.js +1 -0
  55. package/dist/esm/monitoring/error.js +1 -1
  56. package/dist/esm/react-node-view/getInlineNodeViewProducer.js +0 -1
  57. package/dist/esm/react-node-view/index.js +0 -1
  58. package/dist/esm/styles/index.js +3 -1
  59. package/dist/esm/styles/shared/embedCard.js +6 -0
  60. package/dist/esm/styles/shared/smartCard.js +9 -0
  61. package/dist/esm/ui/DropList/index.js +1 -1
  62. package/dist/esm/utils/get-performance-options.js +1 -4
  63. package/dist/esm/version.json +1 -1
  64. package/dist/esm/with-plugin-state/index.js +1 -4
  65. package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +1 -1
  66. package/dist/types/analytics/types/general-events.d.ts +0 -2
  67. package/dist/types/card/LinkToolbarButtonGroup.d.ts +16 -0
  68. package/dist/types/card/index.d.ts +4 -0
  69. package/dist/types/card/link-toolbar-button-group-options.d.ts +5 -0
  70. package/dist/types/card/types.d.ts +27 -0
  71. package/dist/types/card/ui/assets/card.d.ts +3 -0
  72. package/dist/types/card/ui/assets/embed.d.ts +3 -0
  73. package/dist/types/card/ui/assets/inline.d.ts +3 -0
  74. package/dist/types/card/ui/assets/url.d.ts +3 -0
  75. package/dist/types/messages/card.d.ts +82 -0
  76. package/dist/types/messages/index.d.ts +1 -0
  77. package/dist/types/provider-factory/card-provider.d.ts +1 -1
  78. package/dist/types/styles/index.d.ts +2 -0
  79. package/dist/types/styles/shared/embedCard.d.ts +3 -0
  80. package/dist/types/styles/shared/smartCard.d.ts +3 -0
  81. package/dist/types/utils/get-performance-options.d.ts +1 -3
  82. package/dist/types-ts4.5/__tests_external__/page-objects/EditorSmartLink.d.ts +1 -1
  83. package/dist/types-ts4.5/analytics/types/general-events.d.ts +0 -2
  84. package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +16 -0
  85. package/dist/types-ts4.5/card/index.d.ts +4 -0
  86. package/dist/types-ts4.5/card/link-toolbar-button-group-options.d.ts +5 -0
  87. package/dist/types-ts4.5/card/types.d.ts +27 -0
  88. package/dist/types-ts4.5/card/ui/assets/card.d.ts +3 -0
  89. package/dist/types-ts4.5/card/ui/assets/embed.d.ts +3 -0
  90. package/dist/types-ts4.5/card/ui/assets/inline.d.ts +3 -0
  91. package/dist/types-ts4.5/card/ui/assets/url.d.ts +3 -0
  92. package/dist/types-ts4.5/messages/card.d.ts +82 -0
  93. package/dist/types-ts4.5/messages/index.d.ts +1 -0
  94. package/dist/types-ts4.5/provider-factory/card-provider.d.ts +1 -1
  95. package/dist/types-ts4.5/styles/index.d.ts +2 -0
  96. package/dist/types-ts4.5/styles/shared/embedCard.d.ts +3 -0
  97. package/dist/types-ts4.5/styles/shared/smartCard.d.ts +3 -0
  98. package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -3
  99. package/package.json +6 -6
  100. package/dist/cjs/utils/collab.js +0 -18
  101. package/dist/es2019/utils/collab.js +0 -11
  102. package/dist/esm/utils/collab.js +0 -11
  103. package/dist/types/utils/collab.d.ts +0 -2
  104. package/dist/types-ts4.5/utils/collab.d.ts +0 -2
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconCard: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconEmbed: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconInline: (props: GlyphProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ export declare const IconUrl: (props: GlyphProps) => JSX.Element;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { CardAdf, DatasourceAdf } from '@atlaskit/smart-card';
1
+ import type { CardAdf, DatasourceAdf } from '@atlaskit/smart-card';
2
2
  export type CardAppearance = 'inline' | 'block' | 'embed';
3
3
  export type { CardAdf, DatasourceAdf };
4
4
  export interface CardProvider {
@@ -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 embedCardStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const embedSpacingStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const editIconStyles: import("@emotion/react").SerializedStyles;
@@ -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;
@@ -1,4 +1,3 @@
1
- import type { EditorState } from 'prosemirror-state';
2
1
  import type { EditorView } from 'prosemirror-view';
3
2
  import { AnalyticsEventPayload } from '../analytics';
4
3
  export declare function getPerformanceOptions(view: EditorView): {
@@ -9,10 +8,9 @@ export declare function getPerformanceOptions(view: EditorView): {
9
8
  export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
10
9
  nodeTypeName: string;
11
10
  }): void;
12
- export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, editorState, samplingRate, slowThreshold, }: {
11
+ export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, samplingRate, slowThreshold, }: {
13
12
  nodeTypeName: string;
14
13
  dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
15
- editorState: EditorState;
16
14
  samplingRate: number;
17
15
  slowThreshold: number;
18
16
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.12.0",
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/"
@@ -82,7 +82,7 @@
82
82
  "@atlaskit/button": "^16.8.0",
83
83
  "@atlaskit/code": "^14.6.0",
84
84
  "@atlaskit/codemod-utils": "^4.2.0",
85
- "@atlaskit/collab-provider": "^9.4.0",
85
+ "@atlaskit/collab-provider": "^9.5.0",
86
86
  "@atlaskit/editor-palette": "1.5.1",
87
87
  "@atlaskit/editor-shared-styles": "^2.4.0",
88
88
  "@atlaskit/emoji": "^67.4.0",
@@ -95,11 +95,10 @@
95
95
  "@atlaskit/menu": "^1.9.0",
96
96
  "@atlaskit/platform-feature-flags": "^0.2.0",
97
97
  "@atlaskit/profilecard": "^19.5.0",
98
- "@atlaskit/smart-card": "^26.8.0",
99
98
  "@atlaskit/smart-user-picker": "^6.1.0",
100
99
  "@atlaskit/task-decision": "^17.6.0",
101
100
  "@atlaskit/theme": "^12.5.0",
102
- "@atlaskit/tokens": "^1.10.0",
101
+ "@atlaskit/tokens": "^1.11.0",
103
102
  "@atlaskit/tooltip": "^17.8.0",
104
103
  "@atlaskit/ufo": "^0.2.0",
105
104
  "@atlaskit/width-detector": "^4.1.0",
@@ -138,18 +137,19 @@
138
137
  "react-intl-next": "npm:react-intl@^5.18.1"
139
138
  },
140
139
  "devDependencies": {
141
- "@atlaskit/editor-core": "^185.6.0",
140
+ "@atlaskit/editor-core": "^185.7.0",
142
141
  "@atlaskit/editor-json-transformer": "^8.9.0",
143
142
  "@atlaskit/editor-plugin-analytics": "^0.0.3",
144
143
  "@atlaskit/editor-plugin-content-insertion": "^0.0.3",
145
144
  "@atlaskit/editor-plugin-decorations": "^0.1.0",
146
145
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
147
146
  "@atlaskit/editor-plugin-grid": "^0.1.0",
148
- "@atlaskit/editor-plugin-table": "^1.6.0",
147
+ "@atlaskit/editor-plugin-table": "^1.7.0",
149
148
  "@atlaskit/editor-plugin-width": "^0.1.0",
150
149
  "@atlaskit/editor-test-helpers": "^18.7.0",
151
150
  "@atlaskit/media-core": "^34.1.0",
152
151
  "@atlaskit/media-test-helpers": "^33.0.0",
152
+ "@atlaskit/smart-card": "^26.8.0",
153
153
  "@atlaskit/util-data-test": "^17.8.0",
154
154
  "@atlaskit/visual-regression": "*",
155
155
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getParticipantsCount = void 0;
7
- var getParticipantsCount = function getParticipantsCount(editorState) {
8
- var _collabEditPlugin$$pa, _collabEditPlugin$$pa2;
9
- // TODO: ED-15663
10
- // Please, do not copy or use this kind of code below
11
- // @ts-ignore
12
- if (!editorState || !editorState['collabEditPlugin$']) {
13
- return 1;
14
- }
15
- var participantsCount = (_collabEditPlugin$$pa = (_collabEditPlugin$$pa2 = editorState['collabEditPlugin$'].participants) === null || _collabEditPlugin$$pa2 === void 0 ? void 0 : _collabEditPlugin$$pa2.size()) !== null && _collabEditPlugin$$pa !== void 0 ? _collabEditPlugin$$pa : 1;
16
- return participantsCount;
17
- };
18
- exports.getParticipantsCount = getParticipantsCount;
@@ -1,11 +0,0 @@
1
- export const getParticipantsCount = editorState => {
2
- var _collabEditPlugin$$pa, _collabEditPlugin$$pa2;
3
- // TODO: ED-15663
4
- // Please, do not copy or use this kind of code below
5
- // @ts-ignore
6
- if (!editorState || !editorState['collabEditPlugin$']) {
7
- return 1;
8
- }
9
- const participantsCount = (_collabEditPlugin$$pa = (_collabEditPlugin$$pa2 = editorState['collabEditPlugin$'].participants) === null || _collabEditPlugin$$pa2 === void 0 ? void 0 : _collabEditPlugin$$pa2.size()) !== null && _collabEditPlugin$$pa !== void 0 ? _collabEditPlugin$$pa : 1;
10
- return participantsCount;
11
- };
@@ -1,11 +0,0 @@
1
- export var getParticipantsCount = function getParticipantsCount(editorState) {
2
- var _collabEditPlugin$$pa, _collabEditPlugin$$pa2;
3
- // TODO: ED-15663
4
- // Please, do not copy or use this kind of code below
5
- // @ts-ignore
6
- if (!editorState || !editorState['collabEditPlugin$']) {
7
- return 1;
8
- }
9
- var participantsCount = (_collabEditPlugin$$pa = (_collabEditPlugin$$pa2 = editorState['collabEditPlugin$'].participants) === null || _collabEditPlugin$$pa2 === void 0 ? void 0 : _collabEditPlugin$$pa2.size()) !== null && _collabEditPlugin$$pa !== void 0 ? _collabEditPlugin$$pa : 1;
10
- return participantsCount;
11
- };
@@ -1,2 +0,0 @@
1
- import type { EditorState } from 'prosemirror-state';
2
- export declare const getParticipantsCount: (editorState?: EditorState) => any;
@@ -1,2 +0,0 @@
1
- import type { EditorState } from 'prosemirror-state';
2
- export declare const getParticipantsCount: (editorState?: EditorState) => any;