@bitcaster/printkit 0.0.0-stage → 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 (56) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +8 -2
  3. package/README.npm.md +9 -0
  4. package/THIRD_PARTY_NOTICES.md +1973 -0
  5. package/dist/assets/fonts/C400.ttf +0 -0
  6. package/dist/assets/fonts/M400.ttf +0 -0
  7. package/dist/assets/fonts/M600.ttf +0 -0
  8. package/dist/assets/fonts/M700.ttf +0 -0
  9. package/dist/assets/fonts/OFL-IBMPlexMono.txt +93 -0
  10. package/dist/assets/fonts/OFL-LibreCaslonText.txt +93 -0
  11. package/dist/assets/fonts/OFL-Manrope.txt +93 -0
  12. package/dist/assets/fonts/P400.ttf +0 -0
  13. package/dist/assets/fonts/P500.ttf +0 -0
  14. package/dist/assets/pdf.worker.min.mjs +29 -0
  15. package/dist/components/index.d.ts +42 -0
  16. package/dist/components/index.js +1 -0
  17. package/dist/components/p-6By_vSL9.js +1 -0
  18. package/dist/components/p-B85ddf5i.js +58 -0
  19. package/dist/components/p-BEuF_WyR.js +15 -0
  20. package/dist/components/p-C06-VTon.js +1 -0
  21. package/dist/components/p-C5up7ejY.js +22 -0
  22. package/dist/components/p-ChB3W-Ln.js +3 -0
  23. package/dist/components/p-DpEO5JlK.js +2 -0
  24. package/dist/components/p-DzTdZECU.js +21 -0
  25. package/dist/components/pk-editor.d.ts +11 -0
  26. package/dist/components/pk-editor.js +277 -0
  27. package/dist/components/pk-help.d.ts +11 -0
  28. package/dist/components/pk-help.js +1 -0
  29. package/dist/components/pk-template-editor.d.ts +11 -0
  30. package/dist/components/pk-template-editor.js +1 -0
  31. package/dist/types/.stencil/components/pk-editor/pk-editor.d.ts +113 -0
  32. package/dist/types/.stencil/components/pk-help/help.content.d.ts +1 -0
  33. package/dist/types/.stencil/components/pk-help/pk-help.d.ts +9 -0
  34. package/dist/types/.stencil/components/pk-template-editor/pk-template-editor.d.ts +203 -0
  35. package/dist/types/.stencil/services/background-load.d.ts +20 -0
  36. package/dist/types/.stencil/services/background.d.ts +70 -0
  37. package/dist/types/.stencil/services/card-engine.d.ts +123 -0
  38. package/dist/types/.stencil/services/card-render.d.ts +5 -0
  39. package/dist/types/.stencil/services/card.config.d.ts +48 -0
  40. package/dist/types/.stencil/services/cmyk-lut.d.ts +4 -0
  41. package/dist/types/.stencil/services/collide.d.ts +19 -0
  42. package/dist/types/.stencil/services/color.d.ts +12 -0
  43. package/dist/types/.stencil/services/design.d.ts +106 -0
  44. package/dist/types/.stencil/services/fonts.d.ts +32 -0
  45. package/dist/types/.stencil/services/layouts.d.ts +15 -0
  46. package/dist/types/.stencil/services/logo.d.ts +19 -0
  47. package/dist/types/.stencil/services/palette.d.ts +31 -0
  48. package/dist/types/.stencil/services/pdf.d.ts +26 -0
  49. package/dist/types/.stencil/services/qr.d.ts +21 -0
  50. package/dist/types/.stencil/services/spot.d.ts +49 -0
  51. package/dist/types/.stencil/services/terms.d.ts +1 -0
  52. package/dist/types/.stencil/types/card.types.d.ts +403 -0
  53. package/dist/types/.stencil/types/editor.types.d.ts +48 -0
  54. package/dist/types/components.d.ts +320 -0
  55. package/dist/types/stencil-public-runtime.d.ts +1879 -0
  56. package/package.json +46 -4
