@atlaskit/editor-common 134.2.2 → 134.4.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cjs/extensibility/preserveRemixNodeView.js +16 -0
  3. package/dist/cjs/mark/cell-selection-has-any-mark.js +32 -0
  4. package/dist/cjs/mark/get-supported-mark-types.js +30 -0
  5. package/dist/cjs/mention-avatar.js +3 -1
  6. package/dist/cjs/messages/card.js +6 -0
  7. package/dist/cjs/messages/insert-block.js +6 -0
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/preserve-node-view.js +155 -0
  10. package/dist/cjs/quick-insert/rank.js +1 -1
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/cjs/vanilla-tooltip/index.js +1 -0
  13. package/dist/es2019/extensibility/preserveRemixNodeView.js +14 -0
  14. package/dist/es2019/mark/cell-selection-has-any-mark.js +23 -0
  15. package/dist/es2019/mark/get-supported-mark-types.js +20 -0
  16. package/dist/es2019/mention-avatar.js +2 -1
  17. package/dist/es2019/messages/card.js +6 -0
  18. package/dist/es2019/messages/insert-block.js +6 -0
  19. package/dist/es2019/monitoring/error.js +1 -1
  20. package/dist/es2019/preserve-node-view.js +137 -0
  21. package/dist/es2019/quick-insert/rank.js +3 -1
  22. package/dist/es2019/ui/DropList/index.js +1 -1
  23. package/dist/es2019/vanilla-tooltip/index.js +1 -0
  24. package/dist/esm/extensibility/preserveRemixNodeView.js +16 -0
  25. package/dist/esm/mark/cell-selection-has-any-mark.js +26 -0
  26. package/dist/esm/mark/get-supported-mark-types.js +24 -0
  27. package/dist/esm/mention-avatar.js +2 -1
  28. package/dist/esm/messages/card.js +6 -0
  29. package/dist/esm/messages/insert-block.js +6 -0
  30. package/dist/esm/monitoring/error.js +1 -1
  31. package/dist/esm/preserve-node-view.js +149 -0
  32. package/dist/esm/quick-insert/rank.js +1 -1
  33. package/dist/esm/ui/DropList/index.js +1 -1
  34. package/dist/esm/vanilla-tooltip/index.js +1 -0
  35. package/dist/types/collab/index.d.ts +8 -2
  36. package/dist/types/mark/cell-selection-has-any-mark.d.ts +4 -0
  37. package/dist/types/mark/get-supported-mark-types.d.ts +6 -0
  38. package/dist/types/messages/card.d.ts +75 -70
  39. package/dist/types/messages/insert-block.d.ts +5 -0
  40. package/dist/types/preserve-node-view.d.ts +39 -0
  41. package/mark/cell-selection-has-any-mark/package.json +10 -0
  42. package/mark/get-supported-mark-types/package.json +10 -0
  43. package/package.json +10 -10
  44. package/preserve-node-view/package.json +10 -0
  45. package/dist/cjs/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -42
  46. package/dist/cjs/prosemirror-node-view.js +0 -1
  47. package/dist/cjs/sync-block/types.js +0 -1
  48. package/dist/cjs/utils/isNodeTypeValidChildOf.js +0 -23
  49. package/dist/es2019/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -39
  50. package/dist/es2019/prosemirror-node-view.js +0 -0
  51. package/dist/es2019/sync-block/types.js +0 -0
  52. package/dist/es2019/utils/isNodeTypeValidChildOf.js +0 -17
  53. package/dist/esm/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -37
  54. package/dist/esm/prosemirror-node-view.js +0 -0
  55. package/dist/esm/sync-block/types.js +0 -0
  56. package/dist/esm/utils/isNodeTypeValidChildOf.js +0 -17
  57. package/dist/types/element-browser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
  58. package/dist/types/prosemirror-node-view.d.ts +0 -0
  59. package/dist/types/sync-block/types.d.ts +0 -4
  60. package/dist/types/utils/isNodeTypeValidChildOf.d.ts +0 -7
