@atlaskit/editor-common 81.1.5 → 81.2.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 +21 -0
- package/codemods/migrates/entry-points.ts +14 -30
- package/dist/cjs/clipboard/index.js +4 -4
- package/dist/cjs/collab/index.js +1 -1
- package/dist/cjs/doc-utils/editor-use-only.js +2 -2
- package/dist/cjs/i18n/cs.js +1 -0
- package/dist/cjs/i18n/da.js +3 -2
- package/dist/cjs/i18n/de.js +3 -2
- package/dist/cjs/i18n/en.js +1 -0
- package/dist/cjs/i18n/en_GB.js +1 -0
- package/dist/cjs/i18n/en_ZZ.js +1 -0
- package/dist/cjs/i18n/es.js +2 -1
- package/dist/cjs/i18n/fi.js +2 -1
- package/dist/cjs/i18n/fr.js +1 -0
- package/dist/cjs/i18n/hu.js +1 -0
- package/dist/cjs/i18n/it.js +1 -0
- package/dist/cjs/i18n/ja.js +2 -1
- package/dist/cjs/i18n/ko.js +2 -1
- package/dist/cjs/i18n/nb.js +1 -0
- package/dist/cjs/i18n/nl.js +1 -0
- package/dist/cjs/i18n/pl.js +1 -0
- package/dist/cjs/i18n/pt_BR.js +1 -0
- package/dist/cjs/i18n/ru.js +1 -0
- package/dist/cjs/i18n/sv.js +1 -0
- package/dist/cjs/i18n/th.js +1 -0
- package/dist/cjs/i18n/tr.js +1 -0
- package/dist/cjs/i18n/uk.js +7 -6
- package/dist/cjs/i18n/vi.js +1 -0
- package/dist/cjs/i18n/zh.js +3 -2
- package/dist/cjs/i18n/zh_TW.js +1 -0
- package/dist/cjs/lists/node.js +8 -8
- package/dist/cjs/lists/replace-content.js +8 -8
- package/dist/cjs/mark/commands.js +64 -15
- package/dist/cjs/mark/index.js +6 -0
- package/dist/cjs/media-inline/styles.js +2 -2
- package/dist/cjs/messages/card.js +20 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/selection/gap-cursor/styles.js +1 -1
- package/dist/cjs/styles/shared/annotation.js +1 -1
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/code-block.js +2 -2
- package/dist/cjs/styles/shared/lists.js +1 -1
- package/dist/cjs/styles/shared/panel.js +1 -1
- package/dist/cjs/styles/shared/resizer.js +1 -1
- package/dist/cjs/styles/shared/smartCard.js +1 -1
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/styles/shared/task-decision.js +1 -1
- package/dist/cjs/styles/shared/unsupported-content.js +1 -1
- package/dist/cjs/table/SortingIcon.js +2 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +4 -4
- package/dist/cjs/ui/MediaSingle/styled.js +5 -5
- package/dist/cjs/ui/ResizerLegacy/styled.js +1 -1
- package/dist/cjs/ui-menu/DropdownMenu/index.js +2 -2
- package/dist/cjs/utils/calculate-toolbar-position.js +8 -8
- package/dist/cjs/utils/compareNodes.js +7 -7
- package/dist/cjs/utils/dedupe.js +10 -10
- package/dist/es2019/clipboard/index.js +4 -4
- package/dist/es2019/collab/index.js +29 -29
- package/dist/es2019/doc-utils/editor-use-only.js +2 -2
- package/dist/es2019/i18n/cs.js +1 -0
- package/dist/es2019/i18n/da.js +3 -2
- package/dist/es2019/i18n/de.js +3 -2
- package/dist/es2019/i18n/en.js +1 -0
- package/dist/es2019/i18n/en_GB.js +1 -0
- package/dist/es2019/i18n/en_ZZ.js +1 -0
- package/dist/es2019/i18n/es.js +2 -1
- package/dist/es2019/i18n/fi.js +2 -1
- package/dist/es2019/i18n/fr.js +1 -0
- package/dist/es2019/i18n/hu.js +1 -0
- package/dist/es2019/i18n/it.js +1 -0
- package/dist/es2019/i18n/ja.js +2 -1
- package/dist/es2019/i18n/ko.js +2 -1
- package/dist/es2019/i18n/nb.js +1 -0
- package/dist/es2019/i18n/nl.js +1 -0
- package/dist/es2019/i18n/pl.js +1 -0
- package/dist/es2019/i18n/pt_BR.js +1 -0
- package/dist/es2019/i18n/ru.js +1 -0
- package/dist/es2019/i18n/sv.js +1 -0
- package/dist/es2019/i18n/th.js +1 -0
- package/dist/es2019/i18n/tr.js +1 -0
- package/dist/es2019/i18n/uk.js +7 -6
- package/dist/es2019/i18n/vi.js +1 -0
- package/dist/es2019/i18n/zh.js +3 -2
- package/dist/es2019/i18n/zh_TW.js +1 -0
- package/dist/es2019/lists/node.js +8 -8
- package/dist/es2019/lists/replace-content.js +8 -8
- package/dist/es2019/mark/commands.js +54 -1
- package/dist/es2019/mark/index.js +1 -1
- package/dist/es2019/media-inline/styles.js +28 -28
- package/dist/es2019/messages/card.js +20 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/selection/gap-cursor/styles.js +80 -80
- package/dist/es2019/styles/shared/annotation.js +12 -12
- package/dist/es2019/styles/shared/block-marks.js +16 -16
- package/dist/es2019/styles/shared/code-block.js +101 -89
- package/dist/es2019/styles/shared/lists.js +83 -86
- package/dist/es2019/styles/shared/panel.js +78 -78
- package/dist/es2019/styles/shared/resizer.js +180 -178
- package/dist/es2019/styles/shared/smartCard.js +92 -102
- package/dist/es2019/styles/shared/table.js +125 -127
- package/dist/es2019/styles/shared/task-decision.js +46 -46
- package/dist/es2019/styles/shared/unsupported-content.js +15 -15
- package/dist/es2019/table/SortingIcon.js +34 -34
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +14 -14
- package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
- package/dist/es2019/ui/MediaSingle/styled.js +55 -55
- package/dist/es2019/ui/ResizerLegacy/styled.js +10 -10
- package/dist/es2019/ui-menu/DropdownMenu/index.js +30 -30
- package/dist/es2019/utils/calculate-toolbar-position.js +8 -8
- package/dist/es2019/utils/compareNodes.js +7 -7
- package/dist/es2019/utils/dedupe.js +10 -10
- package/dist/esm/clipboard/index.js +4 -4
- package/dist/esm/collab/index.js +1 -1
- package/dist/esm/doc-utils/editor-use-only.js +2 -2
- package/dist/esm/i18n/cs.js +1 -0
- package/dist/esm/i18n/da.js +3 -2
- package/dist/esm/i18n/de.js +3 -2
- package/dist/esm/i18n/en.js +1 -0
- package/dist/esm/i18n/en_GB.js +1 -0
- package/dist/esm/i18n/en_ZZ.js +1 -0
- package/dist/esm/i18n/es.js +2 -1
- package/dist/esm/i18n/fi.js +2 -1
- package/dist/esm/i18n/fr.js +1 -0
- package/dist/esm/i18n/hu.js +1 -0
- package/dist/esm/i18n/it.js +1 -0
- package/dist/esm/i18n/ja.js +2 -1
- package/dist/esm/i18n/ko.js +2 -1
- package/dist/esm/i18n/nb.js +1 -0
- package/dist/esm/i18n/nl.js +1 -0
- package/dist/esm/i18n/pl.js +1 -0
- package/dist/esm/i18n/pt_BR.js +1 -0
- package/dist/esm/i18n/ru.js +1 -0
- package/dist/esm/i18n/sv.js +1 -0
- package/dist/esm/i18n/th.js +1 -0
- package/dist/esm/i18n/tr.js +1 -0
- package/dist/esm/i18n/uk.js +7 -6
- package/dist/esm/i18n/vi.js +1 -0
- package/dist/esm/i18n/zh.js +3 -2
- package/dist/esm/i18n/zh_TW.js +1 -0
- package/dist/esm/lists/node.js +8 -8
- package/dist/esm/lists/replace-content.js +8 -8
- package/dist/esm/mark/commands.js +61 -14
- package/dist/esm/mark/index.js +1 -1
- package/dist/esm/media-inline/styles.js +2 -2
- package/dist/esm/messages/card.js +20 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/selection/gap-cursor/styles.js +1 -1
- package/dist/esm/styles/shared/annotation.js +1 -1
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/code-block.js +2 -2
- package/dist/esm/styles/shared/lists.js +1 -1
- package/dist/esm/styles/shared/panel.js +1 -1
- package/dist/esm/styles/shared/resizer.js +1 -1
- package/dist/esm/styles/shared/smartCard.js +1 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/styles/shared/task-decision.js +1 -1
- package/dist/esm/styles/shared/unsupported-content.js +1 -1
- package/dist/esm/table/SortingIcon.js +2 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +4 -4
- package/dist/esm/ui/MediaSingle/styled.js +5 -5
- package/dist/esm/ui/ResizerLegacy/styled.js +1 -1
- package/dist/esm/ui-menu/DropdownMenu/index.js +2 -2
- package/dist/esm/utils/calculate-toolbar-position.js +8 -8
- package/dist/esm/utils/compareNodes.js +7 -7
- package/dist/esm/utils/dedupe.js +10 -10
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/index.d.ts +3 -3
- package/dist/types/card/LinkToolbarButtonGroup.d.ts +1 -1
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/element-browser/ViewMore.d.ts +1 -1
- package/dist/types/element-browser/components/ElementList/EmptyState.d.ts +1 -1
- package/dist/types/extensibility/index.d.ts +1 -1
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/types/index.d.ts +2 -2
- package/dist/types/guideline/index.d.ts +3 -3
- package/dist/types/i18n/cs.d.ts +1 -0
- package/dist/types/i18n/da.d.ts +1 -0
- package/dist/types/i18n/de.d.ts +1 -0
- package/dist/types/i18n/en.d.ts +1 -0
- package/dist/types/i18n/en_GB.d.ts +1 -0
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/i18n/es.d.ts +1 -0
- package/dist/types/i18n/fi.d.ts +1 -0
- package/dist/types/i18n/fr.d.ts +1 -0
- package/dist/types/i18n/hu.d.ts +1 -0
- package/dist/types/i18n/it.d.ts +1 -0
- package/dist/types/i18n/ja.d.ts +1 -0
- package/dist/types/i18n/ko.d.ts +1 -0
- package/dist/types/i18n/nb.d.ts +1 -0
- package/dist/types/i18n/nl.d.ts +1 -0
- package/dist/types/i18n/pl.d.ts +1 -0
- package/dist/types/i18n/pt_BR.d.ts +1 -0
- package/dist/types/i18n/ru.d.ts +1 -0
- package/dist/types/i18n/sv.d.ts +1 -0
- package/dist/types/i18n/th.d.ts +1 -0
- package/dist/types/i18n/tr.d.ts +1 -0
- package/dist/types/i18n/uk.d.ts +1 -0
- package/dist/types/i18n/vi.d.ts +1 -0
- package/dist/types/i18n/zh.d.ts +1 -0
- package/dist/types/i18n/zh_TW.d.ts +1 -0
- package/dist/types/link/index.d.ts +3 -3
- package/dist/types/lists/index.d.ts +3 -3
- package/dist/types/lists/replace-content.d.ts +1 -1
- package/dist/types/mark/commands.d.ts +5 -0
- package/dist/types/mark/index.d.ts +2 -2
- package/dist/types/media-inline/index.d.ts +1 -1
- package/dist/types/media-inline/views/frame.d.ts +1 -1
- package/dist/types/messages/card.d.ts +20 -0
- package/dist/types/portal/index.d.ts +1 -1
- package/dist/types/preset/index.d.ts +1 -1
- package/dist/types/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types/provider-factory.d.ts +2 -2
- package/dist/types/react-node-view/index.d.ts +1 -1
- package/dist/types/selection/index.d.ts +2 -2
- package/dist/types/styles/index.d.ts +4 -4
- package/dist/types/types/feature-flags.d.ts +6 -6
- package/dist/types/types/index.d.ts +12 -12
- package/dist/types/types/next-editor-plugin.d.ts +2 -8
- package/dist/types/types/performance-tracking.d.ts +4 -4
- package/dist/types/ufo/index.d.ts +1 -1
- package/dist/types/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types/ui/FloatingToolbar/styles.d.ts +4 -4
- package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types/ui/index.d.ts +4 -4
- package/dist/types/ui-color/index.d.ts +1 -1
- package/dist/types/utils/get-performance-options.d.ts +1 -1
- package/dist/types/utils/index.d.ts +6 -6
- package/dist/types/validator.d.ts +1 -1
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/index.d.ts +3 -3
- package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +1 -1
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/element-browser/ViewMore.d.ts +1 -1
- package/dist/types-ts4.5/element-browser/components/ElementList/EmptyState.d.ts +1 -1
- package/dist/types-ts4.5/extensibility/index.d.ts +1 -1
- package/dist/types-ts4.5/extensions/index.d.ts +1 -1
- package/dist/types-ts4.5/extensions/types/index.d.ts +2 -2
- package/dist/types-ts4.5/guideline/index.d.ts +3 -3
- package/dist/types-ts4.5/i18n/cs.d.ts +1 -0
- package/dist/types-ts4.5/i18n/da.d.ts +1 -0
- package/dist/types-ts4.5/i18n/de.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
- package/dist/types-ts4.5/i18n/es.d.ts +1 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +1 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +1 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +1 -0
- package/dist/types-ts4.5/i18n/it.d.ts +1 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +1 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +1 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +1 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +1 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +1 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +1 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +1 -0
- package/dist/types-ts4.5/i18n/th.d.ts +1 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +1 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +1 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +1 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +1 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -0
- package/dist/types-ts4.5/link/index.d.ts +3 -3
- package/dist/types-ts4.5/lists/index.d.ts +3 -3
- package/dist/types-ts4.5/lists/replace-content.d.ts +1 -1
- package/dist/types-ts4.5/mark/commands.d.ts +5 -0
- package/dist/types-ts4.5/mark/index.d.ts +2 -2
- package/dist/types-ts4.5/media-inline/index.d.ts +1 -1
- package/dist/types-ts4.5/media-inline/views/frame.d.ts +1 -1
- package/dist/types-ts4.5/messages/card.d.ts +20 -0
- package/dist/types-ts4.5/portal/index.d.ts +1 -1
- package/dist/types-ts4.5/preset/index.d.ts +1 -1
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory.d.ts +2 -2
- package/dist/types-ts4.5/react-node-view/index.d.ts +1 -1
- package/dist/types-ts4.5/selection/index.d.ts +2 -2
- package/dist/types-ts4.5/styles/index.d.ts +4 -4
- package/dist/types-ts4.5/types/feature-flags.d.ts +6 -6
- package/dist/types-ts4.5/types/index.d.ts +12 -12
- package/dist/types-ts4.5/types/performance-tracking.d.ts +4 -4
- package/dist/types-ts4.5/ufo/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbar/styles.d.ts +4 -4
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types-ts4.5/ui/index.d.ts +4 -4
- package/dist/types-ts4.5/ui-color/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +6 -6
- package/dist/types-ts4.5/validator.d.ts +1 -1
- package/package.json +7 -6
- package/report.api.md +6 -5
|
@@ -321,6 +321,7 @@ export default {
|
|
|
321
321
|
'fabric.editor.pageActionsLabel': '頁面動作',
|
|
322
322
|
'fabric.editor.panel.backgroundColor': '背景顏色',
|
|
323
323
|
'fabric.editor.panel.emoji': '新增表情符號',
|
|
324
|
+
'fabric.editor.panel.panelsGroup': '面板類型',
|
|
324
325
|
'fabric.editor.pasteOptions': '貼上選項',
|
|
325
326
|
'fabric.editor.pastePlainText': '貼上純文字',
|
|
326
327
|
'fabric.editor.placeholderAltText': '使用替代文字描述這張圖片',
|
|
@@ -139,10 +139,10 @@ const findGrandParentResolvedPos = (tr, $from) => {
|
|
|
139
139
|
};
|
|
140
140
|
const findNestedTaskListsIndexAtSameLevel = (tr, $from) => {
|
|
141
141
|
/*
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
|
|
143
|
+
we need to find the grandparent of the cursor which is the list at same level of taskList.
|
|
144
|
+
We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
|
|
145
|
+
*/
|
|
146
146
|
const nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
|
|
147
147
|
const rootListItem = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.node(nestedListResolvedPos.depth - 1);
|
|
148
148
|
const nestedTaskListsIndexes = [];
|
|
@@ -170,10 +170,10 @@ export const processNestedTaskListsInSameLevel = tr => {
|
|
|
170
170
|
const nestedTaskListIndexesToWrap = nestedTaskListIndexes.filter(index => index > 1);
|
|
171
171
|
|
|
172
172
|
/*
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
|
|
174
|
+
After each wrap the indexes changes since two lists are being merged into one,
|
|
175
|
+
so we keep track of it and use it to access actual calculated taskList indexes.
|
|
176
|
+
*/
|
|
177
177
|
if (rootListItemStart) {
|
|
178
178
|
let taskListsFixedNested = 0;
|
|
179
179
|
nestedTaskListIndexesToWrap.forEach(index => {
|
|
@@ -29,14 +29,14 @@ export const wrapTaskListIntoListAbove = (tr, taskListStart, previousListStart)
|
|
|
29
29
|
const frag = Fragment.from(taskList.content);
|
|
30
30
|
|
|
31
31
|
/*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
Delete the existing taskList at the same level and insert inside above list provided
|
|
33
|
+
1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
|
|
34
|
+
$taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
|
|
35
|
+
so we add 1 to it to get the position after the taskList node and completly remove it.
|
|
36
|
+
2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
|
|
37
|
+
Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
|
|
38
|
+
so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
|
|
39
|
+
*/
|
|
40
40
|
tr.delete($taskListStart.before(), $taskListStart.after() + 1);
|
|
41
41
|
tr.insert($previousListStart.end() - 1, frag);
|
|
42
42
|
};
|
|
@@ -61,6 +61,59 @@ export function filterChildrenBetween(doc, from, to, predicate) {
|
|
|
61
61
|
});
|
|
62
62
|
return results;
|
|
63
63
|
}
|
|
64
|
+
export function transformNonTextNodesToText(from, to, tr) {
|
|
65
|
+
const {
|
|
66
|
+
doc
|
|
67
|
+
} = tr;
|
|
68
|
+
const {
|
|
69
|
+
schema
|
|
70
|
+
} = doc.type;
|
|
71
|
+
const {
|
|
72
|
+
mention: mentionNodeType,
|
|
73
|
+
text: textNodeType,
|
|
74
|
+
emoji: emojiNodeType,
|
|
75
|
+
inlineCard: inlineCardNodeType
|
|
76
|
+
} = schema.nodes;
|
|
77
|
+
const nodesToChange = [];
|
|
78
|
+
doc.nodesBetween(from, to, (node, pos, parent) => {
|
|
79
|
+
if ([mentionNodeType, textNodeType, emojiNodeType, inlineCardNodeType].includes(node.type)) {
|
|
80
|
+
nodesToChange.push({
|
|
81
|
+
node,
|
|
82
|
+
pos
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
nodesToChange.forEach(({
|
|
87
|
+
node,
|
|
88
|
+
pos
|
|
89
|
+
}) => {
|
|
90
|
+
if (node.type !== textNodeType) {
|
|
91
|
+
const newText = node.attrs.url ||
|
|
92
|
+
// url for inlineCard
|
|
93
|
+
node.attrs.text || `${node.type.name} text missing`; // fallback for missing text
|
|
94
|
+
|
|
95
|
+
const currentPos = tr.mapping.map(pos);
|
|
96
|
+
tr.replaceWith(currentPos, currentPos + node.nodeSize, schema.text(newText, node.marks));
|
|
97
|
+
} else if (node.text) {
|
|
98
|
+
// Find a valid start and end position because the text may be partially selected.
|
|
99
|
+
const startPositionInSelection = Math.max(pos, from);
|
|
100
|
+
const endPositionInSelection = Math.min(pos + node.nodeSize, to);
|
|
101
|
+
const textForReplacing = doc.textBetween(startPositionInSelection, endPositionInSelection);
|
|
102
|
+
const newText = textForReplacing.replace(FIND_SMART_CHAR, match => {
|
|
103
|
+
var _SMART_TO_ASCII$match;
|
|
104
|
+
return (_SMART_TO_ASCII$match = SMART_TO_ASCII[match]) !== null && _SMART_TO_ASCII$match !== void 0 ? _SMART_TO_ASCII$match : match;
|
|
105
|
+
});
|
|
106
|
+
const currentStartPos = tr.mapping.map(startPositionInSelection);
|
|
107
|
+
const currentEndPos = tr.mapping.map(endPositionInSelection);
|
|
108
|
+
tr.replaceWith(currentStartPos, currentEndPos, schema.text(newText, node.marks));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @private
|
|
115
|
+
* @deprecated Use {@link transformNonTextNodesToText} instead.
|
|
116
|
+
*/
|
|
64
117
|
export const transformSmartCharsMentionsAndEmojis = (from, to, tr) => {
|
|
65
118
|
const {
|
|
66
119
|
schema
|
|
@@ -101,7 +154,7 @@ export const applyMarkOnRange = (from, to, removeMark, mark, tr) => {
|
|
|
101
154
|
inlineCard
|
|
102
155
|
} = schema.nodes;
|
|
103
156
|
if (mark.type === code) {
|
|
104
|
-
transformSmartCharsMentionsAndEmojis(from, to, tr);
|
|
157
|
+
getBooleanFF('platform.editor.simplify-inline-cards-in-code-blocks_jw6t1') ? transformNonTextNodesToText(from, to, tr) : transformSmartCharsMentionsAndEmojis(from, to, tr);
|
|
105
158
|
}
|
|
106
159
|
tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), (node, pos) => {
|
|
107
160
|
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
|
|
1
|
+
export { transformSmartCharsMentionsAndEmojis, transformNonTextNodesToText, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
|
|
2
2
|
export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
|
|
@@ -9,15 +9,15 @@ export const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-imag
|
|
|
9
9
|
// We implemented such selectors to ensure specificity:
|
|
10
10
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
|
|
11
11
|
const inlineImageHeight = (height, margin = 0) => css`
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/* Editor style */
|
|
13
|
+
> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
|
|
14
14
|
> :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
|
|
15
15
|
/* Renderer style */
|
|
16
16
|
> .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
|
|
17
17
|
> :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
height: ${height}px;
|
|
19
|
+
transform: translateY(${margin}px);
|
|
20
|
+
}
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -28,35 +28,35 @@ const inlineImageHeight = (height, margin = 0) => css`
|
|
|
28
28
|
*/
|
|
29
29
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
|
|
30
30
|
export const mediaInlineImageStyles = css`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
// p, h3, and action items
|
|
32
|
+
.${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
|
|
33
|
+
height: ${referenceHeights['p']}px;
|
|
34
|
+
transform: translateY(-2px);
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
h1 {
|
|
38
|
+
${inlineImageHeight(referenceHeights['h1'], -3)}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
h2 {
|
|
42
|
+
${inlineImageHeight(referenceHeights['h2'], -3)}
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
h3 {
|
|
46
|
+
${inlineImageHeight(referenceHeights['h3'], -2)}
|
|
47
|
+
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
h4 {
|
|
50
|
+
${inlineImageHeight(referenceHeights['h4'], -2)}
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
h5 {
|
|
54
|
+
${inlineImageHeight(referenceHeights['h5'], -2)}
|
|
55
|
+
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
h6 {
|
|
58
|
+
${inlineImageHeight(referenceHeights['h6'], -2)}
|
|
59
|
+
}
|
|
60
60
|
`;
|
|
61
61
|
export const wrapperStyle = css({
|
|
62
62
|
display: 'inline-flex',
|
|
@@ -80,6 +80,26 @@ export const messages = defineMessages({
|
|
|
80
80
|
defaultMessage: 'Display an interactive preview of a link',
|
|
81
81
|
description: 'Description for option to display link as an embedded object.'
|
|
82
82
|
},
|
|
83
|
+
editDropdownExpandIconLabel: {
|
|
84
|
+
id: 'fabric.editor.editDropdownExpandIconLabel',
|
|
85
|
+
defaultMessage: 'Expand dropdown menu',
|
|
86
|
+
description: 'Text of an icon to expand the dropdown'
|
|
87
|
+
},
|
|
88
|
+
editDropdownTriggerTitle: {
|
|
89
|
+
id: 'fabric.editor.editDropdownTriggerTitle',
|
|
90
|
+
defaultMessage: 'Edit',
|
|
91
|
+
description: 'Text of a button to trigger opening an edit dropdown'
|
|
92
|
+
},
|
|
93
|
+
editDropdownEditLinkTitle: {
|
|
94
|
+
id: 'fabric.editor.editDropdownEditLinkTitle',
|
|
95
|
+
defaultMessage: 'Edit link',
|
|
96
|
+
description: 'Edit dropdown edit link button text'
|
|
97
|
+
},
|
|
98
|
+
editDropdownEditDatasourceTitle: {
|
|
99
|
+
id: 'fabric.editor.editDropdownEditDatasourceTitle',
|
|
100
|
+
defaultMessage: 'Edit search query',
|
|
101
|
+
description: 'Edit dropdown edit datasource button text'
|
|
102
|
+
},
|
|
83
103
|
datasourceTitle: {
|
|
84
104
|
id: 'fabric.editor.datasourceTitle',
|
|
85
105
|
defaultMessage: 'Edit search query',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "81.1
|
|
3
|
+
const packageVersion = "81.2.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -15,70 +15,70 @@ const wrapRight = '[layout="wrap-right"]';
|
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- This needs manual remediation, it autofixes seemingly safely, but the code style and readability is destroyed.
|
|
17
17
|
export const gapCursorStyles = css`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/* =============== GAP CURSOR ================== */
|
|
19
|
+
.ProseMirror {
|
|
20
|
+
&.${hideCaretModifier} {
|
|
21
|
+
caret-color: transparent;
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
${gapCursor} {
|
|
25
|
+
display: none;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
position: relative;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
& span {
|
|
30
|
+
caret-color: transparent;
|
|
31
|
+
position: absolute;
|
|
32
|
+
height: 100%;
|
|
33
|
+
width: 100%;
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
& span::after {
|
|
38
|
+
animation: 1s ${gapCursorBlink} step-end infinite;
|
|
39
|
+
border-left: 1px solid;
|
|
40
|
+
content: '';
|
|
41
|
+
display: block;
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
&.-left span::after {
|
|
47
|
+
left: ${"var(--ds-space-negative-050, -4px)"};
|
|
48
|
+
}
|
|
49
|
+
&.-right span::after {
|
|
50
|
+
right: ${"var(--ds-space-negative-050, -4px)"};
|
|
51
|
+
}
|
|
52
|
+
& span[layout='full-width'],
|
|
53
|
+
& span[layout='wide'],
|
|
54
|
+
& span[layout='fixed-width'] {
|
|
55
|
+
margin-left: 50%;
|
|
56
|
+
transform: translateX(-50%);
|
|
57
|
+
}
|
|
58
|
+
&${wrapRight} {
|
|
59
|
+
float: right;
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
/* fix vertical alignment of gap cursor */
|
|
63
|
+
&:first-of-type + ul,
|
|
64
|
+
&:first-of-type + span + ul,
|
|
65
|
+
&:first-of-type + ol,
|
|
66
|
+
&:first-of-type + span + ol,
|
|
67
|
+
&:first-of-type + pre,
|
|
68
|
+
&:first-of-type + span + pre,
|
|
69
|
+
&:first-of-type + blockquote,
|
|
70
|
+
&:first-of-type + span + blockquote {
|
|
71
|
+
margin-top: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
&.ProseMirror-focused ${gapCursor} {
|
|
75
|
+
display: block;
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
/* This hack below is for two images aligned side by side */
|
|
81
|
+
${gapCursor}${wrapLeft} + span + ${wrapLeft},
|
|
82
82
|
${gapCursor}${wrapRight} + span + ${wrapRight},
|
|
83
83
|
${gapCursor} + ${wrapLeft} + ${wrapRight},
|
|
84
84
|
${gapCursor} + ${wrapLeft} + span + ${wrapRight},
|
|
@@ -89,10 +89,10 @@ export const gapCursorStyles = css`
|
|
|
89
89
|
${wrapRight} + ${gapCursor} + ${wrapLeft},
|
|
90
90
|
${wrapRight} + ${gapCursor} + span + ${wrapLeft},
|
|
91
91
|
${wrapLeft} + ${gapCursor} {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
clear: none;
|
|
93
|
+
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
${wrapLeft} + ${gapCursor} + ${wrapRight} > div,
|
|
96
96
|
${wrapLeft} + ${gapCursor} + span + ${wrapRight} > div,
|
|
97
97
|
${wrapRight} + ${gapCursor} + ${wrapLeft} > div,
|
|
98
98
|
${wrapRight} + ${gapCursor} + span + ${wrapLeft} > div,
|
|
@@ -100,31 +100,31 @@ export const gapCursorStyles = css`
|
|
|
100
100
|
${gapCursor} + ${wrapRight} + span + ${wrapLeft} > div,
|
|
101
101
|
${gapCursor} + ${wrapLeft} + ${wrapRight} > div,
|
|
102
102
|
${gapCursor} + ${wrapLeft} + span + ${wrapRight} > div {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
margin-right: 0;
|
|
104
|
+
margin-left: 0;
|
|
105
|
+
margin-bottom: 0;
|
|
106
|
+
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
${wrapLeft} + ${gapCursor},
|
|
109
109
|
${wrapRight} + ${gapCursor} {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
float: left;
|
|
111
|
+
}
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
${gapCursor} + ${wrapLeft} + span + ${wrapRight}::after,
|
|
114
114
|
${gapCursor} + ${wrapRight} + span + ${wrapLeft}::after,
|
|
115
115
|
${wrapLeft} + ${gapCursor} + ${wrapRight}::after,
|
|
116
116
|
${wrapLeft} + ${gapCursor} + span + ${wrapRight}::after,
|
|
117
117
|
${wrapRight} + ${gapCursor} + ${wrapLeft}::after,
|
|
118
118
|
${wrapRight} + ${gapCursor} + span + ${wrapLeft}::after {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
visibility: hidden;
|
|
120
|
+
display: block;
|
|
121
|
+
font-size: 0;
|
|
122
|
+
content: ' ';
|
|
123
|
+
clear: both;
|
|
124
|
+
height: 0;
|
|
125
|
+
}
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
${wrapLeft} + ${gapCursor} + ${wrapRight} + *,
|
|
128
128
|
${wrapLeft} + ${gapCursor} + ${wrapRight} + span + *,
|
|
129
129
|
${wrapRight} + ${gapCursor} + ${wrapLeft} + *,
|
|
130
130
|
${wrapRight} + ${gapCursor} + ${wrapLeft} + span + *,
|
|
@@ -142,6 +142,6 @@ export const gapCursorStyles = css`
|
|
|
142
142
|
${gapCursor} + ${wrapRight} + span + ${wrapLeft} + * > *,
|
|
143
143
|
${prosemirrorwidget} + ${gapCursor} + *,
|
|
144
144
|
${prosemirrorwidget} + ${gapCursor} + span + * {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
margin-top: 0;
|
|
146
|
+
}
|
|
147
147
|
`;
|
|
@@ -60,18 +60,18 @@ export const AnnotationSharedCSSByState = () => getBooleanFF('platform.editor.al
|
|
|
60
60
|
|
|
61
61
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
|
|
62
62
|
export const annotationSharedStyles = () => css`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
.ProseMirror {
|
|
64
|
+
.${AnnotationSharedClassNames.focus} {
|
|
65
|
+
${AnnotationSharedCSSByState().focus};
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
.${AnnotationSharedClassNames.draft} {
|
|
69
|
+
${AnnotationSharedCSSByState().focus};
|
|
70
|
+
cursor: initial;
|
|
71
|
+
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
.${AnnotationSharedClassNames.blur} {
|
|
74
|
+
${AnnotationSharedCSSByState().blur};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
77
|
`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Perfectly safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
export const blockMarksSharedStyles = css`
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
5
|
* We need to remove margin-top from first item
|
|
6
6
|
* inside doc, tableCell, tableHeader, blockquote, etc.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
*:not(.fabric-editor-block-mark) >,
|
|
9
9
|
/* For nested block marks apart from those with indentation mark */
|
|
10
10
|
*:not(.fabric-editor-block-mark) >
|
|
11
11
|
div.fabric-editor-block-mark:first-of-type
|
|
@@ -17,18 +17,18 @@ export const blockMarksSharedStyles = css`
|
|
|
17
17
|
.fabric-editor-alignment:first-of-type:first-child,
|
|
18
18
|
// If first document element has indentation mark remove margin-top
|
|
19
19
|
.ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
p,
|
|
21
|
+
h1,
|
|
22
|
+
h2,
|
|
23
|
+
h3,
|
|
24
|
+
h4,
|
|
25
|
+
h5,
|
|
26
|
+
h6,
|
|
27
|
+
.heading-wrapper {
|
|
28
|
+
:first-child:not(style),
|
|
29
|
+
style:first-child + * {
|
|
30
|
+
margin-top: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
34
|
`;
|