labellife-design-tool 2.3.3 → 2.3.4
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/dist/cjs/canvas/workspace.js +115 -44
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/index.js +212 -95
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/side-panel/index.js +97 -51
- package/dist/cjs/side-panel/index.js.map +1 -1
- package/dist/esm/canvas/workspace.js +115 -44
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/index.js +212 -95
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/side-panel/index.js +97 -51
- package/dist/esm/side-panel/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4867,46 +4867,50 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
4867
4867
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
4868
4868
|
radioOptions = _useState22[0],
|
|
4869
4869
|
setRadioOptions = _useState22[1];
|
|
4870
|
-
var _useState23 = react.useState(
|
|
4870
|
+
var _useState23 = react.useState(false),
|
|
4871
4871
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
var _useState25 = react.useState(
|
|
4872
|
+
radioAllowCustom = _useState24[0],
|
|
4873
|
+
setRadioAllowCustom = _useState24[1];
|
|
4874
|
+
var _useState25 = react.useState(''),
|
|
4875
4875
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
var _useState27 = react.useState(
|
|
4876
|
+
listPrompt = _useState26[0],
|
|
4877
|
+
setListPrompt = _useState26[1];
|
|
4878
|
+
var _useState27 = react.useState(0),
|
|
4879
4879
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
var _useState29 = react.useState(
|
|
4880
|
+
listMinSelections = _useState28[0],
|
|
4881
|
+
setListMinSelections = _useState28[1];
|
|
4882
|
+
var _useState29 = react.useState(2),
|
|
4883
4883
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
var _useState31 = react.useState(
|
|
4884
|
+
listMaxSelections = _useState30[0],
|
|
4885
|
+
setListMaxSelections = _useState30[1];
|
|
4886
|
+
var _useState31 = react.useState(['Option 1', 'Option 2']),
|
|
4887
4887
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
4888
|
-
|
|
4889
|
-
|
|
4888
|
+
listOptions = _useState32[0],
|
|
4889
|
+
setListOptions = _useState32[1];
|
|
4890
4890
|
var _useState33 = react.useState(false),
|
|
4891
4891
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
4892
|
-
|
|
4893
|
-
|
|
4892
|
+
textRemoveIfSkipped = _useState34[0],
|
|
4893
|
+
setTextRemoveIfSkipped = _useState34[1];
|
|
4894
4894
|
var _useState35 = react.useState(false),
|
|
4895
4895
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
4896
|
-
|
|
4897
|
-
|
|
4896
|
+
dateRemoveIfSkipped = _useState36[0],
|
|
4897
|
+
setDateRemoveIfSkipped = _useState36[1];
|
|
4898
4898
|
var _useState37 = react.useState(false),
|
|
4899
4899
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
4900
|
-
|
|
4901
|
-
|
|
4900
|
+
integerRemoveIfSkipped = _useState38[0],
|
|
4901
|
+
setIntegerRemoveIfSkipped = _useState38[1];
|
|
4902
4902
|
var _useState39 = react.useState(false),
|
|
4903
4903
|
_useState40 = _slicedToArray(_useState39, 2),
|
|
4904
|
-
|
|
4905
|
-
|
|
4904
|
+
imageRemoveIfSkipped = _useState40[0],
|
|
4905
|
+
setImageRemoveIfSkipped = _useState40[1];
|
|
4906
4906
|
var _useState41 = react.useState(false),
|
|
4907
4907
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
4908
|
-
|
|
4909
|
-
|
|
4908
|
+
radioRemoveIfSkipped = _useState42[0],
|
|
4909
|
+
setRadioRemoveIfSkipped = _useState42[1];
|
|
4910
|
+
var _useState43 = react.useState(false),
|
|
4911
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
4912
|
+
listRemoveIfSkipped = _useState44[0],
|
|
4913
|
+
setListRemoveIfSkipped = _useState44[1];
|
|
4910
4914
|
var addInputElement = function addInputElement(inputType) {
|
|
4911
4915
|
var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
4912
4916
|
var page = store.activePage;
|
|
@@ -4978,7 +4982,7 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
4978
4982
|
fontFamily: 'Roboto',
|
|
4979
4983
|
align: 'center',
|
|
4980
4984
|
fill: '#333333',
|
|
4981
|
-
custom: _objectSpread2(_objectSpread2(_objectSpread2({
|
|
4985
|
+
custom: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
4982
4986
|
inputField: true,
|
|
4983
4987
|
inputType: inputType,
|
|
4984
4988
|
placeholder: placeholder,
|
|
@@ -4989,6 +4993,8 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
4989
4993
|
dateFormat: extra.dateFormat || 'MM-DD-YYYY'
|
|
4990
4994
|
} : {}), ['radio', 'list'].includes(inputType) ? {
|
|
4991
4995
|
options: (extra.options || []).filter(Boolean)
|
|
4996
|
+
} : {}), inputType === 'radio' ? {
|
|
4997
|
+
allowCustomValue: extra.allowCustomValue || false
|
|
4992
4998
|
} : {}), inputType === 'list' ? {
|
|
4993
4999
|
minSelections: extra.minSelections || 0,
|
|
4994
5000
|
maxSelections: extra.maxSelections || 0
|
|
@@ -5316,7 +5322,8 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
5316
5322
|
promptText: radioPrompt,
|
|
5317
5323
|
required: radioRequired,
|
|
5318
5324
|
options: radioOptions,
|
|
5319
|
-
removeIfSkipped: radioRemoveIfSkipped
|
|
5325
|
+
removeIfSkipped: radioRemoveIfSkipped,
|
|
5326
|
+
allowCustomValue: radioAllowCustom
|
|
5320
5327
|
});
|
|
5321
5328
|
}
|
|
5322
5329
|
}), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
|
|
@@ -5368,6 +5375,23 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
5368
5375
|
sx: {
|
|
5369
5376
|
ml: 5.5
|
|
5370
5377
|
}
|
|
5378
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.FormControlLabel, {
|
|
5379
|
+
control: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
|
|
5380
|
+
size: "small",
|
|
5381
|
+
checked: radioAllowCustom,
|
|
5382
|
+
onChange: function onChange(e) {
|
|
5383
|
+
return setRadioAllowCustom(e.target.checked);
|
|
5384
|
+
}
|
|
5385
|
+
}),
|
|
5386
|
+
label: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
5387
|
+
sx: {
|
|
5388
|
+
fontSize: 12
|
|
5389
|
+
},
|
|
5390
|
+
children: t('sidePanel.inputFields.allowCustomValue', 'Allow "Other" (custom input)')
|
|
5391
|
+
}),
|
|
5392
|
+
sx: {
|
|
5393
|
+
ml: 5.5
|
|
5394
|
+
}
|
|
5371
5395
|
}), /*#__PURE__*/jsxRuntime.jsx(OptionsEditor, {
|
|
5372
5396
|
options: radioOptions,
|
|
5373
5397
|
onChange: setRadioOptions
|
|
@@ -5505,34 +5529,38 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
|
|
|
5505
5529
|
var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
5506
5530
|
var _selectedElement$cust;
|
|
5507
5531
|
var store = _ref4.store;
|
|
5508
|
-
var
|
|
5509
|
-
_useState44 = _slicedToArray(_useState43, 2),
|
|
5510
|
-
markLabel = _useState44[0],
|
|
5511
|
-
setMarkLabel = _useState44[1];
|
|
5512
|
-
var _useState45 = react.useState(false),
|
|
5532
|
+
var _useState45 = react.useState(''),
|
|
5513
5533
|
_useState46 = _slicedToArray(_useState45, 2),
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
var _useState47 = react.useState(
|
|
5534
|
+
markLabel = _useState46[0],
|
|
5535
|
+
setMarkLabel = _useState46[1];
|
|
5536
|
+
var _useState47 = react.useState(false),
|
|
5517
5537
|
_useState48 = _slicedToArray(_useState47, 2),
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
var _useState49 = react.useState(
|
|
5538
|
+
markRequired = _useState48[0],
|
|
5539
|
+
setMarkRequired = _useState48[1];
|
|
5540
|
+
var _useState49 = react.useState('text'),
|
|
5521
5541
|
_useState50 = _slicedToArray(_useState49, 2),
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
var _useState51 = react.useState(
|
|
5542
|
+
markInputType = _useState50[0],
|
|
5543
|
+
setMarkInputType = _useState50[1];
|
|
5544
|
+
var _useState51 = react.useState(['Option 1', 'Option 2']),
|
|
5525
5545
|
_useState52 = _slicedToArray(_useState51, 2),
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
var _useState53 = react.useState(
|
|
5546
|
+
markOptions = _useState52[0],
|
|
5547
|
+
setMarkOptions = _useState52[1];
|
|
5548
|
+
var _useState53 = react.useState(0),
|
|
5529
5549
|
_useState54 = _slicedToArray(_useState53, 2),
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
var _useState55 = react.useState(
|
|
5550
|
+
markMinSelections = _useState54[0],
|
|
5551
|
+
setMarkMinSelections = _useState54[1];
|
|
5552
|
+
var _useState55 = react.useState(2),
|
|
5533
5553
|
_useState56 = _slicedToArray(_useState55, 2),
|
|
5534
|
-
|
|
5535
|
-
|
|
5554
|
+
markMaxSelections = _useState56[0],
|
|
5555
|
+
setMarkMaxSelections = _useState56[1];
|
|
5556
|
+
var _useState57 = react.useState(false),
|
|
5557
|
+
_useState58 = _slicedToArray(_useState57, 2),
|
|
5558
|
+
markRemoveIfSkipped = _useState58[0],
|
|
5559
|
+
setMarkRemoveIfSkipped = _useState58[1];
|
|
5560
|
+
var _useState59 = react.useState(false),
|
|
5561
|
+
_useState60 = _slicedToArray(_useState59, 2),
|
|
5562
|
+
markAllowCustom = _useState60[0],
|
|
5563
|
+
setMarkAllowCustom = _useState60[1];
|
|
5536
5564
|
var selectedIds = store.selectedElementsIds || [];
|
|
5537
5565
|
var selectedElement = selectedIds.length === 1 ? store.getElementById(selectedIds[0]) : null;
|
|
5538
5566
|
var isImageElement = (selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.type) === 'image';
|
|
@@ -5541,7 +5569,7 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
|
5541
5569
|
var isAlreadyVariable = !!(selectedElement !== null && selectedElement !== void 0 && (_selectedElement$cust = selectedElement.custom) !== null && _selectedElement$cust !== void 0 && _selectedElement$cust.inputField);
|
|
5542
5570
|
react.useEffect(function () {
|
|
5543
5571
|
if (selectedElement && isSupportedElement) {
|
|
5544
|
-
var _selectedElement$cust2, _selectedElement$cust3, _selectedElement$cust4, _selectedElement$cust5, _selectedElement$cust6, _selectedElement$cust7, _selectedElement$cust8;
|
|
5572
|
+
var _selectedElement$cust2, _selectedElement$cust3, _selectedElement$cust4, _selectedElement$cust5, _selectedElement$cust6, _selectedElement$cust7, _selectedElement$cust8, _selectedElement$cust9;
|
|
5545
5573
|
setMarkLabel(((_selectedElement$cust2 = selectedElement.custom) === null || _selectedElement$cust2 === void 0 ? void 0 : _selectedElement$cust2.promptText) || '');
|
|
5546
5574
|
setMarkRequired(!!((_selectedElement$cust3 = selectedElement.custom) !== null && _selectedElement$cust3 !== void 0 && _selectedElement$cust3.required));
|
|
5547
5575
|
setMarkInputType(isImageElement ? 'image' : ((_selectedElement$cust4 = selectedElement.custom) === null || _selectedElement$cust4 === void 0 ? void 0 : _selectedElement$cust4.inputType) || 'text');
|
|
@@ -5549,6 +5577,7 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
|
5549
5577
|
setMarkMinSelections(((_selectedElement$cust6 = selectedElement.custom) === null || _selectedElement$cust6 === void 0 ? void 0 : _selectedElement$cust6.minSelections) || 0);
|
|
5550
5578
|
setMarkMaxSelections(((_selectedElement$cust7 = selectedElement.custom) === null || _selectedElement$cust7 === void 0 ? void 0 : _selectedElement$cust7.maxSelections) || 2);
|
|
5551
5579
|
setMarkRemoveIfSkipped(!!((_selectedElement$cust8 = selectedElement.custom) !== null && _selectedElement$cust8 !== void 0 && _selectedElement$cust8.removeIfSkipped));
|
|
5580
|
+
setMarkAllowCustom(!!((_selectedElement$cust9 = selectedElement.custom) !== null && _selectedElement$cust9 !== void 0 && _selectedElement$cust9.allowCustomValue));
|
|
5552
5581
|
} else {
|
|
5553
5582
|
setMarkLabel('');
|
|
5554
5583
|
setMarkRequired(false);
|
|
@@ -5557,13 +5586,14 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
|
5557
5586
|
setMarkMinSelections(0);
|
|
5558
5587
|
setMarkMaxSelections(2);
|
|
5559
5588
|
setMarkRemoveIfSkipped(false);
|
|
5589
|
+
setMarkAllowCustom(false);
|
|
5560
5590
|
}
|
|
5561
5591
|
}, [selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.id]);
|
|
5562
5592
|
var handleMark = function handleMark() {
|
|
5563
5593
|
if (!selectedElement || !markLabel.trim()) return;
|
|
5564
5594
|
var effectiveType = isImageElement ? 'image' : markInputType;
|
|
5565
5595
|
selectedElement.set({
|
|
5566
|
-
custom: _objectSpread2(_objectSpread2(_objectSpread2({}, selectedElement.custom), {}, {
|
|
5596
|
+
custom: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, selectedElement.custom), {}, {
|
|
5567
5597
|
inputField: true,
|
|
5568
5598
|
promptText: markLabel.trim(),
|
|
5569
5599
|
inputType: effectiveType,
|
|
@@ -5571,6 +5601,8 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
|
5571
5601
|
removeIfSkipped: !markRequired && markRemoveIfSkipped
|
|
5572
5602
|
}, ['radio', 'list'].includes(effectiveType) ? {
|
|
5573
5603
|
options: markOptions.filter(Boolean)
|
|
5604
|
+
} : {}), effectiveType === 'radio' ? {
|
|
5605
|
+
allowCustomValue: markAllowCustom
|
|
5574
5606
|
} : {}), effectiveType === 'list' ? {
|
|
5575
5607
|
minSelections: markMinSelections,
|
|
5576
5608
|
maxSelections: markMaxSelections
|
|
@@ -5741,6 +5773,20 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
|
|
|
5741
5773
|
options: markOptions,
|
|
5742
5774
|
onChange: setMarkOptions
|
|
5743
5775
|
})]
|
|
5776
|
+
}), isTextElement && markInputType === 'radio' && /*#__PURE__*/jsxRuntime.jsx(material.FormControlLabel, {
|
|
5777
|
+
control: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
|
|
5778
|
+
size: "small",
|
|
5779
|
+
checked: markAllowCustom,
|
|
5780
|
+
onChange: function onChange(e) {
|
|
5781
|
+
return setMarkAllowCustom(e.target.checked);
|
|
5782
|
+
}
|
|
5783
|
+
}),
|
|
5784
|
+
label: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
5785
|
+
sx: {
|
|
5786
|
+
fontSize: 12
|
|
5787
|
+
},
|
|
5788
|
+
children: t('sidePanel.inputFields.allowCustomValue', 'Allow "Other" (custom input)')
|
|
5789
|
+
})
|
|
5744
5790
|
}), isTextElement && markInputType === 'list' && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5745
5791
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
5746
5792
|
sx: {
|