@atlaskit/link-create 1.3.0 → 1.5.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 +12 -0
- package/dist/cjs/controllers/callback-context/main.js +16 -5
- package/dist/cjs/controllers/edit-post-create-context/index.js +43 -0
- package/dist/cjs/controllers/form-context/main.js +15 -2
- package/dist/cjs/controllers/plugin-context/index.js +39 -0
- package/dist/cjs/ui/create-form/main.js +11 -2
- package/dist/cjs/ui/link-create/confirm-dismiss-dialog/index.js +12 -0
- package/dist/cjs/ui/link-create/confirm-dismiss-dialog/main.js +32 -0
- package/dist/cjs/ui/link-create/confirm-dismiss-dialog/messages.js +29 -0
- package/dist/cjs/ui/link-create/edit-modal/index.js +25 -0
- package/dist/cjs/ui/link-create/main.js +57 -9
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/controllers/callback-context/main.js +11 -5
- package/dist/es2019/controllers/edit-post-create-context/index.js +28 -0
- package/dist/es2019/controllers/form-context/main.js +14 -3
- package/dist/es2019/controllers/plugin-context/index.js +25 -0
- package/dist/es2019/ui/create-form/main.js +10 -3
- package/dist/es2019/ui/link-create/confirm-dismiss-dialog/index.js +1 -0
- package/dist/es2019/ui/link-create/confirm-dismiss-dialog/main.js +23 -0
- package/dist/es2019/ui/link-create/confirm-dismiss-dialog/messages.js +23 -0
- package/dist/es2019/ui/link-create/edit-modal/index.js +17 -0
- package/dist/es2019/ui/link-create/main.js +54 -9
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/controllers/callback-context/main.js +16 -5
- package/dist/esm/controllers/edit-post-create-context/index.js +33 -0
- package/dist/esm/controllers/form-context/main.js +16 -3
- package/dist/esm/controllers/plugin-context/index.js +29 -0
- package/dist/esm/ui/create-form/main.js +12 -3
- package/dist/esm/ui/link-create/confirm-dismiss-dialog/index.js +1 -0
- package/dist/esm/ui/link-create/confirm-dismiss-dialog/main.js +22 -0
- package/dist/esm/ui/link-create/confirm-dismiss-dialog/messages.js +23 -0
- package/dist/esm/ui/link-create/edit-modal/index.js +15 -0
- package/dist/esm/ui/link-create/main.js +58 -10
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/controllers/edit-post-create-context/index.d.ts +12 -0
- package/dist/types/controllers/form-context/main.d.ts +3 -0
- package/dist/types/controllers/plugin-context/index.d.ts +18 -0
- package/dist/types/ui/link-create/confirm-dismiss-dialog/index.d.ts +2 -0
- package/dist/types/ui/link-create/confirm-dismiss-dialog/main.d.ts +7 -0
- package/dist/types/ui/link-create/confirm-dismiss-dialog/messages.d.ts +23 -0
- package/dist/types/ui/link-create/edit-modal/index.d.ts +4 -0
- package/dist/types/ui/link-create/main.d.ts +3 -3
- package/dist/types-ts4.5/controllers/edit-post-create-context/index.d.ts +12 -0
- package/dist/types-ts4.5/controllers/form-context/main.d.ts +3 -0
- package/dist/types-ts4.5/controllers/plugin-context/index.d.ts +18 -0
- package/dist/types-ts4.5/ui/link-create/confirm-dismiss-dialog/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/link-create/confirm-dismiss-dialog/main.d.ts +7 -0
- package/dist/types-ts4.5/ui/link-create/confirm-dismiss-dialog/messages.d.ts +23 -0
- package/dist/types-ts4.5/ui/link-create/edit-modal/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/link-create/main.d.ts +3 -3
- package/package.json +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { LinkCreateWithModalProps } from '../../common/types';
|
|
3
3
|
export declare const TEST_ID = "link-create";
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const _default: (props: LinkCreateWithModalProps) => JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CreatePayload } from '../../common/types';
|
|
3
|
+
type EditPostCreateModalContextValue = {
|
|
4
|
+
editViewPayload?: CreatePayload | undefined;
|
|
5
|
+
setEditViewPayload: (payload?: CreatePayload) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const EditPostCreateModalProvider: ({ active, children, }: {
|
|
8
|
+
active: boolean;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export declare const useEditPostCreateModal: () => EditPostCreateModalContextValue;
|
|
12
|
+
export {};
|
|
@@ -4,6 +4,8 @@ interface FormContextType {
|
|
|
4
4
|
getValidators: () => ValidatorMap;
|
|
5
5
|
assignValidator: (name: string, validators: Validator[]) => void;
|
|
6
6
|
setFormErrorMessage: (errorMessage?: string) => void;
|
|
7
|
+
setFormDirty: (dirty?: boolean) => void;
|
|
8
|
+
isFormDirty: () => boolean;
|
|
7
9
|
formErrorMessage?: string;
|
|
8
10
|
/**
|
|
9
11
|
* Callback that updates link create to tell it that it should/should not open the current plugins
|
|
@@ -11,6 +13,7 @@ interface FormContextType {
|
|
|
11
13
|
* is not defined as a prop at the `LinkCreate` props level
|
|
12
14
|
*/
|
|
13
15
|
enableEditView?: ((editButtonClicked: boolean) => void) | undefined;
|
|
16
|
+
formDirty?: boolean;
|
|
14
17
|
}
|
|
15
18
|
export declare const FormContext: React.Context<FormContextType>;
|
|
16
19
|
declare const FormContextProvider: React.FC<{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkCreatePlugin } from '../../common/types';
|
|
3
|
+
type LinkCreatePluginsProviderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The list of plugins provided as a prop to Link Create component
|
|
6
|
+
*/
|
|
7
|
+
plugins: LinkCreatePlugin[];
|
|
8
|
+
/**
|
|
9
|
+
* The entity key as provided as prop to link create which controls the initially active plugin
|
|
10
|
+
*/
|
|
11
|
+
entityKey: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare const LinkCreatePluginsProvider: ({ plugins, entityKey: propEntityKey, children, }: LinkCreatePluginsProviderProps) => JSX.Element;
|
|
15
|
+
export declare const useLinkCreatePlugins: () => {
|
|
16
|
+
activePlugin: LinkCreatePlugin | null;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ConfirmDismissDialogProps = {
|
|
3
|
+
active: boolean;
|
|
4
|
+
onCancelDismiss?: () => void;
|
|
5
|
+
onConfirmDismiss?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const ConfirmDismissDialog: ({ active, onCancelDismiss, onConfirmDismiss, }: ConfirmDismissDialogProps) => JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
cancelButtonLabel: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
confirmButtonLabel: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
description: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { LinkCreateWithModalProps } from '../../common/types';
|
|
3
3
|
export declare const TEST_ID = "link-create";
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const _default: (props: LinkCreateWithModalProps) => JSX.Element;
|
|
5
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@atlaskit/intl-messages-provider": "^1.0.0",
|
|
43
43
|
"@atlaskit/modal-dialog": "^12.8.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
45
|
+
"@atlaskit/primitives": "^1.6.0",
|
|
45
46
|
"@atlaskit/select": "^16.7.0",
|
|
46
47
|
"@atlaskit/spinner": "^15.6.0",
|
|
47
48
|
"@atlaskit/textfield": "^5.6.0",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"@atlaskit/link-test-helpers": "^6.2.0",
|
|
62
63
|
"@atlaskit/visual-regression": "*",
|
|
63
64
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
64
|
-
"@atlassian/feature-flags-test-utils": "
|
|
65
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
65
66
|
"@testing-library/react": "^12.1.5",
|
|
66
67
|
"@testing-library/user-event": "^14.4.3",
|
|
67
68
|
"@types/debounce-promise": "^3.1.2",
|
|
@@ -113,6 +114,9 @@
|
|
|
113
114
|
"platform-feature-flags": {
|
|
114
115
|
"platform.linking-platform.link-create.enable-edit": {
|
|
115
116
|
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"platform.linking-platform.link-create.confirm-dismiss-dialog": {
|
|
119
|
+
"type": "boolean"
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
}
|