@atlaskit/editor-common 128.1.0 → 128.3.0
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 +43 -0
- package/dist/cjs/annotation/manager.js +52 -2
- package/dist/cjs/extensions/buildMenuItem.js +1 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +7 -2
- package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +2 -1
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +5 -0
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +47 -21
- package/dist/cjs/quick-insert/QuickInsertMenuItem.js +7 -0
- package/dist/cjs/quick-insert/SkillTag.compiled.css +9 -0
- package/dist/cjs/quick-insert/SkillTag.js +44 -0
- package/dist/cjs/styles/shared/table.js +3 -5
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/annotation/manager.js +44 -2
- package/dist/es2019/extensions/buildMenuItem.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +7 -2
- package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +2 -1
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +5 -0
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +37 -13
- package/dist/es2019/quick-insert/QuickInsertMenuItem.js +7 -0
- package/dist/es2019/quick-insert/SkillTag.compiled.css +9 -0
- package/dist/es2019/quick-insert/SkillTag.js +35 -0
- package/dist/es2019/styles/shared/table.js +3 -5
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/annotation/manager.js +52 -2
- package/dist/esm/extensions/buildMenuItem.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +7 -2
- package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +2 -1
- package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +5 -0
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +38 -13
- package/dist/esm/quick-insert/QuickInsertMenuItem.js +7 -0
- package/dist/esm/quick-insert/SkillTag.compiled.css +9 -0
- package/dist/esm/quick-insert/SkillTag.js +37 -0
- package/dist/esm/styles/shared/table.js +3 -5
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/annotation/index.d.ts +43 -2
- package/dist/types/annotation/manager.d.ts +6 -2
- package/dist/types/extensions/types/utils.d.ts +1 -0
- package/dist/types/quick-insert/CompactQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/quick-insert/ElementBrowserQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +9 -1
- package/dist/types/quick-insert/QuickInsertMenuItem.d.ts +7 -1
- package/dist/types/quick-insert/SkillTag.d.ts +6 -0
- package/dist/types/styles/shared/table.d.ts +3 -5
- package/package.json +10 -10
- package/quick-insert/skill-tag/package.json +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 128.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`faf42b91fb5b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/faf42b91fb5b1) -
|
|
8
|
+
Extend the `AnnotationManager` API ahead of media (block node) annotation support and the
|
|
9
|
+
Confluence comments migration. Types and manager plumbing only — the hooks behind these methods
|
|
10
|
+
land with the editor and renderer changes.
|
|
11
|
+
- `startDraft` takes an optional `localId`, so a draft can target a block node instead of the
|
|
12
|
+
current text selection. `StartDraftResult` gains an `invalid-localId` failure reason.
|
|
13
|
+
- New `clearSelectedAnnotation()` and `clearHoveredAnnotation()`: clear the selection or hover
|
|
14
|
+
without the caller having to track which annotation id is active. Both return the id they
|
|
15
|
+
cleared (`undefined` when nothing was active); `clearSelectedAnnotation` fails with
|
|
16
|
+
`draft-in-progress` while a draft is open.
|
|
17
|
+
- `AnnotationDraftStartedData` gains `targetNodeType`, and `AnnotationSelectedChangeData` gains
|
|
18
|
+
`targetNodeType` and `viewMethod`.
|
|
19
|
+
- `draftAnnotationCleared` is now subscribable via `onDraftAnnotationCleared` /
|
|
20
|
+
`offDraftAnnotationCleared`.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
26
|
+
## 128.2.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- [`ef6d325af58d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef6d325af58d6) -
|
|
31
|
+
Update i18n NPM package versions for editor,editor-extensions,activity-platform,media,elements
|
|
32
|
+
(Group 3)
|
|
33
|
+
- [`375d0ca074591`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/375d0ca074591) -
|
|
34
|
+
Unify Rovo Skill quick-insert construction across product Editors and AI Chat behind
|
|
35
|
+
`platform_editor_slash_command`. Add shared menu title and preview presentation options, and reuse
|
|
36
|
+
existing extension metadata for Skill icons, descriptions, attribution and Beta labels. Export the
|
|
37
|
+
shared Editor SkillTag for reuse across menus. Preserve shared insertion and Chat-specific
|
|
38
|
+
behavior.
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- [`bf2f598c788f8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf2f598c788f8) -
|
|
43
|
+
clean up feature flag platform_editor_core_static_css
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
|
|
3
46
|
## 128.1.0
|
|
4
47
|
|
|
5
48
|
### Minor Changes
|
|
@@ -74,6 +74,18 @@ var SharedAnnotationManager = exports.SharedAnnotationManager = /*#__PURE__*/fun
|
|
|
74
74
|
this.emitter.off('annotationSelectionChanged', handler);
|
|
75
75
|
return this;
|
|
76
76
|
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "onDraftAnnotationCleared",
|
|
79
|
+
value: function onDraftAnnotationCleared(handler) {
|
|
80
|
+
this.emitter.on('draftAnnotationCleared', handler);
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "offDraftAnnotationCleared",
|
|
85
|
+
value: function offDraftAnnotationCleared(handler) {
|
|
86
|
+
this.emitter.off('draftAnnotationCleared', handler);
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
77
89
|
}, {
|
|
78
90
|
key: "emit",
|
|
79
91
|
value: function emit(event) {
|
|
@@ -110,7 +122,7 @@ var SharedAnnotationManager = exports.SharedAnnotationManager = /*#__PURE__*/fun
|
|
|
110
122
|
}
|
|
111
123
|
}, {
|
|
112
124
|
key: "startDraft",
|
|
113
|
-
value: function startDraft() {
|
|
125
|
+
value: function startDraft(localId) {
|
|
114
126
|
var fn = this.hooks.get('startDraft');
|
|
115
127
|
if (!fn) {
|
|
116
128
|
return {
|
|
@@ -119,7 +131,7 @@ var SharedAnnotationManager = exports.SharedAnnotationManager = /*#__PURE__*/fun
|
|
|
119
131
|
};
|
|
120
132
|
}
|
|
121
133
|
try {
|
|
122
|
-
return fn();
|
|
134
|
+
return fn(localId);
|
|
123
135
|
} catch (_unused2) {
|
|
124
136
|
return {
|
|
125
137
|
success: false,
|
|
@@ -244,5 +256,43 @@ var SharedAnnotationManager = exports.SharedAnnotationManager = /*#__PURE__*/fun
|
|
|
244
256
|
};
|
|
245
257
|
}
|
|
246
258
|
}
|
|
259
|
+
}, {
|
|
260
|
+
key: "clearSelectedAnnotation",
|
|
261
|
+
value: function clearSelectedAnnotation() {
|
|
262
|
+
var fn = this.hooks.get('clearSelectedAnnotation');
|
|
263
|
+
if (!fn) {
|
|
264
|
+
return {
|
|
265
|
+
success: false,
|
|
266
|
+
reason: 'manager-not-initialized'
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
return fn();
|
|
271
|
+
} catch (_unused9) {
|
|
272
|
+
return {
|
|
273
|
+
success: false,
|
|
274
|
+
reason: 'hook-execution-error'
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
key: "clearHoveredAnnotation",
|
|
280
|
+
value: function clearHoveredAnnotation() {
|
|
281
|
+
var fn = this.hooks.get('clearHoveredAnnotation');
|
|
282
|
+
if (!fn) {
|
|
283
|
+
return {
|
|
284
|
+
success: false,
|
|
285
|
+
reason: 'manager-not-initialized'
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
return fn();
|
|
290
|
+
} catch (_unused0) {
|
|
291
|
+
return {
|
|
292
|
+
success: false,
|
|
293
|
+
reason: 'hook-execution-error'
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
247
297
|
}]);
|
|
248
298
|
}();
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "128.0
|
|
30
|
+
var packageVersion = "128.2.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -85,10 +85,13 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
85
85
|
isDisabled = _ref.isDisabled,
|
|
86
86
|
onSelect = _ref.onSelect,
|
|
87
87
|
preview = _ref.preview,
|
|
88
|
+
previewIcon = _ref.previewIcon,
|
|
88
89
|
previewImageUrls = _ref.previewImageUrls,
|
|
89
90
|
shortcut = _ref.shortcut,
|
|
91
|
+
titleContent = _ref.titleContent,
|
|
90
92
|
_ref$shouldShowPrevie = _ref.shouldShowPreview,
|
|
91
93
|
shouldShowPreview = _ref$shouldShowPrevie === void 0 ? true : _ref$shouldShowPrevie,
|
|
94
|
+
shouldClampPreview = _ref.shouldClampPreview,
|
|
92
95
|
_ref$shouldWrapIcon = _ref.shouldWrapIcon,
|
|
93
96
|
shouldWrapIcon = _ref$shouldWrapIcon === void 0 ? true : _ref$shouldWrapIcon,
|
|
94
97
|
title = _ref.title;
|
|
@@ -138,7 +141,7 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
138
141
|
alignBlock: "center",
|
|
139
142
|
spread: "space-between",
|
|
140
143
|
xcss: styles.content
|
|
141
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, null, title), shortcut && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
144
|
+
}, titleContent !== null && titleContent !== void 0 ? titleContent : /*#__PURE__*/_react.default.createElement(_compiled.Text, null, title), shortcut && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
142
145
|
as: "span",
|
|
143
146
|
xcss: styles.shortcut
|
|
144
147
|
}, shortcut))), shouldRenderPreview && referenceElement && /*#__PURE__*/_react.default.createElement(_QuickInsertHoverPreview.QuickInsertHoverPreview, {
|
|
@@ -148,6 +151,8 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
148
151
|
preview: resolvedPreview,
|
|
149
152
|
popupsMountPoint: popupsMountPoint,
|
|
150
153
|
referenceElement: referenceElement,
|
|
151
|
-
title: title
|
|
154
|
+
title: title,
|
|
155
|
+
icon: previewIcon,
|
|
156
|
+
shouldClampText: shouldClampPreview
|
|
152
157
|
}));
|
|
153
158
|
};
|
|
@@ -115,6 +115,7 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
|
|
|
115
115
|
isDisabled = _ref.isDisabled,
|
|
116
116
|
onSelect = _ref.onSelect,
|
|
117
117
|
shortcut = _ref.shortcut,
|
|
118
|
+
titleContent = _ref.titleContent,
|
|
118
119
|
_ref$shouldWrapIcon = _ref.shouldWrapIcon,
|
|
119
120
|
shouldWrapIcon = _ref$shouldWrapIcon === void 0 ? true : _ref$shouldWrapIcon,
|
|
120
121
|
title = _ref.title;
|
|
@@ -155,7 +156,7 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
|
|
|
155
156
|
alignBlock: "center",
|
|
156
157
|
spread: "space-between",
|
|
157
158
|
space: "space.100"
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
159
|
+
}, titleContent !== null && titleContent !== void 0 ? titleContent : /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
159
160
|
color: "color.text",
|
|
160
161
|
maxLines: 1,
|
|
161
162
|
size: "medium",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
9
9
|
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
|
|
10
10
|
._16jlidpf{flex-grow:0}
|
|
11
|
+
._16jlkb7n{flex-grow:1}
|
|
11
12
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
12
13
|
._18m915vq{overflow-y:hidden}
|
|
13
14
|
._1bah1h6o{justify-content:center}
|
|
@@ -20,8 +21,10 @@
|
|
|
20
21
|
._1e0ccj1k{display:-webkit-box}
|
|
21
22
|
._1i4qfg65{overflow-wrap:anywhere}
|
|
22
23
|
._1o9zidpf{flex-shrink:0}
|
|
24
|
+
._1o9zkb7n{flex-shrink:1}
|
|
23
25
|
._1pby16oo{z-index:510}
|
|
24
26
|
._1reo15vq{overflow-x:hidden}
|
|
27
|
+
._1ul9idpf{min-width:0}
|
|
25
28
|
._1yyjcs5v{-webkit-line-clamp:2}
|
|
26
29
|
._1yyjegat{-webkit-line-clamp:4}
|
|
27
30
|
._2lx21bp4{flex-direction:column}
|
|
@@ -36,7 +39,9 @@
|
|
|
36
39
|
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
37
40
|
._c71l1kw7{max-height:inherit}
|
|
38
41
|
._c71lk6is{max-height:calc(100vh - 1pc)}
|
|
42
|
+
._i0dl1wug{flex-basis:auto}
|
|
39
43
|
._i0dlexct{flex-basis:16px}
|
|
44
|
+
._k48pwu06{font-weight:var(--ds-font-weight-bold,653)}
|
|
40
45
|
._p12f1oec{max-width:calc(100vw - 1pc)}
|
|
41
46
|
._p12f1osq{max-width:100%}
|
|
42
47
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
@@ -8,14 +8,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.QuickInsertHoverPreview = void 0;
|
|
10
10
|
require("./QuickInsertHoverPreview.compiled.css");
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var React = _react;
|
|
13
11
|
var _runtime = require("@compiled/react/runtime");
|
|
14
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
14
|
var _reactDom = require("react-dom");
|
|
16
15
|
var _bindEventListener = require("bind-event-listener");
|
|
17
16
|
var _reactIntl = require("react-intl");
|
|
18
17
|
var _reactPopper = require("@atlaskit/popper/react-popper");
|
|
18
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
19
|
+
var _inline = require("@atlaskit/primitives/compiled/inline");
|
|
19
20
|
var _text = require("@atlaskit/primitives/compiled/text");
|
|
20
21
|
var _useThemeObserver2 = require("@atlaskit/tokens/use-theme-observer");
|
|
21
22
|
var _messages = require("./messages");
|
|
@@ -46,33 +47,44 @@ var PREVIEW_MODIFIERS = [{
|
|
|
46
47
|
rootBoundary: 'viewport'
|
|
47
48
|
}
|
|
48
49
|
}];
|
|
50
|
+
var layoutStyles = {
|
|
51
|
+
titleRow: "_1ul9idpf",
|
|
52
|
+
titleIcon: "_4cvr1h6o _1e0c1txw _1o9zidpf _1bah1h6o",
|
|
53
|
+
attributionText: "_16jlkb7n _1o9zkb7n _i0dl1wug _1ul9idpf _1i4qfg65"
|
|
54
|
+
};
|
|
49
55
|
var styles = {
|
|
50
56
|
positioner: "_c71lk6is _p12f1oec _1pby16oo",
|
|
51
57
|
panel: "_2rko1qi0 _1reo15vq _18m915vq _1rjcutpp _18zrutpp _vchhusvi _bfhk1bhr _16qs130s _c71l1kw7 _p12f1osq _1bsbncxg",
|
|
52
58
|
content: "_zulpu2gc _1e0c1txw _2lx21bp4",
|
|
53
|
-
title: "_11c81qyo _1reo15vq _18m915vq _syazazsu _1i4qfg65 _1e0ccj1k _sudp1e54 _1yyjcs5v",
|
|
59
|
+
title: "_11c81qyo _16jlkb7n _1o9zkb7n _i0dl1wug _1reo15vq _18m915vq _syazazsu _1ul9idpf _1i4qfg65 _1e0ccj1k _sudp1e54 _1yyjcs5v",
|
|
60
|
+
unclampedTitle: "_11c8fhey _16jlkb7n _1o9zkb7n _i0dl1wug _syazi7uo _k48pwu06 _1ul9idpf _1i4qfg65",
|
|
54
61
|
description: "_11c8fhey _1reo15vq _18m915vq _syazi7uo _1e0ccj1k _1i4qfg65 _sudp1e54 _1yyjegat",
|
|
62
|
+
unclampedDescription: "_11c8fhey _syazi7uo _1i4qfg65",
|
|
55
63
|
imageArea: "_2rko12b0 _1reo15vq _18m915vq _bfhkhfxm _4t3i68cl _6rthu2gc _p12f1osq _1bsbp3fh",
|
|
56
64
|
image: "_1e0c1ule _4t3i1osq _5ral1f51 _1bsb1osq",
|
|
57
65
|
imageHidden: "_3um015vq",
|
|
58
|
-
attribution: "
|
|
66
|
+
attribution: "_zulp1b66 _4cvr1h6o _syazazsu _1e0c1txw _1i4qfg65",
|
|
67
|
+
compactAttribution: "_11c8wadc",
|
|
59
68
|
attributionIcon: "_16jlidpf _1o9zidpf _i0dlexct _4cvr1h6o _1e0c1txw _4t3i7vkz _1bah1h6o _1bsb7vkz"
|
|
60
69
|
};
|
|
61
70
|
|
|
62
71
|
/** The selected item's description and attribution are announced through its aria-describedby. */
|
|
63
72
|
var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickInsertHoverPreview(_ref) {
|
|
64
73
|
var description = _ref.description,
|
|
74
|
+
icon = _ref.icon,
|
|
65
75
|
id = _ref.id,
|
|
66
76
|
preview = _ref.preview,
|
|
67
77
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
68
78
|
referenceElement = _ref.referenceElement,
|
|
79
|
+
_ref$shouldClampText = _ref.shouldClampText,
|
|
80
|
+
shouldClampText = _ref$shouldClampText === void 0 ? true : _ref$shouldClampText,
|
|
69
81
|
title = _ref.title;
|
|
70
82
|
var _useThemeObserver = (0, _useThemeObserver2.useThemeObserver)(),
|
|
71
83
|
colorMode = _useThemeObserver.colorMode;
|
|
72
84
|
var imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
|
|
73
85
|
var hasAccessibleContent = Boolean(description || preview.attribution);
|
|
74
86
|
var portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
75
|
-
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_reactPopper.Popper, {
|
|
76
88
|
placement: "right-start",
|
|
77
89
|
referenceElement: referenceElement,
|
|
78
90
|
strategy: popupsMountPoint ? 'absolute' : 'fixed',
|
|
@@ -81,17 +93,19 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
81
93
|
var ref = _ref2.ref,
|
|
82
94
|
style = _ref2.style,
|
|
83
95
|
update = _ref2.update;
|
|
84
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
97
|
ref: ref,
|
|
86
98
|
style: style,
|
|
87
99
|
className: (0, _runtime.ax)([styles.positioner])
|
|
88
|
-
}, /*#__PURE__*/
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(QuickInsertPreviewPanel, {
|
|
89
101
|
description: description,
|
|
102
|
+
icon: icon,
|
|
90
103
|
id: hasAccessibleContent ? id : undefined,
|
|
91
104
|
imageUrl: imageUrl,
|
|
92
105
|
preview: preview,
|
|
93
106
|
popupsMountPoint: popupsMountPoint,
|
|
94
107
|
referenceElement: referenceElement,
|
|
108
|
+
shouldClampText: shouldClampText,
|
|
95
109
|
title: title,
|
|
96
110
|
update: update
|
|
97
111
|
}));
|
|
@@ -100,11 +114,13 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
100
114
|
var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
101
115
|
var _preview$attribution, _preview$attribution2;
|
|
102
116
|
var description = _ref3.description,
|
|
117
|
+
icon = _ref3.icon,
|
|
103
118
|
id = _ref3.id,
|
|
104
119
|
imageUrl = _ref3.imageUrl,
|
|
105
120
|
preview = _ref3.preview,
|
|
106
121
|
popupsMountPoint = _ref3.popupsMountPoint,
|
|
107
122
|
referenceElement = _ref3.referenceElement,
|
|
123
|
+
shouldClampText = _ref3.shouldClampText,
|
|
108
124
|
title = _ref3.title,
|
|
109
125
|
update = _ref3.update;
|
|
110
126
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
@@ -145,33 +161,43 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
145
161
|
observer.disconnect();
|
|
146
162
|
};
|
|
147
163
|
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
148
|
-
return /*#__PURE__*/
|
|
164
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
149
165
|
ref: setPanelElement,
|
|
150
166
|
id: id,
|
|
151
167
|
role: id ? 'tooltip' : undefined,
|
|
152
168
|
"data-testid": "quick-insert-preview-panel",
|
|
153
169
|
className: (0, _runtime.ax)([styles.panel])
|
|
154
|
-
}, imageUrl && /*#__PURE__*/
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, imageUrl && /*#__PURE__*/_react.default.createElement(PreviewImage, {
|
|
155
171
|
key: imageUrl,
|
|
156
172
|
imageUrl: imageUrl
|
|
157
|
-
}), /*#__PURE__*/
|
|
173
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
158
174
|
className: (0, _runtime.ax)([styles.content])
|
|
159
|
-
}, /*#__PURE__*/
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement(_inline.Inline, {
|
|
176
|
+
alignBlock: "center",
|
|
177
|
+
space: "space.100",
|
|
178
|
+
xcss: layoutStyles.titleRow,
|
|
179
|
+
"aria-hidden": "true"
|
|
180
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
181
|
+
as: "span",
|
|
160
182
|
"aria-hidden": "true",
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
className: (0, _runtime.ax)([styles.
|
|
164
|
-
},
|
|
165
|
-
className: (0, _runtime.ax)([styles.
|
|
166
|
-
},
|
|
183
|
+
xcss: layoutStyles.titleIcon
|
|
184
|
+
}, icon), /*#__PURE__*/_react.default.createElement("span", {
|
|
185
|
+
className: (0, _runtime.ax)([shouldClampText && styles.title, !shouldClampText && styles.unclampedTitle])
|
|
186
|
+
}, title)), description && /*#__PURE__*/_react.default.createElement("div", {
|
|
187
|
+
className: (0, _runtime.ax)([shouldClampText && styles.description, !shouldClampText && styles.unclampedDescription])
|
|
188
|
+
}, description), preview.attribution && /*#__PURE__*/_react.default.createElement("div", {
|
|
189
|
+
className: (0, _runtime.ax)([styles.attribution, shouldClampText && styles.compactAttribution])
|
|
190
|
+
}, AttributionIcon && /*#__PURE__*/_react.default.createElement("span", {
|
|
167
191
|
"aria-hidden": "true",
|
|
168
192
|
className: (0, _runtime.ax)([styles.attributionIcon])
|
|
169
|
-
}, /*#__PURE__*/
|
|
193
|
+
}, /*#__PURE__*/_react.default.createElement(AttributionIcon, null)), /*#__PURE__*/_react.default.createElement("span", {
|
|
194
|
+
className: (0, _runtime.ax)([layoutStyles.attributionText])
|
|
195
|
+
}, /*#__PURE__*/_react.default.createElement(_text.Text, {
|
|
170
196
|
size: "small",
|
|
171
197
|
color: "color.text.subtle"
|
|
172
198
|
}, AttributionIcon ? formattedAttributionName : formatMessage(_messages.messages.previewAttributionBy, {
|
|
173
199
|
name: formattedAttributionName
|
|
174
|
-
})))));
|
|
200
|
+
})))))));
|
|
175
201
|
};
|
|
176
202
|
var PreviewImage = function PreviewImage(_ref4) {
|
|
177
203
|
var imageUrl = _ref4.imageUrl;
|
|
@@ -183,11 +209,11 @@ var PreviewImage = function PreviewImage(_ref4) {
|
|
|
183
209
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
184
210
|
hasLoaded = _useState6[0],
|
|
185
211
|
setHasLoaded = _useState6[1];
|
|
186
|
-
return /*#__PURE__*/
|
|
212
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
187
213
|
"aria-hidden": "true",
|
|
188
214
|
"data-testid": "quick-insert-preview-image-area",
|
|
189
215
|
className: (0, _runtime.ax)([styles.imageArea])
|
|
190
|
-
}, !hasFailed && /*#__PURE__*/
|
|
216
|
+
}, !hasFailed && /*#__PURE__*/_react.default.createElement("img", {
|
|
191
217
|
"aria-hidden": "true",
|
|
192
218
|
"data-testid": "quick-insert-hover-preview",
|
|
193
219
|
src: imageUrl,
|
|
@@ -16,9 +16,12 @@ var QuickInsertMenuItem = exports.QuickInsertMenuItem = function QuickInsertMenu
|
|
|
16
16
|
isDisabled = _ref.isDisabled,
|
|
17
17
|
onSelect = _ref.onSelect,
|
|
18
18
|
preview = _ref.preview,
|
|
19
|
+
previewIcon = _ref.previewIcon,
|
|
19
20
|
previewImageUrls = _ref.previewImageUrls,
|
|
20
21
|
shortcut = _ref.shortcut,
|
|
22
|
+
titleContent = _ref.titleContent,
|
|
21
23
|
shouldShowPreview = _ref.shouldShowPreview,
|
|
24
|
+
shouldClampPreview = _ref.shouldClampPreview,
|
|
22
25
|
shouldWrapIcon = _ref.shouldWrapIcon,
|
|
23
26
|
title = _ref.title;
|
|
24
27
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
@@ -30,6 +33,7 @@ var QuickInsertMenuItem = exports.QuickInsertMenuItem = function QuickInsertMenu
|
|
|
30
33
|
isDisabled: isDisabled,
|
|
31
34
|
onSelect: onSelect,
|
|
32
35
|
shortcut: shortcut,
|
|
36
|
+
titleContent: titleContent,
|
|
33
37
|
shouldWrapIcon: shouldWrapIcon,
|
|
34
38
|
title: title
|
|
35
39
|
}) : /*#__PURE__*/_react.default.createElement(_CompactQuickInsertMenuItem.CompactQuickInsertMenuItem, {
|
|
@@ -39,9 +43,12 @@ var QuickInsertMenuItem = exports.QuickInsertMenuItem = function QuickInsertMenu
|
|
|
39
43
|
isDisabled: isDisabled,
|
|
40
44
|
onSelect: onSelect,
|
|
41
45
|
preview: preview,
|
|
46
|
+
previewIcon: previewIcon,
|
|
42
47
|
previewImageUrls: previewImageUrls,
|
|
43
48
|
shortcut: shortcut,
|
|
49
|
+
titleContent: titleContent,
|
|
44
50
|
shouldShowPreview: shouldShowPreview,
|
|
51
|
+
shouldClampPreview: shouldClampPreview,
|
|
45
52
|
shouldWrapIcon: shouldWrapIcon,
|
|
46
53
|
title: title
|
|
47
54
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
2
|
+
._1e0c1nu9{display:inline}
|
|
3
|
+
._1i4qfg65{overflow-wrap:anywhere}
|
|
4
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
5
|
+
._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
|
|
6
|
+
._mkrz1f6o{clip-path:polygon(20% 0,100% 0,100% 100%,0 100%)}
|
|
7
|
+
._mkrz1gdk{clip-path:polygon(0 0,100% 0,80% 100%,0 100%)}
|
|
8
|
+
._o5724jg8{white-space:normal}
|
|
9
|
+
._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* SkillTag.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SkillTag = void 0;
|
|
9
|
+
require("./SkillTag.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _css = require("@atlaskit/css");
|
|
13
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
14
|
+
var _text = require("@atlaskit/primitives/compiled/text");
|
|
15
|
+
var styles = {
|
|
16
|
+
highlight: "_bfhki8nm _16d9qvcn _1e0c1nu9",
|
|
17
|
+
start: "_bozg1b66 _y4ti1b66 _mkrz1f6o",
|
|
18
|
+
end: "_y4ti1b66 _mkrz1gdk",
|
|
19
|
+
wrapping: "_1i4qfg65 _o5724jg8",
|
|
20
|
+
text: "_1i4qfg65"
|
|
21
|
+
};
|
|
22
|
+
var SkillTag = exports.SkillTag = function SkillTag(_ref) {
|
|
23
|
+
var slug = _ref.slug,
|
|
24
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
25
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
27
|
+
as: "span",
|
|
28
|
+
xcss: styles.wrapping
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_text.Text, {
|
|
30
|
+
color: isDisabled ? 'color.text.disabled' : 'color.text',
|
|
31
|
+
xcss: styles.text
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
33
|
+
as: "span",
|
|
34
|
+
xcss: (0, _css.cx)(styles.highlight, styles.start)
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_text.Text, {
|
|
36
|
+
color: isDisabled ? 'color.text.disabled' : 'color.text.subtle'
|
|
37
|
+
}, "/")), /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
38
|
+
as: "span",
|
|
39
|
+
xcss: styles.highlight
|
|
40
|
+
}, slug.slice(0, -1)), slug && /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
41
|
+
as: "span",
|
|
42
|
+
xcss: (0, _css.cx)(styles.highlight, styles.end)
|
|
43
|
+
}, slug.slice(-1))));
|
|
44
|
+
};
|
|
@@ -59,12 +59,10 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
59
59
|
*
|
|
60
60
|
* If you are updating this, please also update the above files.
|
|
61
61
|
*
|
|
62
|
-
* @deprecated This Emotion-based style function is being phased out
|
|
63
|
-
*
|
|
64
|
-
* is running, any changes here MUST also be reflected in `EditorContentContainer-compiled.tsx`
|
|
62
|
+
* @deprecated This Emotion-based style function is being phased out in favor of Compiled CSS.
|
|
63
|
+
* Any changes here MUST also be reflected in `EditorContentContainer-compiled.tsx`
|
|
65
64
|
* (look for `tableSharedStyle`, `tableSharedStyle_with_*`, `tableSharedStyle_without_*` entries
|
|
66
|
-
* in the `editorContentStyles` cssMap)
|
|
67
|
-
* compiled version is active.
|
|
65
|
+
* in the `editorContentStyles` cssMap) to keep the shared styles consistent.
|
|
68
66
|
*/
|
|
69
67
|
var tableSharedStyle = exports.tableSharedStyle = function tableSharedStyle() {
|
|
70
68
|
var browser = (0, _browser.getBrowserInfo)();
|
|
@@ -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 = "128.0
|
|
27
|
+
var packageVersion = "128.2.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -49,6 +49,14 @@ export class SharedAnnotationManager {
|
|
|
49
49
|
this.emitter.off('annotationSelectionChanged', handler);
|
|
50
50
|
return this;
|
|
51
51
|
}
|
|
52
|
+
onDraftAnnotationCleared(handler) {
|
|
53
|
+
this.emitter.on('draftAnnotationCleared', handler);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
offDraftAnnotationCleared(handler) {
|
|
57
|
+
this.emitter.off('draftAnnotationCleared', handler);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
52
60
|
emit(event) {
|
|
53
61
|
this.emitter.emit(event.name, 'data' in event ? event.data : undefined);
|
|
54
62
|
return this;
|
|
@@ -75,7 +83,7 @@ export class SharedAnnotationManager {
|
|
|
75
83
|
return false;
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
|
-
startDraft() {
|
|
86
|
+
startDraft(localId) {
|
|
79
87
|
const fn = this.hooks.get('startDraft');
|
|
80
88
|
if (!fn) {
|
|
81
89
|
return {
|
|
@@ -84,7 +92,7 @@ export class SharedAnnotationManager {
|
|
|
84
92
|
};
|
|
85
93
|
}
|
|
86
94
|
try {
|
|
87
|
-
return fn();
|
|
95
|
+
return fn(localId);
|
|
88
96
|
} catch {
|
|
89
97
|
return {
|
|
90
98
|
success: false,
|
|
@@ -197,4 +205,38 @@ export class SharedAnnotationManager {
|
|
|
197
205
|
};
|
|
198
206
|
}
|
|
199
207
|
}
|
|
208
|
+
clearSelectedAnnotation() {
|
|
209
|
+
const fn = this.hooks.get('clearSelectedAnnotation');
|
|
210
|
+
if (!fn) {
|
|
211
|
+
return {
|
|
212
|
+
success: false,
|
|
213
|
+
reason: 'manager-not-initialized'
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
return fn();
|
|
218
|
+
} catch {
|
|
219
|
+
return {
|
|
220
|
+
success: false,
|
|
221
|
+
reason: 'hook-execution-error'
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
clearHoveredAnnotation() {
|
|
226
|
+
const fn = this.hooks.get('clearHoveredAnnotation');
|
|
227
|
+
if (!fn) {
|
|
228
|
+
return {
|
|
229
|
+
success: false,
|
|
230
|
+
reason: 'manager-not-initialized'
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
return fn();
|
|
235
|
+
} catch {
|
|
236
|
+
return {
|
|
237
|
+
success: false,
|
|
238
|
+
reason: 'hook-execution-error'
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}
|
|
200
242
|
}
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "128.0
|
|
16
|
+
const packageVersion = "128.2.0";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -74,9 +74,12 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
74
74
|
isDisabled,
|
|
75
75
|
onSelect,
|
|
76
76
|
preview,
|
|
77
|
+
previewIcon,
|
|
77
78
|
previewImageUrls,
|
|
78
79
|
shortcut,
|
|
80
|
+
titleContent,
|
|
79
81
|
shouldShowPreview = true,
|
|
82
|
+
shouldClampPreview,
|
|
80
83
|
shouldWrapIcon = true,
|
|
81
84
|
title
|
|
82
85
|
}) => {
|
|
@@ -124,7 +127,7 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
124
127
|
alignBlock: "center",
|
|
125
128
|
spread: "space-between",
|
|
126
129
|
xcss: styles.content
|
|
127
|
-
}, /*#__PURE__*/React.createElement(Text, null, title), shortcut && /*#__PURE__*/React.createElement(Box, {
|
|
130
|
+
}, titleContent !== null && titleContent !== void 0 ? titleContent : /*#__PURE__*/React.createElement(Text, null, title), shortcut && /*#__PURE__*/React.createElement(Box, {
|
|
128
131
|
as: "span",
|
|
129
132
|
xcss: styles.shortcut
|
|
130
133
|
}, shortcut))), shouldRenderPreview && referenceElement && /*#__PURE__*/React.createElement(QuickInsertHoverPreview, {
|
|
@@ -134,6 +137,8 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
134
137
|
preview: resolvedPreview,
|
|
135
138
|
popupsMountPoint: popupsMountPoint,
|
|
136
139
|
referenceElement: referenceElement,
|
|
137
|
-
title: title
|
|
140
|
+
title: title,
|
|
141
|
+
icon: previewIcon,
|
|
142
|
+
shouldClampText: shouldClampPreview
|
|
138
143
|
}));
|
|
139
144
|
};
|
|
@@ -107,6 +107,7 @@ export const ElementBrowserQuickInsertMenuItem = ({
|
|
|
107
107
|
isDisabled,
|
|
108
108
|
onSelect,
|
|
109
109
|
shortcut,
|
|
110
|
+
titleContent,
|
|
110
111
|
shouldWrapIcon = true,
|
|
111
112
|
title
|
|
112
113
|
}) => {
|
|
@@ -147,7 +148,7 @@ export const ElementBrowserQuickInsertMenuItem = ({
|
|
|
147
148
|
alignBlock: "center",
|
|
148
149
|
spread: "space-between",
|
|
149
150
|
space: "space.100"
|
|
150
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
151
|
+
}, titleContent !== null && titleContent !== void 0 ? titleContent : /*#__PURE__*/React.createElement(Text, {
|
|
151
152
|
color: "color.text",
|
|
152
153
|
maxLines: 1,
|
|
153
154
|
size: "medium",
|