web-to-print 0.1.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 (92) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  3. package/dist/cjs/canvas-helpers-A6rp5rPD.js +765 -0
  4. package/dist/cjs/index-IFGFRm-i.js +1649 -0
  5. package/dist/cjs/index.cjs.js +232 -0
  6. package/dist/cjs/loader.cjs.js +13 -0
  7. package/dist/cjs/logo-BUX-b45R.js +18 -0
  8. package/dist/cjs/web-to-print.cjs.js +25 -0
  9. package/dist/cjs/wtp-editor_2.cjs.entry.js +12386 -0
  10. package/dist/cjs/wtp-logo-renderer.cjs.entry.js +353 -0
  11. package/dist/cjs/wtp-print-area-editor.cjs.entry.js +431 -0
  12. package/dist/collection/collection-manifest.json +16 -0
  13. package/dist/collection/components/wtp-editor/wtp-editor.css +124 -0
  14. package/dist/collection/components/wtp-editor/wtp-editor.js +1114 -0
  15. package/dist/collection/components/wtp-logo-renderer/wtp-logo-renderer.css +30 -0
  16. package/dist/collection/components/wtp-logo-renderer/wtp-logo-renderer.js +455 -0
  17. package/dist/collection/components/wtp-logo-upload/wtp-logo-upload.css +428 -0
  18. package/dist/collection/components/wtp-logo-upload/wtp-logo-upload.js +573 -0
  19. package/dist/collection/components/wtp-print-area-editor/wtp-print-area-editor.css +20 -0
  20. package/dist/collection/components/wtp-print-area-editor/wtp-print-area-editor.js +600 -0
  21. package/dist/collection/examples/schaeffler--big.svg +1 -0
  22. package/dist/collection/index.js +8 -0
  23. package/dist/collection/types/editor.js +1 -0
  24. package/dist/collection/types/index.js +2 -0
  25. package/dist/collection/types/labels.js +30 -0
  26. package/dist/collection/types/logo.js +13 -0
  27. package/dist/collection/utils/background-removal.js +717 -0
  28. package/dist/collection/utils/canvas-helpers.js +380 -0
  29. package/dist/collection/utils/format-detection.js +48 -0
  30. package/dist/collection/utils/html-render-helpers.js +106 -0
  31. package/dist/collection/utils/image-preview.js +54 -0
  32. package/dist/collection/utils/logo-validation.js +141 -0
  33. package/dist/collection/utils/pdf-export.js +224 -0
  34. package/dist/components/index.d.ts +35 -0
  35. package/dist/components/index.js +1 -0
  36. package/dist/components/p-5qCsRzlt.js +1 -0
  37. package/dist/components/p-Bn9gR_8e.js +1 -0
  38. package/dist/components/p-D8pVJRuX.js +1 -0
  39. package/dist/components/wtp-editor.d.ts +11 -0
  40. package/dist/components/wtp-editor.js +1 -0
  41. package/dist/components/wtp-logo-renderer.d.ts +11 -0
  42. package/dist/components/wtp-logo-renderer.js +1 -0
  43. package/dist/components/wtp-logo-upload.d.ts +11 -0
  44. package/dist/components/wtp-logo-upload.js +1 -0
  45. package/dist/components/wtp-print-area-editor.d.ts +11 -0
  46. package/dist/components/wtp-print-area-editor.js +1 -0
  47. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  48. package/dist/esm/canvas-helpers-CK8OAq2J.js +748 -0
  49. package/dist/esm/index-CUetmLbL.js +1641 -0
  50. package/dist/esm/index.js +228 -0
  51. package/dist/esm/loader.js +11 -0
  52. package/dist/esm/logo-D8pVJRuX.js +15 -0
  53. package/dist/esm/web-to-print.js +21 -0
  54. package/dist/esm/wtp-editor_2.entry.js +12383 -0
  55. package/dist/esm/wtp-logo-renderer.entry.js +351 -0
  56. package/dist/esm/wtp-print-area-editor.entry.js +429 -0
  57. package/dist/index.cjs.js +1 -0
  58. package/dist/index.js +1 -0
  59. package/dist/types/components/wtp-editor/wtp-editor.d.ts +101 -0
  60. package/dist/types/components/wtp-logo-renderer/wtp-logo-renderer.d.ts +55 -0
  61. package/dist/types/components/wtp-logo-upload/wtp-logo-upload.d.ts +76 -0
  62. package/dist/types/components/wtp-print-area-editor/wtp-print-area-editor.d.ts +43 -0
  63. package/dist/types/components.d.ts +507 -0
  64. package/dist/types/index.d.ts +11 -0
  65. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  66. package/dist/types/types/editor.d.ts +79 -0
  67. package/dist/types/types/index.d.ts +5 -0
  68. package/dist/types/types/labels.d.ts +30 -0
  69. package/dist/types/types/logo.d.ts +47 -0
  70. package/dist/types/utils/background-removal.d.ts +95 -0
  71. package/dist/types/utils/canvas-helpers.d.ts +60 -0
  72. package/dist/types/utils/format-detection.d.ts +4 -0
  73. package/dist/types/utils/html-render-helpers.d.ts +44 -0
  74. package/dist/types/utils/image-preview.d.ts +13 -0
  75. package/dist/types/utils/logo-validation.d.ts +2 -0
  76. package/dist/types/utils/pdf-export.d.ts +32 -0
  77. package/dist/web-to-print/index.esm.js +1 -0
  78. package/dist/web-to-print/p-611ec561.entry.js +1 -0
  79. package/dist/web-to-print/p-703e4c52.entry.js +1 -0
  80. package/dist/web-to-print/p-CK8OAq2J.js +1 -0
  81. package/dist/web-to-print/p-CUetmLbL.js +2 -0
  82. package/dist/web-to-print/p-D8pVJRuX.js +1 -0
  83. package/dist/web-to-print/p-DQuL1Twl.js +1 -0
  84. package/dist/web-to-print/p-b532777b.entry.js +1 -0
  85. package/dist/web-to-print/web-to-print.esm.js +1 -0
  86. package/loader/cdn.js +1 -0
  87. package/loader/index.cjs.js +1 -0
  88. package/loader/index.d.ts +24 -0
  89. package/loader/index.es2017.js +1 -0
  90. package/loader/index.js +2 -0
  91. package/package.json +68 -0
  92. package/readme.md +490 -0
