@atlaskit/editor-core 164.0.3 → 166.0.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 +43 -0
- package/dist/cjs/actions/index.js +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +14 -6
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +32 -1
- package/dist/cjs/event-dispatcher/index.js +9 -0
- package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/nodeviews/getPerformanceOptions.js +1 -1
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
- package/dist/cjs/plugins/card/styles.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -4
- package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
- package/dist/cjs/plugins/date/styles.js +3 -1
- package/dist/cjs/plugins/emoji/index.js +30 -34
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
- package/dist/cjs/plugins/emoji/styles.js +3 -17
- package/dist/cjs/plugins/expand/ui/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
- package/dist/cjs/plugins/layout/styles.js +3 -1
- package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
- package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
- package/dist/cjs/plugins/list/transforms.js +11 -3
- package/dist/cjs/plugins/media/styles.js +3 -1
- package/dist/cjs/plugins/mentions/index.js +10 -14
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
- package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/cjs/plugins/panel/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/cjs/plugins/rule/styles.js +3 -1
- package/dist/cjs/plugins/selection/utils.js +39 -23
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -4
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
- package/dist/cjs/plugins/type-ahead/index.js +6 -2
- package/dist/cjs/plugins/unsupported-content/index.js +22 -10
- package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
- package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +57 -0
- package/dist/cjs/ui/PortalProvider/index.js +66 -19
- package/dist/cjs/utils/check-if-mobile-bridge.js +19 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +12 -1
- package/dist/es2019/create-editor/ReactEditorView.js +14 -6
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +33 -2
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
- package/dist/es2019/plugins/card/styles.js +9 -5
- package/dist/es2019/plugins/code-block/styles.js +11 -8
- package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
- package/dist/es2019/plugins/date/styles.js +3 -1
- package/dist/es2019/plugins/emoji/index.js +16 -21
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
- package/dist/es2019/plugins/emoji/styles.js +1 -82
- package/dist/es2019/plugins/expand/ui/styles.js +2 -2
- package/dist/es2019/plugins/extension/ui/styles.js +4 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/es2019/plugins/layout/styles.js +3 -2
- package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
- package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
- package/dist/es2019/plugins/list/transforms.js +9 -4
- package/dist/es2019/plugins/media/styles.js +9 -7
- package/dist/es2019/plugins/mentions/index.js +1 -6
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/es2019/plugins/panel/styles.js +5 -4
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/es2019/plugins/rule/styles.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +35 -20
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/table/ui/consts.js +5 -4
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
- package/dist/es2019/plugins/type-ahead/index.js +5 -1
- package/dist/es2019/plugins/unsupported-content/index.js +23 -12
- package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
- package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
- package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +3 -3
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +39 -0
- package/dist/es2019/ui/PortalProvider/index.js +39 -3
- package/dist/es2019/utils/check-if-mobile-bridge.js +12 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +8 -0
- package/dist/esm/create-editor/ReactEditorView.js +14 -6
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +33 -2
- package/dist/esm/event-dispatcher/index.js +9 -0
- package/dist/esm/nodeviews/ReactNodeView.js +1 -10
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +5 -4
- package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
- package/dist/esm/plugins/date/styles.js +2 -1
- package/dist/esm/plugins/emoji/index.js +26 -29
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
- package/dist/esm/plugins/emoji/styles.js +3 -14
- package/dist/esm/plugins/expand/ui/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/esm/plugins/layout/styles.js +2 -1
- package/dist/esm/plugins/list/commands/indent-list.js +4 -1
- package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
- package/dist/esm/plugins/list/transforms.js +9 -4
- package/dist/esm/plugins/media/styles.js +2 -1
- package/dist/esm/plugins/mentions/index.js +10 -14
- package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
- package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/esm/plugins/panel/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/esm/plugins/rule/styles.js +2 -1
- package/dist/esm/plugins/selection/utils.js +35 -20
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +5 -4
- package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
- package/dist/esm/plugins/type-ahead/index.js +6 -2
- package/dist/esm/plugins/unsupported-content/index.js +21 -11
- package/dist/esm/plugins/unsupported-content/styles.js +3 -2
- package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/esm/ui/Appearance/Chromeless.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +39 -0
- package/dist/esm/ui/PortalProvider/index.js +61 -19
- package/dist/esm/utils/check-if-mobile-bridge.js +12 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -1
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/event-dispatcher/index.d.ts +1 -0
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
- package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -6
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
- package/dist/types/plugins/emoji/styles.d.ts +0 -1
- package/dist/types/plugins/emoji/types.d.ts +0 -1
- package/dist/types/plugins/list/transforms.d.ts +10 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
- package/dist/types/plugins/selection/utils.d.ts +7 -15
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -2
- package/dist/types/plugins/type-ahead/types.d.ts +1 -0
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +0 -14
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +6 -0
- package/dist/types/ui/PortalProvider/index.d.ts +5 -1
- package/dist/types/utils/check-if-mobile-bridge.d.ts +1 -0
- package/package.json +24 -23
- package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
- package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
- package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
- package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
import { DOMSerializer } from 'prosemirror-model';
|
|
7
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
8
|
-
export var EmojiNodeView = /*#__PURE__*/function () {
|
|
9
|
-
function EmojiNodeView(node, _, context) {
|
|
10
|
-
var _this = this,
|
|
11
|
-
_this$options;
|
|
12
|
-
|
|
13
|
-
_classCallCheck(this, EmojiNodeView);
|
|
14
|
-
|
|
15
|
-
_defineProperty(this, "hasProvider", false);
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "subscribe", function (_, provider) {
|
|
18
|
-
_this.hasProvider = false;
|
|
19
|
-
_this.emojiProvider = provider;
|
|
20
|
-
provider === null || provider === void 0 ? void 0 : provider.then(function () {
|
|
21
|
-
return _this.hasProvider = true;
|
|
22
|
-
}).then(function () {
|
|
23
|
-
return _this.findEmoji();
|
|
24
|
-
}).then(function (emoji) {
|
|
25
|
-
return _this.update(_this.node, null, emoji);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
this.node = node;
|
|
30
|
-
this.providers = context.providerFactory;
|
|
31
|
-
this.options = context.options;
|
|
32
|
-
this.dom = EmojiNodeView.toDom(node);
|
|
33
|
-
this.el = this.dom;
|
|
34
|
-
this.providers.subscribe('emojiProvider', this.subscribe);
|
|
35
|
-
|
|
36
|
-
if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.allowZeroWidthSpaceAfter) {
|
|
37
|
-
this.el.after(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this.update(this.node, null);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
_createClass(EmojiNodeView, [{
|
|
44
|
-
key: "findEmoji",
|
|
45
|
-
value: function () {
|
|
46
|
-
var _findEmoji = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
47
|
-
var node,
|
|
48
|
-
emojiProvider,
|
|
49
|
-
_args = arguments;
|
|
50
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
51
|
-
while (1) {
|
|
52
|
-
switch (_context.prev = _context.next) {
|
|
53
|
-
case 0:
|
|
54
|
-
node = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.node;
|
|
55
|
-
_context.next = 3;
|
|
56
|
-
return this.emojiProvider;
|
|
57
|
-
|
|
58
|
-
case 3:
|
|
59
|
-
emojiProvider = _context.sent;
|
|
60
|
-
|
|
61
|
-
if (!emojiProvider) {
|
|
62
|
-
_context.next = 6;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return _context.abrupt("return", emojiProvider.findByEmojiId({
|
|
67
|
-
id: node.attrs.id,
|
|
68
|
-
shortName: node.attrs.shortName,
|
|
69
|
-
fallback: node.attrs.text
|
|
70
|
-
}));
|
|
71
|
-
|
|
72
|
-
case 6:
|
|
73
|
-
case "end":
|
|
74
|
-
return _context.stop();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}, _callee, this);
|
|
78
|
-
}));
|
|
79
|
-
|
|
80
|
-
function findEmoji() {
|
|
81
|
-
return _findEmoji.apply(this, arguments);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return findEmoji;
|
|
85
|
-
}()
|
|
86
|
-
}, {
|
|
87
|
-
key: "destroy",
|
|
88
|
-
value: function destroy() {
|
|
89
|
-
this.providers.unsubscribe('emojiProvider', this.subscribe);
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
key: "update",
|
|
93
|
-
value: function update(node, _) {
|
|
94
|
-
var _this2 = this;
|
|
95
|
-
|
|
96
|
-
var emoji = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.emoji;
|
|
97
|
-
|
|
98
|
-
if (this.node.type !== node.type) {
|
|
99
|
-
this.node = node;
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
var prev = this.node.attrs;
|
|
104
|
-
var next = node.attrs;
|
|
105
|
-
var changed = false;
|
|
106
|
-
|
|
107
|
-
if (prev.id !== next.id) {
|
|
108
|
-
changed = true;
|
|
109
|
-
this.el.dataset.emojiId = next.id;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (prev.shortName !== next.shortName) {
|
|
113
|
-
changed = true;
|
|
114
|
-
this.el.dataset.emojiShortname = next.shortName;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (changed) {
|
|
118
|
-
this.emoji = undefined;
|
|
119
|
-
this.node = node;
|
|
120
|
-
this.findEmoji().then(function (emoji) {
|
|
121
|
-
return _this2.update(_this2.node, _, emoji);
|
|
122
|
-
});
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (!this.hasProvider) {
|
|
127
|
-
this.el.classList.add('editor-emoji-loading');
|
|
128
|
-
this.el.style.backgroundSize = '';
|
|
129
|
-
this.el.style.backgroundPosition = '';
|
|
130
|
-
this.el.style.backgroundImage = '';
|
|
131
|
-
this.node = node;
|
|
132
|
-
this.emoji = emoji;
|
|
133
|
-
return true;
|
|
134
|
-
} else {
|
|
135
|
-
this.el.classList.remove('editor-emoji-loading');
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (!emoji) {
|
|
139
|
-
this.el.classList.add('editor-emoji-fallback');
|
|
140
|
-
this.el.style.backgroundSize = '';
|
|
141
|
-
this.el.style.backgroundPosition = '';
|
|
142
|
-
this.el.style.backgroundImage = '';
|
|
143
|
-
this.node = node;
|
|
144
|
-
this.emoji = emoji;
|
|
145
|
-
return true;
|
|
146
|
-
} else {
|
|
147
|
-
this.el.classList.remove('editor-emoji-fallback');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (this.emoji === emoji) {
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
var representation = emoji === null || emoji === void 0 ? void 0 : emoji.representation;
|
|
155
|
-
|
|
156
|
-
if (EmojiNodeView.isSprite(representation)) {
|
|
157
|
-
var sprite = representation.sprite,
|
|
158
|
-
xIndex = representation.xIndex,
|
|
159
|
-
yIndex = representation.yIndex;
|
|
160
|
-
var row = sprite.row,
|
|
161
|
-
column = sprite.column,
|
|
162
|
-
url = sprite.url;
|
|
163
|
-
var xPosition = 100 / (column - 1) * (xIndex - 0);
|
|
164
|
-
var yPosition = 100 / (row - 1) * (yIndex - 0);
|
|
165
|
-
this.el.style.backgroundSize = "".concat(column * 100, "% ").concat(row * 100, "%");
|
|
166
|
-
this.el.style.backgroundPosition = "".concat(xPosition, "% ").concat(yPosition, "%");
|
|
167
|
-
this.el.style.backgroundImage = "url(".concat(url, ")");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (EmojiNodeView.isImage(representation) || EmojiNodeView.isMedia(representation)) {
|
|
171
|
-
var path = EmojiNodeView.isImage(representation) ? representation.imagePath : representation.mediaPath;
|
|
172
|
-
var rawWidth = representation.width,
|
|
173
|
-
rawHeight = representation.height;
|
|
174
|
-
var width = rawWidth / (rawHeight / 20);
|
|
175
|
-
this.el.style.width = "".concat(width, "px");
|
|
176
|
-
this.el.style.backgroundImage = "url(".concat(path, ")");
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
this.emoji = emoji;
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "ignoreMutation",
|
|
184
|
-
value: function ignoreMutation(_) {
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
}], [{
|
|
188
|
-
key: "toDomSpec",
|
|
189
|
-
value: function toDomSpec(node) {
|
|
190
|
-
return ['span', {
|
|
191
|
-
'aria-label': node.attrs.shortName,
|
|
192
|
-
'data-emoji-id': node.attrs.id,
|
|
193
|
-
'data-emoji-shortname': node.attrs.shortName,
|
|
194
|
-
class: 'editor-emoji'
|
|
195
|
-
}, node.attrs.shortName];
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
key: "toDom",
|
|
199
|
-
value: function toDom(node) {
|
|
200
|
-
return DOMSerializer.renderSpec(document, EmojiNodeView.toDomSpec(node)).dom;
|
|
201
|
-
}
|
|
202
|
-
}, {
|
|
203
|
-
key: "isSprite",
|
|
204
|
-
value: function isSprite(representation) {
|
|
205
|
-
var _representation$hasOw;
|
|
206
|
-
|
|
207
|
-
return (_representation$hasOw = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('sprite')) !== null && _representation$hasOw !== void 0 ? _representation$hasOw : false;
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "isImage",
|
|
211
|
-
value: function isImage(representation) {
|
|
212
|
-
var _representation$hasOw2;
|
|
213
|
-
|
|
214
|
-
return (_representation$hasOw2 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('imagePath')) !== null && _representation$hasOw2 !== void 0 ? _representation$hasOw2 : false;
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "isMedia",
|
|
218
|
-
value: function isMedia(representation) {
|
|
219
|
-
var _representation$hasOw3;
|
|
220
|
-
|
|
221
|
-
return (_representation$hasOw3 = representation === null || representation === void 0 ? void 0 : representation.hasOwnProperty('mediaPath')) !== null && _representation$hasOw3 !== void 0 ? _representation$hasOw3 : false;
|
|
222
|
-
}
|
|
223
|
-
}]);
|
|
224
|
-
|
|
225
|
-
return EmojiNodeView;
|
|
226
|
-
}();
|
|
227
|
-
export default function emojiNodeView(providerFactory, options) {
|
|
228
|
-
return function (node, view) {
|
|
229
|
-
return new EmojiNodeView(node, view, {
|
|
230
|
-
providerFactory: providerFactory,
|
|
231
|
-
options: options
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
import { EditorView, NodeView } from 'prosemirror-view';
|
|
3
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import type { EmojiDescription } from '@atlaskit/emoji';
|
|
5
|
-
import { EmojiPluginOptions } from '../types';
|
|
6
|
-
export interface Props {
|
|
7
|
-
providerFactory: ProviderFactory;
|
|
8
|
-
options?: EmojiPluginOptions;
|
|
9
|
-
}
|
|
10
|
-
export declare class EmojiNodeView implements NodeView {
|
|
11
|
-
private node;
|
|
12
|
-
private options?;
|
|
13
|
-
private providers;
|
|
14
|
-
private emojiProvider;
|
|
15
|
-
private hasProvider;
|
|
16
|
-
private emoji;
|
|
17
|
-
private el;
|
|
18
|
-
dom: HTMLElement;
|
|
19
|
-
constructor(node: PMNode, _: EditorView, context: Props);
|
|
20
|
-
private static toDomSpec;
|
|
21
|
-
private static toDom;
|
|
22
|
-
private static isSprite;
|
|
23
|
-
private static isImage;
|
|
24
|
-
private static isMedia;
|
|
25
|
-
private subscribe;
|
|
26
|
-
private findEmoji;
|
|
27
|
-
destroy(): void;
|
|
28
|
-
update(node: PMNode, _: unknown, emoji?: EmojiDescription | undefined): boolean;
|
|
29
|
-
ignoreMutation(_: unknown): boolean;
|
|
30
|
-
}
|
|
31
|
-
export default function emojiNodeView(providerFactory: ProviderFactory, options?: EmojiPluginOptions): (node: PMNode, view: EditorView) => NodeView;
|