@atlaskit/editor-core 189.3.13 → 189.3.15

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 (167) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/create-editor/ErrorBoundary.js +1 -1
  3. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  4. package/dist/cjs/plugins/analytics/index.js +0 -6
  5. package/dist/cjs/plugins/analytics/utils.js +0 -29
  6. package/dist/cjs/plugins/breakout/index.js +3 -3
  7. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
  8. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  9. package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
  10. package/dist/cjs/plugins/find-replace/index.js +5 -2
  11. package/dist/cjs/plugins/find-replace/keymap.js +4 -4
  12. package/dist/cjs/plugins/index.js +1 -24
  13. package/dist/cjs/plugins/mobile-dimensions/index.js +6 -0
  14. package/dist/cjs/presets/context.js +5 -3
  15. package/dist/cjs/presets/universal.js +14 -4
  16. package/dist/cjs/ui/Appearance/Chromeless.js +18 -9
  17. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  18. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  19. package/dist/cjs/ui/AppearanceComponents/Mobile.js +7 -9
  20. package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
  21. package/dist/cjs/ui/ContentStyles/index.js +4 -4
  22. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  23. package/dist/cjs/use-preset.js +0 -1
  24. package/dist/cjs/version-wrapper.js +1 -1
  25. package/dist/es2019/create-editor/ErrorBoundary.js +0 -2
  26. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  27. package/dist/es2019/plugins/analytics/index.js +1 -1
  28. package/dist/es2019/plugins/analytics/utils.js +0 -24
  29. package/dist/es2019/plugins/breakout/index.js +1 -1
  30. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
  31. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
  32. package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
  33. package/dist/es2019/plugins/find-replace/index.js +7 -2
  34. package/dist/es2019/plugins/find-replace/keymap.js +4 -4
  35. package/dist/es2019/plugins/index.js +0 -2
  36. package/dist/es2019/plugins/mobile-dimensions/index.js +6 -0
  37. package/dist/es2019/presets/context.js +2 -2
  38. package/dist/es2019/presets/universal.js +11 -1
  39. package/dist/es2019/ui/Appearance/Chromeless.js +17 -9
  40. package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
  41. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  42. package/dist/es2019/ui/AppearanceComponents/Mobile.js +8 -9
  43. package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  44. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  45. package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
  46. package/dist/es2019/use-preset.js +0 -1
  47. package/dist/es2019/version-wrapper.js +1 -1
  48. package/dist/esm/create-editor/ErrorBoundary.js +0 -2
  49. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  50. package/dist/esm/plugins/analytics/index.js +1 -1
  51. package/dist/esm/plugins/analytics/utils.js +0 -28
  52. package/dist/esm/plugins/breakout/index.js +1 -1
  53. package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
  54. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  55. package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
  56. package/dist/esm/plugins/find-replace/index.js +5 -2
  57. package/dist/esm/plugins/find-replace/keymap.js +4 -4
  58. package/dist/esm/plugins/index.js +0 -2
  59. package/dist/esm/plugins/mobile-dimensions/index.js +6 -0
  60. package/dist/esm/presets/context.js +2 -2
  61. package/dist/esm/presets/universal.js +10 -1
  62. package/dist/esm/ui/Appearance/Chromeless.js +15 -9
  63. package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
  64. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  65. package/dist/esm/ui/AppearanceComponents/Mobile.js +7 -9
  66. package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  67. package/dist/esm/ui/ContentStyles/index.js +1 -1
  68. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  69. package/dist/esm/use-preset.js +0 -1
  70. package/dist/esm/version-wrapper.js +1 -1
  71. package/dist/types/plugins/analytics/index.d.ts +1 -1
  72. package/dist/types/plugins/analytics/utils.d.ts +0 -11
  73. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  74. package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  75. package/dist/types/plugins/find-replace/index.d.ts +5 -3
  76. package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
  77. package/dist/types/plugins/index.d.ts +0 -2
  78. package/dist/types/plugins/insert-block/types.d.ts +1 -1
  79. package/dist/types/plugins/mobile-dimensions/index.d.ts +5 -1
  80. package/dist/types/presets/context.d.ts +2 -2
  81. package/dist/types/presets/universal.d.ts +5 -0
  82. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -1
  83. package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  84. package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
  85. package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
  86. package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  87. package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  88. package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
  89. package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
  90. package/dist/types-ts4.5/plugins/index.d.ts +0 -2
  91. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
  92. package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +5 -1
  93. package/dist/types-ts4.5/presets/context.d.ts +2 -2
  94. package/dist/types-ts4.5/presets/universal.d.ts +5 -0
  95. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +1 -1
  96. package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  97. package/package.json +6 -9
  98. package/dist/cjs/plugins/breakout/constants.js +0 -10
  99. package/dist/cjs/plugins/expand/commands.js +0 -184
  100. package/dist/cjs/plugins/expand/index.js +0 -111
  101. package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
  102. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
  103. package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
  104. package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
  105. package/dist/cjs/plugins/expand/reducer.js +0 -20
  106. package/dist/cjs/plugins/expand/toolbar.js +0 -59
  107. package/dist/cjs/plugins/expand/types.js +0 -5
  108. package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
  109. package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
  110. package/dist/cjs/plugins/expand/utils.js +0 -24
  111. package/dist/cjs/plugins/max-content-size/index.js +0 -44
  112. package/dist/es2019/plugins/breakout/constants.js +0 -4
  113. package/dist/es2019/plugins/expand/commands.js +0 -161
  114. package/dist/es2019/plugins/expand/index.js +0 -95
  115. package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
  116. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
  117. package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
  118. package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  119. package/dist/es2019/plugins/expand/reducer.js +0 -11
  120. package/dist/es2019/plugins/expand/toolbar.js +0 -52
  121. package/dist/es2019/plugins/expand/types.js +0 -1
  122. package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
  123. package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
  124. package/dist/es2019/plugins/expand/utils.js +0 -1
  125. package/dist/es2019/plugins/max-content-size/index.js +0 -35
  126. package/dist/esm/plugins/breakout/constants.js +0 -4
  127. package/dist/esm/plugins/expand/commands.js +0 -177
  128. package/dist/esm/plugins/expand/index.js +0 -97
  129. package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
  130. package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
  131. package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
  132. package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  133. package/dist/esm/plugins/expand/reducer.js +0 -13
  134. package/dist/esm/plugins/expand/toolbar.js +0 -52
  135. package/dist/esm/plugins/expand/types.js +0 -1
  136. package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
  137. package/dist/esm/plugins/expand/ui/class-names.js +0 -14
  138. package/dist/esm/plugins/expand/utils.js +0 -1
  139. package/dist/esm/plugins/max-content-size/index.js +0 -37
  140. package/dist/types/plugins/breakout/constants.d.ts +0 -4
  141. package/dist/types/plugins/expand/commands.d.ts +0 -13
  142. package/dist/types/plugins/expand/index.d.ts +0 -31
  143. package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
  144. package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  145. package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
  146. package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  147. package/dist/types/plugins/expand/reducer.d.ts +0 -3
  148. package/dist/types/plugins/expand/toolbar.d.ts +0 -3
  149. package/dist/types/plugins/expand/types.d.ts +0 -9
  150. package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  151. package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
  152. package/dist/types/plugins/expand/utils.d.ts +0 -1
  153. package/dist/types/plugins/max-content-size/index.d.ts +0 -13
  154. package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
  155. package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
  156. package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
  157. package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
  158. package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  159. package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
  160. package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  161. package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
  162. package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
  163. package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
  164. package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  165. package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
  166. package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
  167. package/dist/types-ts4.5/plugins/max-content-size/index.d.ts +0 -13
