@atlaskit/editor-plugin-card 17.4.11 → 18.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/cardPlugin/package.json +1 -8
  3. package/cardPluginType/package.json +1 -8
  4. package/package.json +42 -50
  5. package/types/package.json +1 -8
  6. package/dist/types-ts4.5/cardPlugin.d.ts +0 -2
  7. package/dist/types-ts4.5/cardPluginType.d.ts +0 -53
  8. package/dist/types-ts4.5/entry-points/cardPlugin.d.ts +0 -1
  9. package/dist/types-ts4.5/entry-points/cardPluginType.d.ts +0 -1
  10. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  11. package/dist/types-ts4.5/index.d.ts +0 -3
  12. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +0 -64
  13. package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -61
  14. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -102
  15. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +0 -67
  16. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +0 -20
  17. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +0 -8
  18. package/dist/types-ts4.5/nodeviews/lazy-block-card.d.ts +0 -3
  19. package/dist/types-ts4.5/nodeviews/lazy-embed-card.d.ts +0 -3
  20. package/dist/types-ts4.5/nodeviews/lazy-inline-card.d.ts +0 -3
  21. package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +0 -29
  22. package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +0 -29
  23. package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +0 -29
  24. package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -32
  25. package/dist/types-ts4.5/pm-plugins/doc.d.ts +0 -50
  26. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -3
  27. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -5
  28. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  29. package/dist/types-ts4.5/pm-plugins/reducers.d.ts +0 -3
  30. package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +0 -2
  31. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +0 -9
  32. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +0 -56
  33. package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -48
  34. package/dist/types-ts4.5/types/index.d.ts +0 -208
  35. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -15
  36. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -11
  37. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +0 -18
  38. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +0 -29
  39. package/dist/types-ts4.5/ui/DatasourceIcon/index.d.ts +0 -3
  40. package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +0 -20
  41. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +0 -12
  42. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +0 -37
  43. package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +0 -9
  44. package/dist/types-ts4.5/ui/EditToolbarButton/index.d.ts +0 -3
  45. package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +0 -31
  46. package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +0 -10
  47. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +0 -6
  48. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +0 -6
  49. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +0 -20
  50. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +0 -5
  51. package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +0 -4
  52. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +0 -18
  53. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +0 -7
  54. package/dist/types-ts4.5/ui/InlineCardOverlay/index.d.ts +0 -9
  55. package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -6
  56. package/dist/types-ts4.5/ui/InlineCardOverlay/utils.d.ts +0 -20
  57. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -9
  58. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +0 -24
  59. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +0 -13
  60. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +0 -25
  61. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +0 -14
  62. package/dist/types-ts4.5/ui/OpenLinkToolbarButton/index.d.ts +0 -20
  63. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +0 -14
  64. package/dist/types-ts4.5/ui/PasteDisplayAsMenu.d.ts +0 -25
  65. package/dist/types-ts4.5/ui/Pulse/index.d.ts +0 -25
  66. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +0 -66
  67. package/dist/types-ts4.5/ui/SmartCardSSRReactContextsProvider.d.ts +0 -10
  68. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +0 -11
  69. package/dist/types-ts4.5/ui/WithCardContext.d.ts +0 -5
  70. package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +0 -21
  71. package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +0 -19
  72. package/dist/types-ts4.5/ui/analytics/types.d.ts +0 -66
  73. package/dist/types-ts4.5/ui/analytics/utils.d.ts +0 -24
  74. package/dist/types-ts4.5/ui/currentPastedSmartLink.d.ts +0 -2
  75. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +0 -24
  76. package/dist/types-ts4.5/ui/editDatasourceAction.d.ts +0 -4
  77. package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +0 -18
  78. package/dist/types-ts4.5/ui/local-storage.d.ts +0 -7
  79. package/dist/types-ts4.5/ui/pasteDisplayAsUtils.d.ts +0 -12
  80. package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +0 -12
  81. package/dist/types-ts4.5/ui/toolbar.d.ts +0 -19
  82. package/dist/types-ts4.5/ui/useFetchDatasourceDataInfo.d.ts +0 -10
  83. package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 18.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
