@forge/react 10.3.0-next.1 → 10.4.0-experimental-03ab603

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 (45) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/__mocks__/@forge/bridge.js +4 -0
  3. package/out/__test__/components/inline-edit.test.d.ts +2 -0
  4. package/out/__test__/components/inline-edit.test.d.ts.map +1 -0
  5. package/out/__test__/components/inline-edit.test.js +88 -0
  6. package/out/__test__/createFrame.test.d.ts +2 -0
  7. package/out/__test__/createFrame.test.d.ts.map +1 -0
  8. package/out/__test__/createFrame.test.js +33 -0
  9. package/out/components/createFrame.d.ts +5 -0
  10. package/out/components/createFrame.d.ts.map +1 -0
  11. package/out/components/createFrame.js +56 -0
  12. package/out/components/index.d.ts +14 -7
  13. package/out/components/index.d.ts.map +1 -1
  14. package/out/components/index.js +13 -2
  15. package/out/components/inline-edit.d.ts +17 -0
  16. package/out/components/inline-edit.d.ts.map +1 -0
  17. package/out/components/inline-edit.js +89 -0
  18. package/out/components/popup.d.ts +3 -0
  19. package/out/components/popup.d.ts.map +1 -0
  20. package/out/components/popup.js +10 -0
  21. package/out/components/{uikit2-components.d.ts → ui-kit-components.d.ts} +6 -2
  22. package/out/components/ui-kit-components.d.ts.map +1 -0
  23. package/out/components/{uikit2-components.js → ui-kit-components.js} +6 -2
  24. package/out/components/utils/content-wrapper.d.ts +9 -0
  25. package/out/components/utils/content-wrapper.d.ts.map +1 -0
  26. package/out/components/utils/content-wrapper.js +8 -0
  27. package/out/types/components.d.ts +6 -5
  28. package/out/types/components.d.ts.map +1 -1
  29. package/out/types/effect.d.ts +1 -1
  30. package/out/types/effect.d.ts.map +1 -1
  31. package/out/types/effect.js +1 -1
  32. package/out/types/extension.d.ts +1 -1
  33. package/out/types/extension.d.ts.map +1 -1
  34. package/out/types/forge.d.ts +1 -0
  35. package/out/types/forge.d.ts.map +1 -1
  36. package/out/types/forge.js +2 -3
  37. package/out/types/icons.d.ts +1 -1
  38. package/out/types/icons.d.ts.map +1 -1
  39. package/out/types/index.d.ts.map +1 -1
  40. package/out/types/legacy-effect.d.ts +1 -1
  41. package/out/types/legacy-effect.d.ts.map +1 -1
  42. package/out/types/legacy-effect.js +1 -3
  43. package/package.json +3 -3
  44. package/tsconfig.tsbuildinfo +1 -1
  45. package/out/components/uikit2-components.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @forge/react
2
2
 
