@atlaskit/editor-plugin-date 0.1.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/.eslintrc.js +6 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE.md +13 -0
- package/README.md +30 -0
- package/dist/cjs/commands.js +5 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/types.js +5 -0
- package/dist/es2019/commands.js +1 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/types.js +1 -0
- package/dist/esm/commands.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/types/commands.d.ts +10 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types.d.ts +27 -0
- package/dist/types-ts4.5/commands.d.ts +10 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/types.d.ts +30 -0
- package/package.json +82 -0
- package/report.api.md +86 -0
- package/tmp/api-report-tmp.d.ts +59 -0
package/.eslintrc.js
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @atlaskit/editor-plugin-date
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41572](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41572) [`e2c74f2ae09`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2c74f2ae09) - Scaffolding for editor-plugin-date. Adds package.json, LICENSE, tsconfig, exported type and other fundamentals required to create a new package
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2023 Atlassian Pty Ltd
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Editor plugin date
|
|
2
|
+
|
|
3
|
+
Date plugin for @atlaskit/editor-core
|
|
4
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
5
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
---
|
|
9
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-date*
|
|
10
|
+
- **npm** - [@atlaskit/editor-plugin-date](https://www.npmjs.com/package/@atlaskit/editor-plugin-date)
|
|
11
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-date)
|
|
12
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-date/dist/)
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
**Internal use only**
|
|
18
|
+
@atlaskit/editor-plugin-date is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
19
|
+
Direct use of this component is not supported.
|
|
20
|
+
Please see [Atlaskit - Editor plugin Date Dialog](https://atlaskit.atlassian.com/packages/editor/editor-plugin-date) for documentation and examples for this package.
|
|
21
|
+
|
|
22
|
+
## Support
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { DateType } from './types';
|
|
4
|
+
export type DeleteDate = EditorCommand;
|
|
5
|
+
export type InsertDate = (props: {
|
|
6
|
+
date?: DateType;
|
|
7
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
8
|
+
commitMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD;
|
|
9
|
+
enterPressed?: boolean;
|
|
10
|
+
}) => EditorCommand;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
2
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
|
+
import type { DeleteDate, InsertDate } from './commands';
|
|
6
|
+
export type DateType = {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
day?: number;
|
|
10
|
+
};
|
|
11
|
+
export interface DatePluginConfig {
|
|
12
|
+
weekStartDay?: WeekDay;
|
|
13
|
+
}
|
|
14
|
+
export type DatePluginSharedState = {
|
|
15
|
+
showDatePickerAt?: number | null;
|
|
16
|
+
isNew: boolean;
|
|
17
|
+
focusDateInput: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type DatePlugin = NextEditorPlugin<'date', {
|
|
20
|
+
pluginConfiguration: DatePluginConfig | undefined;
|
|
21
|
+
dependencies: [typeof analyticsPlugin, EditorDisabledPlugin];
|
|
22
|
+
sharedState: DatePluginSharedState;
|
|
23
|
+
commands: {
|
|
24
|
+
insertDate: InsertDate;
|
|
25
|
+
deleteDate: DeleteDate;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { DateType } from './types';
|
|
4
|
+
export type DeleteDate = EditorCommand;
|
|
5
|
+
export type InsertDate = (props: {
|
|
6
|
+
date?: DateType;
|
|
7
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
8
|
+
commitMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD;
|
|
9
|
+
enterPressed?: boolean;
|
|
10
|
+
}) => EditorCommand;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
2
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
|
+
import type { DeleteDate, InsertDate } from './commands';
|
|
6
|
+
export type DateType = {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
day?: number;
|
|
10
|
+
};
|
|
11
|
+
export interface DatePluginConfig {
|
|
12
|
+
weekStartDay?: WeekDay;
|
|
13
|
+
}
|
|
14
|
+
export type DatePluginSharedState = {
|
|
15
|
+
showDatePickerAt?: number | null;
|
|
16
|
+
isNew: boolean;
|
|
17
|
+
focusDateInput: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type DatePlugin = NextEditorPlugin<'date', {
|
|
20
|
+
pluginConfiguration: DatePluginConfig | undefined;
|
|
21
|
+
dependencies: [
|
|
22
|
+
typeof analyticsPlugin,
|
|
23
|
+
EditorDisabledPlugin
|
|
24
|
+
];
|
|
25
|
+
sharedState: DatePluginSharedState;
|
|
26
|
+
commands: {
|
|
27
|
+
insertDate: InsertDate;
|
|
28
|
+
deleteDate: DeleteDate;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: AI",
|
|
12
|
+
"singleton": true,
|
|
13
|
+
"releaseModel": "continuous"
|
|
14
|
+
},
|
|
15
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
16
|
+
"main": "dist/cjs/index.js",
|
|
17
|
+
"module": "dist/esm/index.js",
|
|
18
|
+
"module:es2019": "dist/es2019/index.js",
|
|
19
|
+
"types": "dist/types/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
">=4.5 <4.9": {
|
|
22
|
+
"*": [
|
|
23
|
+
"dist/types-ts4.5/*",
|
|
24
|
+
"dist/types-ts4.5/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"atlaskit:src": "src/index.ts",
|
|
30
|
+
"af:exports": {
|
|
31
|
+
".": "./src/index.ts"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@atlaskit/calendar": "^13.3.0",
|
|
35
|
+
"@atlaskit/editor-common": "^76.10.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
38
|
+
"@babel/runtime": "^7.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^16.8.0"
|
|
45
|
+
},
|
|
46
|
+
"techstack": {
|
|
47
|
+
"@atlassian/frontend": {
|
|
48
|
+
"import-structure": [
|
|
49
|
+
"atlassian-conventions"
|
|
50
|
+
],
|
|
51
|
+
"circular-dependencies": [
|
|
52
|
+
"file-and-folder-level"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"@repo/internal": {
|
|
56
|
+
"dom-events": "use-bind-event-listener",
|
|
57
|
+
"analytics": [
|
|
58
|
+
"analytics-next"
|
|
59
|
+
],
|
|
60
|
+
"design-tokens": [
|
|
61
|
+
"color"
|
|
62
|
+
],
|
|
63
|
+
"theming": [
|
|
64
|
+
"react-context"
|
|
65
|
+
],
|
|
66
|
+
"ui-components": [
|
|
67
|
+
"lite-mode"
|
|
68
|
+
],
|
|
69
|
+
"deprecation": [
|
|
70
|
+
"no-deprecated-imports"
|
|
71
|
+
],
|
|
72
|
+
"styling": [
|
|
73
|
+
"static",
|
|
74
|
+
"emotion"
|
|
75
|
+
],
|
|
76
|
+
"imports": [
|
|
77
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
82
|
+
}
|
package/report.api.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
3
|
+
## API Report File for "@atlaskit/editor-plugin-date"
|
|
4
|
+
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
12
|
+
|
|
13
|
+
### Main Entry Types
|
|
14
|
+
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
19
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
20
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
21
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
22
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
23
|
+
import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
24
|
+
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
25
|
+
|
|
26
|
+
// @public (undocumented)
|
|
27
|
+
export type DatePlugin = NextEditorPlugin<
|
|
28
|
+
'date',
|
|
29
|
+
{
|
|
30
|
+
pluginConfiguration: DatePluginConfig | undefined;
|
|
31
|
+
dependencies: [typeof analyticsPlugin, EditorDisabledPlugin];
|
|
32
|
+
sharedState: DatePluginSharedState;
|
|
33
|
+
commands: {
|
|
34
|
+
insertDate: InsertDate;
|
|
35
|
+
deleteDate: DeleteDate;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
// @public (undocumented)
|
|
41
|
+
export interface DatePluginConfig {
|
|
42
|
+
// (undocumented)
|
|
43
|
+
weekStartDay?: WeekDay;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// @public (undocumented)
|
|
47
|
+
export type DatePluginSharedState = {
|
|
48
|
+
showDatePickerAt?: null | number;
|
|
49
|
+
isNew: boolean;
|
|
50
|
+
focusDateInput: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// @public (undocumented)
|
|
54
|
+
export type DateType = {
|
|
55
|
+
year: number;
|
|
56
|
+
month: number;
|
|
57
|
+
day?: number;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export type DeleteDate = EditorCommand;
|
|
62
|
+
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export type InsertDate = (props: {
|
|
65
|
+
date?: DateType;
|
|
66
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
67
|
+
commitMethod?: INPUT_METHOD.KEYBOARD | INPUT_METHOD.PICKER;
|
|
68
|
+
enterPressed?: boolean;
|
|
69
|
+
}) => EditorCommand;
|
|
70
|
+
|
|
71
|
+
// (No @packageDocumentation comment for this package)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
<!--SECTION END: Main Entry Types-->
|
|
75
|
+
|
|
76
|
+
### Peer Dependencies
|
|
77
|
+
|
|
78
|
+
<!--SECTION START: Peer Dependencies-->
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"react": "^16.8.0"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-date"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
10
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
12
|
+
import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
13
|
+
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
14
|
+
|
|
15
|
+
// @public (undocumented)
|
|
16
|
+
export type DatePlugin = NextEditorPlugin<'date', {
|
|
17
|
+
pluginConfiguration: DatePluginConfig | undefined;
|
|
18
|
+
dependencies: [typeof analyticsPlugin, EditorDisabledPlugin];
|
|
19
|
+
sharedState: DatePluginSharedState;
|
|
20
|
+
commands: {
|
|
21
|
+
insertDate: InsertDate;
|
|
22
|
+
deleteDate: DeleteDate;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
// @public (undocumented)
|
|
27
|
+
export interface DatePluginConfig {
|
|
28
|
+
// (undocumented)
|
|
29
|
+
weekStartDay?: WeekDay;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// @public (undocumented)
|
|
33
|
+
export type DatePluginSharedState = {
|
|
34
|
+
showDatePickerAt?: null | number;
|
|
35
|
+
isNew: boolean;
|
|
36
|
+
focusDateInput: boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
export type DateType = {
|
|
41
|
+
year: number;
|
|
42
|
+
month: number;
|
|
43
|
+
day?: number;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// @public (undocumented)
|
|
47
|
+
export type DeleteDate = EditorCommand;
|
|
48
|
+
|
|
49
|
+
// @public (undocumented)
|
|
50
|
+
export type InsertDate = (props: {
|
|
51
|
+
date?: DateType;
|
|
52
|
+
inputMethod?: TOOLBAR_MENU_TYPE;
|
|
53
|
+
commitMethod?: INPUT_METHOD.KEYBOARD | INPUT_METHOD.PICKER;
|
|
54
|
+
enterPressed?: boolean;
|
|
55
|
+
}) => EditorCommand;
|
|
56
|
+
|
|
57
|
+
// (No @packageDocumentation comment for this package)
|
|
58
|
+
|
|
59
|
+
```
|