@cuemath/leap 3.2.23-mb → 3.2.25-m

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.
@@ -1 +1 @@
1
- {"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n return sectionOptions.flatMap(section => section.data).find(({ id }) => id === value)\n ?.label as string;\n }\n\n if (selectOptions) return selectOptions.find(option => option.id === value)?.label;\n }, [searchable, searchText, sectionOptions, selectOptions, value]);\n\n const containerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const inputRef = useRef<HTMLInputElement>(null) as React.RefObject<HTMLInputElement>;\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(\n containerRef,\n undefined,\n !searchable,\n onCloseWithoutSelection,\n disabled,\n );\n\n const handleTextChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (searchable && onSearchTextChange) {\n onSearchTextChange(e.target.value);\n }\n },\n [onSearchTextChange, searchable],\n );\n\n const handleChange = useCallback<IBaseSelectInputProps<IDType>['onChange']>(\n (id, option) => {\n hideMenu();\n onChange(id, option);\n },\n [hideMenu, onChange],\n );\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n e.target.select();\n setTimeout(() => {\n e.target.scrollIntoView({\n behavior: 'smooth',\n });\n }, 300);\n }, []);\n\n const handleClear = useCallback(() => {\n if (onSearchTextChange) {\n onSearchTextChange('');\n inputRef.current?.focus();\n }\n }, [onSearchTextChange]);\n\n const downIcon =\n shape === 'curved' || shape === 'borderLess' ? (\n <Styled.StyledChevronDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n ) : (\n <Styled.StyledDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n );\n\n return (\n <Styled.Container ref={containerRef} $width={width} $widthX={widthX} onClick={onMenuClick}>\n <BaseInput\n renderAs={renderAs}\n label={label}\n stickyLabel={true}\n disabled={disabled}\n willShowMessage={willShowMessage}\n size={size}\n mandatory={mandatory}\n shape={shape}\n isTransparent={isTransparent}\n inputElement={\n <Input\n ref={inputRef}\n $renderAs={renderAs}\n $size={size}\n placeholder={inputValue ? '' : label}\n disabled={disabled}\n readOnly={!searchable}\n value={inputValue ?? ''}\n onFocus={searchable ? handleFocus : undefined}\n onChange={searchable ? handleTextChange : undefined}\n $isTransparent={isTransparent}\n />\n }\n siblingElement={searchable && menuVisible ? <CrossIcon onClick={handleClear} /> : downIcon}\n errorMessage={errorMessage}\n />\n\n {options.length > 0 && (\n <Styled.OptionsContainer $visible={menuVisible}>\n <Styled.OptionsWrapper $renderAs={renderAs} $theme={theme}>\n {sectionOptions && (\n <SelectSection<IDType>\n sectionOptions={sectionOptions}\n theme={theme}\n value={value}\n onChange={handleChange}\n />\n )}\n\n {selectOptions &&\n selectOptions.map(option => (\n <SelectOption<IDType>\n key={option.id}\n option={option}\n selected={option.id === value}\n onChange={handleChange}\n theme={theme}\n />\n ))}\n </Styled.OptionsWrapper>\n </Styled.OptionsContainer>\n )}\n </Styled.Container>\n );\n};\n\nexport default BaseSelectInput;\n"],"names":["BaseSelectInput","props","label","value","options","searchable","searchText","onCloseWithoutSelection","onSearchTextChange","onChange","renderAs","width","widthX","disabled","willShowMessage","mandatory","size","shape","theme","isTransparent","renderOptionsAs","errorMessage","sectionOptions","selectOptions","inputValue","useMemo","_a","section","id","_b","option","containerRef","useRef","inputRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","handleTextChange","useCallback","handleChange","handleFocus","handleClear","jsxs","Styled.Container","jsx","BaseInput","Input","CrossIcon","Styled.StyledChevronDownIcon","Styled.StyledDownIcon","Styled.OptionsContainer","Styled.OptionsWrapper","SelectSection","SelectOption"],"mappings":";;;;;;;;;AAcM,MAAAA,KAAkB,CACtBC,MACiB;AACX,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,eAAAC,IAAgB;AAAA,IAChB,iBAAAC,IAAkB;AAAA,IAClB,cAAAC;AAAA,EACE,IAAApB,GAEEqB,IACJF,MAAoB,kBAAmBhB,GACnCmB,IAAgBH,MAAoB,UAAWhB,GAE/CoB,IAAaC,EAAQ,MAAM;;AAC/B,QAAIpB,EAAmB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AO,OAAO3B;AAAA,UACxB,UAAUqC;AAAA,UACV,OAAAtB;AAAA,QAAA;AAAA,QAJKY,EAAO;AAAA,MAAA,CAMf;AAAA,IAAA,EAAA,CACL,EACF,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n inputLabelOverrides,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n let foundSection, foundOption;\n\n for (const section of sectionOptions) {\n const option = section.data.find(({ id }) => id === value);\n\n if (option) {\n foundSection = section;\n foundOption = option;\n\n break;\n }\n }\n\n if (foundSection && inputLabelOverrides)\n return inputLabelOverrides(foundSection, foundOption);\n\n return foundOption?.label || '';\n }\n\n if (selectOptions) return selectOptions.find(option => option.id === value)?.label;\n }, [searchable, searchText, sectionOptions, selectOptions, inputLabelOverrides, value]);\n\n const containerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const inputRef = useRef<HTMLInputElement>(null) as React.RefObject<HTMLInputElement>;\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(\n containerRef,\n undefined,\n !searchable,\n onCloseWithoutSelection,\n disabled,\n );\n\n const handleTextChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (searchable && onSearchTextChange) {\n onSearchTextChange(e.target.value);\n }\n },\n [onSearchTextChange, searchable],\n );\n\n const handleChange = useCallback<IBaseSelectInputProps<IDType>['onChange']>(\n (id, option) => {\n hideMenu();\n onChange(id, option);\n },\n [hideMenu, onChange],\n );\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n e.target.select();\n setTimeout(() => {\n e.target.scrollIntoView({\n behavior: 'smooth',\n });\n }, 300);\n }, []);\n\n const handleClear = useCallback(() => {\n if (onSearchTextChange) {\n onSearchTextChange('');\n inputRef.current?.focus();\n }\n }, [onSearchTextChange]);\n\n const downIcon =\n shape === 'curved' || shape === 'borderLess' ? (\n <Styled.StyledChevronDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n ) : (\n <Styled.StyledDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n );\n\n return (\n <Styled.Container ref={containerRef} $width={width} $widthX={widthX} onClick={onMenuClick}>\n <BaseInput\n renderAs={renderAs}\n label={label}\n stickyLabel={true}\n disabled={disabled}\n willShowMessage={willShowMessage}\n size={size}\n mandatory={mandatory}\n shape={shape}\n isTransparent={isTransparent}\n inputElement={\n <Input\n ref={inputRef}\n $renderAs={renderAs}\n $size={size}\n placeholder={inputValue ? '' : label}\n disabled={disabled}\n readOnly={!searchable}\n value={inputValue ?? ''}\n onFocus={searchable ? handleFocus : undefined}\n onChange={searchable ? handleTextChange : undefined}\n $isTransparent={isTransparent}\n />\n }\n siblingElement={searchable && menuVisible ? <CrossIcon onClick={handleClear} /> : downIcon}\n errorMessage={errorMessage}\n />\n\n {options.length > 0 && (\n <Styled.OptionsContainer $visible={menuVisible}>\n <Styled.OptionsWrapper $renderAs={renderAs} $theme={theme}>\n {sectionOptions && (\n <SelectSection<IDType>\n sectionOptions={sectionOptions}\n theme={theme}\n value={value}\n onChange={handleChange}\n />\n )}\n\n {selectOptions &&\n selectOptions.map(option => (\n <SelectOption<IDType>\n key={option.id}\n option={option}\n selected={option.id === value}\n onChange={handleChange}\n theme={theme}\n />\n ))}\n </Styled.OptionsWrapper>\n </Styled.OptionsContainer>\n )}\n </Styled.Container>\n );\n};\n\nexport default BaseSelectInput;\n"],"names":["BaseSelectInput","props","label","value","options","searchable","searchText","onCloseWithoutSelection","onSearchTextChange","onChange","renderAs","width","widthX","disabled","willShowMessage","mandatory","size","shape","theme","isTransparent","renderOptionsAs","errorMessage","inputLabelOverrides","sectionOptions","selectOptions","inputValue","useMemo","foundSection","foundOption","section","option","id","_a","containerRef","useRef","inputRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","handleTextChange","useCallback","handleChange","handleFocus","handleClear","jsxs","Styled.Container","jsx","BaseInput","Input","CrossIcon","Styled.StyledChevronDownIcon","Styled.StyledDownIcon","Styled.OptionsContainer","Styled.OptionsWrapper","SelectSection","SelectOption"],"mappings":";;;;;;;;;AAcM,MAAAA,KAAkB,CACtBC,MACiB;AACX,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,OAAA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;AAAA,IACF;AAAA,IAECjB,EAAQ,SAAS,KACf,gBAAA2C,EAAAM,GAAA,EAAwB,UAAUjB,GACjC,UAAA,gBAAAS,EAACS,GAAA,EAAsB,WAAW5C,GAAU,QAAQQ,GACjD,UAAA;AAAA,MACCK,KAAA,gBAAAwB;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,gBAAAhC;AAAA,UACA,OAAAL;AAAA,UACA,OAAAf;AAAA,UACA,UAAUuC;AAAA,QAAA;AAAA,MACZ;AAAA,MAGDlB,KACCA,EAAc,IAAI,CAChBM,MAAA,gBAAAiB;AAAA,QAACS;AAAA,QAAA;AAAA,UAEC,QAAA1B;AAAA,UACA,UAAUA,EAAO,OAAO3B;AAAA,UACxB,UAAUuC;AAAA,UACV,OAAAxB;AAAA,QAAA;AAAA,QAJKY,EAAO;AAAA,MAAA,CAMf;AAAA,IAAA,EAAA,CACL,EACF,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
package/dist/index.d.ts CHANGED
@@ -2,10 +2,14 @@ import type { ButtonHTMLAttributes } from 'react';
2
2
  import type { Channel } from '@cuemath/cue-message-broker';