@@ -0,0 +1,320 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { CardData, FieldOverride, Template } from "./print/types/card.types";
9
+ import { PdfDetail, Validity } from "./print/types/editor.types";
10
+ export { CardData, FieldOverride, Template } from "./print/types/card.types";
11
+ export { PdfDetail, Validity } from "./print/types/editor.types";
12
+ export namespace Components {
13
+ /**
14
+ * Business card editor: all fields at once next to a live card preview, direct typing on the card,
15
+ * print-ready CMYK PDF. Shadow DOM shields it from page styles; the caret logic in card-render.ts handles the shadow root.
16
+ */
17
+ interface PkEditor {
18
+ /**
19
+ * UI color scheme
20
+ * @default 'auto'
21
+ */
22
+ "appearance": 'auto' | 'light' | 'dark';
23
+ /**
24
+ * Ask the customer to confirm the data („Daten geprüft“) before the PDF; edits clear the confirmation
25
+ * @default false
26
+ */
27
+ "confirm": boolean;
28
+ /**
29
+ * Build the PDF; downloads it when `download` is set and emits pkPdf. Rejects while the data has errors.
30
+ */
31
+ "createPdf": () => Promise<PdfDetail>;
32
+ /**
33
+ * Trigger a browser download after the PDF is created
34
+ * @default true
35
+ */
36
+ "download": boolean;
37
+ /**
38
+ * Field overrides and custom fields, merged after template.fields
39
+ */
40
+ "fields"?: FieldOverride[] | string;
41
+ /**
42
+ * Base URL of the font files, ending with a slash. Default: the component's assets folder
43
+ */
44
+ "fontBase"?: string;
45
+ /**
46
+ * Current card data (defaults, locked values and edits merged)
47
+ */
48
+ "getData": () => Promise<CardData>;
49
+ /**
50
+ * Discard all edits
51
+ */
52
+ "reset": () => Promise<void>;
53
+ /**
54
+ * Mark every field with an error, as a click on the built-in PDF button does. For shops that hide that button and lock their own with validate()/pkValidity: errors of fields the customer never left show only after this.
55
+ */
56
+ "showErrors": () => Promise<Validity>;
57
+ /**
58
+ * Show the technical PDF details (final format, bleed, crop marks, color) under the issues; meant for internal use
59
+ * @default false
60
+ */
61
+ "showSpec": boolean;
62
+ /**
63
+ * Persist the draft in localStorage under this key (off when empty)
64
+ */
65
+ "storageKey"?: string;
66
+ /**
67
+ * Template as object or JSON string (same format as the template export of the original editor)
68
+ */
69
+ "template"?: Template | string;
70
+ /**
71
+ * Issues of the current data; valid is false while any issue of level error exists
72
+ */
73
+ "validate": () => Promise<Validity>;
74
+ /**
75
+ * Prefill data (object or JSON string); edits are reported via pkChange
76
+ */
77
+ "value"?: CardData | string;
78
+ }
79
+ /**
80
+ * German guide for designing templates; used inside the template editor and as a standalone page
81
+ */
82
+ interface PkHelp {
83
+ /**
84
+ * Color scheme
85
+ * @default 'auto'
86
+ */
87
+ "appearance": 'auto' | 'light' | 'dark';
88
+ }
89
+ /**
90
+ * Template editor for internal use: move text blocks, logo, QR code and decoration on the card, set the base options
91
+ * and configure fields. Emits the template JSON that <pk-editor> takes as `template`.
92
+ */
93
+ interface PkTemplateEditor {
94
+ /**
95
+ * UI color scheme
96
+ * @default 'auto'
97
+ */
98
+ "appearance": 'auto' | 'light' | 'dark';
99
+ /**
100
+ * Base URL of the font files, ending with a slash. Default: the component's assets folder
101
+ */
102
+ "fontBase"?: string;
103
+ /**
104
+ * The current template (same format as the `template` prop of pk-editor)
105
+ */
106
+ "getTemplate": () => Promise<Template>;
107
+ /**
108
+ * Template to start from, as object or JSON string. Without a design the preset named in `layout` is used.
109
+ */
110
+ "template"?: Template | string;
111
+ }
112
+ }
113
+ export interface PkEditorCustomEvent<T> extends CustomEvent<T> {
114
+ detail: T;
115
+ target: HTMLPkEditorElement;
116
+ }
117
+ export interface PkTemplateEditorCustomEvent<T> extends CustomEvent<T> {
118
+ detail: T;
119
+ target: HTMLPkTemplateEditorElement;
120
+ }
121
+ declare global {
122
+ interface HTMLPkEditorElementEventMap {
123
+ "pkChange": CardData;
124
+ "pkPdf": PdfDetail;
125
+ "pkValidity": Validity;
126
+ }
127
+ /**
128
+ * Business card editor: all fields at once next to a live card preview, direct typing on the card,
129
+ * print-ready CMYK PDF. Shadow DOM shields it from page styles; the caret logic in card-render.ts handles the shadow root.
130
+ */
131
+ interface HTMLPkEditorElement extends Components.PkEditor, HTMLStencilElement {
132
+ addEventListener<K extends keyof HTMLPkEditorElementEventMap>(type: K, listener: (this: HTMLPkEditorElement, ev: PkEditorCustomEvent<HTMLPkEditorElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
133
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
134
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
135
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
136
+ removeEventListener<K extends keyof HTMLPkEditorElementEventMap>(type: K, listener: (this: HTMLPkEditorElement, ev: PkEditorCustomEvent<HTMLPkEditorElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
137
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
138
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
139
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
140
+ }
141
+ var HTMLPkEditorElement: {
142
+ prototype: HTMLPkEditorElement;
143
+ new (): HTMLPkEditorElement;
144
+ };
145
+ /**
146
+ * German guide for designing templates; used inside the template editor and as a standalone page
147
+ */
148
+ interface HTMLPkHelpElement extends Components.PkHelp, HTMLStencilElement {
149
+ }
150
+ var HTMLPkHelpElement: {
151
+ prototype: HTMLPkHelpElement;
152
+ new (): HTMLPkHelpElement;
153
+ };
154
+ interface HTMLPkTemplateEditorElementEventMap {
155
+ "pkTemplateChange": Template;
156
+ }
157
+ /**
158
+ * Template editor for internal use: move text blocks, logo, QR code and decoration on the card, set the base options
159
+ * and configure fields. Emits the template JSON that <pk-editor> takes as `template`.
160
+ */
161
+ interface HTMLPkTemplateEditorElement extends Components.PkTemplateEditor, HTMLStencilElement {
162
+ addEventListener<K extends keyof HTMLPkTemplateEditorElementEventMap>(type: K, listener: (this: HTMLPkTemplateEditorElement, ev: PkTemplateEditorCustomEvent<HTMLPkTemplateEditorElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
163
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
164
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
165
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
166
+ removeEventListener<K extends keyof HTMLPkTemplateEditorElementEventMap>(type: K, listener: (this: HTMLPkTemplateEditorElement, ev: PkTemplateEditorCustomEvent<HTMLPkTemplateEditorElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
167
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
168
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
169
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
170
+ }
171
+ var HTMLPkTemplateEditorElement: {
172
+ prototype: HTMLPkTemplateEditorElement;
173
+ new (): HTMLPkTemplateEditorElement;
174
+ };
175
+ interface HTMLElementTagNameMap {
176
+ "pk-editor": HTMLPkEditorElement;
177
+ "pk-help": HTMLPkHelpElement;
178
+ "pk-template-editor": HTMLPkTemplateEditorElement;
179
+ }
180
+ }
181
+ declare namespace LocalJSX {
182
+ /**
183
+ * Business card editor: all fields at once next to a live card preview, direct typing on the card,
184
+ * print-ready CMYK PDF. Shadow DOM shields it from page styles; the caret logic in card-render.ts handles the shadow root.
185
+ */
186
+ interface PkEditor {
187
+ /**
188
+ * UI color scheme
189
+ * @default 'auto'
190
+ */
191
+ "appearance"?: 'auto' | 'light' | 'dark';
192
+ /**
193
+ * Ask the customer to confirm the data („Daten geprüft“) before the PDF; edits clear the confirmation
194
+ * @default false
195
+ */
196
+ "confirm"?: boolean;
197
+ /**
198
+ * Trigger a browser download after the PDF is created
199
+ * @default true
200
+ */
201
+ "download"?: boolean;
202
+ /**
203
+ * Field overrides and custom fields, merged after template.fields
204
+ */
205
+ "fields"?: FieldOverride[] | string;
206
+ /**
207
+ * Base URL of the font files, ending with a slash. Default: the component's assets folder
208
+ */
209
+ "fontBase"?: string;
210
+ /**
211
+ * Fires on every edit with the complete card data
212
+ */
213
+ "onPkChange"?: (event: PkEditorCustomEvent<CardData>) => void;
214
+ /**
215
+ * Fires after the PDF has been created
216
+ */
217
+ "onPkPdf"?: (event: PkEditorCustomEvent<PdfDetail>) => void;
218
+ /**
219
+ * Fires when the issues change; the host locks its own order button while valid is false
220
+ */
221
+ "onPkValidity"?: (event: PkEditorCustomEvent<Validity>) => void;
222
+ /**
223
+ * Show the technical PDF details (final format, bleed, crop marks, color) under the issues; meant for internal use
224
+ * @default false
225
+ */
226
+ "showSpec"?: boolean;
227
+ /**
228
+ * Persist the draft in localStorage under this key (off when empty)
229
+ */
230
+ "storageKey"?: string;
231
+ /**
232
+ * Template as object or JSON string (same format as the template export of the original editor)
233
+ */
234
+ "template"?: Template | string;
235
+ /**
236
+ * Prefill data (object or JSON string); edits are reported via pkChange
237
+ */
238
+ "value"?: CardData | string;
239
+ }
240
+ /**
241
+ * German guide for designing templates; used inside the template editor and as a standalone page
242
+ */
243
+ interface PkHelp {
244
+ /**
245
+ * Color scheme
246
+ * @default 'auto'
247
+ */
248
+ "appearance"?: 'auto' | 'light' | 'dark';
249
+ }
250
+ /**
251
+ * Template editor for internal use: move text blocks, logo, QR code and decoration on the card, set the base options
252
+ * and configure fields. Emits the template JSON that <pk-editor> takes as `template`.
253
+ */
254
+ interface PkTemplateEditor {
255
+ /**
256
+ * UI color scheme
257
+ * @default 'auto'
258
+ */
259
+ "appearance"?: 'auto' | 'light' | 'dark';
260
+ /**
261
+ * Base URL of the font files, ending with a slash. Default: the component's assets folder
262
+ */
263
+ "fontBase"?: string;
264
+ /**
265
+ * Fires after every change with the complete template
266
+ */
267
+ "onPkTemplateChange"?: (event: PkTemplateEditorCustomEvent<Template>) => void;
268
+ /**
269
+ * Template to start from, as object or JSON string. Without a design the preset named in `layout` is used.
270
+ */
271
+ "template"?: Template | string;
272
+ }
273
+
274
+ interface PkEditorAttributes {
275
+ "template": Template | string;
276
+ "fields": FieldOverride[] | string;
277
+ "value": CardData | string;
278
+ "storageKey": string;
279
+ "fontBase": string;
280
+ "download": boolean;
281
+ "confirm": boolean;
282
+ "showSpec": boolean;
283
+ "appearance": 'auto' | 'light' | 'dark';
284
+ }
285
+ interface PkHelpAttributes {
286
+ "appearance": 'auto' | 'light' | 'dark';
287
+ }
288
+ interface PkTemplateEditorAttributes {
289
+ "template": Template | string;
290
+ "fontBase": string;
291
+ "appearance": 'auto' | 'light' | 'dark';
292
+ }
293
+
294
+ interface IntrinsicElements {
295
+ "pk-editor": Omit<PkEditor, keyof PkEditorAttributes> & { [K in keyof PkEditor & keyof PkEditorAttributes]?: PkEditor[K] } & { [K in keyof PkEditor & keyof PkEditorAttributes as `attr:${K}`]?: PkEditorAttributes[K] } & { [K in keyof PkEditor & keyof PkEditorAttributes as `prop:${K}`]?: PkEditor[K] };
296
+ "pk-help": Omit<PkHelp, keyof PkHelpAttributes> & { [K in keyof PkHelp & keyof PkHelpAttributes]?: PkHelp[K] } & { [K in keyof PkHelp & keyof PkHelpAttributes as `attr:${K}`]?: PkHelpAttributes[K] } & { [K in keyof PkHelp & keyof PkHelpAttributes as `prop:${K}`]?: PkHelp[K] };
297
+ "pk-template-editor": Omit<PkTemplateEditor, keyof PkTemplateEditorAttributes> & { [K in keyof PkTemplateEditor & keyof PkTemplateEditorAttributes]?: PkTemplateEditor[K] } & { [K in keyof PkTemplateEditor & keyof PkTemplateEditorAttributes as `attr:${K}`]?: PkTemplateEditorAttributes[K] } & { [K in keyof PkTemplateEditor & keyof PkTemplateEditorAttributes as `prop:${K}`]?: PkTemplateEditor[K] };
298
+ }
299
+ }
300
+ export { LocalJSX as JSX };
301
+ declare module "@stencil/core" {
302
+ export namespace JSX {
303
+ interface IntrinsicElements {
304
+ /**
305
+ * Business card editor: all fields at once next to a live card preview, direct typing on the card,
306
+ * print-ready CMYK PDF. Shadow DOM shields it from page styles; the caret logic in card-render.ts handles the shadow root.
307
+ */
308
+ "pk-editor": LocalJSX.IntrinsicElements["pk-editor"] & JSXBase.HTMLAttributes<HTMLPkEditorElement>;
309
+ /**
310
+ * German guide for designing templates; used inside the template editor and as a standalone page
311
+ */
312
+ "pk-help": LocalJSX.IntrinsicElements["pk-help"] & JSXBase.HTMLAttributes<HTMLPkHelpElement>;
313
+ /**
314
+ * Template editor for internal use: move text blocks, logo, QR code and decoration on the card, set the base options
315
+ * and configure fields. Emits the template JSON that <pk-editor> takes as `template`.
316
+ */
317
+ "pk-template-editor": LocalJSX.IntrinsicElements["pk-template-editor"] & JSXBase.HTMLAttributes<HTMLPkTemplateEditorElement>;
318
+ }
319
+ }
320
+ }