@atlaskit/link-create 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/ui/create-form/main.js +11 -6
- package/dist/cjs/ui/create-form/styled.js +13 -0
- package/dist/cjs/ui/error-boundary/error-boundary-base/index.js +56 -0
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/index.js +62 -0
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/styled.js +13 -0
- package/dist/cjs/ui/error-boundary/error-boundary-ui/index.js +41 -0
- package/dist/cjs/ui/error-boundary/error-boundary-ui/messages.js +20 -0
- package/dist/cjs/ui/error-boundary/index.js +18 -0
- package/dist/cjs/ui/main.js +17 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/create-form/main.js +11 -5
- package/dist/es2019/ui/create-form/styled.js +7 -0
- package/dist/es2019/ui/error-boundary/error-boundary-base/index.js +32 -0
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/index.js +52 -0
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/styled.js +7 -0
- package/dist/es2019/ui/error-boundary/error-boundary-ui/index.js +28 -0
- package/dist/es2019/ui/error-boundary/error-boundary-ui/messages.js +13 -0
- package/dist/es2019/ui/error-boundary/index.js +11 -0
- package/dist/es2019/ui/main.js +14 -7
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/create-form/main.js +11 -5
- package/dist/esm/ui/create-form/styled.js +5 -0
- package/dist/esm/ui/error-boundary/error-boundary-base/index.js +45 -0
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/index.js +54 -0
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/styled.js +5 -0
- package/dist/esm/ui/error-boundary/error-boundary-ui/index.js +32 -0
- package/dist/esm/ui/error-boundary/error-boundary-ui/messages.js +13 -0
- package/dist/esm/ui/error-boundary/index.js +10 -0
- package/dist/esm/ui/main.js +14 -7
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/create-form/main.d.ts +3 -1
- package/dist/types/ui/create-form/styled.d.ts +1 -0
- package/dist/types/ui/error-boundary/error-boundary-base/index.d.ts +18 -0
- package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/index.d.ts +4 -0
- package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/styled.d.ts +1 -0
- package/dist/types/ui/error-boundary/error-boundary-ui/index.d.ts +3 -0
- package/dist/types/ui/error-boundary/error-boundary-ui/messages.d.ts +13 -0
- package/dist/types/ui/error-boundary/index.d.ts +6 -0
- package/dist/types/ui/main.d.ts +3 -2
- package/package.json +6 -4
- package/report.api.md +7 -11
- package/tmp/api-report-tmp.d.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,17 +9,19 @@ exports.CreateForm = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
12
13
|
var _loadingButton = _interopRequireDefault(require("@atlaskit/button/loading-button"));
|
|
13
14
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
14
15
|
var _form = _interopRequireWildcard(require("@atlaskit/form"));
|
|
15
16
|
var _formContext = require("../../controllers/form-context");
|
|
17
|
+
var _styled = require("./styled");
|
|
16
18
|
var _utils = require("./utils");
|
|
17
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
21
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } /** @jsx jsx */
|
|
20
22
|
var withFormContext = function withFormContext(Component) {
|
|
21
23
|
return function (props) {
|
|
22
|
-
return
|
|
24
|
+
return (0, _react2.jsx)(_formContext.FormContextProvider, null, (0, _react2.jsx)(Component, props));
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
|
|
@@ -59,19 +61,22 @@ var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
|
|
|
59
61
|
return _ref2.apply(this, arguments);
|
|
60
62
|
};
|
|
61
63
|
}();
|
|
62
|
-
return
|
|
64
|
+
return (0, _react2.jsx)(_form.default, {
|
|
63
65
|
onSubmit: handleSubmit
|
|
64
66
|
}, function (_ref3) {
|
|
65
67
|
var submitting = _ref3.submitting,
|
|
66
68
|
formProps = _ref3.formProps;
|
|
67
|
-
return
|
|
69
|
+
return (0, _react2.jsx)("form", (0, _extends2.default)({}, formProps, {
|
|
68
70
|
name: "confluence-creation-form",
|
|
69
71
|
"data-testid": testId
|
|
70
|
-
|
|
72
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
73
|
+
,
|
|
74
|
+
css: _styled.formStyles
|
|
75
|
+
}), (0, _react2.jsx)(_form.FormSection, null, children), (0, _react2.jsx)(_form.FormFooter, null, (0, _react2.jsx)(_standardButton.default, {
|
|
71
76
|
appearance: "subtle",
|
|
72
77
|
onClick: onCancel,
|
|
73
78
|
testId: 'cancel-button'
|
|
74
|
-
}, "Cancel"),
|
|
79
|
+
}, "Cancel"), (0, _react2.jsx)(_loadingButton.default, {
|
|
75
80
|
appearance: "primary",
|
|
76
81
|
type: "submit",
|
|
77
82
|
isLoading: submitting,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.formStyles = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _templateObject;
|
|
11
|
+
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
12
|
+
var formStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
13
|
+
exports.formStyles = formStyles;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.BaseErrorBoundary = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
20
|
+
var BaseErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
21
|
+
(0, _inherits2.default)(BaseErrorBoundary, _Component);
|
|
22
|
+
var _super = _createSuper(BaseErrorBoundary);
|
|
23
|
+
function BaseErrorBoundary(props) {
|
|
24
|
+
var _this;
|
|
25
|
+
(0, _classCallCheck2.default)(this, BaseErrorBoundary);
|
|
26
|
+
_this = _super.call(this, props);
|
|
27
|
+
_this.state = {
|
|
28
|
+
hasError: false
|
|
29
|
+
};
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
(0, _createClass2.default)(BaseErrorBoundary, [{
|
|
33
|
+
key: "componentDidCatch",
|
|
34
|
+
value: function componentDidCatch(error, info) {
|
|
35
|
+
var onError = this.props.onError;
|
|
36
|
+
onError && onError(error, info);
|
|
37
|
+
this.setState({
|
|
38
|
+
hasError: true
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "render",
|
|
43
|
+
value: function render() {
|
|
44
|
+
var _this$props = this.props,
|
|
45
|
+
children = _this$props.children,
|
|
46
|
+
ErrorComponent = _this$props.ErrorComponent;
|
|
47
|
+
var hasError = this.state.hasError;
|
|
48
|
+
if (hasError && ErrorComponent) {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(ErrorComponent, null);
|
|
50
|
+
}
|
|
51
|
+
return children;
|
|
52
|
+
}
|
|
53
|
+
}]);
|
|
54
|
+
return BaseErrorBoundary;
|
|
55
|
+
}(_react.Component);
|
|
56
|
+
exports.BaseErrorBoundary = BaseErrorBoundary;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _styled = require("./styled");
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
|
|
11
|
+
var ErrorSVG = function ErrorSVG() {
|
|
12
|
+
return (0, _react.jsx)("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
viewBox: "0 0 82 110"
|
|
15
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
16
|
+
,
|
|
17
|
+
css: _styled.errorStyles
|
|
18
|
+
}, (0, _react.jsx)("defs", null, (0, _react.jsx)("linearGradient", {
|
|
19
|
+
id: "a",
|
|
20
|
+
x1: "81.992%",
|
|
21
|
+
x2: "-1.724%",
|
|
22
|
+
y1: "43.911%",
|
|
23
|
+
y2: "87.726%"
|
|
24
|
+
}, (0, _react.jsx)("stop", {
|
|
25
|
+
offset: "0%",
|
|
26
|
+
stopColor: "#FFD740"
|
|
27
|
+
}), (0, _react.jsx)("stop", {
|
|
28
|
+
offset: "100%",
|
|
29
|
+
stopColor: "#FFAB00"
|
|
30
|
+
}))), (0, _react.jsx)("g", {
|
|
31
|
+
fill: "none",
|
|
32
|
+
fillRule: "evenodd"
|
|
33
|
+
}, (0, _react.jsx)("path", {
|
|
34
|
+
fill: "url(#a)",
|
|
35
|
+
fillRule: "nonzero",
|
|
36
|
+
d: "M47.39 40.58l33.22 57.54a7.585 7.585 0 0 1-6.57 11.38H7.6a7.585 7.585 0 0 1-6.57-11.38l33.22-57.54a7.585 7.585 0 0 1 13.14 0z"
|
|
37
|
+
}), (0, _react.jsx)("path", {
|
|
38
|
+
fill: "#253858",
|
|
39
|
+
fillRule: "nonzero",
|
|
40
|
+
d: "M43.61 82.355l1.44-22.175a4.59 4.59 0 0 0-4.58-4.89 4.59 4.59 0 0 0-4.58 4.89l1.44 22.175a3.15 3.15 0 0 0 3.14 2.945 3.15 3.15 0 0 0 3.14-2.945zM35.69 94.125a4.765 4.765 0 0 0 5.195 4.79 4.84 4.84 0 0 0-.45-9.66 4.82 4.82 0 0 0-4.745 4.87z"
|
|
41
|
+
}), (0, _react.jsx)("path", {
|
|
42
|
+
fill: "#FFC400",
|
|
43
|
+
fillRule: "nonzero",
|
|
44
|
+
d: "M45.85 14.085L42.145.725a.305.305 0 0 0-.595.025L39.22 13.3l-2.9-.54a.305.305 0 0 0-.35.38l3.705 13.36a.305.305 0 0 0 .595 0l2.33-12.55 2.9.515a.305.305 0 0 0 .35-.38z"
|
|
45
|
+
}), (0, _react.jsx)("path", {
|
|
46
|
+
fill: "#FFAB00",
|
|
47
|
+
fillRule: "nonzero",
|
|
48
|
+
d: "M32.56 21.405l-5.44-4.275a.135.135 0 0 0-.205.165L29.68 23l-1.33.655a.135.135 0 0 0 0 .225l5.435 4.275a.135.135 0 0 0 .205-.165l-2.785-5.715 1.33-.645a.135.135 0 0 0 .025-.225z"
|
|
49
|
+
}), (0, _react.jsx)("path", {
|
|
50
|
+
stroke: "#344563",
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeWidth: "2",
|
|
53
|
+
d: "M57.575 18.8c-.585.795-5.5-2.8-6.08-2-.58.8 4.33 4.395 3.75 5.195-.58.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195-.585.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195"
|
|
54
|
+
}), (0, _react.jsx)("path", {
|
|
55
|
+
stroke: "#5E6C84",
|
|
56
|
+
strokeLinecap: "round",
|
|
57
|
+
strokeWidth: "2",
|
|
58
|
+
d: "M59.96 32.595c-.73.665-3.525-2.39-4.255-1.72-.73.67 2.065 3.725 1.335 4.39-.73.665-3.525-2.39-4.255-1.72-.34.31.08 1.135.555 2M22.4 32.5c.91.385 2.5-3.435 3.43-3.05.93.385-.695 4.2.215 4.585.91.385 2.5-3.435 3.43-3.05.425.18.305 1.095.145 2.065"
|
|
59
|
+
})));
|
|
60
|
+
};
|
|
61
|
+
var _default = ErrorSVG;
|
|
62
|
+
exports.default = _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.errorStyles = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _templateObject;
|
|
11
|
+
var WIDTH = 82;
|
|
12
|
+
var errorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
13
|
+
exports.errorStyles = errorStyles;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ErrorBoundaryUI = exports.CONTACT_SUPPORT_LINK = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
12
|
+
var _emptyState = _interopRequireDefault(require("@atlaskit/empty-state"));
|
|
13
|
+
var _errorSvg = _interopRequireDefault(require("./error-svg"));
|
|
14
|
+
var _messages = _interopRequireDefault(require("./messages"));
|
|
15
|
+
var CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
16
|
+
exports.CONTACT_SUPPORT_LINK = CONTACT_SUPPORT_LINK;
|
|
17
|
+
var ErrorBoundaryUI = function ErrorBoundaryUI() {
|
|
18
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_emptyState.default, {
|
|
20
|
+
maxImageWidth: 82,
|
|
21
|
+
testId: 'link-create-error-boundary-ui',
|
|
22
|
+
header: intl.formatMessage(_messages.default.heading),
|
|
23
|
+
description: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.default.description, {
|
|
24
|
+
values: {
|
|
25
|
+
a: function a(label) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
27
|
+
appearance: "link",
|
|
28
|
+
spacing: "none",
|
|
29
|
+
href: CONTACT_SUPPORT_LINK,
|
|
30
|
+
target: "_blank",
|
|
31
|
+
rel: "noopener noreferrer"
|
|
32
|
+
}, label);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})),
|
|
36
|
+
renderImage: function renderImage() {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_errorSvg.default, null);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.ErrorBoundaryUI = ErrorBoundaryUI;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var _default = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
heading: {
|
|
10
|
+
id: 'link-create.unknown-error.heading',
|
|
11
|
+
defaultMessage: 'Something went wrong',
|
|
12
|
+
description: 'Heading when an unknown error occurs'
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
id: 'link-create.unknown-error.description',
|
|
16
|
+
defaultMessage: '<a>Contact Support</a> if refreshing doesn’t fix things.',
|
|
17
|
+
description: 'Description when an unknown error occurs'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
exports.default = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ErrorBoundary = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _errorBoundaryBase = require("./error-boundary-base");
|
|
10
|
+
var _errorBoundaryUi = require("./error-boundary-ui");
|
|
11
|
+
var ErrorBoundary = function ErrorBoundary(_ref) {
|
|
12
|
+
var children = _ref.children;
|
|
13
|
+
// TODO: onError => Analytics
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement(_errorBoundaryBase.BaseErrorBoundary, {
|
|
15
|
+
ErrorComponent: _errorBoundaryUi.ErrorBoundaryUI
|
|
16
|
+
}, children);
|
|
17
|
+
};
|
|
18
|
+
exports.ErrorBoundary = ErrorBoundary;
|
package/dist/cjs/ui/main.js
CHANGED
|
@@ -4,15 +4,17 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default =
|
|
8
|
-
var _react = require("
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
9
10
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
10
11
|
var _callbackContext = require("../controllers/callback-context");
|
|
12
|
+
var _errorBoundary = require("./error-boundary");
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
15
|
/** @jsx jsx */
|
|
14
16
|
|
|
15
|
-
function
|
|
17
|
+
function ComposedLinkCreate(_ref) {
|
|
16
18
|
var plugins = _ref.plugins,
|
|
17
19
|
testId = _ref.testId,
|
|
18
20
|
groupKey = _ref.groupKey,
|
|
@@ -27,12 +29,18 @@ function LinkCreate(_ref) {
|
|
|
27
29
|
if (!chosenOne) {
|
|
28
30
|
throw new Error('Make sure you specified a valid entityKey');
|
|
29
31
|
}
|
|
30
|
-
return (0,
|
|
31
|
-
onClose: onCancel,
|
|
32
|
-
testId: testId
|
|
33
|
-
}, (0, _react.jsx)(_modalDialog.ModalHeader, null, (0, _react.jsx)(_modalDialog.ModalTitle, null, "Create New")), (0, _react.jsx)(_modalDialog.ModalBody, null, (0, _react.jsx)(_callbackContext.LinkCreateCallbackProvider, {
|
|
32
|
+
return (0, _react2.jsx)(_callbackContext.LinkCreateCallbackProvider, {
|
|
34
33
|
onCreate: onCreate,
|
|
35
34
|
onFailure: onFailure,
|
|
36
35
|
onCancel: onCancel
|
|
37
|
-
}, chosenOne.form)
|
|
38
|
-
}
|
|
36
|
+
}, chosenOne.form);
|
|
37
|
+
}
|
|
38
|
+
var LinkCreate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
39
|
+
return (0, _react2.jsx)(_modalDialog.ModalTransition, null, !!props.active && (0, _react2.jsx)(_modalDialog.default, {
|
|
40
|
+
onClose: props.onCancel,
|
|
41
|
+
testId: props.testId,
|
|
42
|
+
shouldScrollInViewport: true
|
|
43
|
+
}, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, "Create New")), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(ComposedLinkCreate, props)))));
|
|
44
|
+
});
|
|
45
|
+
var _default = LinkCreate;
|
|
46
|
+
exports.default = _default;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
4
6
|
import Button from '@atlaskit/button/standard-button';
|
|
5
7
|
import Form, { FormFooter, FormSection } from '@atlaskit/form';
|
|
6
8
|
import { FormContextProvider, useFormContext } from '../../controllers/form-context';
|
|
9
|
+
import { formStyles } from './styled';
|
|
7
10
|
import { validateFormData } from './utils';
|
|
8
|
-
const withFormContext = Component => props =>
|
|
11
|
+
const withFormContext = Component => props => jsx(FormContextProvider, null, jsx(Component, props));
|
|
9
12
|
const CreateFormWithoutContext = ({
|
|
10
13
|
children,
|
|
11
14
|
testId,
|
|
@@ -26,19 +29,22 @@ const CreateFormWithoutContext = ({
|
|
|
26
29
|
}
|
|
27
30
|
onSubmit(data);
|
|
28
31
|
};
|
|
29
|
-
return
|
|
32
|
+
return jsx(Form, {
|
|
30
33
|
onSubmit: handleSubmit
|
|
31
34
|
}, ({
|
|
32
35
|
submitting,
|
|
33
36
|
formProps
|
|
34
|
-
}) =>
|
|
37
|
+
}) => jsx("form", _extends({}, formProps, {
|
|
35
38
|
name: "confluence-creation-form",
|
|
36
39
|
"data-testid": testId
|
|
37
|
-
|
|
40
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
41
|
+
,
|
|
42
|
+
css: formStyles
|
|
43
|
+
}), jsx(FormSection, null, children), jsx(FormFooter, null, jsx(Button, {
|
|
38
44
|
appearance: "subtle",
|
|
39
45
|
onClick: onCancel,
|
|
40
46
|
testId: 'cancel-button'
|
|
41
|
-
}, "Cancel"),
|
|
47
|
+
}, "Cancel"), jsx(LoadingButton, {
|
|
42
48
|
appearance: "primary",
|
|
43
49
|
type: "submit",
|
|
44
50
|
isLoading: submitting,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
3
|
+
export class BaseErrorBoundary extends Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.state = {
|
|
7
|
+
hasError: false
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
componentDidCatch(error, info) {
|
|
11
|
+
const {
|
|
12
|
+
onError
|
|
13
|
+
} = this.props;
|
|
14
|
+
onError && onError(error, info);
|
|
15
|
+
this.setState({
|
|
16
|
+
hasError: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const {
|
|
21
|
+
children,
|
|
22
|
+
ErrorComponent
|
|
23
|
+
} = this.props;
|
|
24
|
+
const {
|
|
25
|
+
hasError
|
|
26
|
+
} = this.state;
|
|
27
|
+
if (hasError && ErrorComponent) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(ErrorComponent, null);
|
|
29
|
+
}
|
|
30
|
+
return children;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { errorStyles } from './styled';
|
|
4
|
+
const ErrorSVG = () => jsx("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 82 110"
|
|
7
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
8
|
+
,
|
|
9
|
+
css: errorStyles
|
|
10
|
+
}, jsx("defs", null, jsx("linearGradient", {
|
|
11
|
+
id: "a",
|
|
12
|
+
x1: "81.992%",
|
|
13
|
+
x2: "-1.724%",
|
|
14
|
+
y1: "43.911%",
|
|
15
|
+
y2: "87.726%"
|
|
16
|
+
}, jsx("stop", {
|
|
17
|
+
offset: "0%",
|
|
18
|
+
stopColor: "#FFD740"
|
|
19
|
+
}), jsx("stop", {
|
|
20
|
+
offset: "100%",
|
|
21
|
+
stopColor: "#FFAB00"
|
|
22
|
+
}))), jsx("g", {
|
|
23
|
+
fill: "none",
|
|
24
|
+
fillRule: "evenodd"
|
|
25
|
+
}, jsx("path", {
|
|
26
|
+
fill: "url(#a)",
|
|
27
|
+
fillRule: "nonzero",
|
|
28
|
+
d: "M47.39 40.58l33.22 57.54a7.585 7.585 0 0 1-6.57 11.38H7.6a7.585 7.585 0 0 1-6.57-11.38l33.22-57.54a7.585 7.585 0 0 1 13.14 0z"
|
|
29
|
+
}), jsx("path", {
|
|
30
|
+
fill: "#253858",
|
|
31
|
+
fillRule: "nonzero",
|
|
32
|
+
d: "M43.61 82.355l1.44-22.175a4.59 4.59 0 0 0-4.58-4.89 4.59 4.59 0 0 0-4.58 4.89l1.44 22.175a3.15 3.15 0 0 0 3.14 2.945 3.15 3.15 0 0 0 3.14-2.945zM35.69 94.125a4.765 4.765 0 0 0 5.195 4.79 4.84 4.84 0 0 0-.45-9.66 4.82 4.82 0 0 0-4.745 4.87z"
|
|
33
|
+
}), jsx("path", {
|
|
34
|
+
fill: "#FFC400",
|
|
35
|
+
fillRule: "nonzero",
|
|
36
|
+
d: "M45.85 14.085L42.145.725a.305.305 0 0 0-.595.025L39.22 13.3l-2.9-.54a.305.305 0 0 0-.35.38l3.705 13.36a.305.305 0 0 0 .595 0l2.33-12.55 2.9.515a.305.305 0 0 0 .35-.38z"
|
|
37
|
+
}), jsx("path", {
|
|
38
|
+
fill: "#FFAB00",
|
|
39
|
+
fillRule: "nonzero",
|
|
40
|
+
d: "M32.56 21.405l-5.44-4.275a.135.135 0 0 0-.205.165L29.68 23l-1.33.655a.135.135 0 0 0 0 .225l5.435 4.275a.135.135 0 0 0 .205-.165l-2.785-5.715 1.33-.645a.135.135 0 0 0 .025-.225z"
|
|
41
|
+
}), jsx("path", {
|
|
42
|
+
stroke: "#344563",
|
|
43
|
+
strokeLinecap: "round",
|
|
44
|
+
strokeWidth: "2",
|
|
45
|
+
d: "M57.575 18.8c-.585.795-5.5-2.8-6.08-2-.58.8 4.33 4.395 3.75 5.195-.58.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195-.585.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195"
|
|
46
|
+
}), jsx("path", {
|
|
47
|
+
stroke: "#5E6C84",
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeWidth: "2",
|
|
50
|
+
d: "M59.96 32.595c-.73.665-3.525-2.39-4.255-1.72-.73.67 2.065 3.725 1.335 4.39-.73.665-3.525-2.39-4.255-1.72-.34.31.08 1.135.555 2M22.4 32.5c.91.385 2.5-3.435 3.43-3.05.93.385-.695 4.2.215 4.585.91.385 2.5-3.435 3.43-3.05.425.18.305 1.095.145 2.065"
|
|
51
|
+
})));
|
|
52
|
+
export default ErrorSVG;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
|
+
import Button from '@atlaskit/button';
|
|
5
|
+
import EmptyState from '@atlaskit/empty-state';
|
|
6
|
+
import ErrorSVG from './error-svg';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
export const CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
9
|
+
export const ErrorBoundaryUI = () => {
|
|
10
|
+
const intl = useIntl();
|
|
11
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
12
|
+
maxImageWidth: 82,
|
|
13
|
+
testId: 'link-create-error-boundary-ui',
|
|
14
|
+
header: intl.formatMessage(messages.heading),
|
|
15
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.description, {
|
|
16
|
+
values: {
|
|
17
|
+
a: label => /*#__PURE__*/React.createElement(Button, {
|
|
18
|
+
appearance: "link",
|
|
19
|
+
spacing: "none",
|
|
20
|
+
href: CONTACT_SUPPORT_LINK,
|
|
21
|
+
target: "_blank",
|
|
22
|
+
rel: "noopener noreferrer"
|
|
23
|
+
}, label)
|
|
24
|
+
}
|
|
25
|
+
})),
|
|
26
|
+
renderImage: () => /*#__PURE__*/React.createElement(ErrorSVG, null)
|
|
27
|
+
});
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
heading: {
|
|
4
|
+
id: 'link-create.unknown-error.heading',
|
|
5
|
+
defaultMessage: 'Something went wrong',
|
|
6
|
+
description: 'Heading when an unknown error occurs'
|
|
7
|
+
},
|
|
8
|
+
description: {
|
|
9
|
+
id: 'link-create.unknown-error.description',
|
|
10
|
+
defaultMessage: '<a>Contact Support</a> if refreshing doesn’t fix things.',
|
|
11
|
+
description: 'Description when an unknown error occurs'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseErrorBoundary } from './error-boundary-base';
|
|
3
|
+
import { ErrorBoundaryUI } from './error-boundary-ui';
|
|
4
|
+
export const ErrorBoundary = ({
|
|
5
|
+
children
|
|
6
|
+
}) => {
|
|
7
|
+
// TODO: onError => Analytics
|
|
8
|
+
return /*#__PURE__*/React.createElement(BaseErrorBoundary, {
|
|
9
|
+
ErrorComponent: ErrorBoundaryUI
|
|
10
|
+
}, children);
|
|
11
|
+
};
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
import { memo } from 'react';
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import Modal, { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
5
|
import { LinkCreateCallbackProvider } from '../controllers/callback-context';
|
|
5
|
-
|
|
6
|
+
import { ErrorBoundary } from './error-boundary';
|
|
7
|
+
function ComposedLinkCreate({
|
|
6
8
|
plugins,
|
|
7
9
|
testId,
|
|
8
10
|
groupKey,
|
|
@@ -16,12 +18,17 @@ export default function LinkCreate({
|
|
|
16
18
|
if (!chosenOne) {
|
|
17
19
|
throw new Error('Make sure you specified a valid entityKey');
|
|
18
20
|
}
|
|
19
|
-
return jsx(
|
|
20
|
-
onClose: onCancel,
|
|
21
|
-
testId: testId
|
|
22
|
-
}, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(LinkCreateCallbackProvider, {
|
|
21
|
+
return jsx(LinkCreateCallbackProvider, {
|
|
23
22
|
onCreate: onCreate,
|
|
24
23
|
onFailure: onFailure,
|
|
25
24
|
onCancel: onCancel
|
|
26
|
-
}, chosenOne.form)
|
|
27
|
-
}
|
|
25
|
+
}, chosenOne.form);
|
|
26
|
+
}
|
|
27
|
+
const LinkCreate = /*#__PURE__*/memo(props => {
|
|
28
|
+
return jsx(ModalTransition, null, !!props.active && jsx(Modal, {
|
|
29
|
+
onClose: props.onCancel,
|
|
30
|
+
testId: props.testId,
|
|
31
|
+
shouldScrollInViewport: true
|
|
32
|
+
}, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(ComposedLinkCreate, props)))));
|
|
33
|
+
});
|
|
34
|
+
export default LinkCreate;
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,15 +2,18 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5
|
+
/** @jsx jsx */
|
|
5
6
|
import React from 'react';
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
6
8
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
7
9
|
import Button from '@atlaskit/button/standard-button';
|
|
8
10
|
import Form, { FormFooter, FormSection } from '@atlaskit/form';
|
|
9
11
|
import { FormContextProvider, useFormContext } from '../../controllers/form-context';
|
|
12
|
+
import { formStyles } from './styled';
|
|
10
13
|
import { validateFormData } from './utils';
|
|
11
14
|
var withFormContext = function withFormContext(Component) {
|
|
12
15
|
return function (props) {
|
|
13
|
-
return
|
|
16
|
+
return jsx(FormContextProvider, null, jsx(Component, props));
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
19
|
var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
|
|
@@ -50,19 +53,22 @@ var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
|
|
|
50
53
|
return _ref2.apply(this, arguments);
|
|
51
54
|
};
|
|
52
55
|
}();
|
|
53
|
-
return
|
|
56
|
+
return jsx(Form, {
|
|
54
57
|
onSubmit: handleSubmit
|
|
55
58
|
}, function (_ref3) {
|
|
56
59
|
var submitting = _ref3.submitting,
|
|
57
60
|
formProps = _ref3.formProps;
|
|
58
|
-
return
|
|
61
|
+
return jsx("form", _extends({}, formProps, {
|
|
59
62
|
name: "confluence-creation-form",
|
|
60
63
|
"data-testid": testId
|
|
61
|
-
|
|
64
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
65
|
+
,
|
|
66
|
+
css: formStyles
|
|
67
|
+
}), jsx(FormSection, null, children), jsx(FormFooter, null, jsx(Button, {
|
|
62
68
|
appearance: "subtle",
|
|
63
69
|
onClick: onCancel,
|
|
64
70
|
testId: 'cancel-button'
|
|
65
|
-
}, "Cancel"),
|
|
71
|
+
}, "Cancel"), jsx(LoadingButton, {
|
|
66
72
|
appearance: "primary",
|
|
67
73
|
type: "submit",
|
|
68
74
|
isLoading: submitting,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
5
|
+
export var formStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
import React, { Component } from 'react';
|
|
9
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
10
|
+
export var BaseErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
11
|
+
_inherits(BaseErrorBoundary, _Component);
|
|
12
|
+
var _super = _createSuper(BaseErrorBoundary);
|
|
13
|
+
function BaseErrorBoundary(props) {
|
|
14
|
+
var _this;
|
|
15
|
+
_classCallCheck(this, BaseErrorBoundary);
|
|
16
|
+
_this = _super.call(this, props);
|
|
17
|
+
_this.state = {
|
|
18
|
+
hasError: false
|
|
19
|
+
};
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
_createClass(BaseErrorBoundary, [{
|
|
23
|
+
key: "componentDidCatch",
|
|
24
|
+
value: function componentDidCatch(error, info) {
|
|
25
|
+
var onError = this.props.onError;
|
|
26
|
+
onError && onError(error, info);
|
|
27
|
+
this.setState({
|
|
28
|
+
hasError: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "render",
|
|
33
|
+
value: function render() {
|
|
34
|
+
var _this$props = this.props,
|
|
35
|
+
children = _this$props.children,
|
|
36
|
+
ErrorComponent = _this$props.ErrorComponent;
|
|
37
|
+
var hasError = this.state.hasError;
|
|
38
|
+
if (hasError && ErrorComponent) {
|
|
39
|
+
return /*#__PURE__*/React.createElement(ErrorComponent, null);
|
|
40
|
+
}
|
|
41
|
+
return children;
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
return BaseErrorBoundary;
|
|
45
|
+
}(Component);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { errorStyles } from './styled';
|
|
4
|
+
var ErrorSVG = function ErrorSVG() {
|
|
5
|
+
return jsx("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 82 110"
|
|
8
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
9
|
+
,
|
|
10
|
+
css: errorStyles
|
|
11
|
+
}, jsx("defs", null, jsx("linearGradient", {
|
|
12
|
+
id: "a",
|
|
13
|
+
x1: "81.992%",
|
|
14
|
+
x2: "-1.724%",
|
|
15
|
+
y1: "43.911%",
|
|
16
|
+
y2: "87.726%"
|
|
17
|
+
}, jsx("stop", {
|
|
18
|
+
offset: "0%",
|
|
19
|
+
stopColor: "#FFD740"
|
|
20
|
+
}), jsx("stop", {
|
|
21
|
+
offset: "100%",
|
|
22
|
+
stopColor: "#FFAB00"
|
|
23
|
+
}))), jsx("g", {
|
|
24
|
+
fill: "none",
|
|
25
|
+
fillRule: "evenodd"
|
|
26
|
+
}, jsx("path", {
|
|
27
|
+
fill: "url(#a)",
|
|
28
|
+
fillRule: "nonzero",
|
|
29
|
+
d: "M47.39 40.58l33.22 57.54a7.585 7.585 0 0 1-6.57 11.38H7.6a7.585 7.585 0 0 1-6.57-11.38l33.22-57.54a7.585 7.585 0 0 1 13.14 0z"
|
|
30
|
+
}), jsx("path", {
|
|
31
|
+
fill: "#253858",
|
|
32
|
+
fillRule: "nonzero",
|
|
33
|
+
d: "M43.61 82.355l1.44-22.175a4.59 4.59 0 0 0-4.58-4.89 4.59 4.59 0 0 0-4.58 4.89l1.44 22.175a3.15 3.15 0 0 0 3.14 2.945 3.15 3.15 0 0 0 3.14-2.945zM35.69 94.125a4.765 4.765 0 0 0 5.195 4.79 4.84 4.84 0 0 0-.45-9.66 4.82 4.82 0 0 0-4.745 4.87z"
|
|
34
|
+
}), jsx("path", {
|
|
35
|
+
fill: "#FFC400",
|
|
36
|
+
fillRule: "nonzero",
|
|
37
|
+
d: "M45.85 14.085L42.145.725a.305.305 0 0 0-.595.025L39.22 13.3l-2.9-.54a.305.305 0 0 0-.35.38l3.705 13.36a.305.305 0 0 0 .595 0l2.33-12.55 2.9.515a.305.305 0 0 0 .35-.38z"
|
|
38
|
+
}), jsx("path", {
|
|
39
|
+
fill: "#FFAB00",
|
|
40
|
+
fillRule: "nonzero",
|
|
41
|
+
d: "M32.56 21.405l-5.44-4.275a.135.135 0 0 0-.205.165L29.68 23l-1.33.655a.135.135 0 0 0 0 .225l5.435 4.275a.135.135 0 0 0 .205-.165l-2.785-5.715 1.33-.645a.135.135 0 0 0 .025-.225z"
|
|
42
|
+
}), jsx("path", {
|
|
43
|
+
stroke: "#344563",
|
|
44
|
+
strokeLinecap: "round",
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
d: "M57.575 18.8c-.585.795-5.5-2.8-6.08-2-.58.8 4.33 4.395 3.75 5.195-.58.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195-.585.8-5.5-2.8-6.085-2-.585.8 4.33 4.395 3.745 5.195"
|
|
47
|
+
}), jsx("path", {
|
|
48
|
+
stroke: "#5E6C84",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeWidth: "2",
|
|
51
|
+
d: "M59.96 32.595c-.73.665-3.525-2.39-4.255-1.72-.73.67 2.065 3.725 1.335 4.39-.73.665-3.525-2.39-4.255-1.72-.34.31.08 1.135.555 2M22.4 32.5c.91.385 2.5-3.435 3.43-3.05.93.385-.695 4.2.215 4.585.91.385 2.5-3.435 3.43-3.05.425.18.305 1.095.145 2.065"
|
|
52
|
+
})));
|
|
53
|
+
};
|
|
54
|
+
export default ErrorSVG;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
var WIDTH = 82;
|
|
5
|
+
export var errorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
|
+
import Button from '@atlaskit/button';
|
|
5
|
+
import EmptyState from '@atlaskit/empty-state';
|
|
6
|
+
import ErrorSVG from './error-svg';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
export var CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
9
|
+
export var ErrorBoundaryUI = function ErrorBoundaryUI() {
|
|
10
|
+
var intl = useIntl();
|
|
11
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
12
|
+
maxImageWidth: 82,
|
|
13
|
+
testId: 'link-create-error-boundary-ui',
|
|
14
|
+
header: intl.formatMessage(messages.heading),
|
|
15
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.description, {
|
|
16
|
+
values: {
|
|
17
|
+
a: function a(label) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19
|
+
appearance: "link",
|
|
20
|
+
spacing: "none",
|
|
21
|
+
href: CONTACT_SUPPORT_LINK,
|
|
22
|
+
target: "_blank",
|
|
23
|
+
rel: "noopener noreferrer"
|
|
24
|
+
}, label);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
})),
|
|
28
|
+
renderImage: function renderImage() {
|
|
29
|
+
return /*#__PURE__*/React.createElement(ErrorSVG, null);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
heading: {
|
|
4
|
+
id: 'link-create.unknown-error.heading',
|
|
5
|
+
defaultMessage: 'Something went wrong',
|
|
6
|
+
description: 'Heading when an unknown error occurs'
|
|
7
|
+
},
|
|
8
|
+
description: {
|
|
9
|
+
id: 'link-create.unknown-error.description',
|
|
10
|
+
defaultMessage: '<a>Contact Support</a> if refreshing doesn’t fix things.',
|
|
11
|
+
description: 'Description when an unknown error occurs'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseErrorBoundary } from './error-boundary-base';
|
|
3
|
+
import { ErrorBoundaryUI } from './error-boundary-ui';
|
|
4
|
+
export var ErrorBoundary = function ErrorBoundary(_ref) {
|
|
5
|
+
var children = _ref.children;
|
|
6
|
+
// TODO: onError => Analytics
|
|
7
|
+
return /*#__PURE__*/React.createElement(BaseErrorBoundary, {
|
|
8
|
+
ErrorComponent: ErrorBoundaryUI
|
|
9
|
+
}, children);
|
|
10
|
+
};
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
import { memo } from 'react';
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import Modal, { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
5
|
import { LinkCreateCallbackProvider } from '../controllers/callback-context';
|
|
5
|
-
|
|
6
|
+
import { ErrorBoundary } from './error-boundary';
|
|
7
|
+
function ComposedLinkCreate(_ref) {
|
|
6
8
|
var plugins = _ref.plugins,
|
|
7
9
|
testId = _ref.testId,
|
|
8
10
|
groupKey = _ref.groupKey,
|
|
@@ -17,12 +19,17 @@ export default function LinkCreate(_ref) {
|
|
|
17
19
|
if (!chosenOne) {
|
|
18
20
|
throw new Error('Make sure you specified a valid entityKey');
|
|
19
21
|
}
|
|
20
|
-
return jsx(
|
|
21
|
-
onClose: onCancel,
|
|
22
|
-
testId: testId
|
|
23
|
-
}, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(LinkCreateCallbackProvider, {
|
|
22
|
+
return jsx(LinkCreateCallbackProvider, {
|
|
24
23
|
onCreate: onCreate,
|
|
25
24
|
onFailure: onFailure,
|
|
26
25
|
onCancel: onCancel
|
|
27
|
-
}, chosenOne.form)
|
|
28
|
-
}
|
|
26
|
+
}, chosenOne.form);
|
|
27
|
+
}
|
|
28
|
+
var LinkCreate = /*#__PURE__*/memo(function (props) {
|
|
29
|
+
return jsx(ModalTransition, null, !!props.active && jsx(Modal, {
|
|
30
|
+
onClose: props.onCancel,
|
|
31
|
+
testId: props.testId,
|
|
32
|
+
shouldScrollInViewport: true
|
|
33
|
+
}, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(ComposedLinkCreate, props)))));
|
|
34
|
+
});
|
|
35
|
+
export default LinkCreate;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
export interface CreateFormProps {
|
|
3
5
|
children: ReactNode;
|
|
4
6
|
testId?: string;
|
|
5
7
|
onCancel?: () => void;
|
|
6
8
|
onSubmit: (data: Record<string, unknown>) => void;
|
|
7
9
|
}
|
|
8
|
-
export declare const CreateForm: (props: any) => JSX.Element;
|
|
10
|
+
export declare const CreateForm: (props: any) => jsx.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { Component, ReactNode } from 'react';
|
|
2
|
+
export declare type ErrorBoundaryErrorInfo = {
|
|
3
|
+
componentStack: string;
|
|
4
|
+
};
|
|
5
|
+
declare type BaseErrorBoundaryState = {
|
|
6
|
+
hasError: boolean;
|
|
7
|
+
};
|
|
8
|
+
interface BaseErrorBoundaryProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
ErrorComponent?: React.ComponentType;
|
|
11
|
+
onError?: (error: Error, info?: ErrorBoundaryErrorInfo) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class BaseErrorBoundary extends Component<BaseErrorBoundaryProps, BaseErrorBoundaryState> {
|
|
14
|
+
constructor(props: BaseErrorBoundaryProps);
|
|
15
|
+
componentDidCatch(error: Error, info?: ErrorBoundaryErrorInfo): void;
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const errorStyles: import("@emotion/react").SerializedStyles;
|
package/dist/types/ui/main.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { LinkCreateProps } from './types';
|
|
4
|
-
|
|
4
|
+
declare const LinkCreate: import("react").MemoExoticComponent<(props: LinkCreateProps) => jsx.JSX.Element>;
|
|
5
|
+
export default LinkCreate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/button": "^16.6.0",
|
|
30
|
-
"@atlaskit/
|
|
30
|
+
"@atlaskit/empty-state": "^7.4.0",
|
|
31
|
+
"@atlaskit/form": "^8.8.4",
|
|
31
32
|
"@atlaskit/modal-dialog": "^12.4.4",
|
|
32
33
|
"@atlaskit/select": "^16.1.5",
|
|
33
34
|
"@atlaskit/textfield": "^5.3.5",
|
|
35
|
+
"@atlaskit/tokens": "^1.2.0",
|
|
34
36
|
"@babel/runtime": "^7.0.0",
|
|
35
37
|
"@emotion/react": "^11.7.1"
|
|
36
38
|
},
|
|
@@ -47,8 +49,8 @@
|
|
|
47
49
|
"@atlaskit/visual-regression": "*",
|
|
48
50
|
"@atlaskit/webdriver-runner": "*",
|
|
49
51
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
50
|
-
"@atlassian/link-create-confluence": "^
|
|
51
|
-
"@atlassian/link-create-presets": "^
|
|
52
|
+
"@atlassian/link-create-confluence": "^3.0.0",
|
|
53
|
+
"@atlassian/link-create-presets": "^2.0.0",
|
|
52
54
|
"@atlassian/link-picker-plugins": "^18.1.0",
|
|
53
55
|
"@atlassian/recent-work-client": "^1.7.0",
|
|
54
56
|
"@atlassian/search-client": "^0.5.0",
|
package/report.api.md
CHANGED
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
<!--SECTION START: Main Entry Types-->
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
+
/// <reference types="react" />
|
|
19
|
+
|
|
18
20
|
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
19
21
|
import { jsx } from '@emotion/react';
|
|
22
|
+
import { MemoExoticComponent } from 'react';
|
|
20
23
|
import { OptionType } from '@atlaskit/select';
|
|
21
24
|
import { default as React_2 } from 'react';
|
|
22
25
|
import { ReactNode } from 'react';
|
|
@@ -43,7 +46,7 @@ type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
// @public (undocumented)
|
|
46
|
-
export const CreateForm: (props: any) => JSX.Element;
|
|
49
|
+
export const CreateForm: (props: any) => jsx.JSX.Element;
|
|
47
50
|
|
|
48
51
|
// @public (undocumented)
|
|
49
52
|
export interface CreateFormProps {
|
|
@@ -76,16 +79,9 @@ interface Group {
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
// @public (undocumented)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
groupKey,
|
|
83
|
-
entityKey,
|
|
84
|
-
onCreate,
|
|
85
|
-
onFailure,
|
|
86
|
-
onCancel,
|
|
87
|
-
active,
|
|
88
|
-
}: LinkCreateProps): jsx.JSX.Element;
|
|
82
|
+
const LinkCreate: MemoExoticComponent<
|
|
83
|
+
(props: LinkCreateProps) => jsx.JSX.Element
|
|
84
|
+
>;
|
|
89
85
|
export default LinkCreate;
|
|
90
86
|
|
|
91
87
|
// @public (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
7
9
|
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
8
10
|
import { jsx } from '@emotion/react';
|
|
11
|
+
import { MemoExoticComponent } from 'react';
|
|
9
12
|
import { OptionType } from '@atlaskit/select';
|
|
10
13
|
import { default as React_2 } from 'react';
|
|
11
14
|
import { ReactNode } from 'react';
|
|
@@ -24,7 +27,7 @@ type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
// @public (undocumented)
|
|
27
|
-
export const CreateForm: (props: any) => JSX.Element;
|
|
30
|
+
export const CreateForm: (props: any) => jsx.JSX.Element;
|
|
28
31
|
|
|
29
32
|
// @public (undocumented)
|
|
30
33
|
export interface CreateFormProps {
|
|
@@ -57,7 +60,7 @@ interface Group {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
// @public (undocumented)
|
|
60
|
-
|
|
63
|
+
const LinkCreate: MemoExoticComponent<(props: LinkCreateProps) => jsx.JSX.Element>;
|
|
61
64
|
export default LinkCreate;
|
|
62
65
|
|
|
63
66
|
// @public (undocumented)
|