survey-creator-js 2.0.9 → 2.0.10

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator UI v2.0.9
2
+ * SurveyJS Creator UI v2.0.10
3
3
  * (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -357,6 +357,11 @@ class ReactDragEvent extends ReactMouseEvent {
357
357
  }
358
358
  }
359
359
 
360
+ function QuestionElementContentFunc(props) {
361
+ return props.element;
362
+ }
363
+ const QuestionElementContent = React.memo(QuestionElementContentFunc);
364
+ QuestionElementContent.displayName = "QuestionElementContent";
360
365
  class QuestionAdornerComponent extends CreatorModelElement {
361
366
  constructor(props) {
362
367
  super(props);
@@ -431,7 +436,7 @@ class QuestionAdornerComponent extends CreatorModelElement {
431
436
  }
432
437
  renderElementContent() {
433
438
  return (React.createElement(React.Fragment, null,
434
- this.props.element,
439
+ React.createElement(QuestionElementContent, { element: this.props.element }),
435
440
  this.renderElementPlaceholder(),
436
441
  this.renderCarryForwardBanner()));
437
442
  }
@@ -730,6 +735,10 @@ ReactElementFactory.Instance.registerElement("svc-cell-dropdown-question", (prop
730
735
  return React.createElement(CellQuestionDropdownAdornerComponent, props);
731
736
  });
732
737
 
738
+ const PageElementContent = React.memo(({ page, survey, creator }) => {
739
+ return React.createElement(SurveyPage, { page: page, survey: survey, creator: creator });
740
+ });
741
+ PageElementContent.displayName = "PageElementContent";
733
742
  class CreatorSurveyPageComponent extends CreatorModelElement {
734
743
  constructor(props) {
735
744
  super(props);
@@ -739,9 +748,12 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
739
748
  if (this.model) {
740
749
  this.model.attachToUI(props.page, this.rootRef.current);
741
750
  }
742
- this.model = new PageAdorner(props.creator, props.page);
751
+ this.model = this.createPageAdorner(props.creator, props.page);
743
752
  this.model.isGhost = this.props.isGhost;
744
753
  }
754
+ createPageAdorner(creator, page) {
755
+ return new PageAdorner(creator, page);
756
+ }
745
757
  shouldComponentUpdate(nextProps, nextState) {
746
758
  const res = super.shouldComponentUpdate(nextProps, nextState);
747
759
  if (this.model) {
@@ -791,7 +803,7 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
791
803
  React.createElement("div", { className: "svc-panel__placeholder" }, this.model.placeholderText))));
792
804
  }
793
805
  renderContent() {
794
- return (React.createElement(SurveyPage, { page: this.props.page, survey: this.props.survey, creator: this.props.creator, css: this.model.css }));
806
+ return (React.createElement(PageElementContent, { page: this.props.page, survey: this.props.survey, creator: this.props.creator }));
795
807
  }
796
808
  renderHeader() {
797
809
  const actions = (React.createElement("div", { className: "svc-page__content-actions" },
@@ -2811,8 +2823,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2811
2823
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2812
2824
 
2813
2825
  let Version;
2814
- Version = `${"2.0.9"}`;
2815
- checkLibraryVersion(`${"2.0.9"}`, "survey-creator-react");
2826
+ Version = `${"2.0.10"}`;
2827
+ checkLibraryVersion(`${"2.0.10"}`, "survey-creator-react");
2816
2828
 
2817
2829
  function renderSurveyCreator(creator, element, props = {}) {
2818
2830
  let node = element;