@atlaskit/editor-common 122.3.2 → 122.4.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 +30 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/compiled-migration/withCompiledMigration.js +18 -20
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +13 -0
- package/dist/cjs/extensibility/GeneratedContentReveal.compiled.css +53 -0
- package/dist/cjs/extensibility/GeneratedContentReveal.js +146 -0
- package/dist/cjs/extensibility/extensionNodeView.js +6 -2
- package/dist/cjs/extensibility/nativeEmbedExtension.js +19 -0
- package/dist/cjs/extensibility/useNativeEmbedSettled.js +56 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +10 -12
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/compiled-migration/withCompiledMigration.js +17 -17
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +12 -0
- package/dist/es2019/extensibility/GeneratedContentReveal.compiled.css +53 -0
- package/dist/es2019/extensibility/GeneratedContentReveal.js +121 -0
- package/dist/es2019/extensibility/extensionNodeView.js +6 -2
- package/dist/es2019/extensibility/nativeEmbedExtension.js +14 -0
- package/dist/es2019/extensibility/useNativeEmbedSettled.js +49 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +9 -14
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/compiled-migration/withCompiledMigration.js +18 -16
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +13 -0
- package/dist/esm/extensibility/GeneratedContentReveal.compiled.css +53 -0
- package/dist/esm/extensibility/GeneratedContentReveal.js +138 -0
- package/dist/esm/extensibility/extensionNodeView.js +6 -2
- package/dist/esm/extensibility/nativeEmbedExtension.js +14 -0
- package/dist/esm/extensibility/useNativeEmbedSettled.js +51 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +9 -14
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/compiled-migration/withCompiledMigration.d.ts +8 -6
- package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +7 -1
- package/dist/types/extensibility/GeneratedContentReveal.d.ts +13 -0
- package/dist/types/extensibility/extensionNodeView.d.ts +2 -0
- package/dist/types/extensibility/nativeEmbedExtension.d.ts +10 -0
- package/dist/types/extensibility/useNativeEmbedSettled.d.ts +12 -0
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +0 -4
- package/extensibility/native-embed/package.json +10 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 122.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`eded6b2abb218`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eded6b2abb218) -
|
|
8
|
+
Add the `allowAIGeneratedContentMotion` extension plugin option, for surfaces where native embeds
|
|
9
|
+
arrive mid-flight such as AI-generated MAUI apps in the Create with Rovo preview. A native embed
|
|
10
|
+
extension is held closed while it loads, then the document opens out to make room for it and the
|
|
11
|
+
embed fades in, so nothing stands in for the content while it loads. Only native embeds are
|
|
12
|
+
animated, since the reveal waits on an embed reporting itself loaded. The referentiality plugin
|
|
13
|
+
registers extension node views of its own, so it takes the same option.
|
|
14
|
+
|
|
15
|
+
The option defaults off and its rollout is the consumer's to gate; Confluence's Create with Rovo
|
|
16
|
+
preview enables it behind `aifc_page_create_defer_generated_visuals`. MAUI's new
|
|
17
|
+
`waitForContentReady` is behind that same gate, so the reveal opens onto the rendered app rather
|
|
18
|
+
than a still-loading frame.
|
|
19
|
+
|
|
20
|
+
- [`15dfafecc55f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/15dfafecc55f0) -
|
|
21
|
+
Add the tooltip "Get AI suggestions to improve content" to the Editor toolbar Review button.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
27
|
+
## 122.3.3
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 122.3.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -11,6 +11,11 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
11
11
|
defaultMessage: 'Review',
|
|
12
12
|
description: 'Label for the Suggest edits button in the editor toolbar'
|
|
13
13
|
},
|
|
14
|
+
suggestEditsButtonTooltip: {
|
|
15
|
+
id: 'fabric.editor.ai.suggestions.suggestEditsButtonTooltip',
|
|
16
|
+
defaultMessage: 'Get AI suggestions to improve content',
|
|
17
|
+
description: 'Tooltip for the Review button in the editor toolbar'
|
|
18
|
+
},
|
|
14
19
|
suggestEditsPromptPrefix: {
|
|
15
20
|
id: 'fabric.editor.ai.suggestions.suggestEditsPromptPrefix.non-final',
|
|
16
21
|
defaultMessage: 'Review my content with ',
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.withCompiledMigration = withCompiledMigration;
|
|
8
|
-
var
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* IMPORTANT: This file MUST keep the emotion JSX pragma (@jsx jsx from @emotion/react).
|
|
11
|
+
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; }
|
|
12
|
+
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; } /**
|
|
13
|
+
* IMPORTANT: This file MUST keep using emotion's `jsx` factory (from @emotion/react).
|
|
16
14
|
* This is intentional — it allows the HOC to apply emotion styles via the css prop
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* without requiring the wrapped component to use the emotion pragma itself.
|
|
16
|
+
*
|
|
17
|
+
* Note: `jsx` is called directly rather than via the `@jsx jsx` pragma. The two are
|
|
18
|
+
* equivalent (the pragma just compiles JSX down to these calls), but the direct form
|
|
19
|
+
* avoids emotion's `EmotionJSX.LibraryManagedAttributes`, which since @emotion/react
|
|
20
|
+
* 11.13 is a distributive conditional type that TypeScript cannot resolve when the
|
|
21
|
+
* element's props are an uninstantiated generic parameter such as `P` below.
|
|
19
22
|
*
|
|
20
23
|
* This file is part of the Emotion → Compiled CSS-in-JS migration infrastructure.
|
|
21
24
|
* It is temporary and should be removed once the migration is complete.
|
|
22
25
|
*
|
|
23
26
|
* @see https://hello.atlassian.net/wiki/spaces/~712020e6f24689f2da470b80ba6873df7b44a2/pages/6788274038/Emotion+-+Compiled+Feature+Gating+Strategy
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: this file must use emotion's JSX pragma to apply emotion styles via the css prop
|
|
27
|
-
|
|
27
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: this file must use emotion's element factory to apply emotion styles via the css prop
|
|
28
28
|
/**
|
|
29
29
|
* A HOC that enables per-component feature-gated migration from Emotion to Compiled CSS-in-JS.
|
|
30
30
|
*
|
|
@@ -70,7 +70,7 @@ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-ex
|
|
|
70
70
|
*/
|
|
71
71
|
function withCompiledMigration(WrappedComponent, emotionStyles) {
|
|
72
72
|
var _ref, _WrappedComponent$dis;
|
|
73
|
-
// The cast is required because emotion's `css` prop is
|
|
73
|
+
// The cast is required because emotion's `css` prop is handled by the `jsx` factory
|
|
74
74
|
// and is not part of the component's declared props type. We widen to P & { css? }
|
|
75
75
|
// so TypeScript accepts the css prop in the emotion branch while preserving P.
|
|
76
76
|
var Comp = WrappedComponent;
|
|
@@ -79,16 +79,14 @@ function withCompiledMigration(WrappedComponent, emotionStyles) {
|
|
|
79
79
|
if (compiledEnabled) {
|
|
80
80
|
// Experiment ON — render directly. Compiled's statically-extracted CSS classes
|
|
81
81
|
// are applied inside the component via its own css prop. No Emotion code runs.
|
|
82
|
-
// eslint-disable-next-line react/jsx-props-no-spreading -- HOC must forward all props
|
|
83
82
|
return (0, _react.jsx)(Comp, props);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
// Experiment OFF — render with Emotion css prop.
|
|
87
|
-
// the
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
return (0, _react.jsx)(Comp, (0, _extends2.default)({}, props, {
|
|
85
|
+
// Experiment OFF — render with Emotion css prop. `jsx` is Emotion's element
|
|
86
|
+
// factory, so it intercepts the css prop here, converts it to a className, and
|
|
87
|
+
// passes it through to the component. No wrapper div needed.
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional emotion usage for migration
|
|
89
|
+
return (0, _react.jsx)(Comp, _objectSpread(_objectSpread({}, props), {}, {
|
|
92
90
|
css: emotionStyles
|
|
93
91
|
}));
|
|
94
92
|
}
|
|
@@ -10,6 +10,7 @@ var _react2 = require("@emotion/react");
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _whitespace = require("../whitespace");
|
|
12
12
|
var _ExtensionSSRReactContextsProvider = require("./ExtensionSSRReactContextsProvider");
|
|
13
|
+
var _GeneratedContentReveal = require("./GeneratedContentReveal");
|
|
13
14
|
/**
|
|
14
15
|
* @jsxRuntime classic
|
|
15
16
|
* @jsx jsx
|
|
@@ -28,6 +29,8 @@ var styles = (0, _react2.css)({
|
|
|
28
29
|
position: 'relative'
|
|
29
30
|
}
|
|
30
31
|
});
|
|
32
|
+
|
|
33
|
+
// Mirrored by the reveal span in `GeneratedContentReveal`; keep the two in step.
|
|
31
34
|
var hoverStyles = (0, _react2.css)({
|
|
32
35
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
36
|
':has(.extension-label:hover) .extension-container, :has(.extension-edit-toggle-container:hover) .extension-container': {
|
|
@@ -71,9 +74,19 @@ var ExtensionNodeWrapper = exports.ExtensionNodeWrapper = function ExtensionNode
|
|
|
71
74
|
var children = _ref.children,
|
|
72
75
|
nodeType = _ref.nodeType,
|
|
73
76
|
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags,
|
|
77
|
+
_ref$generatedContent = _ref.generatedContentMotion,
|
|
78
|
+
generatedContentMotion = _ref$generatedContent === void 0 ? false : _ref$generatedContent,
|
|
74
79
|
intl = _ref.intl;
|
|
75
80
|
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
76
81
|
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
82
|
+
|
|
83
|
+
// Fixed for the node view's lifetime: switching would remount the subtree and reload the embed.
|
|
84
|
+
if (generatedContentMotion) {
|
|
85
|
+
return (0, _react2.jsx)(_GeneratedContentReveal.GeneratedContentReveal, {
|
|
86
|
+
intl: intl,
|
|
87
|
+
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
88
|
+
}, children);
|
|
89
|
+
}
|
|
77
90
|
var wrapperClassNames = (0, _classnames.default)({
|
|
78
91
|
'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates,
|
|
79
92
|
relative: showMacroInteractionDesignUpdates
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
._10i01bym [data-native-embed-card-wrapper=true]{animation-name:var(--ds-keyframe-fade-in,FadeIn0to100)}
|
|
2
|
+
._10t9kb7n:has(.extension-label:hover) .extension-edit-toggle-container{opacity:1}
|
|
3
|
+
._114yglyw [data-testid$="--loading-overlay"]{display:none}
|
|
4
|
+
._147ai9qs [data-native-embed-card-wrapper=true]{animation-duration:var(--ds-duration-medium,.2s)}
|
|
5
|
+
._15k3glyw:has(.extension-edit-toggle-container:hover) .extension-label{box-shadow:none}
|
|
6
|
+
._17sh1wug:has(.extension-edit-toggle-container:hover) .extension-label.always-hide-label{cursor:auto}
|
|
7
|
+
._17w9indk iframe:not([data-native-embed-card-wrapper=true] iframe){animation-timing-function:var(--ds-easing-out-practical,cubic-bezier(.4,1,.6,1))}
|
|
8
|
+
._18m915vq{overflow-y:hidden}
|
|
9
|
+
._1a2e1j9a:has(.extension-edit-toggle-container:hover) .extension-label.with-bodied-macro-live-page-styles{background-color:var(--ds-background-input,#fff)}
|
|
10
|
+
._1e0c1ule{display:block}
|
|
11
|
+
._1fdfidpf .extension-label:hover.always-hide-label{opacity:0}
|
|
12
|
+
._1ghxysee:has(.extension-container:hover) .extension-label{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
13
|
+
._1i8c1j9a:has(.extension-container:hover) .extension-label.with-bodied-macro-live-page-styles{background-color:var(--ds-background-input,#fff)}
|
|
14
|
+
._1jbo15uc iframe:not([data-native-embed-card-wrapper=true] iframe){animation-delay:var(--ds-duration-xlong,.4s)}
|
|
15
|
+
._1kr5kb7n:has(.extension-container:hover) .extension-edit-toggle-container{opacity:1}
|
|
16
|
+
._1nuetlke:has(.extension-container:hover) .extension-label{cursor:pointer}
|
|
17
|
+
._1p7l15uc [data-native-embed-card-wrapper=true]{animation-delay:var(--ds-duration-xlong,.4s)}
|
|
18
|
+
._1pfgidpf:has(.extension-container:hover) .extension-label.always-hide-label{opacity:0}
|
|
19
|
+
._1pglindk{animation-timing-function:var(--ds-easing-out-practical,cubic-bezier(.4,1,.6,1))}
|
|
20
|
+
._1qac1nu9:has(.extension-container:hover) .extension-icon{display:inline}
|
|
21
|
+
._1reo15vq{overflow-x:hidden}
|
|
22
|
+
._1si41wug:has(.extension-container:hover) .extension-label.always-hide-label{cursor:auto}
|
|
23
|
+
._1tr2ynbm:has(.extension-edit-toggle-container:hover) .extension-container{box-shadow:0 0 0 1px var(--ds-border-input,#8c8f97)}
|
|
24
|
+
._1vs61nu9:has(.extension-label:hover) .extension-icon{display:inline}
|
|
25
|
+
._26lx1tsb .extension-label:hover.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
26
|
+
._2z44kb7n:has(.extension-edit-toggle-container:hover) .extension-label{opacity:1}
|
|
27
|
+
._54r11nu9:has(.extension-edit-toggle-container:hover) .extension-icon{display:inline}
|
|
28
|
+
._5sag15uc{animation-duration:var(--ds-duration-xlong,.4s)}
|
|
29
|
+
._9sz11bym iframe:not([data-native-embed-card-wrapper=true] iframe){animation-name:var(--ds-keyframe-fade-in,FadeIn0to100)}
|
|
30
|
+
._bcikkb7n:has(.extension-container:hover) .extension-label{opacity:1}
|
|
31
|
+
._c71lidpf{max-height:0}
|
|
32
|
+
._d1oeglyw:has(.extension-container:hover) .extension-label{box-shadow:none}
|
|
33
|
+
._decvtlke:has(.extension-edit-toggle-container:hover) .extension-label{cursor:pointer}
|
|
34
|
+
._gp9p1hrf iframe:not([data-native-embed-card-wrapper=true] iframe){animation-fill-mode:both}
|
|
35
|
+
._j7hq1umn{animation-name:ke4lc1x}
|
|
36
|
+
._jl0d1tsb:has(.extension-edit-toggle-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
37
|
+
._kqswh2mm{position:relative}
|
|
38
|
+
._ks721tsb:has(.extension-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
39
|
+
._lbjpindk [data-native-embed-card-wrapper=true]{animation-timing-function:var(--ds-easing-out-practical,cubic-bezier(.4,1,.6,1))}
|
|
40
|
+
._lwlpi9qs iframe:not([data-native-embed-card-wrapper=true] iframe){animation-duration:var(--ds-duration-medium,.2s)}
|
|
41
|
+
._mi5m1wug .extension-label:hover.always-hide-label{cursor:auto}
|
|
42
|
+
._okd3ysee:has(.extension-edit-toggle-container:hover) .extension-label{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
43
|
+
._pjh31hrf [data-native-embed-card-wrapper=true]{animation-fill-mode:both}
|
|
44
|
+
._x3ro1j9a .extension-label:hover.with-bodied-macro-live-page-styles{background-color:var(--ds-background-input,#fff)}
|
|
45
|
+
._xajsynbm:has(.extension-label:hover) .extension-container{box-shadow:0 0 0 1px var(--ds-border-input,#8c8f97)}
|
|
46
|
+
._y7o7idpf:has(.extension-edit-toggle-container:hover) .extension-label.always-hide-label{opacity:0}
|
|
47
|
+
._10pdkb7n .extension-edit-toggle-container:hover{opacity:1}
|
|
48
|
+
._1er3glyw .extension-label:hover{box-shadow:none}
|
|
49
|
+
._1ql7tlke .extension-label:hover{cursor:pointer}
|
|
50
|
+
._1tmrkb7n .extension-label:hover{opacity:1}
|
|
51
|
+
._dmn9ysee .extension-label:hover{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
52
|
+
@keyframes ke4lc1x{0%{max-height:0}to{max-height:var(--_1wl3sa9)}}
|
|
53
|
+
@media (prefers-reduced-motion:reduce){._2hwzru3m{animation-duration:0s}._dxfxru3m [data-native-embed-card-wrapper=true]{animation-duration:0s}._log5ru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-duration:0s}._1pz3ru3m [data-native-embed-card-wrapper=true]{animation-delay:0s}._9hrrru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-delay:0s}}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.GeneratedContentReveal = void 0;
|
|
10
|
+
require("./GeneratedContentReveal.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _ExtensionSSRReactContextsProvider = require("./ExtensionSSRReactContextsProvider");
|
|
15
|
+
var _useNativeEmbedSettled = require("./useNativeEmbedSettled");
|
|
16
|
+
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); }
|
|
17
|
+
/*
|
|
18
|
+
* Animates a native embed into the document once it has loaded.
|
|
19
|
+
*
|
|
20
|
+
* 1. `collapsed` — clipped to zero height and `inert`. The embed loads behind it, full size but
|
|
21
|
+
* unseen, with its own loading overlay hidden.
|
|
22
|
+
* 2. `useNativeEmbedSettled` calls back once the embed has finished loading.
|
|
23
|
+
* 3. `revealing` — the measured height goes into `--extension-reveal-height` and the node animates
|
|
24
|
+
* open (400ms).
|
|
25
|
+
* 4. The embed fades in (200ms), delayed so it follows the opening instead of overlapping it.
|
|
26
|
+
* 5. `open` — on `animationend`, when the content first becomes visible, `inert` is dropped.
|
|
27
|
+
*
|
|
28
|
+
* Failure paths: never settles → `READY_TIMEOUT_MS` opens it and the embed's overlay reappears;
|
|
29
|
+
* fails with no frame → still settles and opens; no `animationend` → `REVEAL_TIMEOUT_MS`. Reduced
|
|
30
|
+
* motion runs the same steps with zero-length animations, so `animationend` still fires.
|
|
31
|
+
*
|
|
32
|
+
* Renders the wrapper span itself, in place of the default one in `ExtensionNodeWrapper`, so the
|
|
33
|
+
* reveal styles sit on the element editor-core reaches through `> span >` chains from the node view
|
|
34
|
+
* root. It therefore carries the default span's `relative` class and hover chrome as well.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** Long, because a MAUI app has to boot and render first. Reaching it means the signal is broken. */
|
|
38
|
+
var READY_TIMEOUT_MS = 30000;
|
|
39
|
+
|
|
40
|
+
/** For when no `animationend` arrives. Must exceed the reveal. */
|
|
41
|
+
var REVEAL_TIMEOUT_MS = 1000;
|
|
42
|
+
|
|
43
|
+
/** Set inline from the measured content height just before the animation runs. */
|
|
44
|
+
var REVEAL_HEIGHT_VARIABLE = '--extension-reveal-height';
|
|
45
|
+
var relativeStyles = null;
|
|
46
|
+
|
|
47
|
+
// Mirrors the default span's hover chrome in `ExtensionNodeWrapper`; keep the two in step.
|
|
48
|
+
var hoverStyles = null;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Animates `max-height`, so the rendered height is `min(content, max-height)` and overshooting is
|
|
52
|
+
* harmless — the measurement is taken before the embed has settled on its size. A measurement is
|
|
53
|
+
* needed because the embed writes a definite inline `height` onto `.extension-container`.
|
|
54
|
+
*/
|
|
55
|
+
var openHeight = null;
|
|
56
|
+
|
|
57
|
+
// `display: block` because `overflow` and `max-height` do not apply to an inline span.
|
|
58
|
+
var clippedStyles = null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Shut, and with the embed's own loading overlay hidden, so only one loading state shows. Only while
|
|
62
|
+
* closed: once open the embed shows its own progress again, which a node opened by the fail-safe
|
|
63
|
+
* timeout needs. Hiding the overlay here keeps `data-native-embed-loading` set, which is the signal
|
|
64
|
+
* the reveal waits on.
|
|
65
|
+
*/
|
|
66
|
+
var collapsedStyles = null;
|
|
67
|
+
var revealingStyles = null;
|
|
68
|
+
|
|
69
|
+
// Two selectors because MAUI renders a bare iframe and others nest theirs in the card wrapper; the
|
|
70
|
+
// second excludes that nested case so the same content is not faded twice.
|
|
71
|
+
var embedContentEnteringStyles = null;
|
|
72
|
+
|
|
73
|
+
/** Mirrored onto `data-extension-reveal`. */
|
|
74
|
+
|
|
75
|
+
var GeneratedContentReveal = exports.GeneratedContentReveal = function GeneratedContentReveal(_ref) {
|
|
76
|
+
var children = _ref.children,
|
|
77
|
+
intl = _ref.intl,
|
|
78
|
+
showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
|
|
79
|
+
// Held in state so the effects below run once the span exists.
|
|
80
|
+
var _useState = (0, _react.useState)(null),
|
|
81
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
82
|
+
wrapperElement = _useState2[0],
|
|
83
|
+
setWrapperElement = _useState2[1];
|
|
84
|
+
var _useState3 = (0, _react.useState)('collapsed'),
|
|
85
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
86
|
+
state = _useState4[0],
|
|
87
|
+
setState = _useState4[1];
|
|
88
|
+
|
|
89
|
+
// Only a collapsed node opens, so whichever of the readiness signal and the fail-safe timer
|
|
90
|
+
// comes second changes nothing. The measurement is repeated harmlessly in that case.
|
|
91
|
+
var startRevealing = (0, _react.useCallback)(function () {
|
|
92
|
+
// The clipped wrapper's `scrollHeight` is the height its content wants.
|
|
93
|
+
wrapperElement === null || wrapperElement === void 0 || wrapperElement.style.setProperty(REVEAL_HEIGHT_VARIABLE, "".concat(wrapperElement.scrollHeight, "px"));
|
|
94
|
+
setState(function (current) {
|
|
95
|
+
return current === 'collapsed' ? 'revealing' : current;
|
|
96
|
+
});
|
|
97
|
+
}, [wrapperElement]);
|
|
98
|
+
|
|
99
|
+
// Step 2 → 3.
|
|
100
|
+
(0, _useNativeEmbedSettled.useNativeEmbedSettled)(wrapperElement, startRevealing);
|
|
101
|
+
|
|
102
|
+
// Set once the span exists; `startRevealing` only changes with it.
|
|
103
|
+
(0, _react.useEffect)(function () {
|
|
104
|
+
var timer = setTimeout(startRevealing, READY_TIMEOUT_MS);
|
|
105
|
+
return function () {
|
|
106
|
+
return clearTimeout(timer);
|
|
107
|
+
};
|
|
108
|
+
}, [startRevealing]);
|
|
109
|
+
(0, _react.useEffect)(function () {
|
|
110
|
+
if (state !== 'revealing') {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
var timer = setTimeout(function () {
|
|
114
|
+
return setState('open');
|
|
115
|
+
}, REVEAL_TIMEOUT_MS);
|
|
116
|
+
return function () {
|
|
117
|
+
return clearTimeout(timer);
|
|
118
|
+
};
|
|
119
|
+
}, [state]);
|
|
120
|
+
|
|
121
|
+
// Clipped content, and content waiting out the fade's delay, are invisible but still focusable.
|
|
122
|
+
// Set as an attribute because `inert` is absent from the React 18 JSX types.
|
|
123
|
+
(0, _react.useEffect)(function () {
|
|
124
|
+
wrapperElement === null || wrapperElement === void 0 || wrapperElement.toggleAttribute('inert', state !== 'open');
|
|
125
|
+
}, [state, wrapperElement]);
|
|
126
|
+
var onAnimationEnd = (0, _react.useCallback)(function (event) {
|
|
127
|
+
// The extension's own content animates too, and those events bubble.
|
|
128
|
+
if (event.target === event.currentTarget) {
|
|
129
|
+
setState('open');
|
|
130
|
+
}
|
|
131
|
+
}, []);
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(_ExtensionSSRReactContextsProvider.ExtensionSSRReactContextsProvider, {
|
|
133
|
+
intl: intl
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
135
|
+
"data-testid": "extension-node-wrapper",
|
|
136
|
+
"data-extension-reveal": state,
|
|
137
|
+
ref: setWrapperElement
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- the block controls and the SSR cleanup find the wrapper by `span.relative`
|
|
139
|
+
,
|
|
140
|
+
className: (0, _runtime.ax)(["_1tr2ynbm _xajsynbm _1tmrkb7n _bcikkb7n _2z44kb7n _dmn9ysee _1ghxysee _okd3ysee _1er3glyw _d1oeglyw _15k3glyw _1ql7tlke _1nuetlke _decvtlke _1fdfidpf _1pfgidpf _y7o7idpf _mi5m1wug _1si41wug _17sh1wug _x3ro1j9a _1i8c1j9a _1a2e1j9a _26lx1tsb _ks721tsb _jl0d1tsb _1qac1nu9 _54r11nu9 _1vs61nu9 _10pdkb7n _1kr5kb7n _10t9kb7n", showMacroInteractionDesignUpdates && "_kqswh2mm", state !== 'open' && "_1reo15vq _18m915vq _1e0c1ule", state === 'collapsed' && "_c71lidpf _114yglyw", state === 'revealing' && "", state === 'revealing' && "_j7hq1umn _5sag15uc _1pglindk _2hwzru3m", state !== 'collapsed' && "_10i01bym _9sz11bym _147ai9qs _lwlpi9qs _lbjpindk _17w9indk _1p7l15uc _1jbo15uc _pjh31hrf _gp9p1hrf _dxfxru3m _log5ru3m _1pz3ru3m _9hrrru3m", showMacroInteractionDesignUpdates ? 'relative' : undefined]),
|
|
141
|
+
onAnimationEnd: onAnimationEnd,
|
|
142
|
+
style: {
|
|
143
|
+
"--_1wl3sa9": (0, _runtime.ix)("var(".concat(REVEAL_HEIGHT_VARIABLE, ")"))
|
|
144
|
+
}
|
|
145
|
+
}, children));
|
|
146
|
+
};
|
|
@@ -20,6 +20,7 @@ var _coreUtils = require("../core-utils");
|
|
|
20
20
|
var _reactNodeView = _interopRequireDefault(require("../react-node-view"));
|
|
21
21
|
var _Extension = require("./Extension");
|
|
22
22
|
var _ExtensionNodeWrapper = require("./ExtensionNodeWrapper");
|
|
23
|
+
var _nativeEmbedExtension = require("./nativeEmbedExtension");
|
|
23
24
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
24
25
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
26
|
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
@@ -298,7 +299,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
298
299
|
}, {
|
|
299
300
|
key: "render",
|
|
300
301
|
value: function render(props, forwardRef) {
|
|
301
|
-
var _props$extensionNodeV;
|
|
302
|
+
var _props$extensionNodeV, _props$extensionNodeV2;
|
|
302
303
|
// While sitting on SSR DOM, skip the React portal — see {@link didReuseSsrDom}.
|
|
303
304
|
if (this.didReuseSsrDom) {
|
|
304
305
|
return null;
|
|
@@ -307,6 +308,9 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
307
308
|
intl: props.intl,
|
|
308
309
|
nodeType: this.node.type.name,
|
|
309
310
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
311
|
+
// Only native embeds animate in; the reveal waits on the embed's own loading state.
|
|
312
|
+
,
|
|
313
|
+
generatedContentMotion: !!((_props$extensionNodeV = props.extensionNodeViewOptions) !== null && _props$extensionNodeV !== void 0 && _props$extensionNodeV.allowAIGeneratedContentMotion) && (0, _nativeEmbedExtension.isNativeEmbedExtension)(this.node)
|
|
310
314
|
}, /*#__PURE__*/_react.default.createElement(_Extension.Extension, {
|
|
311
315
|
editorView: this.view,
|
|
312
316
|
node: this.node,
|
|
@@ -323,7 +327,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
323
327
|
handleContentDOMRef: forwardRef,
|
|
324
328
|
extensionHandlers: props.extensionHandlers,
|
|
325
329
|
extensionLoadingHandlers: props.extensionLoadingHandlers,
|
|
326
|
-
editorAppearance: (_props$
|
|
330
|
+
editorAppearance: (_props$extensionNodeV2 = props.extensionNodeViewOptions) === null || _props$extensionNodeV2 === void 0 ? void 0 : _props$extensionNodeV2.appearance,
|
|
327
331
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
328
332
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
329
333
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isNativeEmbedExtension = void 0;
|
|
7
|
+
var _manifestHelpers = require("../extensions/manifest-helpers");
|
|
8
|
+
/**
|
|
9
|
+
* Whether a node is a native embed: the block `extension` that `editor-plugin-native-embeds` renders
|
|
10
|
+
* as an iframe. Bodied, multi-bodied and inline extensions do not qualify.
|
|
11
|
+
*
|
|
12
|
+
* The key can carry leading segments (`…:native-embed:database`), so it is matched with `includes`.
|
|
13
|
+
* `editor-plugin-native-embeds` and `editor-plugin-card` hold equivalent predicates; neither can be
|
|
14
|
+
* imported here, as both depend on this package.
|
|
15
|
+
*/
|
|
16
|
+
var isNativeEmbedExtension = exports.isNativeEmbedExtension = function isNativeEmbedExtension(node) {
|
|
17
|
+
var _node$attrs, _node$attrs2;
|
|
18
|
+
return node.type.name === 'extension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === _manifestHelpers.NATIVE_EMBED_EXTENSION_TYPE && typeof ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey) === 'string' && node.attrs.extensionKey.includes(_manifestHelpers.NATIVE_EMBED_EXTENSION_KEY);
|
|
19
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useNativeEmbedSettled = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/** Set to `"true"` by the embed frame while loading, then removed — never set to `"false"`. */
|
|
9
|
+
var NATIVE_EMBED_LOADING_ATTRIBUTE = 'data-native-embed-loading';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Calls `onSettled` once the native embed inside `container` has finished loading, successfully or
|
|
13
|
+
* not. The extension handler mounts the embed asynchronously, so the subtree is observed rather
|
|
14
|
+
* than a known element.
|
|
15
|
+
*
|
|
16
|
+
* Two signals, because neither alone catches every embed: the attribute having been seen and gone,
|
|
17
|
+
* which covers a failure that renders no frame; or a frame with no attribute, which covers an embed
|
|
18
|
+
* that never advertises loading. The frame is present either way, so the attribute comes first.
|
|
19
|
+
*
|
|
20
|
+
* `onSettled` must be stable, and runs at most once per container.
|
|
21
|
+
*/
|
|
22
|
+
var useNativeEmbedSettled = exports.useNativeEmbedSettled = function useNativeEmbedSettled(container, onSettled) {
|
|
23
|
+
(0, _react.useEffect)(function () {
|
|
24
|
+
if (!container || typeof MutationObserver === 'undefined') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var hasBeenLoading = false;
|
|
28
|
+
var settled = false;
|
|
29
|
+
var read = function read() {
|
|
30
|
+
if (settled) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (container.querySelector("[".concat(NATIVE_EMBED_LOADING_ATTRIBUTE, "=\"true\"]"))) {
|
|
34
|
+
hasBeenLoading = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (hasBeenLoading || container.querySelector('iframe')) {
|
|
38
|
+
settled = true;
|
|
39
|
+
onSettled();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var observer = new MutationObserver(read);
|
|
43
|
+
observer.observe(container, {
|
|
44
|
+
attributes: true,
|
|
45
|
+
attributeFilter: [NATIVE_EMBED_LOADING_ATTRIBUTE],
|
|
46
|
+
childList: true,
|
|
47
|
+
subtree: true
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// After `observe`, so a change landing in between is either read here or queued.
|
|
51
|
+
read();
|
|
52
|
+
return function () {
|
|
53
|
+
return observer.disconnect();
|
|
54
|
+
};
|
|
55
|
+
}, [container, onSettled]);
|
|
56
|
+
};
|
|
@@ -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 = "122.3.
|
|
30
|
+
var packageVersion = "122.3.3";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -9,7 +9,6 @@ exports.inlineNodeViewClassname = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
13
12
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
13
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
14
|
var _analytics = require("../analytics");
|
|
@@ -21,10 +20,7 @@ var _whitespace = require("../whitespace");
|
|
|
21
20
|
var _generateUniqueNodeKey = require("./generateUniqueNodeKey");
|
|
22
21
|
var _onVisibleObserverFactory = require("./onVisibleObserverFactory");
|
|
23
22
|
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; }
|
|
24
|
-
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; }
|
|
25
|
-
* @jsxRuntime classic
|
|
26
|
-
* @jsx jsx
|
|
27
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
|
+
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; }
|
|
28
24
|
var inlineNodeViewClassname = exports.inlineNodeViewClassname = 'inlineNodeView';
|
|
29
25
|
var canRenderFallback = function canRenderFallback(node) {
|
|
30
26
|
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
@@ -341,15 +337,15 @@ function getPortalChildren(_ref3) {
|
|
|
341
337
|
// refactor. A test suite to catch any instances of this is ideal however
|
|
342
338
|
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
343
339
|
|
|
344
|
-
return
|
|
340
|
+
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
|
|
345
341
|
component: _analytics.ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
346
342
|
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 || (_currentNode$type2 = currentNode.type) === null || _currentNode$type2 === void 0 ? void 0 : _currentNode$type2.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : _analytics.ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
347
343
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
348
|
-
},
|
|
344
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
349
345
|
className: "zeroWidthSpaceContainer"
|
|
350
|
-
},
|
|
346
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
351
347
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
352
|
-
}), _whitespace.ZERO_WIDTH_SPACE),
|
|
348
|
+
}), _whitespace.ZERO_WIDTH_SPACE), /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
353
349
|
view: nodeViewParams.view
|
|
354
350
|
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
355
351
|
// Ignored via go/ees005
|
|
@@ -359,15 +355,17 @@ function getPortalChildren(_ref3) {
|
|
|
359
355
|
node: currentNode
|
|
360
356
|
// eslint-disable-next-line react/jsx-props-no-spreading -- Spreading props to pass through dynamic component props
|
|
361
357
|
}, extraComponentProps)), (0, _browser.getBrowserInfo)().android ?
|
|
358
|
+
/*#__PURE__*/
|
|
362
359
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
363
|
-
|
|
360
|
+
_react.default.createElement("span", {
|
|
364
361
|
className: "zeroWidthSpaceContainer",
|
|
365
362
|
contentEditable: "false"
|
|
366
|
-
},
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
367
364
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
368
365
|
}), _whitespace.ZERO_WIDTH_SPACE) :
|
|
366
|
+
/*#__PURE__*/
|
|
369
367
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
370
|
-
|
|
368
|
+
_react.default.createElement("span", {
|
|
371
369
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
372
370
|
}));
|
|
373
371
|
};
|
|
@@ -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 = "122.3.
|
|
27
|
+
var packageVersion = "122.3.3";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -5,6 +5,11 @@ export const aiSuggestionsMessages = defineMessages({
|
|
|
5
5
|
defaultMessage: 'Review',
|
|
6
6
|
description: 'Label for the Suggest edits button in the editor toolbar'
|
|
7
7
|
},
|
|
8
|
+
suggestEditsButtonTooltip: {
|
|
9
|
+
id: 'fabric.editor.ai.suggestions.suggestEditsButtonTooltip',
|
|
10
|
+
defaultMessage: 'Get AI suggestions to improve content',
|
|
11
|
+
description: 'Tooltip for the Review button in the editor toolbar'
|
|
12
|
+
},
|
|
8
13
|
suggestEditsPromptPrefix: {
|
|
9
14
|
id: 'fabric.editor.ai.suggestions.suggestEditsPromptPrefix.non-final',
|
|
10
15
|
defaultMessage: 'Review my content with ',
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/**
|
|
3
|
-
* @
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*
|
|
6
|
-
* IMPORTANT: This file MUST keep the emotion JSX pragma (@jsx jsx from @emotion/react).
|
|
2
|
+
* IMPORTANT: This file MUST keep using emotion's `jsx` factory (from @emotion/react).
|
|
7
3
|
* This is intentional — it allows the HOC to apply emotion styles via the css prop
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* without requiring the wrapped component to use the emotion pragma itself.
|
|
5
|
+
*
|
|
6
|
+
* Note: `jsx` is called directly rather than via the `@jsx jsx` pragma. The two are
|
|
7
|
+
* equivalent (the pragma just compiles JSX down to these calls), but the direct form
|
|
8
|
+
* avoids emotion's `EmotionJSX.LibraryManagedAttributes`, which since @emotion/react
|
|
9
|
+
* 11.13 is a distributive conditional type that TypeScript cannot resolve when the
|
|
10
|
+
* element's props are an uninstantiated generic parameter such as `P` below.
|
|
10
11
|
*
|
|
11
12
|
* This file is part of the Emotion → Compiled CSS-in-JS migration infrastructure.
|
|
12
13
|
* It is temporary and should be removed once the migration is complete.
|
|
@@ -14,7 +15,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
14
15
|
* @see https://hello.atlassian.net/wiki/spaces/~712020e6f24689f2da470b80ba6873df7b44a2/pages/6788274038/Emotion+-+Compiled+Feature+Gating+Strategy
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: this file must use emotion's
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: this file must use emotion's element factory to apply emotion styles via the css prop
|
|
18
19
|
import { jsx } from '@emotion/react';
|
|
19
20
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
20
21
|
|
|
@@ -63,7 +64,7 @@ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-e
|
|
|
63
64
|
*/
|
|
64
65
|
export function withCompiledMigration(WrappedComponent, emotionStyles) {
|
|
65
66
|
var _ref, _WrappedComponent$dis;
|
|
66
|
-
// The cast is required because emotion's `css` prop is
|
|
67
|
+
// The cast is required because emotion's `css` prop is handled by the `jsx` factory
|
|
67
68
|
// and is not part of the component's declared props type. We widen to P & { css? }
|
|
68
69
|
// so TypeScript accepts the css prop in the emotion branch while preserving P.
|
|
69
70
|
const Comp = WrappedComponent;
|
|
@@ -72,18 +73,17 @@ export function withCompiledMigration(WrappedComponent, emotionStyles) {
|
|
|
72
73
|
if (compiledEnabled) {
|
|
73
74
|
// Experiment ON — render directly. Compiled's statically-extracted CSS classes
|
|
74
75
|
// are applied inside the component via its own css prop. No Emotion code runs.
|
|
75
|
-
// eslint-disable-next-line react/jsx-props-no-spreading -- HOC must forward all props
|
|
76
76
|
return jsx(Comp, props);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// Experiment OFF — render with Emotion css prop.
|
|
80
|
-
// the
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
// Experiment OFF — render with Emotion css prop. `jsx` is Emotion's element
|
|
80
|
+
// factory, so it intercepts the css prop here, converts it to a className, and
|
|
81
|
+
// passes it through to the component. No wrapper div needed.
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional emotion usage for migration
|
|
83
|
+
return jsx(Comp, {
|
|
84
|
+
...props,
|
|
85
85
|
css: emotionStyles
|
|
86
|
-
})
|
|
86
|
+
});
|
|
87
87
|
}
|
|
88
88
|
const name = (_ref = (_WrappedComponent$dis = WrappedComponent.displayName) !== null && _WrappedComponent$dis !== void 0 ? _WrappedComponent$dis : WrappedComponent.name) !== null && _ref !== void 0 ? _ref : 'Component';
|
|
89
89
|
MigrationGatedComponent.displayName = `withCompiledMigration(${name})`;
|