@atlaskit/link-create 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/analytics.spec.yaml +85 -0
  3. package/dist/cjs/common/constants.js +10 -0
  4. package/dist/cjs/common/utils/analytics/analytics.codegen.js +27 -0
  5. package/dist/cjs/common/utils/analytics/context.js +103 -0
  6. package/dist/cjs/common/utils/analytics/index.js +18 -0
  7. package/dist/cjs/controllers/callback-context/main.js +17 -3
  8. package/dist/cjs/ui/create-form/main.js +29 -14
  9. package/dist/cjs/ui/create-form/styled.js +13 -0
  10. package/dist/cjs/ui/error-boundary/error-boundary-base/index.js +56 -0
  11. package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/index.js +62 -0
  12. package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/styled.js +13 -0
  13. package/dist/cjs/ui/error-boundary/error-boundary-ui/index.js +41 -0
  14. package/dist/cjs/ui/error-boundary/error-boundary-ui/messages.js +20 -0
  15. package/dist/cjs/ui/error-boundary/index.js +38 -0
  16. package/dist/cjs/ui/main.js +58 -14
  17. package/dist/cjs/version.json +1 -1
  18. package/dist/es2019/common/constants.js +2 -0
  19. package/dist/es2019/common/utils/analytics/analytics.codegen.js +20 -0
  20. package/dist/es2019/common/utils/analytics/context.js +86 -0
  21. package/dist/es2019/common/utils/analytics/index.js +1 -0
  22. package/dist/es2019/controllers/callback-context/main.js +18 -2
  23. package/dist/es2019/ui/create-form/main.js +26 -9
  24. package/dist/es2019/ui/create-form/styled.js +7 -0
  25. package/dist/es2019/ui/error-boundary/error-boundary-base/index.js +32 -0
  26. package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/index.js +52 -0
  27. package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/styled.js +7 -0
  28. package/dist/es2019/ui/error-boundary/error-boundary-ui/index.js +28 -0
  29. package/dist/es2019/ui/error-boundary/error-boundary-ui/messages.js +13 -0
  30. package/dist/es2019/ui/error-boundary/index.js +29 -0
  31. package/dist/es2019/ui/main.js +57 -13
  32. package/dist/es2019/version.json +1 -1
  33. package/dist/esm/common/constants.js +2 -0
  34. package/dist/esm/common/utils/analytics/analytics.codegen.js +20 -0
  35. package/dist/esm/common/utils/analytics/context.js +91 -0
  36. package/dist/esm/common/utils/analytics/index.js +1 -0
  37. package/dist/esm/controllers/callback-context/main.js +16 -3
  38. package/dist/esm/ui/create-form/main.js +29 -13
  39. package/dist/esm/ui/create-form/styled.js +5 -0
  40. package/dist/esm/ui/error-boundary/error-boundary-base/index.js +45 -0
  41. package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/index.js +54 -0
  42. package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/styled.js +5 -0
  43. package/dist/esm/ui/error-boundary/error-boundary-ui/index.js +32 -0
  44. package/dist/esm/ui/error-boundary/error-boundary-ui/messages.js +13 -0
  45. package/dist/esm/ui/error-boundary/index.js +27 -0
  46. package/dist/esm/ui/main.js +53 -12
  47. package/dist/esm/version.json +1 -1
  48. package/dist/types/common/constants.d.ts +2 -0
  49. package/dist/types/common/types.d.ts +80 -0
  50. package/dist/types/common/utils/analytics/analytics.codegen.d.ts +48 -0
  51. package/dist/types/common/utils/analytics/context.d.ts +29 -0
  52. package/dist/types/common/utils/analytics/index.d.ts +1 -0
  53. package/dist/types/controllers/callback-context/main.d.ts +5 -1
  54. package/dist/types/index.d.ts +2 -2
  55. package/dist/types/ui/create-form/main.d.ts +3 -1
  56. package/dist/types/ui/create-form/styled.d.ts +1 -0
  57. package/dist/types/ui/error-boundary/error-boundary-base/index.d.ts +18 -0
  58. package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/index.d.ts +4 -0
  59. package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/styled.d.ts +1 -0
  60. package/dist/types/ui/error-boundary/error-boundary-ui/index.d.ts +3 -0
  61. package/dist/types/ui/error-boundary/error-boundary-ui/messages.d.ts +13 -0
  62. package/dist/types/ui/error-boundary/index.d.ts +2 -0
  63. package/dist/types/ui/group-selection/types.d.ts +1 -14
  64. package/dist/types/ui/main.d.ts +6 -3
  65. package/dist/types/ui/types.d.ts +0 -61
  66. package/package.json +12 -5
  67. package/report.api.md +16 -15
  68. package/tmp/api-report-tmp.d.ts +14 -6