3
3
  import { ChannelStatus } from '@cuemath/cue-message-broker';
4
4
  import { ComponentType } from 'react';
5
+ import type { Config } from '@lottiefiles/dotlottie-web';
5
6
  import { Context } from 'react';
7
+ import type { Data } from '@lottiefiles/dotlottie-web';
6
8
  import type { DefaultTheme } from 'styled-components';
7
9
  import { DetailedHTMLProps } from 'react';
8
10
  import type { Dispatch } from 'react';
11
+ import type { EventListener as EventListener_2 } from '@lottiefiles/dotlottie-web';
12
+ import type { EventType } from '@lottiefiles/dotlottie-web';
9
13
  import { FC } from 'react';
10
14
  import type { FormEvent } from 'react';
11
15
  import { ForwardRefExoticComponent } from 'react';
@@ -74,6 +78,8 @@ export declare const AnimatedArc: React_2.FC<IAnimatedArcProps>;
74
78
 
75
79
  export declare const AnimatedAvatarMessage: NamedExoticComponent<IAnimatedAvatarMessageProps>;
76
80
 
81
+ declare type AnimationSegment = [number, number];
82
+
77
83
  export declare const AppLoader: FC<IAppLoaderProps>;
78
84
 
79
85
  export declare const ArcButton: NamedExoticComponent<IArcButtonProps & {
@@ -363,6 +369,8 @@ export declare const DesmosCalculator: FC<IDesmosCalculatorProps>;
363
369
 
364
370
  export declare const DigitalMeter: FC<IDigitalMeterProps>;
365
371
 
372
+ export declare const DotLottieAnimation: NamedExoticComponent<IDotLottieAnimationProps & RefAttributes<IDotLottieAnimationRef>>;
373
+
366
374
  export declare const DownIcon: React.FC<React.SVGProps<SVGSVGElement>>;
367
375
 
368
376
  export declare const DraftIcon: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -838,6 +846,7 @@ declare interface IBaseSelectInputProps<IDType extends string | number> extends
838
846
  controlled?: boolean;
839
847
  size?: TInputSizes;
840
848
  theme?: 'light' | 'dark';
849
+ inputLabelOverrides?: (section: ISectionOption<ISelectOption<IDType>>, option: ISelectOption<IDType> | undefined) => string;
841
850
  }
