@atlaskit/editor-core 185.12.0 → 185.12.2

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 (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/block-type/commands/block-type.js +79 -44
  3. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -3
  4. package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +15 -36
  5. package/dist/cjs/plugins/code-block/index.js +7 -3
  6. package/dist/cjs/plugins/expand/commands.js +6 -2
  7. package/dist/cjs/plugins/expand/index.js +5 -1
  8. package/dist/cjs/plugins/hyperlink/Toolbar.js +1 -0
  9. package/dist/cjs/plugins/panel/index.js +81 -43
  10. package/dist/cjs/plugins/quick-insert/commands.js +2 -0
  11. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +10 -0
  12. package/dist/cjs/version-wrapper.js +1 -1
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/plugins/block-type/commands/block-type.js +86 -51
  15. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +4 -3
  16. package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +21 -35
  17. package/dist/es2019/plugins/code-block/index.js +7 -2
  18. package/dist/es2019/plugins/expand/commands.js +6 -2
  19. package/dist/es2019/plugins/expand/index.js +5 -1
  20. package/dist/es2019/plugins/hyperlink/Toolbar.js +1 -0
  21. package/dist/es2019/plugins/panel/index.js +82 -41
  22. package/dist/es2019/plugins/quick-insert/commands.js +2 -0
  23. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +10 -0
  24. package/dist/es2019/version-wrapper.js +1 -1
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/plugins/block-type/commands/block-type.js +76 -43
  27. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +4 -3
  28. package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +15 -36
  29. package/dist/esm/plugins/code-block/index.js +7 -2
  30. package/dist/esm/plugins/expand/commands.js +6 -2
  31. package/dist/esm/plugins/expand/index.js +5 -1
  32. package/dist/esm/plugins/hyperlink/Toolbar.js +1 -0
  33. package/dist/esm/plugins/panel/index.js +81 -43
  34. package/dist/esm/plugins/quick-insert/commands.js +2 -0
  35. package/dist/esm/ui/ElementBrowser/InsertMenu.js +10 -0
  36. package/dist/esm/version-wrapper.js +1 -1
  37. package/dist/esm/version.json +1 -1
  38. package/dist/types/plugins/block-type/commands/block-type.d.ts +25 -0
  39. package/dist/types/plugins/card/types.d.ts +2 -3
  40. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +2 -2
  41. package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +25 -0
  42. package/dist/types-ts4.5/plugins/card/types.d.ts +2 -3
  43. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +2 -2
  44. package/package.json +2 -2
@@ -4,7 +4,7 @@ import { EditorState } from 'prosemirror-state';
4
4
  import { EditorView } from 'prosemirror-view';
5
5
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
- import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
7
+ import type { LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
8
8
  import type { Command, FloatingToolbarItem, FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
10
10
  import { FeatureFlags } from '@atlaskit/editor-common/types';
@@ -16,7 +16,7 @@ export type EditLinkToolbarProps = {
16
16
  url: string | undefined;
17
17
  text: string;
18
18
  node: Node;
19
- onSubmit?: (href: string, text?: string, analytic?: UIAnalyticsEvent | null | undefined) => void;
19
+ onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
20
20
  linkPickerOptions?: LinkPickerOptions;
21
21
  featureFlags: FeatureFlags;
22
22
  forceFocusSelector: ForceFocusSelector | undefined;
@@ -1,3 +1,7 @@
1
+ /// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
2
+ /// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
3
+ import { EditorState } from 'prosemirror-state';
4
+ import { NodeType } from 'prosemirror-model';
1
5
  import { Command } from '../../../types';
2
6
  import { HeadingLevelsAndNormalText } from '../types';
3
7
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -19,4 +23,25 @@ export declare function insertBlockType(name: string): Command;
19
23
  * @returns - command that inserts block type
20
24
  */
21
25
  export declare const insertBlockTypesWithAnalytics: (name: string, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
26
+ /**
27
+ * This function creates a new transaction that wraps the current selection
28
+ * in the specified node type if it results in a valid transaction.
29
+ * If not valid, it performs a safe insert operation.
30
+ *
31
+ * Example of when wrapping might not be valid is when attempting to wrap
32
+ * content that is already inside a panel with another panel
33
+ */
34
+ export declare function createWrapSelectionTransaction({ state, type, nodeAttributes, }: {
35
+ state: EditorState;
36
+ type: NodeType;
37
+ nodeAttributes?: Record<string, any>;
38
+ }): import("prosemirror-state").Transaction;
39
+ /**
40
+ * This function creates a new transaction that inserts a code block,
41
+ * if there is text selected it will wrap the current selection if not it will
42
+ * append the codeblock to the end of the document.
43
+ */
44
+ export declare function createInsertCodeBlockTransaction({ state, }: {
45
+ state: EditorState;
46
+ }): import("prosemirror-state").Transaction;
22
47
  export declare const cleanUpAtTheStartOfDocument: Command;
@@ -64,7 +64,7 @@ export type Request = {
64
64
  */
65
65
  sourceEvent?: UIAnalyticsEvent | null | undefined;
66
66
  };
67
- type Metadata<T = {}> = {
67
+ export type Metadata<T = {}> = {
68
68
  url: string;
69
69
  display: string;
70
70
  isUndo?: boolean;
@@ -74,7 +74,7 @@ type Metadata<T = {}> = {
74
74
  sourceEvent?: unknown;
75
75
  nodeContext?: string;
76
76
  } & T;
77
- type UpdateMetadata = {
77
+ export type UpdateMetadata = {
78
78
  previousDisplay?: string;
79
79
  };
80
80
  export type SmartLinkEventsNext = {
@@ -162,4 +162,3 @@ export type SetCardLayoutAndDatasourceTableRef = {
162
162
  datasourceTableRef?: HTMLElement;
163
163
  };
164
164
  export type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | ShowDatasourceModal | HideDatasourceModal | RegisterSmartCardEvents | RegisterSmartCardEventsNext | SetDatasourceTableRef | SetCardLayout | SetCardLayoutAndDatasourceTableRef;
165
- export {};
@@ -4,7 +4,7 @@ import { EditorState } from 'prosemirror-state';
4
4
  import { EditorView } from 'prosemirror-view';
5
5
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
- import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
7
+ import type { LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
8
8
  import type { Command, FloatingToolbarItem, FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
10
10
  import { FeatureFlags } from '@atlaskit/editor-common/types';
@@ -16,7 +16,7 @@ export type EditLinkToolbarProps = {
16
16
  url: string | undefined;
17
17
  text: string;
18
18
  node: Node;
19
- onSubmit?: (href: string, text?: string, analytic?: UIAnalyticsEvent | null | undefined) => void;
19
+ onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
20
20
  linkPickerOptions?: LinkPickerOptions;
21
21
  featureFlags: FeatureFlags;
22
22
  forceFocusSelector: ForceFocusSelector | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.12.0",
3
+ "version": "185.12.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -77,7 +77,7 @@
77
77
  "@atlaskit/icon-object": "^6.3.0",
78
78
  "@atlaskit/link-analytics": "^8.2.0",
79
79
  "@atlaskit/link-datasource": "^0.28.0",
80
- "@atlaskit/link-picker": "^1.26.0",
80
+ "@atlaskit/link-picker": "^1.27.0",
81
81
  "@atlaskit/locale": "^2.5.0",
82
82
  "@atlaskit/logo": "^13.14.0",
83
83
  "@atlaskit/media-card": "^76.1.0",