Skip to content

Commit

Permalink
Merge branch 'release/v8.3.0' into feature/rtl
Browse files Browse the repository at this point in the history
# Conflicts:
#	cell/view/WorksheetView.js
  • Loading branch information
GoshaZotov committed Dec 11, 2024
2 parents 47f402a + 33d3931 commit cace6fd
Show file tree
Hide file tree
Showing 193 changed files with 53,358 additions and 32,986 deletions.
1 change: 1 addition & 0 deletions .github/workflows/common_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/correctBadTable.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/flowTablePosition.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/pageBreak.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/table-flow.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/table-header.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/textShaper/textShaper.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/text-hyphenator/text-hyphenator.html 30000 "--no-sandbox"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
node-qunit-puppeteer tests/word/document-calculation/table/correctBadTable.html
node-qunit-puppeteer tests/word/document-calculation/table/flowTablePosition.html
node-qunit-puppeteer tests/word/document-calculation/table/pageBreak.html
node-qunit-puppeteer tests/word/document-calculation/table/table-flow.html
node-qunit-puppeteer tests/word/document-calculation/table/table-header.html
node-qunit-puppeteer tests/word/document-calculation/textShaper/textShaper.html
node-qunit-puppeteer tests/word/document-calculation/text-hyphenator/text-hyphenator.html
node-qunit-puppeteer tests/word/forms/forms.html
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ package-lock.json
*/node_modules
*/package-lock.json
connector
tests/package*
31 changes: 29 additions & 2 deletions build/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = function(grunt) {
this.word = null;
this.cell = null;
this.slide = null;
this.visio = null;

this.append(pathConfigs);
}
Expand Down Expand Up @@ -132,9 +133,10 @@ module.exports = function(grunt) {
appendOption.call(this, 'word');
appendOption.call(this, 'cell');
appendOption.call(this, 'slide');
appendOption.call(this, 'visio');
};
CConfig.prototype.valid = function () {
return this.externs && this.word && this.cell && this.slide;
return this.externs && this.word && this.cell && this.slide && this.visio;
};

