const groupRequirements = {
method: {
order: '02 display',
label: 'Stamp Method',
selectOptions: {
'draw': 'draw',
'fill': 'fill',
'drawAndFill': 'drawAndFill',
'fillAndDraw': 'fillAndDraw',
'drawThenFill': 'drawThenFill',
'fillThenDraw': 'fillThenDraw',
'clear': 'clear',
},
glue: ['method', 'raw'],
},
flipUpend: {
order: '01 position flip',
label: 'Flip Upend',
selectOptions: {
false: '0',
true: '1',
},
glue: ['flipUpend', 'boolean'],
},
flipReverse: {
order: '01 position flip',
label: 'Flip Reverse',
selectOptions: {
false: '0',
true: '1',
},
glue: ['flipReverse', 'boolean'],
},
fillStyle: {
order: '02 display style',
label: 'Fill',
inputType: 'color',
glue: ['fillStyle', 'raw'],
},
strokeStyle: {
order: '02 display style',
label: 'Stroke',
inputType: 'color',
glue: ['strokeStyle', 'raw'],
},
lineWidth: {
order: '03 display line',
label: 'Line Width',
inputType: 'number',
controlMin: 0,
controlStep: 0.5,
glue: ['lineWidth', 'float'],
},
lineCap: {
order: '03 display line',
label: 'Line Cap',
selectOptions: {
butt: 'butt',
round: 'round',
square: 'square',
},
glue: ['lineCap', 'raw'],
},
lineJoin: {
order: '03 display line',
label: 'Line Join',
selectOptions: {
miter: 'miter',
round: 'round',
join: 'bevel',
},
glue: ['lineJoin', 'raw'],
},
scaleOutline: {
order: '03 display line',
label: 'Scale Outline',
selectOptions: {
false: '0',
true: '1',
},
glue: ['scaleOutline', 'boolean'],
},
shadowOffsetX: {
order: '04 display shadow',
label: 'Shadow Offset X (px)',
inputType: 'number',
controlStep: 0.5,
glue: ['shadowOffsetX', 'float'],
},
shadowOffsetY: {
order: '04 display shadow',
label: 'Shadow Offset Y (px)',
inputType: 'number',
controlStep: 0.5,
glue: ['shadowOffsetY', 'float'],
},
shadowBlur: {
order: '04 display shadow',
label: 'Shadow Blur',
inputType: 'number',
controlMin: 0,
controlStep: 0.5,
glue: ['shadowBlur', 'float'],
},
shadowColor: {
order: '04 display shadow',
label: 'Shadow Color',
inputType: 'color',
glue: ['shadowColor', 'raw'],
},
};
const commonRequirements = {
...groupRequirements,
handleX: {
order: '01 position handle',
label: 'Handle X (%)',
inputType: 'number',
controlStep: 1,
glue: ['handleX', '%'],
},
handleY: {
order: '01 position handle',
label: 'Handle Y (%)',
inputType: 'number',
controlStep: 1,
glue: ['handleY', '%'],
},
startX: {
order: '01 position start',
label: 'Start X (px)',
inputType: 'number',
controlStep: 1,
glue: ['startX', 'round'],
},
startY: {
order: '01 position start',
label: 'Start Y (px)',
inputType: 'number',
controlStep: 1,
glue: ['startY', 'round'],
},
offsetX: {
order: '01 position offset',
label: 'Offset X (px)',
inputType: 'number',
controlStep: 1,
glue: ['offsetX', 'round'],
},
offsetY: {
order: '01 position offset',
label: 'Offset Y (px)',
inputType: 'number',
controlStep: 1,
glue: ['offsetY', 'round'],
},
roll: {
order: '01 shape roll',
label: 'Roll (deg)',
inputType: 'number',
controlMin: -360,
controlMax: 360,
controlStep: 0.2,
glue: ['roll', 'float'],
},
scale: {
order: '01 shape scale',
label: 'Scale',
inputType: 'number',
controlMin: 0,
controlStep: 0.005,
glue: ['scale', 'float'],
},
};
const entityRequirements = {
Block: {
width: {
order: '00 shape',
label: 'Width (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['width', 'round'],
},
height: {
order: '00 shape',
label: 'Height (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['height', 'round'],
},
},
Wheel: {
radius: {
order: '00 shape',
label: 'Radius (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['radius', 'round'],
},
startAngle: {
order: '00 shape',
label: 'Start Angle (deg)',
inputType: 'number',
controlMin: -360,
controlMax: 360,
controlStep: 0.2,
glue: ['startAngle', 'float'],
},
endAngle: {
order: '00 shape',
label: 'End Angle (deg)',
inputType: 'number',
controlMin: -360,
controlMax: 360,
controlStep: 0.2,
glue: ['endAngle', 'float'],
},
includeCenter: {
order: '00 shape',
label: 'Include Center',
selectOptions: {
false: '0',
true: '1',
},
glue: ['includeCenter', 'boolean'],
},
closed: {
order: '00 shape',
label: 'Closed',
selectOptions: {
false: '0',
true: '1',
},
glue: ['closed', 'boolean'],
},
},
Phrase: {
width: {
order: '00 shape',
label: 'Width (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['width', 'round'],
},
text: {
order: '00 content',
label: 'Text',
inputType: 'text',
glue: ['text', 'raw'],
},
lineHeight: {
order: '00 shape',
label: 'Line height',
inputType: 'number',
controlMin: 0,
controlStep: 0.1,
glue: ['lineHeight', 'float'],
},
letterSpacing: {
order: '00 shape',
label: 'Letter spacing (px)',
inputType: 'number',
controlMin: 0,
controlStep: 0.2,
glue: ['letterSpacing', 'float'],
},
justify: {
order: '00 shape',
label: 'Justify text',
selectOptions: {
left: 'left',
center: 'center',
right: 'right',
full: 'full',
},
glue: ['justify', 'raw'],
},
family: {
order: '00 shape',
label: 'Font family',
selectOptions: {
'sans-serif': 'sans-serif',
serif: 'serif',
monospace: 'monospace',
fantasy: 'fantasy',
},
glue: ['family', 'raw'],
},
sizeValue: {
order: '00 shape',
label: 'Font size value (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['sizeValue', 'round'],
},
},
Picture: {
width: {
order: '00 shape',
label: 'Width (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['width', 'round'],
},
height: {
order: '00 shape',
label: 'Height (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['height', 'round'],
},
copyStartX: {
order: '02 display copyStart',
label: 'Copy start X (px)',
inputType: 'number',
controlStep: 1,
glue: ['copyStartX', 'round'],
},
copyStartY: {
order: '02 display copyStart',
label: 'Copy start Y (px)',
inputType: 'number',
controlStep: 1,
glue: ['copyStartY', 'round'],
},
copyWidth: {
order: '02 display copyWidth',
label: 'Copy width (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['copyWidth', 'round'],
},
copyHeight: {
order: '02 display copyHeight',
label: 'Copy height (px)',
inputType: 'number',
controlMin: 0,
controlStep: 1,
glue: ['copyHeight', 'round'],
},
},
};