29
+ ## 17.4.12
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 17.4.11
4
36
 
5
37
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/cardPlugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/cardPlugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/cardPlugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/cardPluginType.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/cardPluginType.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/cardPluginType.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "17.4.11",
3
+ "version": "18.0.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -16,58 +16,50 @@
16
16
  "module": "dist/esm/index.js",
17
17
  "module:es2019": "dist/es2019/index.js",
18
18
  "types": "dist/types/index.d.ts",
19
- "typesVersions": {
20
- ">=4.5 <4.9": {
21
- "*": [
22
- "dist/types-ts4.5/*",
23
- "dist/types-ts4.5/index.d.ts"
24
- ]
25
- }
26
- },
27
19
  "sideEffects": [
28
20
  "*.compiled.css"
29
21
  ],
30
22
  "atlaskit:src": "src/index.ts",
31
23
  "dependencies": {
32
- "@atlaskit/adf-schema": "^54.0.0",
33
- "@atlaskit/analytics-next": "^11.3.0",
34
- "@atlaskit/button": "^23.11.0",
35
- "@atlaskit/css": "^0.19.0",
36
- "@atlaskit/custom-steps": "^0.17.0",
37
- "@atlaskit/editor-card-provider": "^6.8.0",
38
- "@atlaskit/editor-plugin-analytics": "^11.0.0",
39
- "@atlaskit/editor-plugin-base": "^12.1.0",
40
- "@atlaskit/editor-plugin-connectivity": "^11.0.0",
41
- "@atlaskit/editor-plugin-decorations": "^11.0.0",
42
- "@atlaskit/editor-plugin-editor-disabled": "^11.0.0",
43
- "@atlaskit/editor-plugin-editor-viewmode": "^13.0.0",
44
- "@atlaskit/editor-plugin-feature-flags": "^10.0.0",
45
- "@atlaskit/editor-plugin-floating-toolbar": "^13.0.0",
46
- "@atlaskit/editor-plugin-grid": "^11.0.0",
47
- "@atlaskit/editor-plugin-toolbar": "^8.0.0",
48
- "@atlaskit/editor-plugin-ui-control-registry": "^5.0.0",
49
- "@atlaskit/editor-plugin-width": "^12.0.0",
50
- "@atlaskit/editor-prosemirror": "^7.3.0",
51
- "@atlaskit/editor-shared-styles": "^3.11.0",
52
- "@atlaskit/editor-smart-link-draggable": "^0.5.0",
53
- "@atlaskit/editor-toolbar": "^1.10.0",
54
- "@atlaskit/frontend-utilities": "^3.4.0",
55
- "@atlaskit/icon": "^35.4.0",
56
- "@atlaskit/link": "^3.4.0",
57
- "@atlaskit/link-analytics": "^11.1.0",
58
- "@atlaskit/link-client-extension": "^6.1.0",
59
- "@atlaskit/link-datasource": "^5.6.0",
60
- "@atlaskit/link-extractors": "^2.7.0",
61
- "@atlaskit/linking-common": "^9.13.0",
62
- "@atlaskit/linking-types": "^14.4.0",
63
- "@atlaskit/menu": "^8.5.0",
64
- "@atlaskit/platform-feature-flags": "^1.1.0",
65
- "@atlaskit/platform-feature-flags-react": "^0.5.0",
66
- "@atlaskit/primitives": "^19.0.0",
67
- "@atlaskit/prosemirror-history": "^0.2.0",
68
- "@atlaskit/smart-card": "^44.29.0",
69
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
70
- "@atlaskit/tokens": "^13.4.0",
24
+ "@atlaskit/adf-schema": "^55.0.0",
25
+ "@atlaskit/analytics-next": "^12.0.0",
26
+ "@atlaskit/button": "^24.0.0",
27
+ "@atlaskit/css": "^1.0.0",
28
+ "@atlaskit/custom-steps": "^1.0.0",
29
+ "@atlaskit/editor-card-provider": "^7.0.0",
30
+ "@atlaskit/editor-plugin-analytics": "^12.0.0",
31
+ "@atlaskit/editor-plugin-base": "^13.0.0",
32
+ "@atlaskit/editor-plugin-connectivity": "^12.0.0",
33
+ "@atlaskit/editor-plugin-decorations": "^12.0.0",
34
+ "@atlaskit/editor-plugin-editor-disabled": "^12.0.0",
35
+ "@atlaskit/editor-plugin-editor-viewmode": "^14.0.0",
36
+ "@atlaskit/editor-plugin-feature-flags": "^11.0.0",
37
+ "@atlaskit/editor-plugin-floating-toolbar": "^14.0.0",
38
+ "@atlaskit/editor-plugin-grid": "^12.0.0",
39
+ "@atlaskit/editor-plugin-toolbar": "^9.0.0",
40
+ "@atlaskit/editor-plugin-ui-control-registry": "^6.0.0",
41
+ "@atlaskit/editor-plugin-width": "^13.0.0",
42
+ "@atlaskit/editor-prosemirror": "^8.0.0",
43
+ "@atlaskit/editor-shared-styles": "^4.0.0",
44
+ "@atlaskit/editor-smart-link-draggable": "^1.0.0",
45
+ "@atlaskit/editor-toolbar": "^2.0.0",
46
+ "@atlaskit/frontend-utilities": "^4.0.0",
47
+ "@atlaskit/icon": "^36.0.0",
48
+ "@atlaskit/link": "^4.0.0",
49
+ "@atlaskit/link-analytics": "^12.0.0",
50
+ "@atlaskit/link-client-extension": "^7.0.0",
51
+ "@atlaskit/link-datasource": "^6.0.0",
52
+ "@atlaskit/link-extractors": "^3.0.0",
53
+ "@atlaskit/linking-common": "^10.0.0",
54
+ "@atlaskit/linking-types": "^15.0.0",
55
+ "@atlaskit/menu": "^9.0.0",
56
+ "@atlaskit/platform-feature-flags": "^2.0.0",
57
+ "@atlaskit/platform-feature-flags-react": "^1.0.0",
58
+ "@atlaskit/primitives": "^20.0.0",
59
+ "@atlaskit/prosemirror-history": "^1.0.0",
60
+ "@atlaskit/smart-card": "^45.0.0",
61
+ "@atlaskit/tmp-editor-statsig": "^104.0.0",
62
+ "@atlaskit/tokens": "^14.0.0",
71
63
  "@babel/runtime": "^7.0.0",
72
64
  "@emotion/react": "^11.7.1",
73
65
  "lodash": "^4.17.21",
@@ -76,8 +68,8 @@
76
68
  "uuid": "^3.1.0"
77
69
  },
