@atlaskit/editor-common 110.22.0 → 110.22.2

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7bb84f91500cf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7bb84f91500cf) -
8
+ [ux] EDITOR-2442 update warning modal on source sync block deletion
9
+ - Updated dependencies
10
+
11
+ ## 110.22.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`2e838b25bc36e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e838b25bc36e) -
16
+ Fixing UGC issue with localId
17
+
3
18
  ## 110.22.0
4
19
 
5
20
  ### Minor Changes
@@ -85,5 +85,25 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
85
85
  id: 'fabric.editor.referenceSyncBlockTooltip',
86
86
  defaultMessage: 'Synced from: {title}',
87
87
  description: 'Tooltip that shows the source page title of the synced block'
88
+ },
89
+ deleteConfirmationModalTitle: {
90
+ id: 'fabric.editor.deleteConfirmationModalTitle',
91
+ defaultMessage: "You're about to delete synced content",
92
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
93
+ },
94
+ deleteConfirmationModalCancelButton: {
95
+ id: 'fabric.editor.deleteConfirmationModalCancelButton',
96
+ defaultMessage: "Cancel",
97
+ description: 'Text on button which cancels deleting when user was trying to delete source synced block'
98
+ },
99
+ deleteConfirmationModalDeleteButton: {
100
+ id: 'fabric.editor.deleteConfirmationModalDeleteButton',
101
+ defaultMessage: "Delete",
102
+ description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
103
+ },
104
+ deleteConfirmationModalDescription: {
105
+ id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
106
+ defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
107
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
88
108
  }
89
109
  });
@@ -62,11 +62,13 @@ var createWrappingJoinRule = exports.createWrappingJoinRule = function createWra
62
62
  return createRule(match, handler);
63
63
  };
64
64
  var createRule = exports.createRule = function createRule(match, handler) {
65
+ var allowsBackwardMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
65
66
  return {
66
67
  match: match,
67
68
  handler: handler,
68
69
  onHandlerApply: function onHandlerApply(_state, tr) {
69
70
  (0, _prosemirrorHistory.closeHistory)(tr);
70
- }
71
+ },
72
+ allowsBackwardMatch: allowsBackwardMatch
71
73
  };
72
74
  };
@@ -79,5 +79,25 @@ export const syncBlockMessages = defineMessages({
79
79
  id: 'fabric.editor.referenceSyncBlockTooltip',
80
80
  defaultMessage: 'Synced from: {title}',
81
81
  description: 'Tooltip that shows the source page title of the synced block'
82
+ },
83
+ deleteConfirmationModalTitle: {
84
+ id: 'fabric.editor.deleteConfirmationModalTitle',
85
+ defaultMessage: "You're about to delete synced content",
86
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
87
+ },
88
+ deleteConfirmationModalCancelButton: {
89
+ id: 'fabric.editor.deleteConfirmationModalCancelButton',
90
+ defaultMessage: "Cancel",
91
+ description: 'Text on button which cancels deleting when user was trying to delete source synced block'
92
+ },
93
+ deleteConfirmationModalDeleteButton: {
94
+ id: 'fabric.editor.deleteConfirmationModalDeleteButton',
95
+ defaultMessage: "Delete",
96
+ description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
97
+ },
98
+ deleteConfirmationModalDescription: {
99
+ id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
100
+ defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
101
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
82
102
  }
83
103
  });
@@ -53,12 +53,13 @@ export const createWrappingJoinRule = ({
53
53
  };
54
54
  return createRule(match, handler);
55
55
  };
56
- export const createRule = (match, handler) => {
56
+ export const createRule = (match, handler, allowsBackwardMatch = false) => {
57
57
  return {
58
58
  match,
59
59
  handler,
60
60
  onHandlerApply: (_state, tr) => {
61
61
  closeHistory(tr);
62
- }
62
+ },
63
+ allowsBackwardMatch
63
64
  };
64
65
  };
@@ -79,5 +79,25 @@ export var syncBlockMessages = defineMessages({
79
79
  id: 'fabric.editor.referenceSyncBlockTooltip',
80
80
  defaultMessage: 'Synced from: {title}',
81
81
  description: 'Tooltip that shows the source page title of the synced block'
82
+ },
83
+ deleteConfirmationModalTitle: {
84
+ id: 'fabric.editor.deleteConfirmationModalTitle',
85
+ defaultMessage: "You're about to delete synced content",
86
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
87
+ },
88
+ deleteConfirmationModalCancelButton: {
89
+ id: 'fabric.editor.deleteConfirmationModalCancelButton',
90
+ defaultMessage: "Cancel",
91
+ description: 'Text on button which cancels deleting when user was trying to delete source synced block'
92
+ },
93
+ deleteConfirmationModalDeleteButton: {
94
+ id: 'fabric.editor.deleteConfirmationModalDeleteButton',
95
+ defaultMessage: "Delete",
96
+ description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
97
+ },
98
+ deleteConfirmationModalDescription: {
99
+ id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
100
+ defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
101
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
82
102
  }
83
103
  });
@@ -55,11 +55,13 @@ export var createWrappingJoinRule = function createWrappingJoinRule(_ref) {
55
55
  return createRule(match, handler);
56
56
  };
57
57
  export var createRule = function createRule(match, handler) {
58
+ var allowsBackwardMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
58
59
  return {
59
60
  match: match,
60
61
  handler: handler,
61
62
  onHandlerApply: function onHandlerApply(_state, tr) {
62
63
  closeHistory(tr);
63
- }
64
+ },
65
+ allowsBackwardMatch: allowsBackwardMatch
64
66
  };
65
67
  };
@@ -2,16 +2,14 @@ import { type ACTION, type ACTION_SUBJECT, type ACTION_SUBJECT_ID } from './enum
2
2
  import type { OperationalAEP, UIAEP } from './utils';