@@ -1,27 +1,71 @@
1
1
  /** @jsx jsx */
2
+ import { memo, useCallback } from 'react';
2
3
  import { jsx } from '@emotion/react';
4
+ import { AnalyticsContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
3
5
  import Modal, { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
6
+ import { ANALYTICS_CHANNEL, COMPONENT_NAME } from '../common/constants';
7
+ import { withLinkCreateAnalyticsContext } from '../common/utils/analytics';
8
+ import createEventPayload from '../common/utils/analytics/analytics.codegen';
4
9
  import { LinkCreateCallbackProvider } from '../controllers/callback-context';
5
- export default function LinkCreate({
10
+ import { name as packageName, version as packageVersion } from '../version.json';
11
+ import { ErrorBoundary } from './error-boundary';
12
+ const LinkCreate = ({
6
13
  plugins,
7
- testId,
8
- groupKey,
9
14
  entityKey,
10
15
  onCreate,
11
16
  onFailure,
12
- onCancel,
13
- active
14
- }) {
17
+ onCancel
18
+ }) => {
15
19
  const chosenOne = plugins.find(plugin => plugin.key === entityKey);
16
20
  if (!chosenOne) {
17
21
  throw new Error('Make sure you specified a valid entityKey');
18
22
  }
19
- return jsx(ModalTransition, null, !!active && jsx(Modal, {
20
- onClose: onCancel,
21
- testId: testId
22
- }, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(LinkCreateCallbackProvider, {
23
- onCreate: onCreate,
23
+ const handleCreate = useCallback(result => {
24
+ onCreate && onCreate(result.url);
25
+ }, [onCreate]);
26
+ return jsx(LinkCreateCallbackProvider, {
27
+ onCreate: handleCreate,
24
28
  onFailure: onFailure,
25
29
  onCancel: onCancel
26
- }, chosenOne.form))));
27
- }
30
+ }, chosenOne.form);
31
+ };
32
+ const LinkCreateWithModal = props => {
33
+ const {
34
+ testId,
35
+ onCancel,
36
+ active
37
+ } = props;
38
+ const {
39
+ createAnalyticsEvent
40
+ } = useAnalyticsEvents();
41
+ const handleOpenComplete = useCallback(() => {
42
+ createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.viewed', {})).fire(ANALYTICS_CHANNEL);
43
+ }, [createAnalyticsEvent]);
44
+ const handleCloseComplete = useCallback(() => {
45
+ createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.closed', {})).fire(ANALYTICS_CHANNEL);
46
+ }, [createAnalyticsEvent]);
47
+ return jsx(ModalTransition, null, !!active && jsx(Modal, {
48
+ onClose: onCancel,
49
+ testId: testId,
50
+ shouldScrollInViewport: true,
51
+ onOpenComplete: handleOpenComplete,
52
+ onCloseComplete: handleCloseComplete
53
+ }, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(LinkCreate, props)))));
54
+ };
55
+ const LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(({
56
+ ...props
57
+ }) => {
58
+ return jsx(LinkCreateWithModal, props);
59
+ }));
60
+ export const PACKAGE_DATA = {
61
+ packageName,
62
+ packageVersion,
63
+ componentName: COMPONENT_NAME,
64
+ source: COMPONENT_NAME
65
+ };
66
+ const ComposedLinkCreate = /*#__PURE__*/memo(props => {
67
+ return jsx(AnalyticsContext, {
68
+ data: PACKAGE_DATA
69
+ }, jsx(LinkCreateWithAnalyticsContext, props));
70
+ });
71
+ export default ComposedLinkCreate;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,2 @@
1
+ export var ANALYTICS_CHANNEL = 'media';
2
+ export var COMPONENT_NAME = 'linkCreate';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generates Typescript types for analytics events from analytics.spec.yaml
5
+ *
6
+ * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
7
+ * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
+ */
9
+
10
+ function createEventPayload(eventKey, attributes) {
11
+ var event = eventKey.split('.');
12
+ return {
13
+ eventType: event[0],
14
+ actionSubject: event[1],
15
+ action: event[2],
16
+ actionSubjectId: event[3],
17
+ attributes: attributes
18
+ };
19
+ }
20
+ export default createEventPayload;
@@ -0,0 +1,91 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ import React, { useCallback, useContext, useMemo, useRef, useState } from 'react';
6
+ import { AnalyticsListener } from '@atlaskit/analytics-next';
7
+ import { ANALYTICS_CHANNEL } from '../../constants';
8
+ var UNKNOWN = 'unknown';
9
+ var DEFAULT_CONTEXT_ATTRIBUTES = {
10
+ triggeredFrom: UNKNOWN,
11
+ objectName: UNKNOWN,
12
+ appearance: 'modal'
13
+ };
14
+ var LinkCreateAnalyticsContext = /*#__PURE__*/React.createContext({
15
+ trackAttribute: function trackAttribute() {},
16
+ trackAttributes: function trackAttributes() {},
17
+ getAttributes: function getAttributes() {
18
+ return DEFAULT_CONTEXT_ATTRIBUTES;
19
+ }
20
+ });
21
+ var LinkCreateAnalytics = function LinkCreateAnalytics(_ref) {
22
+ var initialContext = _ref.initialContext,
23
+ children = _ref.children;
24
+ var dataRef = useRef(_objectSpread(_objectSpread({}, DEFAULT_CONTEXT_ATTRIBUTES), initialContext));
25
+ var methods = useMemo(function () {
26
+ return {
27
+ trackAttribute: function trackAttribute(key, value) {
28
+ dataRef.current[key] = value;
29
+ },
30
+ trackAttributes: function trackAttributes(attributes) {
31
+ dataRef.current = _objectSpread(_objectSpread({}, dataRef.current), attributes);
32
+ },
33
+ getAttributes: function getAttributes() {
34
+ return dataRef.current;
35
+ }
36
+ };
37
+ }, []);
38
+ return /*#__PURE__*/React.createElement(LinkCreateAnalyticsContext.Provider, {
39
+ value: methods
40
+ }, children);
41
+ };
42
+ var contextAttributesFromInitialProps = function contextAttributesFromInitialProps(props) {
43
+ return {
44
+ objectName: props.entityKey,
45
+ triggeredFrom: props.triggeredFrom
46
+ };
47
+ };
48
+
49
+ /**
50
+ * Hook that exposes the context-level attribute getters and setters.
51
+ */
52
+ export var useLinkCreateAnalytics = function useLinkCreateAnalytics() {
53
+ return useContext(LinkCreateAnalyticsContext);
54
+ };
55
+
56
+ /**
57
+ * Wrap component in "attributes" context store and initialise the initial context attributes from props.
58
+ */
59
+ function withLinkCreateAnalytics(WrappedComponent) {
60
+ return function (props) {
61
+ var _useState = useState(function () {
62
+ return contextAttributesFromInitialProps(props);
63
+ }),
64
+ _useState2 = _slicedToArray(_useState, 1),
65
+ initialContext = _useState2[0];
66
+ return /*#__PURE__*/React.createElement(LinkCreateAnalytics, {
67
+ initialContext: initialContext
68
+ }, /*#__PURE__*/React.createElement(WrappedComponent, props));
69
+ };
70
+ }
71
+
72
+ /**
73
+ * Wraps a component with the analytics context + listener to update events with contextual-level attributes.
74
+ * Should be implemented once at the root of the link create.
75
+ */
76
+ export function withLinkCreateAnalyticsContext(WrappedComponent) {
77
+ return withLinkCreateAnalytics(function (props) {
78
+ var _useLinkCreateAnalyti = useLinkCreateAnalytics(),
79
+ getAttributes = _useLinkCreateAnalyti.getAttributes;
80
+ var onEvent = useCallback(function (event) {
81
+ var _event$payload$attrib;
82
+ event.update({
83
+ attributes: _objectSpread(_objectSpread({}, getAttributes()), (_event$payload$attrib = event.payload.attributes) !== null && _event$payload$attrib !== void 0 ? _event$payload$attrib : {})
84
+ });
85
+ }, [getAttributes]);
86
+ return /*#__PURE__*/React.createElement(AnalyticsListener, {
87
+ channel: ANALYTICS_CHANNEL,
88
+ onEvent: onEvent
89
+ }, /*#__PURE__*/React.createElement(WrappedComponent, props));
90
+ });
91
+ }
@@ -0,0 +1 @@
1
+ export { useLinkCreateAnalytics, withLinkCreateAnalyticsContext } from './context';
@@ -1,17 +1,30 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
+ import { ANALYTICS_CHANNEL } from '../../common/constants';
4
+ import createEventPayload from '../../common/utils/analytics/analytics.codegen';
2
5
  var LinkCreateCallbackContext = /*#__PURE__*/React.createContext({});
