@atlaskit/editor-core 189.1.7 → 189.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/index.js +2 -2
  3. package/dist/cjs/plugins/insert-block/index.js +3 -8
  4. package/dist/cjs/plugins/layout/actions.js +2 -3
  5. package/dist/cjs/plugins/layout/index.js +6 -7
  6. package/dist/cjs/plugins/layout/toolbar.js +2 -2
  7. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +43 -3
  8. package/dist/cjs/ui/ContentStyles/index.js +8 -8
  9. package/dist/cjs/{plugins/layout/styles.js → ui/ContentStyles/layout.js} +1 -0
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/plugins/index.js +1 -1
  12. package/dist/es2019/plugins/insert-block/index.js +3 -8
  13. package/dist/es2019/plugins/layout/actions.js +1 -2
  14. package/dist/es2019/plugins/layout/index.js +3 -4
  15. package/dist/es2019/plugins/layout/toolbar.js +2 -2
  16. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +42 -1
  17. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  18. package/dist/es2019/{plugins/layout/styles.js → ui/ContentStyles/layout.js} +1 -0
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/plugins/index.js +1 -1
  21. package/dist/esm/plugins/insert-block/index.js +3 -8
  22. package/dist/esm/plugins/layout/actions.js +1 -2
  23. package/dist/esm/plugins/layout/index.js +3 -4
  24. package/dist/esm/plugins/layout/toolbar.js +2 -2
  25. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +42 -2
  26. package/dist/esm/ui/ContentStyles/index.js +1 -1
  27. package/dist/esm/{plugins/layout/styles.js → ui/ContentStyles/layout.js} +1 -0
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/plugins/index.d.ts +1 -1
  30. package/dist/types/plugins/layout/actions.d.ts +1 -2
  31. package/dist/types/plugins/layout/index.d.ts +1 -2
  32. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -4
  33. package/dist/types/{plugins/layout/styles.d.ts → ui/ContentStyles/layout.d.ts} +1 -1
  34. package/dist/types-ts4.5/plugins/index.d.ts +1 -1
  35. package/dist/types-ts4.5/plugins/layout/actions.d.ts +1 -2
  36. package/dist/types-ts4.5/plugins/layout/index.d.ts +1 -2
  37. package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +3 -4
  38. package/dist/types-ts4.5/{plugins/layout/styles.d.ts → ui/ContentStyles/layout.d.ts} +1 -1
  39. package/package.json +1 -1
  40. package/dist/cjs/plugins/layout/utils.js +0 -30
  41. package/dist/es2019/plugins/layout/utils.js +0 -1
  42. package/dist/esm/plugins/layout/utils.js +0 -1
  43. package/dist/types/plugins/layout/utils.d.ts +0 -1
  44. package/dist/types-ts4.5/plugins/layout/utils.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 189.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42477](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42477) [`8f5175dc714`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f5175dc714) - Decouple layout plugin from editor-core
8
+
9
+ ## 189.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42152](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42152) [`0097171c562`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0097171c562) - ED-19766-collab: Adding collab support for paste options toolbar for confluence
14
+
3
15
  ## 189.1.7
4
16
 
5
17
  ### Patch Changes
