@bluepic/embed 0.4.0-next.189 → 0.4.0-next.190

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.
@@ -99,7 +99,6 @@ export declare function useFieldHitboxes(options: {
99
99
  [k: string]: unknown;
100
100
  } | undefined;
101
101
  })[];
102
- removeBackground: boolean | (() => boolean);
103
102
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
104
103
  };
105
104
  } | {
@@ -258,7 +257,6 @@ export declare function useFieldHitboxes(options: {
258
257
  [k: string]: unknown;
259
258
  } | undefined;
260
259
  })[];
261
- removeBackground: boolean | (() => boolean);
262
260
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
263
261
  };
264
262
  } | {
@@ -417,7 +415,6 @@ export declare function useFieldHitboxes(options: {
417
415
  [k: string]: unknown;
418
416
  } | undefined;
419
417
  })[];
420
- removeBackground: boolean | (() => boolean);
421
418
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
422
419
  };
423
420
  } | {
@@ -682,7 +679,6 @@ export declare function useFieldHitboxes(options: {
682
679
  [k: string]: unknown;
683
680
  } | undefined;
684
681
  })[];
685
- removeBackground: boolean | (() => boolean);
686
682
  allowCropImage: boolean | (() => boolean);
687
683
  aspectRatio: number | (() => number);
688
684
  resetCropOnChange: boolean | (() => boolean);
@@ -780,6 +776,7 @@ export declare function useFieldHitboxes(options: {
780
776
  innerAlign: Template.ImageInnerAlign;
781
777
  mirrorX: boolean;
782
778
  mirrorY: boolean;
779
+ removeBackground?: boolean | undefined;
783
780
  naturalWidth?: number | undefined;
784
781
  naturalHeight?: number | undefined;
785
782
  scale?: number | undefined;
@@ -886,7 +883,6 @@ export declare function useFieldHitboxes(options: {
886
883
  [k: string]: unknown;
887
884
  } | undefined;
888
885
  })[];
889
- removeBackground: boolean | (() => boolean);
890
886
  allowCropImage: boolean | (() => boolean);
891
887
  aspectRatio: number | (() => number);
892
888
  resetCropOnChange: boolean | (() => boolean);
@@ -1075,7 +1071,6 @@ export declare function useFieldHitboxes(options: {
1075
1071
  [k: string]: unknown;
1076
1072
  } | undefined;
1077
1073
  })[];
1078
- removeBackground: boolean | (() => boolean);
1079
1074
  allowCropImage: boolean | (() => boolean);
1080
1075
  aspectRatio: number | (() => number);
1081
1076
  resetCropOnChange: boolean | (() => boolean);
@@ -1173,6 +1168,7 @@ export declare function useFieldHitboxes(options: {
1173
1168
  innerAlign: Template.ImageInnerAlign;
1174
1169
  mirrorX: boolean;
1175
1170
  mirrorY: boolean;
1171
+ removeBackground?: boolean | undefined;
1176
1172
  naturalWidth?: number | undefined;
1177
1173
  naturalHeight?: number | undefined;
1178
1174
  scale?: number | undefined;
@@ -1279,7 +1275,6 @@ export declare function useFieldHitboxes(options: {
1279
1275
  [k: string]: unknown;
1280
1276
  } | undefined;
1281
1277
  })[];
1282
- removeBackground: boolean | (() => boolean);
1283
1278
  allowCropImage: boolean | (() => boolean);
1284
1279
  aspectRatio: number | (() => number);
1285
1280
  resetCropOnChange: boolean | (() => boolean);
@@ -1354,7 +1349,6 @@ export declare function useFieldHitboxes(options: {
1354
1349
  [k: string]: unknown;
1355
1350
  } | undefined;
1356
1351
  })[];
1357
- removeBackground: boolean | (() => boolean);
1358
1352
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
1359
1353
  };
1360
1354
  } | {
@@ -1513,7 +1507,6 @@ export declare function useFieldHitboxes(options: {
1513
1507
  [k: string]: unknown;
1514
1508
  } | undefined;
1515
1509
  })[];
