@cristiancosano/pallet-builder 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +93 -93
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,42 +1,42 @@
1
1
  # 📦 @cristiancosano/pallet-builder
2
2
 
3
- Sistema modular para visualización 3D de logística basado en React y React Three Fiber.
3
+ Modular system for 3D logistics visualization based on React and React Three Fiber.
4
4
 
5
- ## 🎯 Descripción
5
+ ## 🎯 Description
6
6
 
7
- Librería de componentes React que permite construir escenas 3D interactivas para visualizar operaciones logísticas como almacenes, pallets, cajas y contenedores de transporte.
7
+ React component library that allows building interactive 3D scenes to visualize logistics operations such as warehouses, pallets, boxes, and shipping containers.
8
8
 
9
- ## ✨ Características
9
+ ## ✨ Features
10
10
 
11
- - 🧱 **Sistema Modular**: Arquitectura limpia con separación entre lógica core y visualización
12
- - 🎨 **Componentes Declarativos**: API simple basada en componentes React
13
- - 📐 **Estándares Industriales**: Soporte para pallets EURO, ISO y personalizados
14
- - 🔄 **Real-time**: Visualización 3D interactiva con controles de cámara
15
- - 📊 **Validaciones**: Lógica de negocio para validar dimensiones, pesos y ocupación
16
- - 🎯 **Agnóstico**: Core en TypeScript puro sin dependencias de frameworks de visualización
11
+ - 🧱 **Modular System**: Clean architecture with separation between core logic and visualization
12
+ - 🎨 **Declarative Components**: Simple API based on React components
13
+ - 📐 **Industry Standards**: Support for EURO, ISO, and custom pallets
14
+ - 🔄 **Real-time**: Interactive 3D visualization with camera controls
15
+ - 📊 **Validations**: Business logic to validate dimensions, weights, and occupancy
16
+ - 🎯 **Agnostic**: Core in pure TypeScript without dependencies on visualization frameworks
17
17
 
18
- ## 🚀 Inicio Rápido
18
+ ## 🚀 Quick Start
19
19
 
20
- ### Instalación
20
+ ### Installation
21
21
 
22
22
  ```bash
23
23
  pnpm install
24
24
  ```
25
25
 
26
- ### Desarrollo
26
+ ### Development
27
27
 
28
28
  ```bash
29
29
  pnpm dev
30
30
  ```
31
31
 