842
851
 
843
852
  declare interface IBaseWebGameProps {
@@ -1412,6 +1421,15 @@ declare interface IDigitalMeterProps {
1412
1421
  actAsTimer?: boolean;
1413
1422
  }
1414
1423
 
1424
+ declare type IDotLottieAnimationProps = XOR<WithSrc, WithData> & SharedProps;
1425
+
1426
+ declare interface IDotLottieAnimationRef {
1427
+ play: () => void;
1428
+ pause: () => void;
1429
+ playSegments: (segments: AnimationSegment) => void;
1430
+ setFrame: (frame: number) => void;
1431
+ }
1432
+
1415
1433
  declare interface IDrawerProps {
1416
1434
  isOpen: boolean;
1417
1435
  onClose?: () => void;
@@ -4524,6 +4542,8 @@ export declare const LOTTIE: {
4524
4542
  VIDEO: string;
4525
4543
  };
4526
4544
 
4545
+ declare type LottieSettings = Omit<Config, 'src' | 'canvas'>;
4546
+
4527
4547
  export declare const LPARChapter: FC<ILPARChapterProps>;
4528
4548
 
4529
4549
  export declare const LPARMilestoneChapter: FC<ILPARMilestoneChapter>;
@@ -4694,6 +4714,28 @@ export declare enum NODE_TYPES {
4694
4714
  'PUZZLE_CARD' = "PUZZLE_CARD"
4695
4715
  }
4696
4716
 
4717
+ declare const Notification_2: React.FC<NotificationProps>;
4718
+ export { Notification_2 as Notification }
4719
+
4720
+ declare interface NotificationProps {
4721
+ avatarUrl?: string | null;
4722
+ Component?: React.ComponentType<Record<string, unknown>> | null;
4723
+ componentProps?: Record<string, unknown>;
4724
+ duration?: number | null;
4725
+ gap?: number;
4726
+ gutter?: number;
4727
+ hideNotification?: () => void;
4728
+ horizontalDist?: number;
4729
+ notificationTheme?: NotificationTheme;
4730
+ position?: Position;
4731
+ showCloseIcon?: boolean;
4732
+ text?: string | null;
4733
+ verticalDist?: number;
4734
+ visible?: boolean;
4735
+ }
4736
+
4737
+ declare type NotificationTheme = 'white' | 'black';
4738
+
4697
4739
  export declare const Nudge: React_2.NamedExoticComponent<INudgeProps>;
4698
4740
 
4699
4741
  export declare const NumRangeInput: React.FC<NumRangeInputProps>;
@@ -4778,6 +4820,8 @@ export declare const PlusIcon: React.FC<React.SVGProps<SVGSVGElement>>;
4778
4820
 
4779
4821
  export declare const PointerIcon: React.FC<React.SVGProps<SVGSVGElement>>;
4780
4822
 
4823
+ declare type Position = 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right';
4824
+
4781
4825
  export declare const PostGameStats: NamedExoticComponent<IPostGameStatsProps & RefAttributes<IPostGameStatsRef>>;
4782
4826
 
4783
4827
  export declare const PracticeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -4932,6 +4976,18 @@ export declare const SENTRY_IGNORED_ERRORS: Array<string | RegExp>;
4932
4976
 
4933
4977
  export declare const Separator: React_2.FC<ISeparatorProps>;
4934
4978
 
4979
+ declare type SharedProps = {
4980
+ width?: string | number;
4981
+ height?: string | number;
4982
+ settings?: Partial<LottieSettings>;
4983
+ eventListeners?: {
4984
+ name: EventType;
4985
+ callback: EventListener_2<EventType>;
4986
+ }[];
4987
+ onRender?: () => void;
4988
+ onError?: () => void;
4989
+ };
4990
+
4935
4991
  export declare const SHEET_ACTIONS: {
4936
4992
  readonly START: "START";
4937
4993
  readonly RESUME: "RESUME";
@@ -6486,6 +6542,18 @@ export declare enum WebViewEvent {
6486
6542
  */
6487
6543
  export declare const WHITELIST_EVENTS: Record<string, PLUGIN_NAME[]>;
6488
6544
 
6545
+ declare type WithData = {
6546
+ data: Data;
6547
+ };
6548
+
6549
+ declare type Without<T, K extends keyof any> = {
6550
+ [P in Exclude<keyof T, K>]?: never;
6551
+ };
6552
+
6553
+ declare type WithSrc = {
6554
+ src: string;
6555
+ };
6556
+
6489
6557
  export declare const Worksheet: NamedExoticComponent<IWorksheetContainerProps & RefAttributes<IWorksheetRef>>;
6490
6558
 
6491
6559
  export declare const WORKSHEET_ACTION_BAR_HEIGHT = 56;
@@ -6498,6 +6566,8 @@ export declare const WORKSHEET_TOP_NAVIGATION_HEIGHT = 48;
6498
6566
 
6499
6567
  export declare const WORKSHEET_V3_NODE_TYPES: TNodeTypeProps[];
6500
6568
 
6569
+ declare type XOR<T, U> = (T & Without<U, keyof T>) | (U & Without<T, keyof U>);
6570
+
6501
6571
  declare const ZINDEX: {
6502
6572
  readonly CHAPTER_CROWN_ICON: 4;
6503
6573
  readonly CHAPTER_PLUS_ICON: 2;