1516
- removeBackground: boolean | (() => boolean);
1517
1510
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
1518
1511
  };
1519
1512
  } | {
@@ -1778,7 +1771,6 @@ export declare function useFieldHitboxes(options: {
1778
1771
  [k: string]: unknown;
1779
1772
  } | undefined;
1780
1773
  })[];
1781
- removeBackground: boolean | (() => boolean);
1782
1774
  allowCropImage: boolean | (() => boolean);
1783
1775
  aspectRatio: number | (() => number);
1784
1776
  resetCropOnChange: boolean | (() => boolean);
@@ -1876,6 +1868,7 @@ export declare function useFieldHitboxes(options: {
1876
1868
  innerAlign: Template.ImageInnerAlign;
1877
1869
  mirrorX: boolean;
1878
1870
  mirrorY: boolean;
1871
+ removeBackground?: boolean | undefined;
1879
1872
  naturalWidth?: number | undefined;
1880
1873
  naturalHeight?: number | undefined;
1881
1874
  scale?: number | undefined;
@@ -1982,7 +1975,6 @@ export declare function useFieldHitboxes(options: {
1982
1975
  [k: string]: unknown;
1983
1976
  } | undefined;
1984
1977
  })[];
1985
- removeBackground: boolean | (() => boolean);
1986
1978
  allowCropImage: boolean | (() => boolean);
1987
1979
  aspectRatio: number | (() => number);
1988
1980
  resetCropOnChange: boolean | (() => boolean);
@@ -2163,7 +2155,6 @@ export declare function useFieldHitboxes(options: {
2163
2155
  [k: string]: unknown;
2164
2156
  } | undefined;
2165
2157
  })[];
2166
- removeBackground: boolean | (() => boolean);
2167
2158
  allowCropImage: boolean | (() => boolean);
2168
2159
  aspectRatio: number | (() => number);
2169
2160
  resetCropOnChange: boolean | (() => boolean);
@@ -2261,6 +2252,7 @@ export declare function useFieldHitboxes(options: {
2261
2252
  innerAlign: Template.ImageInnerAlign;
2262
2253
  mirrorX: boolean;
2263
2254
  mirrorY: boolean;
2255
+ removeBackground?: boolean | undefined;
2264
2256
  naturalWidth?: number | undefined;
2265
2257
  naturalHeight?: number | undefined;
2266
2258
  scale?: number | undefined;
@@ -2367,7 +2359,6 @@ export declare function useFieldHitboxes(options: {
2367
2359
  [k: string]: unknown;
2368
2360
  } | undefined;
2369
2361
  })[];
2370
- removeBackground: boolean | (() => boolean);
2371
2362
  allowCropImage: boolean | (() => boolean);
2372
2363
  aspectRatio: number | (() => number);
2373
2364
  resetCropOnChange: boolean | (() => boolean);
@@ -2556,7 +2547,6 @@ export declare function useFieldHitboxes(options: {
2556
2547
  [k: string]: unknown;
2557
2548
  } | undefined;
2558
2549
  })[];
2559
- removeBackground: boolean | (() => boolean);
2560
2550
  allowCropImage: boolean | (() => boolean);
2561
2551
  aspectRatio: number | (() => number);
2562
2552
  resetCropOnChange: boolean | (() => boolean);
@@ -2654,6 +2644,7 @@ export declare function useFieldHitboxes(options: {
2654
2644
  innerAlign: Template.ImageInnerAlign;
2655
2645
  mirrorX: boolean;
2656
2646
  mirrorY: boolean;
2647
+ removeBackground?: boolean | undefined;
2657
2648
  naturalWidth?: number | undefined;
2658
2649
  naturalHeight?: number | undefined;
2659
2650
  scale?: number | undefined;
@@ -2760,7 +2751,6 @@ export declare function useFieldHitboxes(options: {
2760
2751
  [k: string]: unknown;
2761
2752
  } | undefined;
2762
2753
  })[];
2763
- removeBackground: boolean | (() => boolean);
2764
2754
  allowCropImage: boolean | (() => boolean);
2765
2755
  aspectRatio: number | (() => number);
2766
2756
  resetCropOnChange: boolean | (() => boolean);
@@ -2865,7 +2855,6 @@ export declare function useFieldHitboxes(options: {
2865
2855
  [k: string]: unknown;
2866
2856
  } | undefined;
2867
2857
  })[];
