@procore/text-editor 1.0.1 → 1.2.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/.jest/ckeditorMock.js +3 -0
- package/.jest/ckeditorUtilsMock.js +14 -0
- package/.jest/setupTests.js +1 -2
- package/CHANGELOG.md +24 -0
- package/README.md +15 -0
- package/dist/DebouncedTextEditor/DebouncedTextEditor.js +1 -1
- package/dist/DebouncedTextEditor/DebouncedTextEditor.js.map +1 -1
- package/dist/DebouncedTextEditor/index.js.map +1 -1
- package/dist/TextEditor/CKTextEditor.js +12 -8
- package/dist/TextEditor/CKTextEditor.js.map +1 -1
- package/dist/TextEditor/EditorError.js.map +1 -1
- package/dist/TextEditor/Providers/FeatureFlagProvider.js.map +1 -1
- package/dist/TextEditor/StickyToolbar/index.js.map +1 -1
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +1 -1
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -1
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.d.ts +7 -8
- package/dist/TextEditor/TextEditor.styles.js +6 -6
- package/dist/TextEditor/TextEditor.styles.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +29 -9
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/TextEditorI18nProvider.js.map +1 -1
- package/dist/TextEditor/TextEditorProvider.js.map +1 -1
- package/dist/TextEditor/TextEditorProvider.types.d.ts +1 -1
- package/dist/TextEditor/TextEditorProvider.types.js.map +1 -1
- package/dist/TextEditor/TinyMCETextEditor.js +2 -1
- package/dist/TextEditor/TinyMCETextEditor.js.map +1 -1
- package/dist/TextEditor/index.d.ts +1 -1
- package/dist/TextEditor/index.js +0 -1
- package/dist/TextEditor/index.js.map +1 -1
- package/dist/TextEditor/license_key.js.map +1 -1
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js +21 -29
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +1 -1
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js +2 -2
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/CutPlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/NormalizeTableWidthPlugin/NormalizeTableWidthPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/NormalizeTableWidthPlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +20 -28
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +1 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +2 -2
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js +54 -62
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -1
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js +2 -2
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -1
- package/dist/TextEditor/plugins/PastePlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.d.ts +7 -1
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js +162 -71
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/index.js.map +1 -1
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -1
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +1 -1
- package/dist/TextEditor/textEditorTheming/icons.js.map +1 -1
- package/dist/TextEditor/textEditorTheming/index.js.map +1 -1
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.d.ts +0 -1
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -1
- package/dist/TextEditor/useCKEditorCss.js.map +1 -1
- package/dist/TextEditor/useCKEditorFocusScope.js.map +1 -1
- package/dist/TextEditor/useTabAsNavigation.js.map +1 -1
- package/dist/TextEditor/utils/config.js +30 -5
- package/dist/TextEditor/utils/config.js.map +1 -1
- package/dist/TextEditor/utils/imageAttributes.js.map +1 -1
- package/dist/TextEditor/utils/imageUrls.js.map +1 -1
- package/dist/TextEditor/utils/index.js.map +1 -1
- package/dist/TextEditor/utils/locale.js +12 -1
- package/dist/TextEditor/utils/locale.js.map +1 -1
- package/dist/TextEditor/utils/richTextEditorHandlers.d.ts +5 -2
- package/dist/TextEditor/utils/richTextEditorHandlers.js +138 -99
- package/dist/TextEditor/utils/richTextEditorHandlers.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.d.ts +0 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +2 -2
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +0 -1
- package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.utils.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +1 -1
- package/dist/TextEditorOutput/index.js.map +1 -1
- package/dist/_storyHelpers/constants.js.map +1 -1
- package/dist/_typedoc/TextEditor/TextEditor.types.json +432 -158
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +4 -4
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +9 -9
- package/dist/_typedoc/deprecations.json +1 -1
- package/dist/_utils/propsTypedoc.d.ts +3 -3
- package/dist/_utils/propsTypedoc.js +1 -3
- package/dist/_utils/propsTypedoc.js.map +1 -1
- package/dist/ckeditor5-premium-features.d.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +1 -0
- package/dist/stories/util.js.map +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/debounce.js.map +1 -1
- package/jestConfig.js +0 -2
- package/package.json +49 -47
- package/.jest/translationMock.js +0 -12
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { I18njs } from '@procore/core-i18n-js';
|
|
1
2
|
import type { TextEditorImageUploadHandlers } from '../TextEditor.types';
|
|
2
|
-
|
|
3
|
+
type TextEditorI18n = Pick<I18njs, 't'>;
|
|
4
|
+
type RichTextEditorHandlerOptions = {
|
|
3
5
|
companyId: number | string;
|
|
4
6
|
projectId?: number | string;
|
|
5
7
|
toolName: string;
|
|
8
|
+
i18n: TextEditorI18n;
|
|
6
9
|
fetcher?: typeof fetch;
|
|
7
10
|
};
|
|
8
|
-
export declare const richTextEditorUploadHandler: ({ companyId, projectId, toolName, fetcher, }: RichTextEditorHandlerOptions) => TextEditorImageUploadHandlers[
|
|
11
|
+
export declare const richTextEditorUploadHandler: ({ companyId, projectId, toolName, i18n, fetcher, }: RichTextEditorHandlerOptions) => TextEditorImageUploadHandlers["upload"];
|
|
9
12
|
export {};
|
|
@@ -1,65 +1,50 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
-
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
9
|
-
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
10
|
-
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
11
|
-
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
12
|
-
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
13
|
-
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
14
7
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
15
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) {
|
|
16
|
-
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
8
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
17
9
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
10
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19
|
-
var IMAGE_UPLOAD_FAILED_MESSAGE = 'Image upload failed.';
|
|
20
|
-
var defaultFetcher = function defaultFetcher() {
|
|
21
|
-
return fetch.apply(void 0, arguments);
|
|
22
|
-
};
|
|
23
11
|
var _ref = require('@procore/core-http'),
|
|
24
12
|
requestJSON = _ref.requestJSON;
|
|
25
13
|
var fetcherRequestJSON = /*#__PURE__*/function () {
|
|
26
|
-
var _ref2 = _asyncToGenerator(
|
|
27
|
-
var response;
|
|
28
|
-
return
|
|
29
|
-
while (1) switch (_context.
|
|
14
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(fetcher, url, init, i18n) {
|
|
15
|
+
var response, _t, _t2;
|
|
16
|
+
return _regenerator().w(function (_context) {
|
|
17
|
+
while (1) switch (_context.n) {
|
|
30
18
|
case 0:
|
|
31
|
-
_context.
|
|
19
|
+
_context.n = 1;
|
|
32
20
|
return fetcher(url, init);
|
|
33
|
-
case
|
|
34
|
-
response = _context.
|
|
21
|
+
case 1:
|
|
22
|
+
response = _context.v;
|
|
35
23
|
if (response.ok) {
|
|
36
|
-
_context.
|
|
24
|
+
_context.n = 3;
|
|
37
25
|
break;
|
|
38
26
|
}
|
|
39
|
-
|
|
40
|
-
_context.
|
|
41
|
-
return errorMessageFromResponse(response,
|
|
42
|
-
case
|
|
43
|
-
|
|
44
|
-
throw new
|
|
45
|
-
case
|
|
46
|
-
_context.
|
|
27
|
+
_t = Error;
|
|
28
|
+
_context.n = 2;
|
|
29
|
+
return errorMessageFromResponse(response, i18n.t('textEditor.imageUpload.failed'));
|
|
30
|
+
case 2:
|
|
31
|
+
_t2 = _context.v;
|
|
32
|
+
throw new _t(_t2);
|
|
33
|
+
case 3:
|
|
34
|
+
_context.n = 4;
|
|
47
35
|
return response.json();
|
|
48
|
-
case
|
|
49
|
-
return _context.
|
|
50
|
-
case 12:
|
|
51
|
-
case "end":
|
|
52
|
-
return _context.stop();
|
|
36
|
+
case 4:
|
|
37
|
+
return _context.a(2, _context.v);
|
|
53
38
|
}
|
|
54
39
|
}, _callee);
|
|
55
40
|
}));
|
|
56
|
-
return function fetcherRequestJSON(_x, _x2, _x3) {
|
|
41
|
+
return function fetcherRequestJSON(_x, _x2, _x3, _x4) {
|
|
57
42
|
return _ref2.apply(this, arguments);
|
|
58
43
|
};
|
|
59
44
|
}();
|
|
60
|
-
var procoreRequestJSON = function procoreRequestJSON(url, init, fetcher) {
|
|
45
|
+
var procoreRequestJSON = function procoreRequestJSON(url, init, i18n, fetcher) {
|
|
61
46
|
if (fetcher) {
|
|
62
|
-
return fetcherRequestJSON(fetcher, url, init);
|
|
47
|
+
return fetcherRequestJSON(fetcher, url, init, i18n);
|
|
63
48
|
}
|
|
64
49
|
return requestJSON(url, init);
|
|
65
50
|
};
|
|
@@ -67,30 +52,27 @@ var bodyFromResponse = function bodyFromResponse(response) {
|
|
|
67
52
|
return 'data' in response ? response.data : response;
|
|
68
53
|
};
|
|
69
54
|
var errorMessageFromResponse = /*#__PURE__*/function () {
|
|
70
|
-
var _ref3 = _asyncToGenerator(
|
|
71
|
-
var _body$error, _body$errors,
|
|
72
|
-
return
|
|
73
|
-
while (1) switch (_context2.
|
|
55
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(response, fallbackMessage) {
|
|
56
|
+
var _body$error, _body$errors, body, _t3;
|
|
57
|
+
return _regenerator().w(function (_context2) {
|
|
58
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
74
59
|
case 0:
|
|
75
|
-
_context2.
|
|
76
|
-
_context2.
|
|
60
|
+
_context2.p = 0;
|
|
61
|
+
_context2.n = 1;
|
|
77
62
|
return response.json();
|
|
78
|
-
case
|
|
79
|
-
body = _context2.
|
|
80
|
-
return _context2.
|
|
63
|
+
case 1:
|
|
64
|
+
body = _context2.v;
|
|
65
|
+
return _context2.a(2, ((_body$error = body.error) === null || _body$error === void 0 ? void 0 : _body$error.message) || ((_body$errors = body.errors) === null || _body$errors === void 0 || (_body$errors = _body$errors.find(function (error) {
|
|
81
66
|
return error.message;
|
|
82
|
-
})) === null || _body$errors
|
|
83
|
-
case
|
|
84
|
-
_context2.
|
|
85
|
-
|
|
86
|
-
return _context2.
|
|
87
|
-
case 10:
|
|
88
|
-
case "end":
|
|
89
|
-
return _context2.stop();
|
|
67
|
+
})) === null || _body$errors === void 0 ? void 0 : _body$errors.message) || body.message || fallbackMessage);
|
|
68
|
+
case 2:
|
|
69
|
+
_context2.p = 2;
|
|
70
|
+
_t3 = _context2.v;
|
|
71
|
+
return _context2.a(2, fallbackMessage);
|
|
90
72
|
}
|
|
91
|
-
}, _callee2, null, [[0,
|
|
73
|
+
}, _callee2, null, [[0, 2]]);
|
|
92
74
|
}));
|
|
93
|
-
return function errorMessageFromResponse(
|
|
75
|
+
return function errorMessageFromResponse(_x5, _x6) {
|
|
94
76
|
return _ref3.apply(this, arguments);
|
|
95
77
|
};
|
|
96
78
|
}();
|
|
@@ -106,18 +88,18 @@ var uploadEndpoint = function uploadEndpoint(_ref5) {
|
|
|
106
88
|
return projectId ? "/rest/v1.1/projects/".concat(projectId, "/uploads") : "/rest/v1.1/companies/".concat(companyId, "/uploads");
|
|
107
89
|
};
|
|
108
90
|
var uploadFileToStorage = /*#__PURE__*/function () {
|
|
109
|
-
var _ref6 = _asyncToGenerator(
|
|
91
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(uploadInstructions, file, signal, i18n, fetcher, onProgress) {
|
|
110
92
|
var _uploadInstructions$f;
|
|
111
93
|
var body, uploadResponse;
|
|
112
|
-
return
|
|
113
|
-
while (1) switch (_context3.
|
|
94
|
+
return _regenerator().w(function (_context3) {
|
|
95
|
+
while (1) switch (_context3.n) {
|
|
114
96
|
case 0:
|
|
115
97
|
if (!(!uploadInstructions.uuid || !uploadInstructions.url)) {
|
|
116
|
-
_context3.
|
|
98
|
+
_context3.n = 1;
|
|
117
99
|
break;
|
|
118
100
|
}
|
|
119
|
-
throw new Error('
|
|
120
|
-
case
|
|
101
|
+
throw new Error(i18n.t('textEditor.imageUpload.missingStorageInstructions'));
|
|
102
|
+
case 1:
|
|
121
103
|
body = new FormData();
|
|
122
104
|
Object.entries((_uploadInstructions$f = uploadInstructions.fields) !== null && _uploadInstructions$f !== void 0 ? _uploadInstructions$f : {}).forEach(function (_ref7) {
|
|
123
105
|
var _ref8 = _slicedToArray(_ref7, 2),
|
|
@@ -126,43 +108,101 @@ var uploadFileToStorage = /*#__PURE__*/function () {
|
|
|
126
108
|
body.append(key, value);
|
|
127
109
|
});
|
|
128
110
|
body.append('file', file);
|
|
129
|
-
|
|
111
|
+
if (!fetcher) {
|
|
112
|
+
_context3.n = 4;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
_context3.n = 2;
|
|
130
116
|
return fetcher(uploadInstructions.url, {
|
|
131
117
|
method: 'POST',
|
|
132
118
|
signal: signal,
|
|
133
119
|
body: body
|
|
134
120
|
});
|
|
135
|
-
case
|
|
136
|
-
uploadResponse = _context3.
|
|
121
|
+
case 2:
|
|
122
|
+
uploadResponse = _context3.v;
|
|
137
123
|
if (uploadResponse.ok) {
|
|
138
|
-
_context3.
|
|
124
|
+
_context3.n = 3;
|
|
139
125
|
break;
|
|
140
126
|
}
|
|
141
|
-
throw new Error(
|
|
142
|
-
case
|
|
143
|
-
|
|
144
|
-
return _context3.
|
|
127
|
+
throw new Error(i18n.t('textEditor.imageUpload.failed'));
|
|
128
|
+
case 3:
|
|
129
|
+
onProgress === null || onProgress === void 0 || onProgress(file.size);
|
|
130
|
+
return _context3.a(2);
|
|
131
|
+
case 4:
|
|
132
|
+
_context3.n = 5;
|
|
133
|
+
return uploadFileToStorageWithProgress(uploadInstructions.url, body, file, signal, i18n, onProgress);
|
|
134
|
+
case 5:
|
|
135
|
+
return _context3.a(2);
|
|
145
136
|
}
|
|
146
137
|
}, _callee3);
|
|
147
138
|
}));
|
|
148
|
-
return function uploadFileToStorage(
|
|
139
|
+
return function uploadFileToStorage(_x7, _x8, _x9, _x0, _x1, _x10) {
|
|
149
140
|
return _ref6.apply(this, arguments);
|
|
150
141
|
};
|
|
151
142
|
}();
|
|
143
|
+
var uploadFileToStorageWithProgress = function uploadFileToStorageWithProgress(url, body, file, signal, i18n, onProgress) {
|
|
144
|
+
return new Promise(function (resolve, reject) {
|
|
145
|
+
var abortError = function abortError() {
|
|
146
|
+
return new DOMException('The operation was aborted.', 'AbortError');
|
|
147
|
+
};
|
|
148
|
+
if (signal.aborted) {
|
|
149
|
+
reject(abortError());
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
var xhr = new XMLHttpRequest();
|
|
153
|
+
var abort = function abort() {
|
|
154
|
+
return xhr.abort();
|
|
155
|
+
};
|
|
156
|
+
signal.addEventListener('abort', abort, {
|
|
157
|
+
once: true
|
|
158
|
+
});
|
|
159
|
+
var settle = function settle(fn) {
|
|
160
|
+
signal.removeEventListener('abort', abort);
|
|
161
|
+
fn();
|
|
162
|
+
};
|
|
163
|
+
xhr.upload.onprogress = function (event) {
|
|
164
|
+
if (event.lengthComputable && event.total > 0) {
|
|
165
|
+
onProgress === null || onProgress === void 0 || onProgress(Math.min(file.size, event.loaded / event.total * file.size));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
xhr.onload = function () {
|
|
169
|
+
return settle(function () {
|
|
170
|
+
if (xhr.status === 204 && xhr.status < 300) {
|
|
171
|
+
resolve();
|
|
172
|
+
} else {
|
|
173
|
+
reject(new Error(i18n.t('textEditor.imageUpload.failed')));
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
xhr.onerror = function () {
|
|
178
|
+
return settle(function () {
|
|
179
|
+
return reject(new Error(i18n.t('textEditor.imageUpload.failed')));
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
xhr.onabort = function () {
|
|
183
|
+
return settle(function () {
|
|
184
|
+
return reject(abortError());
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
xhr.open('POST', url);
|
|
188
|
+
xhr.send(body);
|
|
189
|
+
});
|
|
190
|
+
};
|
|
152
191
|
export var richTextEditorUploadHandler = function richTextEditorUploadHandler(_ref9) {
|
|
153
192
|
var companyId = _ref9.companyId,
|
|
154
193
|
projectId = _ref9.projectId,
|
|
155
194
|
toolName = _ref9.toolName,
|
|
195
|
+
i18n = _ref9.i18n,
|
|
156
196
|
fetcher = _ref9.fetcher;
|
|
157
197
|
return /*#__PURE__*/function () {
|
|
158
|
-
var _ref0 = _asyncToGenerator(
|
|
159
|
-
var _callbacks$onProgress, _callbacks$
|
|
160
|
-
var uploadInstructions, createBody, prostoreFileId, urls;
|
|
161
|
-
return
|
|
162
|
-
while (1) switch (_context4.
|
|
198
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(file, context, callbacks) {
|
|
199
|
+
var _callbacks$onProgress, _callbacks$onProgress3;
|
|
200
|
+
var uploadInstructions, createBody, prostoreFileId, urls, _t4;
|
|
201
|
+
return _regenerator().w(function (_context4) {
|
|
202
|
+
while (1) switch (_context4.n) {
|
|
163
203
|
case 0:
|
|
164
|
-
(_callbacks$onProgress = callbacks.onProgress) === null || _callbacks$onProgress === void 0
|
|
165
|
-
_context4.
|
|
204
|
+
(_callbacks$onProgress = callbacks.onProgress) === null || _callbacks$onProgress === void 0 || _callbacks$onProgress.call(callbacks, 0, file.size);
|
|
205
|
+
_context4.n = 1;
|
|
166
206
|
return procoreRequestJSON(uploadEndpoint({
|
|
167
207
|
companyId: companyId,
|
|
168
208
|
projectId: projectId
|
|
@@ -178,14 +218,17 @@ export var richTextEditorUploadHandler = function richTextEditorUploadHandler(_r
|
|
|
178
218
|
response_filename: file.name,
|
|
179
219
|
size: file.size
|
|
180
220
|
})
|
|
181
|
-
}, fetcher);
|
|
182
|
-
case
|
|
183
|
-
uploadInstructions = _context4.
|
|
184
|
-
_context4.
|
|
185
|
-
return uploadFileToStorage(uploadInstructions, file, context.signal,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
221
|
+
}, i18n, fetcher);
|
|
222
|
+
case 1:
|
|
223
|
+
uploadInstructions = _context4.v;
|
|
224
|
+
_context4.n = 2;
|
|
225
|
+
return uploadFileToStorage(uploadInstructions, file, context.signal, i18n, fetcher, function (uploadedBytes) {
|
|
226
|
+
var _callbacks$onProgress2;
|
|
227
|
+
return (_callbacks$onProgress2 = callbacks.onProgress) === null || _callbacks$onProgress2 === void 0 ? void 0 : _callbacks$onProgress2.call(callbacks, uploadedBytes, file.size);
|
|
228
|
+
});
|
|
229
|
+
case 2:
|
|
230
|
+
_t4 = bodyFromResponse;
|
|
231
|
+
_context4.n = 3;
|
|
189
232
|
return procoreRequestJSON(richTextEditorEndpoint({
|
|
190
233
|
companyId: companyId,
|
|
191
234
|
projectId: projectId
|
|
@@ -201,32 +244,28 @@ export var richTextEditorUploadHandler = function richTextEditorUploadHandler(_r
|
|
|
201
244
|
filename: file.name,
|
|
202
245
|
tool_name: toolName
|
|
203
246
|
})
|
|
204
|
-
}, fetcher);
|
|
205
|
-
case
|
|
206
|
-
|
|
207
|
-
createBody = (0, _context4.t0)(_context4.t1);
|
|
247
|
+
}, i18n, fetcher);
|
|
248
|
+
case 3:
|
|
249
|
+
createBody = _t4(_context4.v);
|
|
208
250
|
prostoreFileId = createBody.prostore_file_id;
|
|
209
251
|
urls = createBody.urls;
|
|
210
252
|
if (!(!prostoreFileId || !(urls !== null && urls !== void 0 && urls["default"]))) {
|
|
211
|
-
_context4.
|
|
253
|
+
_context4.n = 4;
|
|
212
254
|
break;
|
|
213
255
|
}
|
|
214
|
-
throw new Error('
|
|
215
|
-
case
|
|
216
|
-
(_callbacks$
|
|
217
|
-
return _context4.
|
|
256
|
+
throw new Error(i18n.t('textEditor.imageUpload.invalidProstoreFileId'));
|
|
257
|
+
case 4:
|
|
258
|
+
(_callbacks$onProgress3 = callbacks.onProgress) === null || _callbacks$onProgress3 === void 0 || _callbacks$onProgress3.call(callbacks, file.size, file.size);
|
|
259
|
+
return _context4.a(2, {
|
|
218
260
|
urls: urls,
|
|
219
261
|
prostoreFileId: prostoreFileId,
|
|
220
262
|
width: createBody.width,
|
|
221
263
|
height: createBody.height
|
|
222
264
|
});
|
|
223
|
-
case 17:
|
|
224
|
-
case "end":
|
|
225
|
-
return _context4.stop();
|
|
226
265
|
}
|
|
227
266
|
}, _callee4);
|
|
228
267
|
}));
|
|
229
|
-
return function (
|
|
268
|
+
return function (_x11, _x12, _x13) {
|
|
230
269
|
return _ref0.apply(this, arguments);
|
|
231
270
|
};
|
|
232
271
|
}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richTextEditorHandlers.js","names":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_regeneratorDefine","enumerable","configurable","writable","_invoke","_OverloadYield","k","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","IMAGE_UPLOAD_FAILED_MESSAGE","defaultFetcher","fetch","_ref","require","requestJSON","fetcherRequestJSON","_ref2","_regeneratorRuntime","mark","_callee","fetcher","url","init","response","wrap","_callee$","_context","prev","next","sent","ok","t0","Error","errorMessageFromResponse","t1","json","abrupt","stop","_x","_x2","_x3","procoreRequestJSON","bodyFromResponse","data","_ref3","_callee2","fallbackMessage","_body$error","_body$errors","_body$errors$find","body","_callee2$","_context2","error","message","errors","find","_x4","_x5","richTextEditorEndpoint","_ref4","companyId","projectId","projectPath","concat","uploadEndpoint","_ref5","uploadFileToStorage","_ref6","_callee3","uploadInstructions","file","signal","_uploadInstructions$f","uploadResponse","_callee3$","_context3","uuid","FormData","entries","fields","forEach","_ref7","_ref8","_slicedToArray","key","append","method","_x6","_x7","_x8","_x9","richTextEditorUploadHandler","_ref9","toolName","_ref0","_callee4","context","callbacks","_callbacks$onProgress","_callbacks$onProgress2","createBody","prostoreFileId","urls","_callee4$","_context4","onProgress","size","credentials","headers","JSON","stringify","response_content_type","type","response_filename","name","upload_uuid","filename","tool_name","prostore_file_id","width","height","_x0","_x1","_x10"],"sources":["../../../src/TextEditor/utils/richTextEditorHandlers.ts"],"sourcesContent":["import type {\n TextEditorImageUploadHandlers,\n TextEditorImageUploadResult,\n} from '../TextEditor.types'\n\ntype CreateRichTextEditorUploadResponseBody = {\n prostore_file_id?: number | string\n urls?: TextEditorImageUploadResult['urls']\n width?: number\n height?: number\n}\n\ntype CreateUploadResponseBody = {\n uuid?: string\n url?: string\n fields?: Record<string, string>\n}\n\ntype CreateRichTextEditorUploadResponse =\n | CreateRichTextEditorUploadResponseBody\n | { data: CreateRichTextEditorUploadResponseBody }\n\ntype ErrorResponseBody = {\n error?: {\n message?: string\n }\n errors?: Array<{\n message?: string\n }>\n message?: string\n}\n\ntype RichTextEditorHandlerOptions = {\n companyId: number | string\n projectId?: number | string\n toolName: string\n fetcher?: typeof fetch\n}\n\nconst IMAGE_UPLOAD_FAILED_MESSAGE = 'Image upload failed.'\n\nconst defaultFetcher: typeof fetch = (...args) => fetch(...args)\nconst { requestJSON } = require('@procore/core-http') as {\n requestJSON: <T>(url: string, init?: RequestInit) => Promise<T>\n}\n\nconst fetcherRequestJSON = async <T extends object>(\n fetcher: typeof fetch,\n url: string,\n init: RequestInit\n) => {\n const response = await fetcher(url, init)\n\n if (!response.ok) {\n throw new Error(\n await errorMessageFromResponse(response, IMAGE_UPLOAD_FAILED_MESSAGE)\n )\n }\n\n return (await response.json()) as T\n}\n\nconst procoreRequestJSON = <T extends object>(\n url: string,\n init: RequestInit,\n fetcher?: typeof fetch\n) => {\n if (fetcher) {\n return fetcherRequestJSON<T>(fetcher, url, init)\n }\n\n return requestJSON<T>(url, init)\n}\n\nconst bodyFromResponse = <T extends object>(response: T | { data: T }) =>\n 'data' in response ? response.data : response\n\nconst errorMessageFromResponse = async (\n response: Response,\n fallbackMessage: string\n) => {\n try {\n const body = (await response.json()) as ErrorResponseBody\n\n return (\n body.error?.message ||\n body.errors?.find((error) => error.message)?.message ||\n body.message ||\n fallbackMessage\n )\n } catch (_error) {\n return fallbackMessage\n }\n}\n\nconst richTextEditorEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n const projectPath = projectId ? `/projects/${projectId}` : ''\n\n return `/rest/v2.0/companies/${companyId}${projectPath}/rich_text_editor/images`\n}\n\nconst uploadEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n return projectId\n ? `/rest/v1.1/projects/${projectId}/uploads`\n : `/rest/v1.1/companies/${companyId}/uploads`\n}\n\nconst uploadFileToStorage = async (\n uploadInstructions: CreateUploadResponseBody,\n file: File,\n signal: AbortSignal,\n fetcher: typeof fetch\n) => {\n if (!uploadInstructions.uuid || !uploadInstructions.url) {\n throw new Error('Image upload did not return storage instructions.')\n }\n\n const body = new FormData()\n\n Object.entries(uploadInstructions.fields ?? {}).forEach(([key, value]) => {\n body.append(key, value)\n })\n body.append('file', file)\n\n const uploadResponse = await fetcher(uploadInstructions.url, {\n method: 'POST',\n signal,\n body,\n })\n\n if (!uploadResponse.ok) {\n throw new Error(IMAGE_UPLOAD_FAILED_MESSAGE)\n }\n}\n\nexport const richTextEditorUploadHandler = ({\n companyId,\n projectId,\n toolName,\n fetcher,\n}: RichTextEditorHandlerOptions): TextEditorImageUploadHandlers['upload'] => {\n return async (file, context, callbacks) => {\n callbacks.onProgress?.(0, file.size)\n\n const uploadInstructions =\n await procoreRequestJSON<CreateUploadResponseBody>(\n uploadEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n response_content_type: file.type,\n response_filename: file.name,\n size: file.size,\n }),\n },\n fetcher\n )\n\n await uploadFileToStorage(\n uploadInstructions,\n file,\n context.signal,\n fetcher ?? defaultFetcher\n )\n\n const createBody = bodyFromResponse(\n await procoreRequestJSON<CreateRichTextEditorUploadResponse>(\n richTextEditorEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n upload_uuid: uploadInstructions.uuid,\n filename: file.name,\n tool_name: toolName,\n }),\n },\n fetcher\n )\n )\n const prostoreFileId = createBody.prostore_file_id\n const urls = createBody.urls\n\n if (!prostoreFileId || !urls?.default) {\n throw new Error('Image upload did not return a Prostore file ID and URL.')\n }\n\n callbacks.onProgress?.(file.size, file.size)\n\n return {\n urls,\n prostoreFileId,\n width: createBody.width,\n height: createBody.height,\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;0BACA,uKAAAA,CAAA,EAAAC,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WAAA,8BAAAC,EAAAN,CAAA,EAAAE,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAC,CAAA,GAAAL,CAAA,IAAAA,CAAA,CAAAM,SAAA,YAAAC,SAAA,GAAAP,CAAA,GAAAO,SAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,MAAA,CAAAL,CAAA,CAAAC,SAAA,UAAAK,mBAAA,CAAAH,CAAA,uBAAAV,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAE,CAAA,EAAAC,CAAA,EAAAG,CAAA,EAAAI,CAAA,MAAAC,CAAA,GAAAX,CAAA,QAAAY,CAA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cAAc,GAAGD,UAAU,CAACkB,gBAAgB;YAC5ChB,IAAI,GAAGF,UAAU,CAACE,IAAI;YAAA,MAExB,CAACD,cAAc,IAAI,EAACC,IAAI,aAAJA,IAAI,eAAJA,IAAI,WAAS;cAAAE,SAAA,CAAA7E,IAAA;cAAA;YAAA;YAAA,MAC7B,IAAII,KAAK,CAAC,yDAAyD,CAAC;UAAA;YAG5E,CAAAoE,sBAAA,GAAAF,SAAS,CAACQ,UAAU,cAAAN,sBAAA,uBAApBA,sBAAA,CAAAxH,IAAA,CAAAsH,SAAS,EAAc3B,IAAI,CAACoC,IAAI,EAAEpC,IAAI,CAACoC,IAAI,CAAC;YAAA,OAAAF,SAAA,CAAArE,MAAA,WAErC;cACLmE,IAAI,EAAJA,IAAI;cACJD,cAAc,EAAdA,cAAc;cACdkB,KAAK,EAAEnB,UAAU,CAACmB,KAAK;cACvBC,MAAM,EAAEpB,UAAU,CAACoB;YACrB,CAAC;UAAA;UAAA;YAAA,OAAAhB,SAAA,CAAApE,IAAA;QAAA;MAAA,GAAA2D,QAAA;IAAA,CACF;IAAA,iBAAA0B,GAAA,EAAAC,GAAA,EAAAC,IAAA;MAAA,OAAA7B,KAAA,CAAAzF,KAAA,OAAAD,SAAA;IAAA;EAAA;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"richTextEditorHandlers.js","names":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_regeneratorDefine","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","_ref","require","requestJSON","fetcherRequestJSON","_ref2","_callee","fetcher","url","init","i18n","response","_t","_t2","_context","ok","Error","errorMessageFromResponse","json","_x","_x2","_x3","_x4","procoreRequestJSON","bodyFromResponse","data","_ref3","_callee2","fallbackMessage","_body$error","_body$errors","body","_t3","_context2","error","message","errors","find","_x5","_x6","richTextEditorEndpoint","_ref4","companyId","projectId","projectPath","concat","uploadEndpoint","_ref5","uploadFileToStorage","_ref6","_callee3","uploadInstructions","file","signal","onProgress","_uploadInstructions$f","uploadResponse","_context3","uuid","FormData","entries","fields","forEach","_ref7","_ref8","_slicedToArray","key","append","method","size","uploadFileToStorageWithProgress","_x7","_x8","_x9","_x0","_x1","_x10","reject","abortError","DOMException","aborted","xhr","XMLHttpRequest","abort","addEventListener","once","settle","fn","removeEventListener","upload","onprogress","event","lengthComputable","total","Math","min","loaded","onload","status","onerror","onabort","open","send","richTextEditorUploadHandler","_ref9","toolName","_ref0","_callee4","context","callbacks","_callbacks$onProgress","_callbacks$onProgress3","createBody","prostoreFileId","urls","_t4","_context4","credentials","headers","JSON","stringify","response_content_type","type","response_filename","name","uploadedBytes","_callbacks$onProgress2","upload_uuid","filename","tool_name","prostore_file_id","width","height","_x11","_x12","_x13"],"sources":["../../../src/TextEditor/utils/richTextEditorHandlers.ts"],"sourcesContent":["import type { I18njs } from '@procore/core-i18n-js'\nimport type {\n TextEditorImageUploadHandlers,\n TextEditorImageUploadResult,\n} from '../TextEditor.types'\n\ntype TextEditorI18n = Pick<I18njs, 't'>\n\ntype CreateRichTextEditorUploadResponseBody = {\n prostore_file_id?: number | string\n urls?: TextEditorImageUploadResult['urls']\n width?: number\n height?: number\n}\n\ntype CreateUploadResponseBody = {\n uuid?: string\n url?: string\n fields?: Record<string, string>\n}\n\ntype CreateRichTextEditorUploadResponse =\n | CreateRichTextEditorUploadResponseBody\n | { data: CreateRichTextEditorUploadResponseBody }\n\ntype ErrorResponseBody = {\n error?: {\n message?: string\n }\n errors?: Array<{\n message?: string\n }>\n message?: string\n}\n\ntype RichTextEditorHandlerOptions = {\n companyId: number | string\n projectId?: number | string\n toolName: string\n i18n: TextEditorI18n\n fetcher?: typeof fetch\n}\n\nconst { requestJSON } = require('@procore/core-http') as {\n requestJSON: <T>(url: string, init?: RequestInit) => Promise<T>\n}\n\nconst fetcherRequestJSON = async <T extends object>(\n fetcher: typeof fetch,\n url: string,\n init: RequestInit,\n i18n: TextEditorI18n\n) => {\n const response = await fetcher(url, init)\n\n if (!response.ok) {\n throw new Error(\n await errorMessageFromResponse(\n response,\n i18n.t('textEditor.imageUpload.failed')\n )\n )\n }\n\n return (await response.json()) as T\n}\n\nconst procoreRequestJSON = <T extends object>(\n url: string,\n init: RequestInit,\n i18n: TextEditorI18n,\n fetcher?: typeof fetch\n) => {\n if (fetcher) {\n return fetcherRequestJSON<T>(fetcher, url, init, i18n)\n }\n\n return requestJSON<T>(url, init)\n}\n\nconst bodyFromResponse = <T extends object>(response: T | { data: T }) =>\n 'data' in response ? response.data : response\n\nconst errorMessageFromResponse = async (\n response: Response,\n fallbackMessage: string\n) => {\n try {\n const body = (await response.json()) as ErrorResponseBody\n\n return (\n body.error?.message ||\n body.errors?.find((error) => error.message)?.message ||\n body.message ||\n fallbackMessage\n )\n } catch (_error) {\n return fallbackMessage\n }\n}\n\nconst richTextEditorEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n const projectPath = projectId ? `/projects/${projectId}` : ''\n\n return `/rest/v2.0/companies/${companyId}${projectPath}/rich_text_editor/images`\n}\n\nconst uploadEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n return projectId\n ? `/rest/v1.1/projects/${projectId}/uploads`\n : `/rest/v1.1/companies/${companyId}/uploads`\n}\n\ntype StorageUploadProgress = (uploadedBytes: number) => void\n\nconst uploadFileToStorage = async (\n uploadInstructions: CreateUploadResponseBody,\n file: File,\n signal: AbortSignal,\n i18n: TextEditorI18n,\n fetcher: typeof fetch | undefined,\n onProgress?: StorageUploadProgress\n) => {\n if (!uploadInstructions.uuid || !uploadInstructions.url) {\n throw new Error(i18n.t('textEditor.imageUpload.missingStorageInstructions'))\n }\n\n const body = new FormData()\n\n Object.entries(uploadInstructions.fields ?? {}).forEach(([key, value]) => {\n body.append(key, value)\n })\n body.append('file', file)\n\n if (fetcher) {\n const uploadResponse = await fetcher(uploadInstructions.url, {\n method: 'POST',\n signal,\n body,\n })\n\n if (!uploadResponse.ok) {\n throw new Error(i18n.t('textEditor.imageUpload.failed'))\n }\n\n onProgress?.(file.size)\n\n return\n }\n\n await uploadFileToStorageWithProgress(\n uploadInstructions.url,\n body,\n file,\n signal,\n i18n,\n onProgress\n )\n}\n\nconst uploadFileToStorageWithProgress = (\n url: string,\n body: FormData,\n file: File,\n signal: AbortSignal,\n i18n: TextEditorI18n,\n onProgress?: StorageUploadProgress\n) =>\n new Promise<void>((resolve, reject) => {\n const abortError = () =>\n new DOMException('The operation was aborted.', 'AbortError')\n\n if (signal.aborted) {\n reject(abortError())\n\n return\n }\n\n const xhr = new XMLHttpRequest()\n const abort = () => xhr.abort()\n\n signal.addEventListener('abort', abort, { once: true })\n\n const settle = (fn: () => void) => {\n signal.removeEventListener('abort', abort)\n fn()\n }\n\n xhr.upload.onprogress = (event) => {\n if (event.lengthComputable && event.total > 0) {\n onProgress?.(\n Math.min(file.size, (event.loaded / event.total) * file.size)\n )\n }\n }\n\n xhr.onload = () =>\n settle(() => {\n if (xhr.status === 204 && xhr.status < 300) {\n resolve()\n } else {\n reject(new Error(i18n.t('textEditor.imageUpload.failed')))\n }\n })\n xhr.onerror = () =>\n settle(() => reject(new Error(i18n.t('textEditor.imageUpload.failed'))))\n xhr.onabort = () => settle(() => reject(abortError()))\n\n xhr.open('POST', url)\n xhr.send(body)\n })\n\nexport const richTextEditorUploadHandler = ({\n companyId,\n projectId,\n toolName,\n i18n,\n fetcher,\n}: RichTextEditorHandlerOptions): TextEditorImageUploadHandlers['upload'] => {\n return async (file, context, callbacks) => {\n callbacks.onProgress?.(0, file.size)\n\n const uploadInstructions =\n await procoreRequestJSON<CreateUploadResponseBody>(\n uploadEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n response_content_type: file.type,\n response_filename: file.name,\n size: file.size,\n }),\n },\n i18n,\n fetcher\n )\n\n await uploadFileToStorage(\n uploadInstructions,\n file,\n context.signal,\n i18n,\n fetcher,\n (uploadedBytes) => callbacks.onProgress?.(uploadedBytes, file.size)\n )\n\n const createBody = bodyFromResponse(\n await procoreRequestJSON<CreateRichTextEditorUploadResponse>(\n richTextEditorEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n upload_uuid: uploadInstructions.uuid,\n filename: file.name,\n tool_name: toolName,\n }),\n },\n i18n,\n fetcher\n )\n )\n const prostoreFileId = createBody.prostore_file_id\n const urls = createBody.urls\n\n if (!prostoreFileId || !urls?.default) {\n throw new Error(i18n.t('textEditor.imageUpload.invalidProstoreFileId'))\n }\n\n callbacks.onProgress?.(file.size, file.size)\n\n return {\n urls,\n prostoreFileId,\n width: createBody.width,\n height: createBody.height,\n }\n }\n}\n"],"mappings":";;;;;;0BACA,uKAAAA,CAAA,EAAAC,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WAAA,8BAAAC,EAAAN,CAAA,EAAAE,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAC,CAAA,GAAAL,CAAA,IAAAA,CAAA,CAAAM,SAAA,YAAAC,SAAA,GAAAP,CAAA,GAAAO,SAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,MAAA,CAAAL,CAAA,CAAAC,SAAA,UAAAK,mBAAA,CAAAH,CAAA,uBAAAV,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAE,CAAA,EAAAC,CAAA,EAAAG,CAAA,EAAAI,CAAA,MAAAC,CAAA,G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AAU,cAAAyD,sBAAA,eAApBA,sBAAA,CAAAzI,IAAA,CAAAuI,SAAS,EAAczD,IAAI,CAACiB,IAAI,EAAEjB,IAAI,CAACiB,IAAI,CAAC;YAAA,OAAA+C,SAAA,CAAApJ,CAAA,IAErC;cACLkJ,IAAI,EAAJA,IAAI;cACJD,cAAc,EAAdA,cAAc;cACdkB,KAAK,EAAEnB,UAAU,CAACmB,KAAK;cACvBC,MAAM,EAAEpB,UAAU,CAACoB;YACrB,CAAC;QAAA;MAAA,GAAAzB,QAAA;IAAA,CACF;IAAA,iBAAA0B,IAAA,EAAAC,IAAA,EAAAC,IAAA;MAAA,OAAA7B,KAAA,CAAA5G,KAAA,OAAAD,SAAA;IAAA;EAAA;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.js","names":["React","StyledEditor","sanitizeTextEditorHtml","TextEditorOutput","forwardRef","_ref","ref","value","props","_objectWithoutProperties","_excluded","sanitizedHtml","createElement","_extends","className","dangerouslySetInnerHTML","__html","contentEditable","displayName"],"sources":["../../src/TextEditorOutput/TextEditorOutput.tsx"],"sourcesContent":["import React from 'react'\n\nimport { StyledEditor } from './TextEditorOutput.styles'\nimport type { TextEditorOutputProps } from './TextEditorOutput.types'\nimport { sanitizeTextEditorHtml } from './TextEditorOutput.utils'\n\n/**\n * Render formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\nexport const TextEditorOutput = React.forwardRef<\n HTMLDivElement,\n TextEditorOutputProps & React.HTMLAttributes<HTMLDivElement>\n>(function TextEditorOutput({ value, ...props }, ref) {\n const sanitizedHtml = sanitizeTextEditorHtml(value || '--')\n\n return (\n <StyledEditor {...props} ref={ref}>\n <div\n className=\"ck-content\"\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n contentEditable={false}\n />\n </StyledEditor>\n )\n})\n\nTextEditorOutput.displayName = 'TextEditorOutput'\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,2BAA2B;AAExD,SAASC,sBAAsB,QAAQ,0BAA0B;;AAEjE;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,gBAAgB,gBAAGH,KAAK,CAACI,UAAU,CAG9C,SAASD,gBAAgBA,CAAAE,IAAA,EAAsBC,GAAG,EAAE;EAAA,IAAxBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAKC,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAC3C,IAAMC,aAAa,GAAGT,sBAAsB,CAACK,KAAK,IAAI,IAAI,CAAC;EAE3D,oBACEP,KAAA,CAAAY,aAAA,CAACX,YAAY,EAAAY,QAAA,KAAKL,KAAK;IAAEF,GAAG,EAAEA;EAAI,iBAChCN,KAAA,CAAAY,aAAA;IACEE,SAAS,EAAC,YAAY;IACtBC,uBAAuB,EAAE;MAAEC,MAAM,EAAEL;IAAc,CAAE;IACnDM,eAAe,EAAE;EAAM,CACxB,CACW,CAAC;AAEnB,CAAC,CAAC;AAEFd,gBAAgB,CAACe,WAAW,GAAG,kBAAkB"}
|
|
1
|
+
{"version":3,"file":"TextEditorOutput.js","names":["React","StyledEditor","sanitizeTextEditorHtml","TextEditorOutput","forwardRef","_ref","ref","value","props","_objectWithoutProperties","_excluded","sanitizedHtml","createElement","_extends","className","dangerouslySetInnerHTML","__html","contentEditable","displayName"],"sources":["../../src/TextEditorOutput/TextEditorOutput.tsx"],"sourcesContent":["import React from 'react'\n\nimport { StyledEditor } from './TextEditorOutput.styles'\nimport type { TextEditorOutputProps } from './TextEditorOutput.types'\nimport { sanitizeTextEditorHtml } from './TextEditorOutput.utils'\n\n/**\n * Render formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\nexport const TextEditorOutput = React.forwardRef<\n HTMLDivElement,\n TextEditorOutputProps & React.HTMLAttributes<HTMLDivElement>\n>(function TextEditorOutput({ value, ...props }, ref) {\n const sanitizedHtml = sanitizeTextEditorHtml(value || '--')\n\n return (\n <StyledEditor {...props} ref={ref}>\n <div\n className=\"ck-content\"\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n contentEditable={false}\n />\n </StyledEditor>\n )\n})\n\nTextEditorOutput.displayName = 'TextEditorOutput'\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,2BAA2B;AAExD,SAASC,sBAAsB,QAAQ,0BAA0B;;AAEjE;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,gBAAgB,gBAAGH,KAAK,CAACI,UAAU,CAG9C,SAASD,gBAAgBA,CAAAE,IAAA,EAAsBC,GAAG,EAAE;EAAA,IAAxBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAKC,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAC3C,IAAMC,aAAa,GAAGT,sBAAsB,CAACK,KAAK,IAAI,IAAI,CAAC;EAE3D,oBACEP,KAAA,CAAAY,aAAA,CAACX,YAAY,EAAAY,QAAA,KAAKL,KAAK;IAAEF,GAAG,EAAEA;EAAI,iBAChCN,KAAA,CAAAY,aAAA;IACEE,SAAS,EAAC,YAAY;IACtBC,uBAAuB,EAAE;MAAEC,MAAM,EAAEL;IAAc,CAAE;IACnDM,eAAe,EAAE;EAAM,CACxB,CACW,CAAC;AAEnB,CAAC,CAAC;AAEFd,gBAAgB,CAACe,WAAW,GAAG,kBAAkB","ignoreList":[]}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "StyledEditor",
|
|
4
|
-
componentId: "text-editor-
|
|
5
|
-
})([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;overflow-x:auto;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;p{margin:0;}img{margin-left:auto;margin-right:auto;max-width:100%;height:auto;}figure.table{display:table;margin-top:0.9em;margin-bottom:0.9em;}figure.table table,table{width:100%;border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
|
|
4
|
+
componentId: "text-editor-1_2_0__sc-1oujb2g-0"
|
|
5
|
+
})([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;overflow-x:auto;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;p{margin:0;}img{margin-left:auto;margin-right:auto;max-width:100%;height:auto;}.image-style-align-left{float:left;margin-right:1.5em;}.image-style-align-right{float:right;margin-left:1.5em;}.image-style-side{float:right;margin-left:1.5em;max-width:50%;}.image-style-block-align-left{margin-left:0;margin-right:auto;}.image-style-block-align-right{margin-left:auto;margin-right:0;}figure.image{display:table;clear:both;margin:0 auto;&.image-style-align-left,&.image-style-align-right,&.image-style-side{clear:none;}&.image-style-align-left{margin:0 1.5em 0 0;}&.image-style-align-right,&.image-style-side{margin:0 0 0 1.5em;}&.image-style-block-align-left{margin-left:0;margin-right:auto;}&.image-style-block-align-right{margin-left:auto;margin-right:0;}}img.image-style-align-left,img.image-style-align-right,img.image-style-side{margin-left:0;margin-right:0;}img.image-style-align-left{margin-right:1.5em;}img.image-style-align-right,img.image-style-side{margin-left:1.5em;}figure.table{display:table;margin-top:0.9em;margin-bottom:0.9em;}figure.table table,table{width:100%;border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
|
|
6
6
|
//# sourceMappingURL=TextEditorOutput.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/TextEditorOutput/TextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-editor__top {\n height: 0 !important;\n }\n\n .ck-content {\n border: none !important;\n padding: 0 !important;\n overflow-x: auto;\n --ck-content-font-family: Inter, 'Noto Sans JP', 'Noto Sans KR',\n 'Noto Sans SC', 'Noto Sans TC', sans-serif;\n --ck-content-font-size: 14px;\n --ck-content-word-break: break-word;\n --ck-content-overflow-wrap: break-word;\n --ck-content-line-height: 1.4;\n\n p {\n margin: 0;\n }\n\n img {\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n height: auto;\n }\n\n figure.table {\n display: table;\n margin-top: 0.9em;\n margin-bottom: 0.9em;\n }\n\n figure.table table,\n table {\n width: 100%;\n border: 1px double #b3b3b3;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n text-align: left;\n }\n\n & > thead,\n & > tbody {\n & > tr > td,\n & > tr > th {\n border: 1px solid #bfbfbf;\n min-width: 2em;\n padding: 0.4em;\n }\n\n & > tr > th {\n background: rgba(0, 0, 0, 0.05);\n font-weight: 700;\n }\n }\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"TextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/TextEditorOutput/TextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-editor__top {\n height: 0 !important;\n }\n\n .ck-content {\n border: none !important;\n padding: 0 !important;\n overflow-x: auto;\n --ck-content-font-family: Inter, 'Noto Sans JP', 'Noto Sans KR',\n 'Noto Sans SC', 'Noto Sans TC', sans-serif;\n --ck-content-font-size: 14px;\n --ck-content-word-break: break-word;\n --ck-content-overflow-wrap: break-word;\n --ck-content-line-height: 1.4;\n\n p {\n margin: 0;\n }\n\n img {\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n height: auto;\n }\n\n .image-style-align-left {\n float: left;\n margin-right: 1.5em;\n }\n\n .image-style-align-right {\n float: right;\n margin-left: 1.5em;\n }\n\n .image-style-side {\n float: right;\n margin-left: 1.5em;\n max-width: 50%;\n }\n\n .image-style-block-align-left {\n margin-left: 0;\n margin-right: auto;\n }\n\n .image-style-block-align-right {\n margin-left: auto;\n margin-right: 0;\n }\n\n figure.image {\n display: table;\n clear: both;\n margin: 0 auto;\n\n &.image-style-align-left,\n &.image-style-align-right,\n &.image-style-side {\n clear: none;\n }\n\n &.image-style-align-left {\n margin: 0 1.5em 0 0;\n }\n\n &.image-style-align-right,\n &.image-style-side {\n margin: 0 0 0 1.5em;\n }\n\n &.image-style-block-align-left {\n margin-left: 0;\n margin-right: auto;\n }\n\n &.image-style-block-align-right {\n margin-left: auto;\n margin-right: 0;\n }\n }\n\n img.image-style-align-left,\n img.image-style-align-right,\n img.image-style-side {\n margin-left: 0;\n margin-right: 0;\n }\n\n img.image-style-align-left {\n margin-right: 1.5em;\n }\n\n img.image-style-align-right,\n img.image-style-side {\n margin-left: 1.5em;\n }\n\n figure.table {\n display: table;\n margin-top: 0.9em;\n margin-bottom: 0.9em;\n }\n\n figure.table table,\n table {\n width: 100%;\n border: 1px double #b3b3b3;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n text-align: left;\n }\n\n & > thead,\n & > tbody {\n & > tr > td,\n & > tr > th {\n border: 1px solid #bfbfbf;\n min-width: 2em;\n padding: 0.4em;\n }\n\n & > tr > th {\n background: rgba(0, 0, 0, 0.05);\n font-weight: 700;\n }\n }\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,uoDAqIrC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.types.js","names":[],"sources":["../../src/TextEditorOutput/TextEditorOutput.types.ts"],"sourcesContent":["export interface TextEditorOutputProps {\n /**\n * Formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\n value?: string\n\n /**\n * Additional classNames\n *\n * @since 10.24.0\n */\n className?: string\n\n /**\n * Additional CSS styles\n *\n * @since 10.24.0\n */\n style?: React.CSSProperties\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TextEditorOutput.types.js","names":[],"sources":["../../src/TextEditorOutput/TextEditorOutput.types.ts"],"sourcesContent":["export interface TextEditorOutputProps {\n /**\n * Formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\n value?: string\n\n /**\n * Additional classNames\n *\n * @since 10.24.0\n */\n className?: string\n\n /**\n * Additional CSS styles\n *\n * @since 10.24.0\n */\n style?: React.CSSProperties\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -35,7 +35,7 @@ var sanitizeSrcset = function sanitizeSrcset(srcset) {
|
|
|
35
35
|
var _candidate$split = candidate.split(/\s+/),
|
|
36
36
|
_candidate$split2 = _toArray(_candidate$split),
|
|
37
37
|
url = _candidate$split2[0],
|
|
38
|
-
descriptors = _candidate$split2.slice(1);
|
|
38
|
+
descriptors = _arrayLikeToArray(_candidate$split2).slice(1);
|
|
39
39
|
var canonicalUrl = canonicalizeTextEditorImageUrl(url);
|
|
40
40
|
if (!canonicalUrl || descriptors.some(function (descriptor) {
|
|
41
41
|
return !/^(?:\d+w|\d+(?:\.\d+)?x)$/.test(descriptor);
|