3
6
  var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
4
7
  var children = _ref.children,
5
- onCreate = _ref.onCreate,
8
+ _onCreate = _ref.onCreate,
6
9
  onFailure = _ref.onFailure,
7
10
  onCancel = _ref.onCancel;
11
+ var _useAnalyticsEvents = useAnalyticsEvents(),
12
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
8
13
  var value = useMemo(function () {
9
14
  return {
10
- onCreate: onCreate,
15
+ onCreate: function onCreate(result) {
16
+ var objectId = result.objectId,
17
+ objectType = result.objectType;
18
+ createAnalyticsEvent(createEventPayload('track.object.created.linkCreate', {
19
+ objectId: objectId,
20
+ objectType: objectType
21
+ })).fire(ANALYTICS_CHANNEL);
22
+ _onCreate && _onCreate(result);
23
+ },
11
24
  onFailure: onFailure,
12
25
  onCancel: onCancel
13
26
  };
14
- }, [onCreate, onFailure, onCancel]);
27
+ }, [onFailure, onCancel, createAnalyticsEvent, _onCreate]);
15
28
  return /*#__PURE__*/React.createElement(LinkCreateCallbackContext.Provider, {
16
29
  value: value
17
30
  }, children);
@@ -2,15 +2,21 @@ 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
- import React from 'react';
5
+ /** @jsx jsx */
6
+ import React, { useCallback } from 'react';
7
+ import { jsx } from '@emotion/react';
8
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
9
  import LoadingButton from '@atlaskit/button/loading-button';
