@cuemath/leap 2.8.50-as2 → 2.8.50-as3

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.
@@ -12,13 +12,13 @@ const b = s(u)(({
12
12
  theme: r,
13
13
  $active: o,
14
14
  $activeColor: t,
15
- $isWhiteBoard: l
15
+ $shouldAnimate: l
16
16
  }) => {
17
17
  const { colors: e } = r, i = o ? a[t] : e.REAL_BLACK_50;
18
18
  return n`
19
19
  position: relative;
20
20
  transition: top 0.3s ease-in-out;
21
- top: ${o && !l ? "0px" : "8px"};
21
+ top: ${o && l ? "0px" : "8px"};
22
22
  cursor: ${o ? "auto" : "pointer"};
23
23
  .pencil-dark-shade {
24
24
  fill: ${o ? i : e.GREY_3};
@@ -44,14 +44,14 @@ const b = s(u)(({
44
44
  theme: r,
45
45
  $active: o,
46
46
  $activeColor: t,
47
- $isWhiteBoard: l
47
+ $shouldAnimate: l
48
48
  }) => {
49
49
  const { colors: e } = r, i = o ? a[t] : e.REAL_BLACK_50;
50
50
  return n`
51
51
  cursor: ${o ? "auto" : "pointer"};
52
52
  position: relative;
53
53
  transition: top 0.3s ease-in-out;
54
- top: ${o && !l ? "0px" : "8px"};
54
+ top: ${o && l ? "0px" : "8px"};
55
55
 
56
56
  .ruler-rect-color {
57
57
  fill: ${o ? i : e.GREY_3};
@@ -81,14 +81,14 @@ const b = s(u)(({
81
81
  $active: r,
82
82
  theme: o,
83
83
  $activeColor: t,
84
- $isWhiteBoard: l
84
+ $shouldAnimate: l
85
85
  }) => {
86
86
  const { colors: e } = o, i = r ? a[t] : e.REAL_BLACK_50;
87
87
  return n`
88
88
  cursor: ${r ? "auto" : "pointer"};
89
89
  position: relative;
90
90
  transition: top 0.3s ease-in-out;
91
- top: ${r && !l ? "0px" : "8px"};
91
+ top: ${r && l ? "0px" : "8px"};
92
92
  ${!r && n`
93
93
  &:hover {
94
94
  .highlighter-tip {
@@ -125,14 +125,14 @@ const b = s(u)(({
125
125
  $active: r,
126
126
  theme: o,
127
127
  $activeColor: t,
128
- $isWhiteBoard: l
128
+ $shouldAnimate: l
129
129
  }) => {
130
130
  const { colors: e } = o, i = r ? a[t] : e.REAL_BLACK_50;
131
131
  return n`
132
132
  cursor: ${r ? "auto" : "pointer"};
133
133
  position: relative;
134
134
  transition: top 0.3s ease-in-out;
135
- top: ${r && !l ? "0px" : "8px"};
135
+ top: ${r && l ? "0px" : "8px"};
136
136
 
137
137
  ${!r && n`
138
138
  &:hover {
@@ -167,50 +167,48 @@ const b = s(u)(({
167
167
  }
168
168
  `}
169
169
  `;
170
- }), W = s(p)(({
171
- theme: r,
172
- $active: o
173
- }) => {
174
- const { colors: t } = r;
175
- return n`
176
- cursor: ${o ? "auto" : "pointer"};
177
- width: 32px;
178
- height: 32px;
179
- justify-content: center;
180
- align-items: center;
170
+ }), W = s(p)(
171
+ ({ theme: r, $active: o }) => {
172
+ const { colors: t } = r;
173
+ return n`
174
+ cursor: ${o ? "auto" : "pointer"};
175
+ width: 32px;
176
+ height: 32px;
177
+ justify-content: center;
178
+ align-items: center;
179
+ border: 1px solid ${t.WHITE};
180
+ border-radius: 50%;
181
+ transition: all 100ms ease-in-out;
181
182
 
182
- border: 1px solid ${t.WHITE};
183
- border-radius: 50%;
184
- transition: all 100ms ease-in-out;
185
-
186
- &:hover {
187
- border: 1px solid ${t.REAL_BLACK};
188
- }
189
- ${!o && n`
190
183
  &:hover {
191
184
  border: 1px solid ${t.REAL_BLACK};
192
185
  }
193
- `}
194
-
195
- ${o && n`
196
- cursor: auto;
197
- background: ${t.BLACK};
198
- svg {
199
- path,
200
- circle {
201
- stroke: ${t.WHITE};
202
- }
203
- .hover-tiles {
204
- stroke: ${t.WHITE};
186
+ ${!o && n`
187
+ &:hover {
188
+ border: 1px solid ${t.REAL_BLACK};
205
189
  }
206
- .hover-eraser {
207
- stroke: none;
208
- fill: ${t.WHITE};
190
+ `}
191
+
192
+ ${o && n`
193
+ cursor: auto;
194
+ background: ${t.BLACK};
195
+ svg {
196
+ path,
197
+ circle {
198
+ stroke: ${t.WHITE};
199
+ }
200
+ .hover-tiles {
201
+ stroke: ${t.WHITE};
202
+ }
203
+ .hover-eraser {
204
+ stroke: none;
205
+ fill: ${t.WHITE};
206
+ }
209
207
  }
210
- }
211
- `}
212
- `;
213
- }), G = s(c)`
208
+ `}
209
+ `;
210
+ }
211
+ ), G = s(c)`
214
212
  path {
215
213
  stroke: ${"white"};
216
214
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cue-cavas-styled.js","sources":["../../../src/features/cue-canvas/cue-cavas-styled.tsx"],"sourcesContent":["import type { ICueCanvasWrapper, TCueCanvasColors } from './types/cue-canvas';\n\nimport styled, { css } from 'styled-components';\n\nimport TickIcon from '../../assets/line-icons/icons/check';\nimport DownIcon from '../../assets/line-icons/icons/down';\nimport HighlighterIcon from '../../assets/line-icons/icons/highlighter';\nimport PencilIcon from '../../assets/line-icons/icons/pencil';\nimport RulerIcon from '../../assets/line-icons/icons/ruler';\nimport SketchIcon from '../../assets/line-icons/icons/sketch';\nimport UndoIcon from '../../assets/line-icons/icons/undo';\nimport FlexView from '../ui/layout/flex-view';\nimport { CANVAS_COLORS } from './constants/constants';\n\ninterface IToolProps {\n $active: boolean;\n $activeColor: TCueCanvasColors;\n $isWhiteBoard: boolean;\n}\n\nexport const StyledPencilIcon = styled(PencilIcon)<IToolProps>(({\n theme,\n $active,\n $activeColor,\n $isWhiteBoard,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && !$isWhiteBoard ? '0px' : '8px'};\n cursor: ${$active ? 'auto' : 'pointer'};\n .pencil-dark-shade {\n fill: ${$active ? color : colors.GREY_3};\n }\n\n .pencil-light-shade {\n fill: ${$active ? color : colors.GREY_2};\n opacity: ${$active ? 0.3 : 1};\n }\n\n ${!$active &&\n css`\n &:hover {\n .pencil-dark-shade {\n fill: ${colors.GREY_4};\n }\n .pencil-light-shade {\n fill: ${colors.GREY_2};\n }\n }\n `}\n `;\n});\n\nexport const StyledRulerIcon = styled(RulerIcon)<IToolProps>(({\n theme,\n $active,\n $activeColor,\n $isWhiteBoard,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && !$isWhiteBoard ? '0px' : '8px'};\n\n .ruler-rect-color {\n fill: ${$active ? color : colors.GREY_3};\n }\n\n .ruler-stripe-base {\n fill: ${$active ? color : colors.GREY_2};\n opacity: ${$active ? 0.2 : 1};\n }\n\n .ruler-small-stripe {\n fill: ${colors.REAL_BLACK};\n }\n\n ${!$active &&\n css`\n &:hover {\n .ruler-rect-color {\n fill: ${colors.GREY_4};\n }\n .ruler-stripe-base {\n fill: ${colors.GREY_3};\n }\n }\n `}\n `;\n});\n\nexport const StyledHighlighterWrapper = styled(HighlighterIcon)<IToolProps>(({\n $active,\n theme,\n $activeColor,\n $isWhiteBoard,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && !$isWhiteBoard ? '0px' : '8px'};\n ${!$active &&\n css`\n &:hover {\n .highlighter-tip {\n fill: ${theme.colors.BLACK};\n }\n\n .highlighter-stripe {\n fill: ${theme.colors.BLACK_50};\n }\n\n .highlighter-light-body {\n fill: ${theme.colors.BLACK_10};\n }\n }\n `}\n\n ${$active &&\n css`\n .highlighter-tip {\n fill: ${color};\n }\n\n .highlighter-stripe {\n fill: ${color};\n opacity: 0.6;\n }\n\n .highlighter-light-body {\n fill: ${color};\n opacity: 0.2;\n }\n `}\n `;\n});\n\nexport const StyledSketchWrapper = styled(SketchIcon)<IToolProps>(({\n $active,\n theme,\n $activeColor,\n $isWhiteBoard,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && !$isWhiteBoard ? '0px' : '8px'};\n\n ${!$active &&\n css`\n &:hover {\n .pen-tip {\n fill: ${theme.colors.BLACK};\n }\n\n .pen-dark-shade {\n fill: ${theme.colors.BLACK_50};\n }\n\n .pen-light-shade {\n fill: ${theme.colors.BLACK_10};\n }\n }\n `}\n\n ${$active &&\n css`\n cursor: ${$active ? 'auto' : 'pointer'};\n .pen-tip {\n fill: ${color};\n }\n\n .pen-dark-shade {\n fill: ${color};\n opacity: 0.6;\n }\n\n .pen-light-shade {\n fill: ${color};\n opacity: 0.4;\n }\n `}\n `;\n});\n\nexport const StyledWrapper = styled(FlexView)<Omit<IToolProps, '$activeColor' | '$isWhiteBoard'>>(({\n theme,\n $active,\n}) => {\n const { colors } = theme;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n width: 32px;\n height: 32px;\n justify-content: center;\n align-items: center;\n\n border: 1px solid ${colors.WHITE};\n border-radius: 50%;\n transition: all 100ms ease-in-out;\n\n &:hover {\n border: 1px solid ${colors.REAL_BLACK};\n }\n ${!$active &&\n css`\n &:hover {\n border: 1px solid ${colors.REAL_BLACK};\n }\n `}\n\n ${$active &&\n css`\n cursor: auto;\n background: ${colors.BLACK};\n svg {\n path,\n circle {\n stroke: ${colors.WHITE};\n }\n .hover-tiles {\n stroke: ${colors.WHITE};\n }\n .hover-eraser {\n stroke: none;\n fill: ${colors.WHITE};\n }\n }\n `}\n `;\n});\n\nexport const StyledCheckIcon = styled(TickIcon)`\n path {\n stroke: ${'white'};\n }\n`;\n\nexport const RedoIcon = styled(UndoIcon)`\n transform: scaleX(-1);\n`;\n\nexport const PaletteWrapper = styled(FlexView)`\n position: absolute;\n display: flex;\n justify-content: center;\n top: -24px; //-16 for icon, -8 for gap\n transition:\n opacity 0.5s ease,\n transform 0.5s ease;\n`;\n\nexport const CueCanvasWrapper = styled(FlexView)<ICueCanvasWrapper>(\n ({ $canScribble, $canRender, $renderAs }) => `\n display: ${$canRender ? 'block' : 'none'};\n opacity: ${$canScribble ? 1 : 0.5};\n pointer-events: ${$canScribble ? 'auto' : 'none'};\n\n ${\n $renderAs === 'canvas' &&\n $canScribble &&\n `\n background-image: radial-gradient(rgb(43 43 43 / 8%) 2px, transparent 10%);\n background-position:0 0,32px 32px;\n background-size: 30px 32px;\n `\n }\n \n`,\n);\n\nexport const ColorPicker = styled(FlexView)<{ $color: TCueCanvasColors }>(\n ({ $color }) => `\nbackground: ${CANVAS_COLORS[$color]};\n`,\n);\n\nexport const StyledDownIcon = styled(DownIcon)<{ $isAnimating: boolean }>`\n pointer-events: none;\n transition: transform 0.5s ease;\n transform: ${({ $isAnimating }) => ($isAnimating ? 'rotate(180deg)' : 'rotate(0deg)')};\n`;\n\nexport const PenIconWrapper = styled(FlexView)`\n overflow: hidden;\n border-right: 1px solid ${({ theme }) => theme.colors.GREY_1};\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n padding: 8px 8px 0 8px;\n overflow: hidden;\n bottom: 58px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n transition:\n opacity 0.5s ease,\n transform 0.5s ease;\n\n :hover {\n cursor: pointer;\n }\n`;\n"],"names":["StyledPencilIcon","styled","PencilIcon","theme","$active","$activeColor","$isWhiteBoard","colors","color","CANVAS_COLORS","css","StyledRulerIcon","RulerIcon","StyledHighlighterWrapper","HighlighterIcon","StyledSketchWrapper","SketchIcon","StyledWrapper","FlexView","StyledCheckIcon","TickIcon","RedoIcon","UndoIcon","PaletteWrapper","CueCanvasWrapper","$canScribble","$canRender","$renderAs","ColorPicker","$color","StyledDownIcon","DownIcon","$isAnimating","PenIconWrapper","MenuWrapper"],"mappings":";;;;;;;;;;AAoBO,MAAMA,IAAmB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A,IAG9CE,MAAc,YACdF,KACA;AAAA;AAAA;AAAA;AAAA,KAKF;AAAA;AAAA;AAGF,GAEaG,IAAc3B,EAAOiB,CAAQ;AAAA,EACxC,CAAC,EAAE,QAAAW,EAAA,MAAa;AAAA,cACJpB,EAAcoB,CAAM,CAAC;AAAA;AAEnC,GAEaC,IAAiB7B,EAAO8B,CAAQ;AAAA;AAAA;AAAA,eAG9B,CAAC,EAAE,cAAAC,EAAA,MAAoBA,IAAe,mBAAmB,cAAe;AAAA,GAG1EC,IAAiBhC,EAAOiB,CAAQ;AAAA;AAAA,4BAEjB,CAAC,EAAE,OAAAf,EAAA,MAAYA,EAAM,OAAO,MAAM;AAAA,GAGjD+B,IAAcjC,EAAOiB,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"cue-cavas-styled.js","sources":["../../../src/features/cue-canvas/cue-cavas-styled.tsx"],"sourcesContent":["import type { ICueCanvasWrapper, TCueCanvasColors } from './types/cue-canvas';\n\nimport styled, { css } from 'styled-components';\n\nimport TickIcon from '../../assets/line-icons/icons/check';\nimport DownIcon from '../../assets/line-icons/icons/down';\nimport HighlighterIcon from '../../assets/line-icons/icons/highlighter';\nimport PencilIcon from '../../assets/line-icons/icons/pencil';\nimport RulerIcon from '../../assets/line-icons/icons/ruler';\nimport SketchIcon from '../../assets/line-icons/icons/sketch';\nimport UndoIcon from '../../assets/line-icons/icons/undo';\nimport FlexView from '../ui/layout/flex-view';\nimport { CANVAS_COLORS } from './constants/constants';\n\ninterface IToolProps {\n $active: boolean;\n $activeColor: TCueCanvasColors;\n $shouldAnimate: boolean;\n}\n\nexport const StyledPencilIcon = styled(PencilIcon)<IToolProps>(({\n theme,\n $active,\n $activeColor,\n $shouldAnimate,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && $shouldAnimate ? '0px' : '8px'};\n cursor: ${$active ? 'auto' : 'pointer'};\n .pencil-dark-shade {\n fill: ${$active ? color : colors.GREY_3};\n }\n\n .pencil-light-shade {\n fill: ${$active ? color : colors.GREY_2};\n opacity: ${$active ? 0.3 : 1};\n }\n\n ${!$active &&\n css`\n &:hover {\n .pencil-dark-shade {\n fill: ${colors.GREY_4};\n }\n .pencil-light-shade {\n fill: ${colors.GREY_2};\n }\n }\n `}\n `;\n});\n\nexport const StyledRulerIcon = styled(RulerIcon)<IToolProps>(({\n theme,\n $active,\n $activeColor,\n $shouldAnimate,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && $shouldAnimate ? '0px' : '8px'};\n\n .ruler-rect-color {\n fill: ${$active ? color : colors.GREY_3};\n }\n\n .ruler-stripe-base {\n fill: ${$active ? color : colors.GREY_2};\n opacity: ${$active ? 0.2 : 1};\n }\n\n .ruler-small-stripe {\n fill: ${colors.REAL_BLACK};\n }\n\n ${!$active &&\n css`\n &:hover {\n .ruler-rect-color {\n fill: ${colors.GREY_4};\n }\n .ruler-stripe-base {\n fill: ${colors.GREY_3};\n }\n }\n `}\n `;\n});\n\nexport const StyledHighlighterWrapper = styled(HighlighterIcon)<IToolProps>(({\n $active,\n theme,\n $activeColor,\n $shouldAnimate,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && $shouldAnimate ? '0px' : '8px'};\n ${!$active &&\n css`\n &:hover {\n .highlighter-tip {\n fill: ${theme.colors.BLACK};\n }\n\n .highlighter-stripe {\n fill: ${theme.colors.BLACK_50};\n }\n\n .highlighter-light-body {\n fill: ${theme.colors.BLACK_10};\n }\n }\n `}\n\n ${$active &&\n css`\n .highlighter-tip {\n fill: ${color};\n }\n\n .highlighter-stripe {\n fill: ${color};\n opacity: 0.6;\n }\n\n .highlighter-light-body {\n fill: ${color};\n opacity: 0.2;\n }\n `}\n `;\n});\n\nexport const StyledSketchWrapper = styled(SketchIcon)<IToolProps>(({\n $active,\n theme,\n $activeColor,\n $shouldAnimate,\n}) => {\n const { colors } = theme;\n const color = $active ? CANVAS_COLORS[$activeColor] : colors.REAL_BLACK_50;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n position: relative;\n transition: top 0.3s ease-in-out;\n top: ${$active && $shouldAnimate ? '0px' : '8px'};\n\n ${!$active &&\n css`\n &:hover {\n .pen-tip {\n fill: ${theme.colors.BLACK};\n }\n\n .pen-dark-shade {\n fill: ${theme.colors.BLACK_50};\n }\n\n .pen-light-shade {\n fill: ${theme.colors.BLACK_10};\n }\n }\n `}\n\n ${$active &&\n css`\n cursor: ${$active ? 'auto' : 'pointer'};\n .pen-tip {\n fill: ${color};\n }\n\n .pen-dark-shade {\n fill: ${color};\n opacity: 0.6;\n }\n\n .pen-light-shade {\n fill: ${color};\n opacity: 0.4;\n }\n `}\n `;\n});\n\nexport const StyledWrapper = styled(FlexView)<Omit<IToolProps, '$activeColor' | '$shouldAnimate'>>(\n ({ theme, $active }) => {\n const { colors } = theme;\n\n return css`\n cursor: ${$active ? 'auto' : 'pointer'};\n width: 32px;\n height: 32px;\n justify-content: center;\n align-items: center;\n border: 1px solid ${colors.WHITE};\n border-radius: 50%;\n transition: all 100ms ease-in-out;\n\n &:hover {\n border: 1px solid ${colors.REAL_BLACK};\n }\n ${!$active &&\n css`\n &:hover {\n border: 1px solid ${colors.REAL_BLACK};\n }\n `}\n\n ${$active &&\n css`\n cursor: auto;\n background: ${colors.BLACK};\n svg {\n path,\n circle {\n stroke: ${colors.WHITE};\n }\n .hover-tiles {\n stroke: ${colors.WHITE};\n }\n .hover-eraser {\n stroke: none;\n fill: ${colors.WHITE};\n }\n }\n `}\n `;\n },\n);\n\nexport const StyledCheckIcon = styled(TickIcon)`\n path {\n stroke: ${'white'};\n }\n`;\n\nexport const RedoIcon = styled(UndoIcon)`\n transform: scaleX(-1);\n`;\n\nexport const PaletteWrapper = styled(FlexView)`\n position: absolute;\n display: flex;\n justify-content: center;\n top: -24px; //-16 for icon, -8 for gap\n transition:\n opacity 0.5s ease,\n transform 0.5s ease;\n`;\n\nexport const CueCanvasWrapper = styled(FlexView)<ICueCanvasWrapper>(\n ({ $canScribble, $canRender, $renderAs }) => `\n display: ${$canRender ? 'block' : 'none'};\n opacity: ${$canScribble ? 1 : 0.5};\n pointer-events: ${$canScribble ? 'auto' : 'none'};\n\n ${\n $renderAs === 'canvas' &&\n $canScribble &&\n `\n background-image: radial-gradient(rgb(43 43 43 / 8%) 2px, transparent 10%);\n background-position:0 0,32px 32px;\n background-size: 30px 32px;\n `\n }\n \n`,\n);\n\nexport const ColorPicker = styled(FlexView)<{ $color: TCueCanvasColors }>(\n ({ $color }) => `\nbackground: ${CANVAS_COLORS[$color]};\n`,\n);\n\nexport const StyledDownIcon = styled(DownIcon)<{ $isAnimating: boolean }>`\n pointer-events: none;\n transition: transform 0.5s ease;\n transform: ${({ $isAnimating }) => ($isAnimating ? 'rotate(180deg)' : 'rotate(0deg)')};\n`;\n\nexport const PenIconWrapper = styled(FlexView)`\n overflow: hidden;\n border-right: 1px solid ${({ theme }) => theme.colors.GREY_1};\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n padding: 8px 8px 0 8px;\n overflow: hidden;\n bottom: 58px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n transition:\n opacity 0.5s ease,\n transform 0.5s ease;\n\n :hover {\n cursor: pointer;\n }\n`;\n"],"names":["StyledPencilIcon","styled","PencilIcon","theme","$active","$activeColor","$shouldAnimate","colors","color","CANVAS_COLORS","css","StyledRulerIcon","RulerIcon","StyledHighlighterWrapper","HighlighterIcon","StyledSketchWrapper","SketchIcon","StyledWrapper","FlexView","StyledCheckIcon","TickIcon","RedoIcon","UndoIcon","PaletteWrapper","CueCanvasWrapper","$canScribble","$canRender","$renderAs","ColorPicker","$color","StyledDownIcon","DownIcon","$isAnimating","PenIconWrapper","MenuWrapper"],"mappings":";;;;;;;;;;AAoBO,MAAMA,IAAmBC,EAAOC,CAAU,EAAc,CAAC;AAAA,EAC9D,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAA,EAAE,QAAAC,EAAW,IAAAJ,GACbK,IAAQJ,IAAUK,EAAcJ,CAAY,IAAIE,EAAO;AAEtD,SAAAG;AAAA;AAAA;AAAA,WAGEN,KAAWE,IAAiB,QAAQ,KAAK;AAAA,cACtCF,IAAU,SAAS,SAAS;AAAA;AAAA,cAE5BA,IAAUI,IAAQD,EAAO,MAAM;AAAA;AAAA;AAAA;AAAA,cAI/BH,IAAUI,IAAQD,EAAO,MAAM;AAAA,iBAC5BH,IAAU,MAAM,CAAC;AAAA;AAAA;AAAA,MAG5B,CAACA,KACHM;AAAA;AAAA;AAAA,kBAGcH,EAAO,MAAM;AAAA;AAAA;AAAA,kBAGbA,EAAO,MAAM;AAAA;AAAA;AAAA,KAG1B;AAAA;AAEL,CAAC,GAEYI,IAAkBV,EAAOW,CAAS,EAAc,CAAC;AAAA,EAC5D,OAAAT;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAA,EAAE,QAAAC,EAAW,IAAAJ,GACbK,IAAQJ,IAAUK,EAAcJ,CAAY,IAAIE,EAAO;AAEtD,SAAAG;AAAA,cACKN,IAAU,SAAS,SAAS;AAAA;AAAA;AAAA,WAG/BA,KAAWE,IAAiB,QAAQ,KAAK;AAAA;AAAA;AAAA,cAGtCF,IAAUI,IAAQD,EAAO,MAAM;AAAA;AAAA;AAAA;AAAA,cAI/BH,IAAUI,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M,IAAmBvB,EAAOiB,CAAQ;AAAA,EAC7C,CAAC,EAAE,cAAAO,GAAc,YAAAC,GAAY,WAAAC,EAAgB,MAAA;AAAA,aAClCD,IAAa,UAAU,MAAM;AAAA,aAC7BD,IAAe,IAAI,GAAG;AAAA,oBACfA,IAAe,SAAS,MAAM;AAAA;AAAA,IAG9CE,MAAc,YACdF,KACA;AAAA;AAAA;AAAA;AAAA,KAKF;AAAA;AAAA;AAGF,GAEaG,IAAc3B,EAAOiB,CAAQ;AAAA,EACxC,CAAC,EAAE,QAAAW,EAAA,MAAa;AAAA,cACJpB,EAAcoB,CAAM,CAAC;AAAA;AAEnC,GAEaC,IAAiB7B,EAAO8B,CAAQ;AAAA;AAAA;AAAA,eAG9B,CAAC,EAAE,cAAAC,EAAA,MAAoBA,IAAe,mBAAmB,cAAe;AAAA,GAG1EC,IAAiBhC,EAAOiB,CAAQ;AAAA;AAAA,4BAEjB,CAAC,EAAE,OAAAf,EAAA,MAAYA,EAAM,OAAO,MAAM;AAAA,GAGjD+B,IAAcjC,EAAOiB,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -2,41 +2,41 @@ import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
2
  import { memo as d, useRef as C } from "react";
3
3
  import $ from "../../ui/buttons/clickable/clickable.js";
4
4
  import v from "../../ui/hooks/use-context-menu-click-handler.js";
5
- import c from "../../ui/layout/flex-view.js";
6
- import { getIsWritingTool as m } from "../cue-canvas-helpers.js";
7
- import { PenIconWrapper as T, StyledDownIcon as b, MenuWrapper as g } from "../cue-cavas-styled.js";
8
- import { useCueCanvasActions as h } from "../hooks/use-cue-canvas-actions.js";
5
+ import m from "../../ui/layout/flex-view.js";
6
+ import { getIsWritingTool as c } from "../cue-canvas-helpers.js";
7
+ import { PenIconWrapper as T, StyledDownIcon as h, MenuWrapper as b } from "../cue-cavas-styled.js";
8
+ import { useCueCanvasActions as g } from "../hooks/use-cue-canvas-actions.js";
9
9
  import x from "./color-palette.js";
10
- import { TOOLS_TO_COMP as I } from "./icon-map.js";
11
- import k from "./tool.js";
10
+ import { TOOLS_TO_COMP as A } from "./icon-map.js";
11
+ import I from "./tool.js";
12
12
  const _ = d(({ writingTools: s, userType: a }) => {
13
- const { activeTool: e, activeColor: t, setActiveColor: u } = h(), i = C(null), { menuVisible: n, onMenuClick: p } = v(
13
+ const { activeTool: e, activeColor: t, setActiveColor: u } = g(), i = C(null), { menuVisible: n, onMenuClick: f } = v(
14
14
  i,
15
15
  void 0,
16
16
  !0,
17
17
  void 0
18
- ), f = I[m(e) ? e : "pen"];
19
- return /* @__PURE__ */ r(c, { $borderRadius: 16, $background: "WHITE", ref: i, children: [
20
- /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o($, { onClick: p, label: "Active Tool", children: /* @__PURE__ */ r(c, { $flexDirection: "row", $justifyContent: "center", $alignItems: "center", children: [
18
+ ), p = A[c(e) ? e : "pen"];
19
+ return /* @__PURE__ */ r(m, { $borderRadius: 16, $background: "WHITE", ref: i, children: [
20
+ /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o($, { onClick: f, label: "Active Tool", children: /* @__PURE__ */ r(m, { $flexDirection: "row", $justifyContent: "center", $alignItems: "center", children: [
21
21
  /* @__PURE__ */ o(
22
- f,
22
+ p,
23
23
  {
24
- $active: m(e),
24
+ $active: c(e),
25
25
  $activeColor: t,
26
- $isWhiteBoard: !0
26
+ $shouldAnimate: !1
27
27
  }
28
28
  ),
29
- /* @__PURE__ */ o(b, { $isAnimating: n })
29
+ /* @__PURE__ */ o(h, { $isAnimating: n })
30
30
  ] }) }) }),
31
31
  n && /* @__PURE__ */ r(
32
- g,
32
+ b,
33
33
  {
34
34
  $flexDirection: "row",
35
35
  $alignItems: "center",
36
36
  $borderColor: "GREY_1",
37
37
  $background: "WHITE",
38
38
  children: [
39
- s.map((l) => /* @__PURE__ */ o(k, { tool: l, withGutter: !0 }, l)),
39
+ s.map((l) => /* @__PURE__ */ o(I, { tool: l, shouldAnimate: !1, withGutter: !0 }, l)),
40
40
  /* @__PURE__ */ o(
41
41
  x,
42
42
  {
@@ -1 +1 @@
1
- {"version":3,"file":"pen-tool-menu.js","sources":["../../../../src/features/cue-canvas/toolbar/pen-tool-menu.tsx"],"sourcesContent":["import type { IPenToolMenu, TToolComponentType } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../ui/layout/flex-view';\nimport { getIsWritingTool } from '../cue-canvas-helpers';\nimport { MenuWrapper, PenIconWrapper, StyledDownIcon } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport ColorPalette from './color-palette';\nimport { TOOLS_TO_COMP } from './icon-map';\nimport Tool from './tool';\n\nconst PenToolMenu: FC<IPenToolMenu> = memo(({ writingTools, userType }) => {\n const { activeTool, activeColor, setActiveColor } = useCueCanvasActions();\n\n const penMenuRef = useRef(null);\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(\n penMenuRef,\n undefined,\n true,\n undefined,\n );\n\n const ActiveToolComponent = TOOLS_TO_COMP[\n getIsWritingTool(activeTool) ? activeTool : 'pen'\n ] as TToolComponentType;\n\n return (\n <FlexView $borderRadius={16} $background=\"WHITE\" ref={penMenuRef}>\n <PenIconWrapper>\n <Clickable onClick={onMenuClick} label=\"Active Tool\">\n <FlexView $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n <ActiveToolComponent\n $active={getIsWritingTool(activeTool)}\n $activeColor={activeColor}\n $isWhiteBoard\n />\n <StyledDownIcon $isAnimating={menuVisible} />\n </FlexView>\n </Clickable>\n </PenIconWrapper>\n {menuVisible && (\n <MenuWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $borderColor=\"GREY_1\"\n $background=\"WHITE\"\n >\n {writingTools.map(tool => (\n <Tool tool={tool} withGutter key={tool} />\n ))}\n\n <ColorPalette\n setActiveColor={setActiveColor}\n activeColor={activeColor}\n userType={userType}\n />\n </MenuWrapper>\n )}\n </FlexView>\n );\n});\n\nexport default PenToolMenu;\n"],"names":["PenToolMenu","memo","writingTools","userType","activeTool","activeColor","setActiveColor","useCueCanvasActions","penMenuRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","ActiveToolComponent","TOOLS_TO_COMP","getIsWritingTool","FlexView","jsx","PenIconWrapper","Clickable","jsxs","StyledDownIcon","MenuWrapper","Tool","tool","ColorPalette"],"mappings":";;;;;;;;;;;AAeA,MAAMA,IAAgCC,EAAK,CAAC,EAAE,cAAAC,GAAc,UAAAC,QAAe;AACzE,QAAM,EAAE,YAAAC,GAAY,aAAAC,GAAa,gBAAAC,MAAmBC,EAAoB,GAElEC,IAAaC,EAAO,IAAI,GACxB,EAAE,aAAAC,GAAa,aAAAC,EAAA,IAAgBC;AAAA,IACnCJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAGIK,IAAsBC,EAC1BC,EAAiBX,CAAU,IAAIA,IAAa,KAC9C;AAEA,2BACGY,GAAS,EAAA,eAAe,IAAI,aAAY,SAAQ,KAAKR,GACpD,UAAA;AAAA,IAAA,gBAAAS,EAACC,GACC,EAAA,UAAA,gBAAAD,EAACE,GAAU,EAAA,SAASR,GAAa,OAAM,eACrC,UAAC,gBAAAS,EAAAJ,GAAA,EAAS,gBAAe,OAAM,iBAAgB,UAAS,aAAY,UAClE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACJ;AAAA,QAAA;AAAA,UACC,SAASE,EAAiBX,CAAU;AAAA,UACpC,cAAcC;AAAA,UACd,eAAa;AAAA,QAAA;AAAA,MACf;AAAA,MACA,gBAAAY,EAACI,GAAe,EAAA,cAAcX,EAAa,CAAA;AAAA,IAAA,EAC7C,CAAA,EACF,CAAA,GACF;AAAA,IACCA,KACC,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,cAAa;AAAA,QACb,aAAY;AAAA,QAEX,UAAA;AAAA,UAAapB,EAAA,IAAI,OACf,gBAAAe,EAAAM,GAAA,EAAK,MAAAC,GAAY,YAAU,GAAA,GAAMA,CAAM,CACzC;AAAA,UAED,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,gBAAAnB;AAAA,cACA,aAAAD;AAAA,cACA,UAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"pen-tool-menu.js","sources":["../../../../src/features/cue-canvas/toolbar/pen-tool-menu.tsx"],"sourcesContent":["import type { IPenToolMenu, TToolComponentType } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../ui/layout/flex-view';\nimport { getIsWritingTool } from '../cue-canvas-helpers';\nimport { MenuWrapper, PenIconWrapper, StyledDownIcon } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport ColorPalette from './color-palette';\nimport { TOOLS_TO_COMP } from './icon-map';\nimport Tool from './tool';\n\nconst PenToolMenu: FC<IPenToolMenu> = memo(({ writingTools, userType }) => {\n const { activeTool, activeColor, setActiveColor } = useCueCanvasActions();\n\n const penMenuRef = useRef(null);\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(\n penMenuRef,\n undefined,\n true,\n undefined,\n );\n\n const ActiveToolComponent = TOOLS_TO_COMP[\n getIsWritingTool(activeTool) ? activeTool : 'pen'\n ] as TToolComponentType;\n\n return (\n <FlexView $borderRadius={16} $background=\"WHITE\" ref={penMenuRef}>\n <PenIconWrapper>\n <Clickable onClick={onMenuClick} label=\"Active Tool\">\n <FlexView $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n <ActiveToolComponent\n $active={getIsWritingTool(activeTool)}\n $activeColor={activeColor}\n $shouldAnimate={false}\n />\n <StyledDownIcon $isAnimating={menuVisible} />\n </FlexView>\n </Clickable>\n </PenIconWrapper>\n {menuVisible && (\n <MenuWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $borderColor=\"GREY_1\"\n $background=\"WHITE\"\n >\n {writingTools.map(tool => (\n <Tool tool={tool} key={tool} shouldAnimate={false} withGutter />\n ))}\n\n <ColorPalette\n setActiveColor={setActiveColor}\n activeColor={activeColor}\n userType={userType}\n />\n </MenuWrapper>\n )}\n </FlexView>\n );\n});\n\nexport default PenToolMenu;\n"],"names":["PenToolMenu","memo","writingTools","userType","activeTool","activeColor","setActiveColor","useCueCanvasActions","penMenuRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","ActiveToolComponent","TOOLS_TO_COMP","getIsWritingTool","FlexView","jsx","PenIconWrapper","Clickable","jsxs","StyledDownIcon","MenuWrapper","tool","Tool","ColorPalette"],"mappings":";;;;;;;;;;;AAeA,MAAMA,IAAgCC,EAAK,CAAC,EAAE,cAAAC,GAAc,UAAAC,QAAe;AACzE,QAAM,EAAE,YAAAC,GAAY,aAAAC,GAAa,gBAAAC,MAAmBC,EAAoB,GAElEC,IAAaC,EAAO,IAAI,GACxB,EAAE,aAAAC,GAAa,aAAAC,EAAA,IAAgBC;AAAA,IACnCJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAGIK,IAAsBC,EAC1BC,EAAiBX,CAAU,IAAIA,IAAa,KAC9C;AAEA,2BACGY,GAAS,EAAA,eAAe,IAAI,aAAY,SAAQ,KAAKR,GACpD,UAAA;AAAA,IAAA,gBAAAS,EAACC,GACC,EAAA,UAAA,gBAAAD,EAACE,GAAU,EAAA,SAASR,GAAa,OAAM,eACrC,UAAC,gBAAAS,EAAAJ,GAAA,EAAS,gBAAe,OAAM,iBAAgB,UAAS,aAAY,UAClE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACJ;AAAA,QAAA;AAAA,UACC,SAASE,EAAiBX,CAAU;AAAA,UACpC,cAAcC;AAAA,UACd,gBAAgB;AAAA,QAAA;AAAA,MAClB;AAAA,MACA,gBAAAY,EAACI,GAAe,EAAA,cAAcX,EAAa,CAAA;AAAA,IAAA,EAC7C,CAAA,EACF,CAAA,GACF;AAAA,IACCA,KACC,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,cAAa;AAAA,QACb,aAAY;AAAA,QAEX,UAAA;AAAA,UAAapB,EAAA,IAAI,CAChBqB,MAAA,gBAAAN,EAACO,GAAK,EAAA,MAAAD,GAAuB,eAAe,IAAO,YAAU,GAAtC,GAAAA,CAAuC,CAC/D;AAAA,UAED,gBAAAN;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,gBAAAnB;AAAA,cACA,aAAAD;AAAA,cACA,UAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,27 +1,34 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { memo as s, useCallback as p } from "react";
3
- import T from "../../ui/buttons/clickable/clickable.js";
4
- import f from "../../ui/layout/flex-view.js";
5
- import { STATELESS_TOOLS as d, getIsWritingTool as C } from "../cue-canvas-helpers.js";
6
- import { StyledWrapper as u } from "../cue-cavas-styled.js";
7
- import { useCueCanvasActions as v } from "../hooks/use-cue-canvas-actions.js";
8
- import O from "./grid-menu.js";
9
- import { TOOLS_TO_COMP as S } from "./icon-map.js";
10
- const $ = ({ tool: o, withGutter: n }) => {
11
- const e = S[o], {
2
+ import { memo as p, useCallback as T } from "react";
3
+ import f from "../../ui/buttons/clickable/clickable.js";
4
+ import d from "../../ui/layout/flex-view.js";
5
+ import { STATELESS_TOOLS as C, getIsWritingTool as u } from "../cue-canvas-helpers.js";
6
+ import { StyledWrapper as v } from "../cue-cavas-styled.js";
7
+ import { useCueCanvasActions as O } from "../hooks/use-cue-canvas-actions.js";
8
+ import S from "./grid-menu.js";
9
+ import { TOOLS_TO_COMP as $ } from "./icon-map.js";
10
+ const h = ({ tool: o, withGutter: n, shouldAnimate: l }) => {
11
+ const e = $[o], {
12
12
  activeInstance: i,
13
- setActiveTool: c,
14
- activeTool: m,
15
- activeColor: l
16
- } = v(), a = p(
13
+ setActiveTool: m,
14
+ activeTool: c,
15
+ activeColor: a
16
+ } = O(), s = T(
17
17
  (t) => {
18
- i == null || i.setTool(t), d.has(t) || c(t);
18
+ i == null || i.setTool(t), C.has(t) || m(t);
19
19
  },
20
- [i, c]
20
+ [i, m]
21
21
  );
22
- return o === "grid" ? /* @__PURE__ */ r(O, { GridIcon: e }) : /* @__PURE__ */ r(f, { $gutterX: n ? 0.25 : 0, children: /* @__PURE__ */ r(T, { onClick: () => a(o), label: o, children: C(o) ? /* @__PURE__ */ r(e, { $active: m === o, $activeColor: l, $isWhiteBoard: !0 }) : /* @__PURE__ */ r(u, { $active: m === o, children: /* @__PURE__ */ r(e, {}) }) }) });
23
- }, _ = s($);
22
+ return o === "grid" ? /* @__PURE__ */ r(S, { GridIcon: e }) : /* @__PURE__ */ r(d, { $gutterX: n ? 0.25 : 0, children: /* @__PURE__ */ r(f, { onClick: () => s(o), label: o, children: u(o) ? /* @__PURE__ */ r(
23
+ e,
24
+ {
25
+ $active: c === o,
26
+ $activeColor: a,
27
+ $shouldAnimate: l
28
+ }
29
+ ) : /* @__PURE__ */ r(v, { $active: c === o, children: /* @__PURE__ */ r(e, {}) }) }) });
30
+ }, G = p(h);
24
31
  export {
25
- _ as default
32
+ G as default
26
33
  };
27
34
  //# sourceMappingURL=tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sources":["../../../../src/features/cue-canvas/toolbar/tool.tsx"],"sourcesContent":["import type { TCueCanvasTool } from '../types/cue-canvas';\nimport type { TToolComponentType } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport { getIsWritingTool, STATELESS_TOOLS } from '../cue-canvas-helpers';\nimport { StyledWrapper } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport GridMenu from './grid-menu';\nimport { TOOLS_TO_COMP } from './icon-map';\n\ninterface IToolProps {\n tool: TCueCanvasTool;\n withGutter?: boolean;\n}\n\nconst Tool: FC<IToolProps> = ({ tool, withGutter }) => {\n const ToolComponent = TOOLS_TO_COMP[tool] as TToolComponentType;\n const {\n activeInstance: cueCanvas,\n setActiveTool,\n activeTool,\n activeColor,\n } = useCueCanvasActions();\n\n const onToolClick = useCallback(\n (t: TCueCanvasTool) => {\n cueCanvas?.setTool(t);\n\n if (!STATELESS_TOOLS.has(t)) {\n setActiveTool(t);\n }\n },\n [cueCanvas, setActiveTool],\n );\n\n if (tool === 'grid') {\n return <GridMenu GridIcon={ToolComponent} />;\n }\n\n return (\n <FlexView $gutterX={withGutter ? 0.25 : 0}>\n <Clickable onClick={() => onToolClick(tool)} label={tool}>\n {getIsWritingTool(tool) ? (\n <ToolComponent $active={activeTool === tool} $activeColor={activeColor} $isWhiteBoard />\n ) : (\n <StyledWrapper $active={activeTool === tool}>\n <ToolComponent />\n </StyledWrapper>\n )}\n </Clickable>\n </FlexView>\n );\n};\n\nexport default memo(Tool);\n"],"names":["Tool","tool","withGutter","ToolComponent","TOOLS_TO_COMP","cueCanvas","setActiveTool","activeTool","activeColor","useCueCanvasActions","onToolClick","useCallback","STATELESS_TOOLS","jsx","GridMenu","FlexView","Clickable","StyledWrapper","Tool$1","memo"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAAuB,CAAC,EAAE,MAAAC,GAAM,YAAAC,QAAiB;AAC/C,QAAAC,IAAgBC,EAAcH,CAAI,GAClC;AAAA,IACJ,gBAAgBI;AAAA,IAChB,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,MACEC,EAAoB,GAElBC,IAAcC;AAAA,IAClB,CAAC,MAAsB;AACrB,MAAAN,KAAA,QAAAA,EAAW,QAAQ,IAEdO,EAAgB,IAAI,CAAC,KACxBN,EAAc,CAAC;AAAA,IAEnB;AAAA,IACA,CAACD,GAAWC,CAAa;AAAA,EAAA;AAG3B,SAAIL,MAAS,SACJ,gBAAAY,EAACC,GAAS,EAAA,UAAUX,EAAe,CAAA,sBAIzCY,GAAS,EAAA,UAAUb,IAAa,OAAO,GACtC,UAAC,gBAAAW,EAAAG,GAAA,EAAU,SAAS,MAAMN,EAAYT,CAAI,GAAG,OAAOA,GACjD,YAAiBA,CAAI,IACnB,gBAAAY,EAAAV,GAAA,EAAc,SAASI,MAAeN,GAAM,cAAcO,GAAa,eAAa,GAAC,CAAA,IAErF,gBAAAK,EAAAI,GAAA,EAAc,SAASV,MAAeN,GACrC,4BAACE,GAAc,CAAA,CAAA,EACjB,CAAA,GAEJ,EACF,CAAA;AAEJ,GAEee,IAAAC,EAAKnB,CAAI;"}
1
+ {"version":3,"file":"tool.js","sources":["../../../../src/features/cue-canvas/toolbar/tool.tsx"],"sourcesContent":["import type { TCueCanvasTool } from '../types/cue-canvas';\nimport type { TToolComponentType } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport { getIsWritingTool, STATELESS_TOOLS } from '../cue-canvas-helpers';\nimport { StyledWrapper } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport GridMenu from './grid-menu';\nimport { TOOLS_TO_COMP } from './icon-map';\n\ninterface IToolProps {\n tool: TCueCanvasTool;\n withGutter?: boolean;\n shouldAnimate?: boolean;\n}\n\nconst Tool: FC<IToolProps> = ({ tool, withGutter, shouldAnimate }) => {\n const ToolComponent = TOOLS_TO_COMP[tool] as TToolComponentType;\n const {\n activeInstance: cueCanvas,\n setActiveTool,\n activeTool,\n activeColor,\n } = useCueCanvasActions();\n\n const onToolClick = useCallback(\n (t: TCueCanvasTool) => {\n cueCanvas?.setTool(t);\n\n if (!STATELESS_TOOLS.has(t)) {\n setActiveTool(t);\n }\n },\n [cueCanvas, setActiveTool],\n );\n\n if (tool === 'grid') {\n return <GridMenu GridIcon={ToolComponent} />;\n }\n\n return (\n <FlexView $gutterX={withGutter ? 0.25 : 0}>\n <Clickable onClick={() => onToolClick(tool)} label={tool}>\n {getIsWritingTool(tool) ? (\n <ToolComponent\n $active={activeTool === tool}\n $activeColor={activeColor}\n $shouldAnimate={shouldAnimate}\n />\n ) : (\n <StyledWrapper $active={activeTool === tool}>\n <ToolComponent />\n </StyledWrapper>\n )}\n </Clickable>\n </FlexView>\n );\n};\n\nexport default memo(Tool);\n"],"names":["Tool","tool","withGutter","shouldAnimate","ToolComponent","TOOLS_TO_COMP","cueCanvas","setActiveTool","activeTool","activeColor","useCueCanvasActions","onToolClick","useCallback","STATELESS_TOOLS","jsx","GridMenu","FlexView","Clickable","getIsWritingTool","StyledWrapper","Tool$1","memo"],"mappings":";;;;;;;;;AAoBA,MAAMA,IAAuB,CAAC,EAAE,MAAAC,GAAM,YAAAC,GAAY,eAAAC,QAAoB;AAC9D,QAAAC,IAAgBC,EAAcJ,CAAI,GAClC;AAAA,IACJ,gBAAgBK;AAAA,IAChB,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,MACEC,EAAoB,GAElBC,IAAcC;AAAA,IAClB,CAAC,MAAsB;AACrB,MAAAN,KAAA,QAAAA,EAAW,QAAQ,IAEdO,EAAgB,IAAI,CAAC,KACxBN,EAAc,CAAC;AAAA,IAEnB;AAAA,IACA,CAACD,GAAWC,CAAa;AAAA,EAAA;AAG3B,SAAIN,MAAS,SACJ,gBAAAa,EAACC,GAAS,EAAA,UAAUX,EAAe,CAAA,sBAIzCY,GAAS,EAAA,UAAUd,IAAa,OAAO,GACtC,UAAC,gBAAAY,EAAAG,GAAA,EAAU,SAAS,MAAMN,EAAYV,CAAI,GAAG,OAAOA,GACjD,UAAAiB,EAAiBjB,CAAI,IACpB,gBAAAa;AAAA,IAACV;AAAA,IAAA;AAAA,MACC,SAASI,MAAeP;AAAA,MACxB,cAAcQ;AAAA,MACd,gBAAgBN;AAAA,IAAA;AAAA,EAClB,IAEC,gBAAAW,EAAAK,GAAA,EAAc,SAASX,MAAeP,GACrC,UAAC,gBAAAa,EAAAV,GAAA,CAAc,CAAA,EACjB,CAAA,EAEJ,CAAA,EACF,CAAA;AAEJ,GAEegB,IAAAC,EAAKrB,CAAI;"}
@@ -2,21 +2,21 @@ import { jsx as m, jsxs as n } from "react/jsx-runtime";
2
2
  import { memo as s, useEffect as a } from "react";
3
3
  import c from "../../ui/layout/flex-view.js";
4
4
  import { CANVAS_COLORS as p } from "../constants/constants.js";
5
- import { getUserTools as C } from "../cue-canvas-helpers.js";
6
- import { useCueCanvasActions as x } from "../hooks/use-cue-canvas-actions.js";
7
- import b from "./color-picker-menu.js";
8
- import u from "./tool.js";
5
+ import { getUserTools as u } from "../cue-canvas-helpers.js";
6
+ import { useCueCanvasActions as C } from "../hooks/use-cue-canvas-actions.js";
7
+ import x from "./color-picker-menu.js";
8
+ import b from "./tool.js";
9
9
  import T from "./whiteboard-toolbar.js";
10
10
  const $ = s(({ userType: t, renderAs: r }) => {
11
- const f = C(t, r), { activeInstance: o, activeTool: i, activeColor: e } = x();
11
+ const f = u(t, r), { activeInstance: o, activeTool: i, activeColor: e } = C();
12
12
  return a(() => {
13
13
  o && (e && o.setColor(p[e]), i && (o == null || o.setTool(i)));
14
14
  }, [e, i, o, r]), r === "whiteboard" ? /* @__PURE__ */ m(T, { tools: f, userType: t }) : /* @__PURE__ */ n(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", $flexGapX: 0.5, children: [
15
- f.map((l) => /* @__PURE__ */ m(u, { tool: l }, l)),
16
- /* @__PURE__ */ m(b, { userType: t })
15
+ f.map((l) => /* @__PURE__ */ m(b, { tool: l, shouldAnimate: !0 }, l)),
16
+ /* @__PURE__ */ m(x, { userType: t })
17
17
  ] });
18
- }), V = $;
18
+ }), S = $;
19
19
  export {
20
- V as default
20
+ S as default
21
21
  };
22
22
  //# sourceMappingURL=toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","sources":["../../../../src/features/cue-canvas/toolbar/toolbar.tsx"],"sourcesContent":["import type { IToolbarProps } from '../types/toolbar';\n\nimport React, { memo, useEffect } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { CANVAS_COLORS } from '../constants/constants';\nimport { getUserTools } from '../cue-canvas-helpers';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport ColorPickerMenu from './color-picker-menu';\nimport Tool from './tool';\nimport WhiteboardToolbar from './whiteboard-toolbar';\n\nconst Toolbar: React.FC<IToolbarProps> = memo(({ userType, renderAs }) => {\n const tools = getUserTools(userType, renderAs);\n const { activeInstance: cueCanvas, activeTool, activeColor } = useCueCanvasActions();\n\n useEffect(() => {\n if (cueCanvas) {\n if (activeColor) {\n cueCanvas.setColor(CANVAS_COLORS[activeColor]);\n }\n\n if (activeTool) {\n cueCanvas?.setTool(activeTool);\n }\n }\n }, [activeColor, activeTool, cueCanvas, renderAs]);\n\n if (renderAs === 'whiteboard') {\n return <WhiteboardToolbar tools={tools} userType={userType} />;\n }\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGapX={0.5}>\n {tools.map(tool => (\n <Tool tool={tool} key={tool} />\n ))}\n <ColorPickerMenu userType={userType} />\n </FlexView>\n );\n});\n\nexport default Toolbar;\n"],"names":["Toolbar","memo","userType","renderAs","tools","getUserTools","cueCanvas","activeTool","activeColor","useCueCanvasActions","useEffect","CANVAS_COLORS","jsx","WhiteboardToolbar","jsxs","FlexView","tool","Tool","ColorPickerMenu","Toolbar$1"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAmCC,EAAK,CAAC,EAAE,UAAAC,GAAU,UAAAC,QAAe;AAClE,QAAAC,IAAQC,EAAaH,GAAUC,CAAQ,GACvC,EAAE,gBAAgBG,GAAW,YAAAC,GAAY,aAAAC,EAAA,IAAgBC;AAc/D,SAZAC,EAAU,MAAM;AACd,IAAIJ,MACEE,KACQF,EAAA,SAASK,EAAcH,CAAW,CAAC,GAG3CD,MACFD,KAAA,QAAAA,EAAW,QAAQC;AAAA,KAGtB,CAACC,GAAaD,GAAYD,GAAWH,CAAQ,CAAC,GAE7CA,MAAa,eACR,gBAAAS,EAACC,GAAkB,EAAA,OAAAT,GAAc,UAAAF,EAAoB,CAAA,IAI5D,gBAAAY,EAACC,KAAS,gBAAe,OAAM,aAAY,UAAS,iBAAgB,UAAS,WAAW,KACrF,UAAA;AAAA,IAAAX,EAAM,IAAI,CACTY,MAAA,gBAAAJ,EAACK,GAAK,EAAA,MAAAD,KAAiBA,CAAM,CAC9B;AAAA,IACD,gBAAAJ,EAACM,KAAgB,UAAAhB,GAAoB;AAAA,EACvC,EAAA,CAAA;AAEJ,CAAC,GAEDiB,IAAenB;"}
1
+ {"version":3,"file":"toolbar.js","sources":["../../../../src/features/cue-canvas/toolbar/toolbar.tsx"],"sourcesContent":["import type { IToolbarProps } from '../types/toolbar';\n\nimport React, { memo, useEffect } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { CANVAS_COLORS } from '../constants/constants';\nimport { getUserTools } from '../cue-canvas-helpers';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport ColorPickerMenu from './color-picker-menu';\nimport Tool from './tool';\nimport WhiteboardToolbar from './whiteboard-toolbar';\n\nconst Toolbar: React.FC<IToolbarProps> = memo(({ userType, renderAs }) => {\n const tools = getUserTools(userType, renderAs);\n const { activeInstance: cueCanvas, activeTool, activeColor } = useCueCanvasActions();\n\n useEffect(() => {\n if (cueCanvas) {\n if (activeColor) {\n cueCanvas.setColor(CANVAS_COLORS[activeColor]);\n }\n\n if (activeTool) {\n cueCanvas?.setTool(activeTool);\n }\n }\n }, [activeColor, activeTool, cueCanvas, renderAs]);\n\n if (renderAs === 'whiteboard') {\n return <WhiteboardToolbar tools={tools} userType={userType} />;\n }\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGapX={0.5}>\n {tools.map(tool => (\n <Tool tool={tool} key={tool} shouldAnimate />\n ))}\n <ColorPickerMenu userType={userType} />\n </FlexView>\n );\n});\n\nexport default Toolbar;\n"],"names":["Toolbar","memo","userType","renderAs","tools","getUserTools","cueCanvas","activeTool","activeColor","useCueCanvasActions","useEffect","CANVAS_COLORS","jsx","WhiteboardToolbar","jsxs","FlexView","Tool","tool","ColorPickerMenu","Toolbar$1"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAmCC,EAAK,CAAC,EAAE,UAAAC,GAAU,UAAAC,QAAe;AAClE,QAAAC,IAAQC,EAAaH,GAAUC,CAAQ,GACvC,EAAE,gBAAgBG,GAAW,YAAAC,GAAY,aAAAC,EAAA,IAAgBC;AAc/D,SAZAC,EAAU,MAAM;AACd,IAAIJ,MACEE,KACQF,EAAA,SAASK,EAAcH,CAAW,CAAC,GAG3CD,MACFD,KAAA,QAAAA,EAAW,QAAQC;AAAA,KAGtB,CAACC,GAAaD,GAAYD,GAAWH,CAAQ,CAAC,GAE7CA,MAAa,eACR,gBAAAS,EAACC,GAAkB,EAAA,OAAAT,GAAc,UAAAF,EAAoB,CAAA,IAI5D,gBAAAY,EAACC,KAAS,gBAAe,OAAM,aAAY,UAAS,iBAAgB,UAAS,WAAW,KACrF,UAAA;AAAA,IAAMX,EAAA,IAAI,OACR,gBAAAQ,EAAAI,GAAA,EAAK,MAAAC,GAAuB,eAAa,GAAA,GAAnBA,CAAoB,CAC5C;AAAA,IACD,gBAAAL,EAACM,KAAgB,UAAAhB,GAAoB;AAAA,EACvC,EAAA,CAAA;AAEJ,CAAC,GAEDiB,IAAenB;"}
@@ -1,16 +1,16 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { memo as n } from "react";
3
- import s from "../../ui/layout/flex-view.js";
4
- import p from "./pen-tool-menu.js";
5
- import a from "./tool.js";
6
- const d = n(({ tools: o, userType: i }) => {
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { memo as s } from "react";
3
+ import n from "../../ui/layout/flex-view.js";
4
+ import a from "./pen-tool-menu.js";
5
+ import f from "./tool.js";
6
+ const h = s(({ tools: o, userType: i }) => {
7
7
  const t = o.slice(0, 4), m = o.slice(4);
8
- return /* @__PURE__ */ l(s, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.25, $position: "relative", children: [
9
- /* @__PURE__ */ e(p, { writingTools: t, userType: i }),
10
- m.map((r) => /* @__PURE__ */ e(a, { tool: r }, r))
8
+ return /* @__PURE__ */ l(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.25, $position: "relative", children: [
9
+ /* @__PURE__ */ r(a, { writingTools: t, userType: i }),
10
+ m.map((e) => /* @__PURE__ */ r(f, { tool: e, shouldAnimate: !1 }, e))
11
11
  ] });
12
12
  });
13
13
  export {
14
- d as default
14
+ h as default
15
15
  };
16
16
  //# sourceMappingURL=whiteboard-toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"whiteboard-toolbar.js","sources":["../../../../src/features/cue-canvas/toolbar/whiteboard-toolbar.tsx"],"sourcesContent":["import type { IWhiteboardToolbar } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport PenToolMenu from './pen-tool-menu';\nimport Tool from './tool';\n\nconst WhiteboardToolbar: FC<IWhiteboardToolbar> = memo(({ tools, userType }) => {\n const writingTools = tools.slice(0, 4);\n const otherTools = tools.slice(4);\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.25} $position=\"relative\">\n <PenToolMenu writingTools={writingTools} userType={userType} />\n {otherTools.map(tool => (\n <Tool tool={tool} key={tool} />\n ))}\n </FlexView>\n );\n});\n\nexport default WhiteboardToolbar;\n"],"names":["WhiteboardToolbar","memo","tools","userType","writingTools","otherTools","jsxs","FlexView","jsx","PenToolMenu","tool","Tool"],"mappings":";;;;;AASA,MAAMA,IAA4CC,EAAK,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AAC9E,QAAMC,IAAeF,EAAM,MAAM,GAAG,CAAC,GAC/BG,IAAaH,EAAM,MAAM,CAAC;AAG9B,SAAA,gBAAAI,EAACC,KAAS,gBAAe,OAAM,aAAY,UAAS,WAAW,MAAM,WAAU,YAC7E,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAY,cAAAL,GAA4B,UAAAD,EAAoB,CAAA;AAAA,IAC5DE,EAAW,IAAI,CAAAK,wBACbC,GAAK,EAAA,MAAAD,KAAiBA,CAAM,CAC9B;AAAA,EACH,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"whiteboard-toolbar.js","sources":["../../../../src/features/cue-canvas/toolbar/whiteboard-toolbar.tsx"],"sourcesContent":["import type { IWhiteboardToolbar } from '../types/toolbar';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport PenToolMenu from './pen-tool-menu';\nimport Tool from './tool';\n\nconst WhiteboardToolbar: FC<IWhiteboardToolbar> = memo(({ tools, userType }) => {\n const writingTools = tools.slice(0, 4);\n const otherTools = tools.slice(4);\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.25} $position=\"relative\">\n <PenToolMenu writingTools={writingTools} userType={userType} />\n {otherTools.map(tool => (\n <Tool tool={tool} key={tool} shouldAnimate={false} />\n ))}\n </FlexView>\n );\n});\n\nexport default WhiteboardToolbar;\n"],"names":["WhiteboardToolbar","memo","tools","userType","writingTools","otherTools","jsxs","FlexView","jsx","PenToolMenu","tool","Tool"],"mappings":";;;;;AASA,MAAMA,IAA4CC,EAAK,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AAC9E,QAAMC,IAAeF,EAAM,MAAM,GAAG,CAAC,GAC/BG,IAAaH,EAAM,MAAM,CAAC;AAG9B,SAAA,gBAAAI,EAACC,KAAS,gBAAe,OAAM,aAAY,UAAS,WAAW,MAAM,WAAU,YAC7E,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAY,cAAAL,GAA4B,UAAAD,EAAoB,CAAA;AAAA,IAC5DE,EAAW,IAAI,CACdK,MAAA,gBAAAF,EAACG,KAAK,MAAAD,GAAuB,eAAe,GAArB,GAAAA,CAA4B,CACpD;AAAA,EACH,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"scribble-switch.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.tsx"],"sourcesContent":["import React, { memo, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport ScribbleIcon from '../../../../assets/line-icons/icons/scribble';\nimport { StyledWrapper } from '../../../cue-canvas/cue-cavas-styled';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\n\ninterface IScribbleSwitchProps {\n isScribblingEnabled: boolean;\n setIsScribblingEnabled: (enabled: boolean) => void;\n isCanvasEnabled: boolean;\n loggerRef: React.MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n canToggleScribbling?: boolean;\n}\nStyledWrapper;\n\nconst IconWrapper = styled(FlexView)<{ $active: boolean }>(\n ({ theme, $active }) => `\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: 1px solid black;\n &:hover {\n background-color: ${theme.colors.BLACK};\n svg path {\n stroke: ${theme.colors.WHITE};\n }\n }\n background-color: ${$active ? theme.colors.BLACK : theme.colors.WHITE};\n justify-content: center;\n align-items: center;\n svg path {\n stroke: ${$active ? theme.colors.WHITE : theme.colors.BLACK};\n }\n`,\n);\n\nconst ScribbleSwitch: React.FC<IScribbleSwitchProps> = memo(\n ({\n isScribblingEnabled,\n setIsScribblingEnabled,\n isCanvasEnabled,\n loggerRef,\n canToggleScribbling = true,\n }) => {\n const handleToggleScribble = useCallback(() => {\n setIsScribblingEnabled(!isScribblingEnabled);\n loggerRef.current(EVENTS.WORKSHEET_V3_SCRIBBLE_TOGGLE, {\n scribbling_enabled: !isScribblingEnabled,\n });\n }, [isScribblingEnabled, loggerRef, setIsScribblingEnabled]);\n\n if (!isCanvasEnabled) {\n // This is done to center align the QuestionNavBar for worksheets for whom scribbling is not enabled.\n return <FlexView $widthX={15.25} />;\n }\n\n return (\n <Clickable\n label=\"ScribbleSwitch Toggled\"\n onClick={handleToggleScribble}\n disabled={!canToggleScribbling}\n >\n <IconWrapper $active={isScribblingEnabled}>\n <ScribbleIcon />\n </IconWrapper>\n </Clickable>\n );\n },\n);\n\nexport default ScribbleSwitch;\n"],"names":["IconWrapper","styled","FlexView","theme","$active","ScribbleSwitch","memo","isScribblingEnabled","setIsScribblingEnabled","isCanvasEnabled","loggerRef","canToggleScribbling","handleToggleScribble","useCallback","EVENTS","jsx","Clickable","ScribbleIcon"],"mappings":";;;;;;;AAkBA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA,EACjC,CAAC,EAAE,OAAAC,GAAO,SAAAC,EAAA,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMFD,EAAM,OAAO,KAAK;AAAA;AAAA,gBAE1BA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,sBAGZC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIzDC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAG/D,GAEME,IAAiDC;AAAA,EACrD,CAAC;AAAA,IACC,qBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,EAAA,MAClB;AACE,UAAAC,IAAuBC,EAAY,MAAM;AAC7C,MAAAL,EAAuB,CAACD,CAAmB,GACjCG,EAAA,QAAQI,EAAO,8BAA8B;AAAA,QACrD,oBAAoB,CAACP;AAAA,MAAA,CACtB;AAAA,IACA,GAAA,CAACA,GAAqBG,GAAWF,CAAsB,CAAC;AAE3D,WAAKC,IAMH,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAASJ;AAAA,QACT,UAAU,CAACD;AAAA,QAEX,4BAACX,GAAY,EAAA,SAASO,GACpB,UAAA,gBAAAQ,EAACE,IAAa,CAAA,GAChB;AAAA,MAAA;AAAA,IAAA,IAXK,gBAAAF,EAACb,GAAS,EAAA,SAAS,MAAO,CAAA;AAAA,EAcrC;AACF;"}
1
+ {"version":3,"file":"scribble-switch.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.tsx"],"sourcesContent":["import React, { memo, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport ScribbleIcon from '../../../../assets/line-icons/icons/scribble';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\n\ninterface IScribbleSwitchProps {\n isScribblingEnabled: boolean;\n setIsScribblingEnabled: (enabled: boolean) => void;\n isCanvasEnabled: boolean;\n loggerRef: React.MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n canToggleScribbling?: boolean;\n}\n\nconst IconWrapper = styled(FlexView)<{ $active: boolean }>(\n ({ theme, $active }) => `\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: 1px solid black;\n &:hover {\n background-color: ${theme.colors.BLACK};\n svg path {\n stroke: ${theme.colors.WHITE};\n }\n }\n background-color: ${$active ? theme.colors.BLACK : theme.colors.WHITE};\n justify-content: center;\n align-items: center;\n svg path {\n stroke: ${$active ? theme.colors.WHITE : theme.colors.BLACK};\n }\n`,\n);\n\nconst ScribbleSwitch: React.FC<IScribbleSwitchProps> = memo(\n ({\n isScribblingEnabled,\n setIsScribblingEnabled,\n isCanvasEnabled,\n loggerRef,\n canToggleScribbling = true,\n }) => {\n const handleToggleScribble = useCallback(() => {\n setIsScribblingEnabled(!isScribblingEnabled);\n loggerRef.current(EVENTS.WORKSHEET_V3_SCRIBBLE_TOGGLE, {\n scribbling_enabled: !isScribblingEnabled,\n });\n }, [isScribblingEnabled, loggerRef, setIsScribblingEnabled]);\n\n if (!isCanvasEnabled) {\n // This is done to center align the QuestionNavBar for worksheets for whom scribbling is not enabled.\n return <FlexView $widthX={15.25} />;\n }\n\n return (\n <Clickable\n label=\"ScribbleSwitch Toggled\"\n onClick={handleToggleScribble}\n disabled={!canToggleScribbling}\n >\n <IconWrapper $active={isScribblingEnabled}>\n <ScribbleIcon />\n </IconWrapper>\n </Clickable>\n );\n },\n);\n\nexport default ScribbleSwitch;\n"],"names":["IconWrapper","styled","FlexView","theme","$active","ScribbleSwitch","memo","isScribblingEnabled","setIsScribblingEnabled","isCanvasEnabled","loggerRef","canToggleScribbling","handleToggleScribble","useCallback","EVENTS","jsx","Clickable","ScribbleIcon"],"mappings":";;;;;;;AAgBA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA,EACjC,CAAC,EAAE,OAAAC,GAAO,SAAAC,EAAA,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMFD,EAAM,OAAO,KAAK;AAAA;AAAA,gBAE1BA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,sBAGZC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIzDC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAG/D,GAEME,IAAiDC;AAAA,EACrD,CAAC;AAAA,IACC,qBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,EAAA,MAClB;AACE,UAAAC,IAAuBC,EAAY,MAAM;AAC7C,MAAAL,EAAuB,CAACD,CAAmB,GACjCG,EAAA,QAAQI,EAAO,8BAA8B;AAAA,QACrD,oBAAoB,CAACP;AAAA,MAAA,CACtB;AAAA,IACA,GAAA,CAACA,GAAqBG,GAAWF,CAAsB,CAAC;AAE3D,WAAKC,IAMH,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAASJ;AAAA,QACT,UAAU,CAACD;AAAA,QAEX,4BAACX,GAAY,EAAA,SAASO,GACpB,UAAA,gBAAAQ,EAACE,IAAa,CAAA,GAChB;AAAA,MAAA;AAAA,IAAA,IAXK,gBAAAF,EAACb,GAAS,EAAA,SAAS,MAAO,CAAA;AAAA,EAcrC;AACF;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.8.50-as2",
3
+ "version": "2.8.50-as3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"