@atlaskit/editor-plugin-extension 0.6.2 → 0.7.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 +17 -0
- package/dist/cjs/actions.js +7 -22
- package/dist/cjs/context-panel.js +4 -1
- package/dist/cjs/plugin.js +5 -4
- package/dist/cjs/pm-plugins/main.js +11 -54
- package/dist/cjs/toolbar.js +5 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +55 -29
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/es2019/actions.js +3 -19
- package/dist/es2019/context-panel.js +4 -1
- package/dist/es2019/plugin.js +5 -4
- package/dist/es2019/pm-plugins/main.js +4 -23
- package/dist/es2019/toolbar.js +5 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +58 -28
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/esm/actions.js +6 -21
- package/dist/esm/context-panel.js +4 -1
- package/dist/esm/plugin.js +5 -4
- package/dist/esm/pm-plugins/main.js +10 -53
- package/dist/esm/toolbar.js +5 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +55 -29
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/types/actions.d.ts +2 -5
- package/dist/types/context-panel.d.ts +3 -3
- package/dist/types/pm-plugins/main.d.ts +1 -2
- package/dist/types/types.d.ts +4 -4
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +4 -3
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +4 -3
- package/dist/types-ts4.5/actions.d.ts +2 -5
- package/dist/types-ts4.5/context-panel.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/types.d.ts +4 -4
- package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +4 -3
- package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +4 -3
- package/example-utils/config-panel/ConfigPanelWithProviders.tsx +2 -1
- package/example-utils/config-panel/FieldTypePicker.tsx +1 -1
- package/package.json +6 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
2
|
+
import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
5
4
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
5
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import type { ExtensionPlugin } from './types';
|
|
8
8
|
export declare const duplicateSelection: (selectionToDuplicate: Selection, doc: Node) => Selection | undefined;
|
|
9
|
-
export declare const getContextPanel: (getEditorView?: () => EditorView | undefined) => (allowAutoSave?: boolean, featureFlags?: FeatureFlags
|
|
9
|
+
export declare const getContextPanel: (getEditorView?: () => EditorView | undefined) => (api: ExtractInjectionAPI<ExtensionPlugin> | undefined, allowAutoSave?: boolean, featureFlags?: FeatureFlags) => (state: EditorState) => JSX.Element | undefined;
|
|
10
10
|
export declare function onChangeAction(editorView: EditorView, updatedParameters: object | undefined, oldParameters: object | undefined, nodeWithPos: ContentNodeWithPos, onSaving?: () => void): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
2
|
import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
3
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
@@ -11,7 +11,6 @@ import { createCommand, getPluginState } from '../plugin-factory';
|
|
|
11
11
|
import { pluginKey } from '../plugin-key';
|
|
12
12
|
import type { ExtensionPlugin } from '../types';
|
|
13
13
|
export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
|
|
14
|
-
export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
15
14
|
export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
|
|
16
15
|
view: EditorView;
|
|
17
16
|
prevState: EditorState;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { ExtensionAPI, ExtensionHandlers, ExtensionProvider, Parameters, TransformAfter, TransformBefore, UpdateExtension } from '@atlaskit/editor-common/extensions';
|
|
3
|
-
import type {
|
|
3
|
+
import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { EditorAppearance, LongPressSelectionPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
+
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
6
7
|
import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
7
8
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
8
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
@@ -21,11 +22,9 @@ export type ExtensionState<T extends Parameters = Parameters> = {
|
|
|
21
22
|
updateExtension?: Promise<UpdateExtension<T> | void>;
|
|
22
23
|
element?: HTMLElement;
|
|
23
24
|
extensionProvider?: ExtensionProvider<T>;
|
|
24
|
-
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
25
25
|
processParametersBefore?: TransformBefore<T>;
|
|
26
26
|
processParametersAfter?: TransformAfter<T>;
|
|
27
27
|
positions?: Record<number, number>;
|
|
28
|
-
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
29
28
|
};
|
|
30
29
|
export type ExtensionAction<T extends Parameters = Parameters> = {
|
|
31
30
|
type: 'UPDATE_STATE';
|
|
@@ -53,7 +52,8 @@ export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
|
53
52
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
54
53
|
WidthPlugin,
|
|
55
54
|
DecorationsPlugin,
|
|
56
|
-
OptionalPlugin<ContextPanelPlugin
|
|
55
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
56
|
+
OptionalPlugin<ContextIdentifierPlugin>
|
|
57
57
|
];
|
|
58
58
|
sharedState: {
|
|
59
59
|
showContextPanel: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import type { ExtensionManifest, FieldDefinition, OnSaveCallback, Parameters } from '@atlaskit/editor-common/extensions';
|
|
4
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { RejectSave } from '../../types';
|
|
4
|
+
import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { ExtensionPlugin, RejectSave } from '../../types';
|
|
6
6
|
type Props = {
|
|
7
7
|
extensionManifest?: ExtensionManifest;
|
|
8
8
|
fields?: FieldDefinition[];
|
|
@@ -17,6 +17,7 @@ type Props = {
|
|
|
17
17
|
errorMessage: string | null;
|
|
18
18
|
isLoading?: boolean;
|
|
19
19
|
featureFlags?: FeatureFlags;
|
|
20
|
+
api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
|
|
20
21
|
} & WithAnalyticsEventsProps;
|
|
21
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "featureFlags" | "autoSaveReject" | "key" | "parameters" | "autoSave" | "onChange" | "errorMessage" | "analyticsContext" | "fields" | "extensionManifest" | "isLoading" | "onCancel" | "autoSaveTrigger" | "showHeader" | "closeOnEsc"> & React.RefAttributes<any>>;
|
|
22
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "featureFlags" | "api" | "autoSaveReject" | "key" | "parameters" | "autoSave" | "onChange" | "errorMessage" | "analyticsContext" | "fields" | "extensionManifest" | "isLoading" | "onCancel" | "autoSaveTrigger" | "showHeader" | "closeOnEsc"> & React.RefAttributes<any>>;
|
|
22
23
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtensionKey, ExtensionProvider, ExtensionType, Parameters } from '@atlaskit/editor-common/extensions';
|
|
3
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { RejectSave } from '../../types';
|
|
3
|
+
import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { ExtensionPlugin, RejectSave } from '../../types';
|
|
5
5
|
export type PublicProps = {
|
|
6
6
|
extensionProvider: ExtensionProvider;
|
|
7
7
|
extensionType: ExtensionType;
|
|
@@ -17,5 +17,6 @@ export type PublicProps = {
|
|
|
17
17
|
featureFlags?: FeatureFlags;
|
|
18
18
|
onChange: (data: Parameters) => void;
|
|
19
19
|
onCancel: () => void;
|
|
20
|
+
api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
|
|
20
21
|
};
|
|
21
|
-
export default function FieldsLoader({ extensionType, extensionKey, nodeKey, extensionProvider, extensionParameters, parameters, autoSave, autoSaveTrigger, autoSaveReject, closeOnEsc, showHeader, featureFlags, onChange, onCancel, }: PublicProps): JSX.Element;
|
|
22
|
+
export default function FieldsLoader({ extensionType, extensionKey, nodeKey, extensionProvider, extensionParameters, parameters, autoSave, autoSaveTrigger, autoSaveReject, closeOnEsc, showHeader, featureFlags, onChange, onCancel, api, }: PublicProps): JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { IntlProvider } from 'react-intl-next';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type {
|
|
6
6
|
ExtensionKey,
|
|
7
7
|
ExtensionProvider,
|
|
8
8
|
ExtensionType,
|
|
@@ -35,6 +35,7 @@ export default function ConfigPanelWithProviders({
|
|
|
35
35
|
return (
|
|
36
36
|
<IntlProvider locale="en">
|
|
37
37
|
<ConfigPanel
|
|
38
|
+
api={undefined}
|
|
38
39
|
extensionType={extensionType}
|
|
39
40
|
extensionKey={extensionKey}
|
|
40
41
|
nodeKey={nodeKey}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
|
|
4
|
-
import { FieldDefinition } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import type { FieldDefinition } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
6
|
import { ButtonItem, HeadingItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,16 +31,17 @@
|
|
|
31
31
|
"@atlaskit/button": "^17.2.0",
|
|
32
32
|
"@atlaskit/checkbox": "^13.0.0",
|
|
33
33
|
"@atlaskit/datetime-picker": "^13.0.3",
|
|
34
|
-
"@atlaskit/editor-common": "^77.
|
|
34
|
+
"@atlaskit/editor-common": "^77.1.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
37
|
+
"@atlaskit/editor-plugin-context-identifier": "^0.1.0",
|
|
37
38
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
38
39
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
39
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
40
41
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
41
42
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
42
43
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
43
|
-
"@atlaskit/editor-tables": "^2.
|
|
44
|
+
"@atlaskit/editor-tables": "^2.5.0",
|
|
44
45
|
"@atlaskit/empty-state": "^7.6.0",
|
|
45
46
|
"@atlaskit/form": "^9.0.3",
|
|
46
47
|
"@atlaskit/icon": "^22.0.0",
|
|
@@ -48,14 +49,14 @@
|
|
|
48
49
|
"@atlaskit/radio": "^6.0.0",
|
|
49
50
|
"@atlaskit/section-message": "^6.4.0",
|
|
50
51
|
"@atlaskit/select": "^17.0.3",
|
|
51
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
52
|
+
"@atlaskit/smart-user-picker": "^6.6.0",
|
|
52
53
|
"@atlaskit/spinner": "^16.0.0",
|
|
53
54
|
"@atlaskit/tabs": "^14.0.0",
|
|
54
55
|
"@atlaskit/textarea": "^5.0.0",
|
|
55
56
|
"@atlaskit/textfield": "^6.0.0",
|
|
56
57
|
"@atlaskit/theme": "^12.6.0",
|
|
57
58
|
"@atlaskit/toggle": "^13.0.0",
|
|
58
|
-
"@atlaskit/tokens": "^1.
|
|
59
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
59
60
|
"@atlaskit/tooltip": "^18.1.0",
|
|
60
61
|
"@babel/runtime": "^7.0.0",
|
|
61
62
|
"@emotion/react": "^11.7.1",
|