survey-creator-core 1.9.118 → 1.9.119

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 (80) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1 -1
  4. package/i18n/arabic.min.js +1 -1
  5. package/i18n/bulgarian.js +1 -1
  6. package/i18n/bulgarian.min.js +1 -1
  7. package/i18n/croatian.js +1 -1
  8. package/i18n/croatian.min.js +1 -1
  9. package/i18n/czech.js +1 -1
  10. package/i18n/czech.min.js +1 -1
  11. package/i18n/danish.js +1 -1
  12. package/i18n/danish.min.js +1 -1
  13. package/i18n/dutch.js +1 -1
  14. package/i18n/dutch.min.js +1 -1
  15. package/i18n/english.js +1 -1
  16. package/i18n/english.min.js +1 -1
  17. package/i18n/finnish.js +1 -1
  18. package/i18n/finnish.min.js +1 -1
  19. package/i18n/french.js +1 -1
  20. package/i18n/french.min.js +1 -1
  21. package/i18n/german.js +1 -1
  22. package/i18n/german.min.js +1 -1
  23. package/i18n/hungarian.js +1 -1
  24. package/i18n/hungarian.min.js +1 -1
  25. package/i18n/index.js +1 -1
  26. package/i18n/index.min.js +1 -1
  27. package/i18n/indonesian.js +1 -1
  28. package/i18n/indonesian.min.js +1 -1
  29. package/i18n/italian.js +1 -1
  30. package/i18n/italian.min.js +1 -1
  31. package/i18n/japanese.js +1 -1
  32. package/i18n/japanese.min.js +1 -1
  33. package/i18n/korean.js +1 -1
  34. package/i18n/korean.min.js +1 -1
  35. package/i18n/malay.js +1 -1
  36. package/i18n/malay.min.js +1 -1
  37. package/i18n/mongolian.js +1 -1
  38. package/i18n/mongolian.min.js +1 -1
  39. package/i18n/norwegian.js +1 -1
  40. package/i18n/norwegian.min.js +1 -1
  41. package/i18n/persian.js +1 -1
  42. package/i18n/persian.min.js +1 -1
  43. package/i18n/polish.js +1 -1
  44. package/i18n/polish.min.js +1 -1
  45. package/i18n/portuguese.js +1 -1
  46. package/i18n/portuguese.min.js +1 -1
  47. package/i18n/russian.js +1 -1
  48. package/i18n/russian.min.js +1 -1
  49. package/i18n/simplified-chinese.js +1 -1
  50. package/i18n/simplified-chinese.min.js +1 -1
  51. package/i18n/slovak.js +1 -1
  52. package/i18n/slovak.min.js +1 -1
  53. package/i18n/spanish.js +1 -1
  54. package/i18n/spanish.min.js +1 -1
  55. package/i18n/swedish.js +1 -1
  56. package/i18n/swedish.min.js +1 -1
  57. package/i18n/tajik.js +1 -1
  58. package/i18n/tajik.min.js +1 -1
  59. package/i18n/traditional-chinese.js +1 -1
  60. package/i18n/traditional-chinese.min.js +1 -1
  61. package/i18n/turkish.js +1 -1
  62. package/i18n/turkish.min.js +1 -1
  63. package/package.json +2 -2
  64. package/survey-creator-core.css +5 -5
  65. package/survey-creator-core.fontless.css +4 -4
  66. package/survey-creator-core.fontless.css.map +1 -1
  67. package/survey-creator-core.fontless.min.css +2 -2
  68. package/survey-creator-core.i18n.js +1 -1
  69. package/survey-creator-core.i18n.min.js +1 -1
  70. package/survey-creator-core.js +299 -107
  71. package/survey-creator-core.js.map +1 -1
  72. package/survey-creator-core.min.css +3 -3
  73. package/survey-creator-core.min.js +5 -5
  74. package/typings/components/tabs/theme-builder.d.ts +3 -5
  75. package/typings/components/tabs/theme-plugin.d.ts +93 -7
  76. package/typings/creator-base.d.ts +45 -6
  77. package/typings/creator-options.d.ts +8 -1
  78. package/typings/property-grid-theme/property-grid.d.ts +2 -1
  79. package/typings/survey-helper.d.ts +2 -1
  80. package/typings/toolbox.d.ts +37 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.118
