@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.
Files changed (60) hide show
  1. package/dist/components/article_designer/VariableBridge.d.ts +4 -0
  2. package/dist/components/article_designer/Zone.d.ts +2 -1
  3. package/dist/components/article_designer/zoneElems/Back.d.ts +2 -1
  4. package/dist/components/article_designer/zoneElems/Bottom.d.ts +3 -2
  5. package/dist/components/article_designer/zoneElems/Divider.d.ts +2 -2
  6. package/dist/components/article_designer/zoneElems/Left.d.ts +2 -1
  7. package/dist/components/article_designer/zoneElems/Right.d.ts +2 -1
  8. package/dist/components/article_designer/zoneElems/Top.d.ts +3 -2
  9. package/dist/components/article_designer/zoneElems/{DrawerItem.d.ts → sub_construction/DrawerItem.d.ts} +3 -3
  10. package/dist/components/article_designer/zoneElems/sub_construction/LinearDividerRender.d.ts +1 -1
  11. package/dist/components/elements_manager/PD_3D.d.ts +2 -2
  12. package/dist/components/ui/Canvas3D.d.ts +1 -1
  13. package/dist/components/ui/CanvasManager.d.ts +1 -1
  14. package/dist/components/ui/VariablePanel.d.ts +5 -0
  15. package/dist/components/ui/VisibilityPanel.d.ts +1 -0
  16. package/dist/components/ui/controls/Configurator.d.ts +7 -0
  17. package/dist/components/ui/controls/VariablePanel.d.ts +2 -5
  18. package/dist/components/ui/controls/configurator-components/MCombo.d.ts +7 -0
  19. package/dist/components/ui/controls/configurator-components/MSlider.d.ts +8 -0
  20. package/dist/components/ui/controls/configurator-components/MSwitch.d.ts +8 -0
  21. package/dist/conditions/helpers/ConditionTreeEvaluator.d.ts +2 -3
  22. package/dist/contexts/article-hover/ArticleHoverContext.d.ts +1 -0
  23. package/dist/contexts/descriptor/useDescriptor.d.ts +2 -3
  24. package/dist/data/articles.d.ts +2 -22
  25. package/dist/data/configurator-data/configuratorFields.d.ts +17 -0
  26. package/dist/data/configurator-data/options.d.ts +2 -0
  27. package/dist/debug/PerformanceMonitor.d.ts +77 -0
  28. package/dist/debug/RerenderTracker.d.ts +85 -0
  29. package/dist/debug/index.d.ts +9 -0
  30. package/dist/debug/trackComponent.d.ts +39 -0
  31. package/dist/descriptor/helper/DescriptorEvaluator.d.ts +2 -3
  32. package/dist/descriptor/services/DescriptorManager.d.ts +3 -4
  33. package/dist/helpers/GroupWrapper.d.ts +3 -0
  34. package/dist/helpers/useCpDispatcher.d.ts +1 -2
  35. package/dist/hooks/zoneDivider.d.ts +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/stores/variableStore.d.ts +30 -0
  41. package/dist/stores/visibilityStore.d.ts +23 -0
  42. package/dist/types/canvas.types.d.ts +1 -0
  43. package/dist/types/configurator.types.d.ts +10 -0
  44. package/dist/types/divider.types.d.ts +5 -2
  45. package/dist/variables/VariableProvider.d.ts +1 -1
  46. package/dist/variables/VariableResolver.d.ts +1 -1
  47. package/dist/variables/useVariables.d.ts +1 -1
  48. package/package.json +5 -1
  49. package/dist/components/ui/PerformanceMonitor.d.ts +0 -1
  50. package/dist/components/ui/controls/ControlPanel.d.ts +0 -8
  51. package/dist/components/ui/controls/ControlPanel2D.d.ts +0 -2
  52. package/dist/components/ui/controls/ControlPanel3D.d.ts +0 -2
  53. package/dist/components/ui/controls/VariableController.d.ts +0 -7
  54. package/dist/components/ui/controls/VariableControllerWrapper.d.ts +0 -12
  55. package/dist/components/ui/controls/VariablePanel2D.d.ts +0 -2
  56. package/dist/components/ui/controls/VariablePanel3D.d.ts +0 -2
  57. package/dist/components/ui/controls/ZoomControls.d.ts +0 -8
  58. package/dist/components/ui/test/LevaVariableController.d.ts +0 -7
  59. package/dist/components/ui/test/LevaVisibilityController.d.ts +0 -11
  60. package/dist/rp-article-designer.css +0 -1