function getExterns(config) {
Expand Down Expand Up @@ -176,6 +178,7 @@ module.exports = function(grunt) {
const word = path.join(deploy, 'word');
const cell = path.join(deploy, 'cell');
const slide = path.join(deploy, 'slide');
const visio = path.join(deploy, 'visio');

const level = grunt.option('level') || 'ADVANCED';
const formatting = grunt.option('formatting') || '';
Expand Down Expand Up @@ -237,6 +240,7 @@ module.exports = function(grunt) {
const configWord = configs.word['sdk'];
const configCell = configs.cell['sdk'];
const configSlide = configs.slide['sdk'];
const configVisio = configs.visio['sdk'];

const compilerArgs = getExterns(configs.externs);
if (formatting) {
Expand Down Expand Up @@ -302,6 +306,10 @@ module.exports = function(grunt) {
grunt.initConfig(getCompileConfig(getFilesMin(configSlide), getFilesAll(configSlide), 'sdk-all-min', 'sdk-all', 'slide', path.join(slide , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('compile-visio', 'Compile Visio SDK', function () {
grunt.initConfig(getCompileConfig(getFilesMin(configVisio), getFilesAll(configVisio), 'sdk-all-min', 'sdk-all', 'visio', path.join(visio , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('copy-maps', 'Copy maps from deploy to build', function() {
grunt.initConfig({
copy: {
Expand Down Expand Up @@ -352,6 +360,22 @@ module.exports = function(grunt) {
}
}
]
},
visio: {
files: [
{
expand: true,
cwd: visio,
src: [
'sdk-all-min.js.map',
'sdk-all.js.map',
],
dest: 'maps',
rename: function (dest, src) {
return path.join(dest , src.replace('sdk', 'visio'));
}
}
]
}
},
clean: {
Expand All @@ -366,13 +390,15 @@ module.exports = function(grunt) {
path.join(cell, 'sdk-all.js.map'),
path.join(slide, 'sdk-all-min.js.map'),
path.join(slide, 'sdk-all.js.map'),
path.join(visio, 'sdk-all-min.js.map'),
path.join(visio, 'sdk-all.js.map'),
]
}
}
});
grunt.task.run('copy', 'clean');
});
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide']);
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide', 'compile-visio']);
grunt.registerTask('clean-deploy', 'Clean deploy folder before deploying', function () {
grunt.initConfig({
clean: {
Expand Down Expand Up @@ -491,6 +517,7 @@ module.exports = function(grunt) {
writeScripts(configs.word['sdk'], 'word');
writeScripts(configs.cell['sdk'], 'cell');
writeScripts(configs.slide['sdk'], 'slide');
writeScripts(configs.visio['sdk'], 'visio');
});
const defaultTasks = ['clean-deploy', 'compile-sdk', 'copy-other'];
if (grunt.option('map')) {
Expand Down
79 changes: 70 additions & 9 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var editor;

this.asyncMethodCallback = undefined;

this.IsInitControl = false;//single canvas creation
// Переменная отвечает, загрузились ли фонты
this.FontLoadWaitComplete = false;
//текущий обьект куда записываются информация для update, когда принимаются изменения в native редакторе
Expand Down Expand Up @@ -979,9 +980,9 @@ var editor;
}
};

spreadsheet_api.prototype.asc_addAutoFilter = function(styleName, addFormatTableOptionsObj) {
spreadsheet_api.prototype.asc_addAutoFilter = function(styleName, addFormatTableOptionsObj, range) {
var ws = this.wb.getWorksheet();
return ws.addAutoFilter(styleName, addFormatTableOptionsObj);
return ws.addAutoFilter(styleName, addFormatTableOptionsObj, range);
};

spreadsheet_api.prototype.asc_changeAutoFilter = function(tableName, optionType, val) {
Expand Down Expand Up @@ -1739,6 +1740,7 @@ var editor;
this.openingEnd = {bin: false, xlsxStart: false, xlsx: false, data: null};
this.isApplyChangesOnOpenEnabled = true;
this.isDocumentLoadComplete = false;
this.FontLoadWaitComplete = false;
this.turnOffSpecialModes();

//удаляю весь handlersList, добавленный при инициализации wbView
Expand Down Expand Up @@ -3226,6 +3228,27 @@ var editor;
previousVersionZoom = this.wb && this.wb.getZoom();
}

if (!this.IsInitControl) {
// todo Create HtmlPage like other editors
// add style
let _head = document.getElementsByTagName('head')[0];
let style0 = document.createElement('style');
style0.type = 'text/css';
style0.innerHTML = ".block_elem { position:absolute;padding:0;margin:0; }";
_head.appendChild(style0);

this.HtmlElement.innerHTML = '<div id="ws-canvas-outer">\
<canvas id="ws-canvas" style="touch-action:none;-ms-touch-action: none;-webkit-user-select: none;"></canvas>\
<canvas id="ws-canvas-overlay" style="touch-action:none;-ms-touch-action: none;-webkit-user-select: none;"></canvas>\
<canvas id="ws-canvas-graphic" style="touch-action:none;-ms-touch-action: none;-webkit-user-select: none;"></canvas>\
<canvas id="ws-canvas-graphic-overlay" style="touch-action:none;-ms-touch-action: none;-webkit-user-select: none;"></canvas>\
<div id="id_target_cursor" class="block_elem" width="1" height="1"\
style="width:2px;height:13px;display:none;z-index:9;"></div>\
</div>';

this.IsInitControl = true;
}

this.wb = new AscCommonExcel.WorkbookView(this.wbModel, this.controller, this.handlers, this.HtmlElement,
this.topLineEditorElement, this, this.collaborativeEditing, this.fontRenderingMode);

Expand All @@ -3242,7 +3265,7 @@ var editor;
}
}

if (this.isMobileVersion) {
if (this.isUseOldMobileVersion()) {
this.wb.defaults.worksheetView.halfSelection = true;
this.wb.defaults.worksheetView.activeCellBorderColor = new CColor(79, 158, 79);
var _container = document.getElementById(this.HtmlElementName);
Expand All @@ -3258,11 +3281,14 @@ var editor;

if ((typeof AscCommonExcel.CMobileTouchManager) !== "undefined")
{
this.wb.MobileTouchManager = new AscCommonExcel.CMobileTouchManager({eventsElement: "cell_mobile_element", desktopMode : !this.isMobileVersion});
this.wb.MobileTouchManager = new AscCommonExcel.CMobileTouchManager({eventsElement: "cell_mobile_element", desktopMode : !this.isUseOldMobileVersion()});
this.wb.MobileTouchManager.Init(this);

if (this.isMobileVersion)
if (this.isUseOldMobileVersion())
this.wb.MobileTouchManager.initEvents(AscCommon.g_inputContext.HtmlArea.id);

if (this.controller)
this.wb.MobileTouchManager.addClickElement([this.controller.element]);
}

this.asc_CheckGuiControlColors();
Expand Down Expand Up @@ -3294,13 +3320,15 @@ var editor;
if (previousVersionZoom) {
this.asc_setZoom(previousVersionZoom);
}
this.asc_Resize();
}

if (this.canEdit() && this.asc_getExternalReferences()) {
this.handlers.trigger("asc_onNeedUpdateExternalReferenceOnOpen");
}
//this.asc_Resize(); // Убрал, т.к. сверху приходит resize (http://bugzilla.onlyoffice.com/show_bug.cgi?id=14680)
this.onUpdateDocumentModified(this.isDocumentModified());//line moved from onDocumentContentReady
//раньше вызов был закомментирован, потому при при открытии вызывается в Viewport.js(asc_Resize) и Main.js(asc_showComments)
//но рассчитывать на внешние вызовы ненадежно и вызовов нет при VersionHistory и refreshFile
this.asc_Resize();

this.initBroadcastChannel();
this.initBroadcastChannelListeners();
Expand Down Expand Up @@ -4599,7 +4627,7 @@ var editor;
} else {
const oOleSize = oThis.wbModel.getOleSize().getLast();
if (oOleSize) {
oRangeSizes = oWorksheet.getRangePosition(oOleSize);
oRangeSizes = oWorksheet.getPrintOleRangePosition(oOleSize);
}
}
if (oRangeSizes.width && oRangeSizes.height) {
Expand Down Expand Up @@ -8941,6 +8969,37 @@ var editor;
this.wb.changeExternalReference(eR, to);
};

/*
* set format option wb->externalLinksPr->autoRefresh
* start timer if true, clear timer if false
* if update from interface all links, timer restart
* if part of links - not restart
* event from model to view - "changeExternalReferenceAutoUpdate"
* @param {bool} val
* */
spreadsheet_api.prototype.asc_setUpdateLinks = function(val) {
//ms desktop: update automatic(realtime) only if open source file(not depends on workbookPr->UpdateLinks property). if source file changed by another editor - not update links
//workbookPr->UpdateLinks only the opening is affected
//ms online
//timer update depends on workbookPr->UpdateLinks property. update only in "always"
if (this.collaborativeEditing.getGlobalLock() || !this.canEdit()) {
return;
}
let wbModel = this.wbModel;
if (!wbModel) {
return;
}
wbModel.setUpdateLinks(val, true);
};

spreadsheet_api.prototype.asc_getUpdateLinks = function() {
let wbModel = this.wbModel;
if (!wbModel) {
return;
}
return wbModel.getUpdateLinks();
};

spreadsheet_api.prototype.asc_fillHandleDone = function(range) {
if (this.canEdit()) {
let wb = this.wb;
Expand Down Expand Up @@ -10094,7 +10153,9 @@ var editor;
prot["asc_updateExternalReferences"] = prot.asc_updateExternalReferences;
prot["asc_removeExternalReferences"] = prot.asc_removeExternalReferences;
prot["asc_openExternalReference"] = prot.asc_openExternalReference;
prot["asc_changeExternalReference"] = prot.asc_changeExternalReference;
prot["asc_setUpdateLinks"] = prot.asc_setUpdateLinks;
prot["asc_getUpdateLinks"] = prot.asc_getUpdateLinks;



prot["asc_fillHandleDone"] = prot.asc_fillHandleDone;
Expand Down
Loading

0 comments on commit cace6fd

Please sign in to comment.