2
+ * SurveyJS Creator v1.9.119
3
3
  * (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -130,7 +130,7 @@ License: MIT
130
130
  /***/ (function(module, exports, __webpack_require__) {
131
131
 
132
132
  /*!
133
- * surveyjs - Survey JavaScript library v1.9.118
133
+ * surveyjs - Survey JavaScript library v1.9.119
134
134
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
135
135
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
136
136
  */
@@ -4862,7 +4862,9 @@ var LogoImageViewModel = /** @class */ (function (_super) {
4862
4862
  }
4863
4863
  Object.defineProperty(LogoImageViewModel.prototype, "allowEdit", {
4864
4864
  get: function () {
4865
- return !this.creator.readOnly;
4865
+ var survey = this.creator.survey;
4866
+ var property = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(survey.getType(), "logo");
4867
+ return !this.creator.readOnly && (!property.overridingProperty || !survey[property.overridingProperty]);
4866
4868
  },
4867
4869
  enumerable: false,
4868
4870
  configurable: true
@@ -8995,7 +8997,7 @@ var TabDesignerPlugin = /** @class */ (function () {
8995
8997
  this.saveSurveyAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
8996
8998
  id: "svd-save",
8997
8999
  iconName: "icon-save",
8998
- action: function () { return _this.creator.doSave(); },
9000
+ action: function () { return _this.creator.saveSurveyActionHandler(); },
8999
9001
  active: false,
9000
9002
  enabled: false,
9001
9003
  visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
@@ -9232,19 +9234,12 @@ var TabDesignerViewModel = /** @class */ (function (_super) {
9232
9234
  this.cssUpdater && this.cssUpdater.dispose();
9233
9235
  };
9234
9236
  TabDesignerViewModel.prototype.checkLastPageToDelete = function () {
9235
- if (this.survey.pageCount === 0)
9236
- return false;
9237
- if (this.survey.pageCount === 1 && !this.creator.isInitialSurveyEmpty)
9237
+ if (this.survey.pageCount === 0 || this.survey.isQuestionDragging)
9238
9238
  return false;
9239
9239
  var lastPage = this.survey.pages[this.survey.pageCount - 1];
9240
9240
  if (lastPage.elements.length > 0 || lastPage.isConverting)
9241
9241
  return false;
9242
- if (!_survey_helper__WEBPACK_IMPORTED_MODULE_4__["SurveyHelper"].isPageNameAutoGenerated(lastPage.name))
9243
- return false;
9244
- var json = lastPage.toJSON();
9245
- delete json["name"];
9246
- //If there is at least one property in page is set, then return
9247
- for (var key in json)
9242
+ if (_survey_helper__WEBPACK_IMPORTED_MODULE_4__["SurveyHelper"].isPagePropertiesAreModified(lastPage))
9248
9243
  return false;
9249
9244
  lastPage.delete();
9250
9245
  if (this.survey.pageCount === 0) {
@@ -14504,8 +14499,8 @@ var ThemeBuilder = /** @class */ (function (_super) {
14504
14499
  _this._availableThemes = _themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedThemes"];
14505
14500
  _this.prevQuestionValues = {};
14506
14501
  _this.onThemeSelected = new survey_core__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
14507
- _this.onThemeModified = new survey_core__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
14508
- _this.onCanModifyTheme = new survey_core__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
14502
+ _this.onThemePropertyChanged = new survey_core__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
14503
+ _this.onAllowModifyTheme = new survey_core__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
14509
14504
  _this.creatorPropertyChanged = function (sender, options) {
14510
14505
  if (options.name === "isMobileView") {
14511
14506
  _this.updateVisibilityOfPropertyGridGroups();
@@ -14522,7 +14517,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14522
14517
  _this.backgroundImageAttachment = _this.surveyProvider.theme.backgroundImageAttachment !== undefined ? _this.surveyProvider.theme.backgroundImageAttachment : surveyProvider.survey.backgroundImageAttachment;
14523
14518
  _this.backgroundOpacity = ((_this.surveyProvider.theme.backgroundOpacity !== undefined ? _this.surveyProvider.theme.backgroundOpacity : surveyProvider.survey.backgroundOpacity) || 1) * 100;
14524
14519
  _this.loadTheme(_this.surveyProvider.theme);
14525
- _this.surveyProvider.isThemeModified = false;
14520
+ _this.surveyProvider.hasPendingThemeChanges = false;
14526
14521
  _this.undoRedoManager = new _plugins_undo_redo_undo_redo_manager__WEBPACK_IMPORTED_MODULE_10__["UndoRedoManager"]();
14527
14522
  _this.surveyProvider.onPropertyChanged.add(_this.creatorPropertyChanged);
14528
14523
  return _this;
@@ -14542,19 +14537,6 @@ var ThemeBuilder = /** @class */ (function (_super) {
14542
14537
  }
14543
14538
  return (_themeName || this.themeName) + "-" + this.themePalette;
14544
14539
  };
14545
- Object.defineProperty(ThemeBuilder.prototype, "activeLanguage", {
14546
- get: function () {
14547
- return this.getPropertyValue("activeLanguage", this.survey.locale || survey_core__WEBPACK_IMPORTED_MODULE_2__["surveyLocalization"].defaultLocale);
14548
- },
14549
- set: function (val) {
14550
- if (val === this.activeLanguage)
14551
- return;
14552
- this.setPropertyValue("activeLanguage", val);
14553
- this.survey.locale = val;
14554
- },
14555
- enumerable: false,
14556
- configurable: true
14557
- });
14558
14540
  Object.defineProperty(ThemeBuilder.prototype, "survey", {
14559
14541
  get: function () {
14560
14542
  return this.simulator.survey;
@@ -14680,6 +14662,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14680
14662
  component: "svc-complete-page",
14681
14663
  data: this
14682
14664
  });
14665
+ newSurvey.locale = json.locale;
14683
14666
  this.simulator.survey = newSurvey;
14684
14667
  this.updateSimulatorTheme();
14685
14668
  if (this.onSurveyCreatedCallback)
@@ -14780,7 +14763,6 @@ var ThemeBuilder = /** @class */ (function (_super) {
14780
14763
  ThemeBuilder.prototype.show = function () {
14781
14764
  this.showInvisibleElements = false;
14782
14765
  this.activePage = this.survey.activePage;
14783
- this.survey.locale = this.activeLanguage;
14784
14766
  this.isRunning = true;
14785
14767
  };
14786
14768
  ThemeBuilder.prototype.testAgain = function () {
@@ -15208,12 +15190,12 @@ var ThemeBuilder = /** @class */ (function (_super) {
15208
15190
  var canModify = !this.surveyProvider.readOnly;
15209
15191
  var options = {
15210
15192
  theme: this.currentTheme,
15211
- canModify: canModify
15193
+ allow: canModify
15212
15194
  };
15213
- this.onCanModifyTheme.fire(this, options);
15195
+ this.onAllowModifyTheme.fire(this, options);
15214
15196
  this.themeEditorSurvey.getAllQuestions().forEach(function (q) {
15215
15197
  if (["themeName", "themePalette", "themeMode"].indexOf(q.name) === -1) {
15216
- q.readOnly = !options.canModify;
15198
+ q.readOnly = !options.allow;
15217
15199
  }
15218
15200
  });
15219
15201
  if (!!this.survey) {
@@ -15284,7 +15266,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
15284
15266
  var _this = this;
15285
15267
  var saveThemeFunc = this.saveThemeFunc;
15286
15268
  if (!saveThemeFunc && this.surveyProvider.saveThemeFunc) {
15287
- saveThemeFunc = function () { return _this.surveyProvider.doSaveTheme(); };
15269
+ saveThemeFunc = function () { return _this.surveyProvider.saveTheme(); };
15288
15270
  }
15289
15271
  if (!saveThemeFunc) {
15290
15272
  return;
@@ -15309,8 +15291,8 @@ var ThemeBuilder = /** @class */ (function (_super) {
15309
15291
  this.onThemeSelected.fire(this, options);
15310
15292
  }
15311
15293
  else {
15312
- this.surveyProvider.isThemeModified = true;
15313
- this.onThemeModified.fire(this, options);
15294
+ this.surveyProvider.hasPendingThemeChanges = true;
15295
+ this.onThemePropertyChanged.fire(this, options);
15314
15296
  }
15315
15297
  if (this.surveyProvider.isAutoSave) {
15316
15298
  this.processAutoSave();
@@ -15320,14 +15302,15 @@ var ThemeBuilder = /** @class */ (function (_super) {
15320
15302
  ThemeBuilder.prototype.getDefaultTitleSetting = function (isAdvanced) {
15321
15303
  var result = { family: _creator_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].theme.fontFamily, weight: "700", size: 32 };
15322
15304
  if (isAdvanced) {
15323
- result["color"] = "rgba(0, 0, 0, 0.91)";
15305
+ result["color"] = "rgba(255, 255, 255, 1)";
15324
15306
  }
15325
15307
  return result;
15326
15308
  };
15327
15309
  ThemeBuilder.prototype.getDefaultDescriptionSetting = function (isAdvanced) {
15328
15310
  var result = { family: _creator_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].theme.fontFamily, weight: "400", size: 16 };
15329
15311
  if (isAdvanced) {
15330
- result["color"] = "rgba(0, 0, 0, 0.45)";
15312
+ result["color"] = "rgba(255, 255, 255, 1)";
15313
+ result["weight"] = "600";
15331
15314
  }
15332
15315
  return result;
15333
15316
  };
@@ -15401,7 +15384,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
15401
15384
  {
15402
15385
  "headerView": "basic",
15403
15386
  "logoPosition": "right",
15404
- "inheritWidthFrom": "survey",
15387
+ "inheritWidthFrom": "container",
15405
15388
  "backgroundColorSwitch": "accentColor",
15406
15389
  "backgroundImageFit": "cover",
15407
15390
  "backgroundImageOpacity": 100,
@@ -16630,6 +16613,22 @@ function getObjectDiffs(obj1, obj2) {
16630
16613
  });
16631
16614
  return result;
16632
16615
  }
16616
+ /**
16617
+ * An object that enables you to modify, add, and remove UI themes and handle theme-related events. To access this object, use the [`themeEditor`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#themeEditor) property on a Survey Creator instance:
16618
+ *
16619
+ * ```js
16620
+ * const creatorOptions = { ... };
16621
+ * const creator = new SurveyCreator.SurveyCreator(creatorOptions);
16622
+ * creator.themeEditor.settingName = "value";
16623
+ *
16624
+ * // In modular applications:
16625
+ * import { SurveyCreatorModel } from "survey-creator-core";
16626
+ *
16627
+ * const creatorOptions = { ... };
16628
+ * const creator = new SurveyCreatorModel(creatorOptions);
16629
+ * creator.themeEditor.settingName = "value";
16630
+ * ```
16631
+ */
16633
16632
  var ThemeTabPlugin = /** @class */ (function () {
16634
16633
  function ThemeTabPlugin(creator) {
16635
16634
  var _this = this;
@@ -16637,9 +16636,46 @@ var ThemeTabPlugin = /** @class */ (function () {
16637
16636
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_0__["defaultV2ThemeName"]];
16638
16637
  this._availableThemes = [].concat(_themes__WEBPACK_IMPORTED_MODULE_4__["PredefinedThemes"]);
16639
16638
  this.saveToFileHandler = _utils_utils__WEBPACK_IMPORTED_MODULE_5__["saveToFileHandler"];
16639
+ /**
16640
+ * An event that is raised when users select a UI theme from a drop-down list, choose a dark or light color palette, and switch between regular and panelless theme modifications.
16641
+ *
16642
+ * Parameters:
16643
+ *
16644
+ * - `sender`: `ThemeTabPlugin`\
16645
+ * A `ThemeTabPlugin` instance that raised the event.
16646
+ * - `options.theme`: [`ITheme`](https://surveyjs.io/form-library/documentation/api-reference/itheme)\
16647
+ * A selected theme.
16648
+ * @see availableThemes
16649
+ * @see addTheme
16650
+ * @see removeTheme
16651
+ */
16640
16652
  this.onThemeSelected = new survey_core__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
16641
- this.onThemeModified = new survey_core__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
16642
- this.onCanModifyTheme = new survey_core__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
16653
+ /**
16654
+ * An event that is raised when the value of a property or CSS variable in a theme JSON schema has changed.
16655
+ *
16656
+ * Parameters:
16657
+ *
16658
+ * - `sender`: `ThemeTabPlugin`\
16659
+ * A `ThemeTabPlugin` instance that raised the event.
16660
+ * - `options.name`: `string`\
16661
+ * The name of the changed property or CSS variable.
16662
+ * - `options.value`: `any`\
16663
+ * A new value of the property or CSS variable.
16664
+ */
16665
+ this.onThemePropertyChanged = new survey_core__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
16666
+ /**
16667
+ * An event that is raised when Theme Editor renders Property Grid. Use this event to switch the current theme to read-only mode.
16668
+ *
16669
+ * Parameters:
16670
+ *
16671
+ * - `sender`: `ThemeTabPlugin`\
16672
+ * A `ThemeTabPlugin` instance that raised the event.
16673
+ * - `options.theme`: [`ITheme`](https://surveyjs.io/form-library/documentation/api-reference/itheme)\
16674
+ * The current theme.
16675
+ * - `options.allow`: `boolean`\
16676
+ * A Boolean property that you can set to `false` if you want to disallow theme modifications.
16677
+ */
16678
+ this.onAllowModifyTheme = new survey_core__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
16643
16679
  creator.addPluginTab("theme", this, "ed.themeSurvey");
16644
16680
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_0__["defaultV2ThemeName"]];
16645
16681
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
@@ -16714,12 +16750,12 @@ var ThemeTabPlugin = /** @class */ (function () {
16714
16750
  _this.saveThemeAction.enabled = true;
16715
16751
  _this.onThemeSelected.fire(_this, options);
16716
16752
  });
16717
- this.model.onThemeModified.add(function (sender, options) {
16753
+ this.model.onThemePropertyChanged.add(function (sender, options) {
16718
16754
  _this.saveThemeAction.enabled = true;
16719
- _this.onThemeModified.fire(_this, options);
16755
+ _this.onThemePropertyChanged.fire(_this, options);
16720
16756
  });
16721
- this.model.onCanModifyTheme.add(function (sender, options) {
16722
- _this.onCanModifyTheme.fire(_this, options);
16757
+ this.model.onAllowModifyTheme.add(function (sender, options) {
16758
+ _this.onAllowModifyTheme.fire(_this, options);
16723
16759
  });
16724
16760
  };
16725
16761
  ThemeTabPlugin.prototype.deactivate = function () {
@@ -16727,8 +16763,8 @@ var ThemeTabPlugin = /** @class */ (function () {
16727
16763
  this.simulatorTheme = this.model.simulator.survey.css;
16728
16764
  this.model.onPropertyChanged.clear();
16729
16765
  this.model.onThemeSelected.clear();
16730
- this.model.onThemeModified.clear();
16731
- this.model.onCanModifyTheme.clear();
16766
+ this.model.onThemePropertyChanged.clear();
16767
+ this.model.onAllowModifyTheme.clear();
16732
16768
  this.model.onSurveyCreatedCallback = undefined;
16733
16769
  this.model.dispose();
16734
16770
  this.model = undefined;
@@ -16821,7 +16857,7 @@ var ThemeTabPlugin = /** @class */ (function () {
16821
16857
  id: "svd-save-theme",
16822
16858
  iconName: "icon-save",
16823
16859
  action: function () {
16824
- _this.creator.doSaveTheme();
16860
+ _this.creator.saveThemeActionHandler();
16825
16861
  _this.saveThemeAction.enabled = false;
16826
16862
  },
16827
16863
  active: false,
@@ -16956,18 +16992,31 @@ var ThemeTabPlugin = /** @class */ (function () {
16956
16992
  this.creator.footerToolbar.actions.push(this.themeSettingsAction);
16957
16993
  };
16958
16994
  Object.defineProperty(ThemeTabPlugin.prototype, "availableThemes", {
16995
+ /**
16996
+ * A list of UI themes from which users can select. You can sort this list if you want to reorder themes in Theme Editor.
16997
+ * @see addTheme
16998
+ * @see removeTheme
16999
+ */
16959
17000
  get: function () {
16960
17001
  return [].concat(this._availableThemes);
16961
17002
  },
16962
- set: function (availebleThemes) {
16963
- this._availableThemes = availebleThemes || [];
17003
+ set: function (availableThemes) {
17004
+ this._availableThemes = availableThemes || [];
16964
17005
  if (!!this.model) {
16965
- this.model.availableThemes = availebleThemes;
17006
+ this.model.availableThemes = availableThemes;
16966
17007
  }
16967
17008
  },
16968
17009
  enumerable: false,
16969
17010
  configurable: true
16970
17011
  });
17012
+ /**
17013
+ * Adds a new UI theme to Theme Editor.
17014
+ * @param theme A [UI theme](https://surveyjs.io/form-library/documentation/api-reference/itheme) to add.
17015
+ * @param setAsDefault For internal use.
17016
+ * @returns An identifier of the added theme, which is a concatenation of the [`themeName`](https://surveyjs.io/form-library/documentation/api-reference/itheme#themeName), [`colorPalette`](https://surveyjs.io/form-library/documentation/api-reference/itheme#colorPalette), and [`isPanelless`](https://surveyjs.io/form-library/documentation/api-reference/itheme#isPanelless) settings (for example, `"default-dark-panelless"`).
17017
+ * @see removeTheme
17018
+ * @see getCurrentTheme
17019
+ */
16971
17020
  ThemeTabPlugin.prototype.addTheme = function (theme, setAsDefault) {
16972
17021
  if (setAsDefault === void 0) { setAsDefault = false; }
16973
17022
  var fullThemeName = Object(_themes__WEBPACK_IMPORTED_MODULE_4__["getThemeFullName"])(theme);
@@ -16987,8 +17036,15 @@ var ThemeTabPlugin = /** @class */ (function () {
16987
17036
  }
16988
17037
  return fullThemeName;
16989
17038
  };
16990
- ThemeTabPlugin.prototype.removeTheme = function (themeAccessor, withModifications) {
16991
- if (withModifications === void 0) { withModifications = false; }
17039
+ /**
17040
+ * Removes a UI theme from Theme Editor.
17041
+ * @param themeAccessor A [UI theme](https://surveyjs.io/form-library/documentation/api-reference/itheme) to delete or a theme identifier, which is a concatenation of the [`themeName`](https://surveyjs.io/form-library/documentation/api-reference/itheme#themeName), [`colorPalette`](https://surveyjs.io/form-library/documentation/api-reference/itheme#colorPalette), and [`isPanelless`](https://surveyjs.io/form-library/documentation/api-reference/itheme#isPanelless) settings (for example, `"default-dark-panelless"`).
17042
+ * @param includeModifications Pass `true` to delete not only the specified UI theme, but also all other themes with the same `themeName` value (dark/light and panelless modifications).
17043
+ * @see addTheme
17044
+ * @see getCurrentTheme
17045
+ */
17046
+ ThemeTabPlugin.prototype.removeTheme = function (themeAccessor, includeModifications) {
17047
+ if (includeModifications === void 0) { includeModifications = false; }
16992
17048
  var themeToDelete = typeof themeAccessor === "string" ? _themes__WEBPACK_IMPORTED_MODULE_4__["Themes"][themeAccessor] : themeAccessor;
16993
17049
  var fullThemeName = typeof themeAccessor === "string" ? themeAccessor : Object(_themes__WEBPACK_IMPORTED_MODULE_4__["getThemeFullName"])(themeToDelete);
16994
17050
  if (!!themeToDelete) {
@@ -16998,10 +17054,10 @@ var ThemeTabPlugin = /** @class */ (function () {
16998
17054
  }
16999
17055
  var registeredThemeNames = Object.keys(_themes__WEBPACK_IMPORTED_MODULE_4__["Themes"]);
17000
17056
  var themeModifications = registeredThemeNames.filter(function (themeName) { return themeName.indexOf(themeToDelete.themeName + "-") === 0; });
17001
- if (withModifications && themeModifications.length > 0) {
17057
+ if (includeModifications && themeModifications.length > 0) {
17002
17058
  themeModifications.forEach(function (themeModificationFullName) { return delete _themes__WEBPACK_IMPORTED_MODULE_4__["Themes"][themeModificationFullName]; });
17003
17059
  }
17004
- if (withModifications || themeModifications.length === 0) {
17060
+ if (includeModifications || themeModifications.length === 0) {
17005
17061
  var themeIndex = this._availableThemes.indexOf(themeToDelete.themeName);
17006
17062
  if (themeIndex !== -1) {
17007
17063
  var availableThemes = this.availableThemes;
@@ -17011,9 +17067,17 @@ var ThemeTabPlugin = /** @class */ (function () {
17011
17067
  }
17012
17068
  }
17013
17069
  };
17014
- ThemeTabPlugin.prototype.getCurrentTheme = function (content) {
17015
- if (content === void 0) { content = "full"; }
17016
- if (content === "full") {
17070
+ /**
17071
+ * Returns a JSON object that describes the currently applied UI theme.
17072
+ * @param changesOnly Pass `true` to get a JSON object that contains only changed theme settings instead of a full theme JSON schema.
17073
+ * @returns A currently applied [theme JSON schema](https://surveyjs.io/form-library/documentation/api-reference/itheme).
17074
+ * @see availableThemes
17075
+ * @see addTheme
17076
+ * @see removeTheme
17077
+ */
17078
+ ThemeTabPlugin.prototype.getCurrentTheme = function (changesOnly) {
17079
+ if (changesOnly === void 0) { changesOnly = false; }
17080
+ if (!changesOnly) {
17017
17081
  return this.creator.theme;
17018
17082
  }
17019
17083
  return this.getThemeChanges();
@@ -17035,13 +17099,18 @@ var ThemeTabPlugin = /** @class */ (function () {
17035
17099
  themeChanges.isPanelless = !!fullTheme.isPanelless;
17036
17100
  return themeChanges;
17037
17101
  };
17038
- Object.defineProperty(ThemeTabPlugin.prototype, "isThemePristine", {
17102
+ Object.defineProperty(ThemeTabPlugin.prototype, "isModified", {
17103
+ /**
17104
+ * Indicates whether the selected theme has been modified.
17105
+ * @see [`creator.saveTheme()`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveTheme)
17106
+ * @see [`creator.saveThemeFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveThemeFunc)
17107
+ */
17039
17108
  get: function () {
17040
17109
  var currentThemeChanges = this.getThemeChanges();
17041
17110
  var hasCssModifications = Object.keys(currentThemeChanges.cssVariables).length > 0;
17042
17111
  var hasBackgroundModifications = Object.keys(currentThemeChanges).some(function (propertyName) { return propertyName.toLowerCase().indexOf("background") !== -1; });
17043
17112
  var hasHeaderModifications = !!currentThemeChanges.header && Object.keys(currentThemeChanges.header).length === 0;
17044
- return !(hasCssModifications || hasBackgroundModifications || hasHeaderModifications);
17113
+ return hasCssModifications || hasBackgroundModifications || hasHeaderModifications;
17045
17114
  },
17046
17115
  enumerable: false,
17047
17116
  configurable: true
@@ -18305,7 +18374,7 @@ var TranslationGroup = /** @class */ (function (_super) {
18305
18374
  !!property.serializationProperty) {
18306
18375
  var locStr = obj[property.serializationProperty];
18307
18376
  if (!!locStr &&
18308
- obj.getType() != "page" &&
18377
+ !obj.isPage &&
18309
18378
  (!!locStr.onGetTextCallback || locStr["onRenderedHtmlCallback"]))
18310
18379
  return obj["name"];
18311
18380
  }
@@ -20375,7 +20444,7 @@ var CreatorBase = /** @class */ (function (_super) {
20375
20444
  * @see allowChangeThemeInPreview
20376
20445
  */
20377
20446
  _this.themeForPreview = "defaultV2";
20378
- _this.isThemeModified = false;
20447
+ _this.hasPendingThemeChanges = false;
20379
20448
  _this._theme = { cssVariables: {} };
20380
20449
  //#endregion Theme
20381
20450
  _this._allowModifyPages = true;
@@ -20570,7 +20639,7 @@ var CreatorBase = /** @class */ (function (_super) {
20570
20639
  _this.updateToolboxIsCompact();
20571
20640
  _this.initTabs();
20572
20641
  _this.initDragDrop();
20573
- _this.saveSurveyAndTheme = _this.options.saveSurveyAndTheme;
20642
+ _this.syncSaveButtons = _this.options.saveSurveyAndTheme !== undefined ? _this.options.saveSurveyAndTheme : _this.options.syncSaveButtons;
20574
20643
  _this.isTouch = survey_core__WEBPACK_IMPORTED_MODULE_1__["IsTouch"];
20575
20644
  var expandAction = _this.sidebar.getExpandAction();
20576
20645
  !!expandAction && _this.toolbar.actions.push(expandAction);
@@ -20795,13 +20864,26 @@ var CreatorBase = /** @class */ (function (_super) {
20795
20864
  enumerable: false,
20796
20865
  configurable: true
20797
20866
  });
20798
- Object.defineProperty(CreatorBase.prototype, "saveThemeFunc", {
20867
+ Object.defineProperty(CreatorBase.prototype, "themeEditor", {
20799
20868
  //#region Theme
20869
+ /**
20870
+ * An object that enables you to manage UI themes. Refer to the following API section for information on available properties, methods, and events: [`ThemeTabPlugin`](https://surveyjs.io/survey-creator/documentation/api-reference/themetabplugin).
20871
+ * @see showThemeTab
20872
+ * @see saveThemeFunc
20873
+ */
20874
+ get: function () {
20875
+ return this.getPlugin("theme");
20876
+ },
20877
+ enumerable: false,
20878
+ configurable: true
20879
+ });
20880
+ Object.defineProperty(CreatorBase.prototype, "saveThemeFunc", {
20800
20881
  /**
20801
20882
  * A function that is called each time users click the [Save button](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#showSaveButton) or [auto-save](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#isAutoSave) is triggered to save a theme JSON object.
20802
20883
  *
20803
20884
  * For more information, refer to the [Save and Load Custom Themes](https://surveyjs.io/survey-creator/documentation/theme-editor#save-and-load-custom-themes) help topic.
20804
20885
  * @see showThemeTab
20886
+ * @see themeEditor
20805
20887
  * @see saveSurveyFunc
20806
20888
  */
20807
20889
  get: function () {
@@ -20819,7 +20901,7 @@ var CreatorBase = /** @class */ (function (_super) {
20819
20901
  },
20820
20902
  set: function (newTheme) {
20821
20903
  this._theme = newTheme;
20822
- this.isThemeModified = true;
20904
+ this.hasPendingThemeChanges = true;
20823
20905
  if (this.activeTab !== "theme") {
20824
20906
  this.updatePlugin(this.activeTab);
20825
20907
  }
@@ -20837,7 +20919,7 @@ var CreatorBase = /** @class */ (function (_super) {
20837
20919
  return;
20838
20920
  if (isSuccess) {
20839
20921
  _this.setState("saved");
20840
- _this.isThemeModified = false;
20922
+ _this.hasPendingThemeChanges = false;
20841
20923
  }
20842
20924
  else {
20843
20925
  _this.setState("modified");
@@ -20849,12 +20931,20 @@ var CreatorBase = /** @class */ (function (_super) {
20849
20931
  });
20850
20932
  }
20851
20933
  };
20852
- CreatorBase.prototype.doSaveTheme = function () {
20853
- if (this.saveSurveyAndTheme) {
20854
- this.doSaveSurveyAndTheme();
20934
+ /**
20935
+ * Calls the [`saveThemeFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveThemeFunc) function to save the theme JSON schema.
20936
+ * @see saveSurvey
20937
+ * @see save
20938
+ */
20939
+ CreatorBase.prototype.saveTheme = function () {
20940
+ this._doSaveThemeCore();
20941
+ };
20942
+ CreatorBase.prototype.saveThemeActionHandler = function () {
20943
+ if (this.syncSaveButtons) {
20944
+ this.save();
20855
20945
  }
20856
20946
  else {
20857
- this._doSaveThemeCore();
20947
+ this.saveTheme();
20858
20948
  }
20859
20949
  };
20860
20950
  Object.defineProperty(CreatorBase.prototype, "allowModifyPages", {
@@ -21439,15 +21529,10 @@ var CreatorBase = /** @class */ (function (_super) {
21439
21529
  enumerable: false,
21440
21530
  configurable: true
21441
21531
  });
21442
- Object.defineProperty(CreatorBase.prototype, "isInitialSurveyEmpty", {
21443
- /**
21444
- * Returns true if initial survey was empty. It was not set via JSON property and default new survey is empty as well.
21445
- * @returns true if initial survey doesn't have any elements or properties
21446
- */
21447
- get: function () { return this.isInitialSurveyEmptyValue; },
21448
- enumerable: false,
21449
- configurable: true
21450
- });
21532
+ /**
21533
+ * Returns true if initial survey was empty. It was not set via JSON property and default new survey is empty as well.
21534
+ * @returns true if initial survey doesn't have any elements or properties
21535
+ */
21451
21536
  CreatorBase.prototype.initSurveyWithJSON = function (json, clearState) {
21452
21537
  var _this = this;
21453
21538
  if (!json) {
@@ -21461,7 +21546,6 @@ var CreatorBase = /** @class */ (function (_super) {
21461
21546
  survey.setDesignMode(true);
21462
21547
  survey.lazyRendering = true;
21463
21548
  survey.setJsonObject(json);
21464
- this.isInitialSurveyEmptyValue = survey.isEmpty;
21465
21549
  if (survey.isEmpty) {
21466
21550
  survey.setJsonObject(this.getDefaultSurveyJson());
21467
21551
  }
@@ -22026,7 +22110,7 @@ var CreatorBase = /** @class */ (function (_super) {
22026
22110
  this.newQuestionChangedNames[element.name] = newName;
22027
22111
  element.name = newName;
22028
22112
  }
22029
- if (element.isPanel || elType == "page") {
22113
+ if (element.isPanel || element.isPage) {
22030
22114
  if (element.isPanel) {
22031
22115
  this.newPanels.push(element);
22032
22116
  }
@@ -22143,9 +22227,9 @@ var CreatorBase = /** @class */ (function (_super) {
22143
22227
  this.selectElement(!!newPage ? newPage : this.survey);
22144
22228
  }
22145
22229
  else {
22146
- if (this.isInitialSurveyEmpty && this.survey.pageCount === 1) {
22230
+ if (this.survey.pageCount === 1) {
22147
22231
  var page = this.survey.pages[0];
22148
- if (page.elements.length === 1 && obj === page.elements[0]) {
22232
+ if (page.elements.length === 1 && obj === page.elements[0] && !_survey_helper__WEBPACK_IMPORTED_MODULE_9__["SurveyHelper"].isPagePropertiesAreModified(page)) {
22149
22233
  this.deleteObjectCore(page);
22150
22234
  return;
22151
22235
  }
@@ -22541,7 +22625,7 @@ var CreatorBase = /** @class */ (function (_super) {
22541
22625
  if (objIndex == elements.length - 1) {
22542
22626
  objIndex--;
22543
22627
  }
22544
- if (this.pageEditMode === "single" && parent.getType() === "page") {
22628
+ if (this.pageEditMode === "single" && parent.isPage) {
22545
22629
  parent = this.survey;
22546
22630
  }
22547
22631
  if (obj["questions"]) {
@@ -22865,12 +22949,23 @@ var CreatorBase = /** @class */ (function (_super) {
22865
22949
  });
22866
22950
  }
22867
22951
  };
22952
+ /**
22953
+ * Calls the [`saveSurveyFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveSurveyFunc) function to save the survey JSON schema.
22954
+ * @see saveTheme
22955
+ * @see save
22956
+ */
22957
+ CreatorBase.prototype.saveSurvey = function () {
22958
+ this._doSaveCore();
22959
+ };
22868
22960
  CreatorBase.prototype.doSave = function () {
22869
- if (this.saveSurveyAndTheme) {
22870
- this.doSaveSurveyAndTheme();
22961
+ this._doSaveCore();
22962
+ };
22963
+ CreatorBase.prototype.saveSurveyActionHandler = function () {
22964
+ if (this.syncSaveButtons) {
22965
+ this.save();
22871
22966
  }
22872
22967
  else {
22873
- this._doSaveCore();
22968
+ this.saveSurvey();
22874
22969
  }
22875
22970
  };
22876
22971
  CreatorBase.prototype._updateSaveActions = function () {
@@ -22879,18 +22974,23 @@ var CreatorBase = /** @class */ (function (_super) {
22879
22974
  action.enabled = this.state === "modified";
22880
22975
  action.active = this.state === "modified";
22881
22976
  }
22882
- if (this.saveSurveyAndTheme) {
22977
+ if (this.syncSaveButtons) {
22883
22978
  var action_1 = this._findAction("svd-save-theme");
22884
22979
  if (action_1) {
22885
- action_1.enabled = this.isThemeModified;
22886
- action_1.active = this.isThemeModified;
22980
+ action_1.enabled = this.hasPendingThemeChanges;
22981
+ action_1.active = this.hasPendingThemeChanges;
22887
22982
  }
22888
22983
  }
22889
22984
  };
22890
- CreatorBase.prototype.doSaveSurveyAndTheme = function () {
22985
+ /**
22986
+ * Calls the [`saveSurveyFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveSurveyFunc) and [`saveThemeFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveThemeFunc) functions to save the survey and theme JSON schemas.
22987
+ * @see saveSurvey
22988
+ * @see saveTheme
22989
+ */
22990
+ CreatorBase.prototype.save = function () {
22891
22991
  var _this = this;
22892
22992
  var themeSaveHandler = function () {
22893
- if (_this.isThemeModified) {
22993
+ if (_this.hasPendingThemeChanges) {
22894
22994
  _this._doSaveThemeCore(function () {
22895
22995
  _this._updateSaveActions();
22896
22996
  });
@@ -23182,17 +23282,17 @@ var CreatorBase = /** @class */ (function (_super) {
23182
23282
  }
23183
23283
  if (val) {
23184
23284
  target.onModified.add(target._syncSaveActions);
23185
- themeTabPlugin.onThemeModified.add(target._syncSaveActions);
23285
+ themeTabPlugin.onThemePropertyChanged.add(target._syncSaveActions);
23186
23286
  themeTabPlugin.onThemeSelected.add(target._syncSaveActions);
23187
23287
  }
23188
23288
  else {
23189
23289
  target.onModified.remove(target._syncSaveActions);
23190
- themeTabPlugin.onThemeModified.remove(target._syncSaveActions);
23290
+ themeTabPlugin.onThemePropertyChanged.remove(target._syncSaveActions);
23191
23291
  themeTabPlugin.onThemeSelected.remove(target._syncSaveActions);
23192
23292
  }
23193
23293
  },
23194
23294
  })
23195
- ], CreatorBase.prototype, "saveSurveyAndTheme", void 0);
23295
+ ], CreatorBase.prototype, "syncSaveButtons", void 0);
23196
23296
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
23197
23297
  Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
23198
23298
  ], CreatorBase.prototype, "showSaveButton", void 0);
@@ -25574,7 +25674,7 @@ __webpack_require__.r(__webpack_exports__);
25574
25674
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! survey-core */ "survey-core");
25575
25675
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_72___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_72__);
25576
25676
  var Version;
25577
- Version = "" + "1.9.118";
25677
+ Version = "" + "1.9.119";
25578
25678
  //should be loaded before other styles for easier override
25579
25679
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
25580
25680
 
@@ -25665,7 +25765,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
25665
25765
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
25666
25766
 
25667
25767
  survey_core__WEBPACK_IMPORTED_MODULE_72__["settings"].supportCreatorV2 = true;
25668
- Object(survey_core__WEBPACK_IMPORTED_MODULE_72__["checkLibraryVersion"])("" + "1.9.118", "survey-creator-core");
25768
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_72__["checkLibraryVersion"])("" + "1.9.119", "survey-creator-core");
25669
25769
 
25670
25770
 
25671
25771
  /***/ }),
@@ -29715,7 +29815,8 @@ var propertyGridCss = {
29715
29815
  panel: {
29716
29816
  title: "spg-title spg-panel__title",
29717
29817
  titleExpandable: "spg-panel__title--expandable",
29718
- titleOnExpand: "spg-panel__title--expanded",
29818
+ titleExpanded: "spg-panel__title--expanded",
29819
+ titleCollapsed: "spg-panel__title--collapsed",
29719
29820
  titleOnError: "spg-panel__title--error",
29720
29821
  description: "spg-description spg-panel__description",
29721
29822
  container: "spg-panel spg-row__panel",
@@ -37234,6 +37335,17 @@ var SurveyHelper = /** @class */ (function () {
37234
37335
  SurveyHelper.isPageNameAutoGenerated = function (name) {
37235
37336
  return SurveyHelper.isNameAutoGenerated(name, _editorLocalization__WEBPACK_IMPORTED_MODULE_1__["editorLocalization"].getString("ed.newPageName"));
37236
37337
  };
37338
+ SurveyHelper.isPagePropertiesAreModified = function (page) {
37339
+ if (!SurveyHelper.isPageNameAutoGenerated(page.name))
37340
+ return true;
37341
+ var json = page.toJSON();
37342
+ delete json["name"];
37343
+ delete json["elements"];
37344
+ //If there is at least one property in page is set, then return true
37345
+ for (var key in json)
37346
+ return true;
37347
+ return false;
37348
+ };
37237
37349
  SurveyHelper.getNewQuestionName = function (objs) {
37238
37350
  return SurveyHelper.getNewName(objs, _editorLocalization__WEBPACK_IMPORTED_MODULE_1__["editorLocalization"].getString("ed.newQuestionName"));
37239
37351
  };
@@ -37275,15 +37387,15 @@ var SurveyHelper = /** @class */ (function () {
37275
37387
  SurveyHelper.getObjectType = function (obj) {
37276
37388
  if (!obj || !obj["getType"])
37277
37389
  return ObjType.Unknown;
37278
- if (obj.getType() == "page")
37390
+ if (obj.isPage)
37279
37391
  return ObjType.Page;
37280
- if (obj.getType() == "panel")
37392
+ if (obj.isPanel)
37281
37393
  return ObjType.Panel;
37282
37394
  if (obj.getType() == "survey")
37283
37395
  return ObjType.Survey;
37284
37396
  if (obj.getType() == "matrixdropdowncolumn")
37285
37397
  return ObjType.Column;
37286
- if (obj["name"])
37398
+ if (obj.isQuestion)
37287
37399
  return ObjType.Question;
37288
37400
  return ObjType.Unknown;
37289
37401
  };
@@ -38381,6 +38493,8 @@ var QuestionToolbox = /** @class */ (function (_super) {
38381
38493
  * @param name
38382
38494
  */
38383
38495
  QuestionToolbox.prototype.getItemByName = function (name) {
38496
+ if (!name)
38497
+ return null;
38384
38498
  var index = this.indexOf(name);
38385
38499
  return index > -1 ? this.actions[index] : null;
38386
38500
  };
@@ -38476,6 +38590,79 @@ var QuestionToolbox = /** @class */ (function (_super) {
38476
38590
  }
38477
38591
  this.onItemsChanged();
38478
38592
  };
38593
+ /**
38594
+ * Defines toolbox categories from scratch.
38595
+ *
38596
+ * This method accepts an array of objects as the `categories` parameter. Each object defines a single category and lists items included into it. Unlisted items can be collected in the Misc category if you pass `true` as the `displayMisc` parameter. Optionally, you can override display titles for individual items.
38597
+ *
38598
+ * The following code defines two toolbox categories: Dropdowns and Text Input. Items that do not fall into either category are collected in Misc. The `"comment"` item has a custom display title.
38599
+ *
38600
+ * ```
38601
+ * creator.toolbox.defineCategories([{
38602
+ * category: "Dropdowns",
38603
+ * items: [
38604
+ * "dropdown",
38605
+ * "tagbox"
38606
+ * ]
38607
+ * }, {
38608
+ * category: "Text Input",
38609
+ * items: [
38610
+ * "text",
38611
+ * // Override the display title
38612
+ * { name: "comment", title: "Multi-Line Input" }
38613
+ * ]
38614
+ * }], true);
38615
+ * ```
38616
+ *
38617
+ * [View Demo](https://surveyjs.io/survey-creator/examples/survey-toolbox-categories/ (linkStyle))
38618
+ * @param categories An array of new categories.
38619
+ * @param displayMisc Pass `true` if you want to collect unlisted toolbox items in the Misc category. Default value: `false`.
38620
+ */
38621
+ QuestionToolbox.prototype.defineCategories = function (categories, displayMisc) {
38622
+ var _this = this;
38623
+ if (displayMisc === void 0) { displayMisc = false; }
38624
+ if (!Array.isArray(categories))
38625
+ return;
38626
+ this.actions.forEach(function (item) {
38627
+ item.visible = false;
38628
+ });
38629
+ var actionList = new Array();
38630
+ categories.forEach(function (category) {
38631
+ if (!Array.isArray(category.items))
38632
+ return;
38633
+ category.items.forEach(function (obj) {
38634
+ var name = undefined;
38635
+ var title = undefined;
38636
+ if (typeof obj === "string") {
38637
+ name = obj;
38638
+ }
38639
+ else {
38640
+ name = obj.name;
38641
+ title = obj.title;
38642
+ }
38643
+ var item = _this.getItemByName(name);
38644
+ if (item) {
38645
+ item.category = category.category;
38646
+ item.visible = true;
38647
+ if (!!title) {
38648
+ item.title = title;
38649
+ }
38650
+ actionList.push(item);
38651
+ }
38652
+ });
38653
+ });
38654
+ this.actions.forEach(function (item) {
38655
+ if (!item.visible) {
38656
+ if (displayMisc) {
38657
+ item.visible = true;
38658
+ item.category = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("ed.toolboxMiscCategory");
38659
+ }
38660
+ actionList.push(item);
38661
+ }
38662
+ });
38663
+ this.setItems(actionList);
38664
+ this.onItemsChanged(false);
38665
+ };
38479
38666
  /**
38480
38667
  * Removes categories from the Toolbox.
38481
38668
  */
@@ -38561,12 +38748,15 @@ var QuestionToolbox = /** @class */ (function (_super) {
38561
38748
  }
38562
38749
  return null;
38563
38750
  };
38564
- QuestionToolbox.prototype.onItemsChanged = function () {
38751
+ QuestionToolbox.prototype.onItemsChanged = function (changeActions) {
38752
+ if (changeActions === void 0) { changeActions = true; }
38565
38753
  var categories = new Array();
38566
38754
  var categoriesHash = {};
38567
38755
  var prevActiveCategory = this.activeCategory;
38568
38756
  for (var i = 0; i < this.actions.length; i++) {
38569
38757
  var item = this.actions[i];
38758
+ if (item.visible === false)
38759
+ continue;
38570
38760
  var categoryName = item.category ? item.category : _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("ed.toolboxGeneralCategory");
38571
38761
  if (!categoriesHash[categoryName]) {
38572
38762
  var category = this.createCategory();
@@ -38593,11 +38783,13 @@ var QuestionToolbox = /** @class */ (function (_super) {
38593
38783
  }
38594
38784
  }
38595
38785
  }
38596
- var newItems = [];
38597
- this.categories.forEach(function (cat) {
38598
- newItems = newItems.concat(cat.items);
38599
- });
38600
- this.actions = newItems;
38786
+ if (changeActions) {
38787
+ var newItems_1 = [];
38788
+ this.categories.forEach(function (cat) {
38789
+ newItems_1 = newItems_1.concat(cat.items);
38790
+ });
38791
+ this.actions = newItems_1;
38792
+ }
38601
38793
  this.hasCategories = categories.length > 1;
38602
38794
  //this.updateCategoriesState();
38603
38795
  this.updateItemSeparators();