@forge/react 10.1.1-next.1 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/out/__test__/hostConfig.test.js +4 -1
- package/out/__test__/inline.test.js +1 -1
- package/out/__test__/reconciler.test.js +16 -15
- package/out/__test__/stack.test.js +1 -1
- package/out/components/index.d.ts +0 -1
- package/out/components/index.d.ts.map +1 -1
- package/out/components/index.js +1 -3
- package/out/components/uikit2-components.d.ts +2 -1
- package/out/components/uikit2-components.d.ts.map +1 -1
- package/out/components/uikit2-components.js +2 -1
- package/out/hooks/__test__/useForm.test.js +4 -1
- package/out/hooks/confluenceEntity.js +3 -5
- package/out/hooks/jiraEntity.js +2 -4
- package/out/hooks/useConfig.js +1 -1
- package/out/hooks/useForm.d.ts +1 -0
- package/out/hooks/useForm.d.ts.map +1 -1
- package/out/hooks/useForm.js +26 -16
- package/out/reconciler.js +6 -4
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/out/components/modal/__test__/index.test.d.ts +0 -2
- package/out/components/modal/__test__/index.test.d.ts.map +0 -1
- package/out/components/modal/__test__/index.test.js +0 -24
- package/out/components/modal/index.d.ts +0 -4
- package/out/components/modal/index.d.ts.map +0 -1
- package/out/components/modal/index.js +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @forge/react
|
|
2
2
|
|
|
3
|
+
## 10.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e982c6f: Fix fields setting to undefined on onBlur
|
|
8
|
+
- c875971: Fix useForm not holding defaultValue state when rendering within a Modal
|
|
9
|
+
- Updated dependencies [b280247]
|
|
10
|
+
- @forge/bridge@3.4.0
|
|
11
|
+
|
|
12
|
+
## 10.1.1-next.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- e982c6f: Fix fields setting to undefined on onBlur
|
|
17
|
+
|
|
3
18
|
## 10.1.1-next.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
let keyCount = 0;
|
|
4
|
-
jest.mock('uuid', () => (
|
|
4
|
+
jest.mock('uuid', () => ({
|
|
5
|
+
...jest.requireActual('uuid'),
|
|
6
|
+
v4: () => `${keyCount++}`
|
|
7
|
+
}));
|
|
5
8
|
const reconciler_1 = require("../reconciler");
|
|
6
9
|
const testUtils_1 = require("./testUtils");
|
|
7
10
|
const emptyForgeDoc = (0, reconciler_1.createElement)({ type: 'root', props: {} });
|
|
@@ -13,7 +13,7 @@ describe('reconciled output', () => {
|
|
|
13
13
|
});
|
|
14
14
|
it('renders Inline ForgeDoc', async () => {
|
|
15
15
|
const Test = () => {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline,
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline, { space: "space.500", children: [(0, jsx_runtime_1.jsxs)(components_1.Inline, { alignInline: "start", space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "Hug" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "red", text: "Really looooooooooooooooooong" }), (0, jsx_runtime_1.jsx)(components_1.Button, { appearance: "primary", onClick: jest.fn(), children: "Button" })] }), (0, jsx_runtime_1.jsxs)(components_1.Inline, { alignInline: "start", space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "Fill" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "red", text: "Really looooooooooooooooooong" }), (0, jsx_runtime_1.jsx)(components_1.Button, { appearance: "primary", onClick: jest.fn(), children: "Button" })] })] }) }));
|
|
17
17
|
};
|
|
18
18
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
19
19
|
const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
let keyCount = 0;
|
|
6
|
-
jest.mock('uuid', () => (
|
|
6
|
+
jest.mock('uuid', () => ({
|
|
7
|
+
...jest.requireActual('uuid'),
|
|
8
|
+
v4: () => `${keyCount++}`
|
|
9
|
+
}));
|
|
7
10
|
const resetKeyCount = () => {
|
|
8
11
|
keyCount = 0;
|
|
9
12
|
};
|
|
@@ -23,7 +26,7 @@ describe('Reconcilation', () => {
|
|
|
23
26
|
bridgeCalls = (0, testUtils_1.setupBridge)();
|
|
24
27
|
const Test = () => {
|
|
25
28
|
const [bool, setBool] = (0, react_1.useState)(false);
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { children: !bool ? 'Loading...' : 'Now loaded...' }), (0, jsx_runtime_1.jsx)(components_1.Button,
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { children: !bool ? 'Loading...' : 'Now loaded...' }), (0, jsx_runtime_1.jsx)(components_1.Button, { onClick: () => setBool(true), children: "Click" }), (0, jsx_runtime_1.jsx)(components_1.Lozenge, { appearance: "inprogress", children: "Test" })] }));
|
|
27
30
|
};
|
|
28
31
|
resetKeyCount();
|
|
29
32
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
@@ -55,7 +58,7 @@ describe('deep tree reconciliation', () => {
|
|
|
55
58
|
function incrementCount() {
|
|
56
59
|
setCount(count + 1);
|
|
57
60
|
}
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline, { children: [(0, jsx_runtime_1.jsx)(components_1.Stack, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: count }) }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { children: "Should not update" }), (0, jsx_runtime_1.jsx)(components_1.Button,
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline, { children: [(0, jsx_runtime_1.jsx)(components_1.Stack, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: count }) }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { children: "Should not update" }), (0, jsx_runtime_1.jsx)(components_1.Button, { onClick: incrementCount, children: "Click" })] })] }) }));
|
|
59
62
|
};
|
|
60
63
|
resetKeyCount();
|
|
61
64
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
@@ -65,13 +68,12 @@ describe('deep tree reconciliation', () => {
|
|
|
65
68
|
expect(forgeDoc).toMatchSnapshot();
|
|
66
69
|
});
|
|
67
70
|
it('should match snapshot after triggering update', () => {
|
|
68
|
-
var _a, _b;
|
|
69
71
|
let forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
70
72
|
expect(forgeDoc).not.toBeNull();
|
|
71
73
|
const button = (0, testUtils_1.findElementInForgeDoc)(forgeDoc, '8');
|
|
72
74
|
expect(button).not.toBeUndefined();
|
|
73
|
-
expect(
|
|
74
|
-
|
|
75
|
+
expect(button?.props?.onClick).not.toBeUndefined();
|
|
76
|
+
button?.props?.onClick();
|
|
75
77
|
forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
76
78
|
expect(forgeDoc).toMatchSnapshot();
|
|
77
79
|
});
|
|
@@ -88,8 +90,8 @@ describe('macro config', () => {
|
|
|
88
90
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(App, {}));
|
|
89
91
|
await reconcilerTestRenderer_1.default.addConfig((0, jsx_runtime_1.jsx)(Config, {}));
|
|
90
92
|
const configForgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
91
|
-
expect(configForgeDoc
|
|
92
|
-
expect(configForgeDoc
|
|
93
|
+
expect(configForgeDoc?.type).toEqual('MacroConfig');
|
|
94
|
+
expect(configForgeDoc?.children[0].type).toEqual('Textfield');
|
|
93
95
|
});
|
|
94
96
|
});
|
|
95
97
|
describe('id props', () => {
|
|
@@ -97,7 +99,7 @@ describe('id props', () => {
|
|
|
97
99
|
beforeAll(async () => {
|
|
98
100
|
bridgeCalls = (0, testUtils_1.setupBridge)();
|
|
99
101
|
const Test = () => {
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Label,
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Label, { labelFor: "username", children: "username" }), (0, jsx_runtime_1.jsx)(components_1.Textfield, { id: "username", placeholder: "name" }), (0, jsx_runtime_1.jsx)(components_1.DatePicker, { id: "datepicker", placeholder: "date" })] }));
|
|
101
103
|
};
|
|
102
104
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
103
105
|
});
|
|
@@ -122,7 +124,7 @@ describe('function props __id__ attributes', () => {
|
|
|
122
124
|
function incrementCount() {
|
|
123
125
|
setCount(count + 1);
|
|
124
126
|
}
|
|
125
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline, { children: [(0, jsx_runtime_1.jsx)(components_1.Stack, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: count }) }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { children: [(0, jsx_runtime_1.jsx)(components_1.Button,
|
|
127
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Inline, { children: [(0, jsx_runtime_1.jsx)(components_1.Stack, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: count }) }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { children: [(0, jsx_runtime_1.jsx)(components_1.Button, { appearance: "danger", onClick: incrementCount, children: "Click" }), (0, jsx_runtime_1.jsx)(components_1.Stack, { children: (0, jsx_runtime_1.jsx)(components_1.Button, { autoFocus: true, onClick: () => setCount(0), children: "Reset" }) })] })] }) }));
|
|
126
128
|
};
|
|
127
129
|
resetKeyCount();
|
|
128
130
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
@@ -133,11 +135,10 @@ describe('function props __id__ attributes', () => {
|
|
|
133
135
|
expect((0, testUtils_1.findElementInForgeDoc)(forgeDoc, '9')).toHaveProperty('props.onClick.__id__', '8');
|
|
134
136
|
});
|
|
135
137
|
it('should not contain __id__ attribute for non function props', () => {
|
|
136
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
137
138
|
const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
138
|
-
expect((
|
|
139
|
-
expect((
|
|
140
|
-
expect((
|
|
141
|
-
expect((
|
|
139
|
+
expect((0, testUtils_1.findElementInForgeDoc)(forgeDoc, '6')?.props?.appearance).toBe('danger');
|
|
140
|
+
expect((0, testUtils_1.findElementInForgeDoc)(forgeDoc, '6')?.props?.appearance?.__id__).toBeUndefined();
|
|
141
|
+
expect((0, testUtils_1.findElementInForgeDoc)(forgeDoc, '9')?.props?.autoFocus).toBe(true);
|
|
142
|
+
expect((0, testUtils_1.findElementInForgeDoc)(forgeDoc, '9')?.props?.autoFocus?.__id__).toBeUndefined();
|
|
142
143
|
});
|
|
143
144
|
});
|
|
@@ -13,7 +13,7 @@ describe('reconciled output', () => {
|
|
|
13
13
|
});
|
|
14
14
|
it('renders Stack ForgeDoc', async () => {
|
|
15
15
|
const Test = () => {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Stack,
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.200", children: [(0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "default align" }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" })] })] }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "start align" }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", alignInline: "start", children: [(0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" })] })] }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "center align" }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", alignInline: "center", children: [(0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" })] })] }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", children: [(0, jsx_runtime_1.jsx)(components_1.Heading, { as: "h3", children: "end align" }), (0, jsx_runtime_1.jsxs)(components_1.Stack, { space: "space.100", alignInline: "end", children: [(0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greyLight", text: "1" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "blueLight", text: "2" }), (0, jsx_runtime_1.jsx)(components_1.Tag, { color: "greenLight", text: "3" })] })] })] }) }));
|
|
17
17
|
};
|
|
18
18
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(Test, {}));
|
|
19
19
|
const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
@@ -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,EACV,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,U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AgC,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;AAKlF,cAAc,qBAAqB,CAAC;AAGpC,aAAK,kBAAkB,GAAG;IACxB,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;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD,CAAC;AACF,eAAO,MAAM,aAAa,UAAyC,kBAAkB,KAAK,YAAY,CAAC"}
|
package/out/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CheckboxGroup = exports.Strong = exports.Strike = exports.Em = exports.UserGroup = exports.User = exports.UserPicker = exports.Text = exports.Link = exports.Image = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
exports.Image = 'Image';
|
|
6
6
|
exports.Link = 'Link';
|
|
@@ -13,5 +13,3 @@ exports.Strike = 'Strike';
|
|
|
13
13
|
exports.Strong = 'Strong';
|
|
14
14
|
tslib_1.__exportStar(require("./uikit2-components"), exports);
|
|
15
15
|
exports.CheckboxGroup = 'CheckboxGroup';
|
|
16
|
-
var index_1 = require("./modal/index");
|
|
17
|
-
Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return index_1.Modal; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ForgeElement } from '../types/index';
|
|
3
|
-
import type { BadgeProps, BoxProps, ButtonProps, ButtonGroupProps, CheckboxProps, CodeProps, CodeBlockProps, DatePickerProps, DynamicTableProps, ErrorMessageProps, HeadingProps, HelperMessageProps, InlineProps, LabelProps, LozengeProps, LinkButtonProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioProps, RadioGroupProps, RangeProps, SectionMessageProps, SectionMessageActionProps, SpinnerProps, StackProps, 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, BoxProps, ButtonProps, ButtonGroupProps, CheckboxProps, CodeProps, CodeBlockProps, DatePickerProps, DynamicTableProps, ErrorMessageProps, HeadingProps, HelperMessageProps, InlineProps, LabelProps, LozengeProps, LinkButtonProps, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioProps, RadioGroupProps, RangeProps, SectionMessageProps, SectionMessageActionProps, SpinnerProps, StackProps, TabsProps, TabProps, TabListProps, TabPanelProps, TagProps, TagGroupProps, FormProps, FormHeaderProps, FormFooterProps, FormSectionProps, TooltipProps, TextAreaProps, TextfieldProps, ToggleProps, ValidMessageProps, LoadingButtonProps, SelectProps, IconProps } from '@atlaskit/forge-react-types';
|
|
4
4
|
export declare const Badge: (props: BadgeProps) => ForgeElement;
|
|
5
5
|
export declare const Box: (props: BoxProps) => ForgeElement;
|
|
6
6
|
export declare const Button: (props: ButtonProps) => ForgeElement;
|
|
@@ -23,6 +23,7 @@ export declare const Label: (props: LabelProps) => ForgeElement;
|
|
|
23
23
|
export declare const LinkButton: (props: LinkButtonProps) => ForgeElement;
|
|
24
24
|
export declare const LoadingButton: (props: LoadingButtonProps) => ForgeElement;
|
|
25
25
|
export declare const Lozenge: (props: LozengeProps) => ForgeElement;
|
|
26
|
+
export declare const Modal: (props: ModalProps) => ForgeElement;
|
|
26
27
|
export declare const ModalBody: (props: ModalBodyProps) => ForgeElement;
|
|
27
28
|
export declare const ModalFooter: (props: ModalFooterProps) => ForgeElement;
|
|
28
29
|
export declare const ModalHeader: (props: ModalHeaderProps) => ForgeElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uikit2-components.d.ts","sourceRoot":"","sources":["../../src/components/uikit2-components.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,aAAa,EACb,SAAS,EACT,eAAe,EACf,eAAe,EAC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AC5E,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
|
+
{"version":3,"file":"uikit2-components.d.ts","sourceRoot":"","sources":["../../src/components/uikit2-components.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,UAAU,EACV,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,EACV,MAAM,6BAA6B,CAAC;AAErC,eAAO,MA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AAa,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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequiredAsterisk = exports.ValidMessage = exports.Tooltip = exports.Toggle = exports.Textfield = exports.TextArea = exports.TagGroup = exports.Tag = exports.Tabs = exports.TabPanel = exports.TabList = exports.Tab = exports.Stack = exports.Spinner = exports.SectionMessageAction = exports.SectionMessage = exports.Select = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressTracker = exports.ProgressBar = exports.ModalTransition = exports.ModalTitle = exports.ModalHeader = exports.ModalFooter = exports.ModalBody = exports.Lozenge = exports.LoadingButton = exports.LinkButton = exports.Label = exports.Inline = exports.Icon = 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.Badge = void 0;
|
|
3
|
+
exports.RequiredAsterisk = exports.ValidMessage = exports.Tooltip = exports.Toggle = exports.Textfield = exports.TextArea = exports.TagGroup = exports.Tag = exports.Tabs = exports.TabPanel = exports.TabList = exports.Tab = exports.Stack = exports.Spinner = exports.SectionMessageAction = exports.SectionMessage = exports.Select = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressTracker = exports.ProgressBar = exports.ModalTransition = exports.ModalTitle = exports.ModalHeader = exports.ModalFooter = exports.ModalBody = exports.Modal = exports.Lozenge = exports.LoadingButton = exports.LinkButton = exports.Label = exports.Inline = exports.Icon = 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.Badge = void 0;
|
|
4
4
|
exports.Badge = 'Badge';
|
|
5
5
|
exports.Box = 'Box';
|
|
6
6
|
exports.Button = 'Button';
|
|
@@ -23,6 +23,7 @@ exports.Label = 'Label';
|
|
|
23
23
|
exports.LinkButton = 'LinkButton';
|
|
24
24
|
exports.LoadingButton = 'LoadingButton';
|
|
25
25
|
exports.Lozenge = 'Lozenge';
|
|
26
|
+
exports.Modal = 'Modal';
|
|
26
27
|
exports.ModalBody = 'ModalBody';
|
|
27
28
|
exports.ModalFooter = 'ModalFooter';
|
|
28
29
|
exports.ModalHeader = 'ModalHeader';
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const react_hooks_1 = require("@testing-library/react-hooks");
|
|
4
4
|
const useForm_1 = require("../useForm");
|
|
5
|
-
jest.mock('react', () => (
|
|
5
|
+
jest.mock('react', () => ({
|
|
6
|
+
...jest.requireActual('react'),
|
|
7
|
+
useId: jest.fn().mockReturnValue('mocked-id')
|
|
8
|
+
}));
|
|
6
9
|
describe('useForm with no default values', () => {
|
|
7
10
|
const { result } = (0, react_hooks_1.renderHook)(() => (0, useForm_1.useForm)());
|
|
8
11
|
it('register should return an id', () => {
|
|
@@ -6,15 +6,14 @@ const apiRequestUtils_1 = require("./utils/apiRequestUtils");
|
|
|
6
6
|
const valueUtils_1 = require("./utils/valueUtils");
|
|
7
7
|
const types_1 = require("./types");
|
|
8
8
|
const confAPIEndpoints = ({ entityType, context }) => {
|
|
9
|
-
var _a, _b;
|
|
10
9
|
let entityId, urlEntity;
|
|
11
10
|
switch (entityType) {
|
|
12
11
|
case 'Space':
|
|
13
|
-
entityId =
|
|
12
|
+
entityId = context.extension.space?.id;
|
|
14
13
|
urlEntity = 'spaces';
|
|
15
14
|
break;
|
|
16
15
|
case 'Content':
|
|
17
|
-
entityId =
|
|
16
|
+
entityId = context.extension.content?.id;
|
|
18
17
|
urlEntity = 'pages';
|
|
19
18
|
break;
|
|
20
19
|
default:
|
|
@@ -76,7 +75,6 @@ const confluenceEntity = ({ entityType, origPropertyKey, initValue }) => {
|
|
|
76
75
|
return (await (0, apiRequestUtils_1.getJSONData)(response)).value;
|
|
77
76
|
};
|
|
78
77
|
const update = async ({ endpointFactory, propertyKey }, valueUpdate) => {
|
|
79
|
-
var _a;
|
|
80
78
|
const originalProp = await fetchOriginal({ endpointFactory, propertyKey });
|
|
81
79
|
if (!originalProp) {
|
|
82
80
|
throw new types_1.EntityPropertyRequestFailedError({
|
|
@@ -88,7 +86,7 @@ const confluenceEntity = ({ entityType, origPropertyKey, initValue }) => {
|
|
|
88
86
|
}
|
|
89
87
|
const newValue = valueUpdate instanceof Function ? valueUpdate(originalProp.value) : valueUpdate;
|
|
90
88
|
const propertyId = originalProp.id;
|
|
91
|
-
const origVersion =
|
|
89
|
+
const origVersion = originalProp?.version?.number;
|
|
92
90
|
const url = endpointFactory.update(propertyId);
|
|
93
91
|
const body = JSON.stringify({
|
|
94
92
|
key: propertyKey,
|
package/out/hooks/jiraEntity.js
CHANGED
|
@@ -6,8 +6,7 @@ const apiRequestUtils_1 = require("./utils/apiRequestUtils");
|
|
|
6
6
|
const valueUtils_1 = require("./utils/valueUtils");
|
|
7
7
|
const types_1 = require("./types");
|
|
8
8
|
const issueAPIEndpoints = (context) => {
|
|
9
|
-
|
|
10
|
-
const issueId = (_a = context.extension.issue) === null || _a === void 0 ? void 0 : _a.id;
|
|
9
|
+
const issueId = context.extension.issue?.id;
|
|
11
10
|
if (!issueId)
|
|
12
11
|
throw new Error('Issue properties not available for this app.');
|
|
13
12
|
return {
|
|
@@ -52,14 +51,13 @@ const jiraIssuePropsManager = ({ origPropertyKey, initValue }) => {
|
|
|
52
51
|
(0, apiRequestUtils_1.assertSuccessfulResponse)({ entityType, propertyKey, operation: 'delete', response });
|
|
53
52
|
};
|
|
54
53
|
const get = async ({ endpointFactory, propertyKey, context }) => {
|
|
55
|
-
var _a;
|
|
56
54
|
const existingProp = await fetchOriginal({ endpointFactory, propertyKey, context });
|
|
57
55
|
if (existingProp) {
|
|
58
56
|
return existingProp.value;
|
|
59
57
|
}
|
|
60
58
|
const resolvedInitVal = await (0, valueUtils_1.resolveValue)(initValue);
|
|
61
59
|
const url = endpointFactory.create();
|
|
62
|
-
const entityId =
|
|
60
|
+
const entityId = context.extension.issue?.id;
|
|
63
61
|
const bodyData = {
|
|
64
62
|
entitiesIds: [entityId],
|
|
65
63
|
properties: {
|
package/out/hooks/useConfig.js
CHANGED
|
@@ -4,6 +4,6 @@ exports.useConfig = void 0;
|
|
|
4
4
|
const useProductContext_1 = require("./useProductContext");
|
|
5
5
|
const useConfig = () => {
|
|
6
6
|
const context = (0, useProductContext_1.useProductContext)();
|
|
7
|
-
return context
|
|
7
|
+
return context?.extension.config;
|
|
8
8
|
};
|
|
9
9
|
exports.useConfig = useConfig;
|
package/out/hooks/useForm.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/hooks/useForm.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,eAAe,EACf,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAGzB,aAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,KAAK,IAAI,CAAC;AAElF,aAAK,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAA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rB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,cAAc,CAAC,EAAE,GAAG,CAAC;CACtB,CAAC;AAEF,wBAAgB,OAAO,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,EACpE,KAAK,GAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,eAAe,CAAM;4BAK9B,MAAM;0BAuBxB,UAAU,YAAY,CAAC,YACxB,KACR,gBAAgB,YAAY,EAAE,UAAU,YAAY,CAAC,CAAC,EACtD,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,CAC7F,KACA,iBAAiB;;;;;;;;;;;;;;;EAuFrB"}
|
package/out/hooks/useForm.js
CHANGED
|
@@ -15,18 +15,18 @@ function useForm(props = {}) {
|
|
|
15
15
|
mode: 'onBlur',
|
|
16
16
|
reValidateMode: 'onChange'
|
|
17
17
|
});
|
|
18
|
-
const defaultValues = props
|
|
18
|
+
const defaultValues = props?.defaultValues;
|
|
19
19
|
const forgeFormRegister = (fieldName, options) => {
|
|
20
|
-
const
|
|
21
|
-
required: options
|
|
22
|
-
disabled: options
|
|
23
|
-
maxLength: options
|
|
24
|
-
minLength: options
|
|
25
|
-
max: options
|
|
26
|
-
min: options
|
|
27
|
-
pattern: options
|
|
28
|
-
validate: options
|
|
29
|
-
})
|
|
20
|
+
const { onChange, ref, required, disabled, onBlur, ...rest } = register(fieldName, {
|
|
21
|
+
required: options?.required,
|
|
22
|
+
disabled: options?.disabled,
|
|
23
|
+
maxLength: options?.maxLength,
|
|
24
|
+
minLength: options?.minLength,
|
|
25
|
+
max: options?.max,
|
|
26
|
+
min: options?.min,
|
|
27
|
+
pattern: options?.pattern,
|
|
28
|
+
validate: options?.validate
|
|
29
|
+
});
|
|
30
30
|
const additionalProps = {};
|
|
31
31
|
if (defaultValues) {
|
|
32
32
|
if (typeof (0, get_1.default)(defaultValues, fieldName) === 'boolean') {
|
|
@@ -41,18 +41,28 @@ function useForm(props = {}) {
|
|
|
41
41
|
shouldDirty: true,
|
|
42
42
|
shouldValidate: formState.submitCount > 0 || !!(0, get_1.default)(formState, `touchedFields["${fieldName}"]`)
|
|
43
43
|
};
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
return {
|
|
45
|
+
...rest,
|
|
46
|
+
onChange: (event) => {
|
|
47
|
+
if (event?.target?.type === 'checkbox') {
|
|
47
48
|
return Promise.resolve(setValue(fieldName, event.target.checked, onChangeOptions));
|
|
48
49
|
}
|
|
49
|
-
if (['number', 'text', 'textarea', 'radio', 'password'].includes(
|
|
50
|
+
if (['number', 'text', 'textarea', 'radio', 'password'].includes(event?.target?.type)) {
|
|
50
51
|
return Promise.resolve(setValue(fieldName, event.target.value, onChangeOptions));
|
|
51
52
|
}
|
|
52
53
|
else {
|
|
53
54
|
return Promise.resolve(setValue(fieldName, event, onChangeOptions));
|
|
54
55
|
}
|
|
55
|
-
},
|
|
56
|
+
},
|
|
57
|
+
onBlur: () => {
|
|
58
|
+
return Promise.resolve(trigger(fieldName));
|
|
59
|
+
},
|
|
60
|
+
isInvalid: isError,
|
|
61
|
+
'aria-invalid': isError,
|
|
62
|
+
id: getFieldId(fieldName),
|
|
63
|
+
isDisabled: disabled,
|
|
64
|
+
...additionalProps
|
|
65
|
+
};
|
|
56
66
|
};
|
|
57
67
|
return {
|
|
58
68
|
getFieldId,
|
package/out/reconciler.js
CHANGED
|
@@ -11,7 +11,10 @@ const newPropsWithIdPrefix = (props) => {
|
|
|
11
11
|
const idProps = ['id', 'labelFor', 'inputId'];
|
|
12
12
|
const newProps = idProps.reduce((acc, idProp) => {
|
|
13
13
|
if (props[idProp]) {
|
|
14
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
...acc,
|
|
16
|
+
[idProp]: `${idPropsPrefix}-${props[idProp]}`
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
return acc;
|
|
17
20
|
}, props);
|
|
@@ -27,12 +30,11 @@ const attachFunctionPropId = (props) => {
|
|
|
27
30
|
return props;
|
|
28
31
|
};
|
|
29
32
|
const callBridge = function (cmd, data) {
|
|
30
|
-
|
|
31
|
-
(_a = self === null || self === void 0 ? void 0 : self.__bridge) === null || _a === void 0 ? void 0 : _a.callBridge(cmd, data);
|
|
33
|
+
self?.__bridge?.callBridge(cmd, data);
|
|
32
34
|
};
|
|
33
35
|
exports.callBridge = callBridge;
|
|
34
36
|
const createElement = ({ type, props = {}, forgeReactMajorVersion }) => {
|
|
35
|
-
const { children
|
|
37
|
+
const { children, ...restProps } = props;
|
|
36
38
|
const newProps = newPropsWithIdPrefix(attachFunctionPropId(restProps));
|
|
37
39
|
const element = {
|
|
38
40
|
type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/react",
|
|
3
|
-
"version": "10.1.1
|
|
3
|
+
"version": "10.1.1",
|
|
4
4
|
"description": "Forge React reconciler",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"pack": "./build/bundle-types.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@forge/bridge": "^3.4.0
|
|
16
|
+
"@forge/bridge": "^3.4.0",
|
|
17
17
|
"@atlaskit/forge-react-types": "^0.5.2",
|
|
18
18
|
"@types/react-reconciler": "^0.28.8",
|
|
19
19
|
"lodash": "^4.17.21",
|