Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push to production active page, disabled, richttext #645

Merged
merged 21 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1b720d2
Add new CanvasProvider state to manage the openinig of the ThumbsPage…
sergioelmoreno Dec 17, 2024
cabdbf9
#639 fine turrning listbox
oleojake Dec 30, 2024
009a543
#639 gray icons when datepicker and timepicker disabled
oleojake Dec 30, 2024
c27ba38
#639 now you can change color of progressbar
oleojake Dec 30, 2024
3f7693a
#639 fix default color on progressbar
oleojake Dec 30, 2024
9f63648
#623 bug fixed and enable properties
oleojake Dec 30, 2024
e4e2c0b
#623 only fontcolor added as property meanwhile we implement parsed text
oleojake Dec 30, 2024
dd6fb67
Merge pull request #641 from Lemoncode/bug/#623-paragraph-bug-when-ch…
brauliodiez Dec 30, 2024
79c2625
Merge branch 'dev' into Enhancement/#639-enhancement-components
brauliodiez Dec 30, 2024
f094e4e
#440 create rich text component structure
oleojake Dec 30, 2024
4f73177
Merge pull request #640 from Lemoncode/Enhancement/#639-enhancement-c…
brauliodiez Dec 30, 2024
3f05a41
refactor
brauliodiez Dec 30, 2024
a9d1b88
Merge branch 'dev' into feature/force-open-2
brauliodiez Dec 30, 2024
5676887
Merge pull request #642 from Lemoncode/feature/force-open-2
brauliodiez Dec 30, 2024
e2db175
#440 default values for rich-text
oleojake Dec 31, 2024
182fb83
#440 first approximation to rich text component
oleojake Dec 31, 2024
109f481
cache first version
brauliodiez Dec 31, 2024
3f84dfd
cleanup code
brauliodiez Jan 1, 2025
1b83cda
Merge branch 'dev' into feature/#440-create-rich-text-paragraph-compo…
brauliodiez Jan 1, 2025
d2b3574
#440 trying to equal styles with normal <p>
oleojake Jan 2, 2025
c3b70f2
Merge pull request #643 from Lemoncode/feature/#440-create-rich-text-…
brauliodiez Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@fontsource/balsamiq-sans": "^5.0.21",
"@types/lodash.clonedeep": "^4.5.9",
"@uiw/react-color-chrome": "^2.3.2",
"html2canvas": "^1.4.1",
"immer": "^10.1.1",
"konva": "^9.3.12",
"lodash.clonedeep": "^4.5.0",
Expand All @@ -30,6 +31,7 @@
"react-konva": "^18.2.10",
"react-konva-utils": "^1.0.6",
"tiny-invariant": "^1.3.3",
"use-debounce": "^10.0.4",
"use-image": "^1.1.1",
"uuid": "^10.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions public/icons/calendar-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/clock-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions public/text/rich-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { forwardRef } from 'react';
import { ShapeProps } from '../shape.model';
import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes/shape-restrictions';
import { Group, Rect, Text, Image } from 'react-konva';
import { DISABLED_COLOR_VALUES, INPUT_SHAPE } from './shape.const';
import { BASIC_SHAPE, DISABLED_COLOR_VALUES } from './shape.const';
import { useShapeProps } from '../../shapes/use-shape-props.hook';
import { useGroupShapeProps } from '../mock-components.utils';

import calendarIconSrc from '/icons/calendar.svg';
import disabledCalendarIconSrc from '/icons/calendar-disabled.svg';

const datepickerInputShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 100,
Expand Down Expand Up @@ -45,7 +46,7 @@ export const DatepickerInputShape = forwardRef<any, ShapeProps>(
const { width: restrictedWidth, height: restrictedHeight } = restrictedSize;

const { stroke, fill, textColor, strokeStyle, borderRadius, disabled } =
useShapeProps(otherProps, INPUT_SHAPE);
useShapeProps(otherProps, BASIC_SHAPE);

const commonGroupProps = useGroupShapeProps(
props,
Expand All @@ -64,7 +65,7 @@ export const DatepickerInputShape = forwardRef<any, ShapeProps>(
const labelFontSize = Math.min(restrictedHeight * 0.3, 12);

const calendarIcon = new window.Image();
calendarIcon.src = calendarIconSrc;
calendarIcon.src = disabled ? disabledCalendarIconSrc : calendarIconSrc;

return (
<Group {...commonGroupProps} {...shapeProps}>
Expand All @@ -79,7 +80,7 @@ export const DatepickerInputShape = forwardRef<any, ShapeProps>(
disabled ? DISABLED_COLOR_VALUES.DEFAULT_STROKE_COLOR : stroke
}
dash={strokeStyle}
strokeWidth={2}
strokeWidth={BASIC_SHAPE.DEFAULT_STROKE_WIDTH}
fill={
disabled ? DISABLED_COLOR_VALUES.DEFAULT_BACKGROUND_COLOR : fill
}
Expand All @@ -91,14 +92,16 @@ export const DatepickerInputShape = forwardRef<any, ShapeProps>(
width={labelFontSize + 20}
height={labelFontSize}
cornerRadius={borderRadius}
strokeWidth={BASIC_SHAPE.DEFAULT_STROKE_WIDTH}
fill="white"
/>
{/* Label "Date" */}
<Text
text="Date"
x={13}
y={-5}
fontSize={labelFontSize}
fontFamily={BASIC_SHAPE.DEFAULT_FONT_FAMILY}
fontSize={BASIC_SHAPE.DEFAULT_FONT_SIZE - 4}
fill={disabled ? DISABLED_COLOR_VALUES.DEFAULT_TEXT_COLOR : stroke}
align="center"
color={stroke}
Expand All @@ -110,7 +113,7 @@ export const DatepickerInputShape = forwardRef<any, ShapeProps>(
x={10}
y={(restrictedHeight - fontSize) / 2 + 2}
width={availableWidth}
fontSize={fontSize}
fontSize={BASIC_SHAPE.DEFAULT_FONT_SIZE}
align="left"
ellipsis={true}
wrap="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ export const ListBoxShape = forwardRef<any, ListBoxShapeProps>((props, ref) => {
);

const calculateItemBackground = (index: number) => {
if (disabled) return DISABLED_COLOR_VALUES.DEFAULT_BACKGROUND_COLOR;
if (disabled) {
return selectedItem === index
? DISABLED_COLOR_VALUES.DEFAULT_STROKE_COLOR
: DISABLED_COLOR_VALUES.DEFAULT_BACKGROUND_COLOR;
}

return selectedItem === index ? selectedBackgroundColor : fill;
};
Expand Down Expand Up @@ -127,6 +131,7 @@ export const ListBoxShape = forwardRef<any, ListBoxShapeProps>((props, ref) => {
fill={calculateItemBackground(index)}
stroke={calculateItemStroke(index)}
strokeWidth={selectedItem === index ? 1 : 0}
cornerRadius={borderRadius}
/>
<Text
x={10}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export const ProgressBarShape = forwardRef<any, ShapeProps>((props, ref) => {
);
const { width: restrictedWidth, height: restrictedHeight } = restrictedSize;

const { progress, borderRadius } = useShapeProps(otherProps, BASIC_SHAPE);
const { progress, borderRadius, fill, stroke } = useShapeProps(
otherProps,
BASIC_SHAPE
);

const progressWidth = useMemo(
() => (progress / 100) * restrictedWidth,
Expand All @@ -54,7 +57,7 @@ export const ProgressBarShape = forwardRef<any, ShapeProps>((props, ref) => {
width={restrictedWidth}
height={restrictedHeight}
cornerRadius={borderRadius}
stroke="black"
stroke={stroke}
strokeWidth={2}
fill="white"
/>
Expand All @@ -66,9 +69,9 @@ export const ProgressBarShape = forwardRef<any, ShapeProps>((props, ref) => {
width={progressWidth}
height={restrictedHeight}
cornerRadius={borderRadius}
stroke="black"
stroke={stroke}
strokeWidth={2}
fill="lightgrey"
fill={fill}
/>
</Group>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useGroupShapeProps } from '../../mock-components.utils';
import { splitCSVContent, setTime } from './timepickerinput-shape.business';

import clockIconSrc from '/icons/clock.svg';
import disabledClockIconSrc from '/icons/clock-disabled.svg';

const timepickerInputShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 100,
Expand Down Expand Up @@ -68,7 +69,7 @@ export const TimepickerInputShape = forwardRef<any, ShapeProps>(
const labelFontSize = Math.min(restrictedHeight * 0.3, 12);

const clockIcon = new window.Image();
clockIcon.src = clockIconSrc;
clockIcon.src = disabled ? disabledClockIconSrc : clockIconSrc;

return (
<Group {...commonGroupProps} {...shapeProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './normaltext-shape';
export * from './smalltext-shape';
export * from './paragraph-text-shape';
export * from './link-text-shape';
export * from './rich-text/';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes/shape-rest
import { BASIC_SHAPE } from '../front-components/shape.const';
import { useShapeProps } from '../../shapes/use-shape-props.hook';
import { useGroupShapeProps } from '../mock-components.utils';
import { useResizeOnFontSizeChange } from './front-text-hooks/resize-fontsize-change.hook';

const paragraphSizeRestrictions: ShapeSizeRestrictions = {
minWidth: 200,
Expand Down Expand Up @@ -41,7 +40,7 @@ export const ParagraphShape = forwardRef<any, ShapeProps>((props, ref) => {
);
const { width: restrictedWidth, height: restrictedHeight } = restrictedSize;

const { textColor, fontSize, textAlignment, fontVariant } = useShapeProps(
const { textColor, fontSize, textAlignment } = useShapeProps(
otherProps,
BASIC_SHAPE
);
Expand All @@ -53,8 +52,6 @@ export const ParagraphShape = forwardRef<any, ShapeProps>((props, ref) => {
ref
);

useResizeOnFontSizeChange(id, { x, y }, text, fontSize, fontVariant, true);

return (
<Group {...commonGroupProps} {...shapeProps}>
<Text
Expand Down
Loading
Loading