@processandtools/rp-article-designer 1.0.12 → 1.0.14

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.
@@ -0,0 +1 @@
1
+ :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>rp-article-designer-005</title>
8
+ <script type="module" crossorigin src="/assets/index-DB7goBO_.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-DQ3P1g1z.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@processandtools/rp-article-designer",
3
- "version": "1.0.12",
4
- "description": "3D Article Designer component library for furniture visualization using React Three Fiber",
3
+ "private": false,
4
+ "version": "1.0.14",
5
5
  "author": "Otman Abid Lmerabetine",
6
6
  "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
7
11
  "keywords": [
8
12
  "react",
9
13
  "three",
@@ -16,10 +20,6 @@
16
20
  "react-three-fiber",
17
21
  "imos"
18
22
  ],
19
- "type": "module",
20
- "main": "./dist/index.cjs",
21
- "module": "./dist/index.js",
22
- "types": "./dist/index.d.ts",
23
23
  "exports": {
24
24
  ".": {
25
25
  "types": "./dist/index.d.ts",
@@ -53,40 +53,28 @@
53
53
  "three": ">=0.150.0"
54
54
  },
55
55
  "dependencies": {
56
- "imos-linear-division": "^0.1.3"
56
+ "@react-three/drei": "^10.7.7",
57
+ "@react-three/fiber": "^9.5.0",
58
+ "imos-linear-division": "^0.1.3",
59
+ "leva": "^0.10.1",
60
+ "react": "^19.2.0",
61
+ "react-dom": "^19.2.0",
62
+ "react-use": "^17.6.0",
63
+ "three": "^0.182.0"
57
64
  },
58
65
  "devDependencies": {
59
- "@react-three/postprocessing": "^2.0.4",
66
+ "javascript-obfuscator": "^5.1.0",
60
67
  "@eslint/js": "^9.39.1",
61
- "@react-three/drei": "^10.7.7",
62
- "@react-three/fiber": "^9.4.0",
63
- "@types/node": "^24.10.0",
64
- "@types/react": "^19.2.2",
65
- "@types/react-dom": "^19.2.2",
66
- "@types/three": "^0.181.0",
67
- "@vitejs/plugin-react": "^5.1.0",
68
- "d3-selection": "^3.0.0",
69
- "d3-zoom": "^3.0.0",
68
+ "@types/node": "^24.10.1",
69
+ "@types/react": "^19.2.5",
70
+ "@types/react-dom": "^19.2.3",
71
+ "@vitejs/plugin-react": "^5.1.1",
70
72
  "eslint": "^9.39.1",
71
73
  "eslint-plugin-react-hooks": "^7.0.1",
72
74
  "eslint-plugin-react-refresh": "^0.4.24",
73
75
  "globals": "^16.5.0",
74
- "javascript-obfuscator": "^5.1.0",
75
- "react": "^19.2.0",
76
- "react-dom": "^19.2.0",
77
- "react-use": "^17.6.0",
78
- "terser": "^5.44.1",
79
- "three": "^0.181.1",
80
76
  "typescript": "~5.9.3",
81
- "typescript-eslint": "^8.46.3",
82
- "vite": "^7.2.2",
83
- "vite-plugin-dts": "^3.9.1"
84
- },
85
- "publishConfig": {
86
- "access": "public"
87
- },
88
- "repository": {
89
- "type": "git",
90
- "url": "https://github.com/processandtools/rp-article-designer.git"
77
+ "typescript-eslint": "^8.46.4",
78
+ "vite": "^7.2.4"
91
79
  }
92
80
  }
