@atlaskit/editor-common 111.0.0 → 111.0.1

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,12 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e56d251bf0184`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e56d251bf0184) -
8
+ [EDITOR-3966] Fix embed sizing issue in sync block
9
+
3
10
  ## 111.0.0
4
11
 
5
12
  ### Major Changes
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  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); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "110.50.3";
22
+ var packageVersion = "111.0.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "110.50.3";
27
+ var packageVersion = "111.0.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -234,7 +234,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
234
234
 
235
235
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
236
236
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
237
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
237
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli &,\n\t\t[data-prosemirror-node-name='bodiedSyncBlock'] &,\n\t\t[data-prosemirror-node-name='syncBlock'] &,\n\t\t[data-sync-block-renderer] &,\n\t\t[data-bodied-sync-block] & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
238
238
  /* This causes issues for new experience where we don't strip layout attributes
239
239
  when copying top-level node and pasting into a table/layout,
240
240
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -10,6 +10,8 @@ exports.shouldAddDefaultWrappedWidth = exports.nonWrappedLayouts = exports.isRic
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
15
  var _grid = require("../ui/MediaSingle/grid");
14
16
  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; }
15
17
  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; }
@@ -26,7 +28,11 @@ var isRichMediaInsideOfBlockNode = exports.isRichMediaInsideOfBlockNode = functi
26
28
  var _view$state$schema$no = view.state.schema.nodes,
27
29
  expand = _view$state$schema$no.expand,
28
30
  nestedExpand = _view$state$schema$no.nestedExpand,
29
- layoutColumn = _view$state$schema$no.layoutColumn;
31
+ layoutColumn = _view$state$schema$no.layoutColumn,
32
+ bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
33
+ if ((0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
34
+ return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
35
+ }
30
36
  return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
31
37
  };
32
38
  var alignAttributes = exports.alignAttributes = function alignAttributes(layout, oldAttrs) {
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "110.50.3";
7
+ const packageVersion = "111.0.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "110.50.3";
17
+ const packageVersion = "111.0.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -216,7 +216,11 @@ export const MediaSingleDimensionHelper = ({
216
216
  [data-layout-column] &,
217
217
  [data-node-type='expand'] &,
218
218
  [data-panel-type] &,
219
- li & {
219
+ li &,
220
+ [data-prosemirror-node-name='bodiedSyncBlock'] &,
221
+ [data-prosemirror-node-name='syncBlock'] &,
222
+ [data-sync-block-renderer] &,
223
+ [data-bodied-sync-block] & {
220
224
  max-width: 100%;
221
225
  }
222
226
 
@@ -1,5 +1,7 @@
1
1
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
2
2
  import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
5
  import { calcPxFromColumns, wrappedLayouts } from '../ui/MediaSingle/grid';
4
6
  export const shouldAddDefaultWrappedWidth = (layout, width, lineLength) => {
5
7
  return wrappedLayouts.indexOf(layout) > -1 && lineLength && width && width > 0.5 * lineLength;
@@ -14,8 +16,12 @@ export const isRichMediaInsideOfBlockNode = (view, pos) => {
14
16
  const {
15
17
  expand,
16
18
  nestedExpand,
17
- layoutColumn
19
+ layoutColumn,
20
+ bodiedSyncBlock
18
21
  } = view.state.schema.nodes;
22
+ if (editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding')) {
23
+ return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
24
+ }
19
25
  return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
20
26
  };
21
27
  export const alignAttributes = (layout, oldAttrs, gridSize = 12, originalWidth, lineLength) => {
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "110.50.3";
13
+ var packageVersion = "111.0.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "110.50.3";
24
+ var packageVersion = "111.0.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -224,7 +224,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
224
224
 
225
225
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
226
226
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
227
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
227
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli &,\n\t\t[data-prosemirror-node-name='bodiedSyncBlock'] &,\n\t\t[data-prosemirror-node-name='syncBlock'] &,\n\t\t[data-sync-block-renderer] &,\n\t\t[data-bodied-sync-block] & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
228
228
  /* This causes issues for new experience where we don't strip layout attributes
229
229
  when copying top-level node and pasting into a table/layout,
230
230
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -3,6 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
8
  import { calcPxFromColumns, wrappedLayouts } from '../ui/MediaSingle/grid';
7
9
  export var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(layout, width, lineLength) {
8
10
  return wrappedLayouts.indexOf(layout) > -1 && lineLength && width && width > 0.5 * lineLength;
@@ -17,7 +19,11 @@ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(
17
19
  var _view$state$schema$no = view.state.schema.nodes,
18
20
  expand = _view$state$schema$no.expand,
19
21
  nestedExpand = _view$state$schema$no.nestedExpand,
20
- layoutColumn = _view$state$schema$no.layoutColumn;
22
+ layoutColumn = _view$state$schema$no.layoutColumn,
23
+ bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
24
+ if (editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding')) {
25
+ return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
26
+ }
21
27
  return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
22
28
  };
23
29
  export var alignAttributes = function alignAttributes(layout, oldAttrs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.0.0",
3
+ "version": "111.0.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -258,6 +258,9 @@
258
258
  "platform_editor_transform_invalid_media_width": {
259
259
  "type": "boolean"
260
260
  },
261
+ "platform_synced_block_dogfooding": {
262
+ "type": "boolean"
263
+ },
261
264
  "platform_editor_sentry_breadcrumbs": {
262
265
  "type": "boolean"
263
266
  },