2868
- removeBackground: boolean | (() => boolean);
2869
2858
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
2870
2859
  };
2871
2860
  } | {
@@ -3024,7 +3013,6 @@ export declare function useFieldHitboxes(options: {
3024
3013
  [k: string]: unknown;
3025
3014
  } | undefined;
3026
3015
  })[];
3027
- removeBackground: boolean | (() => boolean);
3028
3016
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
3029
3017
  };
3030
3018
  } | {
@@ -3183,7 +3171,6 @@ export declare function useFieldHitboxes(options: {
3183
3171
  [k: string]: unknown;
3184
3172
  } | undefined;
3185
3173
  })[];
3186
- removeBackground: boolean | (() => boolean);
3187
3174
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
3188
3175
  };
3189
3176
  } | {
@@ -3448,7 +3435,6 @@ export declare function useFieldHitboxes(options: {
3448
3435
  [k: string]: unknown;
3449
3436
  } | undefined;
3450
3437
  })[];
3451
- removeBackground: boolean | (() => boolean);
3452
3438
  allowCropImage: boolean | (() => boolean);
3453
3439
  aspectRatio: number | (() => number);
3454
3440
  resetCropOnChange: boolean | (() => boolean);
@@ -3546,6 +3532,7 @@ export declare function useFieldHitboxes(options: {
3546
3532
  innerAlign: Template.ImageInnerAlign;
3547
3533
  mirrorX: boolean;
3548
3534
  mirrorY: boolean;
3535
+ removeBackground?: boolean | undefined;
3549
3536
  naturalWidth?: number | undefined;
3550
3537
  naturalHeight?: number | undefined;
3551
3538
  scale?: number | undefined;
@@ -3652,7 +3639,6 @@ export declare function useFieldHitboxes(options: {
3652
3639
  [k: string]: unknown;
3653
3640
  } | undefined;
3654
3641
  })[];
3655
- removeBackground: boolean | (() => boolean);
3656
3642
  allowCropImage: boolean | (() => boolean);
3657
3643
  aspectRatio: number | (() => number);
3658
3644
  resetCropOnChange: boolean | (() => boolean);
@@ -3841,7 +3827,6 @@ export declare function useFieldHitboxes(options: {
3841
3827
  [k: string]: unknown;
3842
3828
  } | undefined;
3843
3829
  })[];
3844
- removeBackground: boolean | (() => boolean);
3845
3830
  allowCropImage: boolean | (() => boolean);
3846
3831
  aspectRatio: number | (() => number);
3847
3832
  resetCropOnChange: boolean | (() => boolean);
@@ -3939,6 +3924,7 @@ export declare function useFieldHitboxes(options: {
3939
3924
  innerAlign: Template.ImageInnerAlign;
3940
3925
  mirrorX: boolean;
3941
3926
  mirrorY: boolean;
3927
+ removeBackground?: boolean | undefined;
3942
3928
  naturalWidth?: number | undefined;
3943
3929
  naturalHeight?: number | undefined;
3944
3930
  scale?: number | undefined;
@@ -4045,7 +4031,6 @@ export declare function useFieldHitboxes(options: {
4045
4031
  [k: string]: unknown;
4046
4032
  } | undefined;
4047
4033
  })[];
4048
- removeBackground: boolean | (() => boolean);
4049
4034
  allowCropImage: boolean | (() => boolean);
4050
4035
  aspectRatio: number | (() => number);
4051
4036
  resetCropOnChange: boolean | (() => boolean);
@@ -4120,7 +4105,6 @@ export declare function useFieldHitboxes(options: {
4120
4105
  [k: string]: unknown;
4121
4106
  } | undefined;
4122
4107
  })[];
4123
- removeBackground: boolean | (() => boolean);
4124
4108
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
4125
4109
  };