@@ -0,0 +1,30 @@
1
+ import { VAR_TYPE } from '../variables/variable.types';
2
+ export interface ArticleVariableEntry {
3
+ articleName: string;
4
+ articleId: string;
5
+ variables: Map<string, {
6
+ value: string | number | boolean;
7
+ type: VAR_TYPE;
8
+ }>;
9
+ descriptorOptions?: Map<string, {
10
+ articles: string[];
11
+ selected?: string;
12
+ }>;
13
+ }
14
+ type Listener = () => void;
15
+ declare class VariableStore {
16
+ private articles;
17
+ private listeners;
18
+ private setters;
19
+ register(articleId: string, entry: ArticleVariableEntry, setter: (name: string, value: string | number | boolean) => void): void;
20
+ unregister(articleId: string): void;
21
+ setDescriptorOptions(articleName: string, descriptorName: string, articles: string[]): void;
22
+ setDescriptorSelection(articleId: string, descriptorName: string, selected: string): void;
23
+ private snapshot;
24
+ getArticles(): ArticleVariableEntry[];
25
+ setValue(articleId: string, varName: string, value: string | number | boolean): void;
26
+ subscribe(listener: Listener): () => boolean;
27
+ private notify;
28
+ }
29
+ export declare const variableStore: VariableStore;
30
+ export {};
@@ -0,0 +1,23 @@
1
+ type Listener = () => void;
2
+ export interface VisibilityEntry {
3
+ label: string;
4
+ visible: boolean;
5
+ }
6
+ declare class VisibilityStore {
7
+ private visibility;
8
+ private listeners;
9
+ private snapshot;
10
+ /** Called once when the article list is known. Only adds new articles, does not reset existing visibility. */
11
+ registerAll(articles: {
12
+ articleId: string;
13
+ name: string;
14
+ visible: boolean;
15
+ }[]): void;
16
+ toggle(articleId: string, visible: boolean): void;
17
+ isVisible(articleId: string): boolean;
18
+ getAll(): Map<string, VisibilityEntry>;
19
+ subscribe(listener: Listener): () => boolean;
20
+ private notify;
21
+ }
22
+ export declare const visibilityStore: VisibilityStore;
23
+ export {};
@@ -5,6 +5,7 @@ export interface CanvasProps {
5
5
  view?: VIEW;
6
6
  data?: ArticleData;
7
7
  articleList: ArticleGroupTypes[];
8
+ selectedArticleId?: string;
8
9
  debugMode?: boolean;
9
10
  isZCentered?: boolean;
10
11
  validNames?: Set<string>;
@@ -0,0 +1,10 @@
1
+ export interface ControlConfig {
2
+ label: string;
3
+ fieldType: string;
4
+ varName: string[];
5
+ options?: string | string[];
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ [key: string]: unknown;
10
+ }
@@ -41,6 +41,7 @@ export interface LinearDivisionDescriptor extends BaseDivider {
41
41
  type: typeof DividerTypeConst.LINEAR_DIVISION;
42
42
  valueSource: typeof ValueSourceConst.DESCRIPTOR;
43
43
  thickness: number;
44
+ descriptorName: string;
44
45
  }
45
46
  export type LinearDivisionMode = LinearDivisionString | LinearDivisionDescriptor;
46
47
  export interface ArticleString extends BaseDivider {
@@ -50,6 +51,8 @@ export interface ArticleString extends BaseDivider {
50
51
  export interface ArticleDescriptor extends BaseDivider {
51
52
  type: typeof DividerTypeConst.ARTICLE;
52
53
  valueSource: typeof ValueSourceConst.DESCRIPTOR;
54
+ matchesArticles?: string[];
55
+ descriptorName: string;
53
56
  }
54
57
  export type ArticleMode = ArticleString | ArticleDescriptor;
55
58
  export type DividerMode = LinearDivisionMode | ArticleMode;
@@ -67,9 +70,9 @@ export declare const isArticle: {
67
70
  };
68
71
  export declare const createDivider: {
69
72
  linearDivisionString(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, DIVIDER: string, thickness: number): LinearDivisionString;
70
- linearDivisionDescriptor(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, DIVIDER: string, thickness: number): LinearDivisionDescriptor;
73
+ linearDivisionDescriptor(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVELEM1: number, DIVIDER: string, thickness: number, descriptorName: string): LinearDivisionDescriptor;
71
74
  articleString(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVIDER: string, DIVELEM1: number): ArticleString;
72
- articleDescriptor(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVIDER: string, DIVELEM1: number): ArticleDescriptor;
75
+ articleDescriptor(NAME: string, TREEID: string, DIVDIR: DivisionDirection, DIVTYPE: DividerType, HORDEFTYPE: HorizontalDefType, LINDIV1: string, DIVIDER: string, DIVELEM1: number, descriptorName: string): ArticleDescriptor;
73
76
  fromZoneData(divProps: DividerProps, thickness: number): DividerMode;
74
77
  };
75
78
  export declare function getDividedAxis(divider?: DividerMode): 'width' | 'depth' | 'height';
@@ -7,7 +7,7 @@ export interface VariableProviderProps {
7
7
  }
8
8
  export interface VariableContextValue {
9
9
  tree: VariableTree;
10
- setVarValue: (name: string, value: string | number) => void;
10
+ setVarValue: (name: string, value: string | number | boolean) => void;
11
11
  }
12
12
  /**
13
13
  * Provides base variable tree from IMOS variable definitions
@@ -12,7 +12,7 @@ export declare function getValue(varName: string, tree: VariableTree, visited?:
12
12
  /**
13
13
  * Set a variable's value (immutable update)
14
14
  */
15
- export declare function setValue(varName: string, newValue: string | number, tree: VariableTree): VariableTree;
15
+ export declare function setValue(varName: string, newValue: string | number | boolean, tree: VariableTree): VariableTree;
16
16
  /**
17
17
  * Resolve variables in a string (e.g., "1:$VAR_M1 mm" → "1:300 mm")
18
18
  */
@@ -8,5 +8,5 @@ export declare function useVariables(): {
8
8
  resolveVar: (str: string) => string;
9
9
  resolveVarRecursive: (str: string) => string;
10
10
  hasVariables: (str: string) => boolean;
11
- setVarValue: (name: string, value: string | number) => void;
11
+ setVarValue: (name: string, value: string | number | boolean) => void;
12
12
  };
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.39",
4
+ "version": "1.0.40",
5
5
  "author": "Otman Abid Lmerabetine",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -55,6 +55,9 @@
55
55
  "three": ">=0.150.0"
56
56
  },
57
57
  "dependencies": {
58
+ "@emotion/react": "^11.14.0",
59
+ "@emotion/styled": "^11.14.1",
60
+ "@mui/material": "^7.3.8",
58
61
  "@react-spring/three": "^10.0.3",
59
62
  "@react-three/drei": "^10.7.7",
60
63
  "@react-three/fiber": ">=6.0.0",
@@ -62,6 +65,7 @@
62
65
  "leva": ">=0.10.0",
63
66
  "react": ">=16.0.0",
64
67
  "react-dom": ">=16.0.0",
68
+ "react-is": "^18.3.1",
65
69
  "react-use": "^17.6.0",
66
70
  "react-zoom-pan-pinch": "^3.7.0",
67
71
  "three": ">=0.150.0"
@@ -1 +0,0 @@
1
- export declare function PerformanceMonitor(): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- export interface ControlPanelProps {
3
- visibility: Record<string, boolean>;
4
- onVisibilityChange: (key: string, value: boolean) => void;
5
- position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6
- style?: CSSProperties;
7
- }
8
- export declare function ControlPanel({ visibility, onVisibilityChange, position, style }: ControlPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { ControlPanelProps } from './ControlPanel';
2
- export declare function ControlPanel2D(props: ControlPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { ControlPanelProps } from './ControlPanel';
2
- export declare function ControlPanel3D(props: ControlPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { VIEW } from '../../../types/view.types';
2
- interface VariableControllerProps {
3
- articleName: string;
4
- view: VIEW;
5
- }
6
- export declare function VariableController({ articleName, view }: VariableControllerProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,12 +0,0 @@
1
- import { ArticleGroupTypes } from '../../../types/article-group.types';
2
- interface VariableControllerWrapperProps {
3
- article: ArticleGroupTypes;
4
- articleId: string;
5
- }
6
- /**
7
- * Wrapper that provides context for LevaVariableController
8
- * This allows us to render the variable controller outside the SVG
9
- * while still having access to the article's context
10
- */
11
- export declare function VariableControllerWrapper({ article, articleId }: VariableControllerWrapperProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,2 +0,0 @@
1
- import { VariablePanelProps } from './VariablePanel';
2
- export declare function VariablePanel2D(props: VariablePanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { VariablePanelProps } from './VariablePanel';
2
- export declare function VariablePanel3D(props: VariablePanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- export interface ZoomControlsProps {
2
- zoom: number;
3
- onZoomIn: () => void;
4
- onZoomOut: () => void;
5
- onReset: () => void;
6
- position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
7
- }
8
- export declare function ZoomControls({ zoom, onZoomIn, onZoomOut, onReset, position }: ZoomControlsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- interface LevaVariableControllerProps {
2
- articleName: string;
3
- articleId: string;
4
- onArticleNameChange?: (name: string) => void;
5
- }
6
- export declare function LevaVariableController({ articleName, articleId, onArticleNameChange }: LevaVariableControllerProps): null;
7
- export {};
@@ -1,11 +0,0 @@
1
- import { ArticleGroupTypes } from '../../../types/article-group.types';
2
- interface LevaVisibilityControllerProps {
3
- articleList: ArticleGroupTypes[];
4
- onVisibilityChange: (articleName: string, visible: boolean) => void;
5
- }
6
- /**
7
- * Leva-based visibility controller for articles
8
- * Renders outside SVG, works in both 3D and 2D views
9
- */
10
- export declare function LevaVisibilityController({ articleList, onVisibilityChange }: LevaVisibilityControllerProps): null;
11
- export {};
@@ -1 +0,0 @@
1
- .leva-c-kWgxhW{width:450px!important;max-height:80vh!important;font-size:12px!important}.leva-c-kWgxhW{position:fixed!important;top:20px!important;right:20px!important}.leva-c-lfSEqC{font-size:13px!important;font-weight:600!important;padding:8px 10px!important}.leva-c-guFiPV{min-width:60px!important}.leva-c-kJFgFS{min-width:150px!important}.leva-c-bXZCSs{width:100px!important}.leva-c-jUkAsD{min-height:28px!important}.leva-c-kWgxhW{background:#000000d9!important;-webkit-backdrop-filter:blur(10px)!important;backdrop-filter:blur(10px)!important}.leva-c-kWgxhW::-webkit-scrollbar{width:8px}.leva-c-kWgxhW::-webkit-scrollbar-track{background:#ffffff1a}.leva-c-kWgxhW::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:4px}.leva-c-kWgxhW::-webkit-scrollbar-thumb:hover{background:#ffffff80}