@mathwiz/ui-components 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AICopilot/AICopilot.css +237 -0
- package/dist/components/AICopilot/AICopilot.d.ts +10 -0
- package/dist/components/AICopilot/AICopilot.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatContainer.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatContainer.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatInput.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatInput.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatMessage.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatMessage.d.ts.map +1 -0
- package/dist/components/AICopilot/components/CollapsibleContextBar.d.ts +9 -0
- package/dist/components/AICopilot/components/CollapsibleContextBar.d.ts.map +1 -0
- package/dist/components/AICopilot/components/QuickActions.d.ts +9 -0
- package/dist/components/AICopilot/components/QuickActions.d.ts.map +1 -0
- package/dist/components/AICopilot/components/StreamMessage.d.ts +9 -0
- package/dist/components/AICopilot/components/StreamMessage.d.ts.map +1 -0
- package/dist/components/AICopilot/index.d.ts +12 -0
- package/dist/components/AICopilot/index.d.ts.map +1 -0
- package/dist/components/AICopilot/store.d.ts +30 -0
- package/dist/components/AICopilot/store.d.ts.map +1 -0
- package/dist/components/AICopilot/types.d.ts +219 -0
- package/dist/components/AICopilot/types.d.ts.map +1 -0
- package/dist/components/MathCardV2/MathCardV2.types.d.ts +20 -1
- package/dist/components/MathCardV2/MathCardV2.types.d.ts.map +1 -1
- package/dist/components/MathCardV2/components/content/MathContainerContent.d.ts +16 -0
- package/dist/components/MathCardV2/components/content/MathContainerContent.d.ts.map +1 -0
- package/dist/components/MathCardV2/components/renderers/ContentRenderer.d.ts.map +1 -1
- package/dist/components/MathCardV2/hooks/useDataAdapter.d.ts.map +1 -1
- package/dist/components/MathCardV2/hooks/useMeetingProblemAdapter.d.ts.map +1 -1
- package/dist/components/MathCell/MathCell.d.ts +35 -0
- package/dist/components/MathCell/MathCell.d.ts.map +1 -0
- package/dist/components/MathCell/MathCell.styles.d.ts +149 -0
- package/dist/components/MathCell/MathCell.styles.d.ts.map +1 -0
- package/dist/components/MathCell/MathCell.types.d.ts +76 -0
- package/dist/components/MathCell/MathCell.types.d.ts.map +1 -0
- package/dist/components/MathCell/index.d.ts +11 -0
- package/dist/components/MathCell/index.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.d.ts +17 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.types.d.ts +55 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.types.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTableView.d.ts +28 -0
- package/dist/components/MathContainer/FactorTable/FactorTableView.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/index.d.ts +7 -0
- package/dist/components/MathContainer/FactorTable/index.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.d.ts +12 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.layout.d.ts +81 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.layout.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.types.d.ts +37 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.types.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivisionView.d.ts +37 -0
- package/dist/components/MathContainer/LongDivision/LongDivisionView.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/index.d.ts +7 -0
- package/dist/components/MathContainer/LongDivision/index.d.ts.map +1 -0
- package/dist/components/MathContainer/MathContainer.types.d.ts +151 -0
- package/dist/components/MathContainer/MathContainer.types.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.d.ts +15 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.types.d.ts +67 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.types.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivisionView.d.ts +16 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivisionView.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/index.d.ts +8 -0
- package/dist/components/MathContainer/ShortDivision/index.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.d.ts +16 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts +42 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.d.ts +22 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.d.ts +19 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/index.d.ts +9 -0
- package/dist/components/MathContainer/VerticalMultiplication/index.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/index.d.ts +15 -0
- package/dist/components/MathContainer/hooks/index.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useFactorTable.d.ts +39 -0
- package/dist/components/MathContainer/hooks/useFactorTable.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useLongDivision.d.ts +51 -0
- package/dist/components/MathContainer/hooks/useLongDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useLongDivision.utils.d.ts +15 -0
- package/dist/components/MathContainer/hooks/useLongDivision.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useShortDivision.d.ts +41 -0
- package/dist/components/MathContainer/hooks/useShortDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.d.ts +28 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.utils.d.ts +30 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/index.d.ts +17 -0
- package/dist/components/MathContainer/index.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/Badge/Badge.d.ts +23 -0
- package/dist/components/dashboard/atoms/Badge/Badge.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/Badge/index.d.ts +4 -0
- package/dist/components/dashboard/atoms/Badge/index.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/GamifiedToken/GamifiedToken.d.ts +14 -0
- package/dist/components/dashboard/atoms/GamifiedToken/GamifiedToken.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/GamifiedToken/index.d.ts +3 -0
- package/dist/components/dashboard/atoms/GamifiedToken/index.d.ts.map +1 -0
- package/dist/components/dashboard/index.d.ts +31 -0
- package/dist/components/dashboard/index.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/FormulaRenderer.d.ts +12 -0
- package/dist/components/dashboard/molecules/MathVisualizer/FormulaRenderer.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/MathVisualizer.css +116 -0
- package/dist/components/dashboard/molecules/MathVisualizer/MathVisualizer.d.ts +39 -0
- package/dist/components/dashboard/molecules/MathVisualizer/MathVisualizer.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/VisualRenderer.d.ts +12 -0
- package/dist/components/dashboard/molecules/MathVisualizer/VisualRenderer.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/constants.d.ts +28 -0
- package/dist/components/dashboard/molecules/MathVisualizer/constants.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/index.d.ts +5 -0
- package/dist/components/dashboard/molecules/MathVisualizer/index.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/types.d.ts +29 -0
- package/dist/components/dashboard/molecules/MathVisualizer/types.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/MathVisualizer/utils.d.ts +6 -0
- package/dist/components/dashboard/molecules/MathVisualizer/utils.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/RadialProgress/RadialProgress.d.ts +3 -0
- package/dist/components/dashboard/molecules/RadialProgress/RadialProgress.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/RadialProgress/index.d.ts +3 -0
- package/dist/components/dashboard/molecules/RadialProgress/index.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/RadialProgress/types.d.ts +22 -0
- package/dist/components/dashboard/molecules/RadialProgress/types.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/SegmentedTabs.d.ts +31 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/SegmentedTabs.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/SegmentedTabs.types.d.ts +39 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/SegmentedTabs.types.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/index.d.ts +6 -0
- package/dist/components/dashboard/molecules/SegmentedTabs/index.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/TaskCheckbox.d.ts +20 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/TaskCheckbox.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/index.d.ts +6 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/index.d.ts.map +1 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/types.d.ts +18 -0
- package/dist/components/dashboard/molecules/TaskCheckbox/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/ActionHeroCard.d.ts +3 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/ActionHeroCard.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/types.d.ts +16 -0
- package/dist/components/dashboard/organisms/ActionHeroCard/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActivityChart/ActivityChart.d.ts +4 -0
- package/dist/components/dashboard/organisms/ActivityChart/ActivityChart.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActivityChart/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/ActivityChart/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/ActivityChart/types.d.ts +23 -0
- package/dist/components/dashboard/organisms/ActivityChart/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardHeader/DashboardHeader.d.ts +4 -0
- package/dist/components/dashboard/organisms/DashboardHeader/DashboardHeader.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardHeader/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/DashboardHeader/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardHeader/types.d.ts +28 -0
- package/dist/components/dashboard/organisms/DashboardHeader/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/DashboardSidebar.d.ts +4 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/DashboardSidebar.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/types.d.ts +25 -0
- package/dist/components/dashboard/organisms/DashboardSidebar/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/PathwayNode/PathwayNode.d.ts +32 -0
- package/dist/components/dashboard/organisms/PathwayNode/PathwayNode.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/PathwayNode/index.d.ts +6 -0
- package/dist/components/dashboard/organisms/PathwayNode/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/PathwayNode/types.d.ts +29 -0
- package/dist/components/dashboard/organisms/PathwayNode/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/RecommendationCard/RecommendationCard.d.ts +4 -0
- package/dist/components/dashboard/organisms/RecommendationCard/RecommendationCard.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/RecommendationCard/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/RecommendationCard/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/RecommendationCard/types.d.ts +44 -0
- package/dist/components/dashboard/organisms/RecommendationCard/types.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/SkillRings/SkillRings.d.ts +4 -0
- package/dist/components/dashboard/organisms/SkillRings/SkillRings.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/SkillRings/index.d.ts +3 -0
- package/dist/components/dashboard/organisms/SkillRings/index.d.ts.map +1 -0
- package/dist/components/dashboard/organisms/SkillRings/types.d.ts +25 -0
- package/dist/components/dashboard/organisms/SkillRings/types.d.ts.map +1 -0
- package/dist/components/dashboard/templates/DailyMilestones/DailyMilestones.d.ts +46 -0
- package/dist/components/dashboard/templates/DailyMilestones/DailyMilestones.d.ts.map +1 -0
- package/dist/components/dashboard/templates/DailyMilestones/index.d.ts +3 -0
- package/dist/components/dashboard/templates/DailyMilestones/index.d.ts.map +1 -0
- package/dist/components/dashboard/templates/DailyMilestones/types.d.ts +13 -0
- package/dist/components/dashboard/templates/DailyMilestones/types.d.ts.map +1 -0
- package/dist/components/dashboard/templates/LearningPathway/LearningPathway.d.ts +4 -0
- package/dist/components/dashboard/templates/LearningPathway/LearningPathway.d.ts.map +1 -0
- package/dist/components/dashboard/templates/LearningPathway/LearningPathway.types.d.ts +46 -0
- package/dist/components/dashboard/templates/LearningPathway/LearningPathway.types.d.ts.map +1 -0
- package/dist/components/dashboard/templates/LearningPathway/index.d.ts +6 -0
- package/dist/components/dashboard/templates/LearningPathway/index.d.ts.map +1 -0
- package/dist/index.cjs +162 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +27418 -17241
- package/dist/index.mjs.map +1 -1
- package/dist/mathwiz-ui.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LongDivision 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
import type { LongDivisionConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
5
|
+
/** LongDivision 组件 Props */
|
|
6
|
+
export interface LongDivisionProps {
|
|
7
|
+
/** 长除法配置 */
|
|
8
|
+
config: LongDivisionConfig;
|
|
9
|
+
/** 初始答案 */
|
|
10
|
+
initialAnswers?: ContainerAnswers;
|
|
11
|
+
/** 答案变化回调 */
|
|
12
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
13
|
+
/** 是否只读 */
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** LongDivisionView 组件 Props */
|
|
17
|
+
export interface LongDivisionViewProps {
|
|
18
|
+
/** 长除法配置 */
|
|
19
|
+
config: LongDivisionConfig;
|
|
20
|
+
/** 当前答案 */
|
|
21
|
+
answers: ContainerAnswers;
|
|
22
|
+
/** 单元格变化回调 */
|
|
23
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
24
|
+
/** 获取单元格状态 */
|
|
25
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
26
|
+
/** 计算步骤 */
|
|
27
|
+
steps: Array<{
|
|
28
|
+
index: number;
|
|
29
|
+
dividend: number;
|
|
30
|
+
quotient: number;
|
|
31
|
+
remainder: number;
|
|
32
|
+
product: number;
|
|
33
|
+
}>;
|
|
34
|
+
/** 是否只读 */
|
|
35
|
+
readonly?: boolean;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=LongDivision.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LongDivision.types.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/LongDivision/LongDivision.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEjG,4BAA4B;AAC5B,MAAM,WAAW,iBAAiB;IAChC,YAAY;IACZ,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gCAAgC;AAChC,MAAM,WAAW,qBAAqB;IACpC,YAAY;IACZ,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW;IACX,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc;IACd,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,WAAW;IACX,KAAK,EAAE,KAAK,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LongDivisionView 组件
|
|
3
|
+
* 长除法展示层 - 纯展示组件 (新版)
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 React.memo 优化,避免不必要的重渲染。
|
|
7
|
+
* 渲染厂字形扩展布局:左侧显示除数,上方显示被除数,下方显示计算步骤。
|
|
8
|
+
* 支持任意除法竖式表现。
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { LongDivisionConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
12
|
+
export interface LongDivisionViewProps {
|
|
13
|
+
/** 长除法配置 */
|
|
14
|
+
config: LongDivisionConfig;
|
|
15
|
+
/** 当前答案 */
|
|
16
|
+
answers: ContainerAnswers;
|
|
17
|
+
/** 单元格变化回调 */
|
|
18
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
19
|
+
/** 获取单元格状态 */
|
|
20
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
21
|
+
/** 计算步骤 */
|
|
22
|
+
steps: Array<{
|
|
23
|
+
index: number;
|
|
24
|
+
dividend: number;
|
|
25
|
+
quotient: number;
|
|
26
|
+
remainder: number;
|
|
27
|
+
product: number;
|
|
28
|
+
}>;
|
|
29
|
+
/** 是否只读 */
|
|
30
|
+
readonly?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 长除法展示组件
|
|
34
|
+
* 纯展示组件,接收 props 渲染,不管理状态
|
|
35
|
+
*/
|
|
36
|
+
export declare const LongDivisionView: React.FC<LongDivisionViewProps>;
|
|
37
|
+
//# sourceMappingURL=LongDivisionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LongDivisionView.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/LongDivision/LongDivisionView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQjG,MAAM,WAAW,qBAAqB;IACpC,YAAY;IACZ,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW;IACX,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc;IACd,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,WAAW;IACX,KAAK,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxG,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAgL5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/LongDivision/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MathContainer 统一类型定义
|
|
3
|
+
* 业务容器组件体系的核心类型系统
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 提供因数表、短除法、乘法竖式、长除法等数学容器组件的统一类型定义。
|
|
7
|
+
* 采用 Hook + View 架构模式,实现逻辑与UI分离。
|
|
8
|
+
*/
|
|
9
|
+
import type { MathCellStatus } from '../MathCell/MathCell.types';
|
|
10
|
+
/** 容器类型 - 使用 const 替代 enum (erasableSyntaxOnly 兼容) */
|
|
11
|
+
export declare const MathContainerType: {
|
|
12
|
+
readonly FACTOR_TABLE: "factorTable";
|
|
13
|
+
readonly SHORT_DIVISION: "shortDivision";
|
|
14
|
+
readonly VERTICAL_MULTIPLICATION: "verticalMultiplication";
|
|
15
|
+
readonly LONG_DIVISION: "longDivision";
|
|
16
|
+
};
|
|
17
|
+
export type MathContainerType = typeof MathContainerType[keyof typeof MathContainerType];
|
|
18
|
+
/** 容器模式 - 使用 const 替代 enum */
|
|
19
|
+
export declare const MathContainerMode: {
|
|
20
|
+
/** 编辑模式 - 用户可输入答案 */
|
|
21
|
+
readonly EDIT: "edit";
|
|
22
|
+
/** 复习模式 - 显示正确/错误状态 */
|
|
23
|
+
readonly REVIEW: "review";
|
|
24
|
+
/** 解答模式 - 显示标准答案 */
|
|
25
|
+
readonly SOLUTION: "solution";
|
|
26
|
+
};
|
|
27
|
+
export type MathContainerMode = typeof MathContainerMode[keyof typeof MathContainerMode];
|
|
28
|
+
/** 答案状态 - 使用 const 替代 enum */
|
|
29
|
+
export declare const AnswerStatus: {
|
|
30
|
+
/** 正确状态 */
|
|
31
|
+
readonly CORRECT: "correct";
|
|
32
|
+
/** 错误状态 */
|
|
33
|
+
readonly INCORRECT: "incorrect";
|
|
34
|
+
/** 待处理状态 */
|
|
35
|
+
readonly PENDING: "pending";
|
|
36
|
+
};
|
|
37
|
+
/** 答案状态类型 */
|
|
38
|
+
export type AnswerStatus = typeof AnswerStatus[keyof typeof AnswerStatus];
|
|
39
|
+
/** 基础答案类型 */
|
|
40
|
+
export interface CellAnswer {
|
|
41
|
+
/** 答案值 */
|
|
42
|
+
value: number | null;
|
|
43
|
+
/** 验证状态 */
|
|
44
|
+
status: AnswerStatus;
|
|
45
|
+
}
|
|
46
|
+
/** 容器答案集合 - 以 cellId 为键的答案映射 */
|
|
47
|
+
export type ContainerAnswers = Record<string, CellAnswer>;
|
|
48
|
+
/** 容器基础配置 */
|
|
49
|
+
export interface BaseContainerConfig {
|
|
50
|
+
/** 容器唯一标识 */
|
|
51
|
+
containerId: string;
|
|
52
|
+
/** 容器模式 */
|
|
53
|
+
mode: MathContainerMode;
|
|
54
|
+
}
|
|
55
|
+
/** 因数表配置 */
|
|
56
|
+
export interface FactorTableConfig extends BaseContainerConfig {
|
|
57
|
+
/** 容器类型 */
|
|
58
|
+
type: 'factorTable';
|
|
59
|
+
/** 目标数字(需要分解因数的数字) */
|
|
60
|
+
number: number;
|
|
61
|
+
/** 行数(因数对数量) */
|
|
62
|
+
rows: number;
|
|
63
|
+
}
|
|
64
|
+
/** 短除法配置 */
|
|
65
|
+
export interface ShortDivisionConfig extends BaseContainerConfig {
|
|
66
|
+
/** 容器类型 */
|
|
67
|
+
type: 'shortDivision';
|
|
68
|
+
/** 被除数 */
|
|
69
|
+
dividend: number;
|
|
70
|
+
/** 除数 */
|
|
71
|
+
divisor: number;
|
|
72
|
+
/** 步骤数 */
|
|
73
|
+
steps: number;
|
|
74
|
+
}
|
|
75
|
+
/** 乘法竖式配置 */
|
|
76
|
+
export interface VerticalMultiplicationConfig extends BaseContainerConfig {
|
|
77
|
+
/** 容器类型 */
|
|
78
|
+
type: 'verticalMultiplication';
|
|
79
|
+
/** 被乘数 */
|
|
80
|
+
multiplicand: number;
|
|
81
|
+
/** 乘数 */
|
|
82
|
+
multiplier: number;
|
|
83
|
+
}
|
|
84
|
+
/** 长除法配置 */
|
|
85
|
+
export interface LongDivisionConfig extends BaseContainerConfig {
|
|
86
|
+
/** 容器类型 */
|
|
87
|
+
type: 'longDivision';
|
|
88
|
+
/** 被除数 */
|
|
89
|
+
dividend: number;
|
|
90
|
+
/** 除数 */
|
|
91
|
+
divisor: number;
|
|
92
|
+
}
|
|
93
|
+
/** 容器配置联合类型 */
|
|
94
|
+
export type ContainerConfig = FactorTableConfig | ShortDivisionConfig | VerticalMultiplicationConfig | LongDivisionConfig;
|
|
95
|
+
/** Hook 返回的基础类型 */
|
|
96
|
+
export interface UseContainerReturn {
|
|
97
|
+
/** 当前所有答案 */
|
|
98
|
+
answers: ContainerAnswers;
|
|
99
|
+
/** 更新答案函数 */
|
|
100
|
+
updateAnswer: (cellId: string, value: number | null) => void;
|
|
101
|
+
/** 获取单元格状态 */
|
|
102
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
103
|
+
/** 验证结果映射 */
|
|
104
|
+
validation: Record<string, AnswerStatus>;
|
|
105
|
+
/** 是否完成 */
|
|
106
|
+
isComplete: boolean;
|
|
107
|
+
/** 重置函数 */
|
|
108
|
+
reset: () => void;
|
|
109
|
+
}
|
|
110
|
+
/** 视图组件基础 Props */
|
|
111
|
+
export interface ContainerViewProps {
|
|
112
|
+
/** 容器配置 */
|
|
113
|
+
config: ContainerConfig;
|
|
114
|
+
/** 当前答案 */
|
|
115
|
+
answers: ContainerAnswers;
|
|
116
|
+
/** 单元格变化回调 */
|
|
117
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
118
|
+
/** 获取单元格状态 */
|
|
119
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
120
|
+
/** 是否只读 */
|
|
121
|
+
readonly?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/** MathContainer 基础 Props 接口 (旧版兼容) */
|
|
124
|
+
export interface MathContainerProps {
|
|
125
|
+
/** 题目数据 */
|
|
126
|
+
questionData?: any;
|
|
127
|
+
/** 用户答案 */
|
|
128
|
+
userAnswers?: Record<string, any>;
|
|
129
|
+
/** 正确答案(用于回显模式) */
|
|
130
|
+
correctAnswers?: Record<string, any>;
|
|
131
|
+
/** 模式:edit | review | solution */
|
|
132
|
+
mode: MathContainerMode;
|
|
133
|
+
/** 只读模式 */
|
|
134
|
+
readonly?: boolean;
|
|
135
|
+
/** 答案变更回调 */
|
|
136
|
+
onAnswerChange?: (answers: Record<string, number | null>) => void;
|
|
137
|
+
/** 单元格变更回调 */
|
|
138
|
+
onCellChange?: (cellId: string, value: number | null) => void;
|
|
139
|
+
/** 验证状态变更回调 */
|
|
140
|
+
onValidationChange?: (validation: Record<string, MathCellStatus>) => void;
|
|
141
|
+
/** 容器标识 */
|
|
142
|
+
containerId?: string;
|
|
143
|
+
}
|
|
144
|
+
/** 容器答案数据类型 (旧版兼容) */
|
|
145
|
+
export interface MathContainerAnswer {
|
|
146
|
+
containerId: string;
|
|
147
|
+
answers: Record<string, number | null>;
|
|
148
|
+
validation?: Record<string, MathCellStatus>;
|
|
149
|
+
timestamp?: string;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=MathContainer.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MathContainer.types.d.ts","sourceRoot":"","sources":["../../../src/components/MathContainer/MathContainer.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShortDivision 组合组件
|
|
3
|
+
* 短除法容器组件 - 组合 Hook 和 View
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 useShortDivision Hook 管理状态,渲染 ShortDivisionView 展示组件。
|
|
7
|
+
* 保持简洁,只负责组合逻辑和视图。
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { ShortDivisionProps } from './ShortDivision.types';
|
|
11
|
+
/**
|
|
12
|
+
* 短除法组合组件
|
|
13
|
+
*/
|
|
14
|
+
export declare const ShortDivision: React.FC<ShortDivisionProps>;
|
|
15
|
+
//# sourceMappingURL=ShortDivision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortDivision.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/ShortDivision/ShortDivision.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6BtD,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShortDivision 组件类型定义
|
|
3
|
+
* 短除法组件专用类型
|
|
4
|
+
*/
|
|
5
|
+
import type { ShortDivisionConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
6
|
+
/**
|
|
7
|
+
* ShortDivisionView 组件 Props
|
|
8
|
+
*/
|
|
9
|
+
export interface ShortDivisionViewProps {
|
|
10
|
+
/** 短除法配置 */
|
|
11
|
+
config: ShortDivisionConfig;
|
|
12
|
+
/** 当前答案 */
|
|
13
|
+
answers: ContainerAnswers;
|
|
14
|
+
/** 单元格变化回调 */
|
|
15
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
16
|
+
/** 获取单元格状态 */
|
|
17
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
18
|
+
/** 每步计算结果 */
|
|
19
|
+
stepResults: Record<number, {
|
|
20
|
+
quotient: number;
|
|
21
|
+
remainder: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** 是否只读 */
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ShortDivision 组合组件 Props
|
|
28
|
+
*/
|
|
29
|
+
export interface ShortDivisionProps {
|
|
30
|
+
/** 短除法配置 */
|
|
31
|
+
config: ShortDivisionConfig;
|
|
32
|
+
/** 初始答案 */
|
|
33
|
+
initialAnswers?: ContainerAnswers;
|
|
34
|
+
/** 答案变化回调 */
|
|
35
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
36
|
+
/** 是否只读 */
|
|
37
|
+
readonly?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 短除法步骤数据
|
|
41
|
+
*/
|
|
42
|
+
export interface ShortDivisionStep {
|
|
43
|
+
/** 步骤索引 */
|
|
44
|
+
index: number;
|
|
45
|
+
/** 当前被除数 */
|
|
46
|
+
dividend: number;
|
|
47
|
+
/** 商 */
|
|
48
|
+
quotient: number;
|
|
49
|
+
/** 余数 */
|
|
50
|
+
remainder: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 短除法单元格数据
|
|
54
|
+
*/
|
|
55
|
+
export interface ShortDivisionCellData {
|
|
56
|
+
/** 单元格ID */
|
|
57
|
+
cellId: string;
|
|
58
|
+
/** 单元格类型 */
|
|
59
|
+
type: 'quotient' | 'remainder';
|
|
60
|
+
/** 步骤索引 */
|
|
61
|
+
stepIndex: number;
|
|
62
|
+
/** 当前值 */
|
|
63
|
+
value: number | null;
|
|
64
|
+
/** 状态 */
|
|
65
|
+
status: AnswerStatus;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=ShortDivision.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortDivision.types.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/ShortDivision/ShortDivision.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY;IACZ,MAAM,EAAE,mBAAmB,CAAC;IAC5B,WAAW;IACX,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc;IACd,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,aAAa;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY;IACZ,MAAM,EAAE,mBAAmB,CAAC;IAC5B,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ;IACR,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS;IACT,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY;IACZ,IAAI,EAAE,UAAU,GAAG,WAAW,CAAC;IAC/B,WAAW;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS;IACT,MAAM,EAAE,YAAY,CAAC;CACtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShortDivisionView 组件
|
|
3
|
+
* 短除法展示层 - 纯展示组件
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 React.memo 优化,避免不必要的重渲染。
|
|
7
|
+
* 渲染 L 型阶梯式布局:左侧显示除数,右侧显示被除数递进计算。
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { ShortDivisionViewProps } from './ShortDivision.types';
|
|
11
|
+
/**
|
|
12
|
+
* 短除法展示组件
|
|
13
|
+
* 纯展示组件,接收 props 渲染,不管理状态
|
|
14
|
+
*/
|
|
15
|
+
export declare const ShortDivisionView: React.FC<ShortDivisionViewProps>;
|
|
16
|
+
//# sourceMappingURL=ShortDivisionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortDivisionView.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/ShortDivision/ShortDivisionView.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqH9D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShortDivision 模块导出
|
|
3
|
+
* 短除法组件
|
|
4
|
+
*/
|
|
5
|
+
export { ShortDivision } from './ShortDivision';
|
|
6
|
+
export { ShortDivisionView } from './ShortDivisionView';
|
|
7
|
+
export type { ShortDivisionProps, ShortDivisionViewProps, ShortDivisionStep, ShortDivisionCellData, } from './ShortDivision.types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/ShortDivision/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VerticalMultiplication 组件
|
|
3
|
+
* 乘法竖式组合组件 - 连接 Hook 和 View
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 useVerticalMultiplication Hook 管理状态,
|
|
7
|
+
* 通过 VerticalMultiplicationView 渲染界面。
|
|
8
|
+
* 保持组件简洁,逻辑集中在 Hook 中。
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { VerticalMultiplicationProps } from './VerticalMultiplication.types';
|
|
12
|
+
/**
|
|
13
|
+
* 乘法竖式组合组件
|
|
14
|
+
*/
|
|
15
|
+
export declare const VerticalMultiplication: React.FC<VerticalMultiplicationProps>;
|
|
16
|
+
//# sourceMappingURL=VerticalMultiplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMultiplication.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/VerticalMultiplication/VerticalMultiplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAoCxE,CAAC"}
|
package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VerticalMultiplication 组件专用类型
|
|
3
|
+
* 乘法竖式组件的类型定义
|
|
4
|
+
*/
|
|
5
|
+
import type { VerticalMultiplicationConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
6
|
+
/**
|
|
7
|
+
* VerticalMultiplication 组件 Props
|
|
8
|
+
*/
|
|
9
|
+
export interface VerticalMultiplicationProps {
|
|
10
|
+
/** 乘法竖式配置 */
|
|
11
|
+
config: VerticalMultiplicationConfig;
|
|
12
|
+
/** 初始答案 */
|
|
13
|
+
initialAnswers?: ContainerAnswers;
|
|
14
|
+
/** 答案变化回调 */
|
|
15
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
16
|
+
/** 是否只读 */
|
|
17
|
+
readonly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* VerticalMultiplicationView 组件 Props
|
|
21
|
+
*/
|
|
22
|
+
export interface VerticalMultiplicationViewProps {
|
|
23
|
+
/** 乘法竖式配置 */
|
|
24
|
+
config: VerticalMultiplicationConfig;
|
|
25
|
+
/** 当前答案 */
|
|
26
|
+
answers: ContainerAnswers;
|
|
27
|
+
/** 单元格变化回调 */
|
|
28
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
29
|
+
/** 获取单元格状态 */
|
|
30
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
31
|
+
/** 中间积数组 */
|
|
32
|
+
partialProducts: Array<{
|
|
33
|
+
digit: number;
|
|
34
|
+
partial: number;
|
|
35
|
+
rowIndex: number;
|
|
36
|
+
}>;
|
|
37
|
+
/** 正确答案 */
|
|
38
|
+
correctProduct: number;
|
|
39
|
+
/** 是否只读 */
|
|
40
|
+
readonly?: boolean;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=VerticalMultiplication.types.d.ts.map
|
package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMultiplication.types.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,aAAa;IACb,MAAM,EAAE,4BAA4B,CAAC;IACrC,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa;IACb,MAAM,EAAE,4BAA4B,CAAC;IACrC,WAAW;IACX,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc;IACd,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,YAAY;IACZ,eAAe,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E,WAAW;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VerticalMultiplicationView 组件
|
|
3
|
+
* 乘法竖式展示层 - 纯展示组件
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { VerticalMultiplicationConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
7
|
+
export interface VerticalMultiplicationViewProps {
|
|
8
|
+
config: VerticalMultiplicationConfig;
|
|
9
|
+
answers: ContainerAnswers;
|
|
10
|
+
onCellChange: (cellId: string, value: number | null) => void;
|
|
11
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
12
|
+
partialProducts: Array<{
|
|
13
|
+
digit: number;
|
|
14
|
+
partial: number;
|
|
15
|
+
rowIndex: number;
|
|
16
|
+
}>;
|
|
17
|
+
correctProduct: number;
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** 乘法竖式展示组件 */
|
|
21
|
+
export declare const VerticalMultiplicationView: React.FC<VerticalMultiplicationViewProps>;
|
|
22
|
+
//# sourceMappingURL=VerticalMultiplicationView.d.ts.map
|
package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMultiplicationView.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,4BAA4B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,eAAe,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6GD,eAAe;AACf,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CA2ChF,CAAC"}
|
package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VerticalMultiplicationView 工具函数
|
|
3
|
+
* 视图组件的辅助函数
|
|
4
|
+
*/
|
|
5
|
+
import type { AnswerStatus } from '../MathContainer.types';
|
|
6
|
+
/**
|
|
7
|
+
* 处理单元格值变化
|
|
8
|
+
* 将字符串输入转换为数字或 null
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseCellValue(value: string): number | null;
|
|
11
|
+
/**
|
|
12
|
+
* 根据状态获取输入框样式类名
|
|
13
|
+
*/
|
|
14
|
+
export declare function getInputClassName(status: AnswerStatus): string;
|
|
15
|
+
/**
|
|
16
|
+
* 计算最大宽度(用于对齐)
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateMaxDigits(multiplicand: number, multiplier: number, correctProduct: number): number;
|
|
19
|
+
//# sourceMappingURL=VerticalMultiplicationView.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMultiplicationView.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAY9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,MAAM,CAMR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VerticalMultiplication 组件导出
|
|
3
|
+
* 乘法竖式组件
|
|
4
|
+
*/
|
|
5
|
+
export { VerticalMultiplication } from './VerticalMultiplication';
|
|
6
|
+
export { VerticalMultiplicationView } from './VerticalMultiplicationView';
|
|
7
|
+
export type { VerticalMultiplicationProps, VerticalMultiplicationViewProps, } from './VerticalMultiplication.types';
|
|
8
|
+
export { parseCellValue, getInputClassName, calculateMaxDigits, } from './VerticalMultiplicationView.utils';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/VerticalMultiplication/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MathContainer Hooks 导出
|
|
3
|
+
* 业务容器组件的自定义 Hooks
|
|
4
|
+
*/
|
|
5
|
+
export { useFactorTable } from './useFactorTable';
|
|
6
|
+
export type { UseFactorTableOptions, UseFactorTableReturn } from './useFactorTable';
|
|
7
|
+
export { useShortDivision } from './useShortDivision';
|
|
8
|
+
export type { UseShortDivisionOptions, UseShortDivisionReturn } from './useShortDivision';
|
|
9
|
+
export { useVerticalMultiplication } from './useVerticalMultiplication';
|
|
10
|
+
export type { UseVerticalMultiplicationOptions, UseVerticalMultiplicationReturn } from './useVerticalMultiplication';
|
|
11
|
+
export { calculatePartialProducts, calculateTotalCells, getCorrectCellValue, checkComplete, } from './useVerticalMultiplication.utils';
|
|
12
|
+
export { useLongDivision } from './useLongDivision';
|
|
13
|
+
export type { UseLongDivisionOptions, UseLongDivisionReturn } from './useLongDivision';
|
|
14
|
+
export { calculateSteps } from './useLongDivision.utils';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,gCAAgC,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AACrH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFactorTable Hook
|
|
3
|
+
* 因数表逻辑层 - 管理状态、验证逻辑
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 useRef 避免闭包问题,确保回调函数引用稳定。
|
|
7
|
+
* 验证逻辑:检查两数乘积是否等于目标数字。
|
|
8
|
+
*/
|
|
9
|
+
import type { FactorTableConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
10
|
+
export interface UseFactorTableOptions {
|
|
11
|
+
/** 因数表配置 */
|
|
12
|
+
config: FactorTableConfig;
|
|
13
|
+
/** 初始答案 */
|
|
14
|
+
initialAnswers?: ContainerAnswers;
|
|
15
|
+
/** 答案变化回调 */
|
|
16
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
17
|
+
/** 验证状态变化回调 */
|
|
18
|
+
onValidationChange?: (validation: Record<string, AnswerStatus>) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface UseFactorTableReturn {
|
|
21
|
+
/** 当前所有答案 */
|
|
22
|
+
answers: ContainerAnswers;
|
|
23
|
+
/** 更新答案函数 */
|
|
24
|
+
updateAnswer: (cellId: string, value: number | null) => void;
|
|
25
|
+
/** 获取单元格状态 */
|
|
26
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
27
|
+
/** 验证结果映射 */
|
|
28
|
+
validation: Record<string, AnswerStatus>;
|
|
29
|
+
/** 是否完成 */
|
|
30
|
+
isComplete: boolean;
|
|
31
|
+
/** 重置函数 */
|
|
32
|
+
reset: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 因数表 Hook
|
|
36
|
+
* 管理因数表的状态和验证逻辑
|
|
37
|
+
*/
|
|
38
|
+
export declare function useFactorTable(options: UseFactorTableOptions): UseFactorTableReturn;
|
|
39
|
+
//# sourceMappingURL=useFactorTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFactorTable.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/hooks/useFactorTable.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,qBAAqB;IACpC,YAAY;IACZ,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,eAAe;IACf,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,IAAI,CAAC;CACzE;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,aAAa;IACb,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,aAAa;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,WAAW;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW;IACX,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB,CAyInF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useLongDivision Hook
|
|
3
|
+
* 长除法逻辑层 - 管理状态、验证逻辑
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* 使用 useRef 避免闭包问题,确保回调函数引用稳定。
|
|
7
|
+
* 长除法计算逻辑(四步循环):
|
|
8
|
+
* 1. 商:当前被除数 ÷ 除数
|
|
9
|
+
* 2. 乘:商 × 除数
|
|
10
|
+
* 3. 减:当前被除数 - 乘积
|
|
11
|
+
* 4. 落:余数 × 10 + 下一位
|
|
12
|
+
*/
|
|
13
|
+
import type { LongDivisionConfig, ContainerAnswers, AnswerStatus } from '../MathContainer.types';
|
|
14
|
+
export interface UseLongDivisionOptions {
|
|
15
|
+
/** 长除法配置 */
|
|
16
|
+
config: LongDivisionConfig;
|
|
17
|
+
/** 初始答案 */
|
|
18
|
+
initialAnswers?: ContainerAnswers;
|
|
19
|
+
/** 答案变化回调 */
|
|
20
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface UseLongDivisionReturn {
|
|
23
|
+
/** 当前所有答案 */
|
|
24
|
+
answers: ContainerAnswers;
|
|
25
|
+
/** 更新答案函数 */
|
|
26
|
+
updateAnswer: (cellId: string, value: number | null) => void;
|
|
27
|
+
/** 获取单元格状态 */
|
|
28
|
+
getCellStatus: (cellId: string) => AnswerStatus;
|
|
29
|
+
/** 计算步骤 */
|
|
30
|
+
steps: Array<{
|
|
31
|
+
index: number;
|
|
32
|
+
dividend: number;
|
|
33
|
+
quotient: number;
|
|
34
|
+
remainder: number;
|
|
35
|
+
product: number;
|
|
36
|
+
}>;
|
|
37
|
+
/** 商 */
|
|
38
|
+
quotient: number;
|
|
39
|
+
/** 余数 */
|
|
40
|
+
remainder: number;
|
|
41
|
+
/** 是否完成 */
|
|
42
|
+
isComplete: boolean;
|
|
43
|
+
/** 重置函数 */
|
|
44
|
+
reset: () => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 长除法 Hook
|
|
48
|
+
* 管理长除法的状态和验证逻辑
|
|
49
|
+
*/
|
|
50
|
+
export declare function useLongDivision(options: UseLongDivisionOptions): UseLongDivisionReturn;
|
|
51
|
+
//# sourceMappingURL=useLongDivision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLongDivision.d.ts","sourceRoot":"","sources":["../../../../src/components/MathContainer/hooks/useLongDivision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAc,MAAM,wBAAwB,CAAC;AAG7G,MAAM,WAAW,sBAAsB;IACrC,YAAY;IACZ,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,aAAa;IACb,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,cAAc;IACd,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAChD,WAAW;IACX,KAAK,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxG,QAAQ;IACR,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW;IACX,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CA4ItF"}
|