@processandtools/rp-article-designer 1.0.39 → 1.0.40
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/article_designer/VariableBridge.d.ts +4 -0
- package/dist/components/article_designer/Zone.d.ts +2 -1
- package/dist/components/article_designer/zoneElems/Back.d.ts +2 -1
- package/dist/components/article_designer/zoneElems/Bottom.d.ts +3 -2
- package/dist/components/article_designer/zoneElems/Divider.d.ts +2 -2
- package/dist/components/article_designer/zoneElems/Left.d.ts +2 -1
- package/dist/components/article_designer/zoneElems/Right.d.ts +2 -1
- package/dist/components/article_designer/zoneElems/Top.d.ts +3 -2
- package/dist/components/article_designer/zoneElems/{DrawerItem.d.ts → sub_construction/DrawerItem.d.ts} +3 -3
- package/dist/components/article_designer/zoneElems/sub_construction/LinearDividerRender.d.ts +1 -1
- package/dist/components/elements_manager/PD_3D.d.ts +2 -2
- package/dist/components/ui/Canvas3D.d.ts +1 -1
- package/dist/components/ui/CanvasManager.d.ts +1 -1
- package/dist/components/ui/VariablePanel.d.ts +5 -0
- package/dist/components/ui/VisibilityPanel.d.ts +1 -0
- package/dist/components/ui/controls/Configurator.d.ts +7 -0
- package/dist/components/ui/controls/VariablePanel.d.ts +2 -5
- package/dist/components/ui/controls/configurator-components/MCombo.d.ts +7 -0
- package/dist/components/ui/controls/configurator-components/MSlider.d.ts +8 -0
- package/dist/components/ui/controls/configurator-components/MSwitch.d.ts +8 -0
- package/dist/conditions/helpers/ConditionTreeEvaluator.d.ts +2 -3
- package/dist/contexts/article-hover/ArticleHoverContext.d.ts +1 -0
- package/dist/contexts/descriptor/useDescriptor.d.ts +2 -3
- package/dist/data/articles.d.ts +2 -22
- package/dist/data/configurator-data/configuratorFields.d.ts +17 -0
- package/dist/data/configurator-data/options.d.ts +2 -0
- package/dist/debug/PerformanceMonitor.d.ts +77 -0
- package/dist/debug/RerenderTracker.d.ts +85 -0
- package/dist/debug/index.d.ts +9 -0
- package/dist/debug/trackComponent.d.ts +39 -0
- package/dist/descriptor/helper/DescriptorEvaluator.d.ts +2 -3
- package/dist/descriptor/services/DescriptorManager.d.ts +3 -4
- package/dist/helpers/GroupWrapper.d.ts +3 -0
- package/dist/helpers/useCpDispatcher.d.ts +1 -2
- package/dist/hooks/zoneDivider.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stores/variableStore.d.ts +30 -0
- package/dist/stores/visibilityStore.d.ts +23 -0
- package/dist/types/canvas.types.d.ts +1 -0
- package/dist/types/configurator.types.d.ts +10 -0
- package/dist/types/divider.types.d.ts +5 -2
- package/dist/variables/VariableProvider.d.ts +1 -1
- package/dist/variables/VariableResolver.d.ts +1 -1
- package/dist/variables/useVariables.d.ts +1 -1
- package/package.json +5 -1
- package/dist/components/ui/PerformanceMonitor.d.ts +0 -1
- package/dist/components/ui/controls/ControlPanel.d.ts +0 -8
- package/dist/components/ui/controls/ControlPanel2D.d.ts +0 -2
- package/dist/components/ui/controls/ControlPanel3D.d.ts +0 -2
- package/dist/components/ui/controls/VariableController.d.ts +0 -7
- package/dist/components/ui/controls/VariableControllerWrapper.d.ts +0 -12
- package/dist/components/ui/controls/VariablePanel2D.d.ts +0 -2
- package/dist/components/ui/controls/VariablePanel3D.d.ts +0 -2
- package/dist/components/ui/controls/ZoomControls.d.ts +0 -8
- package/dist/components/ui/test/LevaVariableController.d.ts +0 -7
- package/dist/components/ui/test/LevaVisibilityController.d.ts +0 -11
- package/dist/rp-article-designer.css +0 -1
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ZoneProps } from '../../types/zone.types';
|
|
2
|
-
|
|
2
|
+
declare const Zone: import('react').NamedExoticComponent<ZoneProps>;
|
|
3
|
+
export default Zone;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ElemProps } from '../../../types/Elem.types';
|
|
2
|
-
|
|
2
|
+
declare const Back: import('react').NamedExoticComponent<ElemProps>;
|
|
3
|
+
export default Back;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElemProps } from '../../../types/Elem.types';
|
|
2
2
|
import { CpDispatcherResult } from '../../../construction_principle/dto/cp-dispatcher.types';
|
|
3
|
-
|
|
3
|
+
declare const Bottom: import('react').NamedExoticComponent<ElemProps & {
|
|
4
4
|
bottomShelfCP?: CpDispatcherResult;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
6
|
+
export default Bottom;
|
|
@@ -10,5 +10,5 @@ interface DividerProps {
|
|
|
10
10
|
view: VIEW;
|
|
11
11
|
remainingZone: ReturnType<typeof calculateRemainingZoneGeometry>;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
export
|
|
13
|
+
declare const Divider: import('react').NamedExoticComponent<DividerProps>;
|
|
14
|
+
export default Divider;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ElemProps } from '../../../types/Elem.types';
|
|
2
|
-
|
|
2
|
+
declare const Left: import('react').NamedExoticComponent<ElemProps>;
|
|
3
|
+
export default Left;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ElemProps } from '../../../types/Elem.types';
|
|
2
|
-
|
|
2
|
+
declare const Right: import('react').NamedExoticComponent<ElemProps>;
|
|
3
|
+
export default Right;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElemProps } from '../../../types/Elem.types';
|
|
2
2
|
import { CpDispatcherResult } from '../../../construction_principle/dto/cp-dispatcher.types';
|
|
3
|
-
|
|
3
|
+
declare const Top: import('react').NamedExoticComponent<ElemProps & {
|
|
4
4
|
topShelfCP?: CpDispatcherResult;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
6
|
+
export default Top;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VIEW } from '
|
|
2
|
-
import { DataContextType, DrawerZoneDataTypes } from '
|
|
3
|
-
import { PositionedChild } from '
|
|
1
|
+
import { VIEW } from '../../../../types/view.types';
|
|
2
|
+
import { DataContextType, DrawerZoneDataTypes } from '../../../../types/data.types';
|
|
3
|
+
import { PositionedChild } from '../../../../types/zone.types';
|
|
4
4
|
interface DrawerItemProps {
|
|
5
5
|
child: PositionedChild;
|
|
6
6
|
index: number;
|
package/dist/components/article_designer/zoneElems/sub_construction/LinearDividerRender.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ interface DividerProps {
|
|
|
10
10
|
view: VIEW;
|
|
11
11
|
remainingZone: ReturnType<typeof calculateRemainingZoneGeometry>;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
13
|
+
export declare const LinearDividerRender: import('react').NamedExoticComponent<DividerProps>;
|
|
14
14
|
export {};
|
|
@@ -17,5 +17,5 @@ interface PD3DExtendedProps extends PDProps {
|
|
|
17
17
|
[key: string]: unknown;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
export
|
|
20
|
+
export default function PD_3D({ length, width, thk, material, opacity, isSelected, isHovered, onClick, onPointerEnter, onPointerLeave, startPanelThk, endPanelThk, render_mat, meshRef, elemInfo }: PD3DExtendedProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CanvasProps } from '../../types/canvas.types';
|
|
2
|
-
export default function Canvas3D({ data, articleList, debugMode, selectedIndex, onArticleSelect }: CanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Canvas3D({ data, articleList, selectedArticleId, debugMode, selectedIndex, onArticleSelect }: CanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CanvasProps } from '../../types/canvas.types';
|
|
2
|
-
export default function CanvasManager({ data, articleList, debugMode, selectedIndex, onArticleSelect }: CanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function CanvasManager({ data, articleList, debugMode, selectedIndex, onArticleSelect, view }: CanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function VisibilityPanel(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlConfig } from '../../../types/configurator.types';
|
|
2
|
+
interface ConfiguratorProps {
|
|
3
|
+
controls: ControlConfig[];
|
|
4
|
+
selectedArticleId: string | null;
|
|
5
|
+
}
|
|
6
|
+
export default function Configurator({ controls, selectedArticleId }: ConfiguratorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
1
|
import { VAR_TYPE } from '../../../variables/variable.types';
|
|
3
2
|
export interface VariableGroup {
|
|
4
3
|
name: string;
|
|
5
4
|
variables: Array<{
|
|
6
5
|
name: string;
|
|
7
|
-
value: string | number;
|
|
6
|
+
value: string | number | boolean;
|
|
8
7
|
type: VAR_TYPE;
|
|
9
8
|
}>;
|
|
10
9
|
}
|
|
@@ -13,7 +12,5 @@ export interface VariablePanelProps {
|
|
|
13
12
|
groups: VariableGroup[];
|
|
14
13
|
onVariableChange: (name: string, value: string | number) => void;
|
|
15
14
|
onArticleNameChange?: (name: string) => void;
|
|
16
|
-
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
17
|
-
style?: CSSProperties;
|
|
18
15
|
}
|
|
19
|
-
export declare function VariablePanel({ articleName, groups, onVariableChange, onArticleNameChange,
|
|
16
|
+
export declare function VariablePanel({ articleName, groups, onVariableChange, onArticleNameChange, }: VariablePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlConfig } from '../../../../types/configurator.types';
|
|
2
|
+
export interface MComboProps {
|
|
3
|
+
control: ControlConfig;
|
|
4
|
+
selectedArticleId: string;
|
|
5
|
+
currentValue: string | number | boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function MCombo({ control, selectedArticleId, currentValue }: MComboProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ControlConfig } from '../../../../types/configurator.types';
|
|
2
|
+
interface MSliderProps {
|
|
3
|
+
control: ControlConfig;
|
|
4
|
+
selectedArticleId: string;
|
|
5
|
+
currentValue: number;
|
|
6
|
+
}
|
|
7
|
+
export default function MSlider({ control, selectedArticleId, currentValue }: MSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ControlConfig } from '../../../../types/configurator.types';
|
|
2
|
+
interface MSwitchProps {
|
|
3
|
+
control: ControlConfig;
|
|
4
|
+
selectedArticleId: string;
|
|
5
|
+
currentValue: string | number | boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function MSwitch({ control, selectedArticleId, currentValue }: MSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ConditionTreeResponse, TreeNode } from '../types/condition.types';
|
|
2
|
-
import { VariableTree } from '../../variables/VariableResolver';
|
|
3
2
|
export declare class ConditionTreeEvaluator {
|
|
4
|
-
static evaluateTree: (tree: ConditionTreeResponse, data: Record<string, unknown>,
|
|
5
|
-
static evaluateNode: (node: TreeNode, data: Record<string, unknown>,
|
|
3
|
+
static evaluateTree: (tree: ConditionTreeResponse, data: Record<string, unknown>, resolveVarRecursive: (str: string) => string) => boolean;
|
|
4
|
+
static evaluateNode: (node: TreeNode, data: Record<string, unknown>, resolveVarRecursive: (str: string) => string) => boolean;
|
|
6
5
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DescriptorManager } from '../../descriptor/services/DescriptorManager';
|
|
2
2
|
import { DescriptorEvaluationResult, DescriptorNode } from '../../descriptor/types/descriptor.types';
|
|
3
3
|
import { DescriptorTypeValue } from '../../descriptor/types/descriptor-data.types';
|
|
4
|
-
import { VariableTree } from '../../variables/VariableResolver';
|
|
5
4
|
export interface UseDescriptorOptions {
|
|
6
5
|
/** Throw error if descriptor not found (default: false) */
|
|
7
6
|
throwOnError?: boolean;
|
|
@@ -14,7 +13,7 @@ export interface UseDescriptorResult<T extends DescriptorTypeValue> {
|
|
|
14
13
|
/** Whether evaluation was successful */
|
|
15
14
|
success: boolean;
|
|
16
15
|
}
|
|
17
|
-
export declare function useDescriptorEvaluation<T extends DescriptorTypeValue = DescriptorTypeValue>(manager: DescriptorManager, descriptorName: string | undefined, inputData: Record<string, unknown>, options: UseDescriptorOptions | undefined,
|
|
16
|
+
export declare function useDescriptorEvaluation<T extends DescriptorTypeValue = DescriptorTypeValue>(manager: DescriptorManager, descriptorName: string | undefined, inputData: Record<string, unknown>, options: UseDescriptorOptions | undefined, resolveVarRecursive: (str: string) => string): UseDescriptorResult<T>;
|
|
18
17
|
export interface UseDescriptorMatchesResult {
|
|
19
18
|
/** All matching nodes */
|
|
20
19
|
matches: DescriptorNode[];
|
|
@@ -23,7 +22,7 @@ export interface UseDescriptorMatchesResult {
|
|
|
23
22
|
/** Number of matches found */
|
|
24
23
|
count: number;
|
|
25
24
|
}
|
|
26
|
-
export declare function useDescriptorMatches(manager: DescriptorManager, descriptorName: string, inputData: Record<string, unknown>,
|
|
25
|
+
export declare function useDescriptorMatches(manager: DescriptorManager, descriptorName: string | undefined, inputData: Record<string, unknown>, resolveVarRecursive: (str: string) => string): UseDescriptorMatchesResult;
|
|
27
26
|
export declare function useDescriptorExists(manager: DescriptorManager, descriptorName: string): boolean;
|
|
28
27
|
export interface UseDescriptorListOptions {
|
|
29
28
|
/** Filter by descriptor type */
|
package/dist/data/articles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const articleList:
|
|
1
|
+
export declare const articleList: {
|
|
2
2
|
name: string;
|
|
3
3
|
visibility: boolean;
|
|
4
4
|
dimensions: {
|
|
@@ -6,24 +6,4 @@ export declare const articleList: ({
|
|
|
6
6
|
height: number;
|
|
7
7
|
depth: number;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
P_SPP_COLOR: string;
|
|
11
|
-
P_WIDTH: number;
|
|
12
|
-
HSP: number;
|
|
13
|
-
P_FAN_H?: undefined;
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
name: string;
|
|
17
|
-
visibility: boolean;
|
|
18
|
-
dimensions: {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
depth: number;
|
|
22
|
-
};
|
|
23
|
-
variables: {
|
|
24
|
-
P_SPP_COLOR: string;
|
|
25
|
-
P_FAN_H: number;
|
|
26
|
-
P_WIDTH: number;
|
|
27
|
-
HSP: number;
|
|
28
|
-
};
|
|
29
|
-
})[];
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const configuratorFields: ({
|
|
2
|
+
label: string;
|
|
3
|
+
fieldType: string;
|
|
4
|
+
varName: string[];
|
|
5
|
+
checked: number;
|
|
6
|
+
unchecked: number;
|
|
7
|
+
min?: undefined;
|
|
8
|
+
max?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
label: string;
|
|
11
|
+
fieldType: string;
|
|
12
|
+
varName: string[];
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
checked?: undefined;
|
|
16
|
+
unchecked?: undefined;
|
|
17
|
+
})[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance Monitor - Captures performance data for analysis
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* 1. Add <PerformanceMonitor /> inside your Canvas
|
|
6
|
+
* 2. Interact with your app
|
|
7
|
+
* 3. Press 'P' to print report to console
|
|
8
|
+
* 4. Copy the JSON output and share for analysis
|
|
9
|
+
*/
|
|
10
|
+
interface FrameData {
|
|
11
|
+
timestamp: number;
|
|
12
|
+
fps: number;
|
|
13
|
+
delta: number;
|
|
14
|
+
drawCalls: number;
|
|
15
|
+
triangles: number;
|
|
16
|
+
geometries: number;
|
|
17
|
+
textures: number;
|
|
18
|
+
}
|
|
19
|
+
interface PerformanceReport {
|
|
20
|
+
summary: {
|
|
21
|
+
totalFrames: number;
|
|
22
|
+
avgFps: number;
|
|
23
|
+
minFps: number;
|
|
24
|
+
maxFps: number;
|
|
25
|
+
avgDrawCalls: number;
|
|
26
|
+
maxDrawCalls: number;
|
|
27
|
+
avgTriangles: number;
|
|
28
|
+
maxTriangles: number;
|
|
29
|
+
maxGeometries: number;
|
|
30
|
+
maxTextures: number;
|
|
31
|
+
slowFrames: number;
|
|
32
|
+
recordingDuration: string;
|
|
33
|
+
};
|
|
34
|
+
slowestFrames: FrameData[];
|
|
35
|
+
componentRenders: Record<string, {
|
|
36
|
+
count: number;
|
|
37
|
+
totalTime: number;
|
|
38
|
+
avgTime: number;
|
|
39
|
+
}>;
|
|
40
|
+
warnings: string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Call this at the start of any component you want to track
|
|
44
|
+
*/
|
|
45
|
+
export declare function trackRenderStart(componentName: string): () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Hook version for functional components
|
|
48
|
+
*/
|
|
49
|
+
export declare function useTrackRender(componentName: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Generate performance report
|
|
52
|
+
*/
|
|
53
|
+
declare function generateReport(): PerformanceReport;
|
|
54
|
+
/**
|
|
55
|
+
* Print report to console in a format that can be copied
|
|
56
|
+
*/
|
|
57
|
+
declare function printReport(): PerformanceReport;
|
|
58
|
+
/**
|
|
59
|
+
* Reset all tracking data
|
|
60
|
+
*/
|
|
61
|
+
declare function resetTracking(): void;
|
|
62
|
+
interface PerformanceMonitorProps {
|
|
63
|
+
/** Auto-start recording (default: true) */
|
|
64
|
+
autoStart?: boolean;
|
|
65
|
+
/** Show on-screen stats (default: true) */
|
|
66
|
+
showStats?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Performance Monitor Component
|
|
70
|
+
* Add inside your <Canvas> component
|
|
71
|
+
*
|
|
72
|
+
* Controls:
|
|
73
|
+
* - Press 'P' to print report
|
|
74
|
+
* - Press 'R' to reset tracking
|
|
75
|
+
*/
|
|
76
|
+
export declare function PerformanceMonitor({ autoStart, showStats }: PerformanceMonitorProps): null;
|
|
77
|
+
export { printReport, resetTracking, generateReport };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
interface RenderEvent {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
componentName: string;
|
|
5
|
+
renderNumber: number;
|
|
6
|
+
duration: number;
|
|
7
|
+
reason: string;
|
|
8
|
+
changedProps: string[];
|
|
9
|
+
changedHooks: number[];
|
|
10
|
+
}
|
|
11
|
+
interface ComponentStats {
|
|
12
|
+
renderCount: number;
|
|
13
|
+
totalTime: number;
|
|
14
|
+
avgTime: number;
|
|
15
|
+
lastReason: string;
|
|
16
|
+
lastChangedProps: string[];
|
|
17
|
+
renders: {
|
|
18
|
+
time: number;
|
|
19
|
+
reason: string;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
interface RerenderReport {
|
|
23
|
+
totalRenders: number;
|
|
24
|
+
recordingTime: string;
|
|
25
|
+
components: Record<string, ComponentStats>;
|
|
26
|
+
timeline: RenderEvent[];
|
|
27
|
+
hotspots: {
|
|
28
|
+
name: string;
|
|
29
|
+
count: number;
|
|
30
|
+
avgTime: number;
|
|
31
|
+
}[];
|
|
32
|
+
warnings: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hook to track re-renders inside a component
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* function MyComponent({ width, height }) {
|
|
39
|
+
* useTrackRenders('MyComponent', { width, height });
|
|
40
|
+
* // ...
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
export declare function useTrackRenders(componentName: string, props?: Record<string, unknown>, dependencies?: unknown[]): number;
|
|
44
|
+
/**
|
|
45
|
+
* Higher-order component to track re-renders
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* const TrackedZone = track(Zone, 'Zone');
|
|
49
|
+
* // or
|
|
50
|
+
* export default track(Front, 'Front');
|
|
51
|
+
*/
|
|
52
|
+
export declare function track<P extends object>(Component: ComponentType<P>, componentName: string): ComponentType<P>;
|
|
53
|
+
/**
|
|
54
|
+
* Generate a comprehensive re-render report
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateRerenderReport(): RerenderReport;
|
|
57
|
+
/**
|
|
58
|
+
* Print re-render report to console
|
|
59
|
+
*/
|
|
60
|
+
export declare function printRerenderReport(): RerenderReport;
|
|
61
|
+
/**
|
|
62
|
+
* Reset all tracking data
|
|
63
|
+
*/
|
|
64
|
+
export declare function resetRerenderTracking(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Start/stop tracking
|
|
67
|
+
*/
|
|
68
|
+
export declare function setTracking(enabled: boolean): void;
|
|
69
|
+
interface RerenderMonitorProps {
|
|
70
|
+
/** Position of the panel */
|
|
71
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
72
|
+
/** Show live updates */
|
|
73
|
+
showLive?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* On-screen re-render monitor panel
|
|
77
|
+
*
|
|
78
|
+
* Add anywhere in your React tree (outside Canvas).
|
|
79
|
+
*
|
|
80
|
+
* Controls:
|
|
81
|
+
* - Press 'L' to print log
|
|
82
|
+
* - Press 'K' to reset
|
|
83
|
+
*/
|
|
84
|
+
export declare function RerenderMonitor({ position, showLive }: RerenderMonitorProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Utilities
|
|
3
|
+
*
|
|
4
|
+
* Performance monitoring tools for development.
|
|
5
|
+
* Remove or disable in production.
|
|
6
|
+
*/
|
|
7
|
+
export { PerformanceMonitor, useTrackRender, trackRenderStart, printReport, resetTracking, generateReport } from './PerformanceMonitor';
|
|
8
|
+
export { withRenderTracking, useRenderTracker, getRenderTrackerData, resetRenderTracker, printRenderReport } from './trackComponent';
|
|
9
|
+
export { RerenderMonitor, useTrackRenders, track, printRerenderReport, resetRerenderTracking, generateRerenderReport, setTracking } from './RerenderTracker';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
interface RenderData {
|
|
3
|
+
count: number;
|
|
4
|
+
totalTime: number;
|
|
5
|
+
lastRenderTime: number;
|
|
6
|
+
propChanges: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get current tracking data (for reporting)
|
|
10
|
+
*/
|
|
11
|
+
export declare function getRenderTrackerData(): Record<string, RenderData>;
|
|
12
|
+
/**
|
|
13
|
+
* Reset tracking data
|
|
14
|
+
*/
|
|
15
|
+
export declare function resetRenderTracker(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Higher-order component that tracks renders
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* const TrackedZone = withRenderTracking(Zone, 'Zone');
|
|
21
|
+
* // or
|
|
22
|
+
* export default withRenderTracking(Front, 'Front');
|
|
23
|
+
*/
|
|
24
|
+
export declare function withRenderTracking<P extends object>(WrappedComponent: ComponentType<P>, componentName: string): ComponentType<P>;
|
|
25
|
+
/**
|
|
26
|
+
* Hook to track renders inside a component
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* function MyComponent(props) {
|
|
30
|
+
* useRenderTracker('MyComponent', props);
|
|
31
|
+
* // ...
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
export declare function useRenderTracker(componentName: string, props?: Record<string, unknown>): number;
|
|
35
|
+
/**
|
|
36
|
+
* Print render tracker report
|
|
37
|
+
*/
|
|
38
|
+
export declare function printRenderReport(): void;
|
|
39
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DescriptorEvaluationResult, DescriptorNode, DescriptorResponse } from '../types/descriptor.types';
|
|
2
2
|
import { DescriptorTypeValue } from '../types/descriptor-data.types';
|
|
3
|
-
import { VariableTree } from '../../variables/VariableResolver';
|
|
4
3
|
export declare class DescriptorEvaluator {
|
|
5
|
-
static evaluate<T extends DescriptorTypeValue>(descriptor: DescriptorResponse<T>, data: Record<string, unknown>,
|
|
6
|
-
static findAllNonDefaultMatches(descriptor: DescriptorResponse, data: Record<string, unknown>,
|
|
4
|
+
static evaluate<T extends DescriptorTypeValue>(descriptor: DescriptorResponse<T>, data: Record<string, unknown>, resolveVarRecursive: (str: string) => string): DescriptorEvaluationResult<T>;
|
|
5
|
+
static findAllNonDefaultMatches(descriptor: DescriptorResponse, data: Record<string, unknown>, resolveVarRecursive: (str: string) => string): DescriptorNode[];
|
|
7
6
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DescriptorEvaluationResult, DescriptorResponse } from '../types/descriptor.types';
|
|
2
2
|
import { DescriptorTypeValue } from '../types/descriptor-data.types';
|
|
3
|
-
import { VariableTree } from '../../variables/VariableResolver';
|
|
4
3
|
export declare class DescriptorManager {
|
|
5
4
|
private descriptors;
|
|
6
5
|
constructor(descriptors: DescriptorResponse[]);
|
|
7
|
-
evaluate<T extends DescriptorTypeValue = DescriptorTypeValue>(descriptorName: string, inputData: Record<string, unknown>,
|
|
6
|
+
evaluate<T extends DescriptorTypeValue = DescriptorTypeValue>(descriptorName: string, inputData: Record<string, unknown>, resolveVarRecursive: (str: string) => string): DescriptorEvaluationResult<T>;
|
|
8
7
|
getDescriptor(descriptorName: string): DescriptorResponse | undefined;
|
|
9
8
|
hasDescriptor(descriptorName: string): boolean;
|
|
10
9
|
getDescriptorNames(): string[];
|
|
11
10
|
getDescriptorsByType(descriptorType: DescriptorTypeValue): DescriptorResponse[];
|
|
12
|
-
findAllMatches(descriptorName: string, inputData: Record<string, unknown>,
|
|
11
|
+
findAllMatches(descriptorName: string, inputData: Record<string, unknown>, resolveVarRecursive: (str: string) => string): import('../types/descriptor.types').DescriptorNode<DescriptorTypeValue>[];
|
|
13
12
|
getStats(): {
|
|
14
13
|
total: number;
|
|
15
14
|
byType: Record<number, number>;
|
|
@@ -9,6 +9,9 @@ interface GroupWrapperProps {
|
|
|
9
9
|
onClick?: () => void;
|
|
10
10
|
onPointerOver?: (e: ThreeEvent<PointerEvent>) => void;
|
|
11
11
|
onPointerLeave?: (e: ThreeEvent<PointerEvent>) => void;
|
|
12
|
+
onPointerDown?: (e: ThreeEvent<PointerEvent>) => void;
|
|
13
|
+
onPointerMove?: (e: ThreeEvent<PointerEvent>) => void;
|
|
14
|
+
onPointerUp?: (e: ThreeEvent<PointerEvent>) => void;
|
|
12
15
|
}
|
|
13
16
|
declare const GroupWrapper: FC<GroupWrapperProps>;
|
|
14
17
|
export default GroupWrapper;
|
|
@@ -4,6 +4,5 @@ import { ElemPartType } from '../types/Elem.types';
|
|
|
4
4
|
import { PartTypeSource } from '../construction_principle/dto/angl-type-config';
|
|
5
5
|
import { CpDispatcherResult } from '../construction_principle/dto/cp-dispatcher.types';
|
|
6
6
|
import { DescriptorManager } from '../descriptor/services/DescriptorManager';
|
|
7
|
-
import { VariableTree } from '../variables/VariableResolver';
|
|
8
7
|
import { DrawerType } from '../construction_principle/drawer/dto/drawer.types';
|
|
9
|
-
export default function UseCpDispatcher(articleData: DataContextType, cpName: string, cpType: ElemPartType | DividerType | DrawerType, source: PartTypeSource,
|
|
8
|
+
export default function UseCpDispatcher(articleData: DataContextType, cpName: string, cpType: ElemPartType | DividerType | DrawerType, source: PartTypeSource, descriptorManager?: DescriptorManager, inputData?: Record<string, unknown>): CpDispatcherResult | undefined;
|
|
@@ -8,6 +8,6 @@ export interface UseZoneDescriptorOptions {
|
|
|
8
8
|
variableTree: VariableTree;
|
|
9
9
|
resolveVarRecursive: (str: string) => string;
|
|
10
10
|
}
|
|
11
|
-
export declare function ZoneDivider({ divider, inputData, descriptorManager,
|
|
11
|
+
export declare function ZoneDivider({ divider, inputData, descriptorManager, resolveVarRecursive }: UseZoneDescriptorOptions): {
|
|
12
12
|
updatedDivider: DividerMode;
|
|
13
13
|
};
|