@@ -1,13 +1,16 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
3
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
4
  type Config = {
4
5
  takeFullWidth: boolean;
5
6
  twoLineEditorToolbar: boolean;
6
7
  };
7
- export declare const findReplacePlugin: NextEditorPlugin<'findReplace', {
8
+ export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
8
9
  pluginConfiguration: Config;
9
10
  dependencies: [
10
- FeatureFlagsPlugin
11
+ FeatureFlagsPlugin,
12
+ OptionalPlugin<AnalyticsPlugin>
11
13
  ];
12
14
  }>;
15
+ export declare const findReplacePlugin: FindReplacePlugin;
13
16
  export default findReplacePlugin;
@@ -1,3 +1,4 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- declare const keymapPlugin: () => SafePlugin<any>;
2
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
+ declare const keymapPlugin: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => SafePlugin<any>;
3
4
  export default keymapPlugin;
@@ -5,7 +5,6 @@ export { default as insertBlockPlugin } from './insert-block';
5
5
  export { default as jiraIssuePlugin } from './jira-issue';
6
6
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
7
7
  export { default as macroPlugin } from './macro';
8
- export { default as maxContentSizePlugin } from './max-content-size';
9
8
  export { default as pastePlugin } from './paste';
10
9
  export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
11
10
  export { default as breakoutPlugin } from './breakout';
