survey-creator-js 1.12.21 → 2.0.0-rc.0
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/index.html +1 -1
- package/package.json +4 -4
- package/survey-creator-js.js +71 -25
- package/survey-creator-js.js.map +1 -1
- package/survey-creator-js.min.js +1 -1
- package/survey-creator-js.min.js.LICENSE.txt +1 -1
- package/typings/survey-creator-react/src/Navigation.d.ts +0 -1
- package/typings/survey-creator-react/src/events.d.ts +0 -1
- package/typings/survey-creator-react/src/toolbox/ToolboxItem.d.ts +3 -0
package/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<!-- <script src="./build/survey-creator-js.js"></script> -->
|
|
21
21
|
|
|
22
22
|
<!--<script src="./build/survey-creator-react.js"></script>-->
|
|
23
|
-
<link rel="stylesheet" type="text/css" href="./node_modules/survey-core/
|
|
23
|
+
<link rel="stylesheet" type="text/css" href="./node_modules/survey-core/default.css" />
|
|
24
24
|
<!-- <link rel="stylesheet" type="text/css" href="./node_modules/survey-core/modern.css" /> -->
|
|
25
25
|
<link rel="stylesheet" type="text/css" href="./node_modules/survey-creator-core/survey-creator-core.css" />
|
|
26
26
|
<!-- <link rel="stylesheet" type="text/css" href="./build/survey-creator-react.css" /> -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-creator-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "Use SurveyJS Creator to create or edit JSON for SurveyJS Form Library.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Survey",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"typings": "./typings/survey-creator-js/entries/index.d.ts",
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"ace-builds": "^1.4.12",
|
|
30
|
-
"survey-core": "
|
|
31
|
-
"survey-js-ui": "
|
|
32
|
-
"survey-creator-core": "
|
|
30
|
+
"survey-core": "2.0.0-rc.0",
|
|
31
|
+
"survey-js-ui": "2.0.0-rc.0",
|
|
32
|
+
"survey-creator-core": "2.0.0-rc.0",
|
|
33
33
|
"@types/react-dom": "*",
|
|
34
34
|
"@types/react": "*"
|
|
35
35
|
},
|
package/survey-creator-js.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator UI
|
|
2
|
+
* SurveyJS Creator UI v2.0.0-rc.0
|
|
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
|
|
@@ -1377,9 +1377,8 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
1377
1377
|
var SurveyLocStringEditor = /** @class */ (function (_super) {
|
|
1378
1378
|
__extends(SurveyLocStringEditor, _super);
|
|
1379
1379
|
function SurveyLocStringEditor(props) {
|
|
1380
|
-
var _this = this;
|
|
1381
1380
|
var _a;
|
|
1382
|
-
_this = _super.call(this, props) || this;
|
|
1381
|
+
var _this = _super.call(this, props) || this;
|
|
1383
1382
|
_this.onChangedHandler = function (sender, options) {
|
|
1384
1383
|
_this.setState({ changed: !!_this.state && _this.state.changed ? _this.state.changed + 1 : 1 });
|
|
1385
1384
|
};
|
|
@@ -1868,6 +1867,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
1868
1867
|
|
|
1869
1868
|
|
|
1870
1869
|
|
|
1870
|
+
|
|
1871
1871
|
var TabbedMenuComponent = /** @class */ (function (_super) {
|
|
1872
1872
|
__extends(TabbedMenuComponent, _super);
|
|
1873
1873
|
function TabbedMenuComponent(props) {
|
|
@@ -1886,7 +1886,7 @@ var TabbedMenuComponent = /** @class */ (function (_super) {
|
|
|
1886
1886
|
return this.model;
|
|
1887
1887
|
};
|
|
1888
1888
|
TabbedMenuComponent.prototype.renderElement = function () {
|
|
1889
|
-
var items = this.model.renderedActions.map(function (item) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(TabbedMenuItemWrapper, { item: item, key: item.
|
|
1889
|
+
var items = this.model.renderedActions.map(function (item) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(TabbedMenuItemWrapper, { item: item, key: item.renderedId }); });
|
|
1890
1890
|
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { ref: this.rootRef, className: "svc-tabbed-menu" }, items));
|
|
1891
1891
|
};
|
|
1892
1892
|
TabbedMenuComponent.prototype.componentDidMount = function () {
|
|
@@ -1894,7 +1894,7 @@ var TabbedMenuComponent = /** @class */ (function (_super) {
|
|
|
1894
1894
|
var container = this.rootRef.current;
|
|
1895
1895
|
if (!container)
|
|
1896
1896
|
return;
|
|
1897
|
-
this.manager = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ResponsivityManager(container, this.model
|
|
1897
|
+
this.manager = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ResponsivityManager(container, this.model);
|
|
1898
1898
|
};
|
|
1899
1899
|
TabbedMenuComponent.prototype.componentWillUnmount = function () {
|
|
1900
1900
|
this.manager && (this.manager.dispose());
|
|
@@ -1905,8 +1905,10 @@ var TabbedMenuComponent = /** @class */ (function (_super) {
|
|
|
1905
1905
|
|
|
1906
1906
|
var TabbedMenuItemWrapper = /** @class */ (function (_super) {
|
|
1907
1907
|
__extends(TabbedMenuItemWrapper, _super);
|
|
1908
|
-
function TabbedMenuItemWrapper() {
|
|
1909
|
-
|
|
1908
|
+
function TabbedMenuItemWrapper(props) {
|
|
1909
|
+
var _this = _super.call(this, props) || this;
|
|
1910
|
+
_this.ref = react__WEBPACK_IMPORTED_MODULE_0__.createRef();
|
|
1911
|
+
return _this;
|
|
1910
1912
|
}
|
|
1911
1913
|
Object.defineProperty(TabbedMenuItemWrapper.prototype, "item", {
|
|
1912
1914
|
get: function () {
|
|
@@ -1925,9 +1927,33 @@ var TabbedMenuItemWrapper = /** @class */ (function (_super) {
|
|
|
1925
1927
|
}
|
|
1926
1928
|
css += (!this.item.isVisible ? " sv-action--hidden" : "");
|
|
1927
1929
|
var component = react__WEBPACK_IMPORTED_MODULE_0__.ReactElementFactory.Instance.createElement(this.item.component || "svc-tabbed-menu-item", { item: this.item });
|
|
1928
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { key: this.item.id, className: css },
|
|
1930
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { key: this.item.id, className: css, ref: this.ref },
|
|
1929
1931
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "sv-action__content" }, component)));
|
|
1930
1932
|
};
|
|
1933
|
+
TabbedMenuItemWrapper.prototype.componentDidMount = function () {
|
|
1934
|
+
var _this = this;
|
|
1935
|
+
_super.prototype.componentDidMount.call(this);
|
|
1936
|
+
this.item.updateModeCallback = function (mode, callback) {
|
|
1937
|
+
queueMicrotask(function () {
|
|
1938
|
+
if (react__WEBPACK_IMPORTED_MODULE_0__.flushSync) {
|
|
1939
|
+
react__WEBPACK_IMPORTED_MODULE_0__.flushSync(function () {
|
|
1940
|
+
_this.item.mode = mode;
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
else {
|
|
1944
|
+
_this.item.mode = mode;
|
|
1945
|
+
}
|
|
1946
|
+
queueMicrotask(function () {
|
|
1947
|
+
callback(mode, _this.ref.current);
|
|
1948
|
+
});
|
|
1949
|
+
});
|
|
1950
|
+
};
|
|
1951
|
+
this.item.afterRender();
|
|
1952
|
+
};
|
|
1953
|
+
TabbedMenuItemWrapper.prototype.componentWillUnmount = function () {
|
|
1954
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
1955
|
+
this.item.updateModeCallback = undefined;
|
|
1956
|
+
};
|
|
1931
1957
|
return TabbedMenuItemWrapper;
|
|
1932
1958
|
}(react__WEBPACK_IMPORTED_MODULE_0__.SurveyElementBase));
|
|
1933
1959
|
var TabbedMenuItemComponent = /** @class */ (function (_super) {
|
|
@@ -2205,7 +2231,8 @@ var CreatorSurveyPageComponent = /** @class */ (function (_super) {
|
|
|
2205
2231
|
CreatorSurveyPageComponent.prototype.renderHeader = function () {
|
|
2206
2232
|
var _this = this;
|
|
2207
2233
|
var actions = (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "svc-page__content-actions" },
|
|
2208
|
-
react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.SurveyActionBar, { model: this.model.actionContainer })
|
|
2234
|
+
react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.SurveyActionBar, { model: this.model.actionContainer }),
|
|
2235
|
+
(this.model.topActionContainer.hasActions ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.SurveyActionBar, { model: this.model.topActionContainer }) : null)));
|
|
2209
2236
|
if (this.model.isGhost || !this.model.allowDragging) {
|
|
2210
2237
|
return actions;
|
|
2211
2238
|
}
|
|
@@ -3791,7 +3818,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3791
3818
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
3792
3819
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_63___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_63__);
|
|
3793
3820
|
var Version;
|
|
3794
|
-
Version = "".concat("
|
|
3821
|
+
Version = "".concat("2.0.0-rc.0");
|
|
3795
3822
|
// import "@survey/creator/survey-creator-core.css";
|
|
3796
3823
|
|
|
3797
3824
|
|
|
@@ -3864,7 +3891,7 @@ Version = "".concat("1.12.21");
|
|
|
3864
3891
|
|
|
3865
3892
|
|
|
3866
3893
|
|
|
3867
|
-
(0,survey_core__WEBPACK_IMPORTED_MODULE_63__.checkLibraryVersion)("".concat("
|
|
3894
|
+
(0,survey_core__WEBPACK_IMPORTED_MODULE_63__.checkLibraryVersion)("".concat("2.0.0-rc.0"), "survey-creator-react");
|
|
3868
3895
|
|
|
3869
3896
|
|
|
3870
3897
|
/***/ }),
|
|
@@ -5204,7 +5231,7 @@ var TabPreviewSurveyComponent = /** @class */ (function (_super) {
|
|
|
5204
5231
|
return TabPreviewSurveyComponent;
|
|
5205
5232
|
}(react__WEBPACK_IMPORTED_MODULE_0__.SurveyElementBase));
|
|
5206
5233
|
|
|
5207
|
-
react__WEBPACK_IMPORTED_MODULE_0__.ReactElementFactory.Instance.registerElement("svc-tab-
|
|
5234
|
+
react__WEBPACK_IMPORTED_MODULE_0__.ReactElementFactory.Instance.registerElement("svc-tab-preview", function (props) {
|
|
5208
5235
|
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(TabPreviewSurveyComponent, props);
|
|
5209
5236
|
});
|
|
5210
5237
|
|
|
@@ -5667,17 +5694,12 @@ var AdaptiveToolbox = /** @class */ (function (_super) {
|
|
|
5667
5694
|
return _this;
|
|
5668
5695
|
}
|
|
5669
5696
|
AdaptiveToolbox.prototype.componentDidMount = function () {
|
|
5670
|
-
var _this = this;
|
|
5671
5697
|
_super.prototype.componentDidMount.call(this);
|
|
5672
5698
|
var container = this.rootRef.current;
|
|
5673
5699
|
this.toolbox.setRootElement(container);
|
|
5674
5700
|
if (!container)
|
|
5675
5701
|
return;
|
|
5676
|
-
this.manager = new survey_core__WEBPACK_IMPORTED_MODULE_1__.VerticalResponsivityManager(this.toolbox.containerElement, this.toolbox
|
|
5677
|
-
if (!_this.toolbox.isResponsivenessDisabled) {
|
|
5678
|
-
callback();
|
|
5679
|
-
}
|
|
5680
|
-
}, 10); });
|
|
5702
|
+
this.manager = new survey_core__WEBPACK_IMPORTED_MODULE_1__.VerticalResponsivityManager(this.toolbox.containerElement, this.toolbox);
|
|
5681
5703
|
};
|
|
5682
5704
|
AdaptiveToolbox.prototype.componentWillUnmount = function () {
|
|
5683
5705
|
this.manager && (this.manager.dispose());
|
|
@@ -5704,12 +5726,9 @@ var AdaptiveToolbox = /** @class */ (function (_super) {
|
|
|
5704
5726
|
AdaptiveToolbox.prototype.renderItems = function (items, isCompact) {
|
|
5705
5727
|
var _this = this;
|
|
5706
5728
|
if (isCompact === void 0) { isCompact = false; }
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
var tool = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ToolboxItem__WEBPACK_IMPORTED_MODULE_2__.SurveyCreatorToolboxTool, { item: item, creator: _this.creator, parentModel: _this.toolbox, isCompact: isCompact, key: "item" + itemIndex });
|
|
5710
|
-
result.push(tool);
|
|
5729
|
+
return items.map(function (item, itemIndex) {
|
|
5730
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ToolboxItem__WEBPACK_IMPORTED_MODULE_2__.SurveyCreatorToolboxTool, { item: item, creator: _this.creator, parentModel: _this.toolbox, isCompact: isCompact, key: item.renderedId });
|
|
5711
5731
|
});
|
|
5712
|
-
return result;
|
|
5713
5732
|
};
|
|
5714
5733
|
AdaptiveToolbox.prototype.renderCategories = function () {
|
|
5715
5734
|
var _this = this;
|
|
@@ -5895,10 +5914,13 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
5895
5914
|
|
|
5896
5915
|
|
|
5897
5916
|
|
|
5917
|
+
|
|
5898
5918
|
var SurveyCreatorToolboxTool = /** @class */ (function (_super) {
|
|
5899
5919
|
__extends(SurveyCreatorToolboxTool, _super);
|
|
5900
5920
|
function SurveyCreatorToolboxTool(props) {
|
|
5901
|
-
|
|
5921
|
+
var _this = _super.call(this, props) || this;
|
|
5922
|
+
_this.rootRef = react__WEBPACK_IMPORTED_MODULE_0__.createRef();
|
|
5923
|
+
return _this;
|
|
5902
5924
|
}
|
|
5903
5925
|
SurveyCreatorToolboxTool.prototype.createModel = function (props) {
|
|
5904
5926
|
this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__.ToolboxToolViewModel(props.item, props.creator, props.parentModel);
|
|
@@ -5940,13 +5962,37 @@ var SurveyCreatorToolboxTool = /** @class */ (function (_super) {
|
|
|
5940
5962
|
model: this.model,
|
|
5941
5963
|
isCompact: this.isCompact
|
|
5942
5964
|
});
|
|
5943
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: item.css, key: item.id },
|
|
5965
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: item.css, key: item.id, ref: this.rootRef },
|
|
5944
5966
|
(item.needSeparator && !this.creator.toolbox.showCategoryTitles) ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "svc-toolbox__category-separator" })) : null,
|
|
5945
5967
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "svc-toolbox__tool-content sv-action__content", onPointerDown: function (event) {
|
|
5946
5968
|
event.persist();
|
|
5947
5969
|
_this.model.onPointerDown(event);
|
|
5948
5970
|
} }, itemComponent)));
|
|
5949
5971
|
};
|
|
5972
|
+
SurveyCreatorToolboxTool.prototype.componentWillUnmount = function () {
|
|
5973
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
5974
|
+
this.item.updateModeCallback = undefined;
|
|
5975
|
+
};
|
|
5976
|
+
SurveyCreatorToolboxTool.prototype.componentDidMount = function () {
|
|
5977
|
+
var _this = this;
|
|
5978
|
+
_super.prototype.componentDidMount.call(this);
|
|
5979
|
+
this.item.updateModeCallback = function (mode, callback) {
|
|
5980
|
+
queueMicrotask(function () {
|
|
5981
|
+
if (react__WEBPACK_IMPORTED_MODULE_0__.flushSync) {
|
|
5982
|
+
react__WEBPACK_IMPORTED_MODULE_0__.flushSync(function () {
|
|
5983
|
+
_this.item.mode = mode;
|
|
5984
|
+
});
|
|
5985
|
+
}
|
|
5986
|
+
else {
|
|
5987
|
+
_this.item.mode = mode;
|
|
5988
|
+
}
|
|
5989
|
+
queueMicrotask(function () {
|
|
5990
|
+
callback(mode, _this.rootRef.current);
|
|
5991
|
+
});
|
|
5992
|
+
});
|
|
5993
|
+
};
|
|
5994
|
+
this.item.afterRender();
|
|
5995
|
+
};
|
|
5950
5996
|
return SurveyCreatorToolboxTool;
|
|
5951
5997
|
}(_ModelElement__WEBPACK_IMPORTED_MODULE_2__.CreatorModelElement));
|
|
5952
5998
|
|