@jjlmoya/utils-diy 1.8.0 → 1.10.0

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 (56) hide show
  1. package/package.json +7 -4
  2. package/scripts/postinstall.mjs +27 -0
  3. package/src/entries.ts +31 -0
  4. package/src/tool/balusterCalculator/baluster-calculator.css +320 -0
  5. package/src/tool/balusterCalculator/component.astro +0 -322
  6. package/src/tool/balusterCalculator/entry.ts +29 -0
  7. package/src/tool/balusterCalculator/index.ts +2 -31
  8. package/src/tool/clayCalculator/clay-shrinkage-calculator.css +530 -0
  9. package/src/tool/clayCalculator/component.astro +0 -532
  10. package/src/tool/clayCalculator/entry.ts +29 -0
  11. package/src/tool/clayCalculator/index.ts +2 -31
  12. package/src/tool/concreteCalculator/component.astro +0 -705
  13. package/src/tool/concreteCalculator/concrete-mortar-calculator.css +703 -0
  14. package/src/tool/concreteCalculator/entry.ts +25 -0
  15. package/src/tool/concreteCalculator/index.ts +2 -26
  16. package/src/tool/cutOptimizer/component.astro +0 -477
  17. package/src/tool/cutOptimizer/cut-optimizer.css +475 -0
  18. package/src/tool/cutOptimizer/entry.ts +25 -0
  19. package/src/tool/cutOptimizer/index.ts +2 -26
  20. package/src/tool/drillCalculator/component.astro +0 -815
  21. package/src/tool/drillCalculator/drill-rpm-calculator.css +813 -0
  22. package/src/tool/drillCalculator/entry.ts +25 -0
  23. package/src/tool/drillCalculator/index.ts +2 -26
  24. package/src/tool/drillSharpener/component.astro +0 -393
  25. package/src/tool/drillSharpener/drill-sharpening-master.css +391 -0
  26. package/src/tool/drillSharpener/entry.ts +25 -0
  27. package/src/tool/drillSharpener/index.ts +2 -27
  28. package/src/tool/epoxyCalculator/component.astro +0 -571
  29. package/src/tool/epoxyCalculator/entry.ts +29 -0
  30. package/src/tool/epoxyCalculator/epoxy-resin-calculator.css +569 -0
  31. package/src/tool/epoxyCalculator/index.ts +2 -31
  32. package/src/tool/furnitureFit/component.astro +0 -345
  33. package/src/tool/furnitureFit/entry.ts +25 -0
  34. package/src/tool/furnitureFit/furniture-fit-calculator.css +343 -0
  35. package/src/tool/furnitureFit/index.ts +2 -26
  36. package/src/tool/mortarCalculator/component.astro +0 -620
  37. package/src/tool/mortarCalculator/entry.ts +25 -0
  38. package/src/tool/mortarCalculator/index.ts +2 -26
  39. package/src/tool/mortarCalculator/lime-mortar-calculator.css +618 -0
  40. package/src/tool/passepartoutCalculator/component.astro +0 -518
  41. package/src/tool/passepartoutCalculator/entry.ts +25 -0
  42. package/src/tool/passepartoutCalculator/index.ts +2 -26
  43. package/src/tool/passepartoutCalculator/passepartout-calculator.css +516 -0
  44. package/src/tool/stairCalculator/component.astro +0 -480
  45. package/src/tool/stairCalculator/entry.ts +25 -0
  46. package/src/tool/stairCalculator/index.ts +2 -27
  47. package/src/tool/stairCalculator/stair-calculator.css +478 -0
  48. package/src/tool/thermalExpansionCalculator/component.astro +0 -490
  49. package/src/tool/thermalExpansionCalculator/entry.ts +25 -0
  50. package/src/tool/thermalExpansionCalculator/index.ts +2 -26
  51. package/src/tool/thermalExpansionCalculator/thermal-expansion-calculator.css +488 -0
  52. package/src/tool/voltageDropCalculator/component.astro +0 -729
  53. package/src/tool/voltageDropCalculator/entry.ts +25 -0
  54. package/src/tool/voltageDropCalculator/index.ts +2 -26
  55. package/src/tool/voltageDropCalculator/voltage-drop-calculator.css +727 -0
  56. package/src/tools.ts +1 -1
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-diy",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
- "./data": "./src/data.ts"
9
+ "./data": "./src/data.ts",
10
+ "./entries": "./src/entries.ts"
10
11
  },
11
12
  "files": [
12
- "src"
13
+ "src",
14
+ "scripts"
13
15
  ],
