@atlaskit/editor-extension-dropbox 19.0.3 → 20.0.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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # @atlaskit/editor-extension-dropbox
2
2
 
3
+ ## 20.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
14
+ Add structured Quick Insert previews with localised title, description and attribution under
15
+ platform_editor_slash_command.
16
+
17
+ Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
18
+ title and attribution text, and default description text.
19
+
20
+ Show text previews even without preview metadata, and reserve a fixed image area while images load
21
+ or when they fail. Keep previews within the viewport, flipping left when needed, with compact
22
+ panel dimensions and typography.
23
+
24
+ Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
25
+ previews while preserving their attribution.
26
+
27
+ Let extension providers own their preview images and attribution. Pass preview metadata through
28
+ the Company Hub manifest factory and remove Editor's fallback preview registry.
29
+
30
+ Localize provider attribution names and display Confluence and Jira product icons instead of the
31
+ attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
32
+ message formatter.
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+
3
38
  ## 19.0.3
4
39
 
5
40
  ### Patch Changes
@@ -11,12 +11,21 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
11
11
  var _react = _interopRequireDefault(require("react"));
12
12
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
  var _client = require("react-dom/client");
14
+ var _reactIntl = require("react-intl");
14
15
  var _builders = require("@atlaskit/adf-utils/builders");
15
16
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
16
17
  var _constants = require("./constants");
17
18
  var _enableDropbox = _interopRequireDefault(require("./enable-dropbox"));
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
19
20
  var reactRoots = new WeakMap();
21
+ var defaultIntl = (0, _reactIntl.createIntl)({
22
+ locale: 'en'
23
+ });
24
+ var dropboxName = (0, _reactIntl.defineMessage)({
25
+ id: 'editor-extension-dropbox.attribution-name.ai-non-final',
26
+ defaultMessage: 'Dropbox',
27
+ description: 'Dropbox product name displayed as the creator in the slash-command preview attribution.'
28
+ });
20
29
 
21
30
  /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
22
31
  var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
@@ -165,11 +174,22 @@ function _pickFromDropbox() {
165
174
  }