@@ -128,7 +128,7 @@ Object.defineProperty(exports, "jiraIssuePlugin", {
128
128
  Object.defineProperty(exports, "layoutPlugin", {
129
129
  enumerable: true,
130
130
  get: function get() {
131
- return _layout.default;
131
+ return _layout.layoutPlugin;
132
132
  }
133
133
  });
134
134
  Object.defineProperty(exports, "macroPlugin", {
@@ -203,7 +203,7 @@ var _collabEdit = _interopRequireDefault(require("./collab-edit"));
203
203
  var _extension = _interopRequireDefault(require("./extension"));
204
204
  var _insertBlock = _interopRequireDefault(require("./insert-block"));
205
205
  var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
206
- var _layout = _interopRequireDefault(require("./layout"));
206
+ var _layout = require("./layout");
207
207
  var _toolbarListsIndentation = _interopRequireDefault(require("./toolbar-lists-indentation"));
208
208
  var _macro = _interopRequireDefault(require("./macro"));
209
209
  var _maxContentSize = _interopRequireDefault(require("./max-content-size"));
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
10
- var _layout = require("../layout");
11
10
  var _macro = require("../macro");
12
11
  var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
13
12
  var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
@@ -76,14 +75,12 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
76
75
  return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
77
76
  plugins: {
78
77
  macroState: _pluginKey2.pluginKey,
79
- placeholderTextState: _pluginKey.pluginKey,
80
- layoutState: _layout.pluginKey
78
+ placeholderTextState: _pluginKey.pluginKey
81
79
  },
82
80
  render: function render(_ref3) {
83
81
  var _ref3$macroState = _ref3.macroState,
84
82
  macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
85
- placeholderTextState = _ref3.placeholderTextState,
86
- layoutState = _ref3.layoutState;
83
+ placeholderTextState = _ref3.placeholderTextState;
87
84
  return /*#__PURE__*/_react.default.createElement(ToolbarInsertBlockWithInjectionApi, {
88
85
  pluginInjectionApi: api,
89
86
  editorView: editorView,
@@ -100,7 +97,6 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
100
97
  featureFlags: featureFlags,
101
98
  macroState: macroState,
102
99
  placeholderTextState: placeholderTextState,
103
- layoutState: layoutState,
104
100
  providers: providers,
105
101
  options: options
106
102
  });
@@ -132,7 +128,6 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
132
128
  options = _ref4.options,
133
129
  macroState = _ref4.macroState,
134
130
  placeholderTextState = _ref4.placeholderTextState,
135
- layoutState = _ref4.layoutState,
136
131
  featureFlags = _ref4.featureFlags;
137
132
  var buttons = toolbarSizeToButtons(toolbarSize);
138
133
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead']),
@@ -158,7 +153,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
158
153
  decisionSupported: !!editorView.state.schema.nodes.decisionItem,
159
154
  dateEnabled: !!dateState,
160
155
  placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
161
- layoutSectionEnabled: !!layoutState,
156
+ layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
162
157
  expandEnabled: !!options.allowExpand,
163
158
  mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
164
159
  onShowMediaPicker: (_ref6 = mediaState && mediaState.showMediaPicker) !== null && _ref6 !== void 0 ? _ref6 : undefined,
@@ -11,7 +11,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
12
  var _model = require("@atlaskit/editor-prosemirror/model");
13
13
  var _state = require("@atlaskit/editor-prosemirror/state");
14
- var _slice = require("../../utils/slice");
15
14
  var _utils2 = require("@atlaskit/editor-common/utils");
16
15
  var _analytics = require("@atlaskit/editor-common/analytics");
17
16
  var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
@@ -43,7 +42,7 @@ var getWidthsForPreset = function getWidthsForPreset(presetLayout) {
43
42
  * inside the layoutSection node
44
43
  */
45
44
  var getPresetLayout = exports.getPresetLayout = function getPresetLayout(section) {
46
- var widths = (0, _slice.mapChildren)(section, function (column) {
45
+ var widths = (0, _utils2.mapChildren)(section, function (column) {
47
46
  return column.attrs.width;
48
47
  }).join(',');
49
48
  switch (widths) {
@@ -180,7 +179,7 @@ function columnWidth(node, schema, widths) {
180
179
  var truncatedWidths = widths.map(function (w) {
181
180
  return Number(w.toFixed(2));
182
181
  });
183
- return (0, _slice.flatmap)(node.content, function (column, idx) {
182
+ return (0, _utils2.flatmap)(node.content, function (column, idx) {
184
183
  if (column.type === layoutColumn) {
185
184
  return layoutColumn.create(_objectSpread(_objectSpread({}, column.attrs), {}, {
186
185
  width: truncatedWidths[idx]
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.layoutPlugin = void 0;
8
8
  Object.defineProperty(exports, "pluginKey", {
9
9
  enumerable: true,
10
10
  get: function get() {
@@ -18,9 +18,9 @@ var _toolbar = require("./toolbar");
18
18
  var _actions = require("./actions");
19
19
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
20
20
  var _analytics = require("@atlaskit/editor-common/analytics");
21
- var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
21
+ var _messages = require("@atlaskit/editor-common/messages");
22
22
  var _pluginKey = require("./pm-plugins/plugin-key");
23
- var layoutPlugin = function layoutPlugin(_ref) {
23
+ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
24
24
  var _api$analytics;
25
25
  var _ref$config = _ref.config,
26
26
  options = _ref$config === void 0 ? {} : _ref$config,
@@ -63,8 +63,8 @@ var layoutPlugin = function layoutPlugin(_ref) {
63
63
  var formatMessage = _ref3.formatMessage;
64
64
  return [{
65
65
  id: 'layout',
66
- title: formatMessage(_messages.messages.columns),
67
- description: formatMessage(_messages.messages.columnsDescription),
66
+ title: formatMessage(_messages.toolbarInsertBlockMessages.columns),
67
+ description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
68
68
  keywords: ['column', 'section'],
69
69
  priority: 1100,
70
70
  icon: function icon() {
@@ -88,5 +88,4 @@ var layoutPlugin = function layoutPlugin(_ref) {
88
88
  }
89
89
  }
90
90
  };
91
- };
92
- var _default = exports.default = layoutPlugin;
91
+ };
@@ -15,7 +15,7 @@ var _layoutTwoRightSidebar = _interopRequireDefault(require("@atlaskit/icon/glyp
15
15
  var _layoutThreeWithSidebars = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-three-with-sidebars"));
16
16
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
17
17
  var _toolbarMessages = require("./toolbar-messages");
18
- var _messages = _interopRequireDefault(require("../../messages"));
18
+ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
19
19
  var _actions = require("./actions");
20
20
  var LAYOUT_TYPES = [{
21
21
  id: 'editor.layout.twoEquals',
@@ -55,7 +55,7 @@ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, ed
55
55
  id: item.id,
56
56
  type: 'button',
57
57
  icon: item.icon,
58
- testId: item.title.id,
58
+ testId: item.title.id ? "".concat(item.title.id) : undefined,
59
59
  title: intl.formatMessage(item.title),
60
60
  onClick: (0, _actions.setPresetLayout)(editorAnalyticsAPI)(item.type),
61
61
  selected: !!currentLayout && currentLayout === item.type,
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -36,10 +37,14 @@ var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
36
37
  var _FormContent = _interopRequireDefault(require("./FormContent"));
37
38
  var _messages = require("./messages");
38
39
  var _FormErrorBoundary = require("./FormErrorBoundary");
40
+ var _excluded = ["page", "labels", "types", "name", "width"];
39
41
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
40
42
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
+ 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; }
44
+ 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; }
41
45
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
42
46
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
+ var LOGGED_MACRO_KEYS = ['children', 'recently-updated', 'excerpt'];
43
48
  function ConfigForm(_ref) {
44
49
  var canSave = _ref.canSave,
45
50
  errorMessage = _ref.errorMessage,
@@ -337,15 +342,50 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
337
342
  var _this$props4 = this.props,
338
343
  createAnalyticsEvent = _this$props4.createAnalyticsEvent,
339
344
  extensionManifest = _this$props4.extensionManifest;
345
+ var currentParameters = this.state.currentParameters;
346
+
347
+ // PGXT-4393 We need to collect configuration analytics for the macros in LOGGED_MACRO_KEYS.
348
+ // This function takes the parameters and filters out anything which might have UGC.
349
+ var getMacroParameters = function getMacroParameters() {
350
+ var page = currentParameters.page,
351
+ labels = currentParameters.labels,
352
+ types = currentParameters.types,
353
+ name = currentParameters.name,
354
+ width = currentParameters.width,
355
+ safeParams = (0, _objectWithoutProperties2.default)(currentParameters, _excluded);
356
+ var ugcFreeParams = _objectSpread({}, safeParams);
357
+ // Parse types field as an array of valid content types and include in the result
358
+ if (types) {
359
+ var contentTypes = ['page', 'blogpost', 'comment', 'attachment'];
360
+ var parsedTypes = types.split(',').map(function (type) {
361
+ return type.trim();
362
+ }).filter(function (type) {
363
+ return contentTypes.includes(type);
364
+ });
365
+ ugcFreeParams = _objectSpread({
366
+ types: parsedTypes
367
+ }, ugcFreeParams);
368
+ }
369
+ // Since width is a raw string input, parse then return
370
+ if (width) {
371
+ var parsedWidth = parseFloat(width);
372
+ ugcFreeParams = _objectSpread({
373
+ width: parsedWidth
374
+ }, ugcFreeParams);
375
+ }
376
+ return ugcFreeParams;
377
+ };
340
378
  (0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
341
379
  payload: {
342
380
  action: _analytics.ACTION.CLOSED,
343
381
  actionSubject: _analytics.ACTION_SUBJECT.CONFIG_PANEL,
344
382
  eventType: _analytics.EVENT_TYPE.UI,
345
- attributes: {
383
+ attributes: _objectSpread({
346
384
  extensionKey: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.key,
347
385
  extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type
348
- }
386
+ }, extensionManifest !== null && extensionManifest !== void 0 && extensionManifest.key && LOGGED_MACRO_KEYS.includes(extensionManifest.key) ? {
387
+ parameters: getMacroParameters()
388
+ } : {})
349
389
  }
350
390
  });
351
391
  }
@@ -18,13 +18,13 @@ var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
18
18
  var _styles4 = require("@atlaskit/editor-plugin-paste-options-toolbar/styles");
19
19
  var _styles5 = require("../../plugins/code-block/styles");
20
20
  var _media = require("./media");
21
- var _styles6 = require("../../plugins/layout/styles");
22
- var _styles7 = require("../../plugins/panel/styles");
23
- var _styles8 = require("../../plugins/placeholder-text/styles");
24
- var _styles9 = require("../../plugins/extension/ui/styles");
25
- var _styles10 = require("../../plugins/expand/ui/styles");
26
- var _styles11 = require("../../plugins/find-replace/styles");
27
- var _styles12 = require("../../plugins/tasks-and-decisions/styles");
21
+ var _layout = require("./layout");
22
+ var _styles6 = require("../../plugins/panel/styles");
23
+ var _styles7 = require("../../plugins/placeholder-text/styles");
24
+ var _styles8 = require("../../plugins/extension/ui/styles");
25
+ var _styles9 = require("../../plugins/expand/ui/styles");
26
+ var _styles10 = require("../../plugins/find-replace/styles");
27
+ var _styles11 = require("../../plugins/tasks-and-decisions/styles");
28
28
  var _status = require("./status");
29
29
  var _date = require("./date");
30
30
  var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
47
47
  var contentStyles = function contentStyles(props) {
48
48
  return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
49
49
  theme: props.theme
50
- }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles8.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _styles6.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles7.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles9.extensionStyles, (0, _styles10.expandStyles)(props), _styles11.findReplaceStyles, _styles4.textHighlightStyle, _styles12.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
50
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles7.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles6.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles8.extensionStyles, (0, _styles9.expandStyles)(props), _styles10.findReplaceStyles, _styles4.textHighlightStyle, _styles11.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
51
51
  };
52
52
  var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
53
53
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
@@ -27,6 +27,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
27
27
  var _types = require("@atlaskit/editor-plugin-table/types");
28
28
  var _consts = require("@atlaskit/editor-plugin-table/ui/consts");
29
29
  var _templateObject; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
30
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
30
31
  var layoutStyles = exports.layoutStyles = function layoutStyles(props) {
31
32
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", " [data-layout-section] {\n // TODO: Migrate away from gridSize\n // Recommendation: Replace directly with 7px\n margin: ", "px -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n border: ", "px solid\n ", ";\n border-radius: 4px;\n padding: ", "px;\n box-sizing: border-box;\n\n > div {\n > :not(style):first-child,\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n > .embedCardView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor.-right\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > .ProseMirror-gapcursor.-right:first-of-type\n + .embedCardView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n > [data-node-type='decisionList'] {\n li:first-of-type [data-decision-wrapper] {\n margin-top: 0;\n }\n }\n }\n\n /* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n [data-layout-content] {\n height: 100%;\n cursor: text;\n }\n }\n\n [data-layout-column] + [data-layout-column] {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n [data-layout-column] + [data-layout-column] {\n margin-left: 0;\n }\n }\n\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4441\n /* Shows the border when cursor is inside a layout */\n &.selected [data-layout-column],\n &:hover [data-layout-column] {\n border: ", "px solid\n ", ";\n }\n\n &.selected.danger > [data-layout-column] {\n background-color: ", ";\n border-color: ", ";\n }\n\n &.", ":not(.danger) {\n [data-layout-column] {\n ", "\n }\n }\n }\n }\n\n .fabric-editor--full-width-mode .ProseMirror {\n [data-layout-section] {\n .", " {\n margin: 0 ", "px;\n }\n }\n }\n"])), _styles.columnLayoutSharedStyle, (0, _constants.gridSize)() - 1, _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSelectedBorderSize, (0, _components.themed)({
32
33
  light: "var(--ds-border, ".concat(_colors.N40A, ")"),
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "189.1.7";
8
+ var version = exports.version = "189.1.11";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -4,7 +4,7 @@ export { default as collabEditPlugin } from './collab-edit';
4
4
  export { default as extensionPlugin } from './extension';
5
5
  export { default as insertBlockPlugin } from './insert-block';
6
6
  export { default as jiraIssuePlugin } from './jira-issue';
7
- export { default as layoutPlugin } from './layout';
7
+ export { layoutPlugin } from './layout';
8
8
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
9
9
  export { default as macroPlugin } from './macro';
10
10
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
3
- import { pluginKey as layoutStateKey } from '../layout';
4
3
  import { insertMacroFromMacroBrowser } from '../macro';
5
4
  import WithPluginState from '../../ui/WithPluginState';
6
5
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
@@ -68,13 +67,11 @@ const insertBlockPlugin = ({
68
67
  return /*#__PURE__*/React.createElement(WithPluginState, {
69
68
  plugins: {
70
69
  macroState: macroStateKey,
71
- placeholderTextState: placeholderTextStateKey,
72
- layoutState: layoutStateKey
70
+ placeholderTextState: placeholderTextStateKey
73
71
  },
74
72
  render: ({
75
73
  macroState = {},
76
- placeholderTextState,
77
- layoutState
74
+ placeholderTextState
78
75
  }) => {
79
76
  return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
80
77
  pluginInjectionApi: api,
@@ -92,7 +89,6 @@ const insertBlockPlugin = ({
92
89
  featureFlags: featureFlags,
93
90
  macroState: macroState,
94
91
  placeholderTextState: placeholderTextState,
95
- layoutState: layoutState,
96
92
  providers: providers,
97
93
  options: options
98
94
  });
@@ -123,7 +119,6 @@ function ToolbarInsertBlockWithInjectionApi({
123
119
  options,
124
120
  macroState,
125
121
  placeholderTextState,
126
- layoutState,
127
122
  featureFlags
128
123
  }) {
129
124
  var _ref, _ref2, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
@@ -152,7 +147,7 @@ function ToolbarInsertBlockWithInjectionApi({
152
147
  decisionSupported: !!editorView.state.schema.nodes.decisionItem,
153
148
  dateEnabled: !!dateState,
154
149
  placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
155
- layoutSectionEnabled: !!layoutState,
150
+ layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
156
151
  expandEnabled: !!options.allowExpand,
157
152
  mediaUploadsEnabled: (_ref = mediaState && mediaState.allowsUploads) !== null && _ref !== void 0 ? _ref : undefined,
158
153
  onShowMediaPicker: (_ref2 = mediaState && mediaState.showMediaPicker) !== null && _ref2 !== void 0 ? _ref2 : undefined,
@@ -1,8 +1,7 @@
1
1
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
2
2
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
- import { flatmap, mapChildren } from '../../utils/slice';
5
- import { getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
4
+ import { flatmap, mapChildren, getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
6
5
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
7
6
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
8
7
  import { pluginKey } from './pm-plugins/plugin-key';
@@ -5,10 +5,10 @@ import { buildToolbar } from './toolbar';
5
5
  import { createDefaultLayoutSection, insertLayoutColumnsWithAnalytics } from './actions';
6
6
  import { IconLayout } from '@atlaskit/editor-common/quick-insert';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
8
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
9
9
  import { pluginKey } from './pm-plugins/plugin-key';
10
10
  export { pluginKey };
11
- const layoutPlugin = ({
11
+ export const layoutPlugin = ({
12
12
  config: options = {},
13
13
  api
14
14
  }) => {
@@ -72,5 +72,4 @@ const layoutPlugin = ({
72
72
  }]
73
73
  }
74
74
  };
75
- };
76
- export default layoutPlugin;
75
+ };
@@ -7,7 +7,7 @@ import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-ri
7
7
  import LayoutThreeWithSidebarsIcon from '@atlaskit/icon/glyph/editor/layout-three-with-sidebars';
8
8
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
9
9
  import { toolbarMessages } from './toolbar-messages';
10
- import commonMessages from '../../messages';
10
+ import commonMessages from '@atlaskit/editor-common/messages';
11
11
  import { setPresetLayout, deleteActiveLayoutNode, getPresetLayout } from './actions';
12
12
  const LAYOUT_TYPES = [{
13
13
  id: 'editor.layout.twoEquals',
@@ -46,7 +46,7 @@ const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI) => ({
46
46
  id: item.id,
47
47
  type: 'button',
48
48
  icon: item.icon,
49
- testId: item.title.id,
49
+ testId: item.title.id ? `${item.title.id}` : undefined,
50
50
  title: intl.formatMessage(item.title),
51
51
  onClick: setPresetLayout(editorAnalyticsAPI)(item.type),
52
52
  selected: !!currentLayout && currentLayout === item.type,
@@ -21,6 +21,7 @@ import WithPluginState from '../WithPluginState';
21
21
  import FormContent from './FormContent';
22
22
  import { messages } from './messages';
23
23
  import { FormErrorBoundary } from './FormErrorBoundary';
24
+ const LOGGED_MACRO_KEYS = ['children', 'recently-updated', 'excerpt'];
24
25
  function ConfigForm({
25
26
  canSave,
26
27
  errorMessage,
@@ -278,6 +279,43 @@ class ConfigPanel extends React.Component {
278
279
  createAnalyticsEvent,
279
280
  extensionManifest
280
281
  } = this.props;
282
+ const {
283
+ currentParameters
284
+ } = this.state;
285
+
286
+ // PGXT-4393 We need to collect configuration analytics for the macros in LOGGED_MACRO_KEYS.
287
+ // This function takes the parameters and filters out anything which might have UGC.
288
+ const getMacroParameters = () => {
289
+ const {
290
+ page,
291
+ labels,
292
+ types,
293
+ name,
294
+ width,
295
+ ...safeParams
296
+ } = currentParameters;
297
+ let ugcFreeParams = {
298
+ ...safeParams
299
+ };
300
+ // Parse types field as an array of valid content types and include in the result
301
+ if (types) {
302
+ const contentTypes = ['page', 'blogpost', 'comment', 'attachment'];
303
+ const parsedTypes = types.split(',').map(type => type.trim()).filter(type => contentTypes.includes(type));
304
+ ugcFreeParams = {
305
+ types: parsedTypes,
306
+ ...ugcFreeParams
307
+ };
308
+ }
309
+ // Since width is a raw string input, parse then return
310
+ if (width) {
311
+ const parsedWidth = parseFloat(width);
312
+ ugcFreeParams = {
313
+ width: parsedWidth,
314
+ ...ugcFreeParams
315
+ };
316
+ }
317
+ return ugcFreeParams;
318
+ };
281
319
  fireAnalyticsEvent(createAnalyticsEvent)({
282
320
  payload: {
283
321
  action: ACTION.CLOSED,
@@ -285,7 +323,10 @@ class ConfigPanel extends React.Component {
285
323
  eventType: EVENT_TYPE.UI,
286
324
  attributes: {
287
325
  extensionKey: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.key,
288
- extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type
326
+ extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type,
327
+ ...(extensionManifest !== null && extensionManifest !== void 0 && extensionManifest.key && LOGGED_MACRO_KEYS.includes(extensionManifest.key) ? {
328
+ parameters: getMacroParameters()
329
+ } : {})
289
330
  }
290
331
  }
291
332
  });
@@ -10,7 +10,7 @@ import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
10
10
  import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
11
11
  import { codeBlockStyles } from '../../plugins/code-block/styles';
12
12
  import { mediaStyles } from './media';
13
- import { layoutStyles } from '../../plugins/layout/styles';
13
+ import { layoutStyles } from './layout';
14
14
  import { panelStyles } from '../../plugins/panel/styles';
15
15
  import { placeholderTextStyles } from '../../plugins/placeholder-text/styles';
16
16
  import { extensionStyles } from '../../plugins/extension/ui/styles';
@@ -3,6 +3,7 @@ import { css } from '@emotion/react';
3
3
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
4
4
  import { gridSize } from '@atlaskit/theme/constants';
5
5
  import { N40A, N50A, DN70, DN80 } from '@atlaskit/theme/colors';
6
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
7
  import { themed } from '@atlaskit/theme/components';
7
8
  import { columnLayoutSharedStyle, LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
8
9
  import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.1.7";
2
+ export const version = "189.1.11";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -4,7 +4,7 @@ export { default as collabEditPlugin } from './collab-edit';
4
4
  export { default as extensionPlugin } from './extension';
5
5
  export { default as insertBlockPlugin } from './insert-block';
6
6
  export { default as jiraIssuePlugin } from './jira-issue';
7
- export { default as layoutPlugin } from './layout';
7
+ export { layoutPlugin } from './layout';
8
8
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
9
9
  export { default as macroPlugin } from './macro';
10
10
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
3
- import { pluginKey as layoutStateKey } from '../layout';
4
3
  import { insertMacroFromMacroBrowser } from '../macro';
5
4
  import WithPluginState from '../../ui/WithPluginState';
6
5
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
@@ -69,14 +68,12 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
69
68
  return /*#__PURE__*/React.createElement(WithPluginState, {
70
69
  plugins: {
71
70
  macroState: macroStateKey,
72
- placeholderTextState: placeholderTextStateKey,
73
- layoutState: layoutStateKey
71
+ placeholderTextState: placeholderTextStateKey
74
72
  },
75
73
  render: function render(_ref3) {
76
74
  var _ref3$macroState = _ref3.macroState,
77
75
  macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
78
- placeholderTextState = _ref3.placeholderTextState,
79
- layoutState = _ref3.layoutState;
76
+ placeholderTextState = _ref3.placeholderTextState;
80
77
  return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
81
78
  pluginInjectionApi: api,
82
79
  editorView: editorView,
@@ -93,7 +90,6 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
93
90
  featureFlags: featureFlags,
94
91
  macroState: macroState,
95
92
  placeholderTextState: placeholderTextState,
96
- layoutState: layoutState,
97
93
  providers: providers,
98
94
  options: options
99
95
  });
@@ -125,7 +121,6 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
125
121
  options = _ref4.options,
126
122
  macroState = _ref4.macroState,
127
123
  placeholderTextState = _ref4.placeholderTextState,
128
- layoutState = _ref4.layoutState,
129
124
  featureFlags = _ref4.featureFlags;
130
125
  var buttons = toolbarSizeToButtons(toolbarSize);
131
126
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead']),
@@ -151,7 +146,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
151
146
  decisionSupported: !!editorView.state.schema.nodes.decisionItem,
152
147
  dateEnabled: !!dateState,
153
148
  placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
154
- layoutSectionEnabled: !!layoutState,
149
+ layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
155
150
  expandEnabled: !!options.allowExpand,
156
151
  mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
157
152
  onShowMediaPicker: (_ref6 = mediaState && mediaState.showMediaPicker) !== null && _ref6 !== void 0 ? _ref6 : undefined,
@@ -4,8 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
6
6
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
- import { flatmap, mapChildren } from '../../utils/slice';
8
- import { getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
7
+ import { flatmap, mapChildren, getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
9
8
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
10
9
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
11
10
  import { pluginKey } from './pm-plugins/plugin-key';
@@ -5,10 +5,10 @@ import { buildToolbar } from './toolbar';
5
5
  import { createDefaultLayoutSection, insertLayoutColumnsWithAnalytics } from './actions';
6
6
  import { IconLayout } from '@atlaskit/editor-common/quick-insert';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
8
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
9
9
  import { pluginKey } from './pm-plugins/plugin-key';
10
10
  export { pluginKey };
11
- var layoutPlugin = function layoutPlugin(_ref) {
11
+ export var layoutPlugin = function layoutPlugin(_ref) {
12
12
  var _api$analytics;
13
13
  var _ref$config = _ref.config,
14
14
  options = _ref$config === void 0 ? {} : _ref$config,
@@ -76,5 +76,4 @@ var layoutPlugin = function layoutPlugin(_ref) {
76
76
  }
77
77
  }
78
78
  };
79
- };
80
- export default layoutPlugin;
79
+ };
@@ -8,7 +8,7 @@ import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-ri
8
8
  import LayoutThreeWithSidebarsIcon from '@atlaskit/icon/glyph/editor/layout-three-with-sidebars';
9
9
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
10
10
  import { toolbarMessages } from './toolbar-messages';
11
- import commonMessages from '../../messages';
11
+ import commonMessages from '@atlaskit/editor-common/messages';
12
12
  import { setPresetLayout, deleteActiveLayoutNode, getPresetLayout } from './actions';
13
13
  var LAYOUT_TYPES = [{
14
14
  id: 'editor.layout.twoEquals',
@@ -48,7 +48,7 @@ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, ed
48
48
  id: item.id,
49
49
  type: 'button',
50
50
  icon: item.icon,
51
- testId: item.title.id,
51
+ testId: item.title.id ? "".concat(item.title.id) : undefined,
52
52
  title: intl.formatMessage(item.title),
53
53
  onClick: setPresetLayout(editorAnalyticsAPI)(item.type),
54
54
  selected: !!currentLayout && currentLayout === item.type,
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
5
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +8,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
+ var _excluded = ["page", "labels", "types", "name", "width"];
12
+ 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; }
13
+ 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) { _defineProperty(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; }
10
14
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
15
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
16
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -31,6 +35,7 @@ import WithPluginState from '../WithPluginState';
31
35
  import FormContent from './FormContent';
32
36
  import { messages } from './messages';
33
37
  import { FormErrorBoundary } from './FormErrorBoundary';
38
+ var LOGGED_MACRO_KEYS = ['children', 'recently-updated', 'excerpt'];
34
39
  function ConfigForm(_ref) {
35
40
  var canSave = _ref.canSave,
36
41
  errorMessage = _ref.errorMessage,
@@ -328,15 +333,50 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
328
333
  var _this$props4 = this.props,
329
334
  createAnalyticsEvent = _this$props4.createAnalyticsEvent,
330
335
  extensionManifest = _this$props4.extensionManifest;
336
+ var currentParameters = this.state.currentParameters;
337
+
338
+ // PGXT-4393 We need to collect configuration analytics for the macros in LOGGED_MACRO_KEYS.
339
+ // This function takes the parameters and filters out anything which might have UGC.
340
+ var getMacroParameters = function getMacroParameters() {
341
+ var page = currentParameters.page,
342
+ labels = currentParameters.labels,
343
+ types = currentParameters.types,
344
+ name = currentParameters.name,
345
+ width = currentParameters.width,
346
+ safeParams = _objectWithoutProperties(currentParameters, _excluded);
347
+ var ugcFreeParams = _objectSpread({}, safeParams);
348
+ // Parse types field as an array of valid content types and include in the result
349
+ if (types) {
350
+ var contentTypes = ['page', 'blogpost', 'comment', 'attachment'];
351
+ var parsedTypes = types.split(',').map(function (type) {
352
+ return type.trim();
353
+ }).filter(function (type) {
354
+ return contentTypes.includes(type);
355
+ });
356
+ ugcFreeParams = _objectSpread({
357
+ types: parsedTypes
358
+ }, ugcFreeParams);
359
+ }
360
+ // Since width is a raw string input, parse then return
361
+ if (width) {
362
+ var parsedWidth = parseFloat(width);
363
+ ugcFreeParams = _objectSpread({
364
+ width: parsedWidth
365
+ }, ugcFreeParams);
366
+ }
367
+ return ugcFreeParams;
368
+ };
331
369
  fireAnalyticsEvent(createAnalyticsEvent)({
332
370
  payload: {
333
371
  action: ACTION.CLOSED,
334
372
  actionSubject: ACTION_SUBJECT.CONFIG_PANEL,
335
373
  eventType: EVENT_TYPE.UI,
336
- attributes: {
374
+ attributes: _objectSpread({
337
375
  extensionKey: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.key,
338
376
  extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type
339
- }
377
+ }, extensionManifest !== null && extensionManifest !== void 0 && extensionManifest.key && LOGGED_MACRO_KEYS.includes(extensionManifest.key) ? {
378
+ parameters: getMacroParameters()
379
+ } : {})
340
380
  }
341
381
  });
342
382
  }
@@ -12,7 +12,7 @@ import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
12
12
  import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
13
13
  import { codeBlockStyles } from '../../plugins/code-block/styles';
14
14
  import { mediaStyles } from './media';
15
- import { layoutStyles } from '../../plugins/layout/styles';
15
+ import { layoutStyles } from './layout';
16
16
  import { panelStyles } from '../../plugins/panel/styles';
17
17
  import { placeholderTextStyles } from '../../plugins/placeholder-text/styles';
18
18
  import { extensionStyles } from '../../plugins/extension/ui/styles';
@@ -5,6 +5,7 @@ import { css } from '@emotion/react';
5
5
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
6
  import { gridSize } from '@atlaskit/theme/constants';
7
7
  import { N40A, N50A, DN70, DN80 } from '@atlaskit/theme/colors';
8
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
8
9
  import { themed } from '@atlaskit/theme/components';
9
10
  import { columnLayoutSharedStyle, LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
10
11
  import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "189.1.7";
2
+ export var version = "189.1.11";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -4,7 +4,7 @@ export { default as collabEditPlugin } from './collab-edit';
4
4
  export { default as extensionPlugin } from './extension';
5
5
  export { default as insertBlockPlugin } from './insert-block';
6
6
  export { default as jiraIssuePlugin } from './jira-issue';
7
- export { default as layoutPlugin } from './layout';
7
+ export { layoutPlugin } from './layout';
8
8
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
9
9
  export { default as macroPlugin } from './macro';
10
10
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -1,9 +1,8 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- import type { Command } from '../../types/command';
3
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { Change, PresetLayout } from './types';
6
- import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
5
+ import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
7
6
  export declare const ONE_COL_LAYOUTS: PresetLayout[];
8
7
  export declare const TWO_COL_LAYOUTS: PresetLayout[];
9
8
  export declare const THREE_COL_LAYOUTS: PresetLayout[];
@@ -12,5 +12,4 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
12
12
  insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
13
13
  };
14
14
  }>;
15
- declare const layoutPlugin: LayoutPlugin;
16
- export default layoutPlugin;
15
+ export declare const layoutPlugin: LayoutPlugin;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import type { ExtensionManifest } from '@atlaskit/editor-common/extensions';
4
- import { FieldDefinition, Parameters, OnSaveCallback } from '@atlaskit/editor-common/extensions';
5
- import { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import type { ExtensionManifest, FieldDefinition, Parameters, OnSaveCallback } from '@atlaskit/editor-common/extensions';
4
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
6
5
  type Props = {
7
6
  extensionManifest?: ExtensionManifest;
8
7
  fields?: FieldDefinition[];
@@ -1,4 +1,4 @@
1
- import { ThemeProps } from '@atlaskit/theme/types';
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
2
  import { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
3
3
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
4
4
  export declare const layoutStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -4,7 +4,7 @@ export { default as collabEditPlugin } from './collab-edit';
4
4
  export { default as extensionPlugin } from './extension';
5
5
  export { default as insertBlockPlugin } from './insert-block';
6
6
  export { default as jiraIssuePlugin } from './jira-issue';
7
- export { default as layoutPlugin } from './layout';
7
+ export { layoutPlugin } from './layout';
8
8
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
9
9
  export { default as macroPlugin } from './macro';
10
10
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -1,9 +1,8 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- import type { Command } from '../../types/command';
3
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { Change, PresetLayout } from './types';
6
- import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
5
+ import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
7
6
  export declare const ONE_COL_LAYOUTS: PresetLayout[];
8
7
  export declare const TWO_COL_LAYOUTS: PresetLayout[];
9
8
  export declare const THREE_COL_LAYOUTS: PresetLayout[];
@@ -15,5 +15,4 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
15
15
  insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
16
16
  };
17
17
  }>;
18
- declare const layoutPlugin: LayoutPlugin;
19
- export default layoutPlugin;
18
+ export declare const layoutPlugin: LayoutPlugin;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import type { ExtensionManifest } from '@atlaskit/editor-common/extensions';
4
- import { FieldDefinition, Parameters, OnSaveCallback } from '@atlaskit/editor-common/extensions';
5
- import { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import type { ExtensionManifest, FieldDefinition, Parameters, OnSaveCallback } from '@atlaskit/editor-common/extensions';
4
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
6
5
  type Props = {
7
6
  extensionManifest?: ExtensionManifest;
8
7
  fields?: FieldDefinition[];
@@ -1,4 +1,4 @@
1
- import { ThemeProps } from '@atlaskit/theme/types';
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
2
  import { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
3
3
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
4
4
  export declare const layoutStyles: (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.1.7",
3
+ "version": "189.1.11",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "removeLayoutFromFirstChild", {
7
- enumerable: true,
8
- get: function get() {
9
- return _transforms.removeLayoutFromFirstChild;
10
- }
11
- });
12
- Object.defineProperty(exports, "removeLayoutFromLastChild", {
13
- enumerable: true,
14
- get: function get() {
15
- return _transforms.removeLayoutFromLastChild;
16
- }
17
- });
18
- Object.defineProperty(exports, "transformSliceToRemoveOpenLayoutNodes", {
19
- enumerable: true,
20
- get: function get() {
21
- return _transforms.transformSliceToRemoveOpenLayoutNodes;
22
- }
23
- });
24
- Object.defineProperty(exports, "unwrapContentFromLayout", {
25
- enumerable: true,
26
- get: function get() {
27
- return _transforms.unwrapContentFromLayout;
28
- }
29
- });
30
- var _transforms = require("@atlaskit/editor-common/transforms");
@@ -1 +0,0 @@
1
- export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
@@ -1 +0,0 @@
1
- export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
@@ -1 +0,0 @@
1
- export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, } from '@atlaskit/editor-common/transforms';
@@ -1 +0,0 @@
1
- export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, } from '@atlaskit/editor-common/transforms';