@atlaskit/editor-common 111.11.9 → 111.11.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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/messages/syncBlock.js +10 -0
- package/dist/cjs/styles/shared/sync-block.js +4 -2
- package/dist/cjs/ui/FloatingToolbar/Button.js +2 -2
- package/dist/cjs/utils/rich-media-utils.js +1 -2
- package/dist/es2019/messages/syncBlock.js +10 -0
- package/dist/es2019/styles/shared/sync-block.js +3 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +2 -2
- package/dist/es2019/utils/rich-media-utils.js +1 -2
- package/dist/esm/messages/syncBlock.js +10 -0
- package/dist/esm/styles/shared/sync-block.js +3 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +2 -2
- package/dist/esm/utils/rich-media-utils.js +1 -2
- package/dist/types/messages/syncBlock.d.ts +10 -0
- package/dist/types/styles/shared/sync-block.d.ts +2 -0
- package/dist/types-ts4.5/messages/syncBlock.d.ts +10 -0
- package/dist/types-ts4.5/styles/shared/sync-block.d.ts +2 -0
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.11.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ab4e4e442ad49`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab4e4e442ad49) -
|
|
8
|
+
[ux] [EDITOR-3694] Add loading state to bodiedSyncBlock for when saving new block to BE
|
|
9
|
+
|
|
10
|
+
## 111.11.10
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`7ba3979b92b42`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ba3979b92b42) -
|
|
15
|
+
Remove platform_synced_block_dogfooding feature gate
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 111.11.9
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -355,5 +355,15 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
|
|
|
355
355
|
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
356
356
|
defaultMessage: 'Learn more',
|
|
357
357
|
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
358
|
+
},
|
|
359
|
+
cannotCreateSyncBlockTitle: {
|
|
360
|
+
id: 'fabric.editor.cannotCreateSyncBlockTitle',
|
|
361
|
+
defaultMessage: 'Unable to create synced block',
|
|
362
|
+
description: 'Title in flag which appears when a synced block cannot be created'
|
|
363
|
+
},
|
|
364
|
+
CannotCreateSyncBlockDescription: {
|
|
365
|
+
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
366
|
+
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
367
|
+
description: 'Description in flag which appears when a synced block cannot be created'
|
|
358
368
|
}
|
|
359
369
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.viewModeClassName = exports.disabledClassName = exports.SyncBlockStateCssClassName = exports.SyncBlockSharedCssClassName = exports.SyncBlockRendererDataAttributeName = exports.SyncBlockLabelSharedCssClassName = exports.BodiedSyncBlockSharedCssClassName = void 0;
|
|
6
|
+
exports.viewModeClassName = exports.disabledClassName = exports.creationLoadingClassName = exports.SyncBlockStateCssClassName = exports.SyncBlockSharedCssClassName = exports.SyncBlockRendererDataAttributeName = exports.SyncBlockLabelSharedCssClassName = exports.BodiedSyncBlockSharedCssClassName = void 0;
|
|
7
7
|
var prefix = 'ak-editor-sync-block';
|
|
8
8
|
var SyncBlockSharedCssClassName = exports.SyncBlockSharedCssClassName = {
|
|
9
9
|
prefix: prefix,
|
|
@@ -25,7 +25,9 @@ var SyncBlockLabelSharedCssClassName = exports.SyncBlockLabelSharedCssClassName
|
|
|
25
25
|
};
|
|
26
26
|
var disabledClassName = exports.disabledClassName = 'disabled';
|
|
27
27
|
var viewModeClassName = exports.viewModeClassName = 'view-mode';
|
|
28
|
+
var creationLoadingClassName = exports.creationLoadingClassName = 'creation-loading';
|
|
28
29
|
var SyncBlockStateCssClassName = exports.SyncBlockStateCssClassName = {
|
|
29
30
|
disabledClassName: disabledClassName,
|
|
30
|
-
viewModeClassName: viewModeClassName
|
|
31
|
+
viewModeClassName: viewModeClassName,
|
|
32
|
+
creationLoadingClassName: creationLoadingClassName
|
|
31
33
|
};
|
|
@@ -107,7 +107,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
107
107
|
className: className,
|
|
108
108
|
ref: function ref(buttonElement) {
|
|
109
109
|
setSpotlightReferenceElement(buttonElement);
|
|
110
|
-
if (forwardedRef && (0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
110
|
+
if (forwardedRef && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
111
111
|
if (typeof forwardedRef === 'function') {
|
|
112
112
|
forwardedRef(buttonElement);
|
|
113
113
|
} else if ((0, _typeof2.default)(forwardedRef) === 'object') {
|
|
@@ -163,5 +163,5 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
163
163
|
}, spotlightConfig.spotlightCardOptions)));
|
|
164
164
|
};
|
|
165
165
|
var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
166
|
-
return (0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
166
|
+
return (0, _experiments.editorExperiment)('platform_synced_block', true);
|
|
167
167
|
}, /*#__PURE__*/(0, _react.forwardRef)(FloatingToolbarButton), FloatingToolbarButton);
|
|
@@ -10,7 +10,6 @@ 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
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
14
|
var _grid = require("../ui/MediaSingle/grid");
|
|
16
15
|
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; }
|
|
@@ -30,7 +29,7 @@ var isRichMediaInsideOfBlockNode = exports.isRichMediaInsideOfBlockNode = functi
|
|
|
30
29
|
nestedExpand = _view$state$schema$no.nestedExpand,
|
|
31
30
|
layoutColumn = _view$state$schema$no.layoutColumn,
|
|
32
31
|
bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
|
|
33
|
-
if ((0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
32
|
+
if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
34
33
|
return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
|
|
35
34
|
}
|
|
36
35
|
return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
|
|
@@ -349,5 +349,15 @@ export const syncBlockMessages = defineMessages({
|
|
|
349
349
|
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
350
350
|
defaultMessage: 'Learn more',
|
|
351
351
|
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
352
|
+
},
|
|
353
|
+
cannotCreateSyncBlockTitle: {
|
|
354
|
+
id: 'fabric.editor.cannotCreateSyncBlockTitle',
|
|
355
|
+
defaultMessage: 'Unable to create synced block',
|
|
356
|
+
description: 'Title in flag which appears when a synced block cannot be created'
|
|
357
|
+
},
|
|
358
|
+
CannotCreateSyncBlockDescription: {
|
|
359
|
+
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
360
|
+
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
361
|
+
description: 'Description in flag which appears when a synced block cannot be created'
|
|
352
362
|
}
|
|
353
363
|
});
|
|
@@ -19,7 +19,9 @@ export const SyncBlockLabelSharedCssClassName = {
|
|
|
19
19
|
};
|
|
20
20
|
export const disabledClassName = 'disabled';
|
|
21
21
|
export const viewModeClassName = 'view-mode';
|
|
22
|
+
export const creationLoadingClassName = 'creation-loading';
|
|
22
23
|
export const SyncBlockStateCssClassName = {
|
|
23
24
|
disabledClassName,
|
|
24
|
-
viewModeClassName
|
|
25
|
+
viewModeClassName,
|
|
26
|
+
creationLoadingClassName
|
|
25
27
|
};
|
|
@@ -85,7 +85,7 @@ const FloatingToolbarButton = ({
|
|
|
85
85
|
className: className,
|
|
86
86
|
ref: buttonElement => {
|
|
87
87
|
setSpotlightReferenceElement(buttonElement);
|
|
88
|
-
if (forwardedRef && editorExperiment('platform_synced_block', true)
|
|
88
|
+
if (forwardedRef && editorExperiment('platform_synced_block', true)) {
|
|
89
89
|
if (typeof forwardedRef === 'function') {
|
|
90
90
|
forwardedRef(buttonElement);
|
|
91
91
|
} else if (typeof forwardedRef === 'object') {
|
|
@@ -147,4 +147,4 @@ const FloatingToolbarButton = ({
|
|
|
147
147
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
148
148
|
}, spotlightConfig.spotlightCardOptions)));
|
|
149
149
|
};
|
|
150
|
-
export default componentWithCondition(() => editorExperiment('platform_synced_block', true)
|
|
150
|
+
export default componentWithCondition(() => editorExperiment('platform_synced_block', true), /*#__PURE__*/forwardRef(FloatingToolbarButton), FloatingToolbarButton);
|
|
@@ -1,6 +1,5 @@
|
|
|
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
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { calcPxFromColumns, wrappedLayouts } from '../ui/MediaSingle/grid';
|
|
6
5
|
export const shouldAddDefaultWrappedWidth = (layout, width, lineLength) => {
|
|
@@ -19,7 +18,7 @@ export const isRichMediaInsideOfBlockNode = (view, pos) => {
|
|
|
19
18
|
layoutColumn,
|
|
20
19
|
bodiedSyncBlock
|
|
21
20
|
} = view.state.schema.nodes;
|
|
22
|
-
if (editorExperiment('platform_synced_block', true)
|
|
21
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
23
22
|
return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
|
|
24
23
|
}
|
|
25
24
|
return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
|
|
@@ -349,5 +349,15 @@ export var syncBlockMessages = defineMessages({
|
|
|
349
349
|
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
350
350
|
defaultMessage: 'Learn more',
|
|
351
351
|
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
352
|
+
},
|
|
353
|
+
cannotCreateSyncBlockTitle: {
|
|
354
|
+
id: 'fabric.editor.cannotCreateSyncBlockTitle',
|
|
355
|
+
defaultMessage: 'Unable to create synced block',
|
|
356
|
+
description: 'Title in flag which appears when a synced block cannot be created'
|
|
357
|
+
},
|
|
358
|
+
CannotCreateSyncBlockDescription: {
|
|
359
|
+
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
360
|
+
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
361
|
+
description: 'Description in flag which appears when a synced block cannot be created'
|
|
352
362
|
}
|
|
353
363
|
});
|
|
@@ -19,7 +19,9 @@ export var SyncBlockLabelSharedCssClassName = {
|
|
|
19
19
|
};
|
|
20
20
|
export var disabledClassName = 'disabled';
|
|
21
21
|
export var viewModeClassName = 'view-mode';
|
|
22
|
+
export var creationLoadingClassName = 'creation-loading';
|
|
22
23
|
export var SyncBlockStateCssClassName = {
|
|
23
24
|
disabledClassName: disabledClassName,
|
|
24
|
-
viewModeClassName: viewModeClassName
|
|
25
|
+
viewModeClassName: viewModeClassName,
|
|
26
|
+
creationLoadingClassName: creationLoadingClassName
|
|
25
27
|
};
|
|
@@ -98,7 +98,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
98
98
|
className: className,
|
|
99
99
|
ref: function ref(buttonElement) {
|
|
100
100
|
setSpotlightReferenceElement(buttonElement);
|
|
101
|
-
if (forwardedRef && editorExperiment('platform_synced_block', true)
|
|
101
|
+
if (forwardedRef && editorExperiment('platform_synced_block', true)) {
|
|
102
102
|
if (typeof forwardedRef === 'function') {
|
|
103
103
|
forwardedRef(buttonElement);
|
|
104
104
|
} else if (_typeof(forwardedRef) === 'object') {
|
|
@@ -154,5 +154,5 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
154
154
|
}, spotlightConfig.spotlightCardOptions)));
|
|
155
155
|
};
|
|
156
156
|
export default componentWithCondition(function () {
|
|
157
|
-
return editorExperiment('platform_synced_block', true)
|
|
157
|
+
return editorExperiment('platform_synced_block', true);
|
|
158
158
|
}, /*#__PURE__*/forwardRef(FloatingToolbarButton), FloatingToolbarButton);
|
|
@@ -3,7 +3,6 @@ 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
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { calcPxFromColumns, wrappedLayouts } from '../ui/MediaSingle/grid';
|
|
9
8
|
export var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(layout, width, lineLength) {
|
|
@@ -21,7 +20,7 @@ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(
|
|
|
21
20
|
nestedExpand = _view$state$schema$no.nestedExpand,
|
|
22
21
|
layoutColumn = _view$state$schema$no.layoutColumn,
|
|
23
22
|
bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
|
|
24
|
-
if (editorExperiment('platform_synced_block', true)
|
|
23
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
25
24
|
return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
|
|
26
25
|
}
|
|
27
26
|
return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
|
|
@@ -349,4 +349,14 @@ export declare const syncBlockMessages: {
|
|
|
349
349
|
defaultMessage: string;
|
|
350
350
|
description: string;
|
|
351
351
|
};
|
|
352
|
+
cannotCreateSyncBlockTitle: {
|
|
353
|
+
id: string;
|
|
354
|
+
defaultMessage: string;
|
|
355
|
+
description: string;
|
|
356
|
+
};
|
|
357
|
+
CannotCreateSyncBlockDescription: {
|
|
358
|
+
id: string;
|
|
359
|
+
defaultMessage: string;
|
|
360
|
+
description: string;
|
|
361
|
+
};
|
|
352
362
|
};
|
|
@@ -16,7 +16,9 @@ export declare const SyncBlockLabelSharedCssClassName: {
|
|
|
16
16
|
};
|
|
17
17
|
export declare const disabledClassName = "disabled";
|
|
18
18
|
export declare const viewModeClassName = "view-mode";
|
|
19
|
+
export declare const creationLoadingClassName = "creation-loading";
|
|
19
20
|
export declare const SyncBlockStateCssClassName: {
|
|
20
21
|
disabledClassName: string;
|
|
21
22
|
viewModeClassName: string;
|
|
23
|
+
creationLoadingClassName: string;
|
|
22
24
|
};
|
|
@@ -349,4 +349,14 @@ export declare const syncBlockMessages: {
|
|
|
349
349
|
defaultMessage: string;
|
|
350
350
|
description: string;
|
|
351
351
|
};
|
|
352
|
+
cannotCreateSyncBlockTitle: {
|
|
353
|
+
id: string;
|
|
354
|
+
defaultMessage: string;
|
|
355
|
+
description: string;
|
|
356
|
+
};
|
|
357
|
+
CannotCreateSyncBlockDescription: {
|
|
358
|
+
id: string;
|
|
359
|
+
defaultMessage: string;
|
|
360
|
+
description: string;
|
|
361
|
+
};
|
|
352
362
|
};
|
|
@@ -16,7 +16,9 @@ export declare const SyncBlockLabelSharedCssClassName: {
|
|
|
16
16
|
};
|
|
17
17
|
export declare const disabledClassName = "disabled";
|
|
18
18
|
export declare const viewModeClassName = "view-mode";
|
|
19
|
+
export declare const creationLoadingClassName = "creation-loading";
|
|
19
20
|
export declare const SyncBlockStateCssClassName: {
|
|
20
21
|
disabledClassName: string;
|
|
21
22
|
viewModeClassName: string;
|
|
23
|
+
creationLoadingClassName: string;
|
|
22
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.11.
|
|
3
|
+
"version": "111.11.11",
|
|
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/"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^22.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^22.1.0",
|
|
85
85
|
"@atlaskit/tokens": "^11.0.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -250,9 +250,6 @@
|
|
|
250
250
|
"platform_editor_transform_invalid_media_width": {
|
|
251
251
|
"type": "boolean"
|
|
252
252
|
},
|
|
253
|
-
"platform_synced_block_dogfooding": {
|
|
254
|
-
"type": "boolean"
|
|
255
|
-
},
|
|
256
253
|
"platform_editor_sentry_breadcrumbs": {
|
|
257
254
|
"type": "boolean"
|
|
258
255
|
},
|