@@ -0,0 +1,428 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :host {
8
+ font-family: var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
9
+ color: var(--wtp-color-text, #1e293b);
10
+ line-height: 1.5;
11
+ }
12
+
13
+ .wtp-logo-upload {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 16px;
17
+ width: 100%;
18
+ }
19
+
20
+ .url-input-section {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: 4px;
24
+ }
25
+
26
+ .url-input-wrapper {
27
+ display: flex;
28
+ gap: 8px;
29
+ }
30
+
31
+ .url-input {
32
+ flex: 1;
33
+ padding: 8px 16px;
34
+ font-family: var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
35
+ font-size: 14px;
36
+ border: 1px solid var(--wtp-color-border, #e2e8f0);
37
+ border-radius: 8px;
38
+ background: var(--wtp-color-bg, #ffffff);
39
+ color: var(--wtp-color-text, #1e293b);
40
+ transition-property: border-color;
41
+ transition-duration: 250ms;
42
+ transition-timing-function: ease;
43
+ }
44
+ .url-input::placeholder {
45
+ color: var(--wtp-color-text-muted, #64748b);
46
+ }
47
+ .url-input:focus {
48
+ outline: none;
49
+ border-color: var(--wtp-color-primary, #2563eb);
50
+ }
51
+ .url-input:disabled {
52
+ opacity: 0.5;
53
+ cursor: not-allowed;
54
+ }
55
+
56
+ .url-submit-btn {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ gap: 8px;
60
+ padding: 8px 16px;
61
+ font-family: var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
62
+ font-size: 14px;
63
+ font-weight: 500;
64
+ border-radius: 8px;
65
+ border: 1px solid var(--wtp-color-border, #e2e8f0);
66
+ background: var(--wtp-color-bg, #ffffff);
67
+ color: var(--wtp-color-text, #1e293b);
68
+ cursor: pointer;
69
+ transition-property: all;
70
+ transition-duration: 250ms;
71
+ transition-timing-function: ease;
72
+ }
73
+ .url-submit-btn:hover {
74
+ background: var(--wtp-color-bg-muted, #f8fafc);
75
+ }
76
+ .url-submit-btn:focus-visible {
77
+ outline: 2px solid var(--wtp-color-primary, #2563eb);
78
+ outline-offset: 2px;
79
+ }
80
+ .url-submit-btn:disabled {
81
+ opacity: 0.5;
82
+ cursor: not-allowed;
83
+ }
84
+ .url-submit-btn {
85
+ background: var(--wtp-color-primary, #2563eb);
86
+ color: var(--wtp-color-bg, #ffffff);
87
+ border-color: var(--wtp-color-primary, #2563eb);
88
+ min-width: 72px;
89
+ justify-content: center;
90
+ }
91
+ .url-submit-btn:hover:not(:disabled) {
92
+ background: var(--wtp-color-primary-hover, #1d4ed8);
93
+ border-color: var(--wtp-color-primary-hover, #1d4ed8);
94
+ }
95
+ .url-submit-btn:disabled {
96
+ opacity: 0.5;
97
+ cursor: not-allowed;
98
+ }
99
+
100
+ .url-error {
101
+ margin: 0;
102
+ font-size: 12px;
103
+ color: var(--wtp-color-error, #dc2626);
104
+ }
105
+
106
+ .divider {
107
+ display: flex;
108
+ align-items: center;
109
+ gap: 16px;
110
+ }
111
+ .divider::before, .divider::after {
112
+ content: "";
113
+ flex: 1;
114
+ height: 1px;
115
+ background: var(--wtp-color-border, #e2e8f0);
116
+ }
117
+
118
+ .divider-text {
119
+ font-size: 14px;
120
+ color: var(--wtp-color-text-muted, #64748b);
121
+ text-transform: lowercase;
122
+ }
123
+
124
+ .upload-zone {
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ position: relative;
129
+ min-height: 160px;
130
+ padding: 32px;
131
+ border: 2px dashed var(--wtp-color-border, #e2e8f0);
132
+ border-radius: 12px;
133
+ background: var(--wtp-color-bg-muted, #f8fafc);
134
+ cursor: pointer;
135
+ transition-property: border-color background-color;
136
+ transition-duration: 250ms;
137
+ transition-timing-function: ease;
138
+ }
139
+ .upload-zone:hover {
140
+ border-color: var(--wtp-color-primary, #2563eb);
141
+ background: var(--wtp-color-primary-light, #dbeafe);
142
+ }
143
+ .upload-zone:focus-visible {
144
+ outline: 2px solid var(--wtp-color-primary, #2563eb);
145
+ outline-offset: 2px;
146
+ }
147
+ .upload-zone.drag-over {
148
+ border-color: var(--wtp-color-primary, #2563eb);
149
+ background: var(--wtp-color-primary-light, #dbeafe);
150
+ border-style: solid;
151
+ }
152
+ .upload-zone.disabled {
153
+ opacity: 0.5;
154
+ cursor: not-allowed;
155
+ pointer-events: none;
156
+ }
157
+
158
+ .file-input {
159
+ position: absolute;
160
+ width: 0;
161
+ height: 0;
162
+ opacity: 0;
163
+ overflow: hidden;
164
+ }
165
+
166
+ .default-prompt {
167
+ display: flex;
168
+ flex-direction: column;
169
+ align-items: center;
170
+ gap: 8px;
171
+ text-align: center;
172
+ }
173
+
174
+ .upload-icon {
175
+ width: 40px;
176
+ height: 40px;
177
+ color: var(--wtp-color-secondary, #64748b);
178
+ }
179
+
180
+ .prompt-text {
181
+ margin: 0;
182
+ font-size: 16px;
183
+ font-weight: 500;
184
+ color: var(--wtp-color-text, #1e293b);
185
+ }
186
+
187
+ .prompt-hint {
188
+ margin: 0;
189
+ font-size: 14px;
190
+ color: var(--wtp-color-text-muted, #64748b);
191
+ }
192
+
193
+ .processing-overlay {
194
+ display: flex;
195
+ align-items: center;
196
+ justify-content: center;
197
+ position: absolute;
198
+ inset: 0;
199
+ background: rgba(255, 255, 255, 0.8);
200
+ border-radius: 12px;
201
+ }
202
+
203
+ .spinner {
204
+ display: block;
205
+ width: 32px;
206
+ height: 32px;
207
+ border: 3px solid var(--wtp-color-border, #e2e8f0);
208
+ border-top-color: var(--wtp-color-primary, #2563eb);
209
+ border-radius: 50%;
210
+ animation: wtp-spin 0.8s linear infinite;
211
+ }
212
+
213
+ .spinner-sm {
214
+ display: inline-block;
215
+ width: 16px;
216
+ height: 16px;
217
+ border: 2px solid var(--wtp-color-border, #e2e8f0);
218
+ border-top-color: var(--wtp-color-primary, #2563eb);
219
+ border-radius: 50%;
220
+ animation: wtp-spin 0.8s linear infinite;
221
+ }
222
+
223
+ @keyframes wtp-spin {
224
+ to {
225
+ transform: rotate(360deg);
226
+ }
227
+ }
228
+ .rejections {
229
+ display: flex;
230
+ flex-direction: column;
231
+ gap: 8px;
232
+ }
233
+
234
+ .rejection-item {
235
+ padding: 8px 16px;
236
+ border-radius: 8px;
237
+ background: var(--wtp-color-error-light, #fee2e2);
238
+ font-size: 14px;
239
+ }
240
+ .rejection-item strong {
241
+ color: var(--wtp-color-error, #dc2626);
242
+ }
243
+ .rejection-item ul {
244
+ margin: 4px 0 0;
245
+ padding-left: 24px;
246
+ }
247
+ .rejection-item .error {
248
+ color: var(--wtp-color-error, #dc2626);
249
+ }
250
+ .rejection-item .warning {
251
+ color: var(--wtp-color-warning, #d97706);
252
+ }
253
+
254
+ .pending-choices {
255
+ display: flex;
256
+ flex-direction: column;
257
+ gap: 16px;
258
+ }
259
+
260
+ .choice-card {
261
+ border: 1px solid var(--wtp-color-border, #e2e8f0);
262
+ border-radius: 12px;
263
+ padding: 16px;
264
+ background: var(--wtp-color-bg, #ffffff);
265
+ }
266
+
267
+ .choice-title {
268
+ margin: 0 0 8px;
269
+ font-size: 14px;
270
+ font-weight: 500;
271
+ color: var(--wtp-color-text, #1e293b);
272
+ overflow: hidden;
273
+ text-overflow: ellipsis;
274
+ white-space: nowrap;
275
+ }
276
+
277
+ .choice-options {
278
+ display: grid;
279
+ grid-template-columns: 1fr 1fr;
280
+ gap: 16px;
281
+ }
282
+
283
+ .choice-option {
284
+ display: flex;
285
+ flex-direction: column;
286
+ align-items: center;
287
+ gap: 8px;
288
+ padding: 8px;
289
+ border: 2px solid var(--wtp-color-border, #e2e8f0);
290
+ border-radius: 8px;
291
+ background: var(--wtp-color-bg, #ffffff);
292
+ cursor: pointer;
293
+ transition-property: border-color;
294
+ transition-duration: 250ms;
295
+ transition-timing-function: ease;
296
+ }
297
+ .choice-option:hover:not(:disabled) {
298
+ border-color: var(--wtp-color-primary, #2563eb);
299
+ }
300
+ .choice-option:focus-visible {
301
+ outline: 2px solid var(--wtp-color-primary, #2563eb);
302
+ outline-offset: 2px;
303
+ }
304
+ .choice-option--disabled {
305
+ opacity: 0.7;
306
+ cursor: wait;
307
+ }
308
+
309
+ .choice-image {
310
+ width: 100%;
311
+ height: 120px;
312
+ object-fit: contain;
313
+ border-radius: 4px;
314
+ }
315
+ .choice-image--transparent {
316
+ background: repeating-conic-gradient(#e2e8f0 0% 25%, #fff 0% 50%) 50%/12px 12px;
317
+ }
318
+ .choice-image--loading {
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: center;
322
+ flex-direction: column;
323
+ gap: 4px;
324
+ background: var(--wtp-color-bg-muted, #f8fafc);
325
+ }
326
+ .choice-image--error {
327
+ display: flex;
328
+ align-items: center;
329
+ justify-content: center;
330
+ background: var(--wtp-color-error-light, #fee2e2);
331
+ padding: 8px;
332
+ }
333
+
334
+ .choice-loading-text {
335
+ font-size: 12px;
336
+ color: var(--wtp-color-text-muted, #64748b);
337
+ }
338
+
339
+ .choice-error-text {
340
+ font-size: 12px;
341
+ color: var(--wtp-color-error, #dc2626);
342
+ text-align: center;
343
+ }
344
+
345
+ .choice-label {
346
+ font-size: 14px;
347
+ font-weight: 500;
348
+ color: var(--wtp-color-text, #1e293b);
349
+ }
350
+
351
+ .previews {
352
+ display: grid;
353
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
354
+ gap: 16px;
355
+ }
356
+
357
+ .preview-item {
358
+ display: flex;
359
+ flex-direction: column;
360
+ position: relative;
361
+ border: 2px solid var(--wtp-color-border, #e2e8f0);
362
+ border-radius: 8px;
363
+ overflow: hidden;
364
+ background: var(--wtp-color-bg, #ffffff);
365
+ cursor: pointer;
366
+ transition-property: border-color box-shadow;
367
+ transition-duration: 250ms;
368
+ transition-timing-function: ease;
369
+ }
370
+ .preview-item:hover {
371
+ border-color: var(--wtp-color-secondary, #64748b);
372
+ }
373
+ .preview-item--selected {
374
+ border-color: var(--wtp-color-primary, #2563eb);
375
+ box-shadow: 0 0 0 2px var(--wtp-color-primary-fade, rgba(37, 99, 235, 0.2));
376
+ }
377
+
378
+ .preview-image {
379
+ width: 100%;
380
+ height: 100px;
381
+ object-fit: contain;
382
+ background: var(--wtp-color-bg-muted, #f8fafc);
383
+ padding: 8px;
384
+ }
385
+
386
+ .preview-info {
387
+ display: flex;
388
+ flex-direction: column;
389
+ padding: 8px;
390
+ gap: 2px;
391
+ font-size: 12px;
392
+ color: var(--wtp-color-text-muted, #64748b);
393
+ }
394
+
395
+ .preview-name {
396
+ font-weight: 500;
397
+ color: var(--wtp-color-text, #1e293b);
398
+ overflow: hidden;
399
+ text-overflow: ellipsis;
400
+ white-space: nowrap;
401
+ }
402
+
403
+ .remove-btn {
404
+ position: absolute;
405
+ top: 4px;
406
+ right: 4px;
407
+ display: flex;
408
+ align-items: center;
409
+ justify-content: center;
410
+ width: 24px;
411
+ height: 24px;
412
+ padding: 0;
413
+ border: none;
414
+ border-radius: 9999px;
415
+ background: rgba(0, 0, 0, 0.5);
416
+ color: white;
417
+ cursor: pointer;
418
+ transition-property: all;
419
+ transition-duration: 250ms;
420
+ transition-timing-function: ease;
421
+ }
422
+ .remove-btn:hover {
423
+ background: rgba(0, 0, 0, 0.7);
424
+ }
425
+ .remove-btn svg {
426
+ width: 14px;
427
+ height: 14px;
428
+ }