@@ -1,187 +1,192 @@
1
1
  export declare const messages: {
2
- url: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
2
  block: {
8
- id: string;
9
3
  defaultMessage: string;
10
4
  description: string;
11
- };
12
- inline: {
13
5
  id: string;
6
+ };
7
+ blockCardUnavailable: {
14
8
  defaultMessage: string;
15
9
  description: string;
16
- };
17
- embed: {
18
10
  id: string;
11
+ };
12
+ blockDescription: {
19
13
  defaultMessage: string;
20
14
  description: string;
21
- };
22
- link: {
23
15
  id: string;
16
+ };
17
+ blockTitle: {
24
18
  defaultMessage: string;
25
19
  description: string;
20
+ id: string;
26
21
  };
27
22
  card: {
28
- id: string;
29
23
  defaultMessage: string;
30
24
  description: string;
31
- };
32
- blockCardUnavailable: {
33
25
  id: string;
26
+ };
27
+ datasourceAppearanceTitle: {
34
28
  defaultMessage: string;
35
29
  description: string;
36
- };
37
- displayOptionUnavailableInParentNode: {
38
30
  id: string;
31
+ };
32
+ datasourceAssetsObjectsDescription: {
39
33
  defaultMessage: string;
40
34
  description: string;
41
- };
42
- urlTitle: {
43
35
  id: string;
36
+ };
37
+ datasourceAssetsObjectsGeneralAvailability: {
44
38
  defaultMessage: string;
45
39
  description: string;
46
- };
47
- blockTitle: {
48
40
  id: string;
41
+ };
42
+ datasourceConfluenceList: {
49
43
  defaultMessage: string;
50
44
  description: string;
51
- };
52
- inlineTitle: {
53
45
  id: string;
46
+ };
47
+ datasourceConfluenceSearch: {
54
48
  defaultMessage: string;
55
49
  description: string;
56
- };
57
- openButtonTitle: {
58
50
  id: string;
51
+ };
52
+ datasourceConfluenceSearchDescription: {
59
53
  defaultMessage: string;
60
54
  description: string;
61
- };
62
- panelButtonTitle: {
63
55
  id: string;
56
+ };
57
+ datasourceJiraIssue: {
64
58
  defaultMessage: string;
65
59
  description: string;
66
- };
67
- previewButtonTitle: {
68
60
  id: string;
61
+ };
62
+ datasourceJiraIssueDescription: {
69
63
  defaultMessage: string;
70
64
  description: string;
71
- };
72
- embedTitle: {
73
65
  id: string;
66
+ };
67
+ datasourceJiraIssueDescriptionIssueTermRefresh: {
74
68
  defaultMessage: string;
75
69
  description: string;
76
- };
77
- urlDescription: {
78
70
  id: string;
71
+ };
72
+ datasourceJiraIssueIssueTermRefresh: {
79
73
  defaultMessage: string;
80
74
  description: string;
81
- };
82
- blockDescription: {
83
75
  id: string;
76
+ };
77
+ datasourceTitle: {
84
78
  defaultMessage: string;
85
79
  description: string;
86
- };
87
- inlineDescription: {
88
80
  id: string;
81
+ };
82
+ displayOptionUnavailableInParentNode: {
89
83
  defaultMessage: string;
90
84
  description: string;
91
- };
92
- embedDescription: {
93
85
  id: string;
86
+ };
87
+ editDropdownEditDatasourceTitle: {
94
88
  defaultMessage: string;
95
89
  description: string;
96
- };
97
- embedToBlockCardWarning: {
98
90
  id: string;
91
+ };
92
+ editDropdownEditLinkTitle: {
99
93
  defaultMessage: string;
100
94
  description: string;
95
+ id: string;
101
96
  };
102
97
  editDropdownExpandIconLabel: {
103
- id: string;
104
98
  defaultMessage: string;
105
99
  description: string;
100
+ id: string;
106
101
  };
107
102
  editDropdownTriggerTitle: {
108
- id: string;
109
103
  defaultMessage: string;
110
104
  description: string;
111
- };
112
- editDropdownEditLinkTitle: {
113
105
  id: string;
106
+ };
107
+ embed: {
114
108
  defaultMessage: string;
115
109
  description: string;
116
- };
117
- editDropdownEditDatasourceTitle: {
118
110
  id: string;
111
+ };
112
+ embedDescription: {
119
113
  defaultMessage: string;
120
114
  description: string;
121
- };
122
- datasourceTitle: {
123
115
  id: string;
116
+ };
117
+ embedTitle: {
124
118
  defaultMessage: string;
125
119
  description: string;
126
- };
127
- datasourceAppearanceTitle: {
128
120
  id: string;
121
+ };
122
+ embedToBlockCardWarning: {
129
123
  defaultMessage: string;
130
124
  description: string;
131
- };
132
- datasourceJiraIssue: {
133
125
  id: string;
126
+ };
127
+ inline: {
134
128
  defaultMessage: string;
135
129
  description: string;
136
- };
137
- datasourceJiraIssueDescription: {
138
130
  id: string;
131
+ };
132
+ inlineConfigureLink: {
139
133
  defaultMessage: string;
140
134
  description: string;
141
- };
142
- datasourceAssetsObjectsGeneralAvailability: {
143
135
  id: string;
136
+ };
137
+ inlineDescription: {
144
138
  defaultMessage: string;
145
139
  description: string;
146
- };
147
- datasourceAssetsObjectsDescription: {
148
140
  id: string;
141
+ };
142
+ inlineGoToLink: {
149
143
  defaultMessage: string;
150
144
  description: string;
145
+ id: string;
151
146
  };
152
147
  inlineOverlay: {
153
- id: string;
154
148
  defaultMessage: string;
155
149
  description: string;
156
- };
157
- inlineConfigureLink: {
158
150
  id: string;
151
+ };
152
+ inlineTitle: {
159
153
  defaultMessage: string;
160
154
  description: string;
161
- };
162
- inlineGoToLink: {
163
155
  id: string;
156
+ };
157
+ link: {
164
158
  defaultMessage: string;
165
159
  description: string;
166
- };
167
- datasourceConfluenceSearch: {
168
160
  id: string;
161
+ };
162
+ openButtonTitle: {
169
163
  defaultMessage: string;
170
164
  description: string;
171
- };
172
- datasourceConfluenceSearchDescription: {
173
165
  id: string;
166
+ };
167
+ panelButtonTitle: {
174
168
  defaultMessage: string;
175
169
  description: string;
170
+ id: string;
176
171
  };
177
- datasourceJiraIssueIssueTermRefresh: {
172
+ previewButtonTitle: {
173
+ defaultMessage: string;
174
+ description: string;
178
175
  id: string;
176
+ };
177
+ url: {
179
178
  defaultMessage: string;
180
179
  description: string;
180
+ id: string;
181
181
  };
182
- datasourceJiraIssueDescriptionIssueTermRefresh: {
182
+ urlDescription: {
183
+ defaultMessage: string;
184
+ description: string;
183
185
  id: string;
186
+ };
187
+ urlTitle: {
184
188
  defaultMessage: string;
185
189
  description: string;
190
+ id: string;
186
191
  };
187
192
  };
@@ -154,6 +154,11 @@ export declare const toolbarInsertBlockMessages: {
154
154
  description: string;
155
155
  id: string;
156
156
  };
157
+ loomTitle: {
158
+ defaultMessage: string;
159
+ description: string;
160
+ id: string;
161
+ };
157
162
  mediaFiles: {
158
163
  defaultMessage: string;
159
164
  description: string;
@@ -0,0 +1,39 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { getPosHandler } from './react-node-view/types';
4
+ export type PreservedNodeView = {
5
+ destroy: () => void;
6
+ dom: HTMLElement;
7
+ getPos: getPosHandler;
8
+ ignoreMutation?: (mutation: MutationRecord | {
9
+ target: Node;
10
+ type: 'selection';
11
+ }) => boolean;
12
+ init: () => NodeView;
13
+ node: PMNode;
14
+ reactComponentProps: unknown;
15
+ stopEvent: (event: Event) => boolean;
16
+ update: (node: PMNode, decorations: readonly Decoration[], innerDecorations?: DecorationSource) => boolean;
17
+ view: EditorView;
18
+ };
19
+ type PreservationOptions = {
20
+ canReuse?: (inner: PreservedNodeView) => boolean;
21
+ canUpdateNode: (previous: PMNode, next: PMNode) => boolean;
22
+ createNodeView: (node: PMNode) => PreservedNodeView;
23
+ getPos: getPosHandler;
24
+ isSameNode: (previous: PMNode, next: PMNode) => boolean;
25
+ node: PMNode;
26
+ onAttach?: (inner: PreservedNodeView, slot: HTMLElement, getPos: () => number | undefined) => void;
27
+ rendererKind: object;
28
+ renderProps: unknown;
29
+ requireUniqueMatch?: boolean;
30
+ view: EditorView;
31
+ };
32
+ /**
33
+ * Preserves an atomic React node view across ProseMirror redraws when native
34
+ * state-preserving DOM moves are available. A disposable slot parks the
35
+ * portal before ProseMirror disconnects its mark wrapper. After reconciliation, the
36
+ * replacement claims the parked portal without taking one from a still-live node.
37
+ */
38
+ export declare function preserveNodeView({ node, view, getPos, renderProps, rendererKind, createNodeView, isSameNode, canUpdateNode, canReuse, onAttach, requireUniqueMatch, }: PreservationOptions): NodeView;
39
+ export {};
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/mark/cell-selection-has-any-mark",
3
+ "main": "../../dist/cjs/mark/cell-selection-has-any-mark.js",
4
+ "module": "../../dist/esm/mark/cell-selection-has-any-mark.js",
5
+ "module:es2019": "../../dist/es2019/mark/cell-selection-has-any-mark.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/mark/cell-selection-has-any-mark.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/mark/get-supported-mark-types",
3
+ "main": "../../dist/cjs/mark/get-supported-mark-types.js",
4
+ "module": "../../dist/esm/mark/get-supported-mark-types.js",
5
+ "module:es2019": "../../dist/es2019/mark/get-supported-mark-types.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/mark/get-supported-mark-types.d.ts"
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "134.2.2",
3
+ "version": "134.4.0",
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/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/analytics-next": "^12.6.0",
38
38
  "@atlaskit/atlassian-context": "^2.0.0",
39
39
  "@atlaskit/browser-apis": "^1.2.0",
40
- "@atlaskit/button": "^25.6.0",
40
+ "@atlaskit/button": "^25.7.0",
41
41
  "@atlaskit/codemod-utils": "^5.1.0",
42
42
  "@atlaskit/css": "^1.1.0",
43
43
  "@atlaskit/custom-steps": "^1.1.0",
@@ -45,17 +45,17 @@
45
45
  "@atlaskit/editor-json-transformer": "^10.0.0",
46
46
  "@atlaskit/editor-palette": "^3.5.0",
47
47
  "@atlaskit/editor-prosemirror": "^9.0.0",
48
- "@atlaskit/editor-shared-styles": "^4.6.0",
48
+ "@atlaskit/editor-shared-styles": "^5.0.0",
49
49
  "@atlaskit/editor-tables": "^3.2.0",
50
50
  "@atlaskit/editor-toolbar": "^2.8.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",
52
52
  "@atlaskit/editor-ui-control-model": "^3.0.0",
53
53
  "@atlaskit/emoji": "^73.3.0",
54
- "@atlaskit/feature-gate-js-client": "^7.1.0",
54
+ "@atlaskit/feature-gate-js-client": "^8.0.0",
55
55
  "@atlaskit/icon": "^38.0.0",
56
56
  "@atlaskit/link": "^5.1.0",
57
- "@atlaskit/link-datasource": "^7.10.0",
58
- "@atlaskit/link-picker": "^6.18.0",
57
+ "@atlaskit/link-datasource": "^7.11.0",
58
+ "@atlaskit/link-picker": "^6.19.0",
59
59
  "@atlaskit/logo": "^23.3.0",
60
60
  "@atlaskit/media-card": "^82.2.0",
61
61
  "@atlaskit/media-client": "^39.3.0",
@@ -79,14 +79,14 @@
79
79
  "@atlaskit/react-compiler-gating": "^0.2.0",
80
80
  "@atlaskit/react-ufo": "^8.3.0",
81
81
  "@atlaskit/section-message": "^10.2.0",
82
- "@atlaskit/smart-card": "^46.11.0",
83
- "@atlaskit/smart-user-picker": "^12.9.0",
82
+ "@atlaskit/smart-card": "^46.12.0",
83
+ "@atlaskit/smart-user-picker": "^12.10.0",
84
84
  "@atlaskit/spinner": "^20.4.0",
85
85
  "@atlaskit/task-decision": "^21.14.0",
86
86
  "@atlaskit/teams-app-config": "^3.1.0",
87
87
  "@atlaskit/textfield": "^10.3.0",
88
- "@atlaskit/tmp-editor-statsig": "^249.0.0",
89
- "@atlaskit/tokens": "^20.8.0",
88
+ "@atlaskit/tmp-editor-statsig": "^250.0.0",
89
+ "@atlaskit/tokens": "^20.9.0",
90
90
  "@atlaskit/tooltip": "^24.4.0",
91
91
  "@atlaskit/width-detector": "^7.2.0",
92
92
  "@babel/runtime": "^7.0.0",
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/preserve-node-view",
3
+ "main": "../dist/cjs/preserve-node-view.js",
4
+ "module": "../dist/esm/preserve-node-view.js",
5
+ "module:es2019": "../dist/es2019/preserve-node-view.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/preserve-node-view.d.ts"
10
+ }
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = cellSizeAndPositionGetter;
7
- var _constants = require("../../constants");
8
- var _utils = require("./utils");
9
- /**
10
- * Callback responsible for returning size and offset/position information
11
- * for a given cell.
12
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
13
- **/
14
- function cellSizeAndPositionGetter(containerWidth, scrollbarWidth) {
15
- var GUTTER_SIZE = 4;
16
- /**
17
- * Save the currently rendered columnY positions.
18
- * Have to be within the current render scope.
19
- */
20
- var columnYMap = [];
21
- return function (_ref) {
22
- var index = _ref.index;
23
- var _generateVirtualizedC = (0, _utils.generateVirtualizedContainerDatum)(containerWidth, {
24
- gutterSize: GUTTER_SIZE,
25
- scrollbarWidth: scrollbarWidth
26
- }),
27
- columnCount = _generateVirtualizedC.columnCount,
28
- availableWidth = _generateVirtualizedC.availableWidth;
29
- var width = Math.floor(availableWidth / columnCount);
30
- var height = _constants.ELEMENT_ITEM_HEIGHT;
31
- var columnPosition = index % (columnCount || 1);
32
- var x = columnPosition * width;
33
- var y = columnYMap[columnPosition] || 0;
34
- columnYMap[columnPosition] = y + height;
35
- return {
36
- height: height,
37
- width: width,
38
- x: x,
39
- y: y
40
- };
41
- };
42
- }
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isNodeTypeValidChildOf = isNodeTypeValidChildOf;
7
- var _model = require("@atlaskit/editor-prosemirror/model");
8
- /**
9
- * Checks if a node type is a valid child of a parent node by creating a minimal valid
10
- * instance and validating it against the parent's content expression. Unlike ProseMirror's
11
- * canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
12
- */
13
- function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
14
- var childType = schema.nodes[childTypeName];
15
- if (!childType) {
16
- return false;
17
- }
18
- var candidate = childType.createAndFill();
19
- if (!candidate) {
20
- return false;
21
- }
22
- return parentNode.type.validContent(_model.Fragment.from(candidate));
23
- }
@@ -1,39 +0,0 @@
1
- import { ELEMENT_ITEM_HEIGHT } from '../../constants';
2
- import { generateVirtualizedContainerDatum } from './utils';
3
-
4
- /**
5
- * Callback responsible for returning size and offset/position information
6
- * for a given cell.
7
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
8
- **/
9
- export default function cellSizeAndPositionGetter(containerWidth, scrollbarWidth) {
10
- const GUTTER_SIZE = 4;
11
- /**
12
- * Save the currently rendered columnY positions.
13
- * Have to be within the current render scope.
14
- */
15
- const columnYMap = [];
16
- return ({
17
- index
18
- }) => {
19
- const {
20
- columnCount,
21
- availableWidth
22
- } = generateVirtualizedContainerDatum(containerWidth, {
23
- gutterSize: GUTTER_SIZE,
24
- scrollbarWidth
25
- });
26
- const width = Math.floor(availableWidth / columnCount);
27
- const height = ELEMENT_ITEM_HEIGHT;
28
- const columnPosition = index % (columnCount || 1);
29
- const x = columnPosition * width;
30
- const y = columnYMap[columnPosition] || 0;
31
- columnYMap[columnPosition] = y + height;
32
- return {
33
- height,
34
- width,
35
- x,
36
- y
37
- };
38
- };
39
- }
File without changes
File without changes
@@ -1,17 +0,0 @@
1
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- /**
3
- * Checks if a node type is a valid child of a parent node by creating a minimal valid
4
- * instance and validating it against the parent's content expression. Unlike ProseMirror's
5
- * canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
6
- */
7
- export function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
8
- const childType = schema.nodes[childTypeName];
9
- if (!childType) {
10
- return false;
11
- }
12
- const candidate = childType.createAndFill();
13
- if (!candidate) {
14
- return false;
15
- }
16
- return parentNode.type.validContent(Fragment.from(candidate));
17
- }
@@ -1,37 +0,0 @@
1
- import { ELEMENT_ITEM_HEIGHT } from '../../constants';
2
- import { generateVirtualizedContainerDatum } from './utils';
3
-
4
- /**
5
- * Callback responsible for returning size and offset/position information
6
- * for a given cell.
7
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
8
- **/
9
- export default function cellSizeAndPositionGetter(containerWidth, scrollbarWidth) {
10
- var GUTTER_SIZE = 4;
11
- /**
12
- * Save the currently rendered columnY positions.
13
- * Have to be within the current render scope.
14
- */
15
- var columnYMap = [];
16
- return function (_ref) {
17
- var index = _ref.index;
18
- var _generateVirtualizedC = generateVirtualizedContainerDatum(containerWidth, {
19
- gutterSize: GUTTER_SIZE,
20
- scrollbarWidth: scrollbarWidth
21
- }),
22
- columnCount = _generateVirtualizedC.columnCount,
23
- availableWidth = _generateVirtualizedC.availableWidth;
24
- var width = Math.floor(availableWidth / columnCount);
25
- var height = ELEMENT_ITEM_HEIGHT;
26
- var columnPosition = index % (columnCount || 1);
27
- var x = columnPosition * width;
28
- var y = columnYMap[columnPosition] || 0;
29
- columnYMap[columnPosition] = y + height;
30
- return {
31
- height: height,
32
- width: width,
33
- x: x,
34
- y: y
35
- };
36
- };
37
- }
File without changes
File without changes
@@ -1,17 +0,0 @@
1
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- /**
3
- * Checks if a node type is a valid child of a parent node by creating a minimal valid
4
- * instance and validating it against the parent's content expression. Unlike ProseMirror's
5
- * canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
6
- */
7
- export function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
8
- var childType = schema.nodes[childTypeName];
9
- if (!childType) {
10
- return false;
11
- }
12
- var candidate = childType.createAndFill();
13
- if (!candidate) {
14
- return false;
15
- }
16
- return parentNode.type.validContent(Fragment.from(candidate));
17
- }
@@ -1,7 +0,0 @@
1
- import type { CollectionCellSizeAndPositionGetter } from 'react-virtualized/dist/commonjs/Collection';
2
- /**
3
- * Callback responsible for returning size and offset/position information
4
- * for a given cell.
5
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
6
- **/
7
- export default function cellSizeAndPositionGetter(containerWidth: number, scrollbarWidth: number): CollectionCellSizeAndPositionGetter;
File without changes
@@ -1,4 +0,0 @@
1
- export type BlockNodeIdentifiers = {
2
- blockInstanceId: string;
3
- resourceId: string;
4
- };
@@ -1,7 +0,0 @@
1
- import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
- /**
3
- * Checks if a node type is a valid child of a parent node by creating a minimal valid
4
- * instance and validating it against the parent's content expression. Unlike ProseMirror's
5
- * canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
6
- */
7
- export declare function isNodeTypeValidChildOf(childTypeName: string, parentNode: PMNode, schema: Schema): boolean;