labellife-design-tool 2.1.5 → 2.1.6
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 +175 -92
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/index.js +548 -210
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/side-panel/index.js +253 -5
- package/dist/cjs/side-panel/index.js.map +1 -1
- package/dist/cjs/toolbar/toolbar.js +118 -111
- package/dist/cjs/toolbar/toolbar.js.map +1 -1
- package/dist/esm/canvas/workspace.js +176 -93
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/index.js +549 -211
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/side-panel/index.js +254 -6
- package/dist/esm/side-panel/index.js.map +1 -1
- package/dist/esm/toolbar/toolbar.js +118 -111
- package/dist/esm/toolbar/toolbar.js.map +1 -1
- package/package.json +1 -1
|
@@ -1708,7 +1708,7 @@ function parseDateFromFormat(dateStr, format) {
|
|
|
1708
1708
|
return new Date();
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
|
-
// ── Default single-field dialog
|
|
1711
|
+
// ── Default single-field dialog (full-page overlay) ──────────────────
|
|
1712
1712
|
var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
1713
1713
|
var field = _ref.field,
|
|
1714
1714
|
onSubmit = _ref.onSubmit,
|
|
@@ -1730,6 +1730,9 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1730
1730
|
var promptText = custom.promptText || custom.placeholder || 'Please provide input';
|
|
1731
1731
|
var dateFormat = custom.dateFormat || 'MM-DD-YYYY';
|
|
1732
1732
|
var isRequired = custom.required === true;
|
|
1733
|
+
var logoUrl = config.logoUrl || null;
|
|
1734
|
+
var accentColor = config.accentColor || '#0d83cd';
|
|
1735
|
+
var progressPct = Math.round((currentIndex + 1) / totalCount * 100);
|
|
1733
1736
|
react.useEffect(function () {
|
|
1734
1737
|
setValue('');
|
|
1735
1738
|
setImagePreview(null);
|
|
@@ -1757,11 +1760,25 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1757
1760
|
}
|
|
1758
1761
|
};
|
|
1759
1762
|
var handleKeyDown = function handleKeyDown(e) {
|
|
1760
|
-
if (e.key === 'Enter')
|
|
1761
|
-
handleSubmit();
|
|
1762
|
-
}
|
|
1763
|
+
if (e.key === 'Enter' && inputType !== 'image') handleSubmit();
|
|
1763
1764
|
};
|
|
1764
1765
|
var renderInput = function renderInput() {
|
|
1766
|
+
var sharedSx = _objectSpread2({
|
|
1767
|
+
mt: 1,
|
|
1768
|
+
'& .MuiOutlinedInput-root': {
|
|
1769
|
+
borderRadius: '8px',
|
|
1770
|
+
fontSize: 22,
|
|
1771
|
+
'& fieldset': {
|
|
1772
|
+
borderColor: '#d0d5dd'
|
|
1773
|
+
},
|
|
1774
|
+
'&:hover fieldset': {
|
|
1775
|
+
borderColor: accentColor
|
|
1776
|
+
},
|
|
1777
|
+
'&.Mui-focused fieldset': {
|
|
1778
|
+
borderColor: accentColor
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
}, config.inputStyle);
|
|
1765
1782
|
switch (inputType) {
|
|
1766
1783
|
case 'date':
|
|
1767
1784
|
return /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
|
|
@@ -1773,13 +1790,10 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1773
1790
|
},
|
|
1774
1791
|
onKeyDown: handleKeyDown,
|
|
1775
1792
|
autoFocus: true,
|
|
1776
|
-
size: "small",
|
|
1777
|
-
sx: _objectSpread2({
|
|
1778
|
-
mt: 1
|
|
1779
|
-
}, config.inputStyle),
|
|
1780
1793
|
InputLabelProps: {
|
|
1781
1794
|
shrink: true
|
|
1782
|
-
}
|
|
1795
|
+
},
|
|
1796
|
+
sx: sharedSx
|
|
1783
1797
|
});
|
|
1784
1798
|
case 'integer':
|
|
1785
1799
|
return /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
|
|
@@ -1788,20 +1802,15 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1788
1802
|
value: value,
|
|
1789
1803
|
onChange: function onChange(e) {
|
|
1790
1804
|
var v = e.target.value;
|
|
1791
|
-
if (v === '' || /^-?\d*$/.test(v))
|
|
1792
|
-
setValue(v);
|
|
1793
|
-
}
|
|
1805
|
+
if (v === '' || /^-?\d*$/.test(v)) setValue(v);
|
|
1794
1806
|
},
|
|
1795
1807
|
onKeyDown: handleKeyDown,
|
|
1796
1808
|
autoFocus: true,
|
|
1797
|
-
size: "small",
|
|
1798
1809
|
placeholder: "0",
|
|
1799
1810
|
inputProps: {
|
|
1800
1811
|
step: 1
|
|
1801
1812
|
},
|
|
1802
|
-
sx:
|
|
1803
|
-
mt: 1
|
|
1804
|
-
}, config.inputStyle)
|
|
1813
|
+
sx: sharedSx
|
|
1805
1814
|
});
|
|
1806
1815
|
case 'image':
|
|
1807
1816
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
@@ -1821,13 +1830,13 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1821
1830
|
display: 'flex',
|
|
1822
1831
|
flexDirection: 'column',
|
|
1823
1832
|
alignItems: 'center',
|
|
1824
|
-
gap:
|
|
1833
|
+
gap: 2
|
|
1825
1834
|
},
|
|
1826
1835
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1827
1836
|
sx: {
|
|
1828
1837
|
width: '100%',
|
|
1829
|
-
maxHeight:
|
|
1830
|
-
borderRadius:
|
|
1838
|
+
maxHeight: 260,
|
|
1839
|
+
borderRadius: '10px',
|
|
1831
1840
|
overflow: 'hidden',
|
|
1832
1841
|
border: '1px solid #e0e0e0',
|
|
1833
1842
|
display: 'flex',
|
|
@@ -1840,20 +1849,21 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1840
1849
|
alt: "Preview",
|
|
1841
1850
|
style: {
|
|
1842
1851
|
maxWidth: '100%',
|
|
1843
|
-
maxHeight:
|
|
1852
|
+
maxHeight: 260,
|
|
1844
1853
|
objectFit: 'contain'
|
|
1845
1854
|
}
|
|
1846
1855
|
})
|
|
1847
1856
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Button, {
|
|
1848
1857
|
variant: "outlined",
|
|
1849
|
-
size: "small",
|
|
1850
1858
|
onClick: function onClick() {
|
|
1851
1859
|
var _fileInputRef$current;
|
|
1852
1860
|
return (_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 ? void 0 : _fileInputRef$current.click();
|
|
1853
1861
|
},
|
|
1854
1862
|
sx: {
|
|
1855
1863
|
textTransform: 'none',
|
|
1856
|
-
fontSize:
|
|
1864
|
+
fontSize: 13,
|
|
1865
|
+
borderRadius: '8px',
|
|
1866
|
+
borderColor: '#d0d5dd'
|
|
1857
1867
|
},
|
|
1858
1868
|
children: t('inputFieldsDialog.changeImage', 'Change Image')
|
|
1859
1869
|
})]
|
|
@@ -1863,28 +1873,28 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1863
1873
|
return (_fileInputRef$current2 = fileInputRef.current) === null || _fileInputRef$current2 === void 0 ? void 0 : _fileInputRef$current2.click();
|
|
1864
1874
|
},
|
|
1865
1875
|
sx: {
|
|
1866
|
-
border: '2px dashed #
|
|
1867
|
-
borderRadius: '
|
|
1868
|
-
p:
|
|
1876
|
+
border: '2px dashed #d0d5dd',
|
|
1877
|
+
borderRadius: '10px',
|
|
1878
|
+
p: 4,
|
|
1869
1879
|
textAlign: 'center',
|
|
1870
1880
|
cursor: 'pointer',
|
|
1871
1881
|
transition: 'all 0.2s ease',
|
|
1872
1882
|
'&:hover': {
|
|
1873
|
-
borderColor:
|
|
1874
|
-
backgroundColor: 'rgba(13,131,205,0.
|
|
1883
|
+
borderColor: accentColor,
|
|
1884
|
+
backgroundColor: 'rgba(13,131,205,0.03)'
|
|
1875
1885
|
}
|
|
1876
1886
|
},
|
|
1877
1887
|
children: [/*#__PURE__*/jsxRuntime.jsx(CloudUploadIcon, {
|
|
1878
1888
|
sx: {
|
|
1879
|
-
fontSize:
|
|
1880
|
-
color: '#
|
|
1881
|
-
mb: 1
|
|
1889
|
+
fontSize: 40,
|
|
1890
|
+
color: '#bbb',
|
|
1891
|
+
mb: 1.5
|
|
1882
1892
|
}
|
|
1883
1893
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1884
1894
|
variant: "body2",
|
|
1885
1895
|
sx: {
|
|
1886
|
-
color: '#
|
|
1887
|
-
fontSize:
|
|
1896
|
+
color: '#888',
|
|
1897
|
+
fontSize: 14
|
|
1888
1898
|
},
|
|
1889
1899
|
children: t('inputFieldsDialog.uploadImage', 'Click to select an image')
|
|
1890
1900
|
})]
|
|
@@ -1901,77 +1911,150 @@ var SingleFieldDialog = function SingleFieldDialog(_ref) {
|
|
|
1901
1911
|
},
|
|
1902
1912
|
onKeyDown: handleKeyDown,
|
|
1903
1913
|
autoFocus: true,
|
|
1904
|
-
size: "small",
|
|
1905
1914
|
placeholder: custom.placeholder || '',
|
|
1906
|
-
sx:
|
|
1907
|
-
mt: 1
|
|
1908
|
-
}, config.inputStyle)
|
|
1915
|
+
sx: sharedSx
|
|
1909
1916
|
});
|
|
1910
1917
|
}
|
|
1911
1918
|
};
|
|
1912
|
-
return /*#__PURE__*/jsxRuntime.jsxs(material.
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
},
|
|
1921
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
1919
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1920
|
+
sx: _objectSpread2({
|
|
1921
|
+
position: 'fixed',
|
|
1922
|
+
inset: 0,
|
|
1923
|
+
zIndex: 9999,
|
|
1924
|
+
backgroundColor: '#f7f8fa',
|
|
1925
|
+
display: 'flex',
|
|
1926
|
+
flexDirection: 'column'
|
|
1927
|
+
}, config.dialogStyle),
|
|
1928
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1929
|
+
sx: {
|
|
1930
|
+
height: 4,
|
|
1931
|
+
backgroundColor: '#e4e7ec',
|
|
1932
|
+
flexShrink: 0
|
|
1933
|
+
},
|
|
1934
|
+
children: /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1935
|
+
sx: {
|
|
1936
|
+
height: '100%',
|
|
1937
|
+
width: "".concat(progressPct, "%"),
|
|
1938
|
+
backgroundColor: accentColor,
|
|
1939
|
+
transition: 'width 0.4s ease'
|
|
1940
|
+
}
|
|
1941
|
+
})
|
|
1942
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1922
1943
|
sx: _objectSpread2({
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1944
|
+
backgroundColor: '#fff',
|
|
1945
|
+
borderBottom: '1px solid #f0f0f0',
|
|
1946
|
+
display: 'flex',
|
|
1947
|
+
alignItems: 'center',
|
|
1948
|
+
justifyContent: 'center',
|
|
1949
|
+
px: 4,
|
|
1950
|
+
py: 1.75,
|
|
1951
|
+
flexShrink: 0
|
|
1926
1952
|
}, config.titleStyle),
|
|
1927
|
-
children:
|
|
1928
|
-
|
|
1953
|
+
children: logoUrl ? /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
1954
|
+
src: logoUrl,
|
|
1955
|
+
alt: "Logo",
|
|
1956
|
+
style: {
|
|
1957
|
+
maxHeight: 36,
|
|
1958
|
+
maxWidth: 200,
|
|
1959
|
+
objectFit: 'contain'
|
|
1960
|
+
}
|
|
1961
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1929
1962
|
sx: {
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1963
|
+
fontWeight: 700,
|
|
1964
|
+
fontSize: 17,
|
|
1965
|
+
color: '#1a1a1a',
|
|
1966
|
+
letterSpacing: '-0.2px'
|
|
1933
1967
|
},
|
|
1934
|
-
children:
|
|
1935
|
-
})
|
|
1936
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
1937
|
-
sx: {
|
|
1938
|
-
pt: 2
|
|
1939
|
-
},
|
|
1940
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1941
|
-
variant: "body1",
|
|
1942
|
-
sx: _objectSpread2({
|
|
1943
|
-
mb: 1,
|
|
1944
|
-
fontWeight: 500
|
|
1945
|
-
}, config.promptStyle),
|
|
1946
|
-
children: promptText
|
|
1947
|
-
}), renderInput()]
|
|
1948
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(material.DialogActions, {
|
|
1968
|
+
children: "LabelLife"
|
|
1969
|
+
})
|
|
1970
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1949
1971
|
sx: {
|
|
1950
|
-
|
|
1951
|
-
|
|
1972
|
+
flex: 1,
|
|
1973
|
+
display: 'flex',
|
|
1974
|
+
alignItems: 'center',
|
|
1975
|
+
justifyContent: 'center',
|
|
1976
|
+
p: {
|
|
1977
|
+
xs: 3,
|
|
1978
|
+
sm: 5
|
|
1979
|
+
},
|
|
1980
|
+
overflowY: 'auto'
|
|
1952
1981
|
},
|
|
1953
|
-
children:
|
|
1954
|
-
|
|
1955
|
-
|
|
1982
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1983
|
+
sx: {
|
|
1984
|
+
width: '100%',
|
|
1985
|
+
maxWidth: 750
|
|
1956
1986
|
},
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1987
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1988
|
+
sx: {
|
|
1989
|
+
display: 'block',
|
|
1990
|
+
fontSize: 18,
|
|
1991
|
+
color: '#999',
|
|
1992
|
+
fontWeight: 500,
|
|
1993
|
+
mb: 1.5,
|
|
1994
|
+
letterSpacing: '0.2px'
|
|
1995
|
+
},
|
|
1996
|
+
children: t('inputFieldsDialog.stepIndicator', 'Field {current} of {total}').replace('{current}', currentIndex + 1).replace('{total}', totalCount)
|
|
1997
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1998
|
+
sx: _objectSpread2({
|
|
1999
|
+
fontSize: {
|
|
2000
|
+
xs: 33,
|
|
2001
|
+
sm: 39
|
|
2002
|
+
},
|
|
2003
|
+
fontWeight: 700,
|
|
2004
|
+
color: '#111827',
|
|
2005
|
+
lineHeight: 1.3,
|
|
2006
|
+
mb: 4.5
|
|
2007
|
+
}, config.promptStyle),
|
|
2008
|
+
children: promptText
|
|
2009
|
+
}), renderInput(), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
2010
|
+
sx: {
|
|
2011
|
+
display: 'flex',
|
|
2012
|
+
alignItems: 'center',
|
|
2013
|
+
gap: 2,
|
|
2014
|
+
mt: 4.5
|
|
2015
|
+
},
|
|
2016
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Button, {
|
|
2017
|
+
variant: "contained",
|
|
2018
|
+
onClick: handleSubmit,
|
|
2019
|
+
disabled: isRequired && !value,
|
|
2020
|
+
sx: _objectSpread2({
|
|
2021
|
+
textTransform: 'none',
|
|
2022
|
+
fontWeight: 600,
|
|
2023
|
+
fontSize: 21,
|
|
2024
|
+
px: 5,
|
|
2025
|
+
py: 1.65,
|
|
2026
|
+
borderRadius: '10px',
|
|
2027
|
+
backgroundColor: accentColor,
|
|
2028
|
+
boxShadow: 'none',
|
|
2029
|
+
'&:hover': {
|
|
2030
|
+
backgroundColor: '#0a6eb3',
|
|
2031
|
+
boxShadow: 'none'
|
|
2032
|
+
}
|
|
2033
|
+
}, config.submitButtonStyle),
|
|
2034
|
+
children: config.submitButtonText || t('inputFieldsDialog.submit', 'Continue')
|
|
2035
|
+
}), !isRequired && /*#__PURE__*/jsxRuntime.jsx(material.Button, {
|
|
2036
|
+
variant: "outlined",
|
|
2037
|
+
onClick: function onClick() {
|
|
2038
|
+
return onSkip(field.id);
|
|
2039
|
+
},
|
|
2040
|
+
sx: _objectSpread2({
|
|
2041
|
+
textTransform: 'none',
|
|
2042
|
+
fontWeight: 500,
|
|
2043
|
+
fontSize: 21,
|
|
2044
|
+
px: 4.5,
|
|
2045
|
+
py: 1.65,
|
|
2046
|
+
borderRadius: '10px',
|
|
2047
|
+
color: '#555',
|
|
2048
|
+
borderColor: '#d0d5dd',
|
|
2049
|
+
'&:hover': {
|
|
2050
|
+
borderColor: '#aaa',
|
|
2051
|
+
backgroundColor: 'rgba(0,0,0,0.02)'
|
|
2052
|
+
}
|
|
2053
|
+
}, config.skipButtonStyle),
|
|
2054
|
+
children: config.skipButtonText || t('inputFieldsDialog.skip', 'Do it later')
|
|
2055
|
+
})]
|
|
2056
|
+
})]
|
|
2057
|
+
})
|
|
1975
2058
|
})]
|
|
1976
2059
|
});
|
|
1977
2060
|
};
|