@atlaskit/editor-plugin-table 7.21.4 → 7.21.6

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 (54) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/nodeviews/TableContainer.js +5 -2
  3. package/dist/cjs/nodeviews/TableResizer.js +9 -6
  4. package/dist/cjs/plugin.js +3 -3
  5. package/dist/cjs/pm-plugins/keymap.js +4 -6
  6. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +40 -12
  7. package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +5 -2
  8. package/dist/cjs/pm-plugins/table-resizing/utils/index.js +6 -0
  9. package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +99 -51
  10. package/dist/cjs/pm-plugins/table-width.js +2 -2
  11. package/dist/cjs/utils/alignment.js +1 -1
  12. package/dist/es2019/nodeviews/TableContainer.js +6 -3
  13. package/dist/es2019/nodeviews/TableResizer.js +10 -7
  14. package/dist/es2019/plugin.js +3 -3
  15. package/dist/es2019/pm-plugins/keymap.js +4 -6
  16. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +41 -13
  17. package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +4 -1
  18. package/dist/es2019/pm-plugins/table-resizing/utils/index.js +1 -1
  19. package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +97 -48
  20. package/dist/es2019/pm-plugins/table-width.js +2 -2
  21. package/dist/es2019/utils/alignment.js +1 -1
  22. package/dist/esm/nodeviews/TableContainer.js +6 -3
  23. package/dist/esm/nodeviews/TableResizer.js +10 -7
  24. package/dist/esm/plugin.js +3 -3
  25. package/dist/esm/pm-plugins/keymap.js +4 -6
  26. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +40 -12
  27. package/dist/esm/pm-plugins/table-resizing/utils/consts.js +4 -1
  28. package/dist/esm/pm-plugins/table-resizing/utils/index.js +1 -1
  29. package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +99 -51
  30. package/dist/esm/pm-plugins/table-width.js +2 -2
  31. package/dist/esm/utils/alignment.js +1 -1
  32. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  33. package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  34. package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  35. package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +23 -1
  36. package/dist/types/pm-plugins/table-width.d.ts +1 -1
  37. package/dist/types/utils/alignment.d.ts +1 -1
  38. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  39. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  40. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  41. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +23 -1
  42. package/dist/types-ts4.5/pm-plugins/table-width.d.ts +1 -1
  43. package/dist/types-ts4.5/utils/alignment.d.ts +1 -1
  44. package/package.json +2 -5
  45. package/src/nodeviews/TableContainer.tsx +8 -4
  46. package/src/nodeviews/TableResizer.tsx +19 -3
  47. package/src/plugin.tsx +4 -2
  48. package/src/pm-plugins/keymap.ts +30 -32
  49. package/src/pm-plugins/table-resizing/event-handlers.ts +37 -25
  50. package/src/pm-plugins/table-resizing/utils/consts.ts +4 -0
  51. package/src/pm-plugins/table-resizing/utils/index.ts +1 -0
  52. package/src/pm-plugins/table-resizing/utils/resize-column.ts +142 -70
  53. package/src/pm-plugins/table-width.ts +2 -1
  54. package/src/utils/alignment.ts +8 -6
@@ -38,6 +38,7 @@ import {
38
38
  resizeColumnAndTable,
39
39
  updateControls,
40
40
  } from './utils';
41
+ import { scaleResizeState } from './utils/resize-column';
41
42
 
