@atlaskit/editor-plugin-panel 0.2.2 → 0.2.4

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,17 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238) [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) - [ED-21835] Change EditorAPI type to always union with undefined
8
+
9
+ ## 0.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#65603](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65603) [`ac8d4b09e18e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac8d4b09e18e) - ED-21609 Node nesting: Use the new nodespec for list and panel when respective FF's are enabled
14
+
3
15
  ## 0.2.2
4
16
 
5
17
  ### Patch Changes
@@ -24,7 +24,7 @@ var panelPlugin = function panelPlugin(_ref) {
24
24
  return {
25
25
  name: 'panel',
26
26
  nodes: function nodes() {
27
- var panelNode = (0, _adfSchema.panel)(!!options.allowCustomPanel);
27
+ var panelNode = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-extended-panel') ? (0, _adfSchema.extendedPanel)(!!options.allowCustomPanel) : (0, _adfSchema.panel)(!!options.allowCustomPanel);
28
28
  return [{
29
29
  name: 'panel',
30
30
  node: panelNode
@@ -264,7 +264,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
264
264
  var formatMessage = intl.formatMessage;
265
265
  var panelObject = (0, _utils2.findPanel)(state);
266
266
  if (panelObject) {
267
- var _api$analytics;
267
+ var _api$decorations, _api$analytics;
268
268
  var nodeType = state.schema.nodes.panel;
269
269
  var _panelObject$node$att = panelObject.node.attrs,
270
270
  panelType = _panelObject$node$att.panelType,
@@ -275,7 +275,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
275
275
  };
276
276
 
277
277
  // force toolbar to be turned on
278
- var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
278
+ var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
279
279
  var getDomRef = function getDomRef(editorView) {
280
280
  var domAtPos = editorView.domAtPos.bind(editorView);
281
281
  var element = (0, _utils.findDomRefAtPos)(panelObject.pos, domAtPos);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { panel, PanelType } from '@atlaskit/adf-schema';
2
+ import { extendedPanel, panel, PanelType } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
5
5
  import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
@@ -16,7 +16,7 @@ const panelPlugin = ({
16
16
  }) => ({
17
17
  name: 'panel',
18
18
  nodes() {
19
- const panelNode = panel(!!options.allowCustomPanel);
19
+ const panelNode = getBooleanFF('platform.editor.allow-extended-panel') ? extendedPanel(!!options.allowCustomPanel) : panel(!!options.allowCustomPanel);
20
20
  return [{
21
21
  name: 'panel',
22
22
  node: panelNode
@@ -249,7 +249,7 @@ export const getToolbarConfig = (state, intl, options = {}, providerFactory, api
249
249
  } = intl;
250
250
  const panelObject = findPanel(state);
251
251
  if (panelObject) {
252
- var _api$analytics;
252
+ var _api$decorations, _api$analytics;
253
253
  const nodeType = state.schema.nodes.panel;
254
254
  const {
255
255
  panelType,
@@ -261,7 +261,7 @@ export const getToolbarConfig = (state, intl, options = {}, providerFactory, api
261
261
  };
262
262
 
263
263
  // force toolbar to be turned on
264
- const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
264
+ const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
265
265
  const getDomRef = editorView => {
266
266
  const domAtPos = editorView.domAtPos.bind(editorView);
267
267
  const element = findDomRefAtPos(panelObject.pos, domAtPos);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { panel, PanelType } from '@atlaskit/adf-schema';
2
+ import { extendedPanel, panel, PanelType } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
5
5
  import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
@@ -17,7 +17,7 @@ var panelPlugin = function panelPlugin(_ref) {
17
17
  return {
18
18
  name: 'panel',
19
19
  nodes: function nodes() {
20
- var panelNode = panel(!!options.allowCustomPanel);
20
+ var panelNode = getBooleanFF('platform.editor.allow-extended-panel') ? extendedPanel(!!options.allowCustomPanel) : panel(!!options.allowCustomPanel);
21
21
  return [{
22
22
  name: 'panel',
23
23
  node: panelNode
@@ -257,7 +257,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
257
257
  var formatMessage = intl.formatMessage;
258
258
  var panelObject = findPanel(state);
259
259
  if (panelObject) {
260
- var _api$analytics;
260
+ var _api$decorations, _api$analytics;
261
261
  var nodeType = state.schema.nodes.panel;
262
262
  var _panelObject$node$att = panelObject.node.attrs,
263
263
  panelType = _panelObject$node$att.panelType,
@@ -268,7 +268,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
268
268
  };
269
269
 
270
270
  // force toolbar to be turned on
271
- var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
271
+ var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
272
272
  var getDomRef = function getDomRef(editorView) {
273
273
  var domAtPos = editorView.domAtPos.bind(editorView);
274
274
  var element = findDomRefAtPos(panelObject.pos, domAtPos);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "releaseModel": "continuous",
15
15
  "runReact18": false
16
16
  },
17
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
18
  "main": "dist/cjs/index.js",
19
19
  "module": "dist/esm/index.js",
20
20
  "module:es2019": "dist/es2019/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^35.3.0",
37
- "@atlaskit/editor-common": "^76.35.0",
37
+ "@atlaskit/editor-common": "^76.39.0",
38
38
  "@atlaskit/editor-palette": "1.5.2",
39
39
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
@@ -104,6 +104,9 @@
104
104
  "platform-feature-flags": {
105
105
  "platform.editor.ordered-list-inserting-nodes_bh0vo": {
106
106
  "type": "boolean"
107
+ },
108
+ "platform.editor.allow-extended-panel": {
109
+ "type": "boolean"
107
110
  }
108
111
  }
109
112
  }