4126
4110
  } | {
@@ -4279,7 +4263,6 @@ export declare function useFieldHitboxes(options: {
4279
4263
  [k: string]: unknown;
4280
4264
  } | undefined;
4281
4265
  })[];
4282
- removeBackground: boolean | (() => boolean);
4283
4266
  autoCrop?: boolean | (() => boolean | undefined) | undefined;
4284
4267
  };
4285
4268
  } | {
@@ -4544,7 +4527,6 @@ export declare function useFieldHitboxes(options: {
4544
4527
  [k: string]: unknown;
4545
4528
  } | undefined;
4546
4529
  })[];
4547
- removeBackground: boolean | (() => boolean);
4548
4530
  allowCropImage: boolean | (() => boolean);
4549
4531
  aspectRatio: number | (() => number);
4550
4532
  resetCropOnChange: boolean | (() => boolean);
@@ -4642,6 +4624,7 @@ export declare function useFieldHitboxes(options: {
4642
4624
  innerAlign: Template.ImageInnerAlign;
4643
4625
  mirrorX: boolean;
4644
4626
  mirrorY: boolean;
4627
+ removeBackground?: boolean | undefined;
4645
4628
  naturalWidth?: number | undefined;
4646
4629
  naturalHeight?: number | undefined;
4647
4630
  scale?: number | undefined;
@@ -4748,7 +4731,6 @@ export declare function useFieldHitboxes(options: {
4748
4731
  [k: string]: unknown;
4749
4732
  } | undefined;
4750
4733
  })[];
4751
- removeBackground: boolean | (() => boolean);
4752
4734
  allowCropImage: boolean | (() => boolean);
4753
4735
  aspectRatio: number | (() => number);
4754
4736
  resetCropOnChange: boolean | (() => boolean);
@@ -4929,7 +4911,6 @@ export declare function useFieldHitboxes(options: {
4929
4911
  [k: string]: unknown;
4930
4912
  } | undefined;
4931
4913
  })[];
4932
- removeBackground: boolean | (() => boolean);
4933
4914
  allowCropImage: boolean | (() => boolean);
4934
4915
  aspectRatio: number | (() => number);
4935
4916
  resetCropOnChange: boolean | (() => boolean);
@@ -5027,6 +5008,7 @@ export declare function useFieldHitboxes(options: {
5027
5008
  innerAlign: Template.ImageInnerAlign;
5028
5009
  mirrorX: boolean;
5029
5010
  mirrorY: boolean;
5011
+ removeBackground?: boolean | undefined;
5030
5012
  naturalWidth?: number | undefined;
5031
5013
  naturalHeight?: number | undefined;
5032
5014
  scale?: number | undefined;
@@ -5133,7 +5115,6 @@ export declare function useFieldHitboxes(options: {
5133
5115
  [k: string]: unknown;
5134
5116
  } | undefined;
5135
5117
  })[];
5136
- removeBackground: boolean | (() => boolean);
5137
5118
  allowCropImage: boolean | (() => boolean);
5138
5119
  aspectRatio: number | (() => number);
5139
5120
  resetCropOnChange: boolean | (() => boolean);
@@ -5322,7 +5303,6 @@ export declare function useFieldHitboxes(options: {
5322
5303
  [k: string]: unknown;
5323
5304
  } | undefined;
5324
5305
  })[];
5325
- removeBackground: boolean | (() => boolean);
5326
5306
  allowCropImage: boolean | (() => boolean);
5327
5307
  aspectRatio: number | (() => number);
5328
5308
  resetCropOnChange: boolean | (() => boolean);