166
175
  var manifestFunction = function manifestFunction(_ref) {
167
176
  var appKey = _ref.appKey,
168
- canMountinIframe = _ref.canMountinIframe;
177
+ canMountinIframe = _ref.canMountinIframe,
178
+ _ref$intl = _ref.intl,
179
+ intl = _ref$intl === void 0 ? defaultIntl : _ref$intl;
169
180
  return {
170
181
  title: 'Dropbox',
171
182
  type: 'com.dropbox.fabric',
172
183
  key: 'dropbox',
184
+ preview: {
185
+ attribution: {
186
+ name: intl.formatMessage(dropboxName)
187
+ },
188
+ image: {
189
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH2.png',
190
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKI.png'
191
+ }
192
+ },
173
193
  description: 'Embed Dropbox file to collaborate with your team',
174
194
  icons: {
175
195
  '16': function _() {
@@ -1,11 +1,20 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import { createRoot } from 'react-dom/client';
4
+ import { createIntl, defineMessage } from 'react-intl';
4
5
  import { inlineCard } from '@atlaskit/adf-utils/builders';
5
6
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
7
  import { POPUP_MOUNTPOINT, DROPBOX_IFRAME_NAME } from './constants';
7
8
  import enableDropbox from './enable-dropbox';
8
9
  const reactRoots = new WeakMap();
10
+ const defaultIntl = createIntl({
11
+ locale: 'en'
12
+ });
13
+ const dropboxName = defineMessage({
14
+ id: 'editor-extension-dropbox.attribution-name.ai-non-final',
15
+ defaultMessage: 'Dropbox',
16
+ description: 'Dropbox product name displayed as the creator in the slash-command preview attribution.'
17
+ });
9
18
 
10
19
  /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
11
20
  const renderToMountPoint = (element, mountPoint) => {
@@ -124,11 +133,21 @@ async function pickFromDropbox(appKey, canMountinIframe) {
124
133
  }
125
134
  const manifestFunction = ({
126
135
  appKey,
127
- canMountinIframe
136
+ canMountinIframe,
137
+ intl = defaultIntl
128
138
  }) => ({
129
139
  title: 'Dropbox',
130
140
  type: 'com.dropbox.fabric',
131
141
  key: 'dropbox',
142
+ preview: {
143
+ attribution: {
144
+ name: intl.formatMessage(dropboxName)
145
+ },
146
+ image: {
147
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH2.png',
148
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKI.png'
149
+ }
150
+ },
132
151
  description: 'Embed Dropbox file to collaborate with your team',
133
152
  icons: {
134
153
  '16': () => import( /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */'./icons/DropboxIcon').then(mod => mod.default),
@@ -3,11 +3,20 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import ReactDOM from 'react-dom';
5
5
  import { createRoot } from 'react-dom/client';
6
+ import { createIntl, defineMessage } from 'react-intl';
6
7
  import { inlineCard } from '@atlaskit/adf-utils/builders';
7
8
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
9
  import { POPUP_MOUNTPOINT, DROPBOX_IFRAME_NAME } from './constants';
9
10
  import enableDropbox from './enable-dropbox';
10
11
  var reactRoots = new WeakMap();
12
+ var defaultIntl = createIntl({
13
+ locale: 'en'
14
+ });
15
+ var dropboxName = defineMessage({
16
+ id: 'editor-extension-dropbox.attribution-name.ai-non-final',
17
+ defaultMessage: 'Dropbox',
18
+ description: 'Dropbox product name displayed as the creator in the slash-command preview attribution.'
19
+ });
11
20
 
12
21
  /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
13
22
  var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
@@ -154,11 +163,22 @@ function _pickFromDropbox() {
154
163
  }
155
164
  var manifestFunction = function manifestFunction(_ref) {
156
165
  var appKey = _ref.appKey,
157
- canMountinIframe = _ref.canMountinIframe;
166
+ canMountinIframe = _ref.canMountinIframe,
167
+ _ref$intl = _ref.intl,
168
+ intl = _ref$intl === void 0 ? defaultIntl : _ref$intl;
158
169
  return {
159
170
  title: 'Dropbox',
160
171
  type: 'com.dropbox.fabric',
161
172
  key: 'dropbox',
173
+ preview: {
174
+ attribution: {
175
+ name: intl.formatMessage(dropboxName)
176
+ },
177
+ image: {
178
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH2.png',
179
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKI.png'
180
+ }
181
+ },
162
182
  description: 'Embed Dropbox file to collaborate with your team',
163
183
  icons: {
164
184
  '16': function _() {
@@ -1,3 +1,4 @@
1
+ import { type IntlShape } from 'react-intl';
1
2
  import type { ExtensionManifest } from '@atlaskit/editor-common/extensions';
2
3
  import type { DropboxFile } from './types';
3
4
  declare global {
@@ -13,8 +14,9 @@ declare global {
13
14
  };
14
15
  }
15
16
  }
16
- declare const manifestFunction: ({ appKey, canMountinIframe, }: {
17
+ declare const manifestFunction: ({ appKey, canMountinIframe, intl, }: {
17
18
  appKey: string;
18
19
  canMountinIframe: boolean;
20
+ intl?: Pick<IntlShape, 'formatMessage'>;
19
21
  }) => ExtensionManifest;
20
22
  export default manifestFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-extension-dropbox",
3
- "version": "19.0.3",
3
+ "version": "20.0.0",
4
4
  "description": "A an atlassian editor extension to add a native dropbox picker",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,14 +43,15 @@
43
43
  "@atlaskit/primitives": "^22.5.0",
44
44
  "@atlaskit/react-compiler-gating": "^0.2.0",
45
45
  "@atlaskit/section-message": "^10.2.0",
46
- "@atlaskit/tmp-editor-statsig": "^208.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
47
47
  "@atlaskit/tokens": "^20.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^1.0.2",
50
- "@emotion/react": "^11.7.1"
50
+ "@emotion/react": "^11.7.1",
51
+ "react-intl": "^7.0.0"
51
52
  },
52
53
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^125.2.0",
54
+ "@atlaskit/editor-common": "^126.0.0",
54
55
  "react": "^18.2.0 || ^19.2.0",
55
56
  "react-dom": "^18.2.0 || ^19.2.0"
56
57
  },