78
70
  "peerDependencies": {
79
- "@atlaskit/editor-common": "^115.15.0",
80
- "@atlaskit/link-provider": "^4.7.0",
71
+ "@atlaskit/editor-common": "^116.0.0",
72
+ "@atlaskit/link-provider": "^5.0.0",
81
73
  "react": "^18.2.0",
82
74
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
83
75
  },
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,2 +0,0 @@
1
- import type { CardPlugin } from './cardPluginType';
2
- export declare const cardPlugin: CardPlugin;
@@ -1,53 +0,0 @@
1
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import type { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
- import type { CardPluginActions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
4
- import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
5
- import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
6
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- import type { InlineCommentPluginState } from '@atlaskit/editor-plugin-annotation';
8
- import type { BasePlugin } from '@atlaskit/editor-plugin-base';
9
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
10
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
11
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
12
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
13
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
14
- import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
15
- import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
16
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
17
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
18
- import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
19
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
20
- import type { CardPluginOptions, CardPluginState } from './types';
21
- type DummyAnnotationPlugin = NextEditorPlugin<'annotation', {
22
- actions: {
23
- setInlineCommentDraftState: (isDraft: boolean, inputMethod: INPUT_METHOD) => Command;
24
- };
25
- sharedState: InlineCommentPluginState;
26
- }>;
27
- export type CardPluginDependencies = [
28
- OptionalPlugin<FeatureFlagsPlugin>,
29
- OptionalPlugin<AnalyticsPlugin>,
30
- OptionalPlugin<EditorViewModePlugin>,
31
- WidthPlugin,
32
- DecorationsPlugin,
33
- GridPlugin,
34
- FloatingToolbarPlugin,
35
- OptionalPlugin<EditorDisabledPlugin>,
36
- OptionalPlugin<SelectionPlugin>,
37
- OptionalPlugin<DummyAnnotationPlugin>,
38
- OptionalPlugin<ConnectivityPlugin>,
39
- OptionalPlugin<BasePlugin>,
40
- OptionalPlugin<ToolbarPlugin>,
41
- OptionalPlugin<UiControlRegistryPlugin>
42
- ];
43
- export type CardPlugin = NextEditorPlugin<'card', {
44
- actions: CardPluginActions;
45
- commands: {
46
- /** EditorCommand form of `queueCardsFromRange`. Prefer over the action. */
47
- queueCardsFromRange: (from: number, to: number, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null, appearance?: CardAppearance) => EditorCommand;
48
- };
49
- dependencies: CardPluginDependencies;
50
- pluginConfiguration: CardPluginOptions | undefined;
51
- sharedState: CardPluginState | null;
52
- }>;
53
- export {};
@@ -1 +0,0 @@
1
- export { cardPlugin } from '../cardPlugin';
@@ -1 +0,0 @@
1
- export type { CardPlugin, CardPluginDependencies } from '../cardPluginType';
@@ -1 +0,0 @@
1
- export type { Request, CardPluginOptions, CardPluginState } from '../types/index';
@@ -1,3 +0,0 @@
1
- export { cardPlugin } from './cardPlugin';
2
- export type { CardPlugin, CardPluginDependencies } from './cardPluginType';
3
- export type { Request, CardPluginOptions, CardPluginState } from './types';
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import type { IntlShape } from 'react-intl';
3
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
4
- import type { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
5
- import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
- import type { Node } from '@atlaskit/editor-prosemirror/model';
7
- import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
8
- import type { CardContext } from '@atlaskit/link-provider';
9
- import { Datasource } from '../nodeviews/datasource';
10
- import type { SmartCardProps } from './genericCard';
11
- export declare class BlockCardComponent extends React.PureComponent<SmartCardProps & {
12
- id?: string;
13
- }, unknown> {
14
- private scrollContainer?;
15
- constructor(props: SmartCardProps & {
16
- id?: string;
17
- });
18
- onResolve: (data: {
19
- title?: string;
20
- url?: string;
21
- }) => void;
22
- componentWillUnmount(): void;
23
- private removeCardDispatched;
24
- private removeCard;
25
- gapCursorSpan: () => React.JSX.Element | undefined;
26
- onError: ({ err }: {
27
- err?: Error;
28
- }) => void;
29
- render(): React.JSX.Element;
30
- }
31
- export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'provider' | 'CompetitorPrompt' | 'intl' | 'smartCardContext'>;
32
- export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
33
- private id;
34
- unsubscribe: (() => void) | undefined;
35
- createDomRef(): HTMLElement;
36
- private updateContentEditable;
37
- validUpdate(currentNode: Node, newNode: Node): boolean;
38
- update(node: Node, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
39
- render(): React.JSX.Element;
40
- /**
41
- * Prevent ProseMirror from handling drag events on the smart-element-link,
42
- * allowing native drag to work so SmartLinkDraggable can intercept it.
43
- * @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
44
- */
45
- stopEvent(event: Event): boolean;
46
- destroy(): void;
47
- }
48
- export interface BlockCardNodeViewProperties {
49
- actionOptions: BlockCardNodeViewProps['actionOptions'];
50
- allowDatasource: boolean | undefined;
51
- CompetitorPrompt?: React.ComponentType<{
52
- linkType?: string;
53
- sourceUrl: string;
54
- }>;
55
- inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
56
- intl?: IntlShape;
57
- isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
58
- onClickCallback: BlockCardNodeViewProps['onClickCallback'];
59
- pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
60
- pmPluginFactoryParams: PMPluginFactoryParams;
61
- provider: BlockCardNodeViewProps['provider'];
62
- smartCardContext?: CardContext;
63
- }
64
- export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, intl, smartCardContext, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => BlockCard | Datasource | NodeView;
@@ -1,61 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import { jsx } from '@emotion/react';
7
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
8
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
9
- import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
10
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
11
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
12
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
13
- import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
14
- import type { cardPlugin } from '../index';
15
- export interface DatasourceProps extends ReactComponentProps {
16
- eventDispatcher: EventDispatcher;
17
- getPos: getPosHandler;
18
- isNodeNested?: boolean;
19
- node: PMNode;
20
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
21
- portalProviderAPI: PortalProviderAPI;
22
- view: EditorView;
23
- }
24
- interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
25
- }
26
- export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
27
- constructor(props: DatasourceComponentProps);
28
- private getDatasource;
29
- private getTableView;
30
- private updateTableProperties;
31
- handleColumnChange: (columnKeys: string[]) => void;
32
- handleColumnResize: (key: string, width: number) => void;
33
- handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
34
- onError: ({ err }: {
35
- err?: Error;
36
- }) => void;
37
- private getColumnsInfo;
38
- render(): jsx.JSX.Element | null;
39
- }
40
- export declare class Datasource extends ReactNodeView<DatasourceProps> {
41
- private tableWidth;
42
- private isNodeNested;
43
- constructor(props: DatasourceProps);
44
- validUpdate(_: PMNode, newNode: PMNode): boolean;
45
- update(node: PMNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
46
- createDomRef(): HTMLElement;
47
- /**
48
- * Node views may render interactive elements that should not have their events reach editor
49
- *
50
- * We should the stop editor from handling events from following elements:
51
- * - typing in input
52
- * - activating buttons via spacebar
53
- *
54
- * Can be used to prevent the editor view from trying to handle some or all DOM events that bubble up from the node view.
55
- * Events for which this returns true are not handled by the editor.
56
- * @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
57
- */
58
- stopEvent(event: Event): boolean;
59
- render(): jsx.JSX.Element;
60
- }
61
- export {};
@@ -1,102 +0,0 @@
1
- import React from 'react';
2
- import type { ComponentProps } from 'react';
3
- import type { IntlShape } from 'react-intl';
4
- import type { RichMediaLayout } from '@atlaskit/adf-schema';
5
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
6
- import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
7
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
- import type { CardContext } from '@atlaskit/link-provider';
10
- import type { cardPlugin } from '../index';
11
- import type { SmartCardProps } from './genericCard';
12
- /**
13
- * Returns a forced aspect ratio for URLs that have a known canvas shape,
14
- * overriding the generic value returned by the link resolver.
15
- * Add new URL checks here as more content types get fixed aspect ratios.
16
- */
17
- /**
18
- * Returns a forced aspect ratio for URLs that have a known canvas shape,
19
- * or `undefined` to use the default resolver-provided ratio.
20
- *
21
- * @internal Exported for testing only.
22
- */
23
- export declare const getAspectRatioForUrl: (url: string | undefined) => number | undefined;
24
- export type EmbedCardState = {
25
- hasPreview: boolean;
26
- initialAspectRatio?: number;
27
- liveHeight?: number;
28
- };
29
- export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps & {
30
- id?: string;
31
- }, EmbedCardState> {
32
- private scrollContainer?;
33
- private embedIframeRef;
34
- constructor(props: SmartCardProps & {
35
- id?: string;
36
- });
37
- state: EmbedCardState;
38
- private getPosSafely;
39
- onResolve: (data: {
40
- aspectRatio?: number;
41
- title?: string;
42
- url?: string;
43
- }) => void;
44
- updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
45
- /**
46
- * Defers line-length measurement until the embed card DOM has fully rendered.
47
- *
48
- * When put embed in the expand, reload the page and open that expand, the embed was collapsed.
49
- * Because the `.rich-media-item` can temporarily report `offsetWidth = 1`, as proportional width styles have not been applied yet.
50
- * Measuring at that moment would cache the bogus width and break resize calculations.
51
- * Scheduling a measurement on the next animation frame ensures layout has
52
- * settled. We then force the node view to re-render so `getLineLength`
53
- * re-runs and captures the correct width.
54
- */
55
- private scheduleLineLengthRemeasureRaf;
56
- private getLineLength;
57
- /**
58
- * Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
59
- * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
60
- * we will show embed window of appropriate size and avoid unnecessary content jumping.
61
- */
62
- saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
63
- onHeightUpdate: (height: number) => void;
64
- onError: ({ err }: {
65
- err?: Error;
66
- }) => void;
67
- componentWillUnmount(): void;
68
- private removeCardDispatched;
69
- private removeCard;
70
- render(): React.JSX.Element;
71
- }
72
- export declare const EmbedOrBlockCardComponent: (props: ComponentProps<typeof EmbedCardComponent>) => React.JSX.Element;
73
- export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'isPageSSRed' | 'provider' | 'CompetitorPrompt' | 'intl' | 'smartCardContext'>;
74
- export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
75
- private id;
76
- unsubscribe: (() => void) | undefined;
77
- viewShouldUpdate(nextNode: PMNode): boolean;
78
- createDomRef(): HTMLElement;
79
- private updateContentEditable;
80
- render(): React.JSX.Element;
81
- /**
82
- * Prevent ProseMirror from handling drag events on the smart-element-link,
83
- * allowing native drag to work so SmartLinkDraggable can intercept it.
84
- * @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
85
- */
86
- stopEvent(event: Event): boolean;
87
- destroy(): void;
88
- }
89
- export interface EmbedCardNodeViewProperties {
90
- actionOptions: EmbedCardNodeViewProps['actionOptions'];
91
- allowResizing: EmbedCardNodeViewProps['allowResizing'];
92
- CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
93
- fullWidthMode: EmbedCardNodeViewProps['fullWidthMode'];
94
- intl?: IntlShape;
95
- isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
96
- onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
97
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
98
- pmPluginFactoryParams: PMPluginFactoryParams;
99
- provider: EmbedCardNodeViewProps['provider'];
100
- smartCardContext?: CardContext;
101
- }
102
- export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, isPageSSRed, provider, intl, smartCardContext, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
@@ -1,67 +0,0 @@
1
- import type { EventHandler, KeyboardEvent, MouseEvent } from 'react';
2
- import React from 'react';
3
- import type { IntlShape } from 'react-intl';
4
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
5
- import type { OnClickCallback } from '@atlaskit/editor-common/card';
6
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
7
- import type { ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
8
- import type { ReactComponentProps, getPosHandler } from '@atlaskit/editor-common/react-node-view';
9
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
10
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
11
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
12
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
13
- import type { CardContext } from '@atlaskit/link-provider';
14
- import type { CardProps as BaseCardProps } from '@atlaskit/smart-card';
15
- import type { cardPlugin } from '../index';
16
- export type EditorContext<T> = React.Context<T> & {
17
- value: T;
18
- };
19
- export interface CardNodeViewProps extends ReactComponentProps {
20
- eventDispatcher?: EventDispatcher;
21
- providerFactory?: ProviderFactory;
22
- }
23
- export interface CardProps extends CardNodeViewProps {
24
- __livePage?: boolean;
25
- actionOptions?: BaseCardProps['actionOptions'];
26
- allowResizing?: boolean;
27
- children?: React.ReactNode;
28
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
29
- eventDispatcher?: EventDispatcher;
30
- fullWidthMode?: boolean;
31
- getPos: getPosHandler;
32
- hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
33
- node: PMNode;
34
- onClickCallback?: OnClickCallback;
35
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
36
- showHoverPreview?: BaseCardProps['showHoverPreview'];
37
- useAlternativePreloader?: boolean;
38
- view: EditorView;
39
- }
40
- export interface SmartCardProps extends CardProps {
41
- allowBlockCards?: boolean;
42
- allowEmbeds?: boolean;
43
- cardContext?: EditorContext<CardContext | undefined>;
44
- CompetitorPrompt?: React.ComponentType<{
45
- linkType?: string;
46
- sourceUrl: string;
47
- }>;
48
- disablePreviewPanel?: BaseCardProps['disablePreviewPanel'];
49
- enableInlineUpgradeFeatures?: boolean;
50
- intl?: IntlShape;
51
- isHovered?: boolean;
52
- isPageSSRed?: boolean;
53
- onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
54
- onResolve?: (tr: Transaction, title?: string) => void;
55
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
56
- provider?: Providers['cardProvider'];
57
- smartCardContext?: CardContext;
58
- }
59
- /**
60
- *
61
- * @param SmartCardComponent
62
- * @param UnsupportedComponent
63
- * @example
64
- */
65
- export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
66
- id?: string;
67
- }>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import type { InlineNodeViewComponentProps, getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
3
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
- import type { SmartCardProps } from './genericCard';
6
- import type { InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
7
- export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
8
- export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider' | 'intl' | 'smartCardContext'>;
9
- /**
10
- * Inline card node view component that renders a Smart Link inline card within the editor.
11
- *
12
- * @param props
13
- * @example
14
- */
15
- export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
16
- export interface InlineCardNodeViewProperties {
17
- inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
18
- isPageSSRed: InlineCardNodeViewProps['isPageSSRed'];
19
- }
20
- export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => NodeView;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { SmartCardProps } from './genericCard';
3
- export type InlineCardWithAwarenessProps = {
4
- isOverlayEnabled?: boolean;
5
- isPulseEnabled?: boolean;
6
- isSelected?: boolean;
7
- };
8
- export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, isPageSSRed, provider, appearance, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
@@ -1,3 +0,0 @@
1
- import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
2
- import type { BlockCardNodeViewProperties } from './blockCard';
3
- export declare const lazyBlockCardView: (props: BlockCardNodeViewProperties) => NodeViewConstructor;
@@ -1,3 +0,0 @@
1
- import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
2
- import type { EmbedCardNodeViewProperties } from './embedCard';
3
- export declare const lazyEmbedCardView: (props: EmbedCardNodeViewProperties) => NodeViewConstructor;
@@ -1,3 +0,0 @@
1
- import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
2
- import type { InlineCardNodeViewProperties } from './inlineCard';
3
- export declare const lazyInlineCardView: (props: InlineCardNodeViewProperties) => NodeViewConstructor;
@@ -1,29 +0,0 @@
1
- import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export declare const blockCardSpecWithFixedToDOM: () => {
4
- atom?: boolean;
5
- attrs?: {
6
- [name: string]: AttributeSpec;
7
- };
8
- code?: boolean;
9
- content?: string;
10
- defining?: boolean;
11
- definingAsContext?: boolean;
12
- definingForContent?: boolean;
13
- disableDropCursor?: boolean | ((view: EditorView, pos: {
14
- inside: number;
15
- pos: number;
16
- }, event: DragEvent) => boolean);
17
- draggable?: boolean;
18
- group?: string;
19
- inline?: boolean;
20
- isolating?: boolean;
21
- leafText?: (node: PMNode) => string;
22
- linebreakReplacement?: boolean;
23
- marks?: string;
24
- parseDOM?: readonly TagParseRule[];
25
- selectable?: boolean;
26
- toDebugString?: (node: PMNode) => string;
27
- toDOM: (node: PMNode) => DOMOutputSpec;
28
- whitespace?: "pre" | "normal";
29
- };