@atlaskit/editor-core 187.10.8 → 187.12.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/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/cjs/editor-next/editor-internal.js +0 -2
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/cjs/editor-next/index.js +0 -2
- package/dist/cjs/editor.js +6 -2
- package/dist/cjs/index.js +2 -94
- package/dist/cjs/plugins/help-dialog/ui/index.js +42 -42
- package/dist/cjs/plugins/paste/handlers.js +4 -6
- package/dist/cjs/plugins/text-formatting/actions.js +188 -0
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +1 -180
- package/dist/cjs/plugins/text-formatting/index.js +11 -0
- package/dist/cjs/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +8 -8
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +16 -16
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +8 -8
- package/dist/cjs/plugins/text-formatting/utils.js +8 -36
- package/dist/cjs/ui/ContentStyles/index.js +8 -9
- package/dist/cjs/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +3 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/es2019/editor-next/editor-internal.js +0 -2
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/es2019/editor-next/index.js +0 -2
- package/dist/es2019/editor.js +5 -0
- package/dist/es2019/index.js +0 -2
- package/dist/es2019/plugins/help-dialog/ui/index.js +1 -1
- package/dist/es2019/plugins/paste/handlers.js +5 -7
- package/dist/es2019/plugins/text-formatting/actions.js +161 -0
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -159
- package/dist/es2019/plugins/text-formatting/index.js +115 -102
- package/dist/es2019/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +9 -9
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/es2019/plugins/text-formatting/utils.js +1 -29
- package/dist/es2019/ui/ContentStyles/index.js +2 -3
- package/dist/es2019/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/esm/editor-next/editor-internal.js +0 -2
- package/dist/esm/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/esm/editor-next/index.js +0 -2
- package/dist/esm/editor.js +6 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/plugins/help-dialog/ui/index.js +1 -1
- package/dist/esm/plugins/paste/handlers.js +5 -7
- package/dist/esm/plugins/text-formatting/actions.js +168 -0
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -166
- package/dist/esm/plugins/text-formatting/index.js +11 -0
- package/dist/esm/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +9 -9
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/esm/plugins/text-formatting/utils.js +6 -33
- package/dist/esm/ui/ContentStyles/index.js +2 -3
- package/dist/esm/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +4 -4
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/labs/next/presets/default.d.ts +50 -15
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +2 -2
- package/dist/types/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -2
- package/dist/types/plugins/text-formatting/actions.d.ts +22 -0
- package/dist/types/plugins/text-formatting/commands/text-formatting.d.ts +0 -31
- package/dist/types/plugins/text-formatting/index.d.ts +11 -2
- package/dist/types/plugins/text-formatting/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/text-formatting/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +1 -5
- package/dist/types/types/editor-props.d.ts +11 -12
- package/dist/types/ui/ContentStyles/index.d.ts +1 -1
- package/dist/types/utils/editorDeprecationWarnings.d.ts +2 -0
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +4 -4
- package/dist/types-ts4.5/editor.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +6 -4
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +50 -15
- package/dist/types-ts4.5/labs/next/presets/useUniversalPreset.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +1 -2
- package/dist/types-ts4.5/plugins/text-formatting/actions.d.ts +22 -0
- package/dist/types-ts4.5/plugins/text-formatting/commands/text-formatting.d.ts +0 -31
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +11 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-formatting/utils.d.ts +1 -5
- package/dist/types-ts4.5/types/editor-props.d.ts +11 -12
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/editorDeprecationWarnings.d.ts +2 -0
- package/package.json +3 -3
- package/report.api.md +39 -166
- package/tmp/api-report-tmp.d.ts +36 -135
- package/dist/cjs/plugins/text-formatting/styles.js +0 -15
- package/dist/cjs/plugins/text-formatting/types.js +0 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -95
- package/dist/es2019/plugins/text-formatting/styles.js +0 -5
- package/dist/es2019/plugins/text-formatting/types.js +0 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -88
- package/dist/esm/plugins/text-formatting/styles.js +0 -7
- package/dist/esm/plugins/text-formatting/types.js +0 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -88
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +0 -2
- package/dist/types/plugins/text-formatting/styles.d.ts +0 -2
- package/dist/types/plugins/text-formatting/types.d.ts +0 -30
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +0 -87
- package/dist/types-ts4.5/editor-next/utils/deprecationWarnings.d.ts +0 -2
- package/dist/types-ts4.5/plugins/text-formatting/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/text-formatting/types.d.ts +0 -30
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +0 -87
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
3
|
+
import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
4
|
+
export var toggleEm = function toggleEm() {
|
|
5
|
+
return function (state, dispatch) {
|
|
6
|
+
var em = state.schema.marks.em;
|
|
7
|
+
if (em) {
|
|
8
|
+
return toggleMark(em)(state, dispatch);
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export var toggleEmWithAnalytics = function toggleEmWithAnalytics(editorAnalyticsAPI) {
|
|
14
|
+
return function (_ref) {
|
|
15
|
+
var inputMethod = _ref.inputMethod;
|
|
16
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
17
|
+
action: ACTION.FORMATTED,
|
|
18
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
19
|
+
eventType: EVENT_TYPE.TRACK,
|
|
20
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_ITALIC,
|
|
21
|
+
attributes: {
|
|
22
|
+
inputMethod: inputMethod
|
|
23
|
+
}
|
|
24
|
+
})(toggleEm());
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export var toggleStrike = function toggleStrike() {
|
|
28
|
+
return function (state, dispatch) {
|
|
29
|
+
var strike = state.schema.marks.strike;
|
|
30
|
+
if (strike) {
|
|
31
|
+
return toggleMark(strike)(state, dispatch);
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export var toggleStrikeWithAnalytics = function toggleStrikeWithAnalytics(editorAnalyticsAPI) {
|
|
37
|
+
return function (_ref2) {
|
|
38
|
+
var inputMethod = _ref2.inputMethod;
|
|
39
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
40
|
+
action: ACTION.FORMATTED,
|
|
41
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
42
|
+
eventType: EVENT_TYPE.TRACK,
|
|
43
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_STRIKE,
|
|
44
|
+
attributes: {
|
|
45
|
+
inputMethod: inputMethod
|
|
46
|
+
}
|
|
47
|
+
})(toggleStrike());
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export var toggleStrong = function toggleStrong() {
|
|
51
|
+
return function (state, dispatch) {
|
|
52
|
+
var strong = state.schema.marks.strong;
|
|
53
|
+
if (strong) {
|
|
54
|
+
return toggleMark(strong)(state, dispatch);
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export var toggleStrongWithAnalytics = function toggleStrongWithAnalytics(editorAnalyticsAPI) {
|
|
60
|
+
return function (_ref3) {
|
|
61
|
+
var inputMethod = _ref3.inputMethod;
|
|
62
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
63
|
+
action: ACTION.FORMATTED,
|
|
64
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
65
|
+
eventType: EVENT_TYPE.TRACK,
|
|
66
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_STRONG,
|
|
67
|
+
attributes: {
|
|
68
|
+
inputMethod: inputMethod
|
|
69
|
+
}
|
|
70
|
+
})(toggleStrong());
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export var toggleUnderline = function toggleUnderline() {
|
|
74
|
+
return function (state, dispatch) {
|
|
75
|
+
var underline = state.schema.marks.underline;
|
|
76
|
+
if (underline) {
|
|
77
|
+
return toggleMark(underline)(state, dispatch);
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export var toggleUnderlineWithAnalytics = function toggleUnderlineWithAnalytics(editorAnalyticsAPI) {
|
|
83
|
+
return function (_ref4) {
|
|
84
|
+
var inputMethod = _ref4.inputMethod;
|
|
85
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
86
|
+
action: ACTION.FORMATTED,
|
|
87
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
88
|
+
eventType: EVENT_TYPE.TRACK,
|
|
89
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_UNDERLINE,
|
|
90
|
+
attributes: {
|
|
91
|
+
inputMethod: inputMethod
|
|
92
|
+
}
|
|
93
|
+
})(toggleUnderline());
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export var toggleSuperscript = function toggleSuperscript() {
|
|
97
|
+
return function (state, dispatch) {
|
|
98
|
+
var subsup = state.schema.marks.subsup;
|
|
99
|
+
if (subsup) {
|
|
100
|
+
return toggleMark(subsup, {
|
|
101
|
+
type: 'sup'
|
|
102
|
+
})(state, dispatch);
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
export var toggleSuperscriptWithAnalytics = function toggleSuperscriptWithAnalytics(editorAnalyticsAPI) {
|
|
108
|
+
return function (_ref5) {
|
|
109
|
+
var inputMethod = _ref5.inputMethod;
|
|
110
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
111
|
+
action: ACTION.FORMATTED,
|
|
112
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
113
|
+
eventType: EVENT_TYPE.TRACK,
|
|
114
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_SUPER,
|
|
115
|
+
attributes: {
|
|
116
|
+
inputMethod: inputMethod
|
|
117
|
+
}
|
|
118
|
+
})(toggleSuperscript());
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export var toggleSubscript = function toggleSubscript() {
|
|
122
|
+
return function (state, dispatch) {
|
|
123
|
+
var subsup = state.schema.marks.subsup;
|
|
124
|
+
if (subsup) {
|
|
125
|
+
return toggleMark(subsup, {
|
|
126
|
+
type: 'sub'
|
|
127
|
+
})(state, dispatch);
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export var toggleSubscriptWithAnalytics = function toggleSubscriptWithAnalytics(editorAnalyticsAPI) {
|
|
133
|
+
return function (_ref6) {
|
|
134
|
+
var inputMethod = _ref6.inputMethod;
|
|
135
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
136
|
+
action: ACTION.FORMATTED,
|
|
137
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
138
|
+
eventType: EVENT_TYPE.TRACK,
|
|
139
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_SUB,
|
|
140
|
+
attributes: {
|
|
141
|
+
inputMethod: inputMethod
|
|
142
|
+
}
|
|
143
|
+
})(toggleSubscript());
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export var toggleCode = function toggleCode() {
|
|
147
|
+
return function (state, dispatch) {
|
|
148
|
+
var code = state.schema.marks.code;
|
|
149
|
+
if (code) {
|
|
150
|
+
return toggleMark(code)(state, dispatch);
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export var toggleCodeWithAnalytics = function toggleCodeWithAnalytics(editorAnalyticsAPI) {
|
|
156
|
+
return function (_ref7) {
|
|
157
|
+
var inputMethod = _ref7.inputMethod;
|
|
158
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
159
|
+
action: ACTION.FORMATTED,
|
|
160
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
161
|
+
eventType: EVENT_TYPE.TRACK,
|
|
162
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_CODE,
|
|
163
|
+
attributes: {
|
|
164
|
+
inputMethod: inputMethod
|
|
165
|
+
}
|
|
166
|
+
})(toggleCode());
|
|
167
|
+
};
|
|
168
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { applyMarkOnRange
|
|
2
|
+
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { hasCode, markActive } from '../utils';
|
|
5
5
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
@@ -97,171 +97,6 @@ export var moveLeft = function moveLeft() {
|
|
|
97
97
|
return false;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
export var toggleEm = function toggleEm() {
|
|
101
|
-
return function (state, dispatch) {
|
|
102
|
-
var em = state.schema.marks.em;
|
|
103
|
-
if (em) {
|
|
104
|
-
return toggleMark(em)(state, dispatch);
|
|
105
|
-
}
|
|
106
|
-
return false;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
export var toggleEmWithAnalytics = function toggleEmWithAnalytics(editorAnalyticsAPI) {
|
|
110
|
-
return function (_ref3) {
|
|
111
|
-
var inputMethod = _ref3.inputMethod;
|
|
112
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
113
|
-
action: ACTION.FORMATTED,
|
|
114
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
115
|
-
eventType: EVENT_TYPE.TRACK,
|
|
116
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_ITALIC,
|
|
117
|
-
attributes: {
|
|
118
|
-
inputMethod: inputMethod
|
|
119
|
-
}
|
|
120
|
-
})(toggleEm());
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
export var toggleStrike = function toggleStrike() {
|
|
124
|
-
return function (state, dispatch) {
|
|
125
|
-
var strike = state.schema.marks.strike;
|
|
126
|
-
if (strike) {
|
|
127
|
-
return toggleMark(strike)(state, dispatch);
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
export var toggleStrikeWithAnalytics = function toggleStrikeWithAnalytics(editorAnalyticsAPI) {
|
|
133
|
-
return function (_ref4) {
|
|
134
|
-
var inputMethod = _ref4.inputMethod;
|
|
135
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
136
|
-
action: ACTION.FORMATTED,
|
|
137
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
138
|
-
eventType: EVENT_TYPE.TRACK,
|
|
139
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_STRIKE,
|
|
140
|
-
attributes: {
|
|
141
|
-
inputMethod: inputMethod
|
|
142
|
-
}
|
|
143
|
-
})(toggleStrike());
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
export var toggleStrong = function toggleStrong() {
|
|
147
|
-
return function (state, dispatch) {
|
|
148
|
-
var strong = state.schema.marks.strong;
|
|
149
|
-
if (strong) {
|
|
150
|
-
return toggleMark(strong)(state, dispatch);
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
export var toggleStrongWithAnalytics = function toggleStrongWithAnalytics(editorAnalyticsAPI) {
|
|
156
|
-
return function (_ref5) {
|
|
157
|
-
var inputMethod = _ref5.inputMethod;
|
|
158
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
159
|
-
action: ACTION.FORMATTED,
|
|
160
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
161
|
-
eventType: EVENT_TYPE.TRACK,
|
|
162
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_STRONG,
|
|
163
|
-
attributes: {
|
|
164
|
-
inputMethod: inputMethod
|
|
165
|
-
}
|
|
166
|
-
})(toggleStrong());
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
export var toggleUnderline = function toggleUnderline() {
|
|
170
|
-
return function (state, dispatch) {
|
|
171
|
-
var underline = state.schema.marks.underline;
|
|
172
|
-
if (underline) {
|
|
173
|
-
return toggleMark(underline)(state, dispatch);
|
|
174
|
-
}
|
|
175
|
-
return false;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
export var toggleUnderlineWithAnalytics = function toggleUnderlineWithAnalytics(editorAnalyticsAPI) {
|
|
179
|
-
return function (_ref6) {
|
|
180
|
-
var inputMethod = _ref6.inputMethod;
|
|
181
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
182
|
-
action: ACTION.FORMATTED,
|
|
183
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
184
|
-
eventType: EVENT_TYPE.TRACK,
|
|
185
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_UNDERLINE,
|
|
186
|
-
attributes: {
|
|
187
|
-
inputMethod: inputMethod
|
|
188
|
-
}
|
|
189
|
-
})(toggleUnderline());
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
export var toggleSuperscript = function toggleSuperscript() {
|
|
193
|
-
return function (state, dispatch) {
|
|
194
|
-
var subsup = state.schema.marks.subsup;
|
|
195
|
-
if (subsup) {
|
|
196
|
-
return toggleMark(subsup, {
|
|
197
|
-
type: 'sup'
|
|
198
|
-
})(state, dispatch);
|
|
199
|
-
}
|
|
200
|
-
return false;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
export var toggleSuperscriptWithAnalytics = function toggleSuperscriptWithAnalytics(editorAnalyticsAPI) {
|
|
204
|
-
return function (_ref7) {
|
|
205
|
-
var inputMethod = _ref7.inputMethod;
|
|
206
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
207
|
-
action: ACTION.FORMATTED,
|
|
208
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
209
|
-
eventType: EVENT_TYPE.TRACK,
|
|
210
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_SUPER,
|
|
211
|
-
attributes: {
|
|
212
|
-
inputMethod: inputMethod
|
|
213
|
-
}
|
|
214
|
-
})(toggleSuperscript());
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
export var toggleSubscript = function toggleSubscript() {
|
|
218
|
-
return function (state, dispatch) {
|
|
219
|
-
var subsup = state.schema.marks.subsup;
|
|
220
|
-
if (subsup) {
|
|
221
|
-
return toggleMark(subsup, {
|
|
222
|
-
type: 'sub'
|
|
223
|
-
})(state, dispatch);
|
|
224
|
-
}
|
|
225
|
-
return false;
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
export var toggleSubscriptWithAnalytics = function toggleSubscriptWithAnalytics(editorAnalyticsAPI) {
|
|
229
|
-
return function (_ref8) {
|
|
230
|
-
var inputMethod = _ref8.inputMethod;
|
|
231
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
232
|
-
action: ACTION.FORMATTED,
|
|
233
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
234
|
-
eventType: EVENT_TYPE.TRACK,
|
|
235
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_SUB,
|
|
236
|
-
attributes: {
|
|
237
|
-
inputMethod: inputMethod
|
|
238
|
-
}
|
|
239
|
-
})(toggleSubscript());
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
export var toggleCode = function toggleCode() {
|
|
243
|
-
return function (state, dispatch) {
|
|
244
|
-
var code = state.schema.marks.code;
|
|
245
|
-
if (code) {
|
|
246
|
-
return toggleMark(code)(state, dispatch);
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
export var toggleCodeWithAnalytics = function toggleCodeWithAnalytics(editorAnalyticsAPI) {
|
|
252
|
-
return function (_ref9) {
|
|
253
|
-
var inputMethod = _ref9.inputMethod;
|
|
254
|
-
return withAnalytics(editorAnalyticsAPI, {
|
|
255
|
-
action: ACTION.FORMATTED,
|
|
256
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
257
|
-
eventType: EVENT_TYPE.TRACK,
|
|
258
|
-
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_CODE,
|
|
259
|
-
attributes: {
|
|
260
|
-
inputMethod: inputMethod
|
|
261
|
-
}
|
|
262
|
-
})(toggleCode());
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
100
|
var createInlineCodeFromTextInput = function createInlineCodeFromTextInput(from, to, text) {
|
|
266
101
|
return function (state, dispatch) {
|
|
267
102
|
if (state.selection.empty) {
|
|
@@ -9,7 +9,9 @@ import textFormattingInputRulePlugin from './pm-plugins/input-rule';
|
|
|
9
9
|
import keymapPlugin from './pm-plugins/keymap';
|
|
10
10
|
import textFormattingSmartInputRulePlugin from './pm-plugins/smart-input-rule';
|
|
11
11
|
import Toolbar from './ui/Toolbar';
|
|
12
|
+
import { toggleSuperscriptWithAnalytics, toggleSubscriptWithAnalytics, toggleStrikeWithAnalytics, toggleCodeWithAnalytics, toggleUnderlineWithAnalytics, toggleEmWithAnalytics, toggleStrongWithAnalytics } from './actions';
|
|
12
13
|
var textFormatting = function textFormatting() {
|
|
14
|
+
var _api$dependencies$ana7, _api$dependencies$ana8, _api$dependencies$ana9, _api$dependencies$ana10, _api$dependencies$ana11, _api$dependencies$ana12, _api$dependencies$ana13;
|
|
13
15
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
16
|
var api = arguments.length > 1 ? arguments[1] : undefined;
|
|
15
17
|
return {
|
|
@@ -111,6 +113,15 @@ var textFormatting = function textFormatting() {
|
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
115
|
});
|
|
116
|
+
},
|
|
117
|
+
actions: {
|
|
118
|
+
toggleSuperscript: toggleSuperscriptWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana7 = api.dependencies.analytics) === null || _api$dependencies$ana7 === void 0 ? void 0 : _api$dependencies$ana7.actions),
|
|
119
|
+
toggleSubscript: toggleSubscriptWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana8 = api.dependencies.analytics) === null || _api$dependencies$ana8 === void 0 ? void 0 : _api$dependencies$ana8.actions),
|
|
120
|
+
toggleStrike: toggleStrikeWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana9 = api.dependencies.analytics) === null || _api$dependencies$ana9 === void 0 ? void 0 : _api$dependencies$ana9.actions),
|
|
121
|
+
toggleCode: toggleCodeWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana10 = api.dependencies.analytics) === null || _api$dependencies$ana10 === void 0 ? void 0 : _api$dependencies$ana10.actions),
|
|
122
|
+
toggleUnderline: toggleUnderlineWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana11 = api.dependencies.analytics) === null || _api$dependencies$ana11 === void 0 ? void 0 : _api$dependencies$ana11.actions),
|
|
123
|
+
toggleEm: toggleEmWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana12 = api.dependencies.analytics) === null || _api$dependencies$ana12 === void 0 ? void 0 : _api$dependencies$ana12.actions),
|
|
124
|
+
toggleStrong: toggleStrongWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana13 = api.dependencies.analytics) === null || _api$dependencies$ana13 === void 0 ? void 0 : _api$dependencies$ana13.actions)
|
|
114
125
|
}
|
|
115
126
|
};
|
|
116
127
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import
|
|
4
|
+
import { toggleStrongWithAnalytics, toggleEmWithAnalytics, toggleCodeWithAnalytics, toggleStrikeWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../actions';
|
|
5
5
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
6
6
|
var list = {};
|
|
7
7
|
if (schema.marks.strong) {
|
|
8
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleBold.common,
|
|
8
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)({
|
|
9
9
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
10
10
|
}), list);
|
|
11
11
|
}
|
|
12
12
|
if (schema.marks.em) {
|
|
13
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleItalic.common,
|
|
13
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)({
|
|
14
14
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
15
15
|
}), list);
|
|
16
16
|
}
|
|
17
17
|
if (schema.marks.code) {
|
|
18
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleCode.common,
|
|
18
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)({
|
|
19
19
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
20
20
|
}), list);
|
|
21
21
|
}
|
|
22
22
|
if (schema.marks.strike) {
|
|
23
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleStrikethrough.common,
|
|
23
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)({
|
|
24
24
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
25
25
|
}), list);
|
|
26
26
|
}
|
|
27
27
|
if (schema.marks.subsup) {
|
|
28
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleSubscript.common,
|
|
28
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)({
|
|
29
29
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
30
30
|
}), list);
|
|
31
31
|
}
|
|
32
32
|
if (schema.marks.subsup) {
|
|
33
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleSuperscript.common,
|
|
33
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)({
|
|
34
34
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
35
35
|
}), list);
|
|
36
36
|
}
|
|
37
37
|
if (schema.marks.underline) {
|
|
38
|
-
keymaps.bindKeymapWithCommand(keymaps.toggleUnderline.common,
|
|
38
|
+
keymaps.bindKeymapWithCommand(keymaps.toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)({
|
|
39
39
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
40
40
|
}), list);
|
|
41
41
|
}
|
|
@@ -6,7 +6,7 @@ import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
|
6
6
|
import { shallowEqual } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { createInlineCodeFromTextInputWithAnalytics } from '../commands/text-formatting';
|
|
8
8
|
import * as commands from '../commands/text-formatting';
|
|
9
|
-
import { anyMarkActive } from '
|
|
9
|
+
import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
10
10
|
import { pluginKey } from './plugin-key';
|
|
11
11
|
export { pluginKey };
|
|
12
12
|
var getTextFormattingState = function getTextFormattingState(editorState, editorAnalyticsAPI) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
5
|
-
import { toolbarMessages } from '
|
|
5
|
+
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { clearFormattingWithAnalytics } from '../../../commands/clear-formatting';
|
|
7
7
|
import { pluginKey as clearFormattingPluginKey } from '../../../pm-plugins/clear-formatting';
|
|
8
8
|
import { clearFormatting as clearFormattingKeymap, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
@@ -6,8 +6,8 @@ import { jsx } from '@emotion/react';
|
|
|
6
6
|
import BoldIcon from '@atlaskit/icon/glyph/editor/bold';
|
|
7
7
|
import ItalicIcon from '@atlaskit/icon/glyph/editor/italic';
|
|
8
8
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
9
|
-
import { toolbarMessages } from '
|
|
10
|
-
import
|
|
9
|
+
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
10
|
+
import { toggleStrongWithAnalytics, toggleEmWithAnalytics, toggleCodeWithAnalytics, toggleStrikeWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../actions';
|
|
11
11
|
import { TOOLBAR_ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin-key';
|
|
13
13
|
import { toggleCode, toggleStrikethrough, toggleUnderline, tooltip, toggleBold, toggleItalic, toggleSubscript, toggleSuperscript, ToolTipContent, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
@@ -21,7 +21,7 @@ var IconButtons = function IconButtons(editorAnalyticsAPI) {
|
|
|
21
21
|
return {
|
|
22
22
|
strong: {
|
|
23
23
|
buttonId: TOOLBAR_ACTION_SUBJECT_ID.TEXT_FORMATTING_STRONG,
|
|
24
|
-
command: withToolbarInputMethod(
|
|
24
|
+
command: withToolbarInputMethod(toggleStrongWithAnalytics(editorAnalyticsAPI)),
|
|
25
25
|
message: toolbarMessages.bold,
|
|
26
26
|
tooltipKeymap: toggleBold,
|
|
27
27
|
component: function component() {
|
|
@@ -32,7 +32,7 @@ var IconButtons = function IconButtons(editorAnalyticsAPI) {
|
|
|
32
32
|
},
|
|
33
33
|
em: {
|
|
34
34
|
buttonId: TOOLBAR_ACTION_SUBJECT_ID.TEXT_FORMATTING_ITALIC,
|
|
35
|
-
command: withToolbarInputMethod(
|
|
35
|
+
command: withToolbarInputMethod(toggleEmWithAnalytics(editorAnalyticsAPI)),
|
|
36
36
|
message: toolbarMessages.italic,
|
|
37
37
|
tooltipKeymap: toggleItalic,
|
|
38
38
|
component: function component() {
|
|
@@ -42,27 +42,27 @@ var IconButtons = function IconButtons(editorAnalyticsAPI) {
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
underline: {
|
|
45
|
-
command: withToolbarInputMethod(
|
|
45
|
+
command: withToolbarInputMethod(toggleUnderlineWithAnalytics(editorAnalyticsAPI)),
|
|
46
46
|
message: toolbarMessages.underline,
|
|
47
47
|
tooltipKeymap: toggleUnderline
|
|
48
48
|
},
|
|
49
49
|
strike: {
|
|
50
|
-
command: withToolbarInputMethod(
|
|
50
|
+
command: withToolbarInputMethod(toggleStrikeWithAnalytics(editorAnalyticsAPI)),
|
|
51
51
|
message: toolbarMessages.strike,
|
|
52
52
|
tooltipKeymap: toggleStrikethrough
|
|
53
53
|
},
|
|
54
54
|
code: {
|
|
55
|
-
command: withToolbarInputMethod(
|
|
55
|
+
command: withToolbarInputMethod(toggleCodeWithAnalytics(editorAnalyticsAPI)),
|
|
56
56
|
message: toolbarMessages.code,
|
|
57
57
|
tooltipKeymap: toggleCode
|
|
58
58
|
},
|
|
59
59
|
subscript: {
|
|
60
|
-
command: withToolbarInputMethod(
|
|
60
|
+
command: withToolbarInputMethod(toggleSubscriptWithAnalytics(editorAnalyticsAPI)),
|
|
61
61
|
message: toolbarMessages.subscript,
|
|
62
62
|
tooltipKeymap: toggleSubscript
|
|
63
63
|
},
|
|
64
64
|
superscript: {
|
|
65
|
-
command: withToolbarInputMethod(
|
|
65
|
+
command: withToolbarInputMethod(toggleSuperscriptWithAnalytics(editorAnalyticsAPI)),
|
|
66
66
|
message: toolbarMessages.superscript,
|
|
67
67
|
tooltipKeymap: toggleSuperscript
|
|
68
68
|
}
|
|
@@ -18,7 +18,7 @@ import { useResponsiveToolbarButtons, useResponsiveIconTypeMenu } from './hooks/
|
|
|
18
18
|
import { SingleToolbarButtons } from './single-toolbar-buttons';
|
|
19
19
|
import { MoreButton } from './more-button';
|
|
20
20
|
import { FormattingTextDropdownMenu } from './dropdown-menu';
|
|
21
|
-
import { toolbarMessages } from '
|
|
21
|
+
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
22
22
|
import { compareItemsArrays, isArrayContainsContent } from '../../utils';
|
|
23
23
|
import { Announcer } from '@atlaskit/editor-common/ui';
|
|
24
24
|
import { usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
2
2
|
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './commands/clear-formatting';
|
|
3
3
|
export var hasCode = function hasCode(state, pos) {
|
|
4
4
|
var code = state.schema.marks.code;
|
|
@@ -30,37 +30,10 @@ export var markActive = function markActive(state, mark) {
|
|
|
30
30
|
});
|
|
31
31
|
return found;
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Determine if a mark of a specific type exists anywhere in the selection.
|
|
36
|
-
*/
|
|
37
|
-
export var anyMarkActive = function anyMarkActive(state, markType) {
|
|
33
|
+
var blockStylingIsPresent = function blockStylingIsPresent(state) {
|
|
38
34
|
var _state$selection2 = state.selection,
|
|
39
|
-
$from = _state$selection2.$from,
|
|
40
35
|
from = _state$selection2.from,
|
|
41
|
-
to = _state$selection2.to
|
|
42
|
-
empty = _state$selection2.empty;
|
|
43
|
-
if (empty) {
|
|
44
|
-
return !!markType.isInSet(state.storedMarks || $from.marks());
|
|
45
|
-
}
|
|
46
|
-
var rangeHasMark = false;
|
|
47
|
-
if (state.selection instanceof CellSelection) {
|
|
48
|
-
state.selection.forEachCell(function (cell, cellPos) {
|
|
49
|
-
var from = cellPos;
|
|
50
|
-
var to = cellPos + cell.nodeSize;
|
|
51
|
-
if (!rangeHasMark) {
|
|
52
|
-
rangeHasMark = state.doc.rangeHasMark(from, to, markType);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
rangeHasMark = state.doc.rangeHasMark(from, to, markType);
|
|
57
|
-
}
|
|
58
|
-
return rangeHasMark;
|
|
59
|
-
};
|
|
60
|
-
var blockStylingIsPresent = function blockStylingIsPresent(state) {
|
|
61
|
-
var _state$selection3 = state.selection,
|
|
62
|
-
from = _state$selection3.from,
|
|
63
|
-
to = _state$selection3.to;
|
|
36
|
+
to = _state$selection2.to;
|
|
64
37
|
var isBlockStyling = false;
|
|
65
38
|
state.doc.nodesBetween(from, to, function (node) {
|
|
66
39
|
if (FORMATTING_NODE_TYPES.indexOf(node.type.name) !== -1) {
|
|
@@ -74,9 +47,9 @@ var blockStylingIsPresent = function blockStylingIsPresent(state) {
|
|
|
74
47
|
var marksArePresent = function marksArePresent(state) {
|
|
75
48
|
var activeMarkTypes = FORMATTING_MARK_TYPES.filter(function (mark) {
|
|
76
49
|
if (!!state.schema.marks[mark]) {
|
|
77
|
-
var _state$
|
|
78
|
-
$from = _state$
|
|
79
|
-
empty = _state$
|
|
50
|
+
var _state$selection3 = state.selection,
|
|
51
|
+
$from = _state$selection3.$from,
|
|
52
|
+
empty = _state$selection3.empty;
|
|
80
53
|
var marks = state.schema.marks;
|
|
81
54
|
if (empty) {
|
|
82
55
|
return !!marks[mark].isInSet(state.storedMarks || $from.marks());
|
|
@@ -20,7 +20,6 @@ import { panelStyles } from '../../plugins/panel/styles';
|
|
|
20
20
|
import { fakeCursorStyles } from '../../plugins/fake-text-cursor/styles';
|
|
21
21
|
import { mentionsStyles } from '../../plugins/mentions/styles';
|
|
22
22
|
import { emojiStyles } from '../../plugins/emoji/styles';
|
|
23
|
-
import { textFormattingStyles } from '../../plugins/text-formatting/styles';
|
|
24
23
|
import { placeholderTextStyles } from '../../plugins/placeholder-text/styles';
|
|
25
24
|
import { extensionStyles } from '../../plugins/extension/ui/styles';
|
|
26
25
|
import { expandStyles } from '../../plugins/expand/ui/styles';
|
|
@@ -30,12 +29,12 @@ import { taskDecisionStyles } from '../../plugins/tasks-and-decisions/styles';
|
|
|
30
29
|
import { statusStyles } from '../../plugins/status/styles';
|
|
31
30
|
import { dateStyles } from '../../plugins/date/styles';
|
|
32
31
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
33
|
-
import { linkSharedStyle } from '@atlaskit/editor-common/styles';
|
|
32
|
+
import { linkSharedStyle, codeMarkSharedStyles } from '@atlaskit/editor-common/styles';
|
|
34
33
|
export var linkStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n"])), linkSharedStyle);
|
|
35
34
|
var contentStyles = function contentStyles(props) {
|
|
36
35
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
|
37
36
|
theme: props.theme
|
|
38
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props),
|
|
37
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), codeMarkSharedStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
39
38
|
};
|
|
40
39
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
41
40
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
package/dist/esm/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nextMajorVersion } from '
|
|
2
|
-
export default function
|
|
1
|
+
import { nextMajorVersion } from '../version-wrapper';
|
|
2
|
+
export default function editorDeprecationWarnings(props) {
|
|
3
3
|
if (process.env.NODE_ENV === 'production') {
|
|
4
4
|
return;
|
|
5
5
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -24,7 +24,6 @@ export interface EditorViewProps {
|
|
|
24
24
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
25
25
|
providerFactory: ProviderFactory;
|
|
26
26
|
portalProviderAPI: PortalProviderAPI;
|
|
27
|
-
allowAnalyticsGASV3?: boolean;
|
|
28
27
|
disabled?: boolean;
|
|
29
28
|
experienceStore?: ExperienceStore;
|
|
30
29
|
render?: (props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import EditorActions from '../../actions';
|
|
5
|
-
import { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
-
import { EditorNextProps } from '../../types/editor-props';
|
|
4
|
+
import type EditorActions from '../../actions';
|
|
5
|
+
import type { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
+
import type { EditorNextProps } from '../../types/editor-props';
|
|
7
7
|
export type ProviderFactoryState = {
|
|
8
8
|
extensionProvider?: ExtensionProvider;
|
|
9
9
|
quickInsertProvider?: Promise<QuickInsertProvider>;
|
package/dist/types/editor.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ import type { EditorProps } from './types/editor-props';
|
|
|
5
5
|
export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
|
|
6
6
|
export default class Editor extends React.Component<EditorProps> {
|
|
7
7
|
static defaultProps: EditorProps;
|
|
8
|
+
constructor(props: EditorProps);
|
|
8
9
|
render(): jsx.JSX.Element;
|
|
9
10
|
}
|