@atlaskit/editor-core 189.0.14 → 189.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 +18 -0
- package/dist/cjs/extensibility.js +4 -4
- package/dist/cjs/plugins/annotation/commands/index.js +51 -43
- package/dist/cjs/plugins/annotation/commands/transform.js +43 -33
- package/dist/cjs/plugins/annotation/index.js +12 -5
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +17 -13
- package/dist/cjs/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/annotation/toolbar.js +41 -39
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/placeholder-text/index.js +8 -1
- package/dist/cjs/plugins/placeholder-text/plugin.js +2 -1
- package/dist/cjs/plugins/placeholder-text/styles.js +1 -1
- package/dist/cjs/presets/default.js +1 -2
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +7 -8
- package/dist/cjs/utils/document.js +0 -26
- package/dist/cjs/utils/index.js +0 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/plugins/annotation/commands/index.js +8 -8
- package/dist/es2019/plugins/annotation/commands/transform.js +13 -11
- package/dist/es2019/plugins/annotation/index.js +12 -5
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +10 -10
- package/dist/es2019/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/annotation/toolbar.js +2 -2
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/placeholder-text/index.js +2 -1
- package/dist/es2019/plugins/placeholder-text/plugin.js +2 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +24 -1
- package/dist/es2019/presets/default.js +1 -2
- package/dist/es2019/presets/universal.js +3 -2
- package/dist/es2019/ui/ContentStyles/index.js +0 -2
- package/dist/es2019/utils/document.js +0 -25
- package/dist/es2019/utils/index.js +0 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/plugins/annotation/commands/index.js +51 -43
- package/dist/esm/plugins/annotation/commands/transform.js +40 -30
- package/dist/esm/plugins/annotation/index.js +12 -5
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +17 -13
- package/dist/esm/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/annotation/toolbar.js +41 -39
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/placeholder-text/index.js +2 -1
- package/dist/esm/plugins/placeholder-text/plugin.js +2 -1
- package/dist/esm/plugins/placeholder-text/styles.js +2 -2
- package/dist/esm/presets/default.js +1 -2
- package/dist/esm/presets/universal.js +3 -2
- package/dist/esm/ui/ContentStyles/index.js +2 -3
- package/dist/esm/utils/document.js +0 -24
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/annotation/commands/index.d.ts +5 -4
- package/dist/types/plugins/annotation/commands/transform.d.ts +5 -4
- package/dist/types/plugins/annotation/index.d.ts +5 -2
- package/dist/types/plugins/annotation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +2 -0
- package/dist/types/plugins/annotation/toolbar.d.ts +2 -1
- package/dist/types/plugins/annotation/ui/InlineCommentView.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/placeholder-text/index.d.ts +1 -0
- package/dist/types/plugins/placeholder-text/types.d.ts +4 -1
- package/dist/types/presets/default.d.ts +4 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/document.d.ts +0 -11
- package/dist/types-ts4.5/extensibility.d.ts +1 -1
- package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +5 -4
- package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +5 -4
- package/dist/types-ts4.5/plugins/annotation/index.d.ts +7 -2
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/annotation/ui/InlineCommentView.d.ts +3 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/placeholder-text/types.d.ts +1 -1
- package/dist/types-ts4.5/presets/default.d.ts +0 -4
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/document.d.ts +0 -11
- package/package.json +4 -3
- package/dist/cjs/plugins/fake-text-cursor/index.js +0 -32
- package/dist/cjs/plugins/fake-text-cursor/styles.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -29
- package/dist/cjs/plugins/fragment/plugin-key.js +0 -8
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +0 -143
- package/dist/es2019/plugins/fake-text-cursor/index.js +0 -20
- package/dist/es2019/plugins/fake-text-cursor/styles.js +0 -26
- package/dist/es2019/plugins/fragment/index.js +0 -20
- package/dist/es2019/plugins/fragment/plugin-key.js +0 -2
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +0 -113
- package/dist/esm/plugins/fake-text-cursor/index.js +0 -26
- package/dist/esm/plugins/fake-text-cursor/styles.js +0 -5
- package/dist/esm/plugins/fragment/index.js +0 -23
- package/dist/esm/plugins/fragment/plugin-key.js +0 -2
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +0 -137
- package/dist/types/plugins/fake-text-cursor/index.d.ts +0 -7
- package/dist/types/plugins/fake-text-cursor/styles.d.ts +0 -1
- package/dist/types/plugins/fragment/index.d.ts +0 -3
- package/dist/types/plugins/fragment/plugin-key.d.ts +0 -2
- package/dist/types/plugins/fragment/pm-plugins/fragment-consistency.d.ts +0 -15
- package/dist/types-ts4.5/plugins/fake-text-cursor/index.d.ts +0 -7
- package/dist/types-ts4.5/plugins/fake-text-cursor/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/fragment/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/fragment/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/fragment/pm-plugins/fragment-consistency.d.ts +0 -15
- /package/dist/cjs/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/es2019/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/esm/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/types/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.d.ts +0 -0
|
@@ -2,7 +2,6 @@ export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-mark
|
|
|
2
2
|
export { default as codeBlockPlugin } from './code-block';
|
|
3
3
|
export { default as collabEditPlugin } from './collab-edit';
|
|
4
4
|
export { default as extensionPlugin } from './extension';
|
|
5
|
-
export { default as fakeTextCursorPlugin } from './fake-text-cursor';
|
|
6
5
|
export { default as insertBlockPlugin } from './insert-block';
|
|
7
6
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
8
7
|
export { default as layoutPlugin } from './layout';
|
|
@@ -16,7 +15,6 @@ export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
|
16
15
|
export { default as breakoutPlugin } from './breakout';
|
|
17
16
|
export { default as alignmentPlugin } from './alignment';
|
|
18
17
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
19
|
-
export { default as fragmentMarkPlugin } from './fragment';
|
|
20
18
|
export { default as indentationPlugin } from './indentation';
|
|
21
19
|
export { default as annotationPlugin } from './annotation';
|
|
22
20
|
export { default as analyticsPlugin } from './analytics';
|
|
@@ -11,7 +11,7 @@ export interface PlaceholderTextPluginState {
|
|
|
11
11
|
export type PlaceholderTextPlugin = NextEditorPlugin<'placeholderText', {
|
|
12
12
|
dependencies: [
|
|
13
13
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
14
|
-
TypeAheadPlugin
|
|
14
|
+
OptionalPlugin<TypeAheadPlugin>
|
|
15
15
|
];
|
|
16
16
|
pluginConfiguration: PlaceholderTextOptions;
|
|
17
17
|
sharedState: PlaceholderTextPluginState | undefined;
|
|
@@ -45,7 +45,6 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
45
45
|
"unsupportedContent",
|
|
46
46
|
"editorDisabled",
|
|
47
47
|
"submitEditor",
|
|
48
|
-
"fakeTextCursor",
|
|
49
48
|
"copyButton",
|
|
50
49
|
"floatingToolbar",
|
|
51
50
|
"selection",
|
|
@@ -190,7 +189,6 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
190
189
|
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
191
190
|
};
|
|
192
191
|
}, undefined>,
|
|
193
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
194
192
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
195
193
|
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
196
194
|
dependencies: [
|
|
@@ -616,7 +614,6 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
616
614
|
"unsupportedContent",
|
|
617
615
|
"editorDisabled",
|
|
618
616
|
"submitEditor",
|
|
619
|
-
"fakeTextCursor",
|
|
620
617
|
"copyButton",
|
|
621
618
|
"floatingToolbar",
|
|
622
619
|
"selection",
|
|
@@ -761,7 +758,6 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
761
758
|
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
762
759
|
};
|
|
763
760
|
}, undefined>,
|
|
764
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
765
761
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
766
762
|
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
767
763
|
dependencies: [
|
|
@@ -3,7 +3,7 @@ export declare const fullPageEditorWrapper: import("@emotion/react").SerializedS
|
|
|
3
3
|
export declare const ScrollContainer: import("react").ForwardRefExoticComponent<Pick<{
|
|
4
4
|
theme?: any;
|
|
5
5
|
featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
|
|
6
|
-
} & import("react").HTMLProps<HTMLDivElement>, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "
|
|
6
|
+
} & import("react").HTMLProps<HTMLDivElement>, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "start" | "accessKey" | "as" | "css" | "step" | "wrap" | "preload" | "className" | "alt" | "crossOrigin" | "sizes" | "src" | "srcSet" | "useMap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "selected" | "required" | "download" | "hrefLang" | "rel" | "target" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "srcDoc" | "srcLang" | "wmode" | keyof {
|
|
7
7
|
theme?: any;
|
|
8
8
|
featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
|
|
9
9
|
}> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -18,5 +18,5 @@ type Props = {
|
|
|
18
18
|
isLoading?: boolean;
|
|
19
19
|
featureFlags?: FeatureFlags;
|
|
20
20
|
} & WithAnalyticsEventsProps;
|
|
21
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "
|
|
21
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "autoSaveReject" | "onChange" | "isLoading" | "fields" | "key" | "parameters" | "featureFlags" | "onCancel" | "autoSave" | "analyticsContext" | "errorMessage" | "extensionManifest" | "autoSaveTrigger" | "showHeader" | "closeOnEsc"> & React.RefAttributes<any>>;
|
|
22
22
|
export default _default;
|
|
@@ -9,6 +9,6 @@ type ContentStylesProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const placeholderStyles: SerializedStyles;
|
|
11
11
|
type Props = ContentStylesProps & React.HTMLProps<HTMLDivElement>;
|
|
12
|
-
export declare const createEditorContentStyle: (styles?: SerializedStyles) => React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "
|
|
13
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "
|
|
12
|
+
export declare const createEditorContentStyle: (styles?: SerializedStyles) => React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "start" | "accessKey" | "as" | "css" | "step" | "wrap" | "preload" | "className" | "alt" | "crossOrigin" | "sizes" | "src" | "srcSet" | "useMap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "selected" | "required" | "download" | "hrefLang" | "rel" | "target" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "srcDoc" | "srcLang" | "wmode" | keyof ContentStylesProps> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "start" | "accessKey" | "as" | "css" | "step" | "wrap" | "preload" | "className" | "alt" | "crossOrigin" | "sizes" | "src" | "srcSet" | "useMap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "selected" | "required" | "download" | "hrefLang" | "rel" | "target" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "srcDoc" | "srcLang" | "wmode" | keyof ContentStylesProps> & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
export default _default;
|
|
@@ -8,17 +8,6 @@ import type { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
|
|
|
8
8
|
export { findFarthestParentNode, isInEmptyLine, } from '@atlaskit/editor-common/utils';
|
|
9
9
|
export declare function processRawFragmentValue(schema: Schema, value?: ReplaceRawValue[], providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Fragment | undefined;
|
|
10
10
|
export type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
11
|
-
export declare function getChangedNodesIn({ tr, doc, }: {
|
|
12
|
-
tr: ReadonlyTransaction | Transaction;
|
|
13
|
-
doc: Node;
|
|
14
|
-
}): {
|
|
15
|
-
node: Node;
|
|
16
|
-
pos: number;
|
|
17
|
-
}[];
|
|
18
|
-
export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction): {
|
|
19
|
-
node: Node;
|
|
20
|
-
pos: number;
|
|
21
|
-
}[];
|
|
22
11
|
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
23
12
|
export declare function getNodesCount(node: Node): Record<string, number>;
|
|
24
13
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "189.
|
|
3
|
+
"version": "189.1.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/code": "^14.6.0",
|
|
54
54
|
"@atlaskit/date": "^0.10.0",
|
|
55
55
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
56
|
-
"@atlaskit/editor-common": "^76.
|
|
56
|
+
"@atlaskit/editor-common": "^76.17.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
58
58
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
59
59
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
78
78
|
"@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
|
|
79
79
|
"@atlaskit/editor-plugin-focus": "^0.2.0",
|
|
80
|
+
"@atlaskit/editor-plugin-fragment": "^0.1.0",
|
|
80
81
|
"@atlaskit/editor-plugin-grid": "^0.3.0",
|
|
81
82
|
"@atlaskit/editor-plugin-guideline": "^0.5.0",
|
|
82
83
|
"@atlaskit/editor-plugin-help-dialog": "^0.2.0",
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
"@atlaskit/radio": "^5.6.0",
|
|
122
123
|
"@atlaskit/section-message": "^6.4.0",
|
|
123
124
|
"@atlaskit/select": "^16.7.0",
|
|
124
|
-
"@atlaskit/smart-card": "^26.
|
|
125
|
+
"@atlaskit/smart-card": "^26.40.0",
|
|
125
126
|
"@atlaskit/smart-user-picker": "^6.3.0",
|
|
126
127
|
"@atlaskit/spinner": "^15.6.0",
|
|
127
128
|
"@atlaskit/tabs": "^13.4.0",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.stateKey = exports.default = exports.createPlugin = void 0;
|
|
7
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _cursor = require("./cursor");
|
|
10
|
-
var stateKey = exports.stateKey = new _state.PluginKey('fakeTextCursorPlugin');
|
|
11
|
-
var createPlugin = exports.createPlugin = function createPlugin() {
|
|
12
|
-
return new _safePlugin.SafePlugin({
|
|
13
|
-
key: stateKey,
|
|
14
|
-
props: {
|
|
15
|
-
decorations: _cursor.drawFakeTextCursor
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
var fakeTextCursorPlugin = function fakeTextCursorPlugin() {
|
|
20
|
-
return {
|
|
21
|
-
name: 'fakeTextCursor',
|
|
22
|
-
pmPlugins: function pmPlugins() {
|
|
23
|
-
return [{
|
|
24
|
-
name: 'fakeTextCursor',
|
|
25
|
-
plugin: function plugin() {
|
|
26
|
-
return createPlugin();
|
|
27
|
-
}
|
|
28
|
-
}];
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
var _default = exports.default = fakeTextCursorPlugin;
|
|
@@ -1,12 +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.fakeCursorStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _templateObject;
|
|
12
|
-
var fakeCursorStyles = exports.fakeCursorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .ProseMirror-fake-text-cursor {\n display: inline;\n pointer-events: none;\n position: relative;\n }\n\n .ProseMirror-fake-text-cursor::after {\n content: '';\n display: inline;\n top: 0;\n position: absolute;\n border-right: 1px solid ", ";\n }\n\n .ProseMirror-fake-text-selection {\n display: inline;\n pointer-events: none;\n position: relative;\n background-color: ", ";\n }\n }\n"])), "var(--ds-border, rgba(0, 0, 0, 0.4))", "var(--ds-background-selected, ".concat(_colors.B75, ")"));
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
|
-
var _fragmentConsistency = require("./pm-plugins/fragment-consistency");
|
|
9
|
-
var fragmentMarkPlugin = function fragmentMarkPlugin() {
|
|
10
|
-
return {
|
|
11
|
-
name: 'fragmentPlugin',
|
|
12
|
-
marks: function marks() {
|
|
13
|
-
return [{
|
|
14
|
-
name: 'fragment',
|
|
15
|
-
mark: _adfSchema.fragment
|
|
16
|
-
}];
|
|
17
|
-
},
|
|
18
|
-
pmPlugins: function pmPlugins() {
|
|
19
|
-
return [{
|
|
20
|
-
name: 'fragmentMarkConsistency',
|
|
21
|
-
plugin: function plugin(_ref) {
|
|
22
|
-
var dispatch = _ref.dispatch;
|
|
23
|
-
return (0, _fragmentConsistency.createPlugin)(dispatch);
|
|
24
|
-
}
|
|
25
|
-
}];
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
var _default = exports.default = fragmentMarkPlugin;
|
|
@@ -1,143 +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.createPlugin = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
12
|
-
var _document = require("../../../utils/document");
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
|
|
18
|
-
* This plugin ensures that certain nodes (such as tables, and various extension ones)
|
|
19
|
-
* have a unique `localId` attribute value for `fragment` marks.
|
|
20
|
-
* It also ensures the preservation of these IDs when nodes are being cut-and-pasted
|
|
21
|
-
* around the document.
|
|
22
|
-
*
|
|
23
|
-
* The implementation has been _heavily_ borrowed from
|
|
24
|
-
* - packages/editor/editor-core/src/plugins/table/pm-plugins/table-local-id.ts
|
|
25
|
-
*/
|
|
26
|
-
var pluginKey = new _state.PluginKey('fragmentMarkConsistencyPlugin');
|
|
27
|
-
var getNodesSupportingFragmentMark = function getNodesSupportingFragmentMark(schema) {
|
|
28
|
-
var _schema$nodes = schema.nodes,
|
|
29
|
-
table = _schema$nodes.table,
|
|
30
|
-
extension = _schema$nodes.extension,
|
|
31
|
-
bodiedExtension = _schema$nodes.bodiedExtension,
|
|
32
|
-
inlineExtension = _schema$nodes.inlineExtension;
|
|
33
|
-
return [table, extension, bodiedExtension, inlineExtension];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Ensures presence of `fragment` mark on certain node types and the uniqueness of their `localId` attributes
|
|
38
|
-
*/
|
|
39
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
40
|
-
return new _safePlugin.SafePlugin({
|
|
41
|
-
key: pluginKey,
|
|
42
|
-
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
43
|
-
var modified = false;
|
|
44
|
-
var tr = newState.tr;
|
|
45
|
-
var fragment = newState.schema.marks.fragment;
|
|
46
|
-
var supportedNodeTypes = getNodesSupportingFragmentMark(newState.schema);
|
|
47
|
-
var addedSupportedNodes = new Set();
|
|
48
|
-
var addedSupportedNodesPos = new Map();
|
|
49
|
-
var localIds = new Set();
|
|
50
|
-
transactions.forEach(function (transaction) {
|
|
51
|
-
if (!transaction.docChanged) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Don't interfere with cut as it clashes with fixTables & we don't need
|
|
56
|
-
// to handle any extra cut cases in this plugin
|
|
57
|
-
var uiEvent = transaction.getMeta('uiEvent');
|
|
58
|
-
if (uiEvent === 'cut') {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
var changedNodes = (0, _document.getChangedNodes)(transaction);
|
|
62
|
-
var _iterator = _createForOfIteratorHelper(changedNodes),
|
|
63
|
-
_step;
|
|
64
|
-
try {
|
|
65
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
66
|
-
var node = _step.value.node;
|
|
67
|
-
if (!supportedNodeTypes.includes(node.type)) {
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
addedSupportedNodes.add(node);
|
|
71
|
-
}
|
|
72
|
-
} catch (err) {
|
|
73
|
-
_iterator.e(err);
|
|
74
|
-
} finally {
|
|
75
|
-
_iterator.f();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
if (!addedSupportedNodes.size) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Get existing fragment marks localIds on the page
|
|
83
|
-
newState.doc.descendants(function (node, pos) {
|
|
84
|
-
if (addedSupportedNodes.has(node)) {
|
|
85
|
-
addedSupportedNodesPos.set(node, pos);
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
if (!supportedNodeTypes.includes(node.type)) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
var existingFragmentMark = node.marks.find(function (mark) {
|
|
92
|
-
return mark.type === fragment;
|
|
93
|
-
});
|
|
94
|
-
if (!existingFragmentMark) {
|
|
95
|
-
// continue traversing
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
localIds.add(existingFragmentMark.attrs.localId);
|
|
99
|
-
return true;
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// If an added node has localId that collides with existing node, generate new localId
|
|
103
|
-
var _iterator2 = _createForOfIteratorHelper(addedSupportedNodes),
|
|
104
|
-
_step2;
|
|
105
|
-
try {
|
|
106
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
107
|
-
var node = _step2.value;
|
|
108
|
-
var pos = addedSupportedNodesPos.get(node);
|
|
109
|
-
if (pos === undefined) {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
var existingFragmentMark = node.marks.find(function (mark) {
|
|
113
|
-
return mark.type === fragment;
|
|
114
|
-
});
|
|
115
|
-
if (!existingFragmentMark) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (localIds.has(existingFragmentMark.attrs.localId)) {
|
|
119
|
-
tr.setNodeMarkup(pos, undefined, node.attrs, node.marks.map(function (mark) {
|
|
120
|
-
if (mark.type !== fragment) {
|
|
121
|
-
return mark;
|
|
122
|
-
}
|
|
123
|
-
var fragmentMark = fragment.create(_objectSpread(_objectSpread({}, mark.attrs), {}, {
|
|
124
|
-
localId: _adfSchema.uuid.generate(),
|
|
125
|
-
name: null
|
|
126
|
-
}));
|
|
127
|
-
return fragmentMark;
|
|
128
|
-
}));
|
|
129
|
-
modified = true;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
} catch (err) {
|
|
133
|
-
_iterator2.e(err);
|
|
134
|
-
} finally {
|
|
135
|
-
_iterator2.f();
|
|
136
|
-
}
|
|
137
|
-
if (modified) {
|
|
138
|
-
return tr;
|
|
139
|
-
}
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { drawFakeTextCursor } from './cursor';
|
|
4
|
-
export const stateKey = new PluginKey('fakeTextCursorPlugin');
|
|
5
|
-
export const createPlugin = () => new SafePlugin({
|
|
6
|
-
key: stateKey,
|
|
7
|
-
props: {
|
|
8
|
-
decorations: drawFakeTextCursor
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const fakeTextCursorPlugin = () => ({
|
|
12
|
-
name: 'fakeTextCursor',
|
|
13
|
-
pmPlugins() {
|
|
14
|
-
return [{
|
|
15
|
-
name: 'fakeTextCursor',
|
|
16
|
-
plugin: () => createPlugin()
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export default fakeTextCursorPlugin;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
import { B75 } from '@atlaskit/theme/colors';
|
|
3
|
-
export const fakeCursorStyles = css`
|
|
4
|
-
.ProseMirror {
|
|
5
|
-
.ProseMirror-fake-text-cursor {
|
|
6
|
-
display: inline;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
position: relative;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.ProseMirror-fake-text-cursor::after {
|
|
12
|
-
content: '';
|
|
13
|
-
display: inline;
|
|
14
|
-
top: 0;
|
|
15
|
-
position: absolute;
|
|
16
|
-
border-right: 1px solid ${"var(--ds-border, rgba(0, 0, 0, 0.4))"};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.ProseMirror-fake-text-selection {
|
|
20
|
-
display: inline;
|
|
21
|
-
pointer-events: none;
|
|
22
|
-
position: relative;
|
|
23
|
-
background-color: ${`var(--ds-background-selected, ${B75})`};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { fragment } from '@atlaskit/adf-schema';
|
|
2
|
-
import { createPlugin as createFragmentMarkConsistencyPlugin } from './pm-plugins/fragment-consistency';
|
|
3
|
-
const fragmentMarkPlugin = () => ({
|
|
4
|
-
name: 'fragmentPlugin',
|
|
5
|
-
marks() {
|
|
6
|
-
return [{
|
|
7
|
-
name: 'fragment',
|
|
8
|
-
mark: fragment
|
|
9
|
-
}];
|
|
10
|
-
},
|
|
11
|
-
pmPlugins() {
|
|
12
|
-
return [{
|
|
13
|
-
name: 'fragmentMarkConsistency',
|
|
14
|
-
plugin: ({
|
|
15
|
-
dispatch
|
|
16
|
-
}) => createFragmentMarkConsistencyPlugin(dispatch)
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export default fragmentMarkPlugin;
|