3
+ ## 10.4.0-experimental-03ab603
4
+
5
+ ### Minor Changes
6
+
7
+ - c2a41b1: Changes to existing components:
8
+
9
+ - `href` prop added to `Tag`
10
+ - `color` prop added to `Icon`
11
+
12
+ The following new components have been added:
13
+
14
+ - List
15
+ - CheckboxGroup
16
+ - Calendar
17
+ - TimePicker
18
+ - InlineEdit
19
+ - Popup
20
+ - EmptyState
21
+
22
+ For more details of these changes and new components, view our [component documentation](https://developer.atlassian.com/platform/forge/ui-kit/components/)
23
+
24
+ ## 10.4.0
25
+
26
+ ### Minor Changes
27
+
28
+ - d6ef7d4: Add createFrame helper to support React-like property passing in Frame component
29
+
30
+ For more information, see the [Frame component documentation](https://developer.atlassian.com/platform/forge/ui-kit/components/frame).
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [ef55008]
35
+ - @forge/bridge@3.5.0
36
+
37
+ ## 10.4.0-next.0
38
+
39
+ ### Minor Changes
40
+
41
+ - d6ef7d4: Add createFrame helper to support React-like property passing in Frame component
42
+
43
+ For more information, see the [Frame component documentation](https://developer.atlassian.com/platform/forge/ui-kit/components/frame).
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [ef55008]
48
+ - @forge/bridge@3.5.0-next.0
49
+
50
+ ## 10.3.0
51
+
52
+ ### Minor Changes
53
+
54
+ - 95b3ce0: Visualisation components have been added to the @forge/react package. This includes BarChart, HorizontalBarChart, StackBarChart, HorizontalStackBarChart, LineChart, PieChart and SingleValueChart. For more information see the [Visualisations Components documentation](https://developer.atlassian.com/platform/forge/ui-kit/components/#visualisation--eap-).
55
+
56
+ ### Patch Changes
57
+
58
+ - 028fcfc: Include JSComments to be included in the build output
59
+
3
60
  ## 10.3.0-next.1
4
61
 
5
62
  ### Minor Changes
@@ -0,0 +1,4 @@
1
+ // __mocks__/@forge/bridge.js
2
+ module.exports = {
3
+ events: {}
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=inline-edit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-edit.test.d.ts","sourceRoot":"","sources":["../../../src/__test__/components/inline-edit.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ const components_1 = require("../../components");
7
+ const reconcilerTestRenderer_1 = tslib_1.__importDefault(require("../reconcilerTestRenderer"));
8
+ const testUtils_1 = require("../testUtils");
9
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
10
+ describe('InlineEdit', () => {
11
+ let bridgeCalls = [];
12
+ const onConfirmMock = jest.fn();
13
+ const validateMock = jest.fn();
14
+ const onEditMock = jest.fn();
15
+ const onCancelMock = jest.fn();
16
+ const validation = (value) => {
17
+ validateMock(value);
18
+ if (value.length < 3) {
19
+ return 'Value must be at least 3 characters long';
20
+ }
21
+ return undefined;
22
+ };
23
+ beforeEach(async () => {
24
+ bridgeCalls = (0, testUtils_1.setupBridge)();
25
+ const Test = () => {
26
+ const [editValue, setEditValue] = (0, react_1.useState)('test');
27
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(components_1.InlineEdit, { onEdit: onEditMock, onCancel: onCancelMock, validate: validation, editView: ({ errorMessage, value, ...fieldProps }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Textfield, { value: value, ...fieldProps }), (0, jsx_runtime_1.jsx)(components_1.Text, { children: errorMessage })] })), readView: () => (0, jsx_runtime_1.jsx)(components_1.Text, { children: editValue }), defaultValue: editValue, onConfirm: (value) => {
28
+ onConfirmMock(value);
29
+ setEditValue(value);
30
+ } }) }));
31
+ };
32
+ await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
33
+ });
34
+ it('readView and editView is passed in the forgeDoc', () => {
35
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
36
+ const editViewComponent = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[0].type');
37
+ const readViewText = (0, get_1.default)(forgeDoc, 'children[0].children[1].children[0].children[0].props.text');
38
+ expect(editViewComponent).toBe('Textfield');
39
+ expect(readViewText).toBe('test');
40
+ });
41
+ it('onConfirm is called with the correct value', () => {
42
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
43
+ const onConfirm = (0, get_1.default)(forgeDoc, 'children[0].props.onConfirm');
44
+ onConfirm();
45
+ expect(onConfirmMock).toHaveBeenCalledWith('test');
46
+ expect(validateMock).toHaveBeenCalledWith('test');
47
+ });
48
+ it('onChange triggers validation', () => {
49
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
50
+ const onChange = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[0].props.onChange');
51
+ onChange('value change');
52
+ expect(validateMock).toHaveBeenCalledWith('value change');
53
+ });
54
+ it('validation is called and fails', () => {
55
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
56
+ const onChange = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[0].props.onChange');
57
+ onChange('f');
58
+ const errorText = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[1].children[0].props.text');
59
+ expect(errorText).toBe('Value must be at least 3 characters long');
60
+ });
61
+ it('clears errorMessage and switches to edit mode when onEdit is called', () => {
62
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
63
+ const onEdit = (0, get_1.default)(forgeDoc, 'children[0].props.onEdit');
64
+ onEdit();
65
+ const errorText = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[1].children[0].props.text');
66
+ expect(errorText).toBe(undefined);
67
+ const isEditing = (0, get_1.default)(forgeDoc, 'children[0].props.isEditing');
68
+ expect(isEditing).toBe(true);
69
+ });
70
+ it('switches back to read mode when onCancel is called', () => {
71
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
72
+ const onEdit = (0, get_1.default)(forgeDoc, 'children[0].props.onEdit');
73
+ onEdit();
74
+ let isEditing = (0, get_1.default)(forgeDoc, 'children[0].props.isEditing');
75
+ expect(isEditing).toBe(true);
76
+ // Text update
77
+ const onChange = (0, get_1.default)(forgeDoc, 'children[0].children[0].children[0].props.onChange');
78
+ onChange('value change');
79
+ // Cancel is called
80
+ const onCancel = (0, get_1.default)(forgeDoc, 'children[0].props.onCancel');
81
+ onCancel();
82
+ isEditing = (0, get_1.default)(forgeDoc, 'children[0].props.isEditing');
83
+ expect(isEditing).toBe(false);
84
+ // Text should revert to previous value
85
+ const valueText = (0, get_1.default)(forgeDoc, 'children[0].children[1].children[0].children[0].props.text');
86
+ expect(valueText).toBe('test');
87
+ });
88
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createFrame.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFrame.test.d.ts","sourceRoot":"","sources":["../../src/__test__/createFrame.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ jest.mock('@forge/bridge', () => ({
6
+ events: {
7
+ emit: jest.fn(),
8
+ on: jest.fn()
9
+ }
10
+ }));
11
+ const react_1 = tslib_1.__importDefault(require("react"));
12
+ const components_1 = require("../components");
13
+ const reconcilerTestRenderer_1 = tslib_1.__importDefault(require("./reconcilerTestRenderer"));
14
+ const testUtils_1 = require("./testUtils");
15
+ describe('createFrame', () => {
16
+ let bridgeCalls = [];
17
+ beforeAll(async () => {
18
+ bridgeCalls = (0, testUtils_1.setupBridge)();
19
+ });
20
+ it('renders correct Frame ForgeDoc', async () => {
21
+ const TestFrame = (0, components_1.createFrame)('test-frame');
22
+ const Test = () => {
23
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(TestFrame, { propA: "hello" }) }));
24
+ };
25
+ await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
26
+ const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
27
+ expect(forgeDoc).toHaveProperty('type', 'Root');
28
+ expect(forgeDoc).toHaveProperty('children[0].type', 'Frame');
29
+ expect(forgeDoc).toHaveProperty('children[0].props.resource', 'test-frame');
30
+ expect(forgeDoc).toHaveProperty('children[0].props.frameId', expect.any(String));
31
+ expect(forgeDoc).not.toHaveProperty('children[0].props.propA', expect.any(String));
32
+ });
33
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare type TArePropsEqual<TFrameProps extends Record<string, unknown>> = (prevProps: TFrameProps, nextProps: TFrameProps) => boolean;
3
+ declare const createFrame: <TFrameProps extends Record<string, unknown>>(resource: string, arePropsEqual?: TArePropsEqual<TFrameProps>) => React.FC<TFrameProps>;
4
+ export { createFrame };
5
+ //# sourceMappingURL=createFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFrame.d.ts","sourceRoot":"","sources":["../../src/components/createFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAYjD,aAAK,cAAc,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CACjE,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,WAAW,KACnB,OAAO,CAAC;AA2Bb,QAAA,MAAM,WAAW,0DACL,MAAM,uEA4BjB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createFrame = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const uuid_1 = require("uuid");
7
+ const bridge_1 = require("@forge/bridge");
8
+ const _1 = require(".");
9
+ const useFrameId = () => {
10
+ const frameId = (0, react_1.useRef)((0, uuid_1.v4)());
11
+ return frameId.current;
12
+ };
13
+ const frameEventKey = (eventKey, frameId) => `frame:${eventKey}:${frameId}`;
14
+ const EVENT_KEY_FRAME_PROPS = 'props';
15
+ const EVENT_KEY_FRAME_LOADED = 'loaded';
16
+ const arePropsEqualWithShallowCheck = (prevProps, nextProps) => {
17
+ // Checks if props have the same reference (for the case of initial render).
18
+ if (prevProps === nextProps) {
19
+ return true;
20
+ }
21
+ const prevKeys = Object.keys(prevProps);
22
+ const nextKeys = Object.keys(nextProps);
23
+ if (prevKeys.length !== nextKeys.length) {
24
+ return false;
25
+ }
26
+ for (const key of prevKeys) {
27
+ if (!Object.hasOwn(nextProps, key) || prevProps[key] !== nextProps[key]) {
28
+ return false;
29
+ }
30
+ }
31
+ return true;
32
+ };
33
+ const createFrame = (resource, arePropsEqual = arePropsEqualWithShallowCheck) => {
34
+ return (props) => {
35
+ const frameId = useFrameId();
36
+ const propsRef = (0, react_1.useRef)(props);
37
+ (0, react_1.useEffect)(() => {
38
+ const sub = bridge_1.events.on(frameEventKey(EVENT_KEY_FRAME_LOADED, frameId), ({ loaded }) => {
39
+ if (loaded) {
40
+ void bridge_1.events.emit(frameEventKey(EVENT_KEY_FRAME_PROPS, frameId), propsRef.current);
41
+ }
42
+ });
43
+ return () => {
44
+ void sub.then((s) => s.unsubscribe());
45
+ };
46
+ }, []);
47
+ (0, react_1.useEffect)(() => {
48
+ if (!arePropsEqual(propsRef.current, props)) {
49
+ propsRef.current = props;
50
+ void bridge_1.events.emit(frameEventKey(EVENT_KEY_FRAME_PROPS, frameId), props);
51
+ }
52
+ }, [props]);
53
+ return (0, jsx_runtime_1.jsx)(_1.Frame, { resource: resource, frameId: frameId });
54
+ };
55
+ };
56
+ exports.createFrame = createFrame;
@@ -1,4 +1,7 @@
1
1
  import { ForgeElement, MarkupProps, NativeImageProps as ImageProps, NativeLinkProps as LinkProps, NativeTextProps as TextProps, NativeUserPickerProps as UserPickerProps, UserGroupProps, UserProps, FrameProps } from '../types/index';
