@atlaskit/editor-plugin-table 7.2.2 → 7.2.3

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 (102) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -19
  3. package/dist/cjs/utils/drag-menu.js +37 -23
  4. package/dist/cjs/utils/merged-cells.js +66 -1
  5. package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
  6. package/dist/es2019/utils/drag-menu.js +38 -14
  7. package/dist/es2019/utils/merged-cells.js +73 -0
  8. package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
  9. package/dist/esm/utils/drag-menu.js +36 -22
  10. package/dist/esm/utils/merged-cells.js +65 -0
  11. package/dist/types/utils/drag-menu.d.ts +4 -1
  12. package/dist/types/utils/merged-cells.d.ts +2 -0
  13. package/dist/types-ts4.5/utils/drag-menu.d.ts +4 -1
  14. package/dist/types-ts4.5/utils/merged-cells.d.ts +2 -0
  15. package/package.json +9 -16
  16. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +11 -32
  17. package/src/utils/drag-menu.ts +94 -20
  18. package/src/utils/merged-cells.ts +78 -0
  19. package/tsconfig.dev.json +0 -69
  20. package/tsconfig.json +2 -877
  21. package/examples/99-testing.tsx +0 -140
  22. package/examples/config.jsonc +0 -14
  23. package/src/__tests__/unit/analytics.ts +0 -888
  24. package/src/__tests__/unit/collab.ts +0 -93
  25. package/src/__tests__/unit/commands/go-to-next-cell.ts +0 -173
  26. package/src/__tests__/unit/commands/insert.ts +0 -137
  27. package/src/__tests__/unit/commands/misc.ts +0 -185
  28. package/src/__tests__/unit/commands/sort.ts +0 -128
  29. package/src/__tests__/unit/commands.ts +0 -745
  30. package/src/__tests__/unit/copy-button.ts +0 -22
  31. package/src/__tests__/unit/copy-paste.ts +0 -677
  32. package/src/__tests__/unit/event-handlers/index.ts +0 -125
  33. package/src/__tests__/unit/event-handlers.ts +0 -296
  34. package/src/__tests__/unit/fix-tables.ts +0 -164
  35. package/src/__tests__/unit/get-toolbar-config.ts +0 -127
  36. package/src/__tests__/unit/handlers.ts +0 -98
  37. package/src/__tests__/unit/hover-selection.ts +0 -230
  38. package/src/__tests__/unit/index-with-fake-timers.ts +0 -111
  39. package/src/__tests__/unit/index.ts +0 -912
  40. package/src/__tests__/unit/layout.ts +0 -146
  41. package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +0 -162
  42. package/src/__tests__/unit/nodeviews/TableComponent.tsx +0 -280
  43. package/src/__tests__/unit/nodeviews/TableContainer.tsx +0 -525
  44. package/src/__tests__/unit/nodeviews/cell.ts +0 -132
  45. package/src/__tests__/unit/nodeviews/table.ts +0 -129
  46. package/src/__tests__/unit/pm-plugins/analytics.ts +0 -327
  47. package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +0 -94
  48. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +0 -176
  49. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +0 -211
  50. package/src/__tests__/unit/pm-plugins/main.ts +0 -214
  51. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -101
  52. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +0 -562
  53. package/src/__tests__/unit/pm-plugins/table-local-id.ts +0 -507
  54. package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +0 -269
  55. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +0 -192
  56. package/src/__tests__/unit/pm-plugins/table-resizing/utils/resize-state.ts +0 -33
  57. package/src/__tests__/unit/pm-plugins/table-width.ts +0 -292
  58. package/src/__tests__/unit/sort-column.ts +0 -399
  59. package/src/__tests__/unit/toolbar.ts +0 -512
  60. package/src/__tests__/unit/transforms/delete-columns.ts +0 -597
  61. package/src/__tests__/unit/transforms/delete-rows.ts +0 -620
  62. package/src/__tests__/unit/transforms/merging.ts +0 -392
  63. package/src/__tests__/unit/ui/ContextualMenu.tsx +0 -71
  64. package/src/__tests__/unit/ui/CornerControls.tsx +0 -99
  65. package/src/__tests__/unit/ui/DeleteButton.tsx +0 -38
  66. package/src/__tests__/unit/ui/FixedButton.tsx +0 -217
  67. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +0 -123
  68. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +0 -68
  69. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +0 -178
  70. package/src/__tests__/unit/ui/FloatingDragMenu.tsx +0 -511
  71. package/src/__tests__/unit/ui/FloatingInsertButton.tsx +0 -322
  72. package/src/__tests__/unit/ui/NumberColumn.tsx +0 -146
  73. package/src/__tests__/unit/ui/RowControls.tsx +0 -294
  74. package/src/__tests__/unit/ui/RowDragControls.tsx +0 -129
  75. package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +0 -189
  76. package/src/__tests__/unit/ui/TableFloatingControls.tsx +0 -118
  77. package/src/__tests__/unit/undo-redo.ts +0 -220
  78. package/src/__tests__/unit/utils/analytics.ts +0 -98
  79. package/src/__tests__/unit/utils/collapse.ts +0 -57
  80. package/src/__tests__/unit/utils/column-controls.ts +0 -205
  81. package/src/__tests__/unit/utils/dom.ts +0 -180
  82. package/src/__tests__/unit/utils/merged-cells.ts +0 -156
  83. package/src/__tests__/unit/utils/nodes.ts +0 -79
  84. package/src/__tests__/unit/utils/row-controls.ts +0 -195
  85. package/src/__tests__/unit/utils/table.ts +0 -96
  86. package/src/__tests__/unit/utils.ts +0 -670
  87. package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +0 -5228
  88. package/src/__tests__/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -20272
  89. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +0 -3
  90. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +0 -3
  91. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +0 -3
  92. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +0 -3
  93. package/src/__tests__/visual-regression/__image_snapshots__/copy-button-ts-floating-toolbar-copy-button-table-target-node-displays-blue-border-when-copy-button-is-hovered-1-snap.png +0 -3
  94. package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-1-snap.png +0 -3
  95. package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-2-snap.png +0 -3
  96. package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-3-snap.png +0 -3
  97. package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-1-snap.png +0 -3
  98. package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +0 -3
  99. package/src/__tests__/visual-regression/cell-options-menu.ts +0 -101
  100. package/src/__tests__/visual-regression/copy-button.ts +0 -181
  101. package/src/__tests__/visual-regression/index.ts +0 -62
  102. package/src/__tests__/visual-regression/sticky-header.ts +0 -61
