@atlaskit/inline-edit 12.2.1 → 12.2.3
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/inline-edit.js +1 -1
- package/dist/cjs/internal/read-view.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/inline-edit.js +1 -1
- package/dist/es2019/internal/read-view.js +4 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/inline-edit.js +1 -1
- package/dist/esm/internal/read-view.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/hooks/use-button-focus-hook.d.ts +1 -1
- package/dist/types-ts4.0/entry-points/inline-edit.d.ts +1 -0
- package/dist/types-ts4.0/entry-points/inline-editable-textfield.d.ts +1 -0
- package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +3 -0
- package/dist/types-ts4.0/inline-edit.d.ts +4 -0
- package/dist/types-ts4.0/inline-editable-textfield.d.ts +5 -0
- package/dist/types-ts4.0/internal/buttons.d.ts +13 -0
- package/dist/types-ts4.0/internal/constants.d.ts +3 -0
- package/dist/types-ts4.0/internal/hooks/use-button-focus-hook.d.ts +8 -0
- package/dist/types-ts4.0/internal/read-view.d.ts +13 -0
- package/dist/types-ts4.0/types.d.ts +68 -0
- package/inline-edit/package.json +8 -1
- package/inline-editable-textfield/package.json +8 -1
- package/package.json +18 -8
- package/report.api.md +7 -6
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 12.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9de88fa1e1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9de88fa1e1e) - Internal changes to include spacing tokens in component implementations.
|
|
8
|
+
|
|
9
|
+
## 12.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
14
|
+
|
|
3
15
|
## 12.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -25,8 +25,10 @@ var readViewContainerStyles = (0, _react2.css)({
|
|
|
25
25
|
});
|
|
26
26
|
var editButtonStyles = (0, _react2.css)({
|
|
27
27
|
display: 'block',
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
29
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
30
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
31
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
30
32
|
appearance: 'none',
|
|
31
33
|
background: 'transparent',
|
|
32
34
|
border: 0,
|
package/dist/cjs/version.json
CHANGED
|
@@ -8,8 +8,10 @@ const readViewContainerStyles = css({
|
|
|
8
8
|
});
|
|
9
9
|
const editButtonStyles = css({
|
|
10
10
|
display: 'block',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
12
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
13
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
14
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
13
15
|
appearance: 'none',
|
|
14
16
|
background: 'transparent',
|
|
15
17
|
border: 0,
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/inline-edit.js
CHANGED
|
@@ -8,8 +8,10 @@ var readViewContainerStyles = css({
|
|
|
8
8
|
});
|
|
9
9
|
var editButtonStyles = css({
|
|
10
10
|
display: 'block',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
12
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
13
|
+
// TODO Delete this comment after verifying spacing token -> previous value `'0'`
|
|
14
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
13
15
|
appearance: 'none',
|
|
14
16
|
background: 'transparent',
|
|
15
17
|
border: 0,
|
package/dist/esm/version.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
declare const useButtonFocusHook: (isEditing: boolean | undefined, isEditingState: boolean) => {
|
|
3
3
|
editButtonRef: import("react").RefObject<HTMLButtonElement>;
|
|
4
4
|
editViewRef: import("react").MutableRefObject<HTMLElement | undefined>;
|
|
5
|
-
shouldBeEditing: boolean
|
|
5
|
+
shouldBeEditing: boolean;
|
|
6
6
|
doNotFocusOnEditButton: () => boolean;
|
|
7
7
|
};
|
|
8
8
|
export default useButtonFocusHook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../inline-edit';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../inline-editable-textfield';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { InlineEditableTextfieldProps, InlineEditProps } from '../types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
5
|
+
interface ButtonsProp {
|
|
6
|
+
mode: ThemeModes;
|
|
7
|
+
confirmButtonLabel: string;
|
|
8
|
+
cancelButtonLabel: string;
|
|
9
|
+
onMouseDown: () => void;
|
|
10
|
+
onCancelClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Buttons: ({ mode, confirmButtonLabel, cancelButtonLabel, onMouseDown, onCancelClick, }: ButtonsProp) => jsx.JSX.Element;
|
|
13
|
+
export default Buttons;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const useButtonFocusHook: (isEditing: boolean | undefined, isEditingState: boolean) => {
|
|
3
|
+
editButtonRef: import("react").RefObject<HTMLButtonElement>;
|
|
4
|
+
editViewRef: import("react").MutableRefObject<HTMLElement | undefined>;
|
|
5
|
+
shouldBeEditing: boolean;
|
|
6
|
+
doNotFocusOnEditButton: () => boolean;
|
|
7
|
+
};
|
|
8
|
+
export default useButtonFocusHook;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
interface ReadViewProps {
|
|
5
|
+
editButtonLabel: string;
|
|
6
|
+
onEditRequested: () => void;
|
|
7
|
+
postReadViewClick: () => void;
|
|
8
|
+
editButtonRef: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
readViewFitContainerWidth?: boolean;
|
|
10
|
+
readView: () => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const ReadView: ({ editButtonLabel, onEditRequested, postReadViewClick, editButtonRef, readViewFitContainerWidth, readView, }: ReadViewProps) => jsx.JSX.Element;
|
|
13
|
+
export default ReadView;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { FieldProps } from '@atlaskit/form';
|
|
4
|
+
interface CommonProps extends WithAnalyticsEventsProps {
|
|
5
|
+
/** Additional information to be included in the `context` of analytics events that come from button. */
|
|
6
|
+
analyticsContext?: Record<string, any>;
|
|
7
|
+
/** Accessibility label for the cancel action button. */
|
|
8
|
+
cancelButtonLabel?: string;
|
|
9
|
+
/** Accessibility label for the confirm action button, which saves the field value into `editValue`. */
|
|
10
|
+
confirmButtonLabel?: string;
|
|
11
|
+
/** The user input entered into the field during `editView`. This value is updated and saved by `onConfirm`. */
|
|
12
|
+
defaultValue: any;
|
|
13
|
+
/** Label above the input field that communicates what value should be entered. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Displays an inline dialog with a message when the field input is invalid. This is handled by `react-final-form`. */
|
|
16
|
+
validate?: (value: any, formState: {}, fieldState: {}) => string | void | Promise<string | void>;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the view when the element blurs and loses focus (this can happen when a user clicks away).
|
|
19
|
+
* When set to true, inline edit stays in `editView` when blurred. */
|
|
20
|
+
keepEditViewOpenOnBlur?: boolean;
|
|
21
|
+
/** Sets whether the confirm and cancel action buttons are displayed in the bottom right of the field. */
|
|
22
|
+
hideActionButtons?: boolean;
|
|
23
|
+
/** Determines whether the input value can be confirmed as empty. */
|
|
24
|
+
isRequired?: boolean;
|
|
25
|
+
/** Determines whether the `readView` has 100% width within its container, or whether it fits the content. */
|
|
26
|
+
readViewFitContainerWidth?: boolean;
|
|
27
|
+
/** Accessibility label for button, which is used to enter `editView` from keyboard. */
|
|
28
|
+
editButtonLabel?: string;
|
|
29
|
+
/** Exits `editView` and switches back to `readView`. This is called when the cancel action button (x) is clicked. */
|
|
30
|
+
onCancel?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Determines whether it begins in `editView` or `readView`. When set to true, `isEditing` begins as true and the inline edit
|
|
33
|
+
* starts in `editView`.
|
|
34
|
+
*/
|
|
35
|
+
startWithEditViewOpen?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ExtendedFieldProps<FieldValue> extends FieldProps<FieldValue> {
|
|
38
|
+
errorMessage?: string | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface InlineEditProps<FieldValue> extends CommonProps {
|
|
41
|
+
/** The component shown when user is editing (when the inline edit is not in `readView`). */
|
|
42
|
+
editView: (fieldProps: ExtendedFieldProps<FieldValue>, ref: React.RefObject<any>) => React.ReactNode;
|
|
43
|
+
/** Sets whether the component shows the `readView` or the `editView`. This is used to manage the state of the input in stateless inline edit. */
|
|
44
|
+
isEditing?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
Saves and confirms the value entered into the field. It exits `editView` and returns to `readView`.
|
|
47
|
+
*/
|
|
48
|
+
onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
|
|
49
|
+
/** Handler called when readView is clicked. */
|
|
50
|
+
onEdit?: () => void;
|
|
51
|
+
/** The component shown when not in `editView`. This is when the inline edit is read-only and not being edited.*/
|
|
52
|
+
readView: () => React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export interface InlineEditableTextfieldProps extends CommonProps {
|
|
55
|
+
/** Sets height of the text field to compact. The top and bottom padding is decreased. */
|
|
56
|
+
isCompact?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Calls the `editView` handler. It confirms the changes.
|
|
59
|
+
* The field value is passed as an argument to this function.
|
|
60
|
+
*/
|
|
61
|
+
onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
62
|
+
/** Text shown in `readView` when the field value is an empty string. */
|
|
63
|
+
placeholder: string;
|
|
64
|
+
/** A `testId` prop is provided for specific elements. This is a unique string that appears as a data attribute `data-testid` in the rendered code and serves as a hook for automated tests.
|
|
65
|
+
*/
|
|
66
|
+
testId?: string;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
package/inline-edit/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/inline-edit.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/inline-edit.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/inline-edit.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/inline-edit.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/inline-edit.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/inline-editable-textfield.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/inline-editable-textfield.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/inline-editable-textfield.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/inline-editable-textfield.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/inline-editable-textfield.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.2.
|
|
3
|
+
"version": "12.2.3",
|
|
4
4
|
"description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,10 +12,19 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*",
|
|
19
|
+
"dist/types-ts4.0/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"homepage": "https://atlassian.design/components/inline-edit/",
|
|
18
26
|
"atlassian": {
|
|
27
|
+
"disableProductCI": true,
|
|
19
28
|
"team": "Design System Team",
|
|
20
29
|
"releaseModel": "scheduled",
|
|
21
30
|
"website": {
|
|
@@ -27,10 +36,10 @@
|
|
|
27
36
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
28
37
|
"@atlaskit/button": "^16.3.0",
|
|
29
38
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
30
|
-
"@atlaskit/form": "^8.
|
|
31
|
-
"@atlaskit/icon": "^21.
|
|
39
|
+
"@atlaskit/form": "^8.6.0",
|
|
40
|
+
"@atlaskit/icon": "^21.11.0",
|
|
32
41
|
"@atlaskit/inline-dialog": "^13.4.0",
|
|
33
|
-
"@atlaskit/textfield": "^5.
|
|
42
|
+
"@atlaskit/textfield": "^5.3.0",
|
|
34
43
|
"@atlaskit/theme": "^12.2.0",
|
|
35
44
|
"@atlaskit/tokens": "^0.10.0",
|
|
36
45
|
"@babel/runtime": "^7.0.0",
|
|
@@ -40,14 +49,14 @@
|
|
|
40
49
|
"react": "^16.8.0"
|
|
41
50
|
},
|
|
42
51
|
"devDependencies": {
|
|
43
|
-
"@atlaskit/datetime-picker": "^12.
|
|
52
|
+
"@atlaskit/datetime-picker": "^12.3.0",
|
|
44
53
|
"@atlaskit/docs": "*",
|
|
45
|
-
"@atlaskit/section-message": "^6.
|
|
54
|
+
"@atlaskit/section-message": "^6.3.0",
|
|
46
55
|
"@atlaskit/select": "^15.7.0",
|
|
47
56
|
"@atlaskit/ssr": "*",
|
|
48
57
|
"@atlaskit/tag": "^11.4.0",
|
|
49
58
|
"@atlaskit/tag-group": "^10.1.0",
|
|
50
|
-
"@atlaskit/textarea": "^4.
|
|
59
|
+
"@atlaskit/textarea": "^4.5.0",
|
|
51
60
|
"@atlaskit/visual-regression": "*",
|
|
52
61
|
"@atlaskit/webdriver-runner": "*",
|
|
53
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -58,7 +67,7 @@
|
|
|
58
67
|
"jscodeshift": "^0.13.0",
|
|
59
68
|
"react-dom": "^16.8.0",
|
|
60
69
|
"storybook-addon-performance": "^0.16.0",
|
|
61
|
-
"typescript": "4.
|
|
70
|
+
"typescript": "4.5.5",
|
|
62
71
|
"wait-for-expect": "^1.2.0"
|
|
63
72
|
},
|
|
64
73
|
"keywords": [
|
|
@@ -74,6 +83,7 @@
|
|
|
74
83
|
"dom-events": "use-bind-event-listener",
|
|
75
84
|
"ui-components": "lite-mode",
|
|
76
85
|
"analytics": "analytics-next",
|
|
86
|
+
"design-tokens": "spacing",
|
|
77
87
|
"theming": "tokens",
|
|
78
88
|
"deprecation": "no-deprecated-imports",
|
|
79
89
|
"styling": [
|
package/report.api.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/inline-edit"
|
|
1
|
+
## API Report File for "@atlaskit/inline-edit".
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
/// <reference types="react" />
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
6
|
|
|
7
|
+
```ts
|
|
8
8
|
import { FieldProps } from '@atlaskit/form';
|
|
9
|
+
import { jsx } from '@emotion/react';
|
|
9
10
|
import { default as React_2 } from 'react';
|
|
10
11
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
11
12
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
@@ -55,12 +56,12 @@ declare interface ExtendedFieldProps<FieldValue>
|
|
|
55
56
|
|
|
56
57
|
declare const InlineEdit: <FieldValue extends unknown = string>(
|
|
57
58
|
props: InlineEditProps<FieldValue>,
|
|
58
|
-
) => JSX.Element;
|
|
59
|
+
) => jsx.JSX.Element;
|
|
59
60
|
export default InlineEdit;
|
|
60
61
|
|
|
61
62
|
export declare const InlineEditableTextfield: (
|
|
62
63
|
props: InlineEditableTextfieldProps,
|
|
63
|
-
) => JSX.Element;
|
|
64
|
+
) => jsx.JSX.Element;
|
|
64
65
|
|
|
65
66
|
export declare interface InlineEditableTextfieldProps extends CommonProps {
|
|
66
67
|
/** Sets height of the text field to compact. The top and bottom padding is decreased. */
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|