7
10
  import Button from '@atlaskit/button/standard-button';
8
11
  import Form, { FormFooter, FormSection } from '@atlaskit/form';
12
+ import { ANALYTICS_CHANNEL } from '../../common/constants';
13
+ import createEventPayload from '../../common/utils/analytics/analytics.codegen';
9
14
  import { FormContextProvider, useFormContext } from '../../controllers/form-context';
15
+ import { formStyles } from './styled';
10
16
  import { validateFormData } from './utils';
11
17
  var withFormContext = function withFormContext(Component) {
12
18
  return function (props) {
13
- return /*#__PURE__*/React.createElement(FormContextProvider, null, /*#__PURE__*/React.createElement(Component, props));
19
+ return jsx(FormContextProvider, null, jsx(Component, props));
14
20
  };
15
21
  };
16
22
  var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
@@ -18,51 +24,61 @@ var CreateFormWithoutContext = function CreateFormWithoutContext(_ref) {
18
24
  testId = _ref.testId,
19
25
  onCancel = _ref.onCancel,
20
26
  onSubmit = _ref.onSubmit;
27
+ var _useAnalyticsEvents = useAnalyticsEvents(),
28
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
21
29
  var _useFormContext = useFormContext(),
22
30
  getValidators = _useFormContext.getValidators;
23
- var handleSubmit = /*#__PURE__*/function () {
31
+ var handleSubmit = useCallback( /*#__PURE__*/function () {
24
32
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
25
33
  var validators, errors;
26
34
  return _regeneratorRuntime().wrap(function _callee$(_context) {
27
35
  while (1) {
28
36
  switch (_context.prev = _context.next) {
29
37
  case 0:
38
+ createAnalyticsEvent(createEventPayload('ui.button.clicked.create', {})).fire(ANALYTICS_CHANNEL);
30
39
  validators = getValidators();
31
40
  errors = validateFormData({
32
41
  data: data,
33
42
  validators: validators
34
43
  });
35
44
  if (!(Object.keys(errors).length !== 0)) {
36
- _context.next = 4;
45
+ _context.next = 5;
37
46
  break;
38
47
  }
39
48
  return _context.abrupt("return", errors);
40
- case 4:
41
- onSubmit(data);
42
49
  case 5:
50
+ onSubmit(data);
51
+ case 6:
43
52
  case "end":
44
53
  return _context.stop();
45
54
  }
46
55
  }
47
56
  }, _callee);
48
57
  }));
49
- return function handleSubmit(_x) {
58
+ return function (_x) {
50
59
  return _ref2.apply(this, arguments);
51
60
  };
52
- }();
53
- return /*#__PURE__*/React.createElement(Form, {
61
+ }(), [createAnalyticsEvent, getValidators, onSubmit]);
62
+ var handleCancel = useCallback(function () {
63
+ createAnalyticsEvent(createEventPayload('ui.button.clicked.cancel', {})).fire(ANALYTICS_CHANNEL);
64
+ onCancel && onCancel();
65
+ }, [createAnalyticsEvent, onCancel]);
66
+ return jsx(Form, {
54
67
  onSubmit: handleSubmit
55
68
  }, function (_ref3) {
56
69
  var submitting = _ref3.submitting,
57
70
  formProps = _ref3.formProps;
58
- return /*#__PURE__*/React.createElement("form", _extends({}, formProps, {
71
+ return jsx("form", _extends({}, formProps, {
59
72
  name: "confluence-creation-form",
60
73
  "data-testid": testId
61
- }), /*#__PURE__*/React.createElement(FormSection, null, children), /*#__PURE__*/React.createElement(FormFooter, null, /*#__PURE__*/React.createElement(Button, {
74
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
75
+ ,
76
+ css: formStyles
77
+ }), jsx(FormSection, null, children), jsx(FormFooter, null, jsx(Button, {
62
78
  appearance: "subtle",
63
- onClick: onCancel,
79
+ onClick: handleCancel,
64
80
  testId: 'cancel-button'
65
- }, "Cancel"), /*#__PURE__*/React.createElement(LoadingButton, {
81
+ }, "Cancel"), jsx(LoadingButton, {
66
82
  appearance: "primary",
67
83
  type: "submit",
68
84
  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,27 @@
1
+ import React, { useCallback } from 'react';
2
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
+ import { ANALYTICS_CHANNEL } from '../../common/constants';
4
+ import createEventPayload from '../../common/utils/analytics/analytics.codegen';
5
+ import { BaseErrorBoundary } from './error-boundary-base';
6
+ import { ErrorBoundaryUI } from './error-boundary-ui';
7
+ export var ErrorBoundary = function ErrorBoundary(_ref) {
8
+ var children = _ref.children;
9
+ var _useAnalyticsEvents = useAnalyticsEvents(),
10
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
11
+ var handleError = useCallback(function (error, info) {
12
+ var _window, _window$navigator, _info$componentStack;
13
+ // Fire Analytics event
14
+ createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', {
15
+ browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
16
+ error: error.toString(),
17
+ componentStack: (_info$componentStack = info === null || info === void 0 ? void 0 : info.componentStack) !== null && _info$componentStack !== void 0 ? _info$componentStack : ''
18
+ })).fire(ANALYTICS_CHANNEL);
19
+
20
+ // Fire UFO failed experience
21
+ // failUfoExperience(ufoExperience.mounted);
22
+ }, [createAnalyticsEvent]);
23
+ return /*#__PURE__*/React.createElement(BaseErrorBoundary, {
24
+ onError: handleError,
25
+ ErrorComponent: ErrorBoundaryUI
26
+ }, children);
27
+ };
@@ -1,28 +1,69 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
3
+ import { memo, useCallback } from 'react';
2
4
  import { jsx } from '@emotion/react';
5
+ import { AnalyticsContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
3
6
  import Modal, { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
7
+ import { ANALYTICS_CHANNEL, COMPONENT_NAME } from '../common/constants';
8
+ import { withLinkCreateAnalyticsContext } from '../common/utils/analytics';
9
+ import createEventPayload from '../common/utils/analytics/analytics.codegen';
4
10
  import { LinkCreateCallbackProvider } from '../controllers/callback-context';
5
- export default function LinkCreate(_ref) {
11
+ import { name as packageName, version as packageVersion } from '../version.json';
12
+ import { ErrorBoundary } from './error-boundary';
13
+ var LinkCreate = function LinkCreate(_ref) {
6
14
  var plugins = _ref.plugins,
7
- testId = _ref.testId,
8
- groupKey = _ref.groupKey,
9
15
  entityKey = _ref.entityKey,
10
16
  onCreate = _ref.onCreate,
11
17
  onFailure = _ref.onFailure,
12
- onCancel = _ref.onCancel,
13
- active = _ref.active;
18
+ onCancel = _ref.onCancel;
14
19
  var chosenOne = plugins.find(function (plugin) {
15
20
  return plugin.key === entityKey;
16
21
  });
17
22
  if (!chosenOne) {
18
23
  throw new Error('Make sure you specified a valid entityKey');
19
24
  }
20
- return jsx(ModalTransition, null, !!active && jsx(Modal, {
21
- onClose: onCancel,
22
- testId: testId
23
- }, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(LinkCreateCallbackProvider, {
24
- onCreate: onCreate,
25
+ var handleCreate = useCallback(function (result) {
26
+ onCreate && onCreate(result.url);
27
+ }, [onCreate]);
28
+ return jsx(LinkCreateCallbackProvider, {
29
+ onCreate: handleCreate,
25
30
  onFailure: onFailure,
26
31
  onCancel: onCancel
27
- }, chosenOne.form))));
28
- }
32
+ }, chosenOne.form);
33
+ };
34
+ var LinkCreateWithModal = function LinkCreateWithModal(props) {
35
+ var testId = props.testId,
36
+ onCancel = props.onCancel,
37
+ active = props.active;
38
+ var _useAnalyticsEvents = useAnalyticsEvents(),
39
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
40
+ var handleOpenComplete = useCallback(function () {
41
+ createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.viewed', {})).fire(ANALYTICS_CHANNEL);
42
+ }, [createAnalyticsEvent]);
43
+ var handleCloseComplete = useCallback(function () {
44
+ createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.closed', {})).fire(ANALYTICS_CHANNEL);
45
+ }, [createAnalyticsEvent]);
46
+ return jsx(ModalTransition, null, !!active && jsx(Modal, {
47
+ onClose: onCancel,
48
+ testId: testId,
49
+ shouldScrollInViewport: true,
50
+ onOpenComplete: handleOpenComplete,
51
+ onCloseComplete: handleCloseComplete
52
+ }, jsx(ModalHeader, null, jsx(ModalTitle, null, "Create New")), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(LinkCreate, props)))));
53
+ };
54
+ var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (_ref2) {
55
+ var props = _extends({}, _ref2);
56
+ return jsx(LinkCreateWithModal, props);
57
+ }));
58
+ export var PACKAGE_DATA = {
59
+ packageName: packageName,
60
+ packageVersion: packageVersion,
61
+ componentName: COMPONENT_NAME,
62
+ source: COMPONENT_NAME
63
+ };
64
+ var ComposedLinkCreate = /*#__PURE__*/memo(function (props) {
65
+ return jsx(AnalyticsContext, {
66
+ data: PACKAGE_DATA
67
+ }, jsx(LinkCreateWithAnalyticsContext, props));
68
+ });
69
+ export default ComposedLinkCreate;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "sideEffects": false
5
5
  }