@@ -16,7 +15,6 @@ export { default as annotationPlugin } from './annotation';
16
15
  export { default as analyticsPlugin } from './analytics';
17
16
  export { default as customAutoformatPlugin } from './custom-autoformat';
18
17
  export { default as feedbackDialogPlugin } from './feedback-dialog';
19
- export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
20
18
  export { default as mobileDimensionsPlugin } from './mobile-dimensions';
21
19
  export { default as findReplacePlugin } from './find-replace';
22
20
  export { default as mobileSelectionPlugin } from './mobile-selection';
@@ -17,7 +17,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
17
17
  import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
18
  import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
19
19
  import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
- import type { ExpandPlugin } from '../expand';
20
+ import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
21
21
  export type InsertBlockPluginDependencies = [
22
22
  FeatureFlagsPlugin,
23
23
  TypeAheadPlugin,
@@ -1,3 +1,7 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- declare const mobileDimensionsPlugin: NextEditorPlugin<'mobileDimensions'>;
2
+ import type { MobileDimensionsPluginState } from './types';
3
+ export type MobileDimensionsPlugin = NextEditorPlugin<'mobileDimensions', {
4
+ sharedState: MobileDimensionsPluginState | undefined;
5
+ }>;
6
+ declare const mobileDimensionsPlugin: MobileDimensionsPlugin;
3
7
  export default mobileDimensionsPlugin;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
2
+ import type { PublicPluginAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
3
  export type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
4
4
  export interface EditorAPIContextType {
5
5
  editorApi?: PublicPluginAPI<any>;
@@ -10,6 +10,6 @@ interface EditorAPIProviderProps {
10
10
  children: React.ReactNode;
11
11
  }
12
12
  export declare const PresetContextProvider: ({ children }: EditorAPIProviderProps) => JSX.Element;
13
- export declare const usePresetContext: () => PublicPluginAPI<any> | undefined;
13
+ export declare function usePresetContext<Plugins extends OptionalPlugin<NextEditorPlugin<any, any>>[]>(): PublicPluginAPI<Plugins>;
14
14
  export declare const useSetPresetContext: () => SetEditorAPI | undefined;
15
15
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { EditorProps } from '../types';
3
4
  import type { DefaultPresetPluginOptions } from './default';
4
5
  import type { EditorPresetProps } from './types';
5
6
  import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../types/editor-props';
@@ -18,4 +19,8 @@ type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & Edi
18
19
  * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
19
20
  */
20
21
  export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetBuilder<any, any>;
22
+ interface ExpandEditorProps {
23
+ allowExpand?: EditorProps['allowExpand'];
24
+ }
25
+ export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
21
26
  export {};
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { EditorAppearanceComponentProps } from '../../types';
4
+ import type { EditorAppearanceComponentProps } from '../../types';
5
5
  export default class Editor extends React.Component<EditorAppearanceComponentProps, any> {
6
6
  static displayName: string;
7
7
  private appearance;
@@ -1,2 +1,2 @@
1
- import { ThemeProps } from '@atlaskit/theme/types';
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
2
  export declare const expandStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "189.3.13",
3
+ "version": "189.3.15",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -73,6 +73,7 @@
73
73
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
74
74
  "@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
75
75
  "@atlaskit/editor-plugin-emoji": "^0.4.0",
76
+ "@atlaskit/editor-plugin-expand": "^0.1.0",
76
77
  "@atlaskit/editor-plugin-extension": "^0.2.0",
77
78
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
78
79
  "@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
@@ -86,6 +87,7 @@
86
87
  "@atlaskit/editor-plugin-image-upload": "^0.2.0",
87
88
  "@atlaskit/editor-plugin-layout": "^0.1.0",
88
89
  "@atlaskit/editor-plugin-list": "^1.3.0",
90
+ "@atlaskit/editor-plugin-max-content-size": "^0.1.0",
89
91
  "@atlaskit/editor-plugin-media": "^0.3.0",
90
92
  "@atlaskit/editor-plugin-mentions": "^0.1.0",
91
93
  "@atlaskit/editor-plugin-panel": "^0.1.0",
@@ -136,6 +138,7 @@
136
138
  "@atlaskit/toggle": "^12.6.0",
137
139
  "@atlaskit/tokens": "^1.28.0",
138
140
  "@atlaskit/tooltip": "^17.8.0",
141
+ "@atlaskit/ufo": "^0.2.0",
139
142
  "@atlaskit/width-detector": "^4.1.0",
140
143
  "@babel/runtime": "^7.0.0",
141
144
  "@emotion/react": "^11.7.1",
@@ -149,8 +152,7 @@
149
152
  "raf-schd": "^4.0.3",
150
153
  "react-loadable": "^5.1.0",
151
154
  "react-transition-group": "^4.4.1",
152
- "uuid": "^3.1.0",
153
- "w3c-keyname": "^2.1.0"
155
+ "uuid": "^3.1.0"
154
156
  },
155
157
  "peerDependencies": {
156
158
  "@atlaskit/link-provider": "^1.6.2",
@@ -166,7 +168,7 @@
166
168
  "@atlaskit/collab-provider": "9.15.4",
167
169
  "@atlaskit/dropdown-menu": "^12.1.0",
168
170
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
169
- "@atlaskit/editor-palette": "1.5.1",
171
+ "@atlaskit/editor-palette": "1.5.2",
170
172
  "@atlaskit/flag": "^15.2.0",
171
173
  "@atlaskit/icon-object": "^6.3.0",
172
174
  "@atlaskit/inline-dialog": "^14.0.0",
@@ -180,7 +182,6 @@
180
182
  "@atlaskit/modal-dialog": "^12.8.0",
181
183
  "@atlaskit/renderer": "^108.15.0",
182
184
  "@atlaskit/synchrony-test-helpers": "^2.3.0",
183
- "@atlaskit/ufo": "^0.2.0",
184
185
  "@atlaskit/util-data-test": "^17.8.0",
185
186
  "@atlaskit/visual-regression": "*",
186
187
  "@atlaskit/webdriver-runner": "*",
@@ -245,10 +246,6 @@
245
246
  "type": "boolean",
246
247
  "referenceOnly": "true"
247
248
  },
248
- "platform.editor.update-table-cell-width-via-step": {
249
- "type": "boolean",
250
- "referenceOnly": "true"
251
- },
252
249
  "platform.editor.table-remove-update-resize-handles_djvab": {
253
250
  "type": "boolean",
254
251
  "referenceOnly": "true"
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BreakoutCssClassName = void 0;
7
- var BreakoutCssClassName = exports.BreakoutCssClassName = {
8
- BREAKOUT_MARK: 'fabric-editor-breakout-mark',
9
- BREAKOUT_MARK_DOM: 'fabric-editor-breakout-mark-dom'
10
- };
@@ -1,184 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.updateExpandTitle = exports.toggleExpandExpanded = exports.setSelectionInsideExpand = exports.setExpandRef = exports.insertExpand = exports.focusTitle = exports.deleteExpandAtPos = exports.deleteExpand = exports.createExpandNode = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _state = require("@atlaskit/editor-prosemirror/state");
10
- var _utils = require("@atlaskit/editor-tables/utils");
11
- var _analytics = require("@atlaskit/editor-common/analytics");
12
- var _selection = require("@atlaskit/editor-common/selection");
13
- var _utils2 = require("./utils");
14
- var _pluginFactory = require("./pm-plugins/plugin-factory");
15
- var _utils3 = require("@atlaskit/editor-common/utils");
16
- var _utils4 = require("@atlaskit/editor-prosemirror/utils");
17
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- var setExpandRef = exports.setExpandRef = function setExpandRef(ref) {
20
- return (0, _pluginFactory.createCommand)({
21
- type: 'SET_EXPAND_REF',
22
- data: {
23
- ref: ref
24
- }
25
- }, function (tr) {
26
- return tr.setMeta('addToHistory', false);
27
- });
28
- };
29
- var deleteExpandAtPos = exports.deleteExpandAtPos = function deleteExpandAtPos(editorAnalyticsAPI) {
30
- return function (expandNodePos, expandNode) {
31
- return function (state, dispatch) {
32
- if (!expandNode || isNaN(expandNodePos)) {
33
- return false;
34
- }
35
- var payload = {
36
- action: _analytics.ACTION.DELETED,
37
- actionSubject: expandNode.type === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
38
- attributes: {
39
- inputMethod: _analytics.INPUT_METHOD.TOOLBAR
40
- },
41
- eventType: _analytics.EVENT_TYPE.TRACK
42
- };
43
- if (expandNode && dispatch) {
44
- var tr = state.tr;
45
- tr.delete(expandNodePos, expandNodePos + expandNode.nodeSize);
46
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
47
- dispatch(tr);
48
- }
49
- return true;
50
- };
51
- };
52
- };
53
- var deleteExpand = exports.deleteExpand = function deleteExpand(editorAnalyticsAPI) {
54
- return function (state, dispatch) {
55
- var expandNode = (0, _utils2.findExpand)(state);
56
- if (!expandNode) {
57
- return false;
58
- }
59
- return deleteExpandAtPos(editorAnalyticsAPI)(expandNode.pos, expandNode.node)(state, dispatch);
60
- };
61
- };
62
- var updateExpandTitle = exports.updateExpandTitle = function updateExpandTitle(title, pos, nodeType) {
63
- return function (state, dispatch) {
64
- var node = state.doc.nodeAt(pos);
65
- if (node && node.type === nodeType && dispatch) {
66
- var tr = state.tr;
67
- tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
68
- title: title
69
- }), node.marks);
70
- dispatch(tr);
71
- }
72
- return true;
73
- };
74
- };
75
- var toggleExpandExpanded = exports.toggleExpandExpanded = function toggleExpandExpanded(editorAnalyticsAPI) {
76
- return function (pos, nodeType) {
77
- return function (state, dispatch) {
78
- var node = state.doc.nodeAt(pos);
79
- if (node && node.type === nodeType && dispatch) {
80
- var tr = state.tr;
81
- var isExpandedNext = !node.attrs.__expanded;
82
- tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
83
- __expanded: isExpandedNext
84
- }), node.marks);
85
-
86
- // If we're going to collapse the expand and our cursor is currently inside
87
- // Move to a right gap cursor, if the toolbar is interacted (or an API),
88
- // it will insert below rather than inside (which will be invisible).
89
- if (isExpandedNext === false && (0, _utils2.findExpand)(state)) {
90
- tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), _selection.Side.RIGHT));
91
- }
92
-
93
- // log when people open/close expands
94
- // TODO: ED-8523 make platform/mode global attributes?
95
- var payload = {
96
- action: _analytics.ACTION.TOGGLE_EXPAND,
97
- actionSubject: nodeType === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
98
- attributes: {
99
- platform: _analytics.PLATFORMS.WEB,
100
- mode: _analytics.MODE.EDITOR,
101
- expanded: isExpandedNext
102
- },
103
- eventType: _analytics.EVENT_TYPE.TRACK
104
- };
105
-
106
- // `isRemote` meta prevents this step from being
107
- // sync'd between sessions in collab edit
108
- tr.setMeta('isRemote', true);
109
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
110
- dispatch(tr);
111
- }
112
- return true;
113
- };
114
- };
115
- };
116
-
117
- // Creates either an expand or a nestedExpand node based on the current selection
118
- var createExpandNode = exports.createExpandNode = function createExpandNode(state) {
119
- var _state$schema$nodes = state.schema.nodes,
120
- expand = _state$schema$nodes.expand,
121
- nestedExpand = _state$schema$nodes.nestedExpand;
122
- var expandType = (0, _utils.findTable)(state.selection) ? nestedExpand : expand;
123
- return expandType.createAndFill({});
124
- };
125
- var insertExpand = exports.insertExpand = function insertExpand(editorAnalyticsAPI) {
126
- return function (state, dispatch) {
127
- var expandNode = createExpandNode(state);
128
- if (!expandNode) {
129
- return false;
130
- }
131
- var tr = state.selection.empty ? (0, _utils4.safeInsert)(expandNode)(state.tr).scrollIntoView() : (0, _utils3.createWrapSelectionTransaction)({
132
- state: state,
133
- type: expandNode.type
134
- });
135
- var payload = {
136
- action: _analytics.ACTION.INSERTED,
137
- actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
138
- actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT_ID.EXPAND : _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND,
139
- attributes: {
140
- inputMethod: _analytics.INPUT_METHOD.INSERT_MENU
141
- },
142
- eventType: _analytics.EVENT_TYPE.TRACK
143
- };
144
- if (dispatch && expandNode) {
145
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
146
- dispatch(tr);
147
- }
148
- return true;
149
- };
150
- };
151
- var focusTitle = exports.focusTitle = function focusTitle(pos) {
152
- return function (state, dispatch, editorView) {
153
- if (editorView) {
154
- var dom = editorView.domAtPos(pos);
155
- var expandWrapper = dom.node.parentElement;
156
- if (expandWrapper) {
157
- setSelectionInsideExpand(pos)(state, dispatch, editorView);
158
- var input = expandWrapper.querySelector('input');
159
- if (input) {
160
- input.focus();
161
- return true;
162
- }
163
- }
164
- }
165
- return false;
166
- };
167
- };
168
-
169
- // Used to clear any node or cell selection when expand title is focused
170
- var setSelectionInsideExpand = exports.setSelectionInsideExpand = function setSelectionInsideExpand(expandPos) {
171
- return function (state, dispatch, editorView) {
172
- if (editorView) {
173
- if (!editorView.hasFocus()) {
174
- editorView.focus();
175
- }
176
- var sel = _state.Selection.findFrom(editorView.state.doc.resolve(expandPos), 1, true);
177
- if (sel && dispatch) {
178
- dispatch(editorView.state.tr.setSelection(sel));
179
- }
180
- return true;
181
- }
182
- return false;
183
- };
184
- };
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- exports.isExpandInsertionEnabled = isExpandInsertionEnabled;
9
- Object.defineProperty(exports, "pluginKey", {
10
- enumerable: true,
11
- get: function get() {
12
- return _pluginFactory.pluginKey;
13
- }
14
- });
15
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _adfSchema = require("@atlaskit/adf-schema");
18
- var _main = require("./pm-plugins/main");
19
- var _keymap = require("./pm-plugins/keymap");
20
- var _quickInsert = require("@atlaskit/editor-common/quick-insert");
21
- var _analytics = require("@atlaskit/editor-common/analytics");
22
- var _toolbar = require("./toolbar");
23
- var _commands = require("./commands");
24
- var _messages = require("@atlaskit/editor-common/messages");
25
- var _utils = require("@atlaskit/editor-common/utils");
26
- var _pluginFactory = require("./pm-plugins/plugin-factory");
27
- var expandPlugin = function expandPlugin(_ref) {
28
- var _api$featureFlags, _api$analytics;
29
- var _ref$config = _ref.config,
30
- options = _ref$config === void 0 ? {} : _ref$config,
31
- api = _ref.api;
32
- var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
33
- return {
34
- name: 'expand',
35
- nodes: function nodes() {
36
- return [{
37
- name: 'expand',
38
- node: _adfSchema.expand
39
- }, {
40
- name: 'nestedExpand',
41
- node: _adfSchema.nestedExpand
42
- }];
43
- },
44
- actions: {
45
- insertExpand: (0, _commands.insertExpand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
46
- },
47
- pmPlugins: function pmPlugins() {
48
- return [{
49
- name: 'expand',
50
- plugin: function plugin(_ref2) {
51
- var dispatch = _ref2.dispatch,
52
- getIntl = _ref2.getIntl;
53
- return (0, _main.createPlugin)(dispatch, getIntl, options.appearance, options.useLongPressSelection, featureFlags, api);
54
- }
55
- }, {
56
- name: 'expandKeymap',
57
- plugin: function plugin() {
58
- return (0, _keymap.expandKeymap)(api);
59
- }
60
- }];
61
- },
62
- pluginsOptions: {
63
- floatingToolbar: (0, _toolbar.getToolbarConfig)(api),
64
- quickInsert: function quickInsert(_ref3) {
65
- var formatMessage = _ref3.formatMessage;
66
- if (options && options.allowInsertion !== true) {
67
- return [];
68
- }
69
- return [{
70
- id: 'expand',
71
- title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
72
- description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
73
- keywords: ['accordion', 'collapse'],
74
- priority: 600,
75
- icon: function icon() {
76
- return /*#__PURE__*/_react.default.createElement(_quickInsert.IconExpand, null);
77
- },
78
- action: function action(insert, state) {
79
- var _api$analytics2;
80
- var node = (0, _commands.createExpandNode)(state);
81
- if (!node) {
82
- return false;
83
- }
84
- var tr = state.selection.empty ? insert(node) : (0, _utils.createWrapSelectionTransaction)({
85
- state: state,
86
- type: node.type
87
- });
88
- api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
89
- action: _analytics.ACTION.INSERTED,
90
- actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
91
- actionSubjectId: node.type === state.schema.nodes.nestedExpand ? _analytics.ACTION_SUBJECT_ID.NESTED_EXPAND : _analytics.ACTION_SUBJECT_ID.EXPAND,
92
- attributes: {
93
- inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
94
- },
95
- eventType: _analytics.EVENT_TYPE.TRACK
96
- })(tr);
97
- return tr;
98
- }
99
- }];
100
- }
101
- }
102
- };
103
- };
104
- var _default = exports.default = expandPlugin;
105
- function isExpandInsertionEnabled(_ref4) {
106
- var allowExpand = _ref4.allowExpand;
107
- if (allowExpand && (0, _typeof2.default)(allowExpand) === 'object') {
108
- return !!allowExpand.allowInsertion;
109
- }
110
- return false;
111
- }