@atlaskit/editor-plugin-block-type 14.1.4 → 14.1.6

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,20 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 14.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 14.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41962dd9dccb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41962dd9dccb2) -
14
+ NO-ISSUE: adds a default toolbar state so we can render the toolbar on initial load without
15
+ relying on editor state
16
+ - Updated dependencies
17
+
3
18
  ## 14.1.4
4
19
 
5
20
  ### Patch Changes
@@ -11,14 +11,15 @@ var _hooks = require("@atlaskit/editor-common/hooks");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _toolbar = require("@atlaskit/editor-common/toolbar");
13
13
  var _editorToolbar = require("@atlaskit/editor-toolbar");
14
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _blockTypes = require("../../block-types");
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
17
  var usePluginState = function usePluginState(api) {
17
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['blockType'], function (state) {
18
- var _state$blockTypeState, _state$blockTypeState2;
18
+ return (0, _hooks.useSharedPluginStateWithSelector)(api, ['blockType', 'interaction'], function (state) {
19
+ var _state$blockTypeState, _state$interactionSta, _state$blockTypeState2;
19
20
  return {
20
21
  blockTypesDisabled: (_state$blockTypeState = state.blockTypeState) === null || _state$blockTypeState === void 0 ? void 0 : _state$blockTypeState.blockTypesDisabled,
21
- currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
22
+ currentBlockType: ((_state$interactionSta = state.interactionState) === null || _state$interactionSta === void 0 ? void 0 : _state$interactionSta.interactionState) === 'hasNotHadInteraction' && (0, _expValEquals.expValEquals)('platform_editor_default_toolbar_state', 'isEnabled', true) ? undefined : (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
22
23
  };
23
24
  });
24
25
  };
@@ -4,13 +4,14 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
4
4
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
5
5
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
6
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { toolbarBlockTypesWithRank } from '../../block-types';
8
9
  const usePluginState = api => {
9
- return useSharedPluginStateWithSelector(api, ['blockType'], state => {
10
- var _state$blockTypeState, _state$blockTypeState2;
10
+ return useSharedPluginStateWithSelector(api, ['blockType', 'interaction'], state => {
11
+ var _state$blockTypeState, _state$interactionSta, _state$blockTypeState2;
11
12
  return {
12
13
  blockTypesDisabled: (_state$blockTypeState = state.blockTypeState) === null || _state$blockTypeState === void 0 ? void 0 : _state$blockTypeState.blockTypesDisabled,
13
- currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
14
+ currentBlockType: ((_state$interactionSta = state.interactionState) === null || _state$interactionSta === void 0 ? void 0 : _state$interactionSta.interactionState) === 'hasNotHadInteraction' && expValEquals('platform_editor_default_toolbar_state', 'isEnabled', true) ? undefined : (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
14
15
  };
15
16
  });
16
17
  };
@@ -4,13 +4,14 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
4
4
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
5
5
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
6
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { toolbarBlockTypesWithRank } from '../../block-types';
8
9
  var usePluginState = function usePluginState(api) {
9
- return useSharedPluginStateWithSelector(api, ['blockType'], function (state) {
10
- var _state$blockTypeState, _state$blockTypeState2;
10
+ return useSharedPluginStateWithSelector(api, ['blockType', 'interaction'], function (state) {
11
+ var _state$blockTypeState, _state$interactionSta, _state$blockTypeState2;
11
12
  return {
12
13
  blockTypesDisabled: (_state$blockTypeState = state.blockTypeState) === null || _state$blockTypeState === void 0 ? void 0 : _state$blockTypeState.blockTypesDisabled,
13
- currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
14
+ currentBlockType: ((_state$interactionSta = state.interactionState) === null || _state$interactionSta === void 0 ? void 0 : _state$interactionSta.interactionState) === 'hasNotHadInteraction' && expValEquals('platform_editor_default_toolbar_state', 'isEnabled', true) ? undefined : (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
14
15
  };
15
16
  });
16
17
  };
@@ -1,6 +1,7 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
4
+ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
4
5
  import type { ListPlugin } from '@atlaskit/editor-plugin-list';
5
6
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
7
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
@@ -28,7 +29,8 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
28
29
  OptionalPlugin<ToolbarPlugin>,
29
30
  OptionalPlugin<BlockMenuPlugin>,
30
31
  OptionalPlugin<ListPlugin>,
31
- OptionalPlugin<SelectionPlugin>
32
+ OptionalPlugin<SelectionPlugin>,
33
+ OptionalPlugin<InteractionPlugin>
32
34
  ];
33
35
  pluginConfiguration: BlockTypePluginOptions | undefined;
34
36
  sharedState: BlockTypeState | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
4
+ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
4
5
  import type { ListPlugin } from '@atlaskit/editor-plugin-list';
5
6
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
7
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
@@ -28,7 +29,8 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
28
29
  OptionalPlugin<ToolbarPlugin>,
29
30
  OptionalPlugin<BlockMenuPlugin>,
30
31
  OptionalPlugin<ListPlugin>,
31
- OptionalPlugin<SelectionPlugin>
32
+ OptionalPlugin<SelectionPlugin>,
33
+ OptionalPlugin<InteractionPlugin>
32
34
  ];
33
35
  pluginConfiguration: BlockTypePluginOptions | undefined;
34
36
  sharedState: BlockTypeState | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "14.1.4",
3
+ "version": "14.1.6",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,10 +29,11 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^52.13.0",
32
+ "@atlaskit/adf-schema": "^52.14.0",
33
33
  "@atlaskit/css": "^0.19.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^10.1.0",
35
35
  "@atlaskit/editor-plugin-block-menu": "^9.2.0",
36
+ "@atlaskit/editor-plugin-interaction": "^19.1.0",
36
37
  "@atlaskit/editor-plugin-list": "^12.1.0",
37
38
  "@atlaskit/editor-plugin-primary-toolbar": "^11.1.0",
38
39
  "@atlaskit/editor-plugin-selection": "^10.1.0",
@@ -41,22 +42,22 @@
41
42
  "@atlaskit/editor-prosemirror": "^7.3.0",
42
43
  "@atlaskit/editor-shared-styles": "^3.11.0",
43
44
  "@atlaskit/editor-tables": "^2.10.0",
44
- "@atlaskit/editor-toolbar": "^1.6.0",
45
+ "@atlaskit/editor-toolbar": "^1.7.0",
45
46
  "@atlaskit/editor-toolbar-model": "^0.5.0",
46
- "@atlaskit/icon": "^35.0.0",
47
- "@atlaskit/icon-lab": "^6.9.0",
47
+ "@atlaskit/icon": "^35.1.0",
48
+ "@atlaskit/icon-lab": "^6.10.0",
48
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
50
  "@atlaskit/primitives": "^19.0.0",
50
51
  "@atlaskit/prosemirror-history": "^0.2.0",
51
52
  "@atlaskit/prosemirror-input-rules": "^3.7.0",
52
- "@atlaskit/tmp-editor-statsig": "^82.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^83.0.0",
53
54
  "@atlaskit/tokens": "^13.0.0",
54
55
  "@babel/runtime": "^7.0.0",
55
56
  "@compiled/react": "^0.20.0",
56
57
  "@emotion/react": "^11.7.1"
57
58
  },
58
59
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^114.37.0",
60
+ "@atlaskit/editor-common": "^114.46.0",
60
61
  "react": "^18.2.0",
61
62
  "react-dom": "^18.2.0",
62
63
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -64,6 +65,8 @@
64
65
  "devDependencies": {
65
66
  "@testing-library/react": "^16.3.0",
66
67
  "@testing-library/user-event": "^14.4.3",
68
+ "react": "^18.2.0",
69
+ "react-dom": "^18.2.0",
67
70
  "react-intl": "^6.6.2",
68
71
  "wait-for-expect": "^1.2.0"
69
72
  },