@@ -1,140 +0,0 @@
1
- import React from 'react';
2
-
3
- import { IntlProvider } from 'react-intl-next';
4
-
5
- import Button from '@atlaskit/button/standard-button';
6
- import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
7
- import {
8
- createEditorExampleForTests,
9
- mapProvidersToProps,
10
- } from '@atlaskit/editor-core/example-helpers/create-editor-example-for-tests';
11
- import { getDefaultLinkPickerOptions } from '@atlaskit/editor-core/example-helpers/link-picker';
12
- import { TitleInput } from '@atlaskit/editor-core/example-helpers/PageElements';
13
- import { SaveAndCancelButtons } from '@atlaskit/editor-core/examples/5-full-page';
14
- import { ContextPanel, Editor } from '@atlaskit/editor-core/src';
15
- import { customInsertMenuItems } from '@atlaskit/editor-test-helpers/mock-insert-menu';
16
- import { SmartCardProvider } from '@atlaskit/link-provider';
17
- import { AtlassianIcon } from '@atlaskit/logo/atlassian-icon';
18
- import { cardClient } from '@atlaskit/media-integration-test-helpers/card-client';
19
- import { EmbedHelper } from '@atlaskit/media-integration-test-helpers/embed-helper';
20
- import { createCollabEditProvider } from '@atlaskit/synchrony-test-helpers';
21
-
22
- export default function EditorExampleForIntegrationTests({ clipboard = true }) {
23
- return createEditorExampleForTests<any>(
24
- (props, nonSerializableProps, lifecycleHandlers, withCollab) => {
25
- const { onMount, onChange, onDestroy } = lifecycleHandlers;
26
-
27
- if (props?.primaryToolbarComponents) {
28
- const saveIndicator = <div>Save Indicator</div>;
29
- const mainButtons = <SaveAndCancelButtons />;
30
-
31
- if (props.primaryToolbarComponents.before) {
32
- props.primaryToolbarComponents = {
33
- before: saveIndicator,
34
- after: mainButtons,
35
- };
36
- } else {
37
- props.primaryToolbarComponents = mainButtons;
38
- }
39
- }
40
-
41
- if (props && props.primaryToolbarIconBefore) {
42
- props.primaryToolbarIconBefore = (
43
- <Button
44
- iconBefore={<AtlassianIcon />}
45
- appearance="subtle"
46
- href="https://atlaskit.atlassian.com/"
47
- shouldFitContainer
48
- ></Button>
49
- );
50
- }
51
-
52
- if (props && props.contentComponents) {
53
- props.contentComponents = (
54
- <TitleInput placeholder="Give this page a title..." />
55
- );
56
- }
57
-
58
- if (nonSerializableProps.withContextPanel) {
59
- props.contextPanel = (
60
- <ContextPanel visible={true}>
61
- <div>
62
- {new Array(50).fill(
63
- <p>Somebody once told me the world is gonna roll me</p>,
64
- )}
65
- </div>
66
- </ContextPanel>
67
- );
68
- }
69
-
70
- if (nonSerializableProps.withLinkPickerOptions) {
71
- props.linking = {
72
- linkPicker: {
73
- ...getDefaultLinkPickerOptions(),
74
- ...props.linkPicker,
75
- },
76
- };
77
- }
78
-
79
- if (props.media) {
80
- props.media = {
81
- allowMediaSingle: true,
82
- allowResizing: true,
83
- allowResizingInTables: true,
84
- allowLinking: true,
85
- ...props.media,
86
- };
87
- }
88
-
89
- if (!props.performanceTracking) {
90
- props.performanceTracking = {
91
- ttiTracking: { enabled: true },
92
- };
93
- }
94
-
95
- const createCollabEdit = (userId: string): CollabEditOptions => {
96
- return {
97
- provider: createCollabEditProvider({ userId }),
98
- };
99
- };
100
- const createEditor = (sessionId?: string) => {
101
- const collabEdit = sessionId ? createCollabEdit(sessionId) : undefined;
102
-
103
- return (
104
- <IntlProvider locale="en">
105
- <Editor
106
- {...mapProvidersToProps(nonSerializableProps.providers, props)}
107
- {...nonSerializableProps.providers}
108
- insertMenuItems={customInsertMenuItems}
109
- extensionHandlers={nonSerializableProps.extensionHandlers}
110
- onEditorReady={onMount}
111
- onChange={onChange}
112
- onDestroy={onDestroy}
113
- collabEdit={collabEdit}
114
- />
115
- </IntlProvider>
116
- );
117
- };
118
- const editorContent = withCollab ? (
119
- <div>
120
- {createEditor('rick')}
121
- {createEditor('morty')}
122
- </div>
123
- ) : (
124
- createEditor()
125
- );
126
-
127
- if (props.linking?.smartLinks || props.smartLinks) {
128
- return (
129
- <SmartCardProvider client={cardClient}>
130
- {editorContent}
131
- <EmbedHelper />
132
- </SmartCardProvider>
133
- );
134
- } else {
135
- return editorContent;
136
- }
137
- },
138
- { clipboard },
139
- );
140
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * This file is used by the test scaling project to optimise test result caching
3
- * Examples that are used by tests affect the outcome of tests so must be included when hashing
4
- * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time
5
- */
6
- {
7
- "exampleDependencies": [
8
- "@atlaskit/button",
9
- "@atlaskit/link-provider",
10
- "@atlaskit/logo",
11
- "@atlaskit/media-integration-test-helpers",
12
- "@atlaskit/synchrony-test-helpers"
13
- ]
14
- }