@atlaskit/editor-common 71.0.3 → 72.0.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 +78 -0
- package/dist/cjs/analytics/types/enums.js +20 -1
- package/dist/cjs/i18n/index.js +13 -5
- package/dist/cjs/i18n/languages.js +42 -0
- package/dist/cjs/keymaps/index.js +56 -6
- package/dist/cjs/styles/index.js +8 -2
- package/dist/cjs/styles/shared/annotation.js +9 -14
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/blockquote.js +1 -3
- package/dist/cjs/styles/shared/code-block.js +13 -16
- package/dist/cjs/styles/shared/code-mark.js +2 -4
- package/dist/cjs/styles/shared/lists.js +55 -4
- package/dist/cjs/styles/shared/panel.js +29 -39
- package/dist/cjs/styles/shared/rule.js +2 -4
- package/dist/cjs/styles/shared/shadow.js +1 -1
- package/dist/cjs/styles/shared/table.js +24 -26
- package/dist/cjs/types/next-editor-plugin.js +5 -0
- package/dist/cjs/ui/Caption/index.js +2 -4
- package/dist/cjs/ui/DropList/index.js +5 -7
- package/dist/cjs/ui/Emoji/index.js +11 -2
- package/dist/cjs/ui/Expand/index.js +17 -19
- package/dist/cjs/ui/Messages/index.js +3 -5
- package/dist/cjs/ui/Popup/index.js +72 -2
- package/dist/cjs/ui/Popup/utils.js +13 -6
- package/dist/cjs/ui/UnsupportedBlock/index.js +3 -5
- package/dist/cjs/ui/UnsupportedInline/index.js +3 -5
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +138 -0
- package/dist/cjs/ui-color/ColorPalette/index.js +20 -2
- package/dist/cjs/ui-menu/DropdownMenu/index.js +12 -12
- package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/cjs/utils/analytics.js +1 -38
- package/dist/cjs/utils/builder.js +44 -0
- package/dist/cjs/utils/compareNodes.js +86 -33
- package/dist/cjs/utils/index.js +47 -1
- package/dist/cjs/utils/list.js +47 -0
- package/dist/cjs/utils/plugin-state-factory.js +9 -9
- package/dist/cjs/utils/referentiality.js +281 -2
- package/dist/cjs/utils/track-unsupported-content.js +19 -20
- package/dist/cjs/utils/validate-using-spec.js +8 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/types/enums.js +20 -1
- package/dist/es2019/i18n/index.js +4 -3
- package/dist/es2019/i18n/languages.js +34 -0
- package/dist/es2019/keymaps/index.js +48 -2
- package/dist/es2019/styles/index.js +1 -1
- package/dist/es2019/styles/shared/annotation.js +9 -13
- package/dist/es2019/styles/shared/block-marks.js +8 -1
- package/dist/es2019/styles/shared/blockquote.js +1 -2
- package/dist/es2019/styles/shared/code-block.js +18 -18
- package/dist/es2019/styles/shared/code-mark.js +2 -3
- package/dist/es2019/styles/shared/lists.js +44 -2
- package/dist/es2019/styles/shared/panel.js +29 -37
- package/dist/es2019/styles/shared/rule.js +2 -3
- package/dist/es2019/styles/shared/shadow.js +20 -6
- package/dist/es2019/styles/shared/table.js +24 -26
- package/dist/es2019/types/next-editor-plugin.js +1 -0
- package/dist/es2019/ui/Caption/index.js +2 -3
- package/dist/es2019/ui/DropList/index.js +5 -6
- package/dist/es2019/ui/Emoji/index.js +11 -2
- package/dist/es2019/ui/Expand/index.js +17 -18
- package/dist/es2019/ui/Messages/index.js +3 -4
- package/dist/es2019/ui/Popup/index.js +68 -2
- package/dist/es2019/ui/Popup/utils.js +13 -6
- package/dist/es2019/ui/UnsupportedBlock/index.js +3 -4
- package/dist/es2019/ui/UnsupportedInline/index.js +3 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +120 -0
- package/dist/es2019/ui-color/ColorPalette/index.js +29 -13
- package/dist/es2019/ui-menu/DropdownMenu/index.js +13 -12
- package/dist/es2019/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/es2019/utils/analytics.js +0 -33
- package/dist/es2019/utils/builder.js +16 -0
- package/dist/es2019/utils/compareNodes.js +79 -28
- package/dist/es2019/utils/index.js +4 -2
- package/dist/es2019/utils/list.js +31 -0
- package/dist/es2019/utils/plugin-state-factory.js +9 -9
- package/dist/es2019/utils/referentiality.js +240 -0
- package/dist/es2019/utils/track-unsupported-content.js +20 -16
- package/dist/es2019/utils/validate-using-spec.js +8 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/types/enums.js +20 -1
- package/dist/esm/i18n/index.js +4 -3
- package/dist/esm/i18n/languages.js +34 -0
- package/dist/esm/keymaps/index.js +49 -2
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/styles/shared/annotation.js +9 -13
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/blockquote.js +1 -2
- package/dist/esm/styles/shared/code-block.js +13 -15
- package/dist/esm/styles/shared/code-mark.js +2 -3
- package/dist/esm/styles/shared/lists.js +49 -2
- package/dist/esm/styles/shared/panel.js +29 -37
- package/dist/esm/styles/shared/rule.js +2 -3
- package/dist/esm/styles/shared/shadow.js +1 -2
- package/dist/esm/styles/shared/table.js +24 -26
- package/dist/esm/types/next-editor-plugin.js +1 -0
- package/dist/esm/ui/Caption/index.js +2 -3
- package/dist/esm/ui/DropList/index.js +5 -6
- package/dist/esm/ui/Emoji/index.js +11 -2
- package/dist/esm/ui/Expand/index.js +17 -18
- package/dist/esm/ui/Messages/index.js +3 -4
- package/dist/esm/ui/Popup/index.js +73 -2
- package/dist/esm/ui/Popup/utils.js +13 -6
- package/dist/esm/ui/UnsupportedBlock/index.js +2 -3
- package/dist/esm/ui/UnsupportedInline/index.js +2 -3
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +124 -0
- package/dist/esm/ui-color/ColorPalette/index.js +19 -3
- package/dist/esm/ui-menu/DropdownMenu/index.js +12 -11
- package/dist/esm/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/esm/utils/analytics.js +0 -33
- package/dist/esm/utils/builder.js +30 -0
- package/dist/esm/utils/compareNodes.js +83 -32
- package/dist/esm/utils/index.js +4 -2
- package/dist/esm/utils/list.js +31 -0
- package/dist/esm/utils/plugin-state-factory.js +9 -9
- package/dist/esm/utils/referentiality.js +269 -0
- package/dist/esm/utils/track-unsupported-content.js +19 -20
- package/dist/esm/utils/validate-using-spec.js +8 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types/enums.d.ts +23 -4
- package/dist/types/collab/types.d.ts +1 -1
- package/dist/types/i18n/index.d.ts +4 -3
- package/dist/types/i18n/languages.d.ts +35 -0
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/styles/index.d.ts +1 -1
- package/dist/types/styles/shared/lists.d.ts +3 -1
- package/dist/types/types/collab.d.ts +1 -1
- package/dist/types/types/copy-button.d.ts +4 -0
- package/dist/types/types/feature-flags.d.ts +30 -25
- package/dist/types/types/floating-toolbar.d.ts +26 -1
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/types/next-editor-plugin.d.ts +61 -0
- package/dist/types/ui/Emoji/index.d.ts +2 -0
- package/dist/types/ui/Popup/index.d.ts +19 -0
- package/dist/types/ui/Popup/utils.d.ts +3 -3
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +214 -0
- package/dist/types/ui-color/ColorPalette/index.d.ts +7 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -1
- package/dist/types/utils/analytics.d.ts +1 -21
- package/dist/types/utils/builder.d.ts +8 -0
- package/dist/types/utils/compareNodes.d.ts +16 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/list.d.ts +10 -0
- package/dist/types/utils/plugin-state-factory.d.ts +1 -1
- package/dist/types/utils/referentiality.d.ts +4 -0
- package/dist/types/utils/track-unsupported-content.d.ts +14 -2
- package/package.json +15 -12
- package/report.api.md +1 -1
|
@@ -31,4 +31,244 @@ export const isReferencedSource = (state, node) => {
|
|
|
31
31
|
return !found;
|
|
32
32
|
});
|
|
33
33
|
return found;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const getConnections = state => {
|
|
37
|
+
const result = {};
|
|
38
|
+
const {
|
|
39
|
+
doc,
|
|
40
|
+
schema
|
|
41
|
+
} = state; // Keeps a map of all raw ids -> to their preferred normalised varient. A node with both fragmentMark & localId will
|
|
42
|
+
// have both ids mapped here to the same normalized version.
|
|
43
|
+
|
|
44
|
+
const normalizedIds = new Map();
|
|
45
|
+
const dataConsumerSources = new Map(); // Perform a prelim scan creating the initial id to connection link mappings.
|
|
46
|
+
// This will also save a list of data sources consumed per node.
|
|
47
|
+
|
|
48
|
+
doc.descendants((node, pos) => {
|
|
49
|
+
var _node$attrs2, _fragmentMark$attrs$l, _fragmentMark, _fragmentMark$attrs, _node$attrs3, _fragmentMark2, _fragmentMark2$attrs, _node$attrs4, _fragmentMark$attrs$n, _fragmentMark3, _fragmentMark3$attrs;
|
|
50
|
+
|
|
51
|
+
let dataConsumer;
|
|
52
|
+
let fragmentMark;
|
|
53
|
+
node.marks.some(mark => {
|
|
54
|
+
if (mark.type === schema.marks.dataConsumer) {
|
|
55
|
+
dataConsumer = mark;
|
|
56
|
+
} else if (mark.type === schema.marks.fragment) {
|
|
57
|
+
fragmentMark = mark;
|
|
58
|
+
} // Stop searching marks if we've found both consumer and fragment.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
return !!dataConsumer && !!fragmentMark;
|
|
62
|
+
}); // If node cannot be referenced by any means then abort.
|
|
63
|
+
|
|
64
|
+
if (!fragmentMark && !((_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.localId)) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const normalizedId = (_fragmentMark$attrs$l = (_fragmentMark = fragmentMark) === null || _fragmentMark === void 0 ? void 0 : (_fragmentMark$attrs = _fragmentMark.attrs) === null || _fragmentMark$attrs === void 0 ? void 0 : _fragmentMark$attrs.localId) !== null && _fragmentMark$attrs$l !== void 0 ? _fragmentMark$attrs$l : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId;
|
|
69
|
+
|
|
70
|
+
if (!normalizedId) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!!((_fragmentMark2 = fragmentMark) !== null && _fragmentMark2 !== void 0 && (_fragmentMark2$attrs = _fragmentMark2.attrs) !== null && _fragmentMark2$attrs !== void 0 && _fragmentMark2$attrs.localId)) {
|
|
75
|
+
normalizedIds.set(fragmentMark.attrs.localId, normalizedId);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!!((_node$attrs4 = node.attrs) !== null && _node$attrs4 !== void 0 && _node$attrs4.localId)) {
|
|
79
|
+
normalizedIds.set(node.attrs.localId, normalizedId);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!!result[normalizedId]) {
|
|
83
|
+
// Duplicate ID has been found, we'll care about the first one for now.
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
result[normalizedId] = {
|
|
88
|
+
localId: normalizedId,
|
|
89
|
+
name: (_fragmentMark$attrs$n = (_fragmentMark3 = fragmentMark) === null || _fragmentMark3 === void 0 ? void 0 : (_fragmentMark3$attrs = _fragmentMark3.attrs) === null || _fragmentMark3$attrs === void 0 ? void 0 : _fragmentMark3$attrs.name) !== null && _fragmentMark$attrs$n !== void 0 ? _fragmentMark$attrs$n : normalizedId,
|
|
90
|
+
node,
|
|
91
|
+
pos,
|
|
92
|
+
targets: []
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
if (!!dataConsumer && dataConsumer.attrs.sources.length) {
|
|
96
|
+
dataConsumerSources.set(normalizedId, dataConsumer.attrs.sources);
|
|
97
|
+
} // Do not descend into children of a node which has a dataConsumer attached. This assumes all children of the node cannot
|
|
98
|
+
// be referenced by another node.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
return !dataConsumer;
|
|
102
|
+
}); // This 2nd-pass only looks at the consumer sources and updates all connections with the correct id refs.
|
|
103
|
+
|
|
104
|
+
for (const [localId, sources] of dataConsumerSources) {
|
|
105
|
+
// This is a ref to the node (connection link) which contains the consumer.
|
|
106
|
+
sources.forEach(src => {
|
|
107
|
+
var _normalizedIds$get;
|
|
108
|
+
|
|
109
|
+
const normalizedId = (_normalizedIds$get = normalizedIds.get(src)) !== null && _normalizedIds$get !== void 0 ? _normalizedIds$get : src;
|
|
110
|
+
const srcLink = result[normalizedId];
|
|
111
|
+
|
|
112
|
+
if (srcLink && normalizedId !== localId) {
|
|
113
|
+
srcLink.targets.push(localId);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const removeConnectedNodes = (state, node) => {
|
|
122
|
+
if (!node) {
|
|
123
|
+
return state.tr;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const selectedLocalIds = getSelectedLocalIds(state, node);
|
|
127
|
+
const allNodes = getConnections(state);
|
|
128
|
+
const idsToBeDeleted = getIdsToBeDeleted(selectedLocalIds, allNodes);
|
|
129
|
+
|
|
130
|
+
if (!(idsToBeDeleted !== null && idsToBeDeleted !== void 0 && idsToBeDeleted.length)) {
|
|
131
|
+
return state.tr;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const {
|
|
135
|
+
tr
|
|
136
|
+
} = state;
|
|
137
|
+
let newTr = tr;
|
|
138
|
+
idsToBeDeleted.forEach(id => {
|
|
139
|
+
if (!allNodes[id]) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const {
|
|
144
|
+
node,
|
|
145
|
+
pos
|
|
146
|
+
} = allNodes[id];
|
|
147
|
+
newTr = newTr.delete(newTr.mapping.map(pos), newTr.mapping.map(node.nodeSize + pos));
|
|
148
|
+
});
|
|
149
|
+
return newTr;
|
|
150
|
+
}; // find all ids need to be remove connected to selected extension
|
|
151
|
+
|
|
152
|
+
const getIdsToBeDeleted = (selectedIds, allNodes) => {
|
|
153
|
+
if (!selectedIds.size) {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let searchSet = [...selectedIds];
|
|
158
|
+
const deletedIds = new Set();
|
|
159
|
+
|
|
160
|
+
while (searchSet.length) {
|
|
161
|
+
const id = searchSet.pop();
|
|
162
|
+
|
|
163
|
+
if (allNodes[id]) {
|
|
164
|
+
var _allNodes$id$targets$, _allNodes$id;
|
|
165
|
+
|
|
166
|
+
deletedIds.add(allNodes[id].localId);
|
|
167
|
+
searchSet = searchSet.concat((_allNodes$id$targets$ = (_allNodes$id = allNodes[id]) === null || _allNodes$id === void 0 ? void 0 : _allNodes$id.targets.filter(targetId => {
|
|
168
|
+
var _allNodes$targetId;
|
|
169
|
+
|
|
170
|
+
return !deletedIds.has((_allNodes$targetId = allNodes[targetId]) === null || _allNodes$targetId === void 0 ? void 0 : _allNodes$targetId.localId);
|
|
171
|
+
})) !== null && _allNodes$id$targets$ !== void 0 ? _allNodes$id$targets$ : []);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return Array.from(deletedIds);
|
|
176
|
+
}; // for get children info for confirmation dialog
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
export const getChildrenInfo = (state, node) => {
|
|
180
|
+
if (!node) {
|
|
181
|
+
return [];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const childrenIdSet = new Set();
|
|
185
|
+
const childrenInfoArray = [];
|
|
186
|
+
const allNodes = getConnections(state);
|
|
187
|
+
const selectedNodeIds = getSelectedLocalIds(state, node);
|
|
188
|
+
selectedNodeIds.forEach(id => {
|
|
189
|
+
if (allNodes[id]) {
|
|
190
|
+
allNodes[id].targets.forEach(childrenIdSet.add, childrenIdSet);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
childrenIdSet.forEach(id => {
|
|
194
|
+
childrenInfoArray.push({
|
|
195
|
+
id,
|
|
196
|
+
name: getNodeNameById(id, allNodes),
|
|
197
|
+
amount: getChildrenNodeAmount(id, allNodes)
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
return childrenInfoArray;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const getChildrenNodeAmount = (id, allNodes) => {
|
|
204
|
+
const searchTerms = new Set([id]);
|
|
205
|
+
const traverseHistory = new Map();
|
|
206
|
+
const childrenIds = new Set();
|
|
207
|
+
traverseHistory.set(id, false);
|
|
208
|
+
|
|
209
|
+
while (searchTerms.size > 0) {
|
|
210
|
+
const [currTerm] = searchTerms;
|
|
211
|
+
let targets = getNodeTargetsById(currTerm, allNodes);
|
|
212
|
+
targets.forEach(target => {
|
|
213
|
+
const isTargetCounted = traverseHistory.get(target);
|
|
214
|
+
|
|
215
|
+
if (!isTargetCounted) {
|
|
216
|
+
searchTerms.add(target);
|
|
217
|
+
childrenIds.add(target);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
target !== id && childrenIds.add(target);
|
|
221
|
+
});
|
|
222
|
+
traverseHistory.set(currTerm, true);
|
|
223
|
+
searchTerms.delete(currTerm);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return childrenIds.size;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const getNodeTargetsById = (id, allNodes) => {
|
|
230
|
+
if (!id || !allNodes[id]) {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return allNodes[id].targets;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const DEFAULT_EXTENSION_NAME = 'Default extension';
|
|
238
|
+
|
|
239
|
+
const getNodeNameById = (id, allNodes) => {
|
|
240
|
+
if (typeof id === 'object') {
|
|
241
|
+
var _name2;
|
|
242
|
+
|
|
243
|
+
let name;
|
|
244
|
+
id.forEach(localId => {
|
|
245
|
+
var _name, _allNodes$localId;
|
|
246
|
+
|
|
247
|
+
name = (_name = name) !== null && _name !== void 0 ? _name : (_allNodes$localId = allNodes[localId]) === null || _allNodes$localId === void 0 ? void 0 : _allNodes$localId.name;
|
|
248
|
+
});
|
|
249
|
+
return (_name2 = name) !== null && _name2 !== void 0 ? _name2 : DEFAULT_EXTENSION_NAME;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!id || !allNodes[id]) {
|
|
253
|
+
return DEFAULT_EXTENSION_NAME;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return allNodes[id].name;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const getSelectedLocalIds = (state, node) => {
|
|
260
|
+
var _node$attrs5, _node$marks2, _node$marks2$find, _node$marks2$find$att;
|
|
261
|
+
|
|
262
|
+
if (!node) {
|
|
263
|
+
return new Set([]);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const localIds = new Set([(_node$attrs5 = node.attrs) === null || _node$attrs5 === void 0 ? void 0 : _node$attrs5.localId, (_node$marks2 = node.marks) === null || _node$marks2 === void 0 ? void 0 : (_node$marks2$find = _node$marks2.find(mark => mark.type === state.schema.marks.fragment)) === null || _node$marks2$find === void 0 ? void 0 : (_node$marks2$find$att = _node$marks2$find.attrs) === null || _node$marks2$find$att === void 0 ? void 0 : _node$marks2$find$att.localId].filter(Boolean));
|
|
267
|
+
return localIds;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const getNodeName = (state, node) => {
|
|
271
|
+
var _node$marks$find$attr2, _node$marks3, _node$marks3$find, _node$marks3$find$att;
|
|
272
|
+
|
|
273
|
+
return (_node$marks$find$attr2 = node === null || node === void 0 ? void 0 : (_node$marks3 = node.marks) === null || _node$marks3 === void 0 ? void 0 : (_node$marks3$find = _node$marks3.find(mark => mark.type === state.schema.marks.fragment)) === null || _node$marks3$find === void 0 ? void 0 : (_node$marks3$find$att = _node$marks3$find.attrs) === null || _node$marks3$find$att === void 0 ? void 0 : _node$marks3$find$att.name) !== null && _node$marks$find$attr2 !== void 0 ? _node$marks$find$attr2 : '';
|
|
34
274
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
2
2
|
const whitelistedAttributes = ['align', 'annotationType', 'extensionKey', 'extensionType', 'layout', 'type', 'localId', 'mode', 'language', 'timestamp', 'state', 'originalWidth', 'originalHeight', 'height', 'width', 'shortName', 'level', 'userType', 'order', 'panelType', 'color', 'style', 'isNumberColumnEnabled', 'colspan', 'rowspan', 'colwidth', 'background'];
|
|
3
3
|
|
|
4
4
|
function concatAncestorHierarchy(node, ancestoryHierarchy) {
|
|
@@ -66,7 +66,6 @@ export const findAndTrackUnsupportedContentNodes = (node, schema, dispatchAnalyt
|
|
|
66
66
|
const {
|
|
67
67
|
originalValue
|
|
68
68
|
} = mark.attrs || {};
|
|
69
|
-
const sanitizedAttrs = sanitizeAttributes(originalValue.attrs) || {};
|
|
70
69
|
const {
|
|
71
70
|
type
|
|
72
71
|
} = originalValue || {};
|
|
@@ -75,20 +74,19 @@ export const findAndTrackUnsupportedContentNodes = (node, schema, dispatchAnalyt
|
|
|
75
74
|
ancestry: ancestorHierarchy,
|
|
76
75
|
parentType: parentType,
|
|
77
76
|
marks: [],
|
|
78
|
-
attrs:
|
|
77
|
+
attrs: originalValue.attrs || {}
|
|
79
78
|
};
|
|
80
79
|
fireUnsupportedEvent(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.UNSUPPORTED_MARK, unsupportedNode);
|
|
81
80
|
} else if (mark.type === unsupportedNodeAttribute) {
|
|
82
81
|
const {
|
|
83
82
|
unsupported
|
|
84
83
|
} = mark.attrs || {};
|
|
85
|
-
const sanitizedAttrs = sanitizeAttributes(unsupported) || {};
|
|
86
84
|
const unsupportedNodeAttribute = {
|
|
87
85
|
type: nodeType.name || '',
|
|
88
86
|
ancestry: ancestorHierarchy,
|
|
89
87
|
parentType: parentType,
|
|
90
88
|
marks: [],
|
|
91
|
-
attrs:
|
|
89
|
+
attrs: unsupported || {}
|
|
92
90
|
};
|
|
93
91
|
fireUnsupportedEvent(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.UNSUPPORTED_NODE_ATTRIBUTE, unsupportedNodeAttribute);
|
|
94
92
|
}
|
|
@@ -112,8 +110,8 @@ export const findAndTrackUnsupportedContentNodes = (node, schema, dispatchAnalyt
|
|
|
112
110
|
type: type || '',
|
|
113
111
|
ancestry: ancestorHierarchy,
|
|
114
112
|
parentType: parentType,
|
|
115
|
-
marks:
|
|
116
|
-
attrs:
|
|
113
|
+
marks: marks || [],
|
|
114
|
+
attrs: attrs || {}
|
|
117
115
|
};
|
|
118
116
|
const actionSubjectId = nodeType === unsupportedInline ? ACTION_SUBJECT_ID.UNSUPPORTED_INLINE : ACTION_SUBJECT_ID.UNSUPPORTED_BLOCK;
|
|
119
117
|
fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode);
|
|
@@ -122,20 +120,26 @@ export const findAndTrackUnsupportedContentNodes = (node, schema, dispatchAnalyt
|
|
|
122
120
|
node.content.forEach(childNode => findAndTrackUnsupportedContentNodes(childNode, schema, dispatchAnalyticsEvent, concatAncestorHierarchy(node, ancestorHierarchy)));
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
|
-
export const fireUnsupportedEvent = (dispatchAnalyticsEvent, actionSubjectId, unsupportedNode
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
export const fireUnsupportedEvent = (dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode) => {
|
|
124
|
+
const sanitizedAttrs = sanitizeAttributes(unsupportedNode.attrs);
|
|
125
|
+
const sanitizedMarks = sanitizeMarks(unsupportedNode.marks);
|
|
126
|
+
const sanitizedUnsupportedNode = {
|
|
127
|
+
type: unsupportedNode.type,
|
|
128
|
+
ancestry: unsupportedNode.ancestry,
|
|
129
|
+
parentType: unsupportedNode.parentType,
|
|
130
|
+
attrs: sanitizedAttrs,
|
|
131
|
+
marks: sanitizedMarks
|
|
128
132
|
};
|
|
129
|
-
|
|
130
|
-
if (errorCode) {
|
|
131
|
-
attrs.errorCode = errorCode;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
133
|
const payload = {
|
|
135
134
|
action: ACTION.UNSUPPORTED_CONTENT_ENCOUNTERED,
|
|
136
135
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
137
136
|
actionSubjectId,
|
|
138
|
-
attributes:
|
|
137
|
+
attributes: {
|
|
138
|
+
unsupportedNode: sanitizedUnsupportedNode,
|
|
139
|
+
...(!!errorCode && {
|
|
140
|
+
errorCode
|
|
141
|
+
})
|
|
142
|
+
},
|
|
139
143
|
eventType: EVENT_TYPE.TRACK
|
|
140
144
|
};
|
|
141
145
|
dispatchAnalyticsEvent(payload);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { validator } from '@atlaskit/adf-utils/validator';
|
|
2
|
+
import { ACTION_SUBJECT_ID } from '../analytics';
|
|
2
3
|
export const UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
|
|
3
|
-
import { ACTION_SUBJECT_ID } from './analytics';
|
|
4
4
|
import { fireUnsupportedEvent } from './track-unsupported-content';
|
|
5
5
|
|
|
6
6
|
const errorCallbackFor = (marks, validate, dispatchAnalyticsEvent) => {
|
|
@@ -102,7 +102,13 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
fireUnsupportedEvent(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.UNSUPPORTED_ERROR,
|
|
105
|
+
fireUnsupportedEvent(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.UNSUPPORTED_ERROR, {
|
|
106
|
+
type: entity.type || '',
|
|
107
|
+
ancestry: entity.ancestorHierarchy || '',
|
|
108
|
+
parentType: entity.parentType || '',
|
|
109
|
+
marks: entity.marks || [],
|
|
110
|
+
attrs: entity.attrs || {}
|
|
111
|
+
}, error.code);
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
export const validateADFEntity = (schema, node, dispatchAnalyticsEvent) => {
|
package/dist/es2019/version.json
CHANGED
|
@@ -99,7 +99,7 @@ export var ACTION;
|
|
|
99
99
|
ACTION["TYPING_FINISHED"] = "typingFinished";
|
|
100
100
|
ACTION["TYPING_STARTED"] = "typingStarted";
|
|
101
101
|
ACTION["UNLINK"] = "unlinked";
|
|
102
|
-
ACTION["UNSUPPORTED_CONTENT_ENCOUNTERED"] = "
|
|
102
|
+
ACTION["UNSUPPORTED_CONTENT_ENCOUNTERED"] = "unsupportedContentEncounteredV2";
|
|
103
103
|
ACTION["UPDATED"] = "updated";
|
|
104
104
|
ACTION["UPDATED_FRAGMENT_MARK_NAME"] = "updatedFragmentMarkName";
|
|
105
105
|
ACTION["UPDATED_SOURCE"] = "updatedSource";
|
|
@@ -116,6 +116,16 @@ export var ACTION;
|
|
|
116
116
|
ACTION["UFO_SESSION_COMPLETE"] = "ufoSessionComplete";
|
|
117
117
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
118
118
|
ACTION["DOCUMENT_PROCESSING_ERROR"] = "documentProcessingError";
|
|
119
|
+
ACTION["RENDERER_TTI"] = "tti";
|
|
120
|
+
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
121
|
+
ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
|
|
122
|
+
ACTION["SELECT_ALL_ESCAPED"] = "selectAllEscaped";
|
|
123
|
+
ACTION["SORT_COLUMN"] = "sortedColumn";
|
|
124
|
+
ACTION["SORT_COLUMN_NOT_ALLOWED"] = "sortColumnNotAllowed";
|
|
125
|
+
ACTION["CREATE_NOT_ALLOWED"] = "createNotAllowed";
|
|
126
|
+
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
|
|
127
|
+
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
|
|
128
|
+
ACTION["UNSUPPORTED_TOOLTIP_VIEWED"] = "viewed";
|
|
119
129
|
})(ACTION || (ACTION = {}));
|
|
120
130
|
|
|
121
131
|
export var INPUT_METHOD;
|
|
@@ -202,6 +212,10 @@ export var ACTION_SUBJECT;
|
|
|
202
212
|
ACTION_SUBJECT["CREATE_LINK_INLINE_DIALOG"] = "createLinkInlineDialog";
|
|
203
213
|
ACTION_SUBJECT["CODE_BLOCK"] = "codeBlock";
|
|
204
214
|
ACTION_SUBJECT["REACT_EDITOR_VIEW"] = "reactEditorView";
|
|
215
|
+
ACTION_SUBJECT["RENDERER"] = "renderer";
|
|
216
|
+
ACTION_SUBJECT["ANCHOR_LINK"] = "anchorLink";
|
|
217
|
+
ACTION_SUBJECT["LINK"] = "link";
|
|
218
|
+
ACTION_SUBJECT["TOOLTIP"] = "tooltip";
|
|
205
219
|
})(ACTION_SUBJECT || (ACTION_SUBJECT = {}));
|
|
206
220
|
|
|
207
221
|
export var ACTION_SUBJECT_ID;
|
|
@@ -319,9 +333,14 @@ export var ACTION_SUBJECT_ID;
|
|
|
319
333
|
ACTION_SUBJECT_ID["TYPEAHEAD_QUICK_INSERT"] = "quickInsertTypeAhead";
|
|
320
334
|
ACTION_SUBJECT_ID["UNKNOWN_NODE"] = "unknownNode";
|
|
321
335
|
ACTION_SUBJECT_ID["UNLINK"] = "unlink";
|
|
336
|
+
ACTION_SUBJECT_ID["HEADING_ANCHOR_LINK"] = "headingAnchorLink";
|
|
337
|
+
ACTION_SUBJECT_ID["UNSUPPORTED_ERROR"] = "unsupportedUnhandled";
|
|
338
|
+
ACTION_SUBJECT_ID["UNSUPPORTED_NODE_ATTRIBUTE"] = "unsupportedNodeAttribute";
|
|
322
339
|
ACTION_SUBJECT_ID["UNSUPPORTED_BLOCK"] = "unsupportedBlock";
|
|
323
340
|
ACTION_SUBJECT_ID["UNSUPPORTED_INLINE"] = "unsupportedInline";
|
|
324
341
|
ACTION_SUBJECT_ID["UNSUPPORTED_MARK"] = "unsupportedMark";
|
|
342
|
+
ACTION_SUBJECT_ID["ON_UNSUPPORTED_INLINE"] = "onUnsupportedInline";
|
|
343
|
+
ACTION_SUBJECT_ID["ON_UNSUPPORTED_BLOCK"] = "onUnsupportedBlock";
|
|
325
344
|
})(ACTION_SUBJECT_ID || (ACTION_SUBJECT_ID = {}));
|
|
326
345
|
|
|
327
346
|
export var FLOATING_CONTROLS_TITLE;
|
package/dist/esm/i18n/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* ED-16073:
|
|
5
|
+
* This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
|
|
6
6
|
*/
|
|
7
7
|
export { default as zh } from './zh';
|
|
8
8
|
export { default as zh_TW } from './zh_TW';
|
|
9
9
|
export { default as cs } from './cs';
|
|
10
10
|
export { default as da } from './da';
|
|
11
11
|
export { default as nl } from './nl';
|
|
12
|
-
export { default as
|
|
12
|
+
export { default as en } from './en';
|
|
13
|
+
export { default as en_GB } from './en_GB';
|
|
13
14
|
export { default as fi } from './fi';
|
|
14
15
|
export { default as fr } from './fr';
|
|
15
16
|
export { default as de } from './de';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* ED-16073:
|
|
5
|
+
* This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
zh: 'Chinese (Simplified)',
|
|
9
|
+
zh_TW: 'Chinese (Traditional)',
|
|
10
|
+
cs: 'Czech',
|
|
11
|
+
da: 'Danish',
|
|
12
|
+
nl: 'Dutch',
|
|
13
|
+
en: 'English',
|
|
14
|
+
en_GB: 'English (United Kingdom)',
|
|
15
|
+
fi: 'Finnish',
|
|
16
|
+
fr: 'French',
|
|
17
|
+
de: 'German',
|
|
18
|
+
hu: 'Hungarian',
|
|
19
|
+
it: 'Italian',
|
|
20
|
+
ja: 'Japanese',
|
|
21
|
+
ko: 'Korean',
|
|
22
|
+
nb: 'Norwegian Bokmål',
|
|
23
|
+
pl: 'Polish',
|
|
24
|
+
pt_BR: 'Portuguese (Brazil)',
|
|
25
|
+
pt_PT: 'Portuguese (Portugal)',
|
|
26
|
+
ru: 'Russian',
|
|
27
|
+
sk: 'Slovak',
|
|
28
|
+
es: 'Spanish',
|
|
29
|
+
sv: 'Swedish',
|
|
30
|
+
th: 'Thai',
|
|
31
|
+
tr: 'Turkish',
|
|
32
|
+
uk: 'Ukrainian',
|
|
33
|
+
vi: 'Vietnamese'
|
|
34
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
1
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
3
|
|
|
3
4
|
var _templateObject;
|
|
@@ -6,7 +7,6 @@ var _templateObject;
|
|
|
6
7
|
import React, { Fragment } from 'react';
|
|
7
8
|
import { css, jsx } from '@emotion/react';
|
|
8
9
|
import { N400 } from '@atlaskit/theme/colors';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
10
|
import { browser } from '../utils';
|
|
11
11
|
export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
12
12
|
export var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
@@ -77,7 +77,7 @@ var arrowKeysMap = {
|
|
|
77
77
|
ARROWUP: "\u2191",
|
|
78
78
|
ARROWDOWN: "\u2193"
|
|
79
79
|
};
|
|
80
|
-
var tooltipShortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])),
|
|
80
|
+
var tooltipShortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), "var(--ds-background-inverse-subtle, ".concat(N400, ")"));
|
|
81
81
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
82
82
|
|
|
83
83
|
function formatShortcut(keymap) {
|
|
@@ -141,6 +141,53 @@ export function findShortcutByKeymap(keymap) {
|
|
|
141
141
|
|
|
142
142
|
return keymap.windows;
|
|
143
143
|
}
|
|
144
|
+
export function getAriaKeyshortcuts(keymap) {
|
|
145
|
+
var keyShortcuts;
|
|
146
|
+
|
|
147
|
+
if (typeof keymap === 'string') {
|
|
148
|
+
keyShortcuts = keymap;
|
|
149
|
+
} else if (_typeof(keymap) === 'object') {
|
|
150
|
+
keyShortcuts = keymap[browser.mac ? 'mac' : 'windows'];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (keyShortcuts) {
|
|
154
|
+
return keyShortcuts.toLowerCase().split('-').map(function (modifier) {
|
|
155
|
+
switch (modifier) {
|
|
156
|
+
case 'cmd':
|
|
157
|
+
return 'Meta';
|
|
158
|
+
|
|
159
|
+
case 'ctrl':
|
|
160
|
+
return 'Control';
|
|
161
|
+
|
|
162
|
+
case 'alt':
|
|
163
|
+
return 'Alt';
|
|
164
|
+
|
|
165
|
+
case 'shift':
|
|
166
|
+
return 'Shift';
|
|
167
|
+
|
|
168
|
+
case 'enter':
|
|
169
|
+
return 'Enter';
|
|
170
|
+
|
|
171
|
+
case 'esc':
|
|
172
|
+
return 'Esc';
|
|
173
|
+
|
|
174
|
+
case 'tab':
|
|
175
|
+
return 'Tab';
|
|
176
|
+
|
|
177
|
+
case 'space':
|
|
178
|
+
return 'Space';
|
|
179
|
+
|
|
180
|
+
case 'backspace':
|
|
181
|
+
return 'Backspace';
|
|
182
|
+
|
|
183
|
+
default:
|
|
184
|
+
return modifier.split('').join(' ');
|
|
185
|
+
}
|
|
186
|
+
}).join('+');
|
|
187
|
+
} else {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
144
191
|
var ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo, find, escape, enter, shiftEnter];
|
|
145
192
|
export function makeKeymap(description, windows, mac, common) {
|
|
146
193
|
return {
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { ruleSharedStyles } from './shared/rule';
|
|
|
9
9
|
export { whitespaceSharedStyles } from './shared/whitespace';
|
|
10
10
|
export { paragraphSharedStyles } from './shared/paragraph';
|
|
11
11
|
export { linkSharedStyle } from './shared/link';
|
|
12
|
-
export { listsSharedStyles,
|
|
12
|
+
export { listsSharedStyles, listItemCounterPadding, getOrderedListInlineStyles } from './shared/lists';
|
|
13
13
|
export { indentationSharedStyles } from './shared/indentation';
|
|
14
14
|
export { blockMarksSharedStyles } from './shared/block-marks';
|
|
15
15
|
export { codeMarkSharedStyles } from './shared/code-mark';
|
|
@@ -5,7 +5,6 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { themed } from '@atlaskit/theme/components';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
8
|
export var annotationPrefix = 'ak-editor-annotation';
|
|
10
9
|
export var AnnotationSharedClassNames = {
|
|
11
10
|
focus: "".concat(annotationPrefix, "-focus"),
|
|
@@ -20,23 +19,20 @@ var DY75a = 'rgba(111, 92, 37, 0.5)';
|
|
|
20
19
|
var DY200 = '#82641c';
|
|
21
20
|
export var AnnotationSharedCSSByState = function AnnotationSharedCSSByState(props) {
|
|
22
21
|
return {
|
|
23
|
-
/* eslint-disable */
|
|
24
22
|
focus: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // Background is not coming through in confluence, suspecting to be caused by some specific combination of\n // emotion and token look up\n\n background: ", ";\n border-bottom: 2px solid\n ", ";\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4147\n box-shadow: ", ";\n cursor: pointer;\n "])), themed({
|
|
25
|
-
light: Y75,
|
|
26
|
-
dark: DY75
|
|
23
|
+
light: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
|
|
24
|
+
dark: "var(--ds-background-accent-yellow-subtler, ".concat(DY75, ")")
|
|
27
25
|
})(props), themed({
|
|
28
|
-
light:
|
|
29
|
-
dark:
|
|
30
|
-
})(props),
|
|
26
|
+
light: "var(--ds-border-accent-yellow, ".concat(Y300, ")"),
|
|
27
|
+
dark: "var(--ds-border-accent-yellow, ".concat(DY300, ")")
|
|
28
|
+
})(props), "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")")),
|
|
31
29
|
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-bottom: 2px solid\n ", ";\n cursor: pointer;\n "])), themed({
|
|
32
|
-
light: Y75a,
|
|
33
|
-
dark: DY75a
|
|
30
|
+
light: "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"),
|
|
31
|
+
dark: "var(--ds-background-accent-yellow-subtlest, ".concat(DY75a, ")")
|
|
34
32
|
})(props), themed({
|
|
35
|
-
light:
|
|
36
|
-
dark:
|
|
33
|
+
light: "var(--ds-border-accent-yellow, ".concat(Y200a, ")"),
|
|
34
|
+
dark: "var(--ds-border-accent-yellow, ".concat(DY200, ")")
|
|
37
35
|
})(props))
|
|
38
|
-
/* eslint-enable */
|
|
39
|
-
|
|
40
36
|
};
|
|
41
37
|
};
|
|
42
38
|
export var annotationSharedStyles = function annotationSharedStyles(props) {
|
|
@@ -3,4 +3,4 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
export var blockMarksSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks apart from those with indentation mark */\n *:not(.fabric-editor-block-mark)
|
|
6
|
+
export var blockMarksSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks apart from those with indentation mark */\n *:not(.fabric-editor-block-mark) >\n div.fabric-editor-block-mark:first-of-type\n /* Do not remove the margin top for nodes inside indentation marks */\n :not(.fabric-editor-indentation-mark)\n /* Do not remove the margin top for nodes inside alignment marks */\n :not(.fabric-editor-alignment),\n // If first element inside a block node has alignment mark, then remove the margin-top\n .fabric-editor-alignment:first-of-type:first-child,\n // If first document element has indentation mark remove margin-top\n .ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n .heading-wrapper {\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n }\n }\n"])));
|
|
@@ -5,5 +5,4 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { akEditorBlockquoteBorderColor, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
|
-
|
|
9
|
-
export var blockquoteSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & blockquote {\n box-sizing: border-box;\n padding-left: ", "px;\n border-left: 2px solid\n ", ";\n margin: ", " 0 0 0;\n margin-right: 0;\n\n [dir='rtl'] & {\n padding-left: 0;\n padding-right: ", "px;\n }\n\n &:first-child {\n margin-top: 0;\n }\n\n &::before {\n content: '';\n }\n\n &::after {\n content: none;\n }\n\n & p {\n display: block;\n }\n\n & table,\n & table:last-child {\n display: inline-table;\n }\n }\n"])), gridSize() * 2, token('color.border', akEditorBlockquoteBorderColor), blockNodesVerticalMargin, gridSize() * 2);
|
|
8
|
+
export var blockquoteSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & blockquote {\n box-sizing: border-box;\n padding-left: ", "px;\n border-left: 2px solid\n ", ";\n margin: ", " 0 0 0;\n margin-right: 0;\n\n [dir='rtl'] & {\n padding-left: 0;\n padding-right: ", "px;\n }\n\n &:first-child {\n margin-top: 0;\n }\n\n &::before {\n content: '';\n }\n\n &::after {\n content: none;\n }\n\n & p {\n display: block;\n }\n\n & table,\n & table:last-child {\n display: inline-table;\n }\n }\n"])), gridSize() * 2, "var(--ds-border, ".concat(akEditorBlockquoteBorderColor, ")"), blockNodesVerticalMargin, gridSize() * 2);
|