@@ -1,7 +0,0 @@
1
- import { DimensionProps } from '../../types/zone.types.tsx';
2
-
3
- export interface ArticleContextType {
4
- articleName: string;
5
- dimensionOverrides?: Partial<DimensionProps>;
6
- }
7
- export declare const ArticleContext: import('react').Context<ArticleContextType>;
@@ -1 +0,0 @@
1
- export declare const DataContext: import('react').Context<any>;
@@ -1,3 +0,0 @@
1
- import { DescriptorManager } from '../../descriptor/services/DescriptorManager.ts';
2
-
3
- export declare const DescriptorContext: import('react').Context<DescriptorManager>;
@@ -1,8 +0,0 @@
1
- import { DescriptorEvaluationResult, DescriptorNode, DescriptorResponse } from '../types/descriptor.types';
2
- import { DescriptorTypeValue } from '../types/descriptor-data.types.ts';
3
- import { VariableTree } from '../../variables/VariableResolver.ts';
4
-
5
- export declare class DescriptorEvaluator {
6
- static evaluate<T extends DescriptorTypeValue>(descriptor: DescriptorResponse<T>, data: Record<string, unknown>, variableTree?: VariableTree): DescriptorEvaluationResult<T>;
7
- static findAllNonDefaultMatches(descriptor: DescriptorResponse, data: Record<string, unknown>, variableTree?: VariableTree): DescriptorNode[];
8
- }
@@ -1,23 +0,0 @@
1
- import { DescriptorResponse, DescriptorEvaluationResult } from '../types/descriptor.types';
2
- import { DescriptorTypeValue } from '../types/descriptor-data.types';
3
- import { VariableTree } from '../../variables/VariableResolver';
4
-
5
- export declare class DescriptorManager {
6
- private descriptors;
7
- private variableTree?;
8
- constructor(descriptors: DescriptorResponse[], variableTree?: VariableTree);
9
- evaluate<T extends DescriptorTypeValue = DescriptorTypeValue>(descriptorName: string, inputData: Record<string, unknown>): DescriptorEvaluationResult<T>;
10
- getDescriptor(descriptorName: string): DescriptorResponse | undefined;
11
- hasDescriptor(descriptorName: string): boolean;
12
- getDescriptorNames(): string[];
13
- getDescriptorsByType(descriptorType: DescriptorTypeValue): DescriptorResponse[];
14
- findAllMatches(descriptorName: string, inputData: Record<string, unknown>): import('../types/descriptor.types').DescriptorNode<DescriptorTypeValue>[];
15
- getStats(): {
16
- total: number;
17
- byType: Record<number, number>;
18
- names: string[];
19
- };
20
- }
21
- export declare function createDescriptorManager(jsonData: DescriptorResponse[] | {
22
- descriptors: DescriptorResponse[];
23
- }, variableTree?: VariableTree): DescriptorManager;
@@ -1,44 +0,0 @@
1
- import { VariableTree } from '../variables/VariableResolver';
2
-
3
- export interface ResolveOptions {
4
- variableTree?: VariableTree;
5
- dataType?: 'FL' | 'IN' | 'CI' | 'CS' | 'DA' | string;
6
- silent?: boolean;
7
- allowFunctions?: boolean;
8
- }
9
- export interface ResolveResult {
10
- value: number | string | undefined;
11
- original: string;
12
- resolved: string;
13
- hadVariables: boolean;
14
- wasEvaluated: boolean;
15
- unit?: string;
16
- error?: string;
17
- }
18
- export declare function resolve(input: string, options?: ResolveOptions): ResolveResult;
19
- export declare function resolveValue(input: string, options?: ResolveOptions): number | string | undefined;
20
- /**
21
- * Check if a string is an IF statement
22
- */
23
- export declare function isIfStatement(str: string): boolean;
24
- /**
25
- * Parse and evaluate an IF statement
26
- * Format: IF(condition, trueValue, falseValue)
27
- *
28
- * Supports:
29
- * - Comparisons: =, !=, <, >, <=, >=
30
- * - Logical: AND, OR, NOT
31
- * - Nested IF statements
32
- *
33
- * @example
34
- * evaluateIfStatement("IF(1 = 1, -150, 150)") // → -150
35
- * evaluateIfStatement("IF(5 > 3, 100, 200)") // → 100
36
- */
37
- export declare function evaluateIfStatement(expr: string, allowFunctions?: boolean): number | string;
38
- export declare function isMathExpression(str: string): boolean;
39
- export declare function evaluateExpression(expr: string, allowFunctions?: boolean): number;
40
- export declare function clearCache(): void;
41
- export declare function resolveMany(inputs: string[], options?: ResolveOptions): ResolveResult[];
42
- export declare function resolveObject<T extends Record<string, unknown>>(obj: T, options?: ResolveOptions): T;
43
- export declare function inspect(input: string, options?: ResolveOptions): ResolveResult;
44
- export declare function canResolve(input: string, options?: ResolveOptions): boolean;
@@ -1,59 +0,0 @@
1
- import { VariableTree } from '../variables/VariableResolver';
2
-
3
- export interface LindivResult {
4
- /** Resolved lindiv string in original format (e.g., "3600mm:1", "1:1800mm") */
5
- value: string;
6
- /** Original input string */
7
- original: string;
8
- /** Whether this is a reference (starts with # or is article name) */
9
- isReference: boolean;
10
- }
11
- /**
12
- * Resolve lindiv expressions and return in original format
13
- *
14
- * Handles:
15
- * - Simple ratios: "1:1", "2:1" → "1:1"
16
- * - References: "#RP_LD_P_T100" → "RP_LD_P_T100"
17
- * - Expressions: "(round(4000/1200 -0.5)*1200)mm:1" → "3600mm:1"
18
- * - Reverse format: "1:((round(2700/150))*150)mm" → "1:1800mm"
19
- * - With braces: "(round(X/150))*{1}" → "24*{1}"
20
- * - With variables: Assumes variables are already resolved
21
- *
22
- * @example
23
- * resolveLindiv("(round(4000/1200 -0.5)*1200)mm:1")
24
- * // → "3600mm:1"
25
- *
26
- * @example
27
- * resolveLindiv("1:((round(2700/150))*150)mm")
28
- * // → "1:1800mm"
29
- *
30
- * @example
31
- * resolveLindiv("#RP_LD_P_T100")
32
- * // → "RP_LD_P_T100" (removes #)
33
- */
34
- export declare function resolveLindiv(lindiv: string, variableTree?: VariableTree): LindivResult;
35
- /**
36
- * Simpler version that just returns the resolved string value
37
- *
38
- * @example
39
- * resolveLindivValue("(round(4000/1200 -0.5)*1200)mm:1")
40
- * // → "3600mm:1"
41
- */
42
- export declare function resolveLindivValue(lindiv: string, variableTree?: VariableTree): string;
43
- /**
44
- * Check if lindiv is a reference (descriptor name or article name)
45
- */
46
- export declare function isLindivReference(lindiv: string): boolean;
47
- /**
48
- * Check if a lindiv expression contains variables
49
- */
50
- export declare function lindivHasVariables(lindiv: string): boolean;
51
- /**
52
- * Extract variable names from lindiv
53
- */
54
- export declare function extractLindivVariables(lindiv: string): string[];
55
- /**
56
- * Format lindiv result back to string
57
- * Since value is already formatted, this just adds # for references
58
- */
59
- export declare function formatLindiv(result: LindivResult): string;
@@ -1 +0,0 @@
1
- export declare function useArticle(): import('../contexts/article/ArticleContext.ts').ArticleContextType;
@@ -1 +0,0 @@
1
- export declare function useData(): any;
@@ -1,32 +0,0 @@
1
- import { DescriptorManager } from '../descriptor/services/DescriptorManager';
2
- import { DescriptorEvaluationResult, DescriptorNode } from '../descriptor/types/descriptor.types';
3
- import { DescriptorTypeValue } from '../descriptor/types/descriptor-data.types';
4
-
5
- export interface UseDescriptorOptions {
6
- /** Throw error if descriptor not found (default: false) */
7
- throwOnError?: boolean;
8
- }
9
- export interface UseDescriptorResult<T extends DescriptorTypeValue> {
10
- /** Evaluation result (null if error and throwOnError=false) */
11
- result: DescriptorEvaluationResult<T> | null;
12
- /** Error message if evaluation failed */
13
- error: string | null;
14
- /** Whether evaluation was successful */
15
- success: boolean;
16
- }
17
- export declare function useDescriptorEvaluation<T extends DescriptorTypeValue = DescriptorTypeValue>(manager: DescriptorManager, descriptorName: string, inputData: Record<string, unknown>, options?: UseDescriptorOptions): UseDescriptorResult<T>;
18
- export interface UseDescriptorMatchesResult {
19
- /** All matching nodes */
20
- matches: DescriptorNode[];
21
- /** Error message if evaluation failed */
22
- error: string | null;
23
- /** Number of matches found */
24
- count: number;
25
- }
26
- export declare function useDescriptorMatches(manager: DescriptorManager, descriptorName: string, inputData: Record<string, unknown>): UseDescriptorMatchesResult;
27
- export declare function useDescriptorExists(manager: DescriptorManager, descriptorName: string): boolean;
28
- export interface UseDescriptorListOptions {
29
- /** Filter by descriptor type */
30
- type?: DescriptorTypeValue;
31
- }
32
- export declare function useDescriptorList(manager: DescriptorManager, options?: UseDescriptorListOptions): string[];
@@ -1,3 +0,0 @@
1
- import { DescriptorManager } from '../descriptor/services/DescriptorManager';
2
-
3
- export declare function useDescriptorManager(): DescriptorManager;
@@ -1,93 +0,0 @@
1
- import { DividerMode } from '../types/divider.types';
2
-
3
- export interface UseZoneDescriptorOptions {
4
- inputData: Record<string, unknown>;
5
- divider?: DividerMode;
6
- }
7
- export declare function ZoneDescriptor({ divider, inputData }: UseZoneDescriptorOptions): {
8
- updatedDivider: {
9
- LINDIV1: string;
10
- articleName: string;
11
- type: "linear-division";
12
- valueSource: "string";
13
- DIVIDER: "";
14
- formula: string;
15
- thickness: number;
16
- TREEID: string;
17
- DIVDIR: import('../types/divider.types').DivisionDirection;
18
- DIVTYPE: import('../types/divider.types').DividerType;
19
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
20
- DIVELEM1: number;
21
- } | {
22
- LINDIV1: string;
23
- articleName: string;
24
- type: "linear-division";
25
- valueSource: "descriptor";
26
- DIVIDER: "";
27
- descriptorName: string;
28
- thickness: number;
29
- TREEID: string;
30
- DIVDIR: import('../types/divider.types').DivisionDirection;
31
- DIVTYPE: import('../types/divider.types').DividerType;
32
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
33
- DIVELEM1: number;
34
- } | {
35
- LINDIV1: string;
36
- articleName: string;
37
- type: "article";
38
- valueSource: "string";
39
- DIVIDER: string;
40
- TREEID: string;
41
- DIVDIR: import('../types/divider.types').DivisionDirection;
42
- DIVTYPE: import('../types/divider.types').DividerType;
43
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
44
- DIVELEM1: number;
45
- } | {
46
- LINDIV1: string;
47
- articleName: string;
48
- type: "article";
49
- valueSource: "descriptor";
50
- DIVIDER: string;
51
- descriptorName: string;
52
- TREEID: string;
53
- DIVDIR: import('../types/divider.types').DivisionDirection;
54
- DIVTYPE: import('../types/divider.types').DividerType;
55
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
56
- DIVELEM1: number;
57
- } | {
58
- LINDIV1: string;
59
- type: "linear-division";
60
- valueSource: "string";
61
- DIVIDER: "";
62
- formula: string;
63
- thickness: number;
64
- TREEID: string;
65
- DIVDIR: import('../types/divider.types').DivisionDirection;
66
- DIVTYPE: import('../types/divider.types').DividerType;
67
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
68
- DIVELEM1: number;
69
- } | {
70
- LINDIV1: string;
71
- type: "linear-division";
72
- valueSource: "descriptor";
73
- DIVIDER: "";
74
- descriptorName: string;
75
- thickness: number;
76
- TREEID: string;
77
- DIVDIR: import('../types/divider.types').DivisionDirection;
78
- DIVTYPE: import('../types/divider.types').DividerType;
79
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
80
- DIVELEM1: number;
81
- } | {
82
- LINDIV1: string;
83
- type: "article";
84
- valueSource: "descriptor";
85
- DIVIDER: string;
86
- descriptorName: string;
87
- TREEID: string;
88
- DIVDIR: import('../types/divider.types').DivisionDirection;
89
- DIVTYPE: import('../types/divider.types').DividerType;
90
- HORDEFTYPE: import('../types/divider.types').HorizontalDefType;
91
- DIVELEM1: number;
92
- };
93
- };