@atlaskit/embedded-document 1.1.0 → 1.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 +8 -0
- package/dist/types/components/document.d.ts +2 -2
- package/dist/types/components/toolbar.d.ts +1 -1
- package/dist/types/consumers/consumer.d.ts +3 -3
- package/dist/types/consumers/with-document-actions.d.ts +1 -1
- package/dist/types/context/context.d.ts +3 -3
- package/dist/types/context/embedded-document.d.ts +3 -3
- package/dist/types/model/index.d.ts +3 -3
- package/dist/types/provider/provider.d.ts +1 -1
- package/dist/types-ts4.5/components/document.d.ts +2 -2
- package/dist/types-ts4.5/components/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/consumers/consumer.d.ts +3 -3
- package/dist/types-ts4.5/consumers/with-document-actions.d.ts +1 -1
- package/dist/types-ts4.5/context/context.d.ts +3 -3
- package/dist/types-ts4.5/context/embedded-document.d.ts +3 -3
- package/dist/types-ts4.5/model/index.d.ts +3 -3
- package/dist/types-ts4.5/provider/provider.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/embedded-document
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 1.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -6,10 +6,10 @@ import { type Mode } from '../context/context';
|
|
|
6
6
|
import { type Document as DocumentModel } from '../model';
|
|
7
7
|
export interface Props extends BaseProps {
|
|
8
8
|
doc?: DocumentModel;
|
|
9
|
-
|
|
9
|
+
editorProps?: Partial<EditorProps>;
|
|
10
10
|
hasError?: boolean;
|
|
11
|
+
isLoading?: boolean;
|
|
11
12
|
mode: Mode;
|
|
12
|
-
editorProps?: Partial<EditorProps>;
|
|
13
13
|
rendererProps?: Partial<RendererProps>;
|
|
14
14
|
}
|
|
15
15
|
export default class Document extends Component<Props> {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { type Actions, type State } from '../context/context';
|
|
3
3
|
export interface Props<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> {
|
|
4
|
-
stateMapper?: (state: State) => PropsFromState;
|
|
5
4
|
actionsMapper?: (actions: Actions) => PropsFromActions;
|
|
6
|
-
renderPropsMapper?: (renderProps: any) => RenderProps;
|
|
7
5
|
children: (props: PropsFromState & PropsFromActions & RenderProps) => React.ReactNode;
|
|
6
|
+
renderPropsMapper?: (renderProps: any) => RenderProps;
|
|
7
|
+
stateMapper?: (state: State) => PropsFromState;
|
|
8
8
|
}
|
|
9
9
|
export interface ConsumerProps<A, V, R> {
|
|
10
10
|
actions: A;
|
|
11
|
-
value: V;
|
|
12
11
|
renderProps: R;
|
|
12
|
+
value: V;
|
|
13
13
|
}
|
|
14
14
|
export declare class Consumer<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
|
|
15
15
|
private previousActions;
|
|
@@ -4,9 +4,9 @@ export interface Props {
|
|
|
4
4
|
render: (actions: DocumentActions) => React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export interface DocumentActions {
|
|
7
|
+
cancelEdit: () => void;
|
|
7
8
|
createDocument: (value: any) => Promise<DocumentModel>;
|
|
8
9
|
editDocument: () => void;
|
|
9
|
-
cancelEdit: () => void;
|
|
10
10
|
updateDocument: (value: any) => Promise<DocumentModel>;
|
|
11
11
|
}
|
|
12
12
|
export default class WithDocumentActions extends PureComponent<Props> {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { type Document } from '../model';
|
|
2
2
|
export interface ContextType {
|
|
3
|
-
value: State;
|
|
4
3
|
actions: Actions;
|
|
5
4
|
renderProps: any;
|
|
5
|
+
value: State;
|
|
6
6
|
}
|
|
7
7
|
export interface State {
|
|
8
8
|
doc?: Document;
|
|
9
|
-
isLoading?: boolean;
|
|
10
9
|
hasError?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
11
|
mode?: Mode;
|
|
12
12
|
}
|
|
13
13
|
export type Mode = 'view' | 'edit' | 'create';
|
|
14
14
|
export interface Actions {
|
|
15
|
+
createDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
15
16
|
getDocument: (documentId: string, language?: string) => void;
|
|
16
17
|
getDocumentByObjectId: (objectId: string, language?: string) => void;
|
|
17
18
|
setDocumentMode: (mode: Mode) => void;
|
|
18
19
|
updateDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
19
|
-
createDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
20
20
|
}
|
|
21
21
|
export declare const Context: import("react").Context<ContextType>;
|
|
@@ -4,14 +4,14 @@ import type { Mode, State } from './context';
|
|
|
4
4
|
import type { ProviderProps } from '../provider';
|
|
5
5
|
export declare const akEditorFullPageMaxWidth = 680;
|
|
6
6
|
export interface Props extends ProviderProps {
|
|
7
|
-
|
|
8
|
-
documentId?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
9
8
|
containerId?: string;
|
|
9
|
+
documentId?: string;
|
|
10
10
|
language?: string;
|
|
11
11
|
mode?: Mode;
|
|
12
|
+
objectId: string;
|
|
12
13
|
renderTitle?: (mode: Mode, doc?: any) => ReactElement<any>;
|
|
13
14
|
renderToolbar?: (mode: Mode, editorActions?: any) => ReactElement<any>;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
16
|
export default class EmbeddedDocument extends Component<Props, State> {
|
|
17
17
|
private actions;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface Document {
|
|
2
|
-
|
|
3
|
-
objectId: string;
|
|
2
|
+
body: string;
|
|
4
3
|
containerId?: string;
|
|
5
4
|
createdBy: User;
|
|
5
|
+
documentId: string;
|
|
6
6
|
language?: string;
|
|
7
|
+
objectId: string;
|
|
7
8
|
title?: string;
|
|
8
|
-
body: string;
|
|
9
9
|
}
|
|
10
10
|
export type User = Object;
|
|
11
11
|
export interface BatchDocumentResponse {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Document } from '../model';
|
|
2
2
|
export interface Provider {
|
|
3
|
+
createDocument: (body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
3
4
|
getDocument: (documentId: string, language?: string) => Promise<Document | null>;
|
|
4
5
|
getDocumentByObjectId: (objectId: string, language?: string) => Promise<Document | null>;
|
|
5
6
|
updateDocument: (documentId: string, body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
6
|
-
createDocument: (body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
7
7
|
}
|
|
@@ -6,10 +6,10 @@ import { type Mode } from '../context/context';
|
|
|
6
6
|
import { type Document as DocumentModel } from '../model';
|
|
7
7
|
export interface Props extends BaseProps {
|
|
8
8
|
doc?: DocumentModel;
|
|
9
|
-
|
|
9
|
+
editorProps?: Partial<EditorProps>;
|
|
10
10
|
hasError?: boolean;
|
|
11
|
+
isLoading?: boolean;
|
|
11
12
|
mode: Mode;
|
|
12
|
-
editorProps?: Partial<EditorProps>;
|
|
13
13
|
rendererProps?: Partial<RendererProps>;
|
|
14
14
|
}
|
|
15
15
|
export default class Document extends Component<Props> {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { type Actions, type State } from '../context/context';
|
|
3
3
|
export interface Props<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> {
|
|
4
|
-
stateMapper?: (state: State) => PropsFromState;
|
|
5
4
|
actionsMapper?: (actions: Actions) => PropsFromActions;
|
|
6
|
-
renderPropsMapper?: (renderProps: any) => RenderProps;
|
|
7
5
|
children: (props: PropsFromState & PropsFromActions & RenderProps) => React.ReactNode;
|
|
6
|
+
renderPropsMapper?: (renderProps: any) => RenderProps;
|
|
7
|
+
stateMapper?: (state: State) => PropsFromState;
|
|
8
8
|
}
|
|
9
9
|
export interface ConsumerProps<A, V, R> {
|
|
10
10
|
actions: A;
|
|
11
|
-
value: V;
|
|
12
11
|
renderProps: R;
|
|
12
|
+
value: V;
|
|
13
13
|
}
|
|
14
14
|
export declare class Consumer<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
|
|
15
15
|
private previousActions;
|
|
@@ -4,9 +4,9 @@ export interface Props {
|
|
|
4
4
|
render: (actions: DocumentActions) => React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export interface DocumentActions {
|
|
7
|
+
cancelEdit: () => void;
|
|
7
8
|
createDocument: (value: any) => Promise<DocumentModel>;
|
|
8
9
|
editDocument: () => void;
|
|
9
|
-
cancelEdit: () => void;
|
|
10
10
|
updateDocument: (value: any) => Promise<DocumentModel>;
|
|
11
11
|
}
|
|
12
12
|
export default class WithDocumentActions extends PureComponent<Props> {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { type Document } from '../model';
|
|
2
2
|
export interface ContextType {
|
|
3
|
-
value: State;
|
|
4
3
|
actions: Actions;
|
|
5
4
|
renderProps: any;
|
|
5
|
+
value: State;
|
|
6
6
|
}
|
|
7
7
|
export interface State {
|
|
8
8
|
doc?: Document;
|
|
9
|
-
isLoading?: boolean;
|
|
10
9
|
hasError?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
11
|
mode?: Mode;
|
|
12
12
|
}
|
|
13
13
|
export type Mode = 'view' | 'edit' | 'create';
|
|
14
14
|
export interface Actions {
|
|
15
|
+
createDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
15
16
|
getDocument: (documentId: string, language?: string) => void;
|
|
16
17
|
getDocumentByObjectId: (objectId: string, language?: string) => void;
|
|
17
18
|
setDocumentMode: (mode: Mode) => void;
|
|
18
19
|
updateDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
19
|
-
createDocument: (body: string, title?: string, language?: string) => Promise<Document>;
|
|
20
20
|
}
|
|
21
21
|
export declare const Context: import("react").Context<ContextType>;
|
|
@@ -4,14 +4,14 @@ import type { Mode, State } from './context';
|
|
|
4
4
|
import type { ProviderProps } from '../provider';
|
|
5
5
|
export declare const akEditorFullPageMaxWidth = 680;
|
|
6
6
|
export interface Props extends ProviderProps {
|
|
7
|
-
|
|
8
|
-
documentId?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
9
8
|
containerId?: string;
|
|
9
|
+
documentId?: string;
|
|
10
10
|
language?: string;
|
|
11
11
|
mode?: Mode;
|
|
12
|
+
objectId: string;
|
|
12
13
|
renderTitle?: (mode: Mode, doc?: any) => ReactElement<any>;
|
|
13
14
|
renderToolbar?: (mode: Mode, editorActions?: any) => ReactElement<any>;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
16
|
export default class EmbeddedDocument extends Component<Props, State> {
|
|
17
17
|
private actions;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface Document {
|
|
2
|
-
|
|
3
|
-
objectId: string;
|
|
2
|
+
body: string;
|
|
4
3
|
containerId?: string;
|
|
5
4
|
createdBy: User;
|
|
5
|
+
documentId: string;
|
|
6
6
|
language?: string;
|
|
7
|
+
objectId: string;
|
|
7
8
|
title?: string;
|
|
8
|
-
body: string;
|
|
9
9
|
}
|
|
10
10
|
export type User = Object;
|
|
11
11
|
export interface BatchDocumentResponse {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Document } from '../model';
|
|
2
2
|
export interface Provider {
|
|
3
|
+
createDocument: (body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
3
4
|
getDocument: (documentId: string, language?: string) => Promise<Document | null>;
|
|
4
5
|
getDocumentByObjectId: (objectId: string, language?: string) => Promise<Document | null>;
|
|
5
6
|
updateDocument: (documentId: string, body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
6
|
-
createDocument: (body: string, objectId: string, title?: string, language?: string) => Promise<Document | null>;
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/embedded-document",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "DEPRECATED Embedded Document component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"@atlaskit/button": "^23.4.0",
|
|
37
37
|
"@atlaskit/editor-core": "^210.1.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
39
|
-
"@atlaskit/renderer": "^120.
|
|
39
|
+
"@atlaskit/renderer": "^120.5.0",
|
|
40
40
|
"@atlaskit/tokens": "^6.0.0",
|
|
41
41
|
"@atlaskit/util-service-support": "^6.3.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^107.
|
|
45
|
+
"@atlaskit/editor-common": "^107.29.0",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"styled-components": "^3.2.6"
|
|
48
48
|
},
|