32
- Abre [http://localhost:5173](http://localhost:5173) para ver la demo.
32
+ Open [http://localhost:5173](http://localhost:5173) to view the demo.
33
33
 
34
- ## 📖 Uso Básico
34
+ ## 📖 Basic Usage
35
35
 
36
36
  ```tsx
37
37
  import { Warehouse, Pallet, Box } from '@cristiancosano/pallet-builder';
38
38
 
39
- function MiAppLogistica() {
39
+ function MyLogisticsApp() {
40
40
  return (
41
41
  <Warehouse width={5000} depth={5000} showGrid>
42
42
 
@@ -45,7 +45,7 @@ function MiAppLogistica() {
45
45
  dimensions={[400, 300, 200]}
46
46
  position={[0, 0, 0]}
47
47
  color="orange"
48
- label="Caja 1"
48
+ label="Box 1"
49
49
  />
50
50
  </Pallet>
51
51
 
@@ -62,16 +62,16 @@ function MiAppLogistica() {
62
62
  }
63
63
  ```
64
64
 
65
- ## 🏗️ Arquitectura
65
+ ## 🏗️ Architecture
66
66
 
67
- ### Core (TypeScript Puro)
67
+ ### Core (Pure TypeScript)
68
68
 
69
- Lógica de negocio agnóstica al framework de visualización:
69
+ Framework-agnostic business logic:
70
70
 
71
71
  ```typescript
72
72
  import { BoxEntity, PalletEntity, ContainerEntity } from '@cristiancosano/pallet-builder';
73
73
 
74
- // Crear un pallet con validaciones
74
+ // Create a pallet with validations
75
75
  const pallet = new PalletEntity({
76
76
  id: 'pallet-1',
77
77
  type: 'EURO',
@@ -86,95 +86,95 @@ const pallet = new PalletEntity({
86
86
  ]
87
87
  });
88
88
 
89
- // Validar configuración
89
+ // Validate configuration
90
90
  const validation = pallet.validate();
91
- console.log('Peso total:', pallet.getTotalWeight(), 'kg');
92
- console.log('Ocupación:', pallet.getOccupancyRate(), '%');
91
+ console.log('Total weight:', pallet.getTotalWeight(), 'kg');
92
+ console.log('Occupancy:', pallet.getOccupancyRate(), '%');
93
93
  ```
94
94
 
95
- ### Componentes (React + R3F)
95
+ ### Components (React + R3F)
96
96
 
97
- Componentes visuales 3D construidos con React Three Fiber:
97
+ 3D visual components built with React Three Fiber:
98
98
 
99
- - **`<Warehouse>`**: Contenedor principal de la escena 3D
100
- - **`<Pallet>`**: Representa un pallet con soporte para EURO, ISO o custom
101
- - **`<Box>`**: Caja/paquete posicionable dentro de un pallet
102
- - **`<CameraControls>`**: Controles de cámara (órbita, primera persona, etc.)
99
+ - **`<Warehouse>`**: Main container of the 3D scene
100
+ - **`<Pallet>`**: Represents a pallet with support for EURO, ISO, or custom
101
+ - **`<Box>`**: Box/package positionable inside a pallet
102
+ - **`<CameraControls>`**: Camera controls (orbit, first person, etc.)
103
103
 
104
- ## 📐 Estándares de Pallets
104
+ ## 📐 Pallet Standards
105
105
 
106
106
  ### EUR-Pallet (EURO)
107
- - Dimensiones: 800 x 1200 x 144 mm
108
- - Peso máximo: 1500 kg
109
- - Altura máxima: 2200 mm
107
+ - Dimensions: 800 x 1200 x 144 mm
108
+ - Maximum weight: 1500 kg
109
+ - Maximum height: 2200 mm
110
110
 
111
111
  ### ISO Pallet (ISO)
112
- - Dimensiones: 1000 x 1200 x 144 mm
113
- - Peso máximo: 2000 kg
114
- - Altura máxima: 2200 mm
112
+ - Dimensions: 1000 x 1200 x 144 mm
113
+ - Maximum weight: 2000 kg
114
+ - Maximum height: 2200 mm
115
115
 
116
116
  ### Custom
117
- - Dimensiones personalizables
118
- - Configuración flexible
117
+ - Customizable dimensions
118
+ - Flexible configuration
119
119
 
120
- ## 🎨 Componentes Disponibles
120
+ ## 🎨 Available Components
121
121
 
122
122
  ### Warehouse
123
123
 
124
- Contenedor principal que crea la escena 3D con iluminación y controles.
124
+ Main container that creates the 3D scene with lighting and controls.
125
125
 
126
126
  ```tsx
127
127
  <Warehouse
128
128
  width={5000} // mm
129
129
  depth={5000} // mm
130
- height={3000} // mm (opcional)
131
- showGrid={true} // Mostrar grid del suelo
130
+ height={3000} // mm (optional)
131
+ showGrid={true} // Show ground grid
132
132
  backgroundColor="#f0f0f0"
133
133
  >
134
- {/* Contenido */}
134
+ {/* Content */}
135
135
  </Warehouse>
136
136
  ```
137
137
 
138
138
  ### Pallet
139
139
 
140
- Representa un pallet estándar o personalizado.
140
+ Represents a standard or custom pallet.
141
141
 
142
142
  ```tsx
143
143
  <Pallet
144
144
  id="pallet-1"
145
145
  type="EURO" // 'EURO' | 'ISO' | 'CUSTOM'
146
- position={[0, 0, 0]} // [x, y, z] en mm
147
- rotation={[0, 0, 0]} // [x, y, z] en radianes
146
+ position={[0, 0, 0]} // [x, y, z] in mm
147
+ rotation={[0, 0, 0]} // [x, y, z] in radians
148
148
  color="#8B4513"
149
149
  showDimensions={false}
150
- customDimensions={[1000, 144, 1200]} // Para CUSTOM
150
+ customDimensions={[1000, 144, 1200]} // For CUSTOM
151
151
  >
152
- {/* Cajas */}
152
+ {/* Boxes */}
153
153
  </Pallet>
154
154
  ```
155
155
 
156
156
  ### Box
157
157
 
158
- Caja o paquete dentro de un pallet.
158
+ Box or package inside a pallet.
159
159
 
160
160
  ```tsx
161
161
  <Box
162
- dimensions={[400, 300, 200]} // [ancho, alto, fondo] en mm
163
- position={[0, 0, 0]} // [x, y, z] dentro del pallet
162
+ dimensions={[400, 300, 200]} // [width, height, depth] in mm
163
+ position={[0, 0, 0]} // [x, y, z] inside the pallet
164
164
  color="#ff6b35"
165
- label="Caja 1"
165
+ label="Box 1"
166
166
  onClick={() => console.log('Click!')}
167
167
  onHover={(hovered) => console.log(hovered)}
168
168
  />
169
169
  ```
170
170
 
171
- ## 🎨 Personalización con AspectConfig
171
+ ## 🎨 Customization with AspectConfig
172
172
 
173
- El sistema `AspectConfig` permite personalizar la apariencia visual de cada componente individualmente.
173
+ The `AspectConfig` system allows customizing the visual appearance of each component individually.
174
174
 
175
- ### Configuración Global
175
+ ### Global Configuration
176
176
 
177
- Define valores por defecto para todos los componentes:
177
+ Define default values for all components:
178
178
 
179
179
  ```tsx
180
180
  import { ConfigurationProvider, PalletBuilder, Box } from '@cristiancosano/pallet-builder';
@@ -199,32 +199,32 @@ function App() {
199
199
  }
200
200
  ```
201
201
 
202
- ### Personalización por Componente
202
+ ### Component-level Customization
203
203
 
204
- Cada pallet o caja puede tener su propia textura, modelo o color:
204
+ Each pallet or box can have its own texture, model, or color:
205
205
 
206
206
  ```tsx
207
207
  <PalletBuilder
208
208
  palletType="EURO"
209
209
  palletAspect={{ textureUrl: '/textures/dark_wood.png' }}
210
210
  >
211
- {/* Caja con color personalizado */}
211
+ {/* Box with custom color */}
212
212
  <Box
213
213
  dimensions={[400, 300, 200]}
214
214
  position={[0, 0, 0]}
215
215
  aspect={{ color: '#00d9ff' }}
216
- label="Caja Azul"
216
+ label="Blue Box"
217
217
  />
218
218
 
219
- {/* Caja con textura personalizada */}
219
+ {/* Box with custom texture */}
220
220
  <Box
221
221
  dimensions={[400, 300, 200]}
222
222
  position={[400, 0, 0]}
223
223
  aspect={{ textureUrl: '/textures/cardboard.png' }}
224
- label="Caja Cartón"
224
+ label="Cardboard Box"
225
225
  />
226
226
 
227
- {/* Caja con modelo 3D personalizado */}
227
+ {/* Box with custom 3D model */}
228
228
  <Box
229
229
  dimensions={[400, 300, 200]}
230
230
  position={[0, 0, 400]}
@@ -232,62 +232,62 @@ Cada pallet o caja puede tener su propia textura, modelo o color:
232
232
  modelUrl: '/objects/custom_box.glb',
233
233
  textureUrl: '/textures/metal.png'
234
234
  }}
235
- label="Caja Metal"
235
+ label="Metal Box"
236
236
  />
237
237
  </PalletBuilder>
238
238
  ```
239
239
 
240
- ### Modelos 3D y Texturas por Defecto
240
+ ### Default 3D Models and Textures
241
241
 
242
- La librería viene configurada con modelos y texturas por defecto:
242
+ The library comes configured with default models and textures:
243
243
 
244
244
  **Pallets:**
245
- - Modelo: `/objects/pallet.glb`
246
- - Textura: `/textures/pallet_planks.png`
245
+ - Model: `/objects/pallet.glb`
246
+ - Texture: `/textures/pallet_planks.png`
247
247
 
248
- **Cajas:**
249
- - Modelo: `/objects/box.glb`
250
- - Textura: `/textures/crate_roughness.png`
248
+ **Boxes:**
249
+ - Model: `/objects/box.glb`
250
+ - Texture: `/textures/crate_roughness.png`
251
251
 
252
- Puedes usar tus propios modelos GLB y texturas personalizando la configuración global o usando el prop `aspect` en cada componente individual.
252
+ You can use your own GLB models and textures by customizing the global configuration or using the `aspect` prop on each individual component.
253
253
 
254
- **Prioridad**: `aspect prop` > `ConfigurationProvider` > `defaults`
254
+ **Priority**: `aspect prop` > `ConfigurationProvider` > `defaults`
255
255
 
256
- Ver [docs/guides/aspect-customization.md](./docs/guides/aspect-customization.md) para ejemplos completos.
256
+ See [docs/guides/aspect-customization.md](./docs/guides/aspect-customization.md) for full examples.
257
257
 
258
258
  ## 🔮 Roadmap
259
259
 
260
- - [ ] **`<Truck>`**: Componente para visualizar camiones
261
- - [ ] **`<Container>`**: Contenedor marítimo
262
- - [ ] **Algoritmos de optimización**: Sugerencias automáticas de colocación
263
- - [ ] **Exportación**: Generar reportes y visualizaciones
264
- - [ ] **Física**: Simulación de peso y estabilidad
265
- - [ ] **Multiplayer**: Colaboración en tiempo real
260
+ - [ ] **`<Truck>`**: Component for truck visualization
261
+ - [ ] **`<Container>`**: Shipping container
262
+ - [ ] **Optimization Algorithms**: Automatic placement suggestions
263
+ - [ ] **Export**: Generate reports and visualizations
264
+ - [ ] **Physics**: Weight and stability simulation
265
+ - [ ] **Multiplayer**: Real-time collaboration
266
266
 
267
- ## 📚 Documentación
267
+ ## 📚 Documentation
268
268
 
269
- Consulta la carpeta `/docs` para más información:
269
+ Check the `/docs` folder for more information:
270
270
 
271
- - [Guía de Componentes 3D](./docs/guides/3d-components-development.md)
272
- - [Modelo de Dominio](./docs/context/domain-model.md)
273
- - [Convenciones de Código](./docs/context/coding-conventions.md)
271
+ - [3D Components Guide](./docs/guides/3d-components-development.md)
272
+ - [Domain Model](./docs/context/domain-model.md)
273
+ - [Coding Conventions](./docs/context/coding-conventions.md)
274
274
 
275
- ## 🤝 Contribuir
275
+ ## 🤝 Contributing
276
276
 
277
- Ver [CONTRIBUTING.md](./docs/guides/contributing.md)
277
+ See [CONTRIBUTING.md](./docs/guides/contributing.md)
278
278
 
279
- ## Atribuciones
279
+ ## 📄 Attributions
280
280
 
281
- Este proyecto utiliza assets de terceros:
281
+ This project uses third-party assets:
282
282
 
283
283
  - **HDR Environment Map**: [HDRI Haven/Poly Haven](https://polyhaven.com/) (CC0 License) via [pmndrs/drei-assets](https://github.com/pmndrs/drei-assets)
284
284
 
285
- Ver [ATTRIBUTIONS.md](./ATTRIBUTIONS.md) para detalles completos.
285
+ See [ATTRIBUTIONS.md](./ATTRIBUTIONS.md) for full details.
286
286
 
287
- ## �📄 Licencia
287
+ ## 📄 License
288
288
 
289
289
  MIT © Cristian Cosano
290
290
 
291
291
  ---
292
292
 
293
- **Hecho con ❤️ usando React Three Fiber**
293
+ **Made with ❤️ using React Three Fiber**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cristiancosano/pallet-builder",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "React Three Fiber component library for 3D pallet visualization and logistics simulation",
6
6
  "main": "./dist/pallet-builder.js",