@forge/react 11.12.0 → 11.13.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/out/__test__/reconciler.test.js +16 -0
- package/out/components/global/index.d.ts +6 -27
- package/out/components/global/index.d.ts.map +1 -1
- package/out/components/global/index.js +4 -17
- package/out/components/index.d.ts.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -116,6 +116,22 @@ describe('id props', () => {
|
|
|
116
116
|
expect(forgeDoc).toHaveProperty('children[2].props.placeholder', 'date');
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
|
+
describe('Global component reconciliation', () => {
|
|
120
|
+
let bridgeCalls = [];
|
|
121
|
+
beforeAll(async () => {
|
|
122
|
+
bridgeCalls = (0, testUtils_1.setupBridge)();
|
|
123
|
+
const App = () => {
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Global, { children: [(0, jsx_runtime_1.jsxs)(components_1.Global.Sidebar, { forYouUrl: "for-you-test", children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 1", href: "1" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 2", href: "2" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 3", href: "3" }), (0, jsx_runtime_1.jsxs)(components_1.Global.ExpandMenuItem, { label: `Campaign 49`, children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Campaign 49 Home`, href: `campaigns/49` }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Feedback for Campaign 49`, href: `campaigns/49/feedback` })] }, 49), (0, jsx_runtime_1.jsxs)(components_1.Global.ExpandMenuItem, { label: `Campaign 23`, children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Campaign 23 Home`, href: `campaigns/23` }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Feedback for Campaign 23`, href: `campaigns/23/feedback` })] }, 23)] }), (0, jsx_runtime_1.jsx)(components_1.Global.Main, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: "hello" }) })] }));
|
|
125
|
+
};
|
|
126
|
+
resetKeyCount();
|
|
127
|
+
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(App, {}));
|
|
128
|
+
});
|
|
129
|
+
it('should reconcile the Global component tree', () => {
|
|
130
|
+
const forgeDoc = (0, testUtils_1.getLastBridgeCallForgeDoc)(bridgeCalls);
|
|
131
|
+
expect(forgeDoc).not.toBeNull();
|
|
132
|
+
expect(forgeDoc).toMatchSnapshot();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
119
135
|
describe('function props __id__ attributes', () => {
|
|
120
136
|
let bridgeCalls = [];
|
|
121
137
|
beforeAll(async () => {
|
|
@@ -1,31 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare type NotGlobalComponents<T> = T extends GlobalElements ? never : T;
|
|
4
|
-
interface GlobalLinkMenuItemProps {
|
|
5
|
-
href: string;
|
|
6
|
-
label: string;
|
|
7
|
-
children?: never;
|
|
8
|
-
}
|
|
9
|
-
interface GlobalExpandableMenuItemProps {
|
|
10
|
-
children: ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalLinkMenuItemProps>[];
|
|
11
|
-
label: string;
|
|
12
|
-
}
|
|
13
|
-
interface GlobalSidebarProps {
|
|
14
|
-
forYouUrl?: string;
|
|
15
|
-
children: ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalExpandableMenuItemProps> | Array<ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalExpandableMenuItemProps>>;
|
|
16
|
-
}
|
|
17
|
-
interface GlobalMainProps {
|
|
18
|
-
children: NotGlobalComponents<ReactNode>;
|
|
19
|
-
}
|
|
20
|
-
interface GlobalProps {
|
|
21
|
-
children: [ReactElement<GlobalSidebarProps, typeof Global.Sidebar>, ReactElement<GlobalMainProps, typeof Global.Main>] | [ReactElement<GlobalMainProps, typeof Global.Main>, ReactElement<GlobalSidebarProps, typeof Global.Sidebar>];
|
|
22
|
-
}
|
|
1
|
+
import { TGlobalExpandableMenuItem, TGlobalLinkMenuItem, TGlobalSidebar, TGlobalMain, GlobalProps } from '@atlaskit/forge-react-types';
|
|
2
|
+
import { ForgeElement } from '../../types';
|
|
23
3
|
export declare const Global: {
|
|
24
4
|
(props: GlobalProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
Main
|
|
26
|
-
Sidebar
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
Main: TGlobalMain<ForgeElement<Record<string, any>>>;
|
|
6
|
+
Sidebar: TGlobalSidebar<ForgeElement<Record<string, any>>>;
|
|
7
|
+
LinkMenuItem: TGlobalLinkMenuItem<ForgeElement<Record<string, any>>>;
|
|
8
|
+
ExpandMenuItem: TGlobalExpandableMenuItem<ForgeElement<Record<string, any>>>;
|
|
29
9
|
};
|
|
30
|
-
export {};
|
|
31
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,cAAc,EACd,WAAW,EAEX,WAAW,EACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,eAAO,MAAM,MAAM;YAAW,WAAW;;;;;CAExC,CAAC"}
|
|
@@ -3,24 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Global = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const GlobalPrimitive = 'Global';
|
|
6
|
-
const GlobalMainPrimitive = 'Global.Main';
|
|
7
|
-
const GlobalSidebarPrimitive = 'Global.Sidebar';
|
|
8
|
-
const GlobalExpandMenuItemPrimitive = 'Global.ExpandMenuItem';
|
|
9
|
-
const GlobalLinkMenuItemPrimitive = 'Global.LinkMenuItem';
|
|
10
|
-
// Top level component
|
|
11
6
|
const Global = (props) => {
|
|
12
7
|
return (0, jsx_runtime_1.jsx)(GlobalPrimitive, { children: props.children });
|
|
13
8
|
};
|
|
14
9
|
exports.Global = Global;
|
|
15
|
-
exports.Global.Main =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.Global.
|
|
19
|
-
return (0, jsx_runtime_1.jsx)(GlobalSidebarPrimitive, { forYouUrl: forYouUrl, children: children });
|
|
20
|
-
};
|
|
21
|
-
exports.Global.ExpandMenuItem = ({ label, children }) => {
|
|
22
|
-
return (0, jsx_runtime_1.jsx)(GlobalExpandMenuItemPrimitive, { label: label, children: children });
|
|
23
|
-
};
|
|
24
|
-
exports.Global.LinkMenuItem = (props) => {
|
|
25
|
-
return (0, jsx_runtime_1.jsx)(GlobalLinkMenuItemPrimitive, { ...props });
|
|
26
|
-
};
|
|
10
|
+
exports.Global.Main = 'Global.Main';
|
|
11
|
+
exports.Global.Sidebar = 'Global.Sidebar';
|
|
12
|
+
exports.Global.LinkMenuItem = 'Global.LinkMenuItem';
|
|
13
|
+
exports.Global.ExpandMenuItem = 'Global.ExpandMenuItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,IAAI,SAAS,EAC5B,qBAAqB,IAAI,eAAe,EACxC,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO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AM,aAAa,UAAyC,kBAAkB,KAAK,YAAY,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export { useForm } from './hooks/useForm';
|
|
|
15
15
|
export { useObjectStore } from './hooks/useObjectStore';
|
|
16
16
|
export type { XCSSObject, DocNode, Event } from './package-types';
|
|
17
17
|
export type { AdfRendererProps, BadgeProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, CommentProps, DatePickerProps, DynamicTableProps, EmptyStateProps, ErrorMessageProps, FlexProps, FormFooterProps, FormHeaderProps, FormProps, FormSectionProps, GridProps, HeadingProps, HelperMessageProps, IconProps, InlineProps, LabelProps, LinkButtonProps, ListProps, ListItemProps, LoadingButtonProps, LozengeProps, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioGroupProps, RadioProps, RangeProps, SectionMessageActionProps, SectionMessageProps, SelectProps, SpinnerProps, StackProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagProps, TextProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, ChromelessEditorProps, CommentEditorProps, PressableProps, BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, DonutChartProps, PieChartProps, ChartColorTokens } from '@atlaskit/forge-react-types';
|
|
18
|
+
export type { GlobalProps, GlobalMainProps, GlobalSidebarProps, GlobalLinkMenuItemProps, GlobalExpandableMenuItemProps } from '@atlaskit/forge-react-types';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;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ANGED
|
@@ -14,6 +14,7 @@ var usePermissions_1 = require("./hooks/usePermissions");
|
|
|
14
14
|
Object.defineProperty(exports, "usePermissions", { enumerable: true, get: function () { return usePermissions_1.usePermissions; } });
|
|
15
15
|
var reconciler_1 = require("./reconciler");
|
|
16
16
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return reconciler_1.ForgeReconciler; } });
|
|
17
|
+
// All UI Kit component definitions
|
|
17
18
|
tslib_1.__exportStar(require("./components"), exports);
|
|
18
19
|
var useContentProperty_1 = require("./hooks/useContentProperty");
|
|
19
20
|
Object.defineProperty(exports, "useContentProperty", { enumerable: true, get: function () { return useContentProperty_1.useContentProperty; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/react",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.13.0-next.0",
|
|
4
4
|
"description": "Forge React reconciler",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^48.0.0",
|
|
33
33
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
34
|
-
"@atlaskit/forge-react-types": "^0.
|
|
35
|
-
"@forge/bridge": "^5.13.0",
|
|
34
|
+
"@atlaskit/forge-react-types": "^0.62.0",
|
|
35
|
+
"@forge/bridge": "^5.13.1-next.0",
|
|
36
36
|
"@forge/egress": "^2.3.1",
|
|
37
37
|
"@forge/i18n": "0.0.7",
|
|
38
38
|
"@types/react": "^18.2.64",
|