@atlaskit/editor-plugin-table 7.2.2 → 7.3.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/commands/column-resize.js +115 -45
- package/dist/cjs/commands/go-to-next-cell.js +7 -11
- package/dist/cjs/commands/misc.js +3 -2
- package/dist/cjs/commands/selection.js +3 -3
- package/dist/cjs/event-handlers.js +38 -25
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -19
- package/dist/cjs/pm-plugins/keymap.js +1 -0
- package/dist/cjs/pm-plugins/main.js +43 -9
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +37 -7
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +20 -6
- package/dist/cjs/reducer.js +5 -2
- package/dist/cjs/utils/drag-menu.js +37 -23
- package/dist/cjs/utils/merged-cells.js +66 -1
- package/dist/es2019/commands/column-resize.js +100 -35
- package/dist/es2019/commands/go-to-next-cell.js +7 -9
- package/dist/es2019/commands/misc.js +3 -2
- package/dist/es2019/commands/selection.js +5 -5
- package/dist/es2019/event-handlers.js +17 -3
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
- package/dist/es2019/pm-plugins/keymap.js +3 -2
- package/dist/es2019/pm-plugins/main.js +41 -5
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +37 -4
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +16 -1
- package/dist/es2019/reducer.js +5 -2
- package/dist/es2019/utils/drag-menu.js +38 -14
- package/dist/es2019/utils/merged-cells.js +73 -0
- package/dist/esm/commands/column-resize.js +105 -35
- package/dist/esm/commands/go-to-next-cell.js +7 -11
- package/dist/esm/commands/misc.js +3 -2
- package/dist/esm/commands/selection.js +5 -5
- package/dist/esm/event-handlers.js +38 -25
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
- package/dist/esm/pm-plugins/keymap.js +3 -2
- package/dist/esm/pm-plugins/main.js +38 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +34 -4
- package/dist/esm/pm-plugins/table-resizing/plugin.js +15 -1
- package/dist/esm/reducer.js +5 -2
- package/dist/esm/utils/drag-menu.js +36 -22
- package/dist/esm/utils/merged-cells.js +65 -0
- package/dist/types/commands/column-resize.d.ts +2 -0
- package/dist/types/commands/misc.d.ts +1 -1
- package/dist/types/types.d.ts +16 -0
- package/dist/types/utils/drag-menu.d.ts +4 -1
- package/dist/types/utils/merged-cells.d.ts +2 -0
- package/dist/types-ts4.5/commands/column-resize.d.ts +2 -0
- package/dist/types-ts4.5/commands/misc.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +16 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +4 -1
- package/dist/types-ts4.5/utils/merged-cells.d.ts +2 -0
- package/package.json +10 -17
- package/src/commands/column-resize.ts +155 -40
- package/src/commands/go-to-next-cell.ts +6 -15
- package/src/commands/misc.ts +2 -0
- package/src/commands/selection.ts +5 -5
- package/src/event-handlers.ts +21 -4
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +11 -32
- package/src/pm-plugins/keymap.ts +3 -0
- package/src/pm-plugins/main.ts +47 -2
- package/src/pm-plugins/table-resizing/event-handlers.ts +33 -5
- package/src/pm-plugins/table-resizing/plugin.ts +18 -1
- package/src/reducer.ts +5 -2
- package/src/types.ts +16 -0
- package/src/utils/drag-menu.ts +94 -20
- package/src/utils/merged-cells.ts +78 -0
- package/tsconfig.dev.json +0 -69
- package/tsconfig.json +2 -877
- package/examples/99-testing.tsx +0 -140
- package/examples/config.jsonc +0 -14
- package/src/__tests__/unit/analytics.ts +0 -888
- package/src/__tests__/unit/collab.ts +0 -93
- package/src/__tests__/unit/commands/go-to-next-cell.ts +0 -173
- package/src/__tests__/unit/commands/insert.ts +0 -137
- package/src/__tests__/unit/commands/misc.ts +0 -185
- package/src/__tests__/unit/commands/sort.ts +0 -128
- package/src/__tests__/unit/commands.ts +0 -745
- package/src/__tests__/unit/copy-button.ts +0 -22
- package/src/__tests__/unit/copy-paste.ts +0 -677
- package/src/__tests__/unit/event-handlers/index.ts +0 -125
- package/src/__tests__/unit/event-handlers.ts +0 -296
- package/src/__tests__/unit/fix-tables.ts +0 -164
- package/src/__tests__/unit/get-toolbar-config.ts +0 -127
- package/src/__tests__/unit/handlers.ts +0 -98
- package/src/__tests__/unit/hover-selection.ts +0 -230
- package/src/__tests__/unit/index-with-fake-timers.ts +0 -111
- package/src/__tests__/unit/index.ts +0 -912
- package/src/__tests__/unit/layout.ts +0 -146
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +0 -162
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +0 -280
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +0 -525
- package/src/__tests__/unit/nodeviews/cell.ts +0 -132
- package/src/__tests__/unit/nodeviews/table.ts +0 -129
- package/src/__tests__/unit/pm-plugins/analytics.ts +0 -327
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +0 -94
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +0 -176
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +0 -211
- package/src/__tests__/unit/pm-plugins/main.ts +0 -214
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -101
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +0 -562
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +0 -507
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +0 -269
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +0 -192
- package/src/__tests__/unit/pm-plugins/table-resizing/utils/resize-state.ts +0 -33
- package/src/__tests__/unit/pm-plugins/table-width.ts +0 -292
- package/src/__tests__/unit/sort-column.ts +0 -399
- package/src/__tests__/unit/toolbar.ts +0 -512
- package/src/__tests__/unit/transforms/delete-columns.ts +0 -597
- package/src/__tests__/unit/transforms/delete-rows.ts +0 -620
- package/src/__tests__/unit/transforms/merging.ts +0 -392
- package/src/__tests__/unit/ui/ContextualMenu.tsx +0 -71
- package/src/__tests__/unit/ui/CornerControls.tsx +0 -99
- package/src/__tests__/unit/ui/DeleteButton.tsx +0 -38
- package/src/__tests__/unit/ui/FixedButton.tsx +0 -217
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +0 -123
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +0 -68
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +0 -178
- package/src/__tests__/unit/ui/FloatingDragMenu.tsx +0 -511
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +0 -322
- package/src/__tests__/unit/ui/NumberColumn.tsx +0 -146
- package/src/__tests__/unit/ui/RowControls.tsx +0 -294
- package/src/__tests__/unit/ui/RowDragControls.tsx +0 -129
- package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +0 -189
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +0 -118
- package/src/__tests__/unit/undo-redo.ts +0 -220
- package/src/__tests__/unit/utils/analytics.ts +0 -98
- package/src/__tests__/unit/utils/collapse.ts +0 -57
- package/src/__tests__/unit/utils/column-controls.ts +0 -205
- package/src/__tests__/unit/utils/dom.ts +0 -180
- package/src/__tests__/unit/utils/merged-cells.ts +0 -156
- package/src/__tests__/unit/utils/nodes.ts +0 -79
- package/src/__tests__/unit/utils/row-controls.ts +0 -195
- package/src/__tests__/unit/utils/table.ts +0 -96
- package/src/__tests__/unit/utils.ts +0 -670
- package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +0 -5228
- package/src/__tests__/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -20272
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/src/__tests__/visual-regression/cell-options-menu.ts +0 -101
- package/src/__tests__/visual-regression/copy-button.ts +0 -181
- package/src/__tests__/visual-regression/index.ts +0 -62
- package/src/__tests__/visual-regression/sticky-header.ts +0 -61
package/examples/99-testing.tsx
DELETED
|
@@ -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
|
-
}
|
package/examples/config.jsonc
DELETED
|
@@ -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
|
-
}
|