@atlaskit/editor-core 196.1.0 → 197.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 197.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#135270](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135270)
8
+ [`4a75557335357`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4a75557335357) -
9
+ [ux] [ED-23237] feat(node data provider): wire up to emoji provider
10
+
11
+ ## 197.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - [#135235](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135235)
16
+ [`f67578e7140b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f67578e7140b5) -
17
+ removed MobileAppearance from editor-core, removed editor-mobile-bridge testing step from a
18
+ pipeline
19
+
3
20
  ## 196.1.0
4
21
 
5
22
  ### Minor Changes
@@ -8,7 +8,6 @@ exports.default = getUiComponent;
8
8
  var _Chromeless = _interopRequireDefault(require("../ui/Appearance/Chromeless"));
9
9
  var _Comment = _interopRequireDefault(require("../ui/Appearance/Comment"));
10
10
  var _FullPage = _interopRequireDefault(require("../ui/Appearance/FullPage"));
11
- var _Mobile = _interopRequireDefault(require("../ui/Appearance/Mobile"));
12
11
  function getUiComponent(appearance) {
13
12
  appearance = appearance || 'comment';
14
13
  switch (appearance) {
@@ -19,8 +18,6 @@ function getUiComponent(appearance) {
19
18
  return _Chromeless.default;
20
19
  case 'comment':
21
20
  return _Comment.default;
22
- case 'mobile':
23
- return _Mobile.default;
24
21
  default:
25
22
  throw new Error("Appearance '".concat(appearance, "' is not supported by the editor."));
26
23
  }
@@ -19,8 +19,7 @@ function shouldRecreatePreset(props, nextProps) {
19
19
  return shouldReconfigureState(props, nextProps);
20
20
  }
21
21
  function shouldReconfigureState(props, nextProps) {
22
- var mobileProperties = props.appearance === 'mobile' ? ['quickInsert', 'featureFlags'] : [];
23
- var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
22
+ var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
24
23
  return properties.reduce(function (acc, curr) {
25
24
  return acc || props[curr] !== nextProps[curr];
26
25
  }, false);
@@ -63,6 +63,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
63
63
  /**
64
64
  * Mechanism to configuring plugins as the universal preset blocks direct access
65
65
  * to configuring plugins.
66
+ *
67
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
66
68
  */
67
69
 
68
70
  /**
@@ -77,7 +79,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
77
79
  * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
78
80
  */
79
81
  function createUniversalPresetInternal(_ref) {
80
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
82
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
81
83
  var appearance = _ref.appearance,
82
84
  props = _ref.props,
83
85
  featureFlags = _ref.featureFlags,
@@ -139,7 +141,9 @@ function createUniversalPresetInternal(_ref) {
139
141
  allowZeroWidthSpaceAfter: !isMobile,
140
142
  HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent,
141
143
  profilecardProvider: (_props$mention3 = props.mention) === null || _props$mention3 === void 0 ? void 0 : _props$mention3.profilecardProvider
142
- }, initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)], Boolean(props.mentionProvider)).maybeAdd(_emoji.emojiPlugin, Boolean(props.emojiProvider)).maybeAdd([_table.tablesPlugin, _objectSpread({
144
+ }, initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)], Boolean(props.mentionProvider)).maybeAdd([_emoji.emojiPlugin, {
145
+ emojiNodeDataProvider: initialPluginConfiguration === null || initialPluginConfiguration === void 0 || (_initialPluginConfigu = initialPluginConfiguration.emoji) === null || _initialPluginConfigu === void 0 ? void 0 : _initialPluginConfigu.emojiNodeDataProvider
146
+ }], Boolean(props.emojiProvider)).maybeAdd([_table.tablesPlugin, _objectSpread({
143
147
  tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
144
148
  dragAndDropEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableDragAndDrop) && (isFullPage || (isComment || isChromeless) && (0, _platformFeatureFlags.fg)('platform_editor_table_support_in_comment')),
145
149
  isTableScalingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tablePreserveWidth) && (isFullPage || isComment && (0, _platformFeatureFlags.fg)('platform_editor_table_support_in_comment')),
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "196.1.0";
8
+ var version = exports.version = "197.1.0";
@@ -1,7 +1,6 @@
1
1
  import Chromeless from '../ui/Appearance/Chromeless';
2
2
  import Comment from '../ui/Appearance/Comment';
3
3
  import FullPage from '../ui/Appearance/FullPage';
4
- import Mobile from '../ui/Appearance/Mobile';
5
4
  export default function getUiComponent(appearance) {
6
5
  appearance = appearance || 'comment';
7
6
  switch (appearance) {
@@ -12,8 +11,6 @@ export default function getUiComponent(appearance) {
12
11
  return Chromeless;
13
12
  case 'comment':
14
13
  return Comment;
15
- case 'mobile':
16
- return Mobile;
17
14
  default:
18
15
  throw new Error(`Appearance '${appearance}' is not supported by the editor.`);
19
16
  }
@@ -9,7 +9,6 @@ export function shouldRecreatePreset(props, nextProps) {
9
9
  return shouldReconfigureState(props, nextProps);
10
10
  }
11
11
  function shouldReconfigureState(props, nextProps) {
12
- const mobileProperties = props.appearance === 'mobile' ? ['quickInsert', 'featureFlags'] : [];
13
- const properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent', ...mobileProperties];
12
+ const properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
14
13
  return properties.reduce((acc, curr) => acc || props[curr] !== nextProps[curr], false);
15
14
  }
@@ -52,6 +52,8 @@ import { createDefaultPreset } from './default';
52
52
  /**
53
53
  * Mechanism to configuring plugins as the universal preset blocks direct access
54
54
  * to configuring plugins.
55
+ *
56
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
55
57
  */
56
58
 
57
59
  /**
@@ -73,7 +75,7 @@ export default function createUniversalPresetInternal({
73
75
  prevAppearance,
74
76
  createAnalyticsEvent
75
77
  }) {
76
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
78
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
77
79
  const isMobile = appearance === 'mobile';
78
80
  const isComment = appearance === 'comment';
79
81
  const isChromeless = appearance === 'chromeless';
@@ -131,7 +133,9 @@ export default function createUniversalPresetInternal({
131
133
  HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent,
132
134
  profilecardProvider: (_props$mention3 = props.mention) === null || _props$mention3 === void 0 ? void 0 : _props$mention3.profilecardProvider,
133
135
  ...(initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)
134
- }], Boolean(props.mentionProvider)).maybeAdd(emojiPlugin, Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, {
136
+ }], Boolean(props.mentionProvider)).maybeAdd([emojiPlugin, {
137
+ emojiNodeDataProvider: initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : (_initialPluginConfigu = initialPluginConfiguration.emoji) === null || _initialPluginConfigu === void 0 ? void 0 : _initialPluginConfigu.emojiNodeDataProvider
138
+ }], Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, {
135
139
  tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
136
140
  dragAndDropEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableDragAndDrop) && (isFullPage || (isComment || isChromeless) && fg('platform_editor_table_support_in_comment')),
137
141
  isTableScalingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tablePreserveWidth) && (isFullPage || isComment && fg('platform_editor_table_support_in_comment')),
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "196.1.0";
2
+ export const version = "197.1.0";
@@ -1,7 +1,6 @@
1
1
  import Chromeless from '../ui/Appearance/Chromeless';
2
2
  import Comment from '../ui/Appearance/Comment';
3
3
  import FullPage from '../ui/Appearance/FullPage';
4
- import Mobile from '../ui/Appearance/Mobile';
5
4
  export default function getUiComponent(appearance) {
6
5
  appearance = appearance || 'comment';
7
6
  switch (appearance) {
@@ -12,8 +11,6 @@ export default function getUiComponent(appearance) {
12
11
  return Chromeless;
13
12
  case 'comment':
14
13
  return Comment;
15
- case 'mobile':
16
- return Mobile;
17
14
  default:
18
15
  throw new Error("Appearance '".concat(appearance, "' is not supported by the editor."));
19
16
  }
@@ -13,8 +13,7 @@ export function shouldRecreatePreset(props, nextProps) {
13
13
  return shouldReconfigureState(props, nextProps);
14
14
  }
15
15
  function shouldReconfigureState(props, nextProps) {
16
- var mobileProperties = props.appearance === 'mobile' ? ['quickInsert', 'featureFlags'] : [];
17
- var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
16
+ var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
18
17
  return properties.reduce(function (acc, curr) {
19
18
  return acc || props[curr] !== nextProps[curr];
20
19
  }, false);
@@ -56,6 +56,8 @@ import { createDefaultPreset } from './default';
56
56
  /**
57
57
  * Mechanism to configuring plugins as the universal preset blocks direct access
58
58
  * to configuring plugins.
59
+ *
60
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
59
61
  */
60
62
 
61
63
  /**
@@ -70,7 +72,7 @@ import { createDefaultPreset } from './default';
70
72
  * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
71
73
  */
72
74
  export default function createUniversalPresetInternal(_ref) {
73
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
75
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
74
76
  var appearance = _ref.appearance,
75
77
  props = _ref.props,
76
78
  featureFlags = _ref.featureFlags,
@@ -132,7 +134,9 @@ export default function createUniversalPresetInternal(_ref) {
132
134
  allowZeroWidthSpaceAfter: !isMobile,
133
135
  HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent,
134
136
  profilecardProvider: (_props$mention3 = props.mention) === null || _props$mention3 === void 0 ? void 0 : _props$mention3.profilecardProvider
135
- }, initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)], Boolean(props.mentionProvider)).maybeAdd(emojiPlugin, Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, _objectSpread({
137
+ }, initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)], Boolean(props.mentionProvider)).maybeAdd([emojiPlugin, {
138
+ emojiNodeDataProvider: initialPluginConfiguration === null || initialPluginConfiguration === void 0 || (_initialPluginConfigu = initialPluginConfiguration.emoji) === null || _initialPluginConfigu === void 0 ? void 0 : _initialPluginConfigu.emojiNodeDataProvider
139
+ }], Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, _objectSpread({
136
140
  tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
137
141
  dragAndDropEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableDragAndDrop) && (isFullPage || (isComment || isChromeless) && fg('platform_editor_table_support_in_comment')),
138
142
  isTableScalingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tablePreserveWidth) && (isFullPage || isComment && fg('platform_editor_table_support_in_comment')),
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "196.1.0";
2
+ export var version = "197.1.0";
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
+ import { type EmojiPluginOptions } from '@atlaskit/editor-plugins/emoji';
4
5
  import type { EditorProps } from '../types';
5
6
  import type { EditorPluginFeatureProps, EditorProviderProps, EditorSharedPropsWithPlugins } from '../types/editor-props';
6
7
  import type { FeatureFlags } from '../types/feature-flags';
@@ -9,6 +10,8 @@ type UniversalPresetProps = DefaultPresetPluginOptions & EditorSharedPropsWithPl
9
10
  /**
10
11
  * Mechanism to configuring plugins as the universal preset blocks direct access
11
12
  * to configuring plugins.
13
+ *
14
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
12
15
  */
13
16
  export type InitialPluginConfiguration = {
14
17
  mentionsPlugin?: {
@@ -21,6 +24,9 @@ export type InitialPluginConfiguration = {
21
24
  tablesPlugin?: {
22
25
  tableResizingEnabled?: boolean;
23
26
  };
27
+ emoji?: {
28
+ emojiNodeDataProvider?: EmojiPluginOptions['emojiNodeDataProvider'];
29
+ };
24
30
  };
25
31
  /**
26
32
  * Creates a preset with all of the available plugins.
@@ -784,6 +790,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
784
790
  }, FeatureFlags>>];
785
791
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
786
792
  actions: {
793
+ /**
794
+ * Mechanism to configuring plugins as the universal preset blocks direct access
795
+ * to configuring plugins.
796
+ *
797
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
798
+ */
787
799
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
788
800
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
789
801
  insert: (props: {
@@ -1049,6 +1061,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1049
1061
  }, FeatureFlags>>];
1050
1062
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
1051
1063
  actions: {
1064
+ /**
1065
+ * Mechanism to configuring plugins as the universal preset blocks direct access
1066
+ * to configuring plugins.
1067
+ *
1068
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
1069
+ */
1052
1070
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
1053
1071
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
1054
1072
  insert: (props: {
@@ -1422,6 +1440,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1422
1440
  }, FeatureFlags>>];
1423
1441
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
1424
1442
  actions: {
1443
+ /**
1444
+ * Mechanism to configuring plugins as the universal preset blocks direct access
1445
+ * to configuring plugins.
1446
+ *
1447
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
1448
+ */
1425
1449
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
1426
1450
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
1427
1451
  insert: (props: {
@@ -2045,6 +2069,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2045
2069
  }, FeatureFlags>>];
2046
2070
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2047
2071
  actions: {
2072
+ /**
2073
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2074
+ * to configuring plugins.
2075
+ *
2076
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2077
+ */
2048
2078
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2049
2079
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2050
2080
  insert: (props: {
@@ -2124,6 +2154,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2124
2154
  }, FeatureFlags>>];
2125
2155
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2126
2156
  actions: {
2157
+ /**
2158
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2159
+ * to configuring plugins.
2160
+ *
2161
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2162
+ */
2127
2163
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2128
2164
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2129
2165
  insert: (props: {
@@ -2253,7 +2289,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2253
2289
  sharedState: FeatureFlags;
2254
2290
  }, FeatureFlags>>];
2255
2291
  }, import("@atlaskit/editor-plugins/table").TablePluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"emoji", {
2256
- pluginConfiguration: import("@atlaskit/editor-plugins/emoji").EmojiPluginOptions | undefined;
2292
+ pluginConfiguration: EmojiPluginOptions | undefined;
2257
2293
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2258
2294
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2259
2295
  sharedState: {
@@ -2286,6 +2322,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2286
2322
  }, FeatureFlags>>];
2287
2323
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2288
2324
  actions: {
2325
+ /**
2326
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2327
+ * to configuring plugins.
2328
+ *
2329
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2330
+ */
2289
2331
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2290
2332
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2291
2333
  insert: (props: {
@@ -2319,7 +2361,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2319
2361
  actions: {
2320
2362
  openTypeAhead: (inputMethod: import("@atlaskit/editor-plugin-type-ahead").TypeAheadInputMethod) => boolean;
2321
2363
  };
2322
- }, import("@atlaskit/editor-plugins/emoji").EmojiPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"mention", {
2364
+ }, EmojiPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"mention", {
2323
2365
  pluginConfiguration: import("@atlaskit/editor-plugins/mentions").MentionPluginOptions | undefined;
2324
2366
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2325
2367
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
@@ -2353,6 +2395,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2353
2395
  }, FeatureFlags>>];
2354
2396
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2355
2397
  actions: {
2398
+ /**
2399
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2400
+ * to configuring plugins.
2401
+ *
2402
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2403
+ */
2356
2404
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2357
2405
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2358
2406
  insert: (props: {
@@ -3198,6 +3246,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
3198
3246
  }, FeatureFlags>>];
3199
3247
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
3200
3248
  actions: {
3249
+ /**
3250
+ * Mechanism to configuring plugins as the universal preset blocks direct access
3251
+ * to configuring plugins.
3252
+ *
3253
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
3254
+ */
3201
3255
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
3202
3256
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
3203
3257
  insert: (props: {
@@ -3898,6 +3952,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
3898
3952
  }, FeatureFlags>>];
3899
3953
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
3900
3954
  actions: {
3955
+ /**
3956
+ * Mechanism to configuring plugins as the universal preset blocks direct access
3957
+ * to configuring plugins.
3958
+ *
3959
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
3960
+ */
3901
3961
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
3902
3962
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
3903
3963
  insert: (props: {
@@ -3946,6 +4006,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
3946
4006
  }, FeatureFlags>>];
3947
4007
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
3948
4008
  actions: {
4009
+ /**
4010
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4011
+ * to configuring plugins.
4012
+ *
4013
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4014
+ */
3949
4015
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
3950
4016
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
3951
4017
  insert: (props: {
@@ -4321,6 +4387,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
4321
4387
  }, FeatureFlags>>];
4322
4388
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
4323
4389
  actions: {
4390
+ /**
4391
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4392
+ * to configuring plugins.
4393
+ *
4394
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4395
+ */
4324
4396
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
4325
4397
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
4326
4398
  insert: (props: {
@@ -4387,6 +4459,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
4387
4459
  }, FeatureFlags>>];
4388
4460
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
4389
4461
  actions: {
4462
+ /**
4463
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4464
+ * to configuring plugins.
4465
+ *
4466
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4467
+ */
4390
4468
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
4391
4469
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
4392
4470
  insert: (props: {
@@ -5167,6 +5245,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
5167
5245
  }, FeatureFlags>>];
5168
5246
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
5169
5247
  actions: {
5248
+ /**
5249
+ * Mechanism to configuring plugins as the universal preset blocks direct access
5250
+ * to configuring plugins.
5251
+ *
5252
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
5253
+ */
5170
5254
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
5171
5255
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
5172
5256
  insert: (props: {
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
+ import { type EmojiPluginOptions } from '@atlaskit/editor-plugins/emoji';
4
5
  import type { EditorProps } from '../types';
5
6
  import type { EditorPluginFeatureProps, EditorProviderProps, EditorSharedPropsWithPlugins } from '../types/editor-props';
6
7
  import type { FeatureFlags } from '../types/feature-flags';
@@ -9,6 +10,8 @@ type UniversalPresetProps = DefaultPresetPluginOptions & EditorSharedPropsWithPl
9
10
  /**
10
11
  * Mechanism to configuring plugins as the universal preset blocks direct access
11
12
  * to configuring plugins.
13
+ *
14
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
12
15
  */
13
16
  export type InitialPluginConfiguration = {
14
17
  mentionsPlugin?: {
@@ -21,6 +24,9 @@ export type InitialPluginConfiguration = {
21
24
  tablesPlugin?: {
22
25
  tableResizingEnabled?: boolean;
23
26
  };
27
+ emoji?: {
28
+ emojiNodeDataProvider?: EmojiPluginOptions['emojiNodeDataProvider'];
29
+ };
24
30
  };
25
31
  /**
26
32
  * Creates a preset with all of the available plugins.
@@ -1033,6 +1039,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1033
1039
  ];
1034
1040
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
1035
1041
  actions: {
1042
+ /**
1043
+ * Mechanism to configuring plugins as the universal preset blocks direct access
1044
+ * to configuring plugins.
1045
+ *
1046
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
1047
+ */
1036
1048
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
1037
1049
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
1038
1050
  insert: (props: {
@@ -1349,6 +1361,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1349
1361
  ];
1350
1362
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
1351
1363
  actions: {
1364
+ /**
1365
+ * Mechanism to configuring plugins as the universal preset blocks direct access
1366
+ * to configuring plugins.
1367
+ *
1368
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
1369
+ */
1352
1370
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
1353
1371
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
1354
1372
  insert: (props: {
@@ -1807,6 +1825,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1807
1825
  ];
1808
1826
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
1809
1827
  actions: {
1828
+ /**
1829
+ * Mechanism to configuring plugins as the universal preset blocks direct access
1830
+ * to configuring plugins.
1831
+ *
1832
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
1833
+ */
1810
1834
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
1811
1835
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
1812
1836
  insert: (props: {
@@ -2564,6 +2588,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2564
2588
  ];
2565
2589
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2566
2590
  actions: {
2591
+ /**
2592
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2593
+ * to configuring plugins.
2594
+ *
2595
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2596
+ */
2567
2597
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2568
2598
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2569
2599
  insert: (props: {
@@ -2657,6 +2687,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2657
2687
  ];
2658
2688
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2659
2689
  actions: {
2690
+ /**
2691
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2692
+ * to configuring plugins.
2693
+ *
2694
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2695
+ */
2660
2696
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2661
2697
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2662
2698
  insert: (props: {
@@ -2813,7 +2849,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2813
2849
  ];
2814
2850
  }, import("@atlaskit/editor-plugins/table").TablePluginOptions | undefined> | undefined,
2815
2851
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"emoji", {
2816
- pluginConfiguration: import("@atlaskit/editor-plugins/emoji").EmojiPluginOptions | undefined;
2852
+ pluginConfiguration: EmojiPluginOptions | undefined;
2817
2853
  dependencies: [
2818
2854
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2819
2855
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
@@ -2855,6 +2891,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2855
2891
  ];
2856
2892
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2857
2893
  actions: {
2894
+ /**
2895
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2896
+ * to configuring plugins.
2897
+ *
2898
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2899
+ */
2858
2900
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2859
2901
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2860
2902
  insert: (props: {
@@ -2889,7 +2931,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2889
2931
  actions: {
2890
2932
  openTypeAhead: (inputMethod: import("@atlaskit/editor-plugin-type-ahead").TypeAheadInputMethod) => boolean;
2891
2933
  };
2892
- }, import("@atlaskit/editor-plugins/emoji").EmojiPluginOptions | undefined> | undefined,
2934
+ }, EmojiPluginOptions | undefined> | undefined,
2893
2935
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"mention", {
2894
2936
  pluginConfiguration: import("@atlaskit/editor-plugins/mentions").MentionPluginOptions | undefined;
2895
2937
  dependencies: [
@@ -2933,6 +2975,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2933
2975
  ];
2934
2976
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
2935
2977
  actions: {
2978
+ /**
2979
+ * Mechanism to configuring plugins as the universal preset blocks direct access
2980
+ * to configuring plugins.
2981
+ *
2982
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
2983
+ */
2936
2984
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
2937
2985
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
2938
2986
  insert: (props: {
@@ -3969,6 +4017,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
3969
4017
  ];
3970
4018
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
3971
4019
  actions: {
4020
+ /**
4021
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4022
+ * to configuring plugins.
4023
+ *
4024
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4025
+ */
3972
4026
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
3973
4027
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
3974
4028
  insert: (props: {
@@ -4837,6 +4891,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
4837
4891
  ];
4838
4892
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
4839
4893
  actions: {
4894
+ /**
4895
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4896
+ * to configuring plugins.
4897
+ *
4898
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4899
+ */
4840
4900
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
4841
4901
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
4842
4902
  insert: (props: {
@@ -4893,6 +4953,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
4893
4953
  ];
4894
4954
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
4895
4955
  actions: {
4956
+ /**
4957
+ * Mechanism to configuring plugins as the universal preset blocks direct access
4958
+ * to configuring plugins.
4959
+ *
4960
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
4961
+ */
4896
4962
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
4897
4963
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
4898
4964
  insert: (props: {
@@ -5349,6 +5415,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
5349
5415
  ];
5350
5416
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
5351
5417
  actions: {
5418
+ /**
5419
+ * Mechanism to configuring plugins as the universal preset blocks direct access
5420
+ * to configuring plugins.
5421
+ *
5422
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
5423
+ */
5352
5424
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
5353
5425
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
5354
5426
  insert: (props: {
@@ -5426,6 +5498,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
5426
5498
  ];
5427
5499
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
5428
5500
  actions: {
5501
+ /**
5502
+ * Mechanism to configuring plugins as the universal preset blocks direct access
5503
+ * to configuring plugins.
5504
+ *
5505
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
5506
+ */
5429
5507
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
5430
5508
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
5431
5509
  insert: (props: {
@@ -6382,6 +6460,12 @@ export default function createUniversalPresetInternal({ appearance, props, featu
6382
6460
  ];
6383
6461
  sharedState: import("@atlaskit/editor-plugin-type-ahead").TypeAheadPluginSharedState;
6384
6462
  actions: {
6463
+ /**
6464
+ * Mechanism to configuring plugins as the universal preset blocks direct access
6465
+ * to configuring plugins.
6466
+ *
6467
+ * Note: not all plugins are configurable via this mechanism, and for plugins configured -- it is only doing a subset of the configuration.
6468
+ */
6385
6469
  isOpen: (editorState: import("prosemirror-state").EditorState) => boolean;
6386
6470
  isAllowed: (editorState: import("prosemirror-state").EditorState) => boolean;
6387
6471
  insert: (props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "196.1.0",
3
+ "version": "197.1.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
47
47
  "@atlaskit/button": "^20.1.0",
48
48
  "@atlaskit/editor-common": "^88.4.0",
49
- "@atlaskit/editor-plugins": "^4.2.0",
49
+ "@atlaskit/editor-plugins": "^4.3.0",
50
50
  "@atlaskit/editor-prosemirror": "5.0.1",
51
51
  "@atlaskit/editor-shared-styles": "^2.13.0",
52
52
  "@atlaskit/emoji": "^67.7.0",
@@ -80,7 +80,7 @@
80
80
  "react-intl-next": "npm:react-intl@^5.18.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@af/editor-examples-helpers": "0.3.4",
83
+ "@af/editor-examples-helpers": "0.3.5",
84
84
  "@af/editor-libra": "*",
85
85
  "@af/visual-regression": "*",
86
86
  "@atlaskit/adf-utils": "^19.8.0",
@@ -1,52 +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 = Mobile;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Mobile = require("../AppearanceComponents/Mobile");
10
- var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
11
- function Mobile(_ref) {
12
- var _innerRef$current;
13
- var editorView = _ref.editorView,
14
- maxHeight = _ref.maxHeight,
15
- persistScrollGutter = _ref.persistScrollGutter,
16
- editorDOMElement = _ref.editorDOMElement,
17
- disabled = _ref.disabled,
18
- contentComponents = _ref.contentComponents,
19
- editorActions = _ref.editorActions,
20
- eventDispatcher = _ref.eventDispatcher,
21
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
22
- providerFactory = _ref.providerFactory,
23
- appearance = _ref.appearance,
24
- popupsMountPoint = _ref.popupsMountPoint,
25
- popupsBoundariesElement = _ref.popupsBoundariesElement,
26
- popupsScrollableElement = _ref.popupsScrollableElement,
27
- innerRef = _ref.innerRef,
28
- pluginHooks = _ref.pluginHooks,
29
- featureFlags = _ref.featureFlags;
30
- return /*#__PURE__*/_react.default.createElement(_Mobile.MobileAppearance, {
31
- ref: innerRef,
32
- editorView: editorView || null,
33
- maxHeight: maxHeight,
34
- persistScrollGutter: persistScrollGutter,
35
- editorDisabled: disabled,
36
- featureFlags: featureFlags
37
- }, editorDOMElement, /*#__PURE__*/_react.default.createElement(_PluginSlot.default, {
38
- editorView: editorView,
39
- editorActions: editorActions,
40
- eventDispatcher: eventDispatcher,
41
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
42
- providerFactory: providerFactory,
43
- appearance: appearance,
44
- popupsMountPoint: popupsMountPoint,
45
- popupsBoundariesElement: popupsBoundariesElement,
46
- popupsScrollableElement: popupsScrollableElement,
47
- containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
48
- disabled: !!disabled,
49
- wrapperElement: null,
50
- pluginHooks: pluginHooks
51
- }));
52
- }
@@ -1,110 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.MobileAppearance = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _react2 = require("@emotion/react");
11
- var _hooks = require("@atlaskit/editor-common/hooks");
12
- var _context = require("../../presets/context");
13
- var _Addon = require("../Addon");
14
- var _ContentStyles = require("../ContentStyles");
15
- var _WithFlash = _interopRequireDefault(require("../WithFlash"));
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
- /**
19
- * @jsxRuntime classic
20
- * @jsx jsx
21
- */
22
-
23
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
-
25
- // Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
26
- // Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
27
-
28
- // Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
29
-
30
- var mobileEditor = (0, _react2.css)({
31
- minHeight: '30px',
32
- width: '100%',
33
- maxWidth: 'inherit',
34
- boxSizing: 'border-box',
35
- wordWrap: 'break-word',
36
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
37
- 'div > .ProseMirror': {
38
- outline: 'none',
39
- whiteSpace: 'pre-wrap',
40
- padding: 0,
41
- margin: 0
42
- }
43
- });
44
- var ContentArea = (0, _ContentStyles.createEditorContentStyle)();
45
- ContentArea.displayName = 'ContentArea';
46
- var MobileAppearance = exports.MobileAppearance = /*#__PURE__*/(0, _react.forwardRef)(function MobileAppearance(_ref, ref) {
47
- var _api$base2;
48
- var editorView = _ref.editorView,
49
- persistScrollGutter = _ref.persistScrollGutter,
50
- children = _ref.children,
51
- editorDisabled = _ref.editorDisabled,
52
- featureFlags = _ref.featureFlags;
53
- var api = (0, _context.usePresetContext)();
54
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize', 'mobileDimensions']),
55
- maxContentSizeState = _useSharedPluginState.maxContentSizeState,
56
- mobileDimensionsState = _useSharedPluginState.mobileDimensionsState;
57
- var render = (0, _react.useCallback)(function (_ref2) {
58
- var maxContentSize = _ref2.maxContentSize,
59
- mobileDimensions = _ref2.mobileDimensions;
60
- var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
61
- var minHeight = 100;
62
- var currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
63
- if (mobileDimensions) {
64
- var _api$base, _basePluginState$keyb;
65
- var windowHeight = mobileDimensions.windowHeight,
66
- mobilePaddingTop = mobileDimensions.mobilePaddingTop,
67
- isExpanded = mobileDimensions.isExpanded;
68
- var basePluginState = api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
69
- var keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
70
-
71
- /*
72
- We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
73
- This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
74
- but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
75
- is scrolled nevertheless, and it gives the sensation that the content was lost.
76
- */
77
-
78
- if (!persistScrollGutter) {
79
- // in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
80
- // in Android keyboardHeight is always set to -1;
81
- minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
82
- } else {
83
- // in iOS Compact Editor windowHeight excludes keyboardHeight
84
- minHeight = windowHeight - mobilePaddingTop;
85
- // isExpanded can be true of false for Compact editor
86
- currentIsExpanded = isExpanded;
87
- }
88
- }
89
- return (0, _react2.jsx)(_WithFlash.default, {
90
- animate: maxContentSizeReached
91
- }, (0, _react2.jsx)("div", {
92
- css: mobileEditor,
93
- ref: ref
94
- }, (0, _react2.jsx)(_Addon.ClickAreaMobile, {
95
- editorView: editorView || undefined,
96
- minHeight: minHeight,
97
- persistScrollGutter: persistScrollGutter,
98
- isExpanded: currentIsExpanded,
99
- editorDisabled: editorDisabled
100
- }, (0, _react2.jsx)(ContentArea, {
101
- featureFlags: featureFlags
102
- }, (0, _react2.jsx)("div", {
103
- className: "ak-editor-content-area"
104
- }, children)))));
105
- }, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 || (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
106
- return render({
107
- maxContentSize: maxContentSizeState,
108
- mobileDimensions: mobileDimensionsState
109
- });
110
- });
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { MobileAppearance } from '../AppearanceComponents/Mobile';
3
- import PluginSlot from '../PluginSlot';
4
- export default function Mobile({
5
- editorView,
6
- maxHeight,
7
- persistScrollGutter,
8
- editorDOMElement,
9
- disabled,
10
- contentComponents,
11
- editorActions,
12
- eventDispatcher,
13
- dispatchAnalyticsEvent,
14
- providerFactory,
15
- appearance,
16
- popupsMountPoint,
17
- popupsBoundariesElement,
18
- popupsScrollableElement,
19
- innerRef,
20
- pluginHooks,
21
- featureFlags
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
- }) {
24
- var _innerRef$current;
25
- return /*#__PURE__*/React.createElement(MobileAppearance, {
26
- ref: innerRef,
27
- editorView: editorView || null,
28
- maxHeight: maxHeight,
29
- persistScrollGutter: persistScrollGutter,
30
- editorDisabled: disabled,
31
- featureFlags: featureFlags
32
- }, editorDOMElement, /*#__PURE__*/React.createElement(PluginSlot, {
33
- editorView: editorView,
34
- editorActions: editorActions,
35
- eventDispatcher: eventDispatcher,
36
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
37
- providerFactory: providerFactory,
38
- appearance: appearance,
39
- popupsMountPoint: popupsMountPoint,
40
- popupsBoundariesElement: popupsBoundariesElement,
41
- popupsScrollableElement: popupsScrollableElement,
42
- containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
43
- disabled: !!disabled,
44
- wrapperElement: null,
45
- pluginHooks: pluginHooks
46
- }));
47
- }
@@ -1,105 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React, { forwardRef, useCallback } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
- import { usePresetContext } from '../../presets/context';
11
- import { ClickAreaMobile as ClickArea } from '../Addon';
12
- import { createEditorContentStyle } from '../ContentStyles';
13
- import WithFlash from '../WithFlash';
14
-
15
- // Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
16
- // Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
17
-
18
- // Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
19
-
20
- const mobileEditor = css({
21
- minHeight: '30px',
22
- width: '100%',
23
- maxWidth: 'inherit',
24
- boxSizing: 'border-box',
25
- wordWrap: 'break-word',
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
27
- 'div > .ProseMirror': {
28
- outline: 'none',
29
- whiteSpace: 'pre-wrap',
30
- padding: 0,
31
- margin: 0
32
- }
33
- });
34
- const ContentArea = createEditorContentStyle();
35
- ContentArea.displayName = 'ContentArea';
36
- export const MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance({
37
- editorView,
38
- persistScrollGutter,
39
- children,
40
- editorDisabled,
41
- featureFlags
42
- }, ref) {
43
- var _api$base2;
44
- const api = usePresetContext();
45
- const {
46
- maxContentSizeState,
47
- mobileDimensionsState
48
- } = useSharedPluginState(api, ['maxContentSize', 'mobileDimensions']);
49
- const render = useCallback(({
50
- maxContentSize,
51
- mobileDimensions
52
- }) => {
53
- const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
54
- let minHeight = 100;
55
- let currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
56
- if (mobileDimensions) {
57
- var _api$base, _basePluginState$keyb;
58
- const {
59
- windowHeight,
60
- mobilePaddingTop,
61
- isExpanded
62
- } = mobileDimensions;
63
- const basePluginState = api === null || api === void 0 ? void 0 : (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
64
- const keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
65
-
66
- /*
67
- We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
68
- This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
69
- but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
70
- is scrolled nevertheless, and it gives the sensation that the content was lost.
71
- */
72
-
73
- if (!persistScrollGutter) {
74
- // in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
75
- // in Android keyboardHeight is always set to -1;
76
- minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
77
- } else {
78
- // in iOS Compact Editor windowHeight excludes keyboardHeight
79
- minHeight = windowHeight - mobilePaddingTop;
80
- // isExpanded can be true of false for Compact editor
81
- currentIsExpanded = isExpanded;
82
- }
83
- }
84
- return jsx(WithFlash, {
85
- animate: maxContentSizeReached
86
- }, jsx("div", {
87
- css: mobileEditor,
88
- ref: ref
89
- }, jsx(ClickArea, {
90
- editorView: editorView || undefined,
91
- minHeight: minHeight,
92
- persistScrollGutter: persistScrollGutter,
93
- isExpanded: currentIsExpanded,
94
- editorDisabled: editorDisabled
95
- }, jsx(ContentArea, {
96
- featureFlags: featureFlags
97
- }, jsx("div", {
98
- className: "ak-editor-content-area"
99
- }, children)))));
100
- }, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 ? void 0 : (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
101
- return render({
102
- maxContentSize: maxContentSizeState,
103
- mobileDimensions: mobileDimensionsState
104
- });
105
- });
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import { MobileAppearance } from '../AppearanceComponents/Mobile';
3
- import PluginSlot from '../PluginSlot';
4
- export default function Mobile(_ref) {
5
- var _innerRef$current;
6
- var editorView = _ref.editorView,
7
- maxHeight = _ref.maxHeight,
8
- persistScrollGutter = _ref.persistScrollGutter,
9
- editorDOMElement = _ref.editorDOMElement,
10
- disabled = _ref.disabled,
11
- contentComponents = _ref.contentComponents,
12
- editorActions = _ref.editorActions,
13
- eventDispatcher = _ref.eventDispatcher,
14
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
15
- providerFactory = _ref.providerFactory,
16
- appearance = _ref.appearance,
17
- popupsMountPoint = _ref.popupsMountPoint,
18
- popupsBoundariesElement = _ref.popupsBoundariesElement,
19
- popupsScrollableElement = _ref.popupsScrollableElement,
20
- innerRef = _ref.innerRef,
21
- pluginHooks = _ref.pluginHooks,
22
- featureFlags = _ref.featureFlags;
23
- return /*#__PURE__*/React.createElement(MobileAppearance, {
24
- ref: innerRef,
25
- editorView: editorView || null,
26
- maxHeight: maxHeight,
27
- persistScrollGutter: persistScrollGutter,
28
- editorDisabled: disabled,
29
- featureFlags: featureFlags
30
- }, editorDOMElement, /*#__PURE__*/React.createElement(PluginSlot, {
31
- editorView: editorView,
32
- editorActions: editorActions,
33
- eventDispatcher: eventDispatcher,
34
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
35
- providerFactory: providerFactory,
36
- appearance: appearance,
37
- popupsMountPoint: popupsMountPoint,
38
- popupsBoundariesElement: popupsBoundariesElement,
39
- popupsScrollableElement: popupsScrollableElement,
40
- containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
41
- disabled: !!disabled,
42
- wrapperElement: null,
43
- pluginHooks: pluginHooks
44
- }));
45
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React, { forwardRef, useCallback } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
- import { usePresetContext } from '../../presets/context';
11
- import { ClickAreaMobile as ClickArea } from '../Addon';
12
- import { createEditorContentStyle } from '../ContentStyles';
13
- import WithFlash from '../WithFlash';
14
-
15
- // Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
16
- // Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
17
-
18
- // Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
19
-
20
- var mobileEditor = css({
21
- minHeight: '30px',
22
- width: '100%',
23
- maxWidth: 'inherit',
24
- boxSizing: 'border-box',
25
- wordWrap: 'break-word',
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
27
- 'div > .ProseMirror': {
28
- outline: 'none',
29
- whiteSpace: 'pre-wrap',
30
- padding: 0,
31
- margin: 0
32
- }
33
- });
34
- var ContentArea = createEditorContentStyle();
35
- ContentArea.displayName = 'ContentArea';
36
- export var MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance(_ref, ref) {
37
- var _api$base2;
38
- var editorView = _ref.editorView,
39
- persistScrollGutter = _ref.persistScrollGutter,
40
- children = _ref.children,
41
- editorDisabled = _ref.editorDisabled,
42
- featureFlags = _ref.featureFlags;
43
- var api = usePresetContext();
44
- var _useSharedPluginState = useSharedPluginState(api, ['maxContentSize', 'mobileDimensions']),
45
- maxContentSizeState = _useSharedPluginState.maxContentSizeState,
46
- mobileDimensionsState = _useSharedPluginState.mobileDimensionsState;
47
- var render = useCallback(function (_ref2) {
48
- var maxContentSize = _ref2.maxContentSize,
49
- mobileDimensions = _ref2.mobileDimensions;
50
- var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
51
- var minHeight = 100;
52
- var currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
53
- if (mobileDimensions) {
54
- var _api$base, _basePluginState$keyb;
55
- var windowHeight = mobileDimensions.windowHeight,
56
- mobilePaddingTop = mobileDimensions.mobilePaddingTop,
57
- isExpanded = mobileDimensions.isExpanded;
58
- var basePluginState = api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
59
- var keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
60
-
61
- /*
62
- We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
63
- This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
64
- but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
65
- is scrolled nevertheless, and it gives the sensation that the content was lost.
66
- */
67
-
68
- if (!persistScrollGutter) {
69
- // in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
70
- // in Android keyboardHeight is always set to -1;
71
- minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
72
- } else {
73
- // in iOS Compact Editor windowHeight excludes keyboardHeight
74
- minHeight = windowHeight - mobilePaddingTop;
75
- // isExpanded can be true of false for Compact editor
76
- currentIsExpanded = isExpanded;
77
- }
78
- }
79
- return jsx(WithFlash, {
80
- animate: maxContentSizeReached
81
- }, jsx("div", {
82
- css: mobileEditor,
83
- ref: ref
84
- }, jsx(ClickArea, {
85
- editorView: editorView || undefined,
86
- minHeight: minHeight,
87
- persistScrollGutter: persistScrollGutter,
88
- isExpanded: currentIsExpanded,
89
- editorDisabled: editorDisabled
90
- }, jsx(ContentArea, {
91
- featureFlags: featureFlags
92
- }, jsx("div", {
93
- className: "ak-editor-content-area"
94
- }, children)))));
95
- }, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 || (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
96
- return render({
97
- maxContentSize: maxContentSizeState,
98
- mobileDimensions: mobileDimensionsState
99
- });
100
- });
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { EditorAppearanceComponentProps } from '../../types';
3
- export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
@@ -1,17 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
- import type { FeatureFlags } from '../../types/feature-flags';
8
- export declare const MobileAppearance: React.ForwardRefExoticComponent<{
9
- editorView: EditorView | null;
10
- maxHeight?: number | undefined;
11
- persistScrollGutter?: boolean | undefined;
12
- editorDisabled?: boolean | undefined;
13
- children?: React.ReactNode;
14
- featureFlags?: FeatureFlags | undefined;
15
- } & {
16
- children?: React.ReactNode;
17
- } & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { EditorAppearanceComponentProps } from '../../types';
3
- export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
@@ -1,17 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
- import type { FeatureFlags } from '../../types/feature-flags';
8
- export declare const MobileAppearance: React.ForwardRefExoticComponent<{
9
- editorView: EditorView | null;
10
- maxHeight?: number | undefined;
11
- persistScrollGutter?: boolean | undefined;
12
- editorDisabled?: boolean | undefined;
13
- children?: React.ReactNode;
14
- featureFlags?: FeatureFlags | undefined;
15
- } & {
16
- children?: React.ReactNode;
17
- } & React.RefAttributes<HTMLDivElement>>;