@atlaskit/editor-extension-googledrive 8.0.1 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/enable-googledrive.js +7 -7
- package/dist/cjs/manifest.js +26 -25
- package/dist/esm/enable-googledrive.js +7 -7
- package/dist/esm/manifest.js +25 -24
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -15,7 +15,7 @@ function gapiLoaded() {
|
|
|
15
15
|
} // Callback after API client is loaded. Loads discovery doc to initialize API
|
|
16
16
|
function _gapiLoaded() {
|
|
17
17
|
_gapiLoaded = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
18
|
-
return _regenerator.default.wrap(function
|
|
18
|
+
return _regenerator.default.wrap(function (_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
21
|
window.gapi.load('client:picker', initializePicker);
|
|
@@ -32,12 +32,12 @@ function initializePicker() {
|
|
|
32
32
|
} // Callback after Google Identity Services are loaded
|
|
33
33
|
function _initializePicker() {
|
|
34
34
|
_initializePicker = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
35
|
-
return _regenerator.default.wrap(function
|
|
35
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
36
36
|
while (1) switch (_context2.prev = _context2.next) {
|
|
37
37
|
case 0:
|
|
38
|
-
_context2.next =
|
|
38
|
+
_context2.next = 1;
|
|
39
39
|
return window.gapi.client.load('https://www.googleapis.com/discovery/v1/apis/drive/v3/rest');
|
|
40
|
-
case
|
|
40
|
+
case 1:
|
|
41
41
|
case "end":
|
|
42
42
|
return _context2.stop();
|
|
43
43
|
}
|
|
@@ -61,11 +61,11 @@ function _default(_x) {
|
|
|
61
61
|
function _ref2() {
|
|
62
62
|
_ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref) {
|
|
63
63
|
var clientID, scopes;
|
|
64
|
-
return _regenerator.default.wrap(function
|
|
64
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
65
65
|
while (1) switch (_context3.prev = _context3.next) {
|
|
66
66
|
case 0:
|
|
67
67
|
clientID = _ref.clientID, scopes = _ref.scopes;
|
|
68
|
-
_context3.next =
|
|
68
|
+
_context3.next = 1;
|
|
69
69
|
return new Promise(function (resolve, reject) {
|
|
70
70
|
var handleLoad = function handleLoad() {
|
|
71
71
|
if (!window.gapi) {
|
|
@@ -113,7 +113,7 @@ function _ref2() {
|
|
|
113
113
|
window.addEventListener('load', handleLoad);
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
case
|
|
116
|
+
case 1:
|
|
117
117
|
case "end":
|
|
118
118
|
return _context3.stop();
|
|
119
119
|
}
|
package/dist/cjs/manifest.js
CHANGED
|
@@ -10,7 +10,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _enableGoogledrive = _interopRequireDefault(require("./enable-googledrive"));
|
|
12
12
|
var _builders = require("@atlaskit/adf-utils/builders");
|
|
13
|
-
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
|
|
13
|
+
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); }
|
|
14
14
|
var scopes = ['https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.readonly'];
|
|
15
15
|
var pickerResolve;
|
|
16
16
|
// Handle user's file selection and displays as a smart link
|
|
@@ -40,28 +40,29 @@ function createPicker(appKey) {
|
|
|
40
40
|
window.appKey = appKey;
|
|
41
41
|
window.GooglePicker.token_client.callback = /*#__PURE__*/function () {
|
|
42
42
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
|
|
43
|
-
|
|
43
|
+
var _t;
|
|
44
|
+
return _regenerator.default.wrap(function (_context) {
|
|
44
45
|
while (1) switch (_context.prev = _context.next) {
|
|
45
46
|
case 0:
|
|
46
47
|
_context.prev = 0;
|
|
47
48
|
if (!(response.error !== undefined)) {
|
|
48
|
-
_context.next =
|
|
49
|
+
_context.next = 1;
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
51
52
|
throw response;
|
|
52
|
-
case
|
|
53
|
+
case 1:
|
|
53
54
|
window.GooglePicker.accessToken = response.access_token;
|
|
54
55
|
showPicker();
|
|
55
|
-
_context.next =
|
|
56
|
+
_context.next = 3;
|
|
56
57
|
break;
|
|
57
|
-
case
|
|
58
|
-
_context.prev =
|
|
59
|
-
|
|
60
|
-
case
|
|
58
|
+
case 2:
|
|
59
|
+
_context.prev = 2;
|
|
60
|
+
_t = _context["catch"](0);
|
|
61
|
+
case 3:
|
|
61
62
|
case "end":
|
|
62
63
|
return _context.stop();
|
|
63
64
|
}
|
|
64
|
-
}, _callee, null, [[0,
|
|
65
|
+
}, _callee, null, [[0, 2]]);
|
|
65
66
|
}));
|
|
66
67
|
return function (_x) {
|
|
67
68
|
return _ref.apply(this, arguments);
|
|
@@ -87,21 +88,21 @@ function pickFromGoogle(_x2, _x3) {
|
|
|
87
88
|
// appKey = APIKey, clientID = OAuth 2.0 Client ID
|
|
88
89
|
function _pickFromGoogle() {
|
|
89
90
|
_pickFromGoogle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(appKey, clientID) {
|
|
90
|
-
return _regenerator.default.wrap(function
|
|
91
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
91
92
|
while (1) switch (_context3.prev = _context3.next) {
|
|
92
93
|
case 0:
|
|
93
94
|
window.GooglePicker = window.GooglePicker || {};
|
|
94
|
-
_context3.next =
|
|
95
|
+
_context3.next = 1;
|
|
95
96
|
return (0, _enableGoogledrive.default)({
|
|
96
97
|
clientID: clientID,
|
|
97
98
|
scopes: scopes
|
|
98
99
|
});
|
|
99
|
-
case
|
|
100
|
+
case 1:
|
|
100
101
|
return _context3.abrupt("return", new Promise(function (resolve) {
|
|
101
102
|
pickerResolve = resolve;
|
|
102
103
|
createPicker(appKey);
|
|
103
104
|
}));
|
|
104
|
-
case
|
|
105
|
+
case 2:
|
|
105
106
|
case "end":
|
|
106
107
|
return _context3.stop();
|
|
107
108
|
}
|
|
@@ -148,31 +149,31 @@ var manifestFunction = function manifestFunction(_ref2) {
|
|
|
148
149
|
// eslint-disable-next-line no-async-promise-executor
|
|
149
150
|
new Promise( /*#__PURE__*/function () {
|
|
150
151
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
|
|
151
|
-
var node;
|
|
152
|
-
return _regenerator.default.wrap(function
|
|
152
|
+
var node, _t2;
|
|
153
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
153
154
|
while (1) switch (_context2.prev = _context2.next) {
|
|
154
155
|
case 0:
|
|
155
156
|
_context2.prev = 0;
|
|
156
|
-
_context2.next =
|
|
157
|
+
_context2.next = 1;
|
|
157
158
|
return pickFromGoogle(appKey, clientID);
|
|
158
|
-
case
|
|
159
|
+
case 1:
|
|
159
160
|
node = _context2.sent;
|
|
160
161
|
if (!node) {
|
|
161
162
|
reject();
|
|
162
163
|
} else {
|
|
163
164
|
resolve(node);
|
|
164
165
|
}
|
|
165
|
-
_context2.next =
|
|
166
|
+
_context2.next = 3;
|
|
166
167
|
break;
|
|
167
|
-
case
|
|
168
|
-
_context2.prev =
|
|
169
|
-
|
|
170
|
-
reject(
|
|
171
|
-
case
|
|
168
|
+
case 2:
|
|
169
|
+
_context2.prev = 2;
|
|
170
|
+
_t2 = _context2["catch"](0);
|
|
171
|
+
reject(_t2);
|
|
172
|
+
case 3:
|
|
172
173
|
case "end":
|
|
173
174
|
return _context2.stop();
|
|
174
175
|
}
|
|
175
|
-
}, _callee2, null, [[0,
|
|
176
|
+
}, _callee2, null, [[0, 2]]);
|
|
176
177
|
}));
|
|
177
178
|
return function (_x4, _x5) {
|
|
178
179
|
return _ref3.apply(this, arguments);
|
|
@@ -8,7 +8,7 @@ function gapiLoaded() {
|
|
|
8
8
|
} // Callback after API client is loaded. Loads discovery doc to initialize API
|
|
9
9
|
function _gapiLoaded() {
|
|
10
10
|
_gapiLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
11
|
-
return _regeneratorRuntime.wrap(function
|
|
11
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
12
12
|
while (1) switch (_context.prev = _context.next) {
|
|
13
13
|
case 0:
|
|
14
14
|
window.gapi.load('client:picker', initializePicker);
|
|
@@ -25,12 +25,12 @@ function initializePicker() {
|
|
|
25
25
|
} // Callback after Google Identity Services are loaded
|
|
26
26
|
function _initializePicker() {
|
|
27
27
|
_initializePicker = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
28
|
-
return _regeneratorRuntime.wrap(function
|
|
28
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
29
29
|
while (1) switch (_context2.prev = _context2.next) {
|
|
30
30
|
case 0:
|
|
31
|
-
_context2.next =
|
|
31
|
+
_context2.next = 1;
|
|
32
32
|
return window.gapi.client.load('https://www.googleapis.com/discovery/v1/apis/drive/v3/rest');
|
|
33
|
-
case
|
|
33
|
+
case 1:
|
|
34
34
|
case "end":
|
|
35
35
|
return _context2.stop();
|
|
36
36
|
}
|
|
@@ -54,11 +54,11 @@ export default function (_x) {
|
|
|
54
54
|
function _ref2() {
|
|
55
55
|
_ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref) {
|
|
56
56
|
var clientID, scopes;
|
|
57
|
-
return _regeneratorRuntime.wrap(function
|
|
57
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
58
58
|
while (1) switch (_context3.prev = _context3.next) {
|
|
59
59
|
case 0:
|
|
60
60
|
clientID = _ref.clientID, scopes = _ref.scopes;
|
|
61
|
-
_context3.next =
|
|
61
|
+
_context3.next = 1;
|
|
62
62
|
return new Promise(function (resolve, reject) {
|
|
63
63
|
var handleLoad = function handleLoad() {
|
|
64
64
|
if (!window.gapi) {
|
|
@@ -106,7 +106,7 @@ function _ref2() {
|
|
|
106
106
|
window.addEventListener('load', handleLoad);
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
case
|
|
109
|
+
case 1:
|
|
110
110
|
case "end":
|
|
111
111
|
return _context3.stop();
|
|
112
112
|
}
|
package/dist/esm/manifest.js
CHANGED
|
@@ -31,28 +31,29 @@ function createPicker(appKey) {
|
|
|
31
31
|
window.appKey = appKey;
|
|
32
32
|
window.GooglePicker.token_client.callback = /*#__PURE__*/function () {
|
|
33
33
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
34
|
-
|
|
34
|
+
var _t;
|
|
35
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
35
36
|
while (1) switch (_context.prev = _context.next) {
|
|
36
37
|
case 0:
|
|
37
38
|
_context.prev = 0;
|
|
38
39
|
if (!(response.error !== undefined)) {
|
|
39
|
-
_context.next =
|
|
40
|
+
_context.next = 1;
|
|
40
41
|
break;
|
|
41
42
|
}
|
|
42
43
|
throw response;
|
|
43
|
-
case
|
|
44
|
+
case 1:
|
|
44
45
|
window.GooglePicker.accessToken = response.access_token;
|
|
45
46
|
showPicker();
|
|
46
|
-
_context.next =
|
|
47
|
+
_context.next = 3;
|
|
47
48
|
break;
|
|
48
|
-
case
|
|
49
|
-
_context.prev =
|
|
50
|
-
|
|
51
|
-
case
|
|
49
|
+
case 2:
|
|
50
|
+
_context.prev = 2;
|
|
51
|
+
_t = _context["catch"](0);
|
|
52
|
+
case 3:
|
|
52
53
|
case "end":
|
|
53
54
|
return _context.stop();
|
|
54
55
|
}
|
|
55
|
-
}, _callee, null, [[0,
|
|
56
|
+
}, _callee, null, [[0, 2]]);
|
|
56
57
|
}));
|
|
57
58
|
return function (_x) {
|
|
58
59
|
return _ref.apply(this, arguments);
|
|
@@ -78,21 +79,21 @@ function pickFromGoogle(_x2, _x3) {
|
|
|
78
79
|
// appKey = APIKey, clientID = OAuth 2.0 Client ID
|
|
79
80
|
function _pickFromGoogle() {
|
|
80
81
|
_pickFromGoogle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(appKey, clientID) {
|
|
81
|
-
return _regeneratorRuntime.wrap(function
|
|
82
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
82
83
|
while (1) switch (_context3.prev = _context3.next) {
|
|
83
84
|
case 0:
|
|
84
85
|
window.GooglePicker = window.GooglePicker || {};
|
|
85
|
-
_context3.next =
|
|
86
|
+
_context3.next = 1;
|
|
86
87
|
return enableGoogleDrive({
|
|
87
88
|
clientID: clientID,
|
|
88
89
|
scopes: scopes
|
|
89
90
|
});
|
|
90
|
-
case
|
|
91
|
+
case 1:
|
|
91
92
|
return _context3.abrupt("return", new Promise(function (resolve) {
|
|
92
93
|
pickerResolve = resolve;
|
|
93
94
|
createPicker(appKey);
|
|
94
95
|
}));
|
|
95
|
-
case
|
|
96
|
+
case 2:
|
|
96
97
|
case "end":
|
|
97
98
|
return _context3.stop();
|
|
98
99
|
}
|
|
@@ -133,31 +134,31 @@ var manifestFunction = function manifestFunction(_ref2) {
|
|
|
133
134
|
// eslint-disable-next-line no-async-promise-executor
|
|
134
135
|
new Promise( /*#__PURE__*/function () {
|
|
135
136
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
|
|
136
|
-
var node;
|
|
137
|
-
return _regeneratorRuntime.wrap(function
|
|
137
|
+
var node, _t2;
|
|
138
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
138
139
|
while (1) switch (_context2.prev = _context2.next) {
|
|
139
140
|
case 0:
|
|
140
141
|
_context2.prev = 0;
|
|
141
|
-
_context2.next =
|
|
142
|
+
_context2.next = 1;
|
|
142
143
|
return pickFromGoogle(appKey, clientID);
|
|
143
|
-
case
|
|
144
|
+
case 1:
|
|
144
145
|
node = _context2.sent;
|
|
145
146
|
if (!node) {
|
|
146
147
|
reject();
|
|
147
148
|
} else {
|
|
148
149
|
resolve(node);
|
|
149
150
|
}
|
|
150
|
-
_context2.next =
|
|
151
|
+
_context2.next = 3;
|
|
151
152
|
break;
|
|
152
|
-
case
|
|
153
|
-
_context2.prev =
|
|
154
|
-
|
|
155
|
-
reject(
|
|
156
|
-
case
|
|
153
|
+
case 2:
|
|
154
|
+
_context2.prev = 2;
|
|
155
|
+
_t2 = _context2["catch"](0);
|
|
156
|
+
reject(_t2);
|
|
157
|
+
case 3:
|
|
157
158
|
case "end":
|
|
158
159
|
return _context2.stop();
|
|
159
160
|
}
|
|
160
|
-
}, _callee2, null, [[0,
|
|
161
|
+
}, _callee2, null, [[0, 2]]);
|
|
161
162
|
}));
|
|
162
163
|
return function (_x4, _x5) {
|
|
163
164
|
return _ref3.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-extension-googledrive",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "An Atlassian editor extension to add a native Google Drive picker",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"team": "trello-ecosystem"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^
|
|
33
|
-
"@atlaskit/adf-utils": "^19.
|
|
34
|
-
"@atlaskit/tokens": "^13.
|
|
32
|
+
"@atlaskit/adf-schema": "^53.0.0",
|
|
33
|
+
"@atlaskit/adf-utils": "^19.33.0",
|
|
34
|
+
"@atlaskit/tokens": "^13.3.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@compiled/react": "^0.20.0",
|
|
37
37
|
"@types/gapi": "0.0.44"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^115.10.0",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0"
|
|
43
43
|
},
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@atlassian/react-compiler-gating": "workspace:^"
|
|
56
|
+
"@atlassian/react-compiler-gating": "workspace:^",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0"
|
|
57
59
|
}
|
|
58
60
|
}
|