2
+ import { CheckboxGroupProps as UIKitCheckboxGroupProps } from '@atlaskit/forge-react-types';
3
+ export { InlineEdit } from './inline-edit';
4
+ export { Popup } from './popup';
2
5
  export { UserPickerValue } from '../types/index';
3
6
  export declare const Image: (props: ImageProps) => ForgeElement;
4
7
  export declare const Link: (props: LinkProps) => ForgeElement;
@@ -15,11 +18,17 @@ export declare const Strong: (props: MarkupProps) => ForgeElement;
15
18
  * For more information, see the {@link https://developer.atlassian.com/platform/forge/ui-kit/components/frame|Frame component} documentation.
16
19
  */
17
20
  export declare const Frame: (props: FrameProps) => ForgeElement;
21
+ /**
22
+ * `createFrame` helper for `Frame` component is in EAP (Early Access Program).
23
+ *
24
+ * For more information, see the {@link https://developer.atlassian.com/platform/forge/ui-kit/components/frame|Frame component} documentation.
25
+ */
26
+ export { createFrame } from './createFrame';
18
27
  /**
19
28
  * Export Code generated UI Kit 2 Components
20
29
  */
21
- export * from './uikit2-components';
22
- declare type CheckboxGroupProps = {
30
+ export * from './ui-kit-components';
31
+ interface MacroCheckboxGroupProps {
23
32
  name: string;
24
33
  label?: string;
25
34
  description?: string;
@@ -28,10 +37,8 @@ declare type CheckboxGroupProps = {
28
37
  label: string;
29
38
  value: string;
30
39
  }[];
31
- defaultValue?: {
32
- label: string;
33
- value: string;
34
- }[];
35
- };
40
+ defaultValue?: string[];
41
+ }
42
+ declare type CheckboxGroupProps = MacroCheckboxGroupProps | UIKitCheckboxGroupProps;
36
43
  export declare const CheckboxGroup: (props: CheckboxGroupProps) => ForgeElement;
37
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,gBAAgB,IAAI,UAAU,EAC9B,eAAe,IAAI,SAAS,EAC5B,eAAe,IAAI,SAAS,EAC5B,qBAAqB,IAAI,eAAe,EACxC,cAAc,EACd,SAAS,EACT,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,KAAK,UAAiC,UAAU,KAAK,YAAY,CAAC;AAC/E,eAAO,MAAM,IAAI,UAAgC,SAAS,KAAK,YAAY,CAAC;AAC5E,eAAO,MAAM,IAAI,UAAgC,SAAS,KAAK,YAAY,CAAC;AAC5E,eAAO,MAAM,UAAU,UAAsC,eAAe,KAAK,YAAY,CAAC;AAC9F,eAAO,MAAM,IAAI,UAAgC,SAAS,KAAK,YAAY,CAAC;AAC5E,eAAO,MAAM,SAAS,UAAqC,cAAc,KAAK,YAAY,CAAC;AAE3F,eAAO,MAAM,EAAE,UAA8B,WAAW,KAAK,YAAY,CAAC;AAC1E,eAAO,MAAM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAClF,eAAO,MAAM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,KAAK,UAAiC,UAAU,KAAK,YAAY,CAAC;AAE/E;;GAEG;AACH,cAAc,qBAAqB,CAAC;AAGpC,aAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,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AM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAClF,eAAO,MAAM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,KAAK,UAAiC,UAAU,KAAK,YAAY,CAAC;AAE/E;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,cAAc,qBAAqB,CAAC;AAIpC,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AACD,aAAK,kBAAkB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC;AAC5E,eAAO,MAAM,aAAa,UAAyC,kBAAkB,KAAK,YAAY,CAAC"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckboxGroup = exports.Frame = exports.Strong = exports.Strike = exports.Em = exports.UserGroup = exports.User = exports.UserPicker = exports.Text = exports.Link = exports.Image = void 0;
3
+ exports.CheckboxGroup = exports.createFrame = exports.Frame = exports.Strong = exports.Strike = exports.Em = exports.UserGroup = exports.User = exports.UserPicker = exports.Text = exports.Link = exports.Image = exports.Popup = exports.InlineEdit = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ var inline_edit_1 = require("./inline-edit");
6
+ Object.defineProperty(exports, "InlineEdit", { enumerable: true, get: function () { return inline_edit_1.InlineEdit; } });
7
+ var popup_1 = require("./popup");
8
+ Object.defineProperty(exports, "Popup", { enumerable: true, get: function () { return popup_1.Popup; } });
5
9
  exports.Image = 'Image';
6
10
  exports.Link = 'Link';
7
11
  exports.Text = 'Text';
@@ -17,8 +21,15 @@ exports.Strong = 'Strong';
17
21
  * For more information, see the {@link https://developer.atlassian.com/platform/forge/ui-kit/components/frame|Frame component} documentation.
18
22
  */
19
23
  exports.Frame = 'Frame';
24
+ /**
25
+ * `createFrame` helper for `Frame` component is in EAP (Early Access Program).
26
+ *
27
+ * For more information, see the {@link https://developer.atlassian.com/platform/forge/ui-kit/components/frame|Frame component} documentation.
28
+ */
29
+ var createFrame_1 = require("./createFrame");
30
+ Object.defineProperty(exports, "createFrame", { enumerable: true, get: function () { return createFrame_1.createFrame; } });
20
31
  /**
21
32
  * Export Code generated UI Kit 2 Components
22
33
  */
23
- tslib_1.__exportStar(require("./uikit2-components"), exports);
34
+ tslib_1.__exportStar(require("./ui-kit-components"), exports);
24
35
  exports.CheckboxGroup = 'CheckboxGroup';
@@ -0,0 +1,17 @@
1
+ import { InlineEditProps } from '@atlaskit/forge-react-types';
2
+ /**
3
+ * The following workaround is required because functions cannot be passed outside of the runtime.
4
+ * The Renderer will invoke the function from within the runtime
5
+ * Instead of passing the function, we are reimplementing validation and confirmation here to provide the same behaviour as the ADS version.
6
+ *
7
+ * The reimplemented functions include:
8
+ * - validate
9
+ * - onConfirm
10
+ * - onCancel
11
+ * - onEdit
12
+ *
13
+ * readView and editView also need to be evaluated here so that into a primitive type(JS object) to be rendered by the Renderer. Otherwise the Renderer will not be able to evaluate them on the product side.
14
+ *
15
+ */
16
+ export declare const InlineEdit: ({ label, readView, editView, validate, startWithEditViewOpen, keepEditViewOpenOnBlur, hideActionButtons, isRequired, readViewFitContainerWidth, editButtonLabel, confirmButtonLabel, cancelButtonLabel, defaultValue, isEditing, onConfirm, onCancel, onEdit }: InlineEditProps) => import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=inline-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-edit.d.ts","sourceRoot":"","sources":["../../src/components/inline-edit.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAU9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,mQAkBpB,eAAe,4CAqGjB,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InlineEdit = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const content_wrapper_1 = require("./utils/content-wrapper");
7
+ const InlineEditPrimitive = 'InlineEdit';
8
+ /**
9
+ * The following workaround is required because functions cannot be passed outside of the runtime.
10
+ * The Renderer will invoke the function from within the runtime
11
+ * Instead of passing the function, we are reimplementing validation and confirmation here to provide the same behaviour as the ADS version.
12
+ *
13
+ * The reimplemented functions include:
14
+ * - validate
15
+ * - onConfirm
16
+ * - onCancel
17
+ * - onEdit
18
+ *
19
+ * readView and editView also need to be evaluated here so that into a primitive type(JS object) to be rendered by the Renderer. Otherwise the Renderer will not be able to evaluate them on the product side.
20
+ *
21
+ */
22
+ const InlineEdit = ({ label, readView, editView, validate, startWithEditViewOpen, keepEditViewOpenOnBlur, hideActionButtons, isRequired, readViewFitContainerWidth, editButtonLabel, confirmButtonLabel, cancelButtonLabel, defaultValue, isEditing, onConfirm, onCancel, onEdit }) => {
23
+ const [prevValue, setPrevValue] = (0, react_1.useState)();
24
+ const [value, setValue] = (0, react_1.useState)(defaultValue);
25
+ const [_isEditing, _setIsEditing] = (0, react_1.useState)(startWithEditViewOpen ? startWithEditViewOpen : false);
26
+ const [errorMessage, setErrorMessage] = (0, react_1.useState)(undefined);
27
+ const internalValidate = (newValue, setEdit, onConfirm) => {
28
+ if (validate !== undefined) {
29
+ const errorMessageFromValidation = validate(newValue, {}, {});
30
+ const handleValidationResult = (error) => {
31
+ setErrorMessage(error || undefined);
32
+ // If no error and onConfirm is being called
33
+ if (error === undefined && onConfirm) {
34
+ onConfirm(newValue);
35
+ }
36
+ if (setEdit) {
37
+ setEdit(error !== undefined);
38
+ }
39
+ };
40
+ if (errorMessageFromValidation instanceof Promise) {
41
+ void errorMessageFromValidation.then(handleValidationResult);
42
+ }
43
+ else {
44
+ handleValidationResult(errorMessageFromValidation);
45
+ }
46
+ }
47
+ else {
48
+ if (setEdit) {
49
+ setEdit(false);
50
+ }
51
+ if (onConfirm) {
52
+ onConfirm(newValue);
53
+ }
54
+ }
55
+ };
56
+ const internalOnConfirm = () => {
57
+ if (value === prevValue) {
58
+ _setIsEditing(false);
59
+ return;
60
+ }
61
+ internalValidate(value, _setIsEditing, onConfirm);
62
+ };
63
+ const internalOnChange = (e) => {
64
+ const newValue = e.target ? e.target.value : e;
65
+ setValue(newValue);
66
+ internalValidate(newValue);
67
+ };
68
+ const internalOnEdit = () => {
69
+ // Reset error state on first open
70
+ setErrorMessage(undefined);
71
+ _setIsEditing(true);
72
+ setPrevValue(value);
73
+ onEdit?.();
74
+ };
75
+ const internalOnCancel = () => {
76
+ _setIsEditing(false);
77
+ setValue(prevValue);
78
+ onCancel?.();
79
+ };
80
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(InlineEditPrimitive, { label: label, onConfirm: () => internalOnConfirm(), onEdit: () => internalOnEdit(), onCancel: () => internalOnCancel(), isEditing: isEditing !== undefined ? isEditing : _isEditing, startWithEditViewOpen: startWithEditViewOpen, keepEditViewOpenOnBlur: keepEditViewOpenOnBlur, hideActionButtons: hideActionButtons, isRequired: isRequired, readViewFitContainerWidth: readViewFitContainerWidth, editButtonLabel: editButtonLabel, confirmButtonLabel: confirmButtonLabel, cancelButtonLabel: cancelButtonLabel, children: [(0, jsx_runtime_1.jsx)(content_wrapper_1.ContentWrapper, { name: "editView", children: editView({
81
+ onChange: internalOnChange,
82
+ value,
83
+ errorMessage,
84
+ isInvalid: errorMessage !== undefined,
85
+ 'aria-invalid': errorMessage !== undefined ? 'true' : 'false',
86
+ isRequired: isRequired || false
87
+ }) }), (0, jsx_runtime_1.jsx)(content_wrapper_1.ContentWrapper, { name: "readView", children: readView() })] }) }));
88
+ };
89
+ exports.InlineEdit = InlineEdit;
@@ -0,0 +1,3 @@
1
+ import { PopupProps } from '@atlaskit/forge-react-types';
2
+ export declare const Popup: ({ content, trigger, isOpen, id, testId, onClose, boundary, rootBoundary, shouldFlip, placement, fallbackPlacements, autoFocus, shouldUseCaptureOnOutsideClick, shouldFitContainer, shouldDisableFocusLock, strategy, role, label, titleId }: PopupProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=popup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../../src/components/popup.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAUzD,eAAO,MAAM,KAAK,gPAoBf,UAAU,4CAyBZ,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Popup = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const content_wrapper_1 = require("./utils/content-wrapper");
6
+ const PopupPrimitive = 'Popup';
7
+ const Popup = ({ content, trigger, isOpen, id, testId, onClose, boundary, rootBoundary, shouldFlip, placement, fallbackPlacements, autoFocus, shouldUseCaptureOnOutsideClick, shouldFitContainer, shouldDisableFocusLock, strategy, role, label, titleId }) => {
8
+ return ((0, jsx_runtime_1.jsxs)(PopupPrimitive, { isOpen: isOpen, id: id, testId: testId, onClose: onClose, boundary: boundary, rootBoundary: rootBoundary, shouldFlip: shouldFlip, placement: placement, fallbackPlacements: fallbackPlacements, autoFocus: autoFocus, shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick, shouldFitContainer: shouldFitContainer, shouldDisableFocusLock: shouldDisableFocusLock, strategy: strategy, role: role, label: label, titleId: titleId, children: [(0, jsx_runtime_1.jsx)(content_wrapper_1.ContentWrapper, { name: "content", children: content() }), (0, jsx_runtime_1.jsx)(content_wrapper_1.ContentWrapper, { name: "trigger", children: trigger() })] }));
9
+ };
10
+ exports.Popup = Popup;
@@ -1,16 +1,18 @@
1
1
  /// <reference types="react" />
2
2
  import { ForgeElement } from '../types/index';
3
- import type { BadgeProps, BarChartProps, BoxProps, ButtonProps, ButtonGroupProps, CheckboxProps, CodeProps, CodeBlockProps, DatePickerProps, DynamicTableProps, ErrorMessageProps, HeadingProps, HelperMessageProps, HorizontalBarChartProps, HorizontalStackBarChartProps, InlineProps, LabelProps, LozengeProps, LineChartProps, LinkButtonProps, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ModalTitleProps, ModalTransitionProps, PieChartProps, ProgressBarProps, ProgressTrackerProps, RadioProps, RadioGroupProps, RangeProps, SectionMessageProps, SectionMessageActionProps, SingleValueChartProps, SpinnerProps, StackProps, StackBarChartProps, TabsProps, TabProps, TabListProps, TabPanelProps, TagProps, TagGroupProps, FormProps, FormHeaderProps, FormFooterProps, FormSectionProps, TooltipProps, TextAreaProps, TextfieldProps, ToggleProps, ValidMessageProps, LoadingButtonProps, SelectProps, IconProps } from '@atlaskit/forge-react-types';
3
+ import type { BadgeProps, BarChartProps, BoxProps, ButtonProps, ButtonGroupProps, CalendarProps, CheckboxProps, CodeProps, CodeBlockProps, DatePickerProps, DynamicTableProps, ErrorMessageProps, HeadingProps, HelperMessageProps, HorizontalBarChartProps, HorizontalStackBarChartProps, InlineProps, LabelProps, ListProps, ListItemProps, LozengeProps, LineChartProps, LinkButtonProps, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ModalTitleProps, ModalTransitionProps, PieChartProps, ProgressBarProps, ProgressTrackerProps, RadioProps, RadioGroupProps, RangeProps, SectionMessageProps, SectionMessageActionProps, SingleValueChartProps, SpinnerProps, StackProps, StackBarChartProps, TabsProps, TabProps, TabListProps, TabPanelProps, TagProps, TagGroupProps, FormProps, FormHeaderProps, FormFooterProps, FormSectionProps, TooltipProps, TextAreaProps, TextfieldProps, ToggleProps, ValidMessageProps, LoadingButtonProps, SelectProps, IconProps, EmptyStateProps } from '@atlaskit/forge-react-types';
4
4
  export declare const Badge: (props: BadgeProps) => ForgeElement;
5
5
  export declare const BarChart: (props: BarChartProps) => ForgeElement;
6
6
  export declare const Box: (props: BoxProps) => ForgeElement;
7
7
  export declare const Button: (props: ButtonProps) => ForgeElement;
8
8
  export declare const ButtonGroup: (props: ButtonGroupProps) => ForgeElement;
9
+ export declare const Calendar: (props: CalendarProps) => ForgeElement;
9
10
  export declare const Checkbox: (props: CheckboxProps) => ForgeElement;
10
11
  export declare const Code: (props: CodeProps) => ForgeElement;
11
12
  export declare const CodeBlock: (props: CodeBlockProps) => ForgeElement;
12
13
  export declare const DatePicker: (props: DatePickerProps) => ForgeElement;
13
14
  export declare const DynamicTable: (props: DynamicTableProps) => ForgeElement;
15
+ export declare const EmptyState: (props: EmptyStateProps) => ForgeElement;
14
16
  export declare const ErrorMessage: (props: ErrorMessageProps) => ForgeElement;
15
17
  export declare const Form: (props: FormProps) => ForgeElement;
16
18
  export declare const FormFooter: (props: FormFooterProps) => ForgeElement;
@@ -25,6 +27,8 @@ export declare const Inline: (props: InlineProps) => ForgeElement;
25
27
  export declare const Label: (props: LabelProps) => ForgeElement;
26
28
  export declare const LineChart: (props: LineChartProps) => ForgeElement;
27
29
  export declare const LinkButton: (props: LinkButtonProps) => ForgeElement;
30
+ export declare const List: (props: ListProps) => ForgeElement;
31
+ export declare const ListItem: (props: ListItemProps) => ForgeElement;
28
32
  export declare const LoadingButton: (props: LoadingButtonProps) => ForgeElement;
29
33
  export declare const Lozenge: (props: LozengeProps) => ForgeElement;
30
34
  export declare const Modal: (props: ModalProps) => ForgeElement;
@@ -58,4 +62,4 @@ export declare const Toggle: (props: ToggleProps) => ForgeElement;
58
62
  export declare const Tooltip: (props: TooltipProps) => ForgeElement;
59
63
  export declare const ValidMessage: (props: ValidMessageProps) => ForgeElement;
60
64
  export declare const RequiredAsterisk: () => JSX.Element;
61
- //# sourceMappingURL=uikit2-components.d.ts.map
65
+ //# sourceMappingURL=ui-kit-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-kit-components.d.ts","sourceRoot":"","sources":["../../src/components/ui-kit-components.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,WAAW,EACX,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,aAAa,EACb,SAAS,EACT,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,KAAK,UAAiC,UAAU,KAAK,YAAY,CAAC;AAC/E,eAAO,MAAM,QAAQ,UAAoC,aAAa,KAAK,YAAY,CAAC;AACxF,eAAO,MAAM,GAAG,UAA+B,QAAQ,KAAK,YAAY,CAAC;AACzE,eAAO,MAAM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAClF,eAAO,MAAM,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UAAiC,UAAU,KAAK,YAAY,CAAC;AAC/E,eAAO,MAAM,aAAa,UAAyC,kBAAkB,KAAK,YAAY,CAAC;AACvG,eAAO,MAAM,GAAG,UAA+B,QAAQ,KAAK,YAAY,CAAC;AACzE,eAAO,MAAM,OAAO,UAAmC,YAAY,KAAK,YAAY,CAAC;AACrF,eAAO,MAAM,QAAQ,UAAoC,aAAa,KAAK,YAAY,CAAC;AACxF,eAAO,MAAM,IAAI,UAAgC,SAAS,KAAK,YAAY,CAAC;AAC5E,eAAO,MAAM,GAAG,UAA+B,QAAQ,KAAK,YAAY,CAAC;AACzE,eAAO,MAAM,QAAQ,UAAoC,aAAa,KAAK,YAAY,CAAC;AACxF,eAAO,MAAM,QAAQ,UAAoC,aAAa,KAAK,YAAY,CAAC;AACxF,eAAO,MAAM,SAAS,UAAqC,cAAc,KAAK,YAAY,CAAC;AAC3F,eAAO,MAAM,MAAM,UAAkC,WAAW,KAAK,YAAY,CAAC;AAClF,eAAO,MAAM,OAAO,UAAmC,YAAY,KAAK,YAAY,CAAC;AACrF,eAAO,MAAM,YAAY,UAAwC,iBAAiB,KAAK,YAAY,CAAC;AAEpG,eAAO,MAAM,gBAAgB,QAA0C,WAAW,CAAC"}
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tag = exports.Tabs = exports.TabPanel = exports.TabList = exports.Tab = exports.StackBarChart = exports.Stack = exports.Spinner = exports.SingleValueChart = exports.SectionMessageAction = exports.SectionMessage = exports.Select = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressTracker = exports.ProgressBar = exports.PieChart = exports.ModalTransition = exports.ModalTitle = exports.ModalHeader = exports.ModalFooter = exports.ModalBody = exports.Modal = exports.Lozenge = exports.LoadingButton = exports.LinkButton = exports.LineChart = exports.Label = exports.Inline = exports.Icon = exports.HorizontalStackBarChart = exports.HorizontalBarChart = exports.HelperMessage = exports.Heading = exports.FormSection = exports.FormHeader = exports.FormFooter = exports.Form = exports.ErrorMessage = exports.DynamicTable = exports.DatePicker = exports.CodeBlock = exports.Code = exports.Checkbox = exports.ButtonGroup = exports.Button = exports.Box = exports.BarChart = exports.Badge = void 0;
4
- exports.RequiredAsterisk = exports.ValidMessage = exports.Tooltip = exports.Toggle = exports.Textfield = exports.TextArea = exports.TagGroup = void 0;
3
+ exports.Tab = exports.StackBarChart = exports.Stack = exports.Spinner = exports.SingleValueChart = exports.SectionMessageAction = exports.SectionMessage = exports.Select = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressTracker = exports.ProgressBar = exports.PieChart = exports.ModalTransition = exports.ModalTitle = exports.ModalHeader = exports.ModalFooter = exports.ModalBody = exports.Modal = exports.Lozenge = exports.LoadingButton = exports.ListItem = exports.List = exports.LinkButton = exports.LineChart = exports.Label = exports.Inline = exports.Icon = exports.HorizontalStackBarChart = exports.HorizontalBarChart = exports.HelperMessage = exports.Heading = exports.FormSection = exports.FormHeader = exports.FormFooter = exports.Form = exports.ErrorMessage = exports.EmptyState = exports.DynamicTable = exports.DatePicker = exports.CodeBlock = exports.Code = exports.Checkbox = exports.Calendar = exports.ButtonGroup = exports.Button = exports.Box = exports.BarChart = exports.Badge = void 0;
4
+ exports.RequiredAsterisk = exports.ValidMessage = exports.Tooltip = exports.Toggle = exports.Textfield = exports.TextArea = exports.TagGroup = exports.Tag = exports.Tabs = exports.TabPanel = exports.TabList = void 0;
5
5
  exports.Badge = 'Badge';
6
6
  exports.BarChart = 'BarChart';
7
7
  exports.Box = 'Box';
8
8
  exports.Button = 'Button';
9
9
  exports.ButtonGroup = 'ButtonGroup';
10
+ exports.Calendar = 'Calendar';
10
11
  exports.Checkbox = 'Checkbox';
11
12
  exports.Code = 'Code';
12
13
  exports.CodeBlock = 'CodeBlock';
13
14
  exports.DatePicker = 'DatePicker';
14
15
  exports.DynamicTable = 'DynamicTable';
16
+ exports.EmptyState = 'EmptyState';
15
17
  exports.ErrorMessage = 'ErrorMessage';
16
18
  exports.Form = 'Form';
17
19
  exports.FormFooter = 'FormFooter';
@@ -26,6 +28,8 @@ exports.Inline = 'Inline';
26
28
  exports.Label = 'Label';
27
29
  exports.LineChart = 'LineChart';
28
30
  exports.LinkButton = 'LinkButton';
31
+ exports.List = 'List';
32
+ exports.ListItem = 'ListItem';
29
33
  exports.LoadingButton = 'LoadingButton';
30
34
  exports.Lozenge = 'Lozenge';
31
35
  exports.Modal = 'Modal';
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ForgeElement } from '../../types';
3
+ declare type ContentWrapperProps = {
4
+ name: string;
5
+ children?: ReactNode;
6
+ };
7
+ export declare const ContentWrapper: (props: ContentWrapperProps) => ForgeElement;
8
+ export {};
9
+ //# sourceMappingURL=content-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-wrapper.d.ts","sourceRoot":"","sources":["../../../src/components/utils/content-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,aAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAMF,eAAO,MAAM,cAAc,UAA0C,mBAAmB,KAAK,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContentWrapper = void 0;
4
+ // ContentWrapper is an internal component that allows us to workaround the limitation of the Forge architecture
5
+ // Functions in Forge apps are invoked from within the runtime and it's definition cannot be passed across the bridge.
6
+ // For ADS components that accept a call back function that returns a ReactNode as a prop, these must be evaluated within the runtime to return a ForgeDoc before being passed to the Renderer. Otherwise the Renderer would not be able to render the component at all.
7
+ // The ContentWrapper component should be used to wrap around any callback function that returns a ReactNode so that it will evaluate the callback within the runtime and pass back the evaluated ForgeDoc
8
+ exports.ContentWrapper = 'ContentWrapper';
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import { ForgeChildren, ForgeNode, ForgeElement, CustomFieldValue } from './forge';
3
- import { Icon } from './icons';
1
+ import type React from 'react';
2
+ import { type ForgeChildren, type ForgeNode, type ForgeElement, type CustomFieldValue } from './forge';
3
+ import { type Icon } from './icons';
4
4
  export interface AKOption {
5
5
  label: string;
6
6
  value: any;
7
7
  }
8
8
  export interface AuxPipelineUserVisibleError extends Error {
9
- errorMessage?: string;
9
+ errorMessage?: string | JSX.Element;
10
10
  errorDetails?: string;
11
11
  }
12
12
  export interface BadgeProps {
@@ -112,6 +112,7 @@ export interface NativeButtonProps {
112
112
  }
113
113
  export interface FrameProps {
114
114
  resource: string;
115
+ frameId?: string;
115
116
  }
116
117
  export interface InlineDialogProps {
117
118
  children: ForgeChildren;
@@ -162,7 +163,7 @@ export interface CheckboxProps {
162
163
  }
163
164
  export interface NativeCheckboxProps extends CheckboxProps {
164
165
  key?: string;
165
- onChange?: ({ value, isChecked, }: {
166
+ onChange?: ({ value, isChecked }: {
166
167
  value: string;
167
168
  isChecked: boolean;
168
169
  }) => void;