42
43
  export const handleMouseDown = (
43
44
  view: EditorView,
@@ -53,7 +54,7 @@ export const handleMouseDown = (
53
54
  const { state, dispatch } = view;
54
55
  const editorDisabled = !view.editable;
55
56
  const domAtPos = view.domAtPos.bind(view);
56
- const { lineLength } = getEditorContainerWidth();
57
+ const { lineLength, width: editorWidth } = getEditorContainerWidth();
57
58
 
58
59
  if (
59
60
  editorDisabled ||
@@ -102,7 +103,7 @@ export const handleMouseDown = (
102
103
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
103
104
  }
104
105
 
105
- const resizeState = getResizeState({
106
+ let resizeState = getResizeState({
106
107
  minWidth: tableCellMinWidth,
107
108
  maxSize,
108
109
  table: originalTable,
@@ -135,6 +136,17 @@ export const handleMouseDown = (
135
136
  // unnecessary tooltips being displayed during drag.
136
137
  updateResizeHandleDecorations(undefined, undefined, false)(state, dispatch);
137
138
 
139
+ // for new column resizing, take the current scaled version of table widths and use those as the basis for resizing
140
+ // implication: the scaled version of the table becomes the source of truth
141
+ if (isNewColumnResizingEnabled && shouldScale) {
142
+ resizeState = scaleResizeState({
143
+ resizeState,
144
+ tableRef: dom,
145
+ tableNode: originalTable,
146
+ editorWidth,
147
+ });
148
+ }
149
+
138
150
  function finish(event: MouseEvent) {
139
151
  window.removeEventListener('mouseup', finish);
140
152
  window.removeEventListener('mousemove', move);
@@ -201,20 +213,19 @@ export const handleMouseDown = (
201
213
  const shouldUseIncreasedScalingPercent =
202
214
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
203
215
  fg('platform.editor.table.use-increased-scaling-percent');
216
+
204
217
  if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
205
- const newResizeState = resizeColumnAndTable(
218
+ const newResizeState = resizeColumnAndTable({
206
219
  resizeState,
207
220
  colIndex,
208
- resizedDelta,
209
- dom,
210
- originalTable,
211
- resizingSelectedColumns ? selectedColumns : undefined,
212
- shouldScale, // isTableScalingEnabled
213
- undefined, // originalTableWidth
214
- shouldUseIncreasedScalingPercent,
221
+ amount: resizedDelta,
222
+ tableRef: dom,
223
+ tableNode: originalTable,
224
+ width: editorWidth,
215
225
  lineLength,
216
226
  isTableAlignmentEnabled,
217
- );
227
+ });
228
+
218
229
  tr = updateColumnWidths(newResizeState, table, start)(tr);
219
230
 
220
231
  // If the table is aligned to the start and the table width is greater than the line length, we should change the alignment to center
@@ -222,12 +233,13 @@ export const handleMouseDown = (
222
233
  isTableAlignmentEnabled,
223
234
  originalTable,
224
235
  lineLength,
225
- newResizeState.tableWidth,
236
+ newResizeState.maxSize,
226
237
  );
238
+
227
239
  if (shouldChangeAlignment) {
228
240
  tr = tr.setNodeMarkup(start - 1, state.schema.nodes.table, {
229
241
  ...table.attrs,
230
- width: newResizeState.tableWidth,
242
+ width: newResizeState.maxSize,
231
243
  layout: ALIGN_CENTER,
232
244
  });
233
245
 
@@ -236,7 +248,7 @@ export const handleMouseDown = (
236
248
  actionSubject: ACTION_SUBJECT.TABLE,
237
249
  actionSubjectId: null,
238
250
  attributes: {
239
- tableWidth: newResizeState.tableWidth,
251
+ tableWidth: newResizeState.maxSize,
240
252
  newAlignment: ALIGN_CENTER,
241
253
  previousAlignment: ALIGN_START,
242
254
  totalRowCount: totalRowCount,
@@ -247,7 +259,7 @@ export const handleMouseDown = (
247
259
  eventType: EVENT_TYPE.TRACK,
248
260
  })(tr);
249
261
  } else {
250
- tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
262
+ tr.setNodeAttribute(start - 1, 'width', newResizeState.maxSize);
251
263
  }
252
264
  } else {
253
265
  const newResizeState = resizeColumn(
@@ -335,29 +347,29 @@ export const handleMouseDown = (
335
347
  const shouldUseIncreasedScalingPercent =
336
348
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
337
349
  fg('platform.editor.table.use-increased-scaling-percent');
350
+
338
351
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
339
352
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
340
353
  }
341
354
 
355
+ const resizedDelta = clientX - dragging.startX;
356
+
342
357
  if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
343
- resizeColumnAndTable(
358
+ resizeColumnAndTable({
344
359
  resizeState,
345
360
  colIndex,
346
- clientX - dragging.startX,
347
- dom,
348
- table,
349
- undefined,
350
- shouldScale,
351
- undefined,
352
- shouldUseIncreasedScalingPercent,
361
+ amount: resizedDelta,
362
+ tableRef: dom,
363
+ tableNode: originalTable,
364
+ width: editorWidth,
353
365
  lineLength,
354
366
  isTableAlignmentEnabled,
355
- );
367
+ });
356
368
  } else {
357
369
  resizeColumn(
358
370
  resizeState,
359
371
  colIndex,
360
- clientX - dragging.startX,
372
+ resizedDelta,
361
373
  dom,
362
374
  table,
363
375
  undefined,
@@ -6,3 +6,7 @@ export const MAX_SCALING_PERCENT = 0.3;
6
6
  export const MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
7
7
  // Used to calculate the width of a table using the Editor width
8
8
  export const TABLE_EDITOR_MARGIN = 76;
9
+ const COMMENT_AK_EDITOR_CONTENT_AREA_PADDING = 20;
10
+ const COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN = 12;
11
+ export const TABLE_OFFSET_IN_COMMENT_EDITOR =
12
+ 2 * (COMMENT_AK_EDITOR_CONTENT_AREA_PADDING + COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN);
@@ -44,4 +44,5 @@ export {
44
44
  TABLE_DEFAULT_WIDTH,
45
45
  MAX_SCALING_PERCENT,
46
46
  MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION,
47
+ TABLE_OFFSET_IN_COMMENT_EDITOR,
47
48
  } from './consts';
@@ -1,14 +1,19 @@
1
1
  // Resize a given column by an amount from the current state
2
+ import { type EditorContainerWidth } from '@atlaskit/editor-common/types';
2
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
+ import {
5
+ akEditorFullWidthLayoutWidth,
6
+ akEditorGutterPaddingDynamic,
7
+ } from '@atlaskit/editor-shared-styles';
3
8
 
4
- import { type AlignmentOptions, TableCssClassName as ClassName } from '../../../types';
9
+ import { TableCssClassName as ClassName } from '../../../types';
5
10
  import {
6
11
  ALIGN_CENTER,
7
12
  ALIGN_START,
8
13
  shouldChangeAlignmentToCenterResized,
9
14
  } from '../../../utils/alignment';
10
15
 
11
- import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
16
+ import { getTableScalingPercent } from './misc';
12
17
  import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
13
18
  import { updateColgroup } from './resize-state';
14
19
  import type { ResizeState } from './types';
@@ -49,97 +54,164 @@ export const resizeColumn = (
49
54
  return newState;
50
55
  };
51
56
 
52
- // try not scale table during resize
53
- export const resizeColumnAndTable = (
54
- resizeState: ResizeState,
55
- colIndex: number,
56
- amount: number,
57
- tableRef: HTMLElement,
58
- tableNode: PmNode,
59
- selectedColumns?: number[],
60
- isTableScalingEnabled = false,
61
- originalTableWidth?: number,
62
- shouldUseIncreasedScalingPercent = false,
63
- lineLength?: number,
64
- isTableAlignmentEnabled = false,
65
- ): ResizeState => {
66
- // TODO: can we use document state, and apply scaling factor?
67
- const tableWidth = tableRef.clientWidth;
68
- const tableContainerWidth = tableRef.closest('.pm-table-container')?.clientWidth;
69
-
70
- const isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
71
- let resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
72
-
73
- // todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
74
- // let scalePercent = 1;
75
- // if (isTableScalingEnabled) {
76
- // import from ./misc
77
- // scalePercent = getStaticTableScalingPercent(
78
- // tableNode,
79
- // originalTableWidth || resizeState.maxSize,
80
- // );
81
- // resizeAmount = amount / scalePercent;
82
- // }
83
-
84
- // need to look at the resize amount and try to adjust the colgroups
85
- if (isOverflowed) {
57
+ type ResizeInformation = {
58
+ resizeState: ResizeState;
59
+ colIndex: number;
60
+ amount: number;
61
+ };
62
+
63
+ type TableReferences = {
64
+ tableRef: HTMLElement;
65
+ tableNode: PmNode;
66
+ };
67
+
68
+ type TableResizingPluginOptions = {
69
+ isTableAlignmentEnabled?: boolean;
70
+ };
71
+
72
+ type ResizeColumnAndTable = ResizeInformation &
73
+ TableResizingPluginOptions &
74
+ TableReferences &
75
+ EditorContainerWidth;
76
+
77
+ export const resizeColumnAndTable = ({
78
+ resizeState,
79
+ colIndex,
80
+ amount,
81
+ tableRef,
82
+ tableNode,
83
+ lineLength,
84
+ width: editorWidth,
85
+ isTableAlignmentEnabled,
86
+ }: ResizeColumnAndTable): ResizeState => {
87
+ const editorContainerWidth = getEditorContainerWidth(editorWidth);
88
+ const isTableLeftAligned = tableNode.attrs.layout === ALIGN_START;
89
+ let resizeAmount = isTableLeftAligned ? amount : amount * 2;
90
+
91
+ const willTableHitEditorEdge = resizeState.maxSize + resizeAmount > editorContainerWidth;
92
+
93
+ const willResizedTableStayInOverflow =
94
+ resizeState.overflow && resizeState.tableWidth + resizeAmount / 2 > resizeState.maxSize;
95
+
96
+ // STEP 1: Update col width
97
+ if (willTableHitEditorEdge || willResizedTableStayInOverflow) {
98
+ const tableContainerWidth = tableRef.closest('.pm-table-container')?.clientWidth;
86
99
  resizeAmount =
87
100
  amount < 0
88
101
  ? amount
89
- : resizeAmount - (tableNode.attrs.width + resizeAmount - tableContainerWidth) / 2;
102
+ : resizeAmount - (resizeState.maxSize + resizeAmount - tableContainerWidth!) / 2;
90
103
  }
91
104
 
92
- const newState = updateAffectedColumn(resizeState, colIndex, resizeAmount);
105
+ if (!willResizedTableStayInOverflow && !willTableHitEditorEdge) {
106
+ const diff = -(resizeState.tableWidth - resizeState.maxSize);
107
+ const rest = amount - diff;
108
+ const final = isTableLeftAligned ? diff + rest : diff + rest * 2;
109
+ resizeAmount = final;
110
+ }
93
111
 
94
- // this function only updates the colgroup in DOM, it reverses the scalePercent
95
- // todo: change isScalingEnabled to true when reimplementing scaling
96
- updateColgroup(newState, tableRef, tableNode, false, shouldUseIncreasedScalingPercent);
112
+ let newState = updateAffectedColumn(resizeState, colIndex, resizeAmount);
97
113
 
98
- // use the difference in width from affected column to update overall table width
114
+ // STEP 2: Update table container width
115
+ // columns have a min width, so delta !== resizeAmount when this is reached, use this for calculations
99
116
  const delta = newState.cols[colIndex].width - resizeState.cols[colIndex].width;
100
117
 
101
- if (!isOverflowed) {
102
- // If the table is aligned to the start and the table width is greater than the line length, we should change the alignment to center
103
- const shouldChangeAlignment = shouldChangeAlignmentToCenterResized(
104
- isTableAlignmentEnabled,
105
- tableNode,
106
- lineLength,
107
- newState.tableWidth + delta,
108
- );
118
+ newState.maxSize = Math.round(
119
+ resizeState.overflow
120
+ ? willResizedTableStayInOverflow
121
+ ? // CASE 1A: table will stay in overflow
122
+ // do not grow the table because resize is happening in the overflow region
123
+ // and the overall table container needs to be retained
124
+ resizeState.maxSize
125
+ : // CASE 1B: table will no longer be in overflow, so adjust container width
126
+ // ensure the table is resized without any 'big jumps' by working out
127
+ // the difference between the new table width and the max size and adding the resize
128
+ resizeState.maxSize + (resizeState.tableWidth - resizeState.maxSize + delta)
129
+ : willTableHitEditorEdge
130
+ ? // CASE 2: table will hit editor edge
131
+ editorContainerWidth
132
+ : // CASE 3: table is being resized from a non-overflow state
133
+ resizeState.maxSize + delta,
134
+ );
109
135
 
110
- shouldChangeAlignment
111
- ? updateTablePreview(delta, tableRef, tableNode, ALIGN_CENTER)
112
- : updateTablePreview(delta, tableRef, tableNode);
136
+ // do not apply scaling logic because resize state is already scaled
137
+ updateColgroup(newState, tableRef, tableNode, false, false);
138
+
139
+ if (!willTableHitEditorEdge && !willResizedTableStayInOverflow) {
140
+ updateTablePreview(
141
+ tableRef,
142
+ newState.maxSize,
143
+ shouldChangeAlignmentToCenterResized(
144
+ isTableAlignmentEnabled,
145
+ tableNode,
146
+ lineLength,
147
+ newState.maxSize,
148
+ ),
149
+ );
113
150
  }
114
151
 
115
- return {
116
- ...newState,
117
- // resizeState.tableWidth sometimes is off by ~3px on load on resized table when !isOverflowed, using resizeState.maxSize instead
118
- tableWidth: isOverflowed ? tableContainerWidth : resizeState.maxSize + delta,
119
- };
152
+ return newState;
120
153
  };
121
154
 
122
155
  const updateTablePreview = (
123
- resizeAmount: number,
124
- tableRef: HTMLElement | null,
125
- tableNode: PmNode,
126
- tableAligment?: AlignmentOptions,
156
+ tableRef: HTMLElement,
157
+ newTableWidth: number,
158
+ shouldChangeAlignment?: boolean,
127
159
  ) => {
128
- const currentWidth = getTableContainerElementWidth(tableNode);
129
- const resizingContainer = tableRef?.closest(`.${ClassName.TABLE_RESIZER_CONTAINER}`);
160
+ const resizingContainer = tableRef.closest(`.${ClassName.TABLE_RESIZER_CONTAINER}`);
130
161
  const resizingItem = resizingContainer?.querySelector('.resizer-item');
131
162
  const alignmentContainer = resizingContainer?.parentElement;
132
163
 
133
164
  if (resizingItem) {
134
- const newWidth = `${currentWidth + resizeAmount}px`;
135
- if (tableRef) {
136
- tableRef.style.width = newWidth;
137
- }
165
+ const newWidth = `${newTableWidth}px`;
138
166
  (resizingContainer as HTMLElement).style.width = newWidth;
139
167
  (resizingItem as HTMLElement).style.width = newWidth;
140
168
 
141
- if (tableAligment && alignmentContainer) {
142
- alignmentContainer.style.justifyContent = tableAligment;
169
+ if (shouldChangeAlignment && alignmentContainer) {
170
+ alignmentContainer.style.justifyContent = ALIGN_CENTER;
143
171
  }
144
172
  }
145
173
  };
174
+
175
+ const getEditorContainerWidth = (editorWidth: number) =>
176
+ Math.min(editorWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth);
177
+
178
+ /**
179
+ * Apply a scaling factor to resize state
180
+ */
181
+ export const scaleResizeState = ({
182
+ resizeState,
183
+ tableRef,
184
+ tableNode,
185
+ editorWidth,
186
+ }: TableReferences & { resizeState: ResizeState; editorWidth: number }): ResizeState => {
187
+ // check if table is scaled, if not then avoid applying scaling values down
188
+ if (resizeState.maxSize < getEditorContainerWidth(editorWidth)) {
189
+ return resizeState;
190
+ }
191
+
192
+ const scalePercent = getTableScalingPercent(tableNode, tableRef);
193
+ let cols = resizeState.cols.map((col) => ({
194
+ ...col,
195
+ width: Math.round(Math.max(col.width * scalePercent, col.minWidth)),
196
+ }));
197
+
198
+ const scaledTableWidth = Math.round(resizeState.tableWidth * scalePercent);
199
+ const calculatedTableWidth = cols.reduce((prev, curr) => prev + curr.width, 0);
200
+
201
+ // using Math.round can cause the sum of col widths to be larger than the table width
202
+ // distribute the difference to the smallest column
203
+ if (calculatedTableWidth > scaledTableWidth) {
204
+ const diff = calculatedTableWidth - scaledTableWidth;
205
+ cols = cols.map((col) => {
206
+ return col.width - diff >= col.minWidth ? { ...col, width: col.width - diff } : col;
207
+ });
208
+ }
209
+
210
+ return {
211
+ ...resizeState,
212
+ widths: cols.map((col) => col.width),
213
+ tableWidth: scaledTableWidth,
214
+ maxSize: Math.round(resizeState.maxSize * scalePercent),
215
+ cols,
216
+ };
217
+ };
@@ -47,6 +47,7 @@ const createPlugin = (
47
47
  fullWidthEnabled: boolean,
48
48
  isTableScalingEnabled: boolean,
49
49
  isTableAlignmentEnabled: boolean,
50
+ isCommentEditor: boolean,
50
51
  ) => {
51
52
  return new SafePlugin({
52
53
  key: pluginKey,
@@ -158,7 +159,7 @@ const createPlugin = (
158
159
  });
159
160
  }
160
161
 
161
- if (isReplaceDocumentOperation) {
162
+ if (isReplaceDocumentOperation && !isCommentEditor) {
162
163
  newState.doc.forEach((node, offset) => {
163
164
  if (node.type === table) {
164
165
  const width = node.attrs.width;
@@ -23,9 +23,11 @@ export const shouldChangeAlignmentToCenterResized = (
23
23
  lineLength: number | undefined,
24
24
  updatedTableWidth: number,
25
25
  ) =>
26
- isTableAlignmentEnabled &&
27
- tableNode &&
28
- tableNode.attrs.layout === ALIGN_START &&
29
- lineLength &&
30
- updatedTableWidth > lineLength &&
31
- lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH;
26
+ Boolean(
27
+ isTableAlignmentEnabled &&
28
+ tableNode &&
29
+ tableNode.attrs.layout === ALIGN_START &&
30
+ lineLength &&
31
+ updatedTableWidth > lineLength &&
32
+ lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH,
33
+ );