@magiclabs.ai/magicbook-client 0.2.1 → 0.3.3
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.
- package/README.md +16 -8
- package/data/design-options.d.ts +2 -0
- package/data/design-request.d.ts +10 -0
- package/data/galleon.d.ts +2 -0
- package/index.d.ts +4 -3
- package/magicbook-client.js +2054 -1832
- package/magicbook-client.umd.cjs +6 -6
- package/models/client.d.ts +2 -2
- package/models/design-request/design-options.d.ts +15 -0
- package/models/design-request/index.d.ts +49 -0
- package/package.json +11 -11
- package/data/nautilus.d.ts +0 -2
- package/models/design-request.d.ts +0 -34
- /package/models/{image.d.ts → design-request/image.d.ts} +0 -0
- /package/models/{nautilus.d.ts → galleon.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -26,9 +26,9 @@ const designRequest = await client.createDesignRequest({
|
|
|
26
26
|
title: 'Australia 2023',
|
|
27
27
|
occasion: 'travel',
|
|
28
28
|
style: '1234',
|
|
29
|
-
|
|
30
|
-
coverType: '
|
|
31
|
-
pageType: '
|
|
29
|
+
bookSize: '8x8',
|
|
30
|
+
coverType: 'hc',
|
|
31
|
+
pageType: 'sp'
|
|
32
32
|
})
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -39,11 +39,10 @@ const designRequest = await client.createDesignRequest()
|
|
|
39
39
|
designRequest.title = 'Australia 2023',
|
|
40
40
|
designRequest.occasion = 'travel',
|
|
41
41
|
designRequest.style = '1234',
|
|
42
|
-
designRequest.
|
|
43
|
-
designRequest.coverType = '
|
|
44
|
-
designRequest.pageType = '
|
|
42
|
+
designRequest.bookSize = '8x8',
|
|
43
|
+
designRequest.coverType = 'hc',
|
|
44
|
+
designRequest.pageType = 'sp'
|
|
45
45
|
```
|
|
46
|
-
|
|
47
46
|
As images are getting ready to be handed over to Magicbook, for example when successfully uploaded, add them to the design request object.
|
|
48
47
|
|
|
49
48
|
```ts
|
|
@@ -57,11 +56,19 @@ This would typically be done in an event handler connected to the image manager.
|
|
|
57
56
|
|
|
58
57
|
```ts
|
|
59
58
|
window.addEventListener('ImageManager.ImageUploaded', async (item) => {
|
|
60
|
-
const image:
|
|
59
|
+
const image: DesignRequestImage = {...}
|
|
61
60
|
await designRequest.images.add(image)
|
|
62
61
|
})
|
|
63
62
|
```
|
|
64
63
|
|
|
64
|
+
Optionally, you can retrieve design options for the design request by calling the `getOptions` method, providing the total number of images selected by the user. The returned object contains the image densities (i.e. page count and image per page estimations)
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
const selectedImageCount = 200
|
|
68
|
+
...
|
|
69
|
+
const designOptions = designRequest.getOptions(selectedImageCount)
|
|
70
|
+
```
|
|
71
|
+
|
|
65
72
|
Before submitting the design request to Magicbook, register a callback to receive update events.
|
|
66
73
|
|
|
67
74
|
```ts
|
|
@@ -75,6 +82,7 @@ Submit the design request. Again, the argument object can receive additional or
|
|
|
75
82
|
```ts
|
|
76
83
|
designRequest.submit({
|
|
77
84
|
imageDensity: 'high',
|
|
85
|
+
imageFiltering: 'best',
|
|
78
86
|
embellishmentLevel: 'few',
|
|
79
87
|
textStickerLevel: 'none'
|
|
80
88
|
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const States: readonly ["new", "designing", "completed", "canceled", "error"];
|
|
2
|
+
export declare const Occasions: readonly ["baby", "birthday", "default", "everyday", "family", "kids", "life-stories", "none", "portfolio", "school-memories", "seasonal-holidays", "special-celebrations", "sports-and-hobbies", "travel", "wedding", "year-in-review"];
|
|
3
|
+
export declare const Styles: readonly ["2020-what-a-year-sfly", "a-year-in-color-sfly", "adventure-awaits-sfly", "autumn-memories-sfly", "babys-first-sfly", "babys-first-year-sfly", "beach-bliss-sfly", "beach-travel-sfly", "beach-wedding-sfly", "best-dad-ever-sfly", "best-day-ever-sfly", "best-grandparents-ever-sfly", "best-mom-ever-sfly", "black-and-white-rustic-sfly", "black-white-photo-album-sfly", "boho-baby-sfly", "boho-summer-sfly", "boho-travel-by-umaiana-studio-sfly", "boho-wedding-sfly", "bold-year-in-review-by-float-paperie-sfly", "bon-voyage-sfly", "bright-and-bold-kids-year-in-review-by-sarah-hawkins-designs-sfly", "bright-color-pop-sfly", "celebrate-family-by-float-paperie-sfly", "celebration-of-life-by-sarah-hawkins-designs-sfly", "chalkboard-chic-sfly", "cheerful-color-sfly", "chic-celebrations-by-float-paperie-sfly", "classic-baby-sfly", "classic-disney-sfly", "classic-recipes-sfly", "classic-school-yearbook-sfly", "classic-wedding-mma", "classic-wedding-sfly", "colorful-birthday-sfly", "colorful-childhood-sfly", "colorful-elementary-school-yearbook-sfly", "colorful-florals-by-potts-design-sfly", "colorful-gradients-sfly", "colorful-memories-by-britt-bass-sfly", "colorful-school-days-by-float-paperie-sfly", "colorful-year-in-review-by-sarah-hawkins-designs-sfly", "colorfully-fun-sfly", "digiscrap-sfly", "disney-adventure-sfly", "disney-family-adventures-sfly", "elegant-wedding-greenery-by-kim-thoa-sfly", "elegant-wedding-sfly", "elegantly-scripted-year-in-review-sfly", "elevated-rustic-sfly", "everyday-boho-by-umaiana-studio-sfly", "everyday-chalkboard-by-potts-design-sfly", "everyday-fairytale-by-jenny-romanski-sfly", "everyday-happiness-sfly", "everyday-indigo-sfly", "everyday-neutrals-sfly", "everyday-recipes-by-slightly-stationery-sfly", "everyday-rustic-sfly", "everyday-sentiments-sfly", "everyday-watercolor-sfly", "everything-sports-sfly", "family-blessings-by-potts-design-sfly", "family-favorites-by-lure-design-sfly", "family-vacation-sfly", "family-yearbook-sfly", "familygram-sfly", "forever-love-by-with-merriment-sfly", "fun-in-the-sun-sfly", "gilded-wedding-guestbook-sfly", "gilded-wedding-sfly", "go-sports-by-lure-design-sfly", "graduation-celebration-sfly", "graduation-photo-album-sfly", "hello-spring-sfly", "hello-summer-sfly", "high-school-memories-sfly", "holiday-memories-sfly", "its-a-girl-thing-sfly", "kraft-pop-sfly", "life-is-grand-sfly", "little-love-sfly", "love-and-thanks-sfly", "love-grows-sfly", "love-is-all-we-need-sfly", "love-you-because-sfly", "made-with-love-sfly", "milestone-anniversaries-sfly", "modern-baby-sfly", "modern-black-sfly", "modern-celebrations-sfly", "modern-dark-neutrals-sfly", "modern-grey-sfly", "modern-indigo-sfly", "modern-light-neutrals-sfly", "modern-love-story-sfly", "modern-photo-album-sfly", "modern-travel-sfly", "modern-wedding-mma", "modern-wedding-sfly", "modern-wedding-story-sfly", "modern-white-sfly", "modern-year-in-review-photo-album-sfly", "muted-everyday-abstract-sfly", "national-parks-travel-by-eiman-design-co-sfly", "natural-neutrals-sfly", "ombre-watercolor-sfly", "our-wedding-day-guestbook-sfly", "our-wedding-day-sfly", "outdoor-adventures-by-sarah-hawkins-designs-sfly", "outdoor-wedding-sfly", "painted-seasons-sfly", "pet-lover-sfly", "reunion-sfly", "road-trip-travel-by-sarah-hawkins-designs-sfly", "rustic-farmhouse-sfly", "rustic-gilded-wedding-sfly", "rustic-wedding-mma", "rustic-wedding-sfly", "school-days-yearbook-sfly", "shimmer-and-shine-sfly", "simple-elegant-wedding-sfly", "simply-black-sfly", "simply-bold-type-sfly", "simply-gallery-sfly", "simply-gray-sfly", "simply-modern-sfly", "simply-scrapbook-sfly", "softly-rustic-sfly", "sparkle-and-shine-sfly", "summertime-fun-sfly", "the-story-of-me-sfly", "the-travel-bug-sfly", "this-is-love-sfly", "together-again-sfly", "travel-abroad-sfly", "travel-adventures-sfly", "travel-gallery-sfly", "travel-memories-sfly", "travel-snapshots-sfly", "tropical-travel-sfly", "tropical-travels-sfly", "usa-travel-sfly", "vintage-disney-sfly", "vintage-travel-sfly", "vintage-wedding-sfly", "vivid-watercolor-sfly", "watercolor-baby-boy-sfly", "watercolor-baby-girl-sfly", "watercolor-floral-wedding-by-kim-thoa-sfly", "watercolor-greenery-by-sarah-hawkins-designs-sfly", "watercolor-year-in-review-sfly", "watercolorwashes-sfly", "wedding-gallery-sfly", "welcome-baby-sfly", "what-i-love-about-you-sfly", "whimsical-recipes-by-slightly-stationery-sfly", "whimsy-chalkboard-sfly", "winter-getaway-sfly", "winter-memories-by-sarah-hawkins-design-sfly", "world-travel-sfly"];
|
|
4
|
+
export declare const BookSizes: readonly ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"];
|
|
5
|
+
export declare const CoverTypes: readonly ["sc", "hc", "pl"];
|
|
6
|
+
export declare const PageTypes: readonly ["sp", "sl", "dl"];
|
|
7
|
+
export declare const ImageDensities: readonly ["low", "medium", "high"];
|
|
8
|
+
export declare const ImageFilterings: readonly ["best", "most", "all"];
|
|
9
|
+
export declare const EmbellishmentLevels: readonly ["none", "few", "lots"];
|
|
10
|
+
export declare const TextStickerLevels: readonly ["none", "few", "lots"];
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './models/client';
|
|
2
|
+
export * from './models/design-request/image';
|
|
3
|
+
export * from './models/design-request';
|
|
4
|
+
export * from './data/design-request';
|