@atlaskit/editor-common 72.5.1 → 72.6.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 +41 -0
- package/dist/cjs/node-width/index.js +18 -4
- package/dist/cjs/preset/builder.js +180 -0
- package/dist/cjs/preset/index.js +19 -0
- package/dist/cjs/preset/plugin-injection-api.js +223 -0
- package/dist/cjs/styles/shared/media-single.js +1 -1
- package/dist/cjs/styles/shared/panel.js +2 -2
- package/dist/cjs/styles/shared/table.js +2 -1
- package/dist/cjs/styles/shared/tableCell.js +31 -0
- package/dist/cjs/ui/DropList/index.js +6 -3
- package/dist/cjs/ui-color/ColorPalette/Color/styles.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +14 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +139 -8
- package/dist/cjs/ui-color/ColorPalette/index.js +10 -11
- package/dist/cjs/ui-color/index.js +13 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
- package/dist/cjs/ui-menu/Dropdown/index.js +18 -8
- package/dist/cjs/ui-menu/DropdownMenu/index.js +1 -1
- package/dist/cjs/utils/breakout.js +12 -4
- package/dist/cjs/utils/index.js +12 -7
- package/dist/cjs/utils/nodes.js +38 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/node-width/index.js +18 -4
- package/dist/es2019/preset/builder.js +138 -0
- package/dist/es2019/preset/index.js +2 -0
- package/dist/es2019/preset/plugin-injection-api.js +176 -0
- package/dist/es2019/styles/shared/media-single.js +9 -0
- package/dist/es2019/styles/shared/panel.js +2 -2
- package/dist/es2019/styles/shared/table.js +2 -0
- package/dist/es2019/styles/shared/tableCell.js +27 -0
- package/dist/es2019/ui/DropList/index.js +6 -3
- package/dist/es2019/ui-color/ColorPalette/Color/styles.js +3 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/index.js +2 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +137 -7
- package/dist/es2019/ui-color/ColorPalette/index.js +10 -8
- package/dist/es2019/ui-color/index.js +1 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
- package/dist/es2019/ui-menu/Dropdown/index.js +18 -6
- package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -1
- package/dist/es2019/utils/breakout.js +13 -5
- package/dist/es2019/utils/index.js +1 -2
- package/dist/es2019/utils/nodes.js +34 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/node-width/index.js +18 -4
- package/dist/esm/preset/builder.js +172 -0
- package/dist/esm/preset/index.js +2 -0
- package/dist/esm/preset/plugin-injection-api.js +213 -0
- package/dist/esm/styles/shared/media-single.js +1 -1
- package/dist/esm/styles/shared/panel.js +2 -2
- package/dist/esm/styles/shared/table.js +2 -1
- package/dist/esm/styles/shared/tableCell.js +24 -0
- package/dist/esm/ui/DropList/index.js +6 -3
- package/dist/esm/ui-color/ColorPalette/Color/styles.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/index.js +2 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +132 -5
- package/dist/esm/ui-color/ColorPalette/index.js +10 -11
- package/dist/esm/ui-color/index.js +1 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
- package/dist/esm/ui-menu/Dropdown/index.js +18 -8
- package/dist/esm/ui-menu/DropdownMenu/index.js +1 -1
- package/dist/esm/utils/breakout.js +13 -5
- package/dist/esm/utils/index.js +1 -2
- package/dist/esm/utils/nodes.js +34 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/card/cardOptions.d.ts +1 -0
- package/dist/types/preset/builder.d.ts +30 -0
- package/dist/types/preset/index.d.ts +2 -0
- package/dist/types/preset/plugin-injection-api.d.ts +43 -0
- package/dist/types/provider-factory/provider-factory.d.ts +1 -1
- package/dist/types/styles/shared/tableCell.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +18 -3
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +56 -28
- package/dist/types/ui/DropList/index.d.ts +2 -1
- package/dist/types/ui-color/ColorPalette/Palettes/index.d.ts +1 -0
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +648 -2
- package/dist/types/ui-color/ColorPalette/Palettes/type.d.ts +4 -0
- package/dist/types/ui-color/ColorPalette/index.d.ts +36 -17
- package/dist/types/ui-color/index.d.ts +2 -1
- package/dist/types/ui-menu/Dropdown/index.d.ts +3 -0
- package/dist/types/utils/breakout.d.ts +10 -2
- package/dist/types/utils/index.d.ts +1 -2
- package/dist/types/utils/nodes.d.ts +15 -1
- package/package.json +13 -12
- package/preset/package.json +15 -0
- package/dist/cjs/utils/builder.js +0 -34
- package/dist/es2019/utils/builder.js +0 -14
- package/dist/esm/utils/builder.js +0 -26
- package/dist/types/utils/builder.d.ts +0 -8
|
@@ -1,31 +1,50 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { PaletteColor } from './Palettes/type';
|
|
4
|
+
import { PaletteColor, PaletteTooltipMessages } from './Palettes/type';
|
|
5
5
|
interface Props {
|
|
6
|
-
palette: PaletteColor[];
|
|
7
6
|
selectedColor: string | null;
|
|
8
7
|
onClick: (value: string, label: string) => void;
|
|
9
8
|
cols?: number;
|
|
10
9
|
className?: string;
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - the check mark color uses design tokens when available
|
|
15
|
-
* - the colors use design tokens when available
|
|
16
|
-
* @default false
|
|
11
|
+
* paletteOptions is the prop, where any configuration related to
|
|
12
|
+
* how palette should look or behave will be added.
|
|
17
13
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
paletteOptions: {
|
|
15
|
+
palette: PaletteColor[];
|
|
16
|
+
/**
|
|
17
|
+
* If hexToPaletteColor is passed, it will be called to convert
|
|
18
|
+
* hexCodes passed in palette props to DST token.
|
|
19
|
+
* Different color palette will set different mapping function.
|
|
20
|
+
* Such as text and background color palette uses different
|
|
21
|
+
* mapping function to map tokens.
|
|
22
|
+
*/
|
|
23
|
+
hexToPaletteColor?: (hexColor: string) => string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* We have pivoted from having logic inside ColorPalette determining
|
|
26
|
+
* which tooltip messages should be used to consumer of ColorPalette giving
|
|
27
|
+
* tooltip messages. Which is same as palette, where consumer determines which
|
|
28
|
+
* colors ColorPalette should render.
|
|
29
|
+
* Same way now consumer will determine which tooltip messages should
|
|
30
|
+
* be used using paletteColorTooltipMessages option.
|
|
31
|
+
*/
|
|
32
|
+
paletteColorTooltipMessages?: PaletteTooltipMessages;
|
|
33
|
+
/**
|
|
34
|
+
* If true then color tooltips in the color picker for all color palettes
|
|
35
|
+
* such as text, background and table charts will show semantic names.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
showSomewhatSemanticTooltips?: boolean;
|
|
39
|
+
};
|
|
27
40
|
}
|
|
28
41
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
29
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
42
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>; /**
|
|
43
|
+
* If hexToPaletteColor is passed, it will be called to convert
|
|
44
|
+
* hexCodes passed in palette props to DST token.
|
|
45
|
+
* Different color palette will set different mapping function.
|
|
46
|
+
* Such as text and background color palette uses different
|
|
47
|
+
* mapping function to map tokens.
|
|
48
|
+
*/
|
|
30
49
|
};
|
|
31
50
|
export default _default;
|
|
@@ -6,5 +6,6 @@ export { default as colorPaletteMessages } from './ColorPalette/Palettes/palette
|
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
8
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
+
export { backgroundPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
|
|
9
10
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
10
|
-
export type { PaletteColor } from './ColorPalette/Palettes/type';
|
|
11
|
+
export type { PaletteColor, PaletteTooltipMessages, } from './ColorPalette/Palettes/type';
|
|
@@ -12,6 +12,7 @@ export interface Props {
|
|
|
12
12
|
fitHeight?: number;
|
|
13
13
|
zIndex?: number;
|
|
14
14
|
arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
|
|
15
|
+
dropdownListId?: string;
|
|
15
16
|
}
|
|
16
17
|
export interface State {
|
|
17
18
|
target?: HTMLElement;
|
|
@@ -27,6 +28,8 @@ export declare class Dropdown extends PureComponent<Props, State> {
|
|
|
27
28
|
constructor(props: Props);
|
|
28
29
|
private handleRef;
|
|
29
30
|
private updatePopupPlacement;
|
|
31
|
+
private handleCloseAndFocus;
|
|
32
|
+
private handleClose;
|
|
30
33
|
private renderDropdown;
|
|
31
34
|
render(): JSX.Element;
|
|
32
35
|
}
|
|
@@ -24,12 +24,20 @@ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, wi
|
|
|
24
24
|
}): {
|
|
25
25
|
type: "line-length-unknown";
|
|
26
26
|
width: any;
|
|
27
|
+
minWidth: number;
|
|
28
|
+
display: string;
|
|
29
|
+
justifyContent: string;
|
|
27
30
|
transform: string;
|
|
28
|
-
|
|
31
|
+
transition: string;
|
|
32
|
+
marginLeft?: undefined;
|
|
29
33
|
} | {
|
|
30
34
|
type: "line-length-known";
|
|
31
35
|
width: any;
|
|
36
|
+
minWidth: number;
|
|
37
|
+
transition: string;
|
|
38
|
+
transform: string;
|
|
32
39
|
marginLeft: string;
|
|
33
|
-
|
|
40
|
+
display?: undefined;
|
|
41
|
+
justifyContent?: undefined;
|
|
34
42
|
};
|
|
35
43
|
export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number): number;
|
|
@@ -10,7 +10,7 @@ export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSel
|
|
|
10
10
|
export { withImageLoader } from './imageLoader';
|
|
11
11
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus, } from './imageLoader';
|
|
12
12
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, } from './breakout';
|
|
13
|
-
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, } from './nodes';
|
|
13
|
+
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode, } from './nodes';
|
|
14
14
|
export type { Reducer } from './plugin-state-factory';
|
|
15
15
|
export { pluginFactory } from './plugin-state-factory';
|
|
16
16
|
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren, } from './slice';
|
|
@@ -47,5 +47,4 @@ export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-com
|
|
|
47
47
|
export { isOutdatedBrowser } from './outdated-browsers';
|
|
48
48
|
export { isReferencedSource, removeConnectedNodes, getChildrenInfo, getNodeName, } from './referentiality';
|
|
49
49
|
export { sendLogs } from './sendLogs';
|
|
50
|
-
export { Builder } from './builder';
|
|
51
50
|
export { getItemCounterDigitsSize, getOrderFromOrderedListNode, resolveOrder, } from './list';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, MarkType, NodeType, Mark as PMMark, Node as PMNode, Schema } from 'prosemirror-model';
|
|
1
|
+
import { Fragment, MarkType, NodeType, Mark as PMMark, Node as PMNode, ResolvedPos, Schema } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
3
3
|
import { CardAppearance } from '@atlaskit/smart-card';
|
|
4
4
|
/**
|
|
@@ -32,4 +32,18 @@ export declare const isNodeSelectedOrInRange: (anchorPosition: number, headPosit
|
|
|
32
32
|
* @param fragment The fragment to be checked for
|
|
33
33
|
*/
|
|
34
34
|
export declare const isSupportedInParent: (state: EditorState, fragment: Fragment, currentAppearance?: CardAppearance | undefined) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the passed in node is a media node
|
|
37
|
+
* Includes media, mediaInline, mediaGroup, mediaSingle
|
|
38
|
+
* @param node The PM node to be checked
|
|
39
|
+
*/
|
|
40
|
+
export declare const isMediaNode: (node: PMNode) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the node before selection is a media node
|
|
43
|
+
* If there is no node before, checks the node before the parent node
|
|
44
|
+
* Includes media, mediaInline, mediaGroup, mediaSingle
|
|
45
|
+
* @param $pos The position of the selection
|
|
46
|
+
* @param state The editor state
|
|
47
|
+
*/
|
|
48
|
+
export declare const isNodeBeforeMediaNode: ($pos: ResolvedPos, state: EditorState) => boolean;
|
|
35
49
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "72.
|
|
3
|
+
"version": "72.6.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"./transforms": "./src/transforms/index.ts",
|
|
55
55
|
"./core-utils": "./src/core-utils/index.ts",
|
|
56
56
|
"./selection": "./src/selection/index.ts",
|
|
57
|
+
"./preset": "./src/preset/index.ts",
|
|
57
58
|
"./hooks": "./src/hooks/index.ts"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
@@ -64,25 +65,25 @@
|
|
|
64
65
|
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
65
66
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
66
67
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
67
|
-
"@atlaskit/button": "^16.
|
|
68
|
+
"@atlaskit/button": "^16.6.0",
|
|
68
69
|
"@atlaskit/code": "^14.5.0",
|
|
69
70
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
70
71
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
71
|
-
"@atlaskit/editor-palette": "1.
|
|
72
|
+
"@atlaskit/editor-palette": "1.1.0",
|
|
72
73
|
"@atlaskit/editor-shared-styles": "^2.3.0",
|
|
73
|
-
"@atlaskit/emoji": "^67.
|
|
74
|
+
"@atlaskit/emoji": "^67.2.0",
|
|
74
75
|
"@atlaskit/icon": "^21.11.0",
|
|
75
76
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
76
77
|
"@atlaskit/media-card": "^74.7.0",
|
|
77
|
-
"@atlaskit/media-client": "^20.
|
|
78
|
+
"@atlaskit/media-client": "^20.2.0",
|
|
78
79
|
"@atlaskit/media-picker": "^64.2.0",
|
|
79
|
-
"@atlaskit/mention": "^
|
|
80
|
+
"@atlaskit/mention": "^22.0.0",
|
|
80
81
|
"@atlaskit/menu": "^1.5.0",
|
|
81
|
-
"@atlaskit/profilecard": "^19.
|
|
82
|
-
"@atlaskit/smart-card": "^25.
|
|
82
|
+
"@atlaskit/profilecard": "^19.2.0",
|
|
83
|
+
"@atlaskit/smart-card": "^25.1.0",
|
|
83
84
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
84
85
|
"@atlaskit/task-decision": "^17.5.0",
|
|
85
|
-
"@atlaskit/theme": "^12.
|
|
86
|
+
"@atlaskit/theme": "^12.3.0",
|
|
86
87
|
"@atlaskit/tokens": "^1.2.0",
|
|
87
88
|
"@atlaskit/tooltip": "^17.7.0",
|
|
88
89
|
"@atlaskit/ufo": "^0.1.0",
|
|
@@ -116,12 +117,12 @@
|
|
|
116
117
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
117
118
|
},
|
|
118
119
|
"devDependencies": {
|
|
119
|
-
"@atlaskit/editor-core": "^
|
|
120
|
+
"@atlaskit/editor-core": "^181.0.0",
|
|
120
121
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
121
122
|
"@atlaskit/editor-plugin-table": "^1.2.0",
|
|
122
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
123
|
+
"@atlaskit/editor-test-helpers": "^18.1.0",
|
|
123
124
|
"@atlaskit/media-core": "^34.0.0",
|
|
124
|
-
"@atlaskit/util-data-test": "^17.
|
|
125
|
+
"@atlaskit/util-data-test": "^17.7.0",
|
|
125
126
|
"@atlaskit/visual-regression": "*",
|
|
126
127
|
"@atlaskit/webdriver-runner": "*",
|
|
127
128
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/preset",
|
|
3
|
+
"main": "../dist/cjs/preset/index.js",
|
|
4
|
+
"module": "../dist/esm/preset/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/preset/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/preset/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/preset/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Builder = void 0;
|
|
8
|
-
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var Builder = /*#__PURE__*/function () {
|
|
13
|
-
function Builder() {
|
|
14
|
-
(0, _classCallCheck2.default)(this, Builder);
|
|
15
|
-
for (var _len = arguments.length, more = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
-
more[_key] = arguments[_key];
|
|
17
|
-
}
|
|
18
|
-
this.data = [].concat(more) || [];
|
|
19
|
-
}
|
|
20
|
-
(0, _createClass2.default)(Builder, [{
|
|
21
|
-
key: "add",
|
|
22
|
-
value: function add(nextOrTuple) {
|
|
23
|
-
return (0, _construct2.default)(Builder, [
|
|
24
|
-
/**
|
|
25
|
-
* re-cast this to NewPlugin as we've done all the type
|
|
26
|
-
* safety, dependency checking, narrowing, during
|
|
27
|
-
* `SafePresetCheck & VerifyPluginDependencies`
|
|
28
|
-
*/
|
|
29
|
-
nextOrTuple].concat((0, _toConsumableArray2.default)(this.data)));
|
|
30
|
-
}
|
|
31
|
-
}]);
|
|
32
|
-
return Builder;
|
|
33
|
-
}();
|
|
34
|
-
exports.Builder = Builder;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class Builder {
|
|
2
|
-
constructor(...more) {
|
|
3
|
-
this.data = [...more] || [];
|
|
4
|
-
}
|
|
5
|
-
add(nextOrTuple) {
|
|
6
|
-
return new Builder(
|
|
7
|
-
/**
|
|
8
|
-
* re-cast this to NewPlugin as we've done all the type
|
|
9
|
-
* safety, dependency checking, narrowing, during
|
|
10
|
-
* `SafePresetCheck & VerifyPluginDependencies`
|
|
11
|
-
*/
|
|
12
|
-
nextOrTuple, ...this.data);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import _construct from "@babel/runtime/helpers/construct";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
export var Builder = /*#__PURE__*/function () {
|
|
6
|
-
function Builder() {
|
|
7
|
-
_classCallCheck(this, Builder);
|
|
8
|
-
for (var _len = arguments.length, more = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
-
more[_key] = arguments[_key];
|
|
10
|
-
}
|
|
11
|
-
this.data = [].concat(more) || [];
|
|
12
|
-
}
|
|
13
|
-
_createClass(Builder, [{
|
|
14
|
-
key: "add",
|
|
15
|
-
value: function add(nextOrTuple) {
|
|
16
|
-
return _construct(Builder, [
|
|
17
|
-
/**
|
|
18
|
-
* re-cast this to NewPlugin as we've done all the type
|
|
19
|
-
* safety, dependency checking, narrowing, during
|
|
20
|
-
* `SafePresetCheck & VerifyPluginDependencies`
|
|
21
|
-
*/
|
|
22
|
-
nextOrTuple].concat(_toConsumableArray(this.data)));
|
|
23
|
-
}
|
|
24
|
-
}]);
|
|
25
|
-
return Builder;
|
|
26
|
-
}();
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AllBuilderPlugins, SafePresetCheck } from '../types';
|
|
2
|
-
export declare class Builder<T extends {
|
|
3
|
-
name: string;
|
|
4
|
-
}, StackPlugins extends AllBuilderPlugins[] = []> {
|
|
5
|
-
readonly data: [...StackPlugins];
|
|
6
|
-
constructor(...more: [...StackPlugins]);
|
|
7
|
-
add<NewPlugin extends AllBuilderPlugins>(nextOrTuple: SafePresetCheck<NewPlugin, StackPlugins>): Builder<T, [...[NewPlugin], ...StackPlugins]>;
|
|
8
|
-
}
|