@@ -5420,6 +5400,7 @@ export declare function useFieldHitboxes(options: {
5420
5400
  innerAlign: Template.ImageInnerAlign;
5421
5401
  mirrorX: boolean;
5422
5402
  mirrorY: boolean;
5403
+ removeBackground?: boolean | undefined;
5423
5404
  naturalWidth?: number | undefined;
5424
5405
  naturalHeight?: number | undefined;
5425
5406
  scale?: number | undefined;
@@ -5526,7 +5507,6 @@ export declare function useFieldHitboxes(options: {
5526
5507
  [k: string]: unknown;
5527
5508
  } | undefined;
5528
5509
  })[];
5529
- removeBackground: boolean | (() => boolean);
5530
5510
  allowCropImage: boolean | (() => boolean);
5531
5511
  aspectRatio: number | (() => number);
5532
5512
  resetCropOnChange: boolean | (() => boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluepic/embed",
3
- "version": "0.4.0-next.189",
3
+ "version": "0.4.0-next.190",
4
4
  "description": "Bluepic embed sdk",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@auth0/auth0-vue": "^2.4.0",
49
- "@bluepic/types": "^0.8.75",
49
+ "@bluepic/types": "^0.8.76",
50
50
  "@hono/zod-openapi": "^1.1.4",
51
51
  "@types/css": "^0.0.38",
52
52
  "@types/downloadjs": "^1.4.6",
@@ -1,69 +0,0 @@
1
- import { type FieldsBridge } from '@bluepic/types';
2
- /**
3
- * The transform that performs background removal.
4
- *
5
- * `format: 'png'` is not optional dressing: `segment=foreground` writes
6
- * transparent pixels, and without an alpha-capable output format Cloudflare
7
- * flattens them — you'd pay for the transformation and get the original back.
8
- */
9
- export declare const BACKGROUND_REMOVAL_TRANSFORM: {
10
- readonly segment: "foreground";
11
- readonly format: "png";
12
- };
13
- /**
14
- * Whether the host can actually perform Cloudflare Images transforms.
15
- *
16
- * Absent capabilities read as `false`: a bridge that predates this field
17
- * demonstrably has no forwarding, so assuming "yes" would produce broken URLs.
18
- */
19
- export declare function hostSupportsImageAi(bridge: Pick<FieldsBridge, 'capabilities'> | null | undefined): boolean;
20
- /**
21
- * Whether the host forces background removal through Bluepic's own rembg
22
- * service instead of the Cloudflare transform.
23
- *
24
- * For a field this means one thing: DON'T touch the src. The host has already
25
- * had the cutout baked into the stored image at upload time, so appending
26
- * `segment=foreground` would be a second removal layered on an image that is
27
- * already cut out.
28
- *
29
- * Absent reads as `false` — the Cloudflare path is the default, and a bridge
30
- * that predates this switch is not running an experiment.
31
- */
32
- export declare function hostEnforcesBxRembg(bridge: Pick<FieldsBridge, 'capabilities'> | null | undefined): boolean;
33
- export type ResolveBackgroundRemovalOptions = {
34
- /** The field's `removeBackground` prop. */
35
- enabled: boolean;
36
- /** Host capability — see `hostSupportsImageAi`. */
37
- capable: boolean;
38
- /**
39
- * Host bakes the cutout at upload instead — see `hostEnforcesBxRembg`. When
40
- * true the transform is never applied, only stripped.
41
- */
42
- enforced?: boolean;
43
- };
44
- /**
45
- * Decide the `src` an image field should store.
46
- *
47
- * Three properties this relies on, all provided by `withCloudflareTransform`:
48
- *
49
- * - **Idempotent** — safe to run on a src that already carries the transform,
50
- * which happens on every re-render and every draft reload.
51
- * - **Reversible** — turning the setting off restores the plain variant, so
52
- * existing drafts follow the toggle instead of freezing at whatever they
53
- * were uploaded with.
54
- * - **Silent passthrough** — legacy R2 srcs, Pexels and shared-drive links
55
- * are not delivery URLs and come back untouched rather than mangled.
56
- *
57
- * Never throws; the worst case is "the image is unchanged".
58
- */
59
- export declare function resolveBackgroundRemoval(src: string, opts: ResolveBackgroundRemovalOptions): string;
60
- /**
61
- * The untransformed counterpart of a src, for use as an `<img>` error
62
- * fallback.
63
- *
64
- * `segment=foreground` is a Cloudflare open beta. When it fails the browser
65
- * renders a broken image, which is strictly worse than showing the original —
66
- * so every surface that applies the transform should also be able to fall back.
67
- * Returns `null` when there is nothing to fall back to.
68
- */
69
- export declare function backgroundRemovalFallbackSrc(src: string): string | null;