14
16
  "publishConfig": {
15
17
  "access": "public"
@@ -28,7 +30,8 @@
28
30
  "postversion": "git push && git push --tags",
29
31
  "patch": "npm version patch",
30
32
  "minor": "npm version minor",
31
- "major": "npm version major"
33
+ "major": "npm version major",
34
+ "postinstall": "node scripts/postinstall.mjs"
32
35
  },
33
36
  "lint-staged": {
34
37
  "*.{ts,tsx,astro}": [
@@ -0,0 +1,27 @@
1
+ import { readFileSync, writeFileSync, mkdirSync, readdirSync } from 'fs';
2
+ import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const libDir = dirname(fileURLToPath(import.meta.url));
6
+ const toolsDir = join(libDir, '../src/tool');
7
+
8
+ const inNodeModules = libDir.includes('node_modules');
9
+ if (!inNodeModules) process.exit(0);
10
+
11
+ const projectRoot = join(libDir, '../../../..');
12
+ const categoryKey = JSON.parse(readFileSync(join(libDir, '../package.json'), 'utf8')).name.replace('@jjlmoya/utils-', '');
13
+ const destDir = join(projectRoot, `public/styles/lib/${categoryKey}`);
14
+
15
+ mkdirSync(destDir, { recursive: true });
16
+
17
+ const tools = readdirSync(toolsDir, { withFileTypes: true }).filter(d => d.isDirectory());
18
+ for (const tool of tools) {
19
+ const toolDir = join(toolsDir, tool.name);
20
+ let files;
21
+ try { files = readdirSync(toolDir).filter(f => f.endsWith('.css')); }
22
+ catch { continue; }
23
+ for (const file of files) {
24
+ writeFileSync(join(destDir, file), readFileSync(join(toolDir, file)));
25
+ console.log(`[@jjlmoya/utils-${categoryKey}] copied ${file}`);
26
+ }
27
+ }
package/src/entries.ts ADDED
@@ -0,0 +1,31 @@
1
+ export { balusterCalculator } from './tool/balusterCalculator/entry';
2
+ export type { BalusterCalculatorLocaleContent } from './tool/balusterCalculator/entry';
3
+ export { clayCalculator } from './tool/clayCalculator/entry';
4
+ export type { ClayCalculatorLocaleContent } from './tool/clayCalculator/entry';
5
+ export { concreteCalculator } from './tool/concreteCalculator/entry';
6
+ export { cutOptimizer } from './tool/cutOptimizer/entry';
7
+ export { drillCalculator } from './tool/drillCalculator/entry';
8
+ export { drillSharpener } from './tool/drillSharpener/entry';
9
+ export { epoxyCalculator } from './tool/epoxyCalculator/entry';
10
+ export type { EpoxyCalculatorLocaleContent } from './tool/epoxyCalculator/entry';
11
+ export { furnitureFit } from './tool/furnitureFit/entry';
12
+ export { mortarCalculator } from './tool/mortarCalculator/entry';
13
+ export { passepartoutCalculator } from './tool/passepartoutCalculator/entry';
14
+ export { stairCalculator } from './tool/stairCalculator/entry';
15
+ export { thermalExpansionCalculator } from './tool/thermalExpansionCalculator/entry';
16
+ export { voltageDropCalculator } from './tool/voltageDropCalculator/entry';
17
+ export { diyCategory } from './category';
18
+ import { balusterCalculator } from './tool/balusterCalculator/entry';
19
+ import { clayCalculator } from './tool/clayCalculator/entry';
20
+ import { concreteCalculator } from './tool/concreteCalculator/entry';
21
+ import { cutOptimizer } from './tool/cutOptimizer/entry';
22
+ import { drillCalculator } from './tool/drillCalculator/entry';
23
+ import { drillSharpener } from './tool/drillSharpener/entry';
24
+ import { epoxyCalculator } from './tool/epoxyCalculator/entry';
25
+ import { furnitureFit } from './tool/furnitureFit/entry';
26
+ import { mortarCalculator } from './tool/mortarCalculator/entry';
27
+ import { passepartoutCalculator } from './tool/passepartoutCalculator/entry';
28
+ import { stairCalculator } from './tool/stairCalculator/entry';
29
+ import { thermalExpansionCalculator } from './tool/thermalExpansionCalculator/entry';
30
+ import { voltageDropCalculator } from './tool/voltageDropCalculator/entry';
31
+ export const ALL_ENTRIES = [balusterCalculator, clayCalculator, concreteCalculator, cutOptimizer, drillCalculator, drillSharpener, epoxyCalculator, furnitureFit, mortarCalculator, passepartoutCalculator, stairCalculator, thermalExpansionCalculator, voltageDropCalculator];
@@ -0,0 +1,320 @@
1
+ .bc-root {
2
+ width: 100%;
3
+ max-width: 56rem;
4
+ margin: 0 auto;
5
+ padding: 1rem;
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: 2rem;
9
+ }
10
+
11
+ .bc-input-panel {
12
+ background: #fff;
13
+ border-radius: 1.5rem;
14
+ padding: 1.5rem;
15
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
16
+ border: 1px solid #f1f5f9;
17
+ }
18
+
19
+ .bc-panel-header {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 0.75rem;
23
+ margin-bottom: 1.5rem;
24
+ }
25
+
26
+ .bc-panel-icon {
27
+ padding: 0.75rem;
28
+ background: #dbeafe;
29
+ border-radius: 0.75rem;
30
+ color: #2563eb;
31
+ font-size: 1.5rem;
32
+ display: flex;
33
+ flex-shrink: 0;
34
+ }
35
+
36
+ .bc-icon {
37
+ width: 1.5rem;
38
+ height: 1.5rem;
39
+ }
40
+
41
+ .bc-panel-title {
42
+ font-size: 1.25rem;
43
+ font-weight: 700;
44
+ color: #1e293b;
45
+ margin: 0;
46
+ }
47
+
48
+ .bc-panel-desc {
49
+ font-size: 0.875rem;
50
+ color: #94a3b8;
51
+ margin: 0;
52
+ }
53
+
54
+ .bc-inputs-grid {
55
+ display: grid;
56
+ grid-template-columns: 1fr;
57
+ gap: 1.5rem;
58
+ }
59
+
60
+ @media (min-width: 768px) {
61
+ .bc-inputs-grid {
62
+ grid-template-columns: 1fr 1fr 1fr;
63
+ }
64
+ }
65
+
66
+ .bc-input-group {
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 0.5rem;
70
+ }
71
+
72
+ .bc-label {
73
+ display: block;
74
+ font-size: 0.875rem;
75
+ font-weight: 500;
76
+ color: #374151;
77
+ }
78
+
79
+ .bc-input-wrapper {
80
+ position: relative;
81
+ }
82
+
83
+ .bc-input {
84
+ display: block;
85
+ width: 100%;
86
+ padding: 0.75rem 2.5rem 0.75rem 1rem;
87
+ border-radius: 0.75rem;
88
+ background: #f8fafc;
89
+ border: 1px solid transparent;
90
+ color: #1e293b;
91
+ font-size: 1rem;
92
+ outline: none;
93
+ transition: border-color 0.2s, box-shadow 0.2s;
94
+ box-sizing: border-box;
95
+ }
96
+
97
+ .bc-input:focus {
98
+ border-color: #3b82f6;
99
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
100
+ }
101
+
102
+ .bc-unit-label {
103
+ position: absolute;
104
+ right: 1rem;
105
+ top: 50%;
106
+ transform: translateY(-50%);
107
+ color: #94a3b8;
108
+ font-size: 0.875rem;
109
+ pointer-events: none;
110
+ }
111
+
112
+ .bc-unit-switcher {
113
+ display: flex;
114
+ justify-content: flex-end;
115
+ margin-top: 1.5rem;
116
+ }
117
+
118
+ .bc-unit-toggle {
119
+ display: inline-flex;
120
+ background: #f1f5f9;
121
+ padding: 0.25rem;
122
+ border-radius: 0.5rem;
123
+ gap: 0.25rem;
124
+ }
125
+
126
+ .bc-unit-btn {
127
+ padding: 0.375rem 1rem;
128
+ border-radius: 0.375rem;
129
+ border: none;
130
+ font-size: 0.875rem;
131
+ font-weight: 500;
132
+ cursor: pointer;
133
+ transition: all 0.2s;
134
+ color: #64748b;
135
+ background: transparent;
136
+ }
137
+
138
+ [data-bc-unit][data-bc-active='true'] {
139
+ background: #fff;
140
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
141
+ color: #1e293b;
142
+ }
143
+
144
+ .bc-blueprint {
145
+ background: #1e3a8a;
146
+ border-radius: 1.5rem;
147
+ padding: 0.25rem;
148
+ box-shadow: 0 12px 40px rgba(30, 58, 138, 0.3);
149
+ overflow: hidden;
150
+ border: 4px solid rgba(255, 255, 255, 0.1);
151
+ position: relative;
152
+ }
153
+
154
+ .bc-blueprint-grid {
155
+ position: absolute;
156
+ inset: 0;
157
+ opacity: 0.1;
158
+ background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
159
+ background-size: 20px 20px;
160
+ pointer-events: none;
161
+ }
162
+
163
+ .bc-blueprint-inner {
164
+ position: relative;
165
+ padding: 1.5rem;
166
+ color: #bfdbfe;
167
+ }
168
+
169
+ @media (min-width: 768px) {
170
+ .bc-blueprint-inner {
171
+ padding: 2.5rem;
172
+ }
173
+ }
174
+
175
+ .bc-bp-header {
176
+ display: flex;
177
+ justify-content: space-between;
178
+ align-items: flex-start;
179
+ margin-bottom: 2rem;
180
+ padding-bottom: 1rem;
181
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
182
+ }
183
+
184
+ .bc-bp-plan-title {
185
+ font-size: 1.25rem;
186
+ letter-spacing: 0.1em;
187
+ text-transform: uppercase;
188
+ color: #fff;
189
+ margin: 0 0 0.25rem;
190
+ }
191
+
192
+ .bc-bp-ref {
193
+ font-size: 0.75rem;
194
+ opacity: 0.6;
195
+ margin: 0;
196
+ }
197
+
198
+ .bc-bp-count-block {
199
+ text-align: right;
200
+ }
201
+
202
+ .bc-bp-count {
203
+ font-size: 1.875rem;
204
+ font-weight: 700;
205
+ color: #fff;
206
+ margin: 0 0 0.25rem;
207
+ line-height: 1;
208
+ }
209
+
210
+ .bc-bp-count-label {
211
+ font-size: 0.625rem;
212
+ opacity: 0.6;
213
+ text-transform: uppercase;
214
+ letter-spacing: 0.1em;
215
+ margin: 0;
216
+ }
217
+
218
+ .bc-bp-stats {
219
+ display: grid;
220
+ grid-template-columns: 1fr 1fr;
221
+ gap: 1rem;
222
+ margin-bottom: 2rem;
223
+ }
224
+
225
+ @media (min-width: 768px) {
226
+ .bc-bp-stats {
227
+ grid-template-columns: 1fr 1fr 1fr 1fr;
228
+ }
229
+ }
230
+
231
+ .bc-stat-card {
232
+ background: rgba(255, 255, 255, 0.05);
233
+ backdrop-filter: blur(4px);
234
+ padding: 0.75rem;
235
+ border-radius: 0.375rem;
236
+ border: 1px solid rgba(255, 255, 255, 0.1);
237
+ }
238
+
239
+ .bc-stat-label {
240
+ display: block;
241
+ font-size: 0.625rem;
242
+ opacity: 0.5;
243
+ text-transform: uppercase;
244
+ letter-spacing: 0.05em;
245
+ margin-bottom: 0.25rem;
246
+ }
247
+
248
+ .bc-stat-value {
249
+ font-size: 1.125rem;
250
+ font-weight: 700;
251
+ color: #fff;
252
+ }
253
+
254
+ .bc-visualizer {
255
+ width: 100%;
256
+ height: 12rem;
257
+ border: 1px dashed rgba(255, 255, 255, 0.3);
258
+ border-radius: 0.375rem;
259
+ background: rgba(23, 37, 84, 0.5);
260
+ overflow: hidden;
261
+ position: relative;
262
+ }
263
+
264
+ @media (min-width: 768px) {
265
+ .bc-visualizer {
266
+ height: 16rem;
267
+ }
268
+ }
269
+
270
+ .bc-svg {
271
+ width: 100%;
272
+ height: 100%;
273
+ }
274
+
275
+ .bc-disclaimer {
276
+ text-align: center;
277
+ font-size: 0.75rem;
278
+ opacity: 0.4;
279
+ margin-top: 1rem;
280
+ margin-bottom: 0;
281
+ }
282
+
283
+ :global(.theme-dark) .bc-input-panel {
284
+ background: #18181b;
285
+ border-color: rgba(51, 65, 85, 0.4);
286
+ }
287
+
288
+ :global(.theme-dark) .bc-panel-icon {
289
+ background: rgba(30, 58, 138, 0.3);
290
+ }
291
+
292
+ :global(.theme-dark) .bc-panel-title {
293
+ color: #f1f5f9;
294
+ }
295
+
296
+ :global(.theme-dark) .bc-label {
297
+ color: #94a3b8;
298
+ }
299
+
300
+ :global(.theme-dark) .bc-input {
301
+ background: #27272a;
302
+ color: #f1f5f9;
303
+ }
304
+
305
+ :global(.theme-dark) .bc-input:focus {
306
+ border-color: #3b82f6;
307
+ }
308
+
309
+ :global(.theme-dark) .bc-unit-toggle {
310
+ background: #27272a;
311
+ }
312
+
313
+ :global(.theme-dark) [data-bc-unit][data-bc-active='true'] {
314
+ background: #3f3f46;
315
+ color: #f1f5f9;
316
+ }
317
+
318
+ :global(.theme-dark) .bc-blueprint {
319
+ background: #0f172a;
320
+ }