@processandtools/rp-article-designer 1.0.14 → 1.0.16
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/README.md +0 -0
- package/dist/components/article_designer/ArticleDesigner.d.ts +10 -0
- package/dist/components/article_designer/Designer.d.ts +4 -0
- package/dist/components/article_designer/Zone.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Back.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Bottom.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Divider.d.ts +13 -0
- package/dist/components/article_designer/zoneElems/Front.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Left.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Right.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Top.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/sub_construction/LinearDividerRender.d.ts +13 -0
- package/dist/components/article_designer/zoneElems/sub_construction/SubArticleRender.d.ts +9 -0
- package/dist/components/elements_manager/PD_2D.d.ts +17 -0
- package/dist/components/elements_manager/PD_3D.d.ts +14 -0
- package/dist/components/ui/Canvas2D.d.ts +7 -0
- package/dist/components/ui/Canvas3D.d.ts +5 -0
- package/dist/components/ui/CanvasManager.d.ts +4 -0
- package/dist/components/ui/DimensionControl.d.ts +1 -0
- package/dist/components/ui/LoadingIndicator.d.ts +18 -0
- package/dist/components/ui/PerformanceMonitor.d.ts +1 -0
- package/dist/components/ui/UnifiedCanvas.d.ts +6 -0
- package/dist/components/ui/controls/VarController.d.ts +1 -0
- package/dist/components/ui/test/CustomShaderMaterial.d.ts +1 -0
- package/dist/components/ui/test/DataFieldsViewer.d.ts +8 -0
- package/dist/components/ui/test/ExtrudGeo.d.ts +1 -0
- package/dist/components/ui/test/GeneralTester.d.ts +1 -0
- package/dist/components/ui/test/MyParser.d.ts +1 -0
- package/dist/components/ui/test/PropertiesPanel.d.ts +1 -0
- package/dist/components/ui/test/TestDescriptorComparison.d.ts +6 -0
- package/dist/components/ui/test/TestDescriptorHooks.d.ts +6 -0
- package/dist/components/ui/test/TestDescriptorManager.d.ts +6 -0
- package/dist/components/ui/test/TestImageRender.d.ts +1 -0
- package/dist/components/ui/test/Test_KMS.d.ts +1 -0
- package/dist/components/ui/test/Test_MatSurfFetching.d.ts +1 -0
- package/dist/conditions/helpers/ComparisonMap.d.ts +2 -0
- package/dist/conditions/helpers/ConditionTreeEvaluator.d.ts +6 -0
- package/dist/conditions/helpers/KeyMap.d.ts +1 -0
- package/dist/conditions/types/condition.types.d.ts +39 -0
- package/dist/constants/Constants.d.ts +24 -0
- package/dist/constants/RalColors.d.ts +8 -0
- package/dist/construction_principle/cabin/CabinHelper.d.ts +52 -0
- package/dist/construction_principle/cabin/cabin.types.d.ts +4 -0
- package/dist/construction_principle/kms/KmsHelper.d.ts +50 -0
- package/dist/construction_principle/kms/KmsRenderSelector.d.ts +1 -0
- package/dist/construction_principle/kms/kms.types.d.ts +7 -0
- package/dist/construction_principle/material/MatHelper.d.ts +15 -0
- package/dist/construction_principle/material/material.types.d.ts +8 -0
- package/dist/construction_principle/render/RenderHelper.d.ts +7 -0
- package/dist/construction_principle/render/render.types.d.ts +4 -0
- package/dist/construction_principle/side_panel/CSideHelper.d.ts +52 -0
- package/dist/construction_principle/side_panel/cside.types.d.ts +4 -0
- package/dist/construction_principle/surface/SurfHelper.d.ts +15 -0
- package/dist/construction_principle/surface/surface.types.d.ts +8 -0
- package/dist/contexts/article/ArticleContext.d.ts +6 -0
- package/dist/contexts/article/ArticleProvider.d.ts +7 -0
- package/dist/contexts/article-data/DataContext.d.ts +2 -0
- package/dist/contexts/article-data/DataProvider.d.ts +2 -0
- package/dist/contexts/descriptor/DescriptorContext.d.ts +2 -0
- package/dist/contexts/descriptor/DescriptorProvider.d.ts +7 -0
- package/dist/contexts/mat-surf/MatSurfContext.d.ts +25 -0
- package/dist/contexts/mat-surf/MatSurfProvider.d.ts +9 -0
- package/dist/contexts/texture/TextureConfig.d.ts +15 -0
- package/dist/descriptor/Descriptor.d.ts +1 -0
- package/dist/descriptor/helper/DescriptorEvaluator.d.ts +7 -0
- package/dist/descriptor/helper/descriptor-type-guards.d.ts +6 -0
- package/dist/descriptor/services/DescriptorManager.d.ts +22 -0
- package/dist/descriptor/types/descriptor-data.types.d.ts +15 -0
- package/dist/descriptor/types/descriptor.types.d.ts +31 -0
- package/dist/helpers/CheckUrlExists.d.ts +1 -0
- package/dist/helpers/CpDispatcher.d.ts +53 -0
- package/dist/helpers/ExpressionResolver.d.ts +43 -0
- package/dist/helpers/GroupWrapper.d.ts +10 -0
- package/dist/helpers/LinDivHelper.d.ts +3 -0
- package/dist/helpers/LinDivPatternTransform.d.ts +2 -0
- package/dist/helpers/LindivResolver.d.ts +58 -0
- package/dist/helpers/MitreCalc.d.ts +11 -0
- package/dist/helpers/PositionHelper.d.ts +10 -0
- package/dist/helpers/VariableHelper.d.ts +2 -0
- package/dist/helpers/WallTransform.d.ts +6 -0
- package/dist/helpers/WallTransformGeo.d.ts +6 -0
- package/dist/helpers/ZoneCalculations.d.ts +425 -0
- package/dist/helpers/angls/UseClieHelper.d.ts +3 -0
- package/dist/helpers/angls/UseElemHelper.d.ts +79 -0
- package/dist/helpers/angls/UseGrtxHelper.d.ts +3 -0
- package/dist/helpers/angls/UsePrimHelper.d.ts +8 -0
- package/dist/helpers/angls/UseZoneHelper.d.ts +119 -0
- package/dist/hooks/useAPI.d.ts +5 -0
- package/dist/hooks/useArticle.d.ts +1 -0
- package/dist/hooks/useData.d.ts +1 -0
- package/dist/hooks/useDescriptor.d.ts +31 -0
- package/dist/hooks/useDescriptorManager.d.ts +2 -0
- package/dist/hooks/useMaterialLoader.d.ts +8 -0
- package/dist/hooks/useZoneSelection.d.ts +12 -0
- package/dist/hooks/zoneDescriptor.d.ts +92 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1 -0
- package/dist/rp-article-designer.css +1 -0
- package/dist/services/ApiFactory.d.ts +20 -0
- package/dist/services/GenericApi.d.ts +25 -0
- package/dist/types/Elem.types.d.ts +10 -0
- package/dist/types/canvas.types.d.ts +7 -0
- package/dist/types/cp.types.d.ts +13 -0
- package/dist/types/data.types.d.ts +126 -0
- package/dist/types/divider.types.d.ts +81 -0
- package/dist/types/geometry.types.d.ts +19 -0
- package/dist/types/helper.types.d.ts +4 -0
- package/dist/types/pd.types.d.ts +7 -0
- package/dist/types/primitives.types.d.ts +18 -0
- package/dist/types/shape.types.d.ts +35 -0
- package/dist/types/view.types.d.ts +5 -0
- package/dist/types/wall.types.d.ts +8 -0
- package/dist/types/zone.types.d.ts +40 -0
- package/dist/variables/TestVariable.d.ts +1 -0
- package/dist/variables/TestVariableProvider.d.ts +1 -0
- package/dist/variables/VariableContext.d.ts +2 -0
- package/dist/variables/VariableProvider.d.ts +13 -0
- package/dist/variables/VariableResolver.d.ts +27 -0
- package/dist/variables/useVariables.d.ts +11 -0
- package/dist/variables/variable.types.d.ts +24 -0
- package/dist/vite.svg +0 -0
- package/package.json +10 -9
- package/dist/assets/index-DB7goBO_.js +0 -1
- package/dist/assets/index-DQ3P1g1z.css +0 -1
- package/dist/index.html +0 -14
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum CPTypeCode {
|
|
2
|
+
SidePanel = "S",
|
|
3
|
+
Door = "D",
|
|
4
|
+
Back = "B",
|
|
5
|
+
Shelf = "H"
|
|
6
|
+
}
|
|
7
|
+
export declare enum CPTypeName {
|
|
8
|
+
SidePanel = "side_panel",
|
|
9
|
+
Door = "door",
|
|
10
|
+
Back = "back",
|
|
11
|
+
Shelf = "shelf"
|
|
12
|
+
}
|
|
13
|
+
export declare const CP_TYPE_MAP: Record<CPTypeCode, CPTypeName>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DescriptorResponse } from '../descriptor/types/descriptor.types';
|
|
3
|
+
import { ImosVariable } from '../variables/variable.types';
|
|
4
|
+
import { CsideTypes } from '../construction_principle/side_panel/cside.types';
|
|
5
|
+
import { KmsTypes } from '../construction_principle/kms/kms.types';
|
|
6
|
+
import { MaterialTypes } from '../construction_principle/material/material.types';
|
|
7
|
+
import { SurfaceTypes } from '../construction_principle/surface/surface.types';
|
|
8
|
+
import { CabinTypes } from '../construction_principle/cabin/cabin.types';
|
|
9
|
+
import { CPTypeCode } from './cp.types';
|
|
10
|
+
export interface AngleElem {
|
|
11
|
+
NAME: string;
|
|
12
|
+
TREEID: string;
|
|
13
|
+
PARTTYPE: CPTypeCode;
|
|
14
|
+
CPNAME: string;
|
|
15
|
+
STARTTRIM: string;
|
|
16
|
+
ENDTRIM: string;
|
|
17
|
+
TOPTRIM: string;
|
|
18
|
+
BOTTRIM: string;
|
|
19
|
+
MANINFO: string;
|
|
20
|
+
STARTOFFS: number;
|
|
21
|
+
ENDOFFS: number;
|
|
22
|
+
TOPOFFS: number;
|
|
23
|
+
BOTOFFS: number;
|
|
24
|
+
INSETFOR: string;
|
|
25
|
+
INSET: number;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface AnglZone {
|
|
29
|
+
NAME: string;
|
|
30
|
+
TREEID: string;
|
|
31
|
+
DIVDIR: 'A' | 'D' | 'H' | 'I' | 'V';
|
|
32
|
+
LINDIV1: string;
|
|
33
|
+
LINDIV2: string;
|
|
34
|
+
DIVELEM1: number;
|
|
35
|
+
TOPSHELF: string;
|
|
36
|
+
BOTSHELF: string;
|
|
37
|
+
DIVIDER: string;
|
|
38
|
+
DIVTYPE: 'A' | 'B' | 'C' | 'D' | 'F' | 'P' | 'S' | 'T' | 'V';
|
|
39
|
+
HORDEFTYPE: '2' | 'A' | 'D' | 'P' | 'W';
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface AnglPrim {
|
|
43
|
+
NAME: string;
|
|
44
|
+
CONTOUR: string;
|
|
45
|
+
SIZEX: number;
|
|
46
|
+
SIZEY: number;
|
|
47
|
+
SIZEZ: number;
|
|
48
|
+
DIMCALCFX: string;
|
|
49
|
+
DIMCALCFY: string;
|
|
50
|
+
DIMCALCFZ: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface AnglClie {
|
|
54
|
+
NAME: string;
|
|
55
|
+
TREEID: string;
|
|
56
|
+
TAGNAME: string;
|
|
57
|
+
TAGVALUE: string;
|
|
58
|
+
DATATYPE: number;
|
|
59
|
+
INORDER: string;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface AnglGrtx {
|
|
63
|
+
NAME: string;
|
|
64
|
+
TREEID: string;
|
|
65
|
+
NUM: number;
|
|
66
|
+
TEXT: string;
|
|
67
|
+
}
|
|
68
|
+
export interface DataContextType {
|
|
69
|
+
anglElems: AngleElem[];
|
|
70
|
+
anglZones: AnglZone[];
|
|
71
|
+
anglPrims: AnglPrim[];
|
|
72
|
+
anglClies: AnglClie[];
|
|
73
|
+
anglGrtxs: AnglGrtx[];
|
|
74
|
+
csides: CsideTypes[];
|
|
75
|
+
kmsList: KmsTypes[];
|
|
76
|
+
cabins: CabinTypes[];
|
|
77
|
+
variables: ImosVariable[];
|
|
78
|
+
selectedElem: string | null;
|
|
79
|
+
setSelectedElem: (elemId: string | null) => void;
|
|
80
|
+
hoveredElem: string | null;
|
|
81
|
+
setHoveredElem: (elemId: string | null) => void;
|
|
82
|
+
updateAnglPrim: (articleName: string, property: keyof AnglPrim, newValue: unknown) => void;
|
|
83
|
+
updateAnglElem: (articleName: string, treeid: string, property: keyof AngleElem, newValue: unknown) => void;
|
|
84
|
+
updateAnglZone: (articleName: string, treeid: string, property: keyof AnglZone, newValue: unknown) => void;
|
|
85
|
+
updateAnglClie: (articleName: string, treeid: string, tagname: string, newValue: string, datatype: number) => void;
|
|
86
|
+
updateVariable: (name: string, newValue: string) => void;
|
|
87
|
+
getArticleData: (articleName: string) => {
|
|
88
|
+
anglElems: AngleElem[];
|
|
89
|
+
anglZones: AnglZone[];
|
|
90
|
+
anglPrims: AnglPrim[];
|
|
91
|
+
anglClies: AnglClie[];
|
|
92
|
+
anglGrtxs: AnglGrtx[];
|
|
93
|
+
csides: CsideTypes[];
|
|
94
|
+
cabins: CabinTypes[];
|
|
95
|
+
variables: ImosVariable[];
|
|
96
|
+
};
|
|
97
|
+
allData: {
|
|
98
|
+
anglelem: AngleElem[];
|
|
99
|
+
anglzone: AnglZone[];
|
|
100
|
+
anglprim: AnglPrim[];
|
|
101
|
+
anglclie: AnglClie[];
|
|
102
|
+
anglgrtx: AnglGrtx[];
|
|
103
|
+
cside: CsideTypes[];
|
|
104
|
+
kms: KmsTypes[];
|
|
105
|
+
cabin: CabinTypes[];
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export interface ArticleData {
|
|
109
|
+
anglzone: AnglZone[];
|
|
110
|
+
anglelem: AngleElem[];
|
|
111
|
+
anglprim: AnglPrim[];
|
|
112
|
+
anglclie: AnglClie[];
|
|
113
|
+
anglgrtx: AnglGrtx[];
|
|
114
|
+
descriptors: DescriptorResponse[];
|
|
115
|
+
variables: ImosVariable[];
|
|
116
|
+
cside?: CsideTypes[];
|
|
117
|
+
kms?: KmsTypes[];
|
|
118
|
+
cabin?: CabinTypes[];
|
|
119
|
+
materials?: MaterialTypes[];
|
|
120
|
+
surfaces?: SurfaceTypes[];
|
|
121
|
+
}
|
|
122
|
+
export interface DataProviderProps {
|
|
123
|
+
data: ArticleData;
|
|
124
|
+
children: ReactNode;
|
|
125
|
+
names?: string[];
|
|
126
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AnglZone } from './data.types';
|
|
2
|
+
import { DimensionProps } from './zone.types';
|
|
3
|
+
export type DivisionDirection = 'A' | 'D' | 'H' | 'I' | 'V';
|
|
4
|
+
export type HorizontalDefType = '2' | 'A' | 'D' | 'P' | 'W';
|
|
5
|
+
export type DividerType = 'A' | 'B' | 'C' | 'D' | 'F' | 'P' | 'S' | 'T' | 'V';
|
|
6
|
+
type DividerProps = Pick<AnglZone, 'TREEID' | 'DIVDIR' | 'DIVTYPE' | 'HORDEFTYPE' | 'LINDIV1' | 'DIVELEM1' | 'DIVIDER'>;
|
|
7
|
+
export declare const DividerTypeConst: {
|
|
8
|
+
readonly LINEAR_DIVISION: "linear-division";
|
|
9
|
+
readonly ARTICLE: "article";
|
|
10
|
+
};
|
|
11
|
+
export declare const ValueSourceConst: {
|
|
12
|
+
readonly STRING: "string";
|
|
13
|
+
readonly DESCRIPTOR: "descriptor";
|
|
14
|
+
};
|
|
15
|
+
interface BaseDivider {
|
|
16
|
+
TREEID: string;
|
|
17
|
+
DIVDIR: DivisionDirection;
|
|
18
|
+
DIVTYPE: DividerType;
|
|
19
|
+
HORDEFTYPE: HorizontalDefType;
|
|
20
|
+
LINDIV1: string;
|
|
21
|
+
DIVELEM1: number;
|
|
22
|
+
}
|
|
23
|
+
export interface LinearDivisionString extends BaseDivider {
|
|
24
|
+
type: typeof DividerTypeConst.LINEAR_DIVISION;
|
|
25
|
+
valueSource: typeof ValueSourceConst.STRING;
|
|
26
|
+
DIVIDER: '';
|
|
27
|
+
formula: string;
|
|
28
|
+
thickness: number;
|
|
29
|
+
}
|
|
30
|
+
export interface LinearDivisionDescriptor extends BaseDivider {
|
|
31
|
+
type: typeof DividerTypeConst.LINEAR_DIVISION;
|
|
32
|
+
valueSource: typeof ValueSourceConst.DESCRIPTOR;
|
|
33
|
+
DIVIDER: '';
|
|
34
|
+
descriptorName: string;
|
|
35
|
+
thickness: number;
|
|
36
|
+
}
|
|
37
|
+
export type LinearDivisionMode = LinearDivisionString | LinearDivisionDescriptor;
|
|
38
|
+
export interface ArticleString extends BaseDivider {
|
|
39
|
+
type: typeof DividerTypeConst.ARTICLE;
|
|
40
|
+
valueSource: typeof ValueSourceConst.STRING;
|
|
41
|
+
DIVIDER: string;
|
|
42
|
+
articleName: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ArticleDescriptor extends BaseDivider {
|
|
45
|
+
type: typeof DividerTypeConst.ARTICLE;
|
|
46
|
+
valueSource: typeof ValueSourceConst.DESCRIPTOR;
|
|
47
|
+
DIVIDER: string;
|
|
48
|
+
descriptorName: string;
|
|
49
|
+
}
|
|
50
|
+
export type ArticleMode = ArticleString | ArticleDescriptor;
|
|
51
|
+
export type DividerMode = LinearDivisionMode | ArticleMode;
|
|
52
|
+
export declare const isDivider: {
|
|
53
|
+
linearDivision: (divider: DividerMode) => divider is LinearDivisionMode;
|
|
54
|
+
article: (divider: DividerMode) => divider is ArticleMode;
|
|
55
|
+
};
|
|
56
|
+
export declare const isLinearDivision: {
|
|
57
|
+
string: (divider: DividerMode) => divider is LinearDivisionString;
|
|
58
|
+
descriptor: (divider: DividerMode) => divider is LinearDivisionDescriptor;
|
|
59
|
+
};
|
|
60
|
+
export declare const isArticle: {
|
|
61
|
+
string: (divider: DividerMode) => divider is ArticleString;
|
|
62
|
+
descriptor: (divider: DividerMode) => divider is ArticleDescriptor;
|
|
63
|
+
};
|
|
64
|
+
export declare const createDivider: {
|
|
65
|
+
linearDivisionString(TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, formula: string, thickness: number): LinearDivisionString;
|
|
66
|
+
linearDivisionDescriptor(TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, descriptorName: string, thickness: number): LinearDivisionDescriptor;
|
|
67
|
+
articleString(TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, articleName: string): ArticleString;
|
|
68
|
+
articleDescriptor(TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, descriptorName: string): ArticleDescriptor;
|
|
69
|
+
fromZoneData(divProps: DividerProps, thickness: number): DividerMode;
|
|
70
|
+
};
|
|
71
|
+
export declare function getArticleName(divider: DividerMode): string | undefined;
|
|
72
|
+
export declare function getArticleDescriptorName(divider: DividerMode): string | undefined;
|
|
73
|
+
export declare function getFormula(divider: DividerMode): string | undefined;
|
|
74
|
+
export declare function getLinearDescriptorName(divider: DividerMode): string | undefined;
|
|
75
|
+
export declare function needsDescriptorEvaluation(divider: DividerMode): boolean;
|
|
76
|
+
export declare function getDescriptorName(divider: DividerMode): string | undefined;
|
|
77
|
+
export declare function getDividedAxis(divider?: DividerMode): 'width' | 'depth' | 'height';
|
|
78
|
+
export declare function getDividedLength(axis: 'width' | 'depth' | 'height', dimensions?: DimensionProps): number;
|
|
79
|
+
export declare function isHorizontalDivision(divider: DividerMode): boolean;
|
|
80
|
+
export declare function isVerticalDivision(divider: DividerMode): boolean;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dimensions } from './primitives.types';
|
|
2
|
+
export interface Geometry {
|
|
3
|
+
type: 'line' | 'box' | 'cylinder' | 'custom';
|
|
4
|
+
dimensions?: Dimensions;
|
|
5
|
+
metadata?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface LineGeometry extends Geometry {
|
|
8
|
+
type: 'line';
|
|
9
|
+
dimensions: Required<Pick<Dimensions, 'height' | 'thickness'>> & Pick<Dimensions, 'width'>;
|
|
10
|
+
}
|
|
11
|
+
export interface BoxGeometry extends Geometry {
|
|
12
|
+
type: 'box';
|
|
13
|
+
dimensions: Required<Pick<Dimensions, 'width' | 'height' | 'depth'>>;
|
|
14
|
+
}
|
|
15
|
+
export interface CylinderGeometry extends Geometry {
|
|
16
|
+
type: 'cylinder';
|
|
17
|
+
dimensions: Required<Pick<Dimensions, 'radius' | 'height'>>;
|
|
18
|
+
}
|
|
19
|
+
export type GeometryTypes = LineGeometry | BoxGeometry | CylinderGeometry;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface Point {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Dimensions {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
depth?: number;
|
|
10
|
+
radius?: number;
|
|
11
|
+
length?: number;
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Rotation {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
z: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BoxGeometry, CylinderGeometry, Geometry, LineGeometry } from './geometry.types';
|
|
2
|
+
import { Point, Rotation } from './primitives.types';
|
|
3
|
+
export interface Shape {
|
|
4
|
+
shapeType: string;
|
|
5
|
+
geometry: Geometry;
|
|
6
|
+
position?: Point;
|
|
7
|
+
rotation?: Rotation;
|
|
8
|
+
metadata?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface WallShape extends Shape {
|
|
11
|
+
shapeType: 'wall';
|
|
12
|
+
geometry: LineGeometry;
|
|
13
|
+
startPoint: Point;
|
|
14
|
+
endPoint: Point;
|
|
15
|
+
}
|
|
16
|
+
export interface CabinetShape extends Shape {
|
|
17
|
+
shapeType: 'cabinet';
|
|
18
|
+
geometry: BoxGeometry;
|
|
19
|
+
position: Point;
|
|
20
|
+
rotation?: Rotation;
|
|
21
|
+
style?: string;
|
|
22
|
+
material?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DoorShape extends Shape {
|
|
25
|
+
shapeType: 'door';
|
|
26
|
+
geometry: BoxGeometry;
|
|
27
|
+
position: Point;
|
|
28
|
+
openingDirection: 'left' | 'right' | 'inward' | 'outward';
|
|
29
|
+
}
|
|
30
|
+
export interface ColumnShape extends Shape {
|
|
31
|
+
shapeType: 'column';
|
|
32
|
+
geometry: CylinderGeometry;
|
|
33
|
+
position: Point;
|
|
34
|
+
}
|
|
35
|
+
export type ShapeTypes = WallShape | CabinetShape | DoorShape | ColumnShape;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { VIEW } from './view.types';
|
|
2
|
+
export interface ZoneProps {
|
|
3
|
+
view?: VIEW;
|
|
4
|
+
TREEID: string;
|
|
5
|
+
dimension: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
depth: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface DimensionProps {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
depth: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PositionedChild {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
z: number;
|
|
20
|
+
zone_dims: DimensionProps;
|
|
21
|
+
TREEID: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DividerPosition {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
z: number;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
depth: number;
|
|
30
|
+
}
|
|
31
|
+
export interface PositionHelperResult {
|
|
32
|
+
childPositions: PositionedChild[];
|
|
33
|
+
dividerType: 'width' | 'depth' | 'height' | 'article' | 'independent';
|
|
34
|
+
}
|
|
35
|
+
export interface ChildrenDimsResult {
|
|
36
|
+
isReversed?: boolean;
|
|
37
|
+
divisionType: 'width' | 'depth' | 'height' | 'article' | 'independent';
|
|
38
|
+
zone_dimensions: DimensionProps[];
|
|
39
|
+
divided_length_list: number[];
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TestVariable(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TestVariableProvider(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VariableTree } from './VariableResolver';
|
|
3
|
+
import { ImosVariable } from './variable.types';
|
|
4
|
+
export interface VariableProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
imosVariables: ImosVariable[];
|
|
7
|
+
articleValues?: Record<string, string | number>;
|
|
8
|
+
}
|
|
9
|
+
export interface VariableContextValue {
|
|
10
|
+
tree: VariableTree;
|
|
11
|
+
setVarValue: (name: string, value: string | number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function VariableProvider({ children, imosVariables, articleValues }: VariableProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ImosVariable } from './variable.types';
|
|
2
|
+
export type VariableTree = Map<string, ImosVariable>;
|
|
3
|
+
/**
|
|
4
|
+
* Create variable tree - just convert array to Map
|
|
5
|
+
*/
|
|
6
|
+
export declare function createVariableTree(imosVariables: ImosVariable[]): VariableTree;
|
|
7
|
+
/**
|
|
8
|
+
* Get the final value by following $VAR references
|
|
9
|
+
* V1 ($V2) -> V2 ($V3) -> V3 ($V4) -> V4 (400) = 400
|
|
10
|
+
*/
|
|
11
|
+
export declare function getValue(varName: string, tree: VariableTree, visited?: Set<string>): string | number | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Set a variable's value (immutable update)
|
|
14
|
+
*/
|
|
15
|
+
export declare function setValue(varName: string, newValue: string | number, tree: VariableTree): VariableTree;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve variables in a string (e.g., "1:$VAR_M1 mm" → "1:300 mm")
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveString(str: string, tree: VariableTree): string;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a string contains variable references
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasVariables(str: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Extract all variable names from a string
|
|
26
|
+
*/
|
|
27
|
+
export declare function extractVariableNames(str: string): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access variables
|
|
3
|
+
* Provides utilities to work with the variable tree
|
|
4
|
+
*/
|
|
5
|
+
export declare function useVariables(): {
|
|
6
|
+
tree: import('./VariableResolver.ts').VariableTree;
|
|
7
|
+
getValue: (name: string) => string | number | undefined;
|
|
8
|
+
resolveString: (str: string) => string;
|
|
9
|
+
hasVariables: (str: string) => boolean;
|
|
10
|
+
setVarValue: (name: string, value: string | number) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum VAR_TYPE {
|
|
2
|
+
None = 0,
|
|
3
|
+
Profile = 2,
|
|
4
|
+
Surface = 3,
|
|
5
|
+
Material = 4,
|
|
6
|
+
Kms = 5,
|
|
7
|
+
Numeric = 100,
|
|
8
|
+
Text = 120,
|
|
9
|
+
color = 29
|
|
10
|
+
}
|
|
11
|
+
export interface ImosVariable {
|
|
12
|
+
NAME: string;
|
|
13
|
+
TYP: number;
|
|
14
|
+
WERT: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function isVariableReference(value: string): boolean;
|
|
17
|
+
export declare function extractVariableName(reference: string): string;
|
|
18
|
+
export interface VariableContextType {
|
|
19
|
+
getValue: (name: string) => string | number | undefined;
|
|
20
|
+
setValue: (name: string, value: string | number) => void;
|
|
21
|
+
resolveString: (str: string) => string;
|
|
22
|
+
hasVariables: (str: string) => boolean;
|
|
23
|
+
getTree: () => Map<string, ImosVariable>;
|
|
24
|
+
}
|
package/dist/vite.svg
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@processandtools/rp-article-designer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"author": "Otman Abid Lmerabetine",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -53,17 +53,16 @@
|
|
|
53
53
|
"three": ">=0.150.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@react-three/drei": "
|
|
57
|
-
"@react-three/fiber": "
|
|
56
|
+
"@react-three/drei": ">=6.0.0",
|
|
57
|
+
"@react-three/fiber": ">=6.0.0",
|
|
58
58
|
"imos-linear-division": "^0.1.3",
|
|
59
|
-
"leva": "
|
|
60
|
-
"react": "
|
|
61
|
-
"react-dom": "
|
|
59
|
+
"leva": ">=0.10.0",
|
|
60
|
+
"react": ">=16.0.0",
|
|
61
|
+
"react-dom": ">=16.0.0",
|
|
62
62
|
"react-use": "^17.6.0",
|
|
63
|
-
"three": "
|
|
63
|
+
"three": ">=0.150.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"javascript-obfuscator": "^5.1.0",
|
|
67
66
|
"@eslint/js": "^9.39.1",
|
|
68
67
|
"@types/node": "^24.10.1",
|
|
69
68
|
"@types/react": "^19.2.5",
|
|
@@ -73,8 +72,10 @@
|
|
|
73
72
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
74
73
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
75
74
|
"globals": "^16.5.0",
|
|
75
|
+
"javascript-obfuscator": "^5.1.0",
|
|
76
76
|
"typescript": "~5.9.3",
|
|
77
77
|
"typescript-eslint": "^8.46.4",
|
|
78
|
-
"vite": "^7.2.4"
|
|
78
|
+
"vite": "^7.2.4",
|
|
79
|
+
"vite-plugin-dts": "^4.5.4"
|
|
79
80
|
}
|
|
80
81
|
}
|