survey-creator-react 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 React v2.0.9
2
+ * SurveyJS Creator React 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
@@ -359,6 +359,11 @@ class ReactDragEvent extends ReactMouseEvent {
359
359
  }
360
360
  }
361
361
 
362
+ function QuestionElementContentFunc(props) {
363
+ return props.element;
364
+ }
365
+ const QuestionElementContent = React.memo(QuestionElementContentFunc);
366
+ QuestionElementContent.displayName = "QuestionElementContent";
362
367
  class QuestionAdornerComponent extends CreatorModelElement {
363
368
  constructor(props) {
364
369
  super(props);
@@ -433,7 +438,7 @@ class QuestionAdornerComponent extends CreatorModelElement {
433
438
  }
434
439
  renderElementContent() {
435
440
  return (React.createElement(React.Fragment, null,
436
- this.props.element,
441
+ React.createElement(QuestionElementContent, { element: this.props.element }),
437
442
  this.renderElementPlaceholder(),
438
443
  this.renderCarryForwardBanner()));
439
444
  }
@@ -732,6 +737,10 @@ ReactElementFactory.Instance.registerElement("svc-cell-dropdown-question", (prop
732
737
  return React.createElement(CellQuestionDropdownAdornerComponent, props);
733
738
  });
734
739
 
740
+ const PageElementContent = React.memo(({ page, survey, creator }) => {
741
+ return React.createElement(SurveyPage, { page: page, survey: survey, creator: creator });
742
+ });
743
+ PageElementContent.displayName = "PageElementContent";
735
744
  class CreatorSurveyPageComponent extends CreatorModelElement {
736
745
  constructor(props) {
737
746
  super(props);
@@ -741,9 +750,12 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
741
750
  if (this.model) {
742
751
  this.model.attachToUI(props.page, this.rootRef.current);
743
752
  }
744
- this.model = new PageAdorner(props.creator, props.page);
753
+ this.model = this.createPageAdorner(props.creator, props.page);
745
754
  this.model.isGhost = this.props.isGhost;
746
755
  }
756
+ createPageAdorner(creator, page) {
757
+ return new PageAdorner(creator, page);
758
+ }
747
759
  shouldComponentUpdate(nextProps, nextState) {
748
760
  const res = super.shouldComponentUpdate(nextProps, nextState);
749
761
  if (this.model) {
@@ -793,7 +805,7 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
793
805
  React.createElement("div", { className: "svc-panel__placeholder" }, this.model.placeholderText))));
794
806
  }
795
807
  renderContent() {
796
- return (React.createElement(SurveyPage, { page: this.props.page, survey: this.props.survey, creator: this.props.creator, css: this.model.css }));
808
+ return (React.createElement(PageElementContent, { page: this.props.page, survey: this.props.survey, creator: this.props.creator }));
797
809
  }
798
810
  renderHeader() {
799
811
  const actions = (React.createElement("div", { className: "svc-page__content-actions" },
@@ -2813,8 +2825,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2813
2825
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2814
2826
 
2815
2827
  let Version;
2816
- Version = `${"2.0.9"}`;
2817
- checkLibraryVersion(`${"2.0.9"}`, "survey-creator-react");
2828
+ Version = `${"2.0.10"}`;
2829
+ checkLibraryVersion(`${"2.0.10"}`, "survey-creator-react");
2818
2830
 
2819
2831
  export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, CreatorSurveyPageComponent, ImageItemValueAdornerComponent, ItemValueAdornerComponent, LogoImageComponent, MatrixCellAdornerComponent, PanelAdornerComponent, PropertyGridComponent, PropertyGridPlaceholderComponent, QuestionAdornerComponent, QuestionBanner, QuestionDropdownAdornerComponent, QuestionEditorContentComponent, QuestionErrorComponent, QuestionImageAdornerComponent, QuestionRatingAdornerComponent, QuestionWidgetAdornerComponent, QuestionWrapperFooter, QuestionWrapperHeader, ReactDragEvent, ReactMouseEvent, RowWrapper, SearchComponent, SideBarDefaultHeader, SidebarComponent, SurveyCreator, SurveyCreatorComponent, SurveyCreatorToolboxCategory, SurveyCreatorToolboxItem, SurveyCreatorToolboxItemGroup, SurveyCreatorToolboxTool, SurveyElementEmbeddedSurvey, SurveyLocStringEditor, SurveyLogicOpertor, SurveyNavigation, SurveyQuestionBooleanSwitch, SurveyQuestionColor, SurveyQuestionFileEditor, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyQuestionTextWithReset, SurveyResults, SurveyResultsByRow, SurveySimulator, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
2820
2832
  //# sourceMappingURL=survey-creator-react.mjs.map