@dangl/angular-material-shared 2.6.2-beta0003 → 2.6.2-beta0016
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/esm2022/guid-generator/dangl-angular-material-shared-guid-generator.mjs +5 -0
- package/esm2022/guid-generator/public_api.mjs +2 -0
- package/esm2022/guid-generator/src/guid-generator.mjs +35 -0
- package/esm2022/lib/components/footer/footer.component.mjs +15 -16
- package/esm2022/lib/components/header/header.component.mjs +14 -9
- package/esm2022/public_api.mjs +1 -3
- package/esm2022/tiny-mce/dangl-angular-material-shared-tiny-mce.mjs +5 -0
- package/esm2022/tiny-mce/public_api.mjs +2 -0
- package/esm2022/tiny-mce/src/tiny-mce.component.mjs +114 -0
- package/fesm2022/dangl-angular-material-shared-guid-generator.mjs +41 -0
- package/fesm2022/dangl-angular-material-shared-guid-generator.mjs.map +1 -0
- package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs +121 -0
- package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs.map +1 -0
- package/fesm2022/dangl-angular-material-shared.mjs +29 -165
- package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
- package/guid-generator/index.d.ts +5 -0
- package/guid-generator/public_api.d.ts +1 -0
- package/package.json +14 -3
- package/public_api.d.ts +0 -2
- package/tiny-mce/index.d.ts +5 -0
- package/tiny-mce/public_api.d.ts +1 -0
- package/{lib/components/tiny-mce → tiny-mce/src}/tiny-mce.component.d.ts +1 -1
- package/tinymce-assets/icons/default/icons.js +0 -4
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/models/dom/model.js +64 -86
- package/tinymce-assets/models/dom/model.min.js +2 -2
- package/tinymce-assets/plugins/accordion/plugin.js +1 -1
- package/tinymce-assets/plugins/accordion/plugin.min.js +1 -1
- package/tinymce-assets/plugins/advlist/plugin.js +2 -2
- package/tinymce-assets/plugins/advlist/plugin.min.js +2 -2
- package/tinymce-assets/plugins/anchor/plugin.js +1 -1
- package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +1 -1
- package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autosave/plugin.js +1 -1
- package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
- package/tinymce-assets/plugins/charmap/plugin.js +1 -1
- package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
- package/tinymce-assets/plugins/code/plugin.js +1 -1
- package/tinymce-assets/plugins/code/plugin.min.js +1 -1
- package/tinymce-assets/plugins/codesample/plugin.js +1 -1
- package/tinymce-assets/plugins/codesample/plugin.min.js +1 -1
- package/tinymce-assets/plugins/directionality/plugin.js +1 -1
- package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +1 -2
- package/tinymce-assets/plugins/emoticons/plugin.min.js +2 -2
- package/tinymce-assets/plugins/fullscreen/plugin.js +2 -3
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
- package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -2
- package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +1 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -1
- package/tinymce-assets/plugins/help/plugin.js +43 -53
- package/tinymce-assets/plugins/help/plugin.min.js +2 -2
- package/tinymce-assets/plugins/image/plugin.js +1 -1
- package/tinymce-assets/plugins/image/plugin.min.js +1 -1
- package/tinymce-assets/plugins/importcss/plugin.js +1 -1
- package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +1 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -1
- package/tinymce-assets/plugins/link/plugin.js +3 -4
- package/tinymce-assets/plugins/link/plugin.min.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.js +3 -4
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
- package/tinymce-assets/plugins/media/plugin.js +2 -2
- package/tinymce-assets/plugins/media/plugin.min.js +2 -2
- package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
- package/tinymce-assets/plugins/preview/plugin.js +1 -1
- package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/save/plugin.js +2 -3
- package/tinymce-assets/plugins/save/plugin.min.js +2 -2
- package/tinymce-assets/plugins/searchreplace/plugin.js +2 -3
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +2 -2
- package/tinymce-assets/plugins/table/plugin.js +48 -51
- package/tinymce-assets/plugins/table/plugin.min.js +2 -2
- package/tinymce-assets/plugins/template/index.js +7 -0
- package/tinymce-assets/plugins/template/plugin.js +567 -0
- package/tinymce-assets/plugins/template/plugin.min.js +4 -0
- package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +63 -392
- package/tinymce-assets/skins/ui/oxide/skin.js +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +66 -395
- package/tinymce-assets/skins/ui/oxide-dark/skin.js +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.css +41 -369
- package/tinymce-assets/skins/ui/tinymce-5/skin.js +1 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +46 -374
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +1 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/tinymce-assets/themes/silver/theme.js +302 -661
- package/tinymce-assets/themes/silver/theme.min.js +2 -2
- package/esm2022/lib/components/tiny-mce/tiny-mce.component.mjs +0 -107
- package/esm2022/lib/utils/guid-generator.mjs +0 -36
- /package/{lib/utils → guid-generator/src}/guid-generator.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 6.8.3 (2024-02-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -879,14 +879,7 @@
|
|
|
879
879
|
const bindFrom = (a, f) => a !== undefined && a !== null ? f(a) : Optional.none();
|
|
880
880
|
const someIf = (b, a) => b ? Optional.some(a) : Optional.none();
|
|
881
881
|
|
|
882
|
-
const removeFromStart = (str, numChars) => {
|
|
883
|
-
return str.substring(numChars);
|
|
884
|
-
};
|
|
885
|
-
|
|
886
882
|
const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
|
|
887
|
-
const removeLeading = (str, prefix) => {
|
|
888
|
-
return startsWith(str, prefix) ? removeFromStart(str, prefix.length) : str;
|
|
889
|
-
};
|
|
890
883
|
const contains = (str, substr, start = 0, end) => {
|
|
891
884
|
const idx = str.indexOf(substr, start);
|
|
892
885
|
if (idx !== -1) {
|
|
@@ -1842,7 +1835,6 @@
|
|
|
1842
1835
|
const rPercentageBasedSizeRegex = /(\d+(\.\d+)?)%/;
|
|
1843
1836
|
const rPixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/;
|
|
1844
1837
|
const isCol$2 = isTag('col');
|
|
1845
|
-
const isRow$2 = isTag('tr');
|
|
1846
1838
|
const getPercentSize = (elm, outerGetter, innerGetter) => {
|
|
1847
1839
|
const relativeParent = parentElement(elm).getOrThunk(() => getBody$1(owner(elm)));
|
|
1848
1840
|
return outerGetter(elm) / innerGetter(relativeParent) * 100;
|
|
@@ -1856,9 +1848,6 @@
|
|
|
1856
1848
|
const setHeight = (cell, amount) => {
|
|
1857
1849
|
set$1(cell, 'height', amount + 'px');
|
|
1858
1850
|
};
|
|
1859
|
-
const removeHeight = cell => {
|
|
1860
|
-
remove$5(cell, 'height');
|
|
1861
|
-
};
|
|
1862
1851
|
const getHeightValue = cell => getRuntime(cell) + 'px';
|
|
1863
1852
|
const convert = (cell, number, getter, setter) => {
|
|
1864
1853
|
const newSize = table(cell).map(table => {
|
|
@@ -1890,11 +1879,11 @@
|
|
|
1890
1879
|
});
|
|
1891
1880
|
};
|
|
1892
1881
|
const getRawWidth$1 = element => getRaw$1(element, 'width');
|
|
1893
|
-
const getRawHeight
|
|
1882
|
+
const getRawHeight = element => getRaw$1(element, 'height');
|
|
1894
1883
|
const getPercentageWidth = cell => getPercentSize(cell, get$9, getInner);
|
|
1895
1884
|
const getPixelWidth$1 = cell => isCol$2(cell) ? get$9(cell) : getRuntime$1(cell);
|
|
1896
1885
|
const getHeight = cell => {
|
|
1897
|
-
return
|
|
1886
|
+
return get$7(cell, 'rowspan', getTotalHeight);
|
|
1898
1887
|
};
|
|
1899
1888
|
const getGenericWidth = cell => {
|
|
1900
1889
|
const width = getRawWidth$1(cell);
|
|
@@ -1908,7 +1897,6 @@
|
|
|
1908
1897
|
set$1(cell, 'width', amount + unit);
|
|
1909
1898
|
};
|
|
1910
1899
|
const getPixelTableWidth = table => get$9(table) + 'px';
|
|
1911
|
-
const getPixelTableHeight = table => get$8(table) + 'px';
|
|
1912
1900
|
const getPercentTableWidth = table => getPercentSize(table, get$9, getInner) + '%';
|
|
1913
1901
|
const isPercentSizing$1 = table => getRawWidth$1(table).exists(size => rPercentageBasedSizeRegex.test(size));
|
|
1914
1902
|
const isPixelSizing$1 = table => getRawWidth$1(table).exists(size => rPixelBasedSizeRegex.test(size));
|
|
@@ -1920,7 +1908,7 @@
|
|
|
1920
1908
|
return getRawWidth$1(cell).getOrThunk(() => getPixelWidth$1(cell) + 'px');
|
|
1921
1909
|
};
|
|
1922
1910
|
const getRawH = cell => {
|
|
1923
|
-
return getRawHeight
|
|
1911
|
+
return getRawHeight(cell).getOrThunk(() => getHeight(cell) + 'px');
|
|
1924
1912
|
};
|
|
1925
1913
|
const justCols = warehouse => map$1(Warehouse.justColumns(warehouse), column => Optional.from(column.element));
|
|
1926
1914
|
const isValidColumn = cell => {
|
|
@@ -1967,19 +1955,20 @@
|
|
|
1967
1955
|
return deduced.getOrThunk(tableSize.minCellWidth);
|
|
1968
1956
|
});
|
|
1969
1957
|
};
|
|
1970
|
-
const getHeightFrom = (warehouse, table, getHeight, fallback) => {
|
|
1971
|
-
const
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
|
|
1958
|
+
const getHeightFrom = (warehouse, table, direction, getHeight, fallback) => {
|
|
1959
|
+
const rows$1 = rows(warehouse);
|
|
1960
|
+
const backups = [Optional.some(direction.edge(table))].concat(map$1(direction.positions(rows$1, table), pos => pos.map(p => p.y)));
|
|
1961
|
+
return map$1(rows$1, (cellOption, c) => {
|
|
1962
|
+
return getDimension(cellOption, c, backups, not(hasRowspan), getHeight, fallback);
|
|
1963
|
+
});
|
|
1975
1964
|
};
|
|
1976
|
-
const getPixelHeights = (warehouse, table) => {
|
|
1977
|
-
return getHeightFrom(warehouse, table, getHeight, deduced => {
|
|
1965
|
+
const getPixelHeights = (warehouse, table, direction) => {
|
|
1966
|
+
return getHeightFrom(warehouse, table, direction, getHeight, deduced => {
|
|
1978
1967
|
return deduced.getOrThunk(minHeight);
|
|
1979
1968
|
});
|
|
1980
1969
|
};
|
|
1981
|
-
const getRawHeights = (warehouse, table) => {
|
|
1982
|
-
return getHeightFrom(warehouse, table, getRawH, getDeduced);
|
|
1970
|
+
const getRawHeights = (warehouse, table, direction) => {
|
|
1971
|
+
return getHeightFrom(warehouse, table, direction, getRawH, getDeduced);
|
|
1983
1972
|
};
|
|
1984
1973
|
|
|
1985
1974
|
const widthLookup = (table, getter) => () => {
|
|
@@ -2523,12 +2512,10 @@
|
|
|
2523
2512
|
const getSelectionStart = editor => SugarElement.fromDom(editor.selection.getStart());
|
|
2524
2513
|
const getPixelWidth = elm => elm.getBoundingClientRect().width;
|
|
2525
2514
|
const getPixelHeight = elm => elm.getBoundingClientRect().height;
|
|
2526
|
-
const
|
|
2527
|
-
const raw = editor.dom.getStyle(elm,
|
|
2515
|
+
const getRawWidth = (editor, elm) => {
|
|
2516
|
+
const raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width');
|
|
2528
2517
|
return Optional.from(raw).filter(isNotEmpty);
|
|
2529
2518
|
};
|
|
2530
|
-
const getRawWidth = getRawValue('width');
|
|
2531
|
-
const getRawHeight = getRawValue('height');
|
|
2532
2519
|
const isPercentage$1 = value => /^(\d+(\.\d+)?)%$/.test(value);
|
|
2533
2520
|
const isPixel = value => /^(\d+(\.\d+)?)px$/.test(value);
|
|
2534
2521
|
const isInEditableContext$1 = cell => closest$2(cell, isTag('table')).exists(isEditable$1);
|
|
@@ -4170,6 +4157,17 @@
|
|
|
4170
4157
|
colspan: column.colspan
|
|
4171
4158
|
}));
|
|
4172
4159
|
};
|
|
4160
|
+
const recalculateHeightForCells = (warehouse, heights) => {
|
|
4161
|
+
const all = Warehouse.justCells(warehouse);
|
|
4162
|
+
return map$1(all, cell => {
|
|
4163
|
+
const height = total(cell.row, cell.row + cell.rowspan, heights);
|
|
4164
|
+
return {
|
|
4165
|
+
element: cell.element,
|
|
4166
|
+
height,
|
|
4167
|
+
rowspan: cell.rowspan
|
|
4168
|
+
};
|
|
4169
|
+
});
|
|
4170
|
+
};
|
|
4173
4171
|
const matchRowHeight = (warehouse, heights) => {
|
|
4174
4172
|
return map$1(warehouse.all, (row, i) => {
|
|
4175
4173
|
return {
|
|
@@ -4204,16 +4202,17 @@
|
|
|
4204
4202
|
recalculateAndApply(warehouse, newWidths, tableSize);
|
|
4205
4203
|
resizing.resizeTable(tableSize.adjustTableWidth, clampedStep, isLastColumn);
|
|
4206
4204
|
};
|
|
4207
|
-
const adjustHeight = (table, delta, index) => {
|
|
4205
|
+
const adjustHeight = (table, delta, index, direction) => {
|
|
4208
4206
|
const warehouse = Warehouse.fromTable(table);
|
|
4209
|
-
const heights = getPixelHeights(warehouse, table);
|
|
4207
|
+
const heights = getPixelHeights(warehouse, table, direction);
|
|
4210
4208
|
const newHeights = map$1(heights, (dy, i) => index === i ? Math.max(delta + dy, minHeight()) : dy);
|
|
4209
|
+
const newCellSizes = recalculateHeightForCells(warehouse, newHeights);
|
|
4211
4210
|
const newRowSizes = matchRowHeight(warehouse, newHeights);
|
|
4212
4211
|
each$2(newRowSizes, row => {
|
|
4213
4212
|
setHeight(row.element, row.height);
|
|
4214
4213
|
});
|
|
4215
|
-
each$2(
|
|
4216
|
-
|
|
4214
|
+
each$2(newCellSizes, cell => {
|
|
4215
|
+
setHeight(cell.element, cell.height);
|
|
4217
4216
|
});
|
|
4218
4217
|
const total = sumUp(newHeights);
|
|
4219
4218
|
setHeight(table, total);
|
|
@@ -4582,7 +4581,7 @@
|
|
|
4582
4581
|
const opEraseRows = (grid, details, _comparator, _genWrappers) => {
|
|
4583
4582
|
const rows = uniqueRows(details);
|
|
4584
4583
|
const newGrid = deleteRowsAt(grid, rows[0].row, rows[rows.length - 1].row);
|
|
4585
|
-
const maxRowIndex =
|
|
4584
|
+
const maxRowIndex = newGrid.length > 0 ? newGrid.length - 1 : 0;
|
|
4586
4585
|
return bundle(newGrid, Math.min(details[0].row, maxRowIndex), details[0].column);
|
|
4587
4586
|
};
|
|
4588
4587
|
const opMergeCells = (grid, mergable, comparator, genWrappers) => {
|
|
@@ -4627,7 +4626,7 @@
|
|
|
4627
4626
|
const context = rows[pasteDetails.cells[0].row];
|
|
4628
4627
|
const gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);
|
|
4629
4628
|
const mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator);
|
|
4630
|
-
return bundle(mergedGrid, pasteDetails.cells[0].row,
|
|
4629
|
+
return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);
|
|
4631
4630
|
};
|
|
4632
4631
|
const opPasteRowsBefore = (grid, pasteDetails, comparator, _genWrappers) => {
|
|
4633
4632
|
const rows = extractGridDetails(grid).rows;
|
|
@@ -4643,7 +4642,7 @@
|
|
|
4643
4642
|
const context = rows[pasteDetails.cells[0].row];
|
|
4644
4643
|
const gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);
|
|
4645
4644
|
const mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator);
|
|
4646
|
-
return bundle(mergedGrid,
|
|
4645
|
+
return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);
|
|
4647
4646
|
};
|
|
4648
4647
|
const opGetColumnsType = (table, target) => {
|
|
4649
4648
|
const house = Warehouse.fromTable(table);
|
|
@@ -5111,9 +5110,11 @@
|
|
|
5111
5110
|
set$1(column.element, 'width', width + unit);
|
|
5112
5111
|
});
|
|
5113
5112
|
};
|
|
5114
|
-
const redistributeToH = (newHeights, rows, cells) => {
|
|
5113
|
+
const redistributeToH = (newHeights, rows, cells, unit) => {
|
|
5115
5114
|
each$2(cells, cell => {
|
|
5116
|
-
|
|
5115
|
+
const heights = newHeights.slice(cell.row, cell.rowspan + cell.row);
|
|
5116
|
+
const h = sum(heights, minHeight());
|
|
5117
|
+
set$1(cell.element, 'height', h + unit);
|
|
5117
5118
|
});
|
|
5118
5119
|
each$2(rows, (row, i) => {
|
|
5119
5120
|
set$1(row.element, 'height', newHeights[i]);
|
|
@@ -5140,10 +5141,11 @@
|
|
|
5140
5141
|
set$1(table, 'width', newWidth);
|
|
5141
5142
|
});
|
|
5142
5143
|
optHeight.each(newHeight => {
|
|
5144
|
+
const hUnit = getUnit(newHeight);
|
|
5143
5145
|
const totalHeight = get$8(table);
|
|
5144
|
-
const oldHeights = getRawHeights(warehouse, table);
|
|
5146
|
+
const oldHeights = getRawHeights(warehouse, table, height);
|
|
5145
5147
|
const nuHeights = redistribute$1(oldHeights, totalHeight, newHeight);
|
|
5146
|
-
redistributeToH(nuHeights, rows, cells);
|
|
5148
|
+
redistributeToH(nuHeights, rows, cells, hUnit);
|
|
5147
5149
|
set$1(table, 'height', newHeight);
|
|
5148
5150
|
});
|
|
5149
5151
|
};
|
|
@@ -5153,24 +5155,18 @@
|
|
|
5153
5155
|
|
|
5154
5156
|
const cleanupLegacyAttributes = element => {
|
|
5155
5157
|
remove$7(element, 'width');
|
|
5156
|
-
remove$7(element, 'height');
|
|
5157
5158
|
};
|
|
5158
|
-
const
|
|
5159
|
+
const convertToPercentSize = table => {
|
|
5159
5160
|
const newWidth = getPercentTableWidth(table);
|
|
5160
5161
|
redistribute(table, Optional.some(newWidth), Optional.none());
|
|
5161
5162
|
cleanupLegacyAttributes(table);
|
|
5162
5163
|
};
|
|
5163
|
-
const
|
|
5164
|
+
const convertToPixelSize = table => {
|
|
5164
5165
|
const newWidth = getPixelTableWidth(table);
|
|
5165
5166
|
redistribute(table, Optional.some(newWidth), Optional.none());
|
|
5166
5167
|
cleanupLegacyAttributes(table);
|
|
5167
5168
|
};
|
|
5168
|
-
const
|
|
5169
|
-
const newHeight = getPixelTableHeight(table);
|
|
5170
|
-
redistribute(table, Optional.none(), Optional.some(newHeight));
|
|
5171
|
-
cleanupLegacyAttributes(table);
|
|
5172
|
-
};
|
|
5173
|
-
const convertToNoneSizeWidth = table => {
|
|
5169
|
+
const convertToNoneSize = table => {
|
|
5174
5170
|
remove$5(table, 'width');
|
|
5175
5171
|
const columns = columns$1(table);
|
|
5176
5172
|
const rowElements = columns.length > 0 ? columns : cells$1(table);
|
|
@@ -5278,11 +5274,11 @@
|
|
|
5278
5274
|
});
|
|
5279
5275
|
return descendant(getBody(editor), 'table[data-mce-id="__mce"]').map(table => {
|
|
5280
5276
|
if (isTablePixelsForced(editor)) {
|
|
5281
|
-
|
|
5277
|
+
convertToPixelSize(table);
|
|
5282
5278
|
} else if (isTableResponsiveForced(editor)) {
|
|
5283
|
-
|
|
5279
|
+
convertToNoneSize(table);
|
|
5284
5280
|
} else if (isTablePercentagesForced(editor) || isPercentage(defaultStyles.width)) {
|
|
5285
|
-
|
|
5281
|
+
convertToPercentSize(table);
|
|
5286
5282
|
}
|
|
5287
5283
|
removeDataStyle(table);
|
|
5288
5284
|
remove$7(table, 'data-mce-id');
|
|
@@ -5359,11 +5355,11 @@
|
|
|
5359
5355
|
if (!isForcedSizing) {
|
|
5360
5356
|
table(cellOrCaption, isRoot).each(table => {
|
|
5361
5357
|
if (sizing === 'relative' && !isPercentSizing(table)) {
|
|
5362
|
-
|
|
5358
|
+
convertToPercentSize(table);
|
|
5363
5359
|
} else if (sizing === 'fixed' && !isPixelSizing(table)) {
|
|
5364
|
-
|
|
5360
|
+
convertToPixelSize(table);
|
|
5365
5361
|
} else if (sizing === 'responsive' && !isNoneSizing(table)) {
|
|
5366
|
-
|
|
5362
|
+
convertToNoneSize(table);
|
|
5367
5363
|
}
|
|
5368
5364
|
removeDataStyle(table);
|
|
5369
5365
|
fireTableModified(editor, table.dom, structureModified);
|
|
@@ -6999,12 +6995,11 @@
|
|
|
6999
6995
|
const onSelection = (cells, start, finish) => {
|
|
7000
6996
|
const tableOpt = table(start);
|
|
7001
6997
|
tableOpt.each(table => {
|
|
7002
|
-
const cellsDom = map$1(cells, cell => cell.dom);
|
|
7003
6998
|
const cloneFormats = getTableCloneElements(editor);
|
|
7004
6999
|
const generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), cloneFormats);
|
|
7005
7000
|
const selectedCells = getCellsFromSelection(editor);
|
|
7006
|
-
const
|
|
7007
|
-
fireTableSelectionChange(editor,
|
|
7001
|
+
const otherCells = getOtherCells(table, { selection: selectedCells }, generators);
|
|
7002
|
+
fireTableSelectionChange(editor, cells, start, finish, otherCells);
|
|
7008
7003
|
});
|
|
7009
7004
|
};
|
|
7010
7005
|
const onClear = () => fireTableSelectionClear(editor);
|
|
@@ -7790,7 +7785,7 @@
|
|
|
7790
7785
|
const table = event.table;
|
|
7791
7786
|
events.trigger.beforeResize(table, 'row');
|
|
7792
7787
|
const delta = hdirection.delta(event.delta, table);
|
|
7793
|
-
adjustHeight(table, delta, event.row);
|
|
7788
|
+
adjustHeight(table, delta, event.row, hdirection);
|
|
7794
7789
|
events.trigger.afterResize(table, 'row');
|
|
7795
7790
|
});
|
|
7796
7791
|
manager.events.startAdjust.bind(_event => {
|
|
@@ -7873,7 +7868,7 @@
|
|
|
7873
7868
|
const isTable = node => isNonNullable(node) && node.nodeName === 'TABLE';
|
|
7874
7869
|
const barResizerPrefix = 'bar-';
|
|
7875
7870
|
const isResizable = elm => get$b(elm, 'data-mce-resize') !== 'false';
|
|
7876
|
-
const
|
|
7871
|
+
const syncPixels = table => {
|
|
7877
7872
|
const warehouse = Warehouse.fromTable(table);
|
|
7878
7873
|
if (!Warehouse.hasColumns(warehouse)) {
|
|
7879
7874
|
each$2(cells$1(table), cell => {
|
|
@@ -7883,29 +7878,19 @@
|
|
|
7883
7878
|
});
|
|
7884
7879
|
}
|
|
7885
7880
|
};
|
|
7886
|
-
const isCornerResize = origin => startsWith(origin, 'corner-');
|
|
7887
|
-
const getCornerLocation = origin => removeLeading(origin, 'corner-');
|
|
7888
7881
|
const TableResizeHandler = editor => {
|
|
7889
7882
|
const selectionRng = value();
|
|
7890
7883
|
const tableResize = value();
|
|
7891
7884
|
const resizeWire = value();
|
|
7892
7885
|
let startW;
|
|
7893
7886
|
let startRawW;
|
|
7894
|
-
let startH;
|
|
7895
|
-
let startRawH;
|
|
7896
7887
|
const lazySizing = table => get$5(editor, table);
|
|
7897
7888
|
const lazyResizingBehaviour = () => isPreserveTableColumnResizing(editor) ? preserveTable() : resizeTable();
|
|
7898
7889
|
const getNumColumns = table => getGridSize(table).columns;
|
|
7899
|
-
const
|
|
7900
|
-
|
|
7901
|
-
const location = getCornerLocation(origin);
|
|
7902
|
-
const isRightEdgeResize = endsWith(location, 'e');
|
|
7903
|
-
const isNorthEdgeResize = startsWith(location, 'n');
|
|
7890
|
+
const afterCornerResize = (table, origin, width) => {
|
|
7891
|
+
const isRightEdgeResize = endsWith(origin, 'e');
|
|
7904
7892
|
if (startRawW === '') {
|
|
7905
|
-
|
|
7906
|
-
}
|
|
7907
|
-
if (startRawH === '') {
|
|
7908
|
-
convertToPixelSizeHeight(table);
|
|
7893
|
+
convertToPercentSize(table);
|
|
7909
7894
|
}
|
|
7910
7895
|
if (width !== startW && startRawW !== '') {
|
|
7911
7896
|
set$1(table, 'width', startRawW);
|
|
@@ -7919,12 +7904,7 @@
|
|
|
7919
7904
|
set$1(table, 'width', targetPercentW + '%');
|
|
7920
7905
|
}
|
|
7921
7906
|
if (isPixel(startRawW)) {
|
|
7922
|
-
|
|
7923
|
-
}
|
|
7924
|
-
if (height !== startH && startRawH !== '') {
|
|
7925
|
-
set$1(table, 'height', startRawH);
|
|
7926
|
-
const idx = isNorthEdgeResize ? 0 : getNumRows(table) - 1;
|
|
7927
|
-
adjustHeight(table, height - startH, idx);
|
|
7907
|
+
syncPixels(table);
|
|
7928
7908
|
}
|
|
7929
7909
|
};
|
|
7930
7910
|
const destroy = () => {
|
|
@@ -7971,17 +7951,15 @@
|
|
|
7971
7951
|
editor.dom.addClass(clone, 'mce-' + getTableColumnResizingBehaviour(editor) + '-columns');
|
|
7972
7952
|
});
|
|
7973
7953
|
if (!isPixelSizing(table) && isTablePixelsForced(editor)) {
|
|
7974
|
-
|
|
7954
|
+
convertToPixelSize(table);
|
|
7975
7955
|
} else if (!isPercentSizing(table) && isTablePercentagesForced(editor)) {
|
|
7976
|
-
|
|
7956
|
+
convertToPercentSize(table);
|
|
7977
7957
|
}
|
|
7978
7958
|
if (isNoneSizing(table) && startsWith(e.origin, barResizerPrefix)) {
|
|
7979
|
-
|
|
7959
|
+
convertToPercentSize(table);
|
|
7980
7960
|
}
|
|
7981
7961
|
startW = e.width;
|
|
7982
7962
|
startRawW = isTableResponsiveForced(editor) ? '' : getRawWidth(editor, targetElm).getOr('');
|
|
7983
|
-
startH = e.height;
|
|
7984
|
-
startRawH = getRawHeight(editor, targetElm).getOr('');
|
|
7985
7963
|
}
|
|
7986
7964
|
});
|
|
7987
7965
|
editor.on('ObjectResized', e => {
|
|
@@ -7989,8 +7967,8 @@
|
|
|
7989
7967
|
if (isTable(targetElm)) {
|
|
7990
7968
|
const table = SugarElement.fromDom(targetElm);
|
|
7991
7969
|
const origin = e.origin;
|
|
7992
|
-
if (
|
|
7993
|
-
afterCornerResize(table, origin, e.width
|
|
7970
|
+
if (startsWith(origin, 'corner-')) {
|
|
7971
|
+
afterCornerResize(table, origin, e.width);
|
|
7994
7972
|
}
|
|
7995
7973
|
removeDataStyle(table);
|
|
7996
7974
|
fireTableModified(editor, table.dom, styleModified);
|