3
3
  type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
4
4
  docSize: number | undefined;
5
- localId: string;
5
+ localIdLength: number;
6
6
  }>;
7
7
  type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
8
- command: Record<string, unknown> | undefined;
9
8
  isSameDoc: boolean;
10
9
  isSameDocIgnoreAttrs: boolean;
11
10
  }>;
12
11
  type AIStreamingInvalidCommandAEP = OperationalAEP<ACTION.INVALID_COMMAND_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
13
12
  ancestors?: string[];
14
- command: Record<string, unknown>;
15
13
  errorMessage?: string;
16
14
  errorStack?: string;
17
15
  fragments?: string[];
@@ -79,4 +79,24 @@ export declare const syncBlockMessages: {
79
79
  defaultMessage: string;
80
80
  description: string;
81
81
  };
82
+ deleteConfirmationModalTitle: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
87
+ deleteConfirmationModalCancelButton: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
92
+ deleteConfirmationModalDeleteButton: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ deleteConfirmationModalDescription: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
82
102
  };
@@ -2,6 +2,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
2
2
  export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
3
3
  export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
4
4
  export interface InputRuleWrapper {
5
+ allowsBackwardMatch?: boolean;
5
6
  handler: InputRuleHandler;
6
7
  match: RegExp;
7
8
  onHandlerApply?: OnHandlerApply;
@@ -12,5 +12,5 @@ type WrappingRuleProps = {
12
12
  nodeType: NodeType;
13
13
  };
14
14
  export declare const createWrappingJoinRule: ({ match, nodeType, getAttrs, joinPredicate, }: WrappingRuleProps) => InputRuleWrapper;
15
- export declare const createRule: (match: RegExp, handler: InputRuleHandler) => InputRuleWrapper;
15
+ export declare const createRule: (match: RegExp, handler: InputRuleHandler, allowsBackwardMatch?: boolean) => InputRuleWrapper;
16
16
  export {};
@@ -2,16 +2,14 @@ import { type ACTION, type ACTION_SUBJECT, type ACTION_SUBJECT_ID } from './enum
2
2
  import type { OperationalAEP, UIAEP } from './utils';
3
3
  type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
4
4
  docSize: number | undefined;
5
- localId: string;
5
+ localIdLength: number;
6
6
  }>;
7
7
  type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
8
- command: Record<string, unknown> | undefined;
9
8
  isSameDoc: boolean;
10
9
  isSameDocIgnoreAttrs: boolean;
11
10
  }>;
12
11
  type AIStreamingInvalidCommandAEP = OperationalAEP<ACTION.INVALID_COMMAND_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
13
12
  ancestors?: string[];
14
- command: Record<string, unknown>;
15
13
  errorMessage?: string;
16
14
  errorStack?: string;
17
15
  fragments?: string[];
@@ -79,4 +79,24 @@ export declare const syncBlockMessages: {
79
79
  defaultMessage: string;
80
80
  description: string;
81
81
  };
82
+ deleteConfirmationModalTitle: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
87
+ deleteConfirmationModalCancelButton: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
92
+ deleteConfirmationModalDeleteButton: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ deleteConfirmationModalDescription: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
82
102
  };
@@ -2,6 +2,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
2
2
  export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
3
3
  export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
4
4
  export interface InputRuleWrapper {
5
+ allowsBackwardMatch?: boolean;
5
6
  handler: InputRuleHandler;
6
7
  match: RegExp;
7
8
  onHandlerApply?: OnHandlerApply;
@@ -12,5 +12,5 @@ type WrappingRuleProps = {
12
12
  nodeType: NodeType;
13
13
  };
14
14
  export declare const createWrappingJoinRule: ({ match, nodeType, getAttrs, joinPredicate, }: WrappingRuleProps) => InputRuleWrapper;
15
- export declare const createRule: (match: RegExp, handler: InputRuleHandler) => InputRuleWrapper;
15
+ export declare const createRule: (match: RegExp, handler: InputRuleHandler, allowsBackwardMatch?: boolean) => InputRuleWrapper;
16
16
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "110.22.0",
3
+ "version": "110.22.2",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/media-picker": "^70.0.0",
65
65
  "@atlaskit/media-ui": "^28.7.0",
66
66
  "@atlaskit/media-viewer": "^52.4.0",
67
- "@atlaskit/mention": "^24.3.0",
67
+ "@atlaskit/mention": "^24.4.0",
68
68
  "@atlaskit/menu": "^8.4.0",
69
69
  "@atlaskit/onboarding": "^14.4.0",
70
70
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -75,14 +75,14 @@
75
75
  "@atlaskit/prosemirror-history": "^0.2.0",
76
76
  "@atlaskit/react-ufo": "^4.14.0",
77
77
  "@atlaskit/section-message": "^8.9.0",
78
- "@atlaskit/smart-card": "^43.5.0",
78
+ "@atlaskit/smart-card": "^43.6.0",
79
79
  "@atlaskit/smart-user-picker": "^8.4.0",
80
80
  "@atlaskit/spinner": "^19.0.0",
81
81
  "@atlaskit/status": "^3.0.0",
82
82
  "@atlaskit/task-decision": "^19.2.0",
83
83
  "@atlaskit/textfield": "^8.0.0",
84
84
  "@atlaskit/theme": "^21.0.0",
85
- "@atlaskit/tmp-editor-statsig": "^13.26.0",
85
+ "@atlaskit/tmp-editor-statsig": "^13.29.0",
86
86
  "@atlaskit/tokens": "^7.1.0",
87
87
  "@atlaskit/tooltip": "^20.7.0",
88
88
  "@atlaskit/ufo": "^0.4.0",