@bluepic/embed 0.4.0-next.99 → 0.5.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.
- package/dist/bluepic-embed.iife.js +402 -178
- package/dist/bluepic-embed.umd.js +402 -178
- package/dist/components/AssetViewer/AssetViewer.vue.d.ts +71 -0
- package/dist/components/BxAudioPlayButton.vue.d.ts +24 -0
- package/dist/components/BxCard.vue.d.ts +35 -0
- package/dist/components/BxInput.vue.d.ts +7 -1
- package/dist/components/BxList.vue.d.ts +9 -0
- package/dist/components/BxListItem.vue.d.ts +13 -1
- package/dist/components/BxPopover.vue.d.ts +7 -0
- package/dist/components/BxPreviewLayer.vue.d.ts +18 -0
- package/dist/components/BxScrollbar.vue.d.ts +7 -0
- package/dist/components/BxSelect.vue.d.ts +16 -2
- package/dist/components/BxTable.vue.d.ts +109 -0
- package/dist/components/BxTabs.vue.d.ts +7 -0
- package/dist/components/BxWaveformThumb.vue.d.ts +27 -0
- package/dist/components/CollectionFieldPopup.vue.d.ts +4 -0
- package/dist/components/PopoverElement.vue.d.ts +10 -1
- package/dist/components/TemplateEditor/BatchCell.vue.d.ts +18 -0
- package/dist/components/TemplateEditor/BatchEditor.vue.d.ts +264 -0
- package/dist/components/TemplateEditor/BatchExportPopup.vue.d.ts +68 -0
- package/dist/components/TemplateEditor/BatchImportPopup.vue.d.ts +25 -0
- package/dist/components/TemplateEditor/BxLiveTemplate.vue.d.ts +8 -0
- package/dist/components/TemplateEditor/BxTemplateEditor.vue.d.ts +285 -16
- package/dist/components/TemplateEditor/FieldHintsLayer.vue.d.ts +86 -0
- package/dist/components/TemplateEditor/TemplateView.vue.d.ts +77 -2
- package/dist/components/User/UserInfo.vue.d.ts +12 -1
- package/dist/components/directives/usePopup.d.ts +5 -0
- package/dist/components/fields/Collection.vue.d.ts +3 -0
- package/dist/components/fields/Image.vue.d.ts +19 -5
- package/dist/components/fields/ImageEdit.vue.d.ts +6 -1
- package/dist/components/fields/Text.vue.d.ts +1 -1
- package/dist/embed/embed.d.ts +1024 -228
- package/dist/{index-CWm6zOv7.js → index-C99_zLhc.js} +9 -9
- package/dist/index-D8N6IfRw.cjs +1 -0
- package/dist/main.cjs +240 -162
- package/dist/main.d.ts +20 -0
- package/dist/main.mjs +79043 -68465
- package/dist/markdown-it-5-ieF6Bh.js +3790 -0
- package/dist/markdown-it-CLB5Jta6.cjs +16 -0
- package/dist/postal-mime-Df-WB8Vq.js +3337 -0
- package/dist/postal-mime-_7WF5UBe.cjs +28 -0
- package/dist/style.css +1 -1
- package/dist/theme/bridge.d.ts +14 -0
- package/dist/theme/color.d.ts +80 -0
- package/dist/theme/css.d.ts +8 -0
- package/dist/theme/index.d.ts +19 -0
- package/dist/theme/legacy.d.ts +3 -0
- package/dist/theme/resolve.d.ts +10 -0
- package/dist/theme/tokens.d.ts +129 -0
- package/dist/theme/types-contract.d.ts +13 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.mjs +1313 -0
- package/dist/util/assetAuth.d.ts +35 -0
- package/dist/util/audioPreview.d.ts +8 -0
- package/dist/util/batch/csv.d.ts +58 -0
- package/dist/util/batch/export.d.ts +92 -0
- package/dist/util/batch/fields.d.ts +22 -0
- package/dist/util/batch/parseCSV.d.ts +72 -0
- package/dist/util/batch/useBatchRows.d.ts +67 -0
- package/dist/util/cloneDeep.d.ts +5 -5
- package/dist/util/cloudflareImages.d.ts +8 -1
- package/dist/util/contextCapture.d.ts +19 -0
- package/dist/util/export.d.ts +65 -18
- package/dist/util/fieldHints/chipAction.d.ts +23 -0
- package/dist/util/fieldHints/fieldFocus.d.ts +81 -0
- package/dist/util/fieldHints/geometry.d.ts +52 -0
- package/dist/util/fieldHints/index.d.ts +20 -0
- package/dist/util/fieldHints/probe.d.ts +84 -0
- package/dist/util/fieldHints/resolve.d.ts +55 -0
- package/dist/util/fieldHints/textProbe.d.ts +71 -0
- package/dist/util/fieldHints/useCanvasTextEditing.d.ts +125 -0
- package/dist/util/fieldHints/useChipHighlight.d.ts +29 -0
- package/dist/util/fieldHints/useFieldHitboxes.d.ts +5601 -0
- package/dist/util/fieldHints/useHintReveal.d.ts +10 -0
- package/dist/util/fieldTree.d.ts +20 -0
- package/dist/util/fields.d.ts +1 -1
- package/dist/util/gallery.d.ts +78 -30
- package/dist/util/popoverArrow.d.ts +33 -0
- package/dist/util/popupHeaderTools.d.ts +26 -0
- package/dist/util/scrollPassthrough.d.ts +9 -0
- package/dist/util/useTheme.d.ts +36 -1
- package/dist/util/visualViewport.d.ts +47 -0
- package/dist/xlsx-BopDBbWb.js +24176 -0
- package/dist/xlsx-qn1xoUuv.cjs +105 -0
- package/package.json +18 -5
- package/dist/index-DFXQWOGQ.cjs +0 -1
- package/dist/util/backgroundRemoval.d.ts +0 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluepic/embed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Bluepic embed sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"import": "./dist/main.mjs",
|
|
15
15
|
"require": "./dist/main.cjs"
|
|
16
16
|
},
|
|
17
|
+
"./theme": {
|
|
18
|
+
"types": "./dist/theme/index.d.ts",
|
|
19
|
+
"import": "./dist/theme.mjs",
|
|
20
|
+
"require": "./dist/theme.cjs"
|
|
21
|
+
},
|
|
17
22
|
"./style.css": "./dist/style.css"
|
|
18
23
|
},
|
|
19
24
|
"types": "./dist/main.d.ts",
|
|
@@ -22,26 +27,31 @@
|
|
|
22
27
|
"!dist/**/*.map"
|
|
23
28
|
],
|
|
24
29
|
"scripts": {
|
|
25
|
-
"build": "rimraf dist && vite build && npm run build:types",
|
|
30
|
+
"build": "rimraf dist && vite build && vite build --config vite.theme.config.ts && npm run build:types",
|
|
26
31
|
"copy-test-js-embed-module": "cp dist/bluepic-embed.umd.js test/test1/bluepic-embed.umd.js && cp dist/bluepic-embed.umd.js.map test/test1/bluepic-embed.umd.js.map && cp dist/style.css test/test1/style.css",
|
|
27
32
|
"build:types": "vue-tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist",
|
|
28
33
|
"typecheck": "vue-tsc --noEmit",
|
|
34
|
+
"lint:theme": "node scripts/check-theme-literals.mjs",
|
|
29
35
|
"dev": "rimraf dist && concurrently \"npm:dev:vite\" \"npm:dev:types\"",
|
|
30
36
|
"dev:vite": "vite build --watch",
|
|
31
37
|
"dev:types": "vue-tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist --watch",
|
|
32
38
|
"playground:dev": "vite --config vite.playground.config.ts",
|
|
33
|
-
"test:autocrop": "tsx src/util/autoCrop/solveAutoCrop.test.ts"
|
|
39
|
+
"test:autocrop": "tsx src/util/autoCrop/solveAutoCrop.test.ts",
|
|
40
|
+
"test:gallery": "tsx src/util/gallery.test.ts",
|
|
41
|
+
"test:fieldhints": "tsx src/util/fieldHints/fieldHints.test.ts",
|
|
42
|
+
"test:clone": "tsx src/util/cloneDeep.test.ts"
|
|
34
43
|
},
|
|
35
44
|
"peerDependencies": {
|
|
36
45
|
"vue": "^3.5.23"
|
|
37
46
|
},
|
|
38
47
|
"devDependencies": {
|
|
39
48
|
"@auth0/auth0-vue": "^2.4.0",
|
|
40
|
-
"@bluepic/types": "^0.
|
|
49
|
+
"@bluepic/types": "^0.8.96",
|
|
41
50
|
"@hono/zod-openapi": "^1.1.4",
|
|
42
51
|
"@types/css": "^0.0.38",
|
|
43
52
|
"@types/downloadjs": "^1.4.6",
|
|
44
53
|
"@types/fontkit": "^2.0.8",
|
|
54
|
+
"@types/markdown-it": "^14.2.0",
|
|
45
55
|
"@types/mime-types": "^3.0.1",
|
|
46
56
|
"@types/node": "^24.10.0",
|
|
47
57
|
"@types/object-hash": "^3.0.6",
|
|
@@ -75,17 +85,20 @@
|
|
|
75
85
|
"fontkit": "^2.0.4",
|
|
76
86
|
"highlight.js": "^11.11.1",
|
|
77
87
|
"inline-style-parser": "^0.2.7",
|
|
88
|
+
"markdown-it": "^15.0.0",
|
|
78
89
|
"mime": "^4.1.0",
|
|
79
90
|
"nanoid": "^5.1.6",
|
|
80
91
|
"object-hash": "^3.0.0",
|
|
81
92
|
"p-limit": "^7.2.0",
|
|
82
93
|
"pexels": "^1.4.0",
|
|
94
|
+
"postal-mime": "^3.0.0",
|
|
83
95
|
"semver": "^7.7.3",
|
|
84
96
|
"sortablejs": "^1.15.6",
|
|
85
97
|
"svg-path-commander": "^2.1.11",
|
|
86
98
|
"swiper": "^12.1.4",
|
|
87
99
|
"unzipit": "^1.4.3",
|
|
88
100
|
"vue3-delay-watch": "^0.1.3",
|
|
89
|
-
"vue3-rich-text-editor": "^0.1.15"
|
|
101
|
+
"vue3-rich-text-editor": "^0.1.15",
|
|
102
|
+
"xlsx": "^0.18.5"
|
|
90
103
|
}
|
|
91
104
|
}
|
package/dist/index-DFXQWOGQ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(t,n,e){const i=Number(0xffffffffn&n),o=Number(n>>32n);this.setUint32(t+(e?0:4),i,e),this.setUint32(t+(e?4:0),o,e)}});var U=t=>new DataView(new ArrayBuffer(t)),u=t=>new Uint8Array(t.buffer||t),y=t=>new TextEncoder().encode(String(t)),c=t=>Math.min(4294967295,Number(t)),b=t=>Math.min(65535,Number(t));function R(t,n,e){n===void 0||n instanceof Date||(n=new Date(n));const i=t!==void 0;if(e||(e=i?436:509),t instanceof File)return{isFile:i,t:n||new Date(t.lastModified),bytes:t.stream(),mode:e};if(t instanceof Response)return{isFile:i,t:n||new Date(t.headers.get("Last-Modified")||Date.now()),bytes:t.body,mode:e};if(n===void 0)n=new Date;else if(isNaN(n))throw new Error("Invalid modification date.");if(!i)return{isFile:i,t:n,mode:e};if(typeof t=="string")return{isFile:i,t:n,bytes:y(t),mode:e};if(t instanceof Blob)return{isFile:i,t:n,bytes:t.stream(),mode:e};if(t instanceof Uint8Array||t instanceof ReadableStream)return{isFile:i,t:n,bytes:t,mode:e};if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return{isFile:i,t:n,bytes:u(t),mode:e};if(Symbol.asyncIterator in t)return{isFile:i,t:n,bytes:v(t[Symbol.asyncIterator]()),mode:e};throw new TypeError("Unsupported input format.")}function v(t,n=t){return new ReadableStream({async pull(e){let i=0;for(;e.desiredSize>i;){const o=await t.next();if(!o.value){e.close();break}{const r=M(o.value);e.enqueue(r),i+=r.byteLength}}},cancel(e){var i;(i=n.throw)==null||i.call(n,e)}})}function M(t){return typeof t=="string"?y(t):t instanceof Uint8Array?t:u(t)}function I(t,n,e){let[i,o]=function(r){return r?r instanceof Uint8Array?[r,1]:ArrayBuffer.isView(r)||r instanceof ArrayBuffer?[u(r),1]:[y(r),0]:[void 0,0]}(n);if(t instanceof File)return{i:p(i||y(t.name)),o:BigInt(t.size),u:o};if(t instanceof Response){const r=t.headers.get("content-disposition"),f=r&&r.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),a=f&&f[1]||t.url&&new URL(t.url).pathname.split("/").findLast(Boolean),l=a&&decodeURIComponent(a),d=e||+t.headers.get("content-length");return{i:p(i||y(l)),o:BigInt(d),u:o}}return i=p(i,t!==void 0||e!==void 0),typeof t=="string"?{i,o:BigInt(y(t).length),u:o}:t instanceof Blob?{i,o:BigInt(t.size),u:o}:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?{i,o:BigInt(t.byteLength),u:o}:{i,o:T(t,e),u:o}}function T(t,n){return n>-1?BigInt(n):t?void 0:0n}function p(t,n=1){if(!t||t.every(e=>e===47))throw new Error("The file must have a name.");if(n)for(;t[t.length-1]===47;)t=t.subarray(0,-1);else t[t.length-1]!==47&&(t=new Uint8Array([...t,47]));return t}var F=new Uint32Array(256);for(let t=0;t<256;++t){let n=t;for(let e=0;e<8;++e)n=n>>>1^(1&n&&3988292384);F[t]=n}function B(t,n=0){n=~n;for(var e=0,i=t.length;e<i;e++)n=n>>>8^F[255&n^t[e]];return~n>>>0}function A(t,n,e=0){const i=t.getSeconds()>>1|t.getMinutes()<<5|t.getHours()<<11,o=t.getDate()|t.getMonth()+1<<5|t.getFullYear()-1980<<9;n.setUint16(e,i,1),n.setUint16(e+2,o,1)}function L({i:t,u:n},e){return 8*(!n||(e??function(i){try{N.decode(i)}catch{return 0}return 1}(t)))}var N=new TextDecoder("utf8",{fatal:1});function E(t,n=0){const e=U(30);return e.setUint32(0,1347093252),e.setUint32(4,754976768|n),A(t.t,e,10),e.setUint16(26,t.i.length,1),u(e)}async function*z(t){let{bytes:n}=t;if("then"in n&&(n=await n),n instanceof Uint8Array)yield n,t.l=B(n,0),t.o=BigInt(n.length);else{t.o=0n;const e=n.getReader();for(;;){const{value:i,done:o}=await e.read();if(o)break;t.l=B(i,t.l),t.o+=BigInt(i.length),yield i}}}function V(t,n){const e=U(16+(n?8:0));return e.setUint32(0,1347094280),e.setUint32(4,t.isFile?t.l:0,1),n?(e.setBigUint64(8,t.o,1),e.setBigUint64(16,t.o,1)):(e.setUint32(8,c(t.o),1),e.setUint32(12,c(t.o),1)),u(e)}function C(t,n,e=0,i=0){const o=U(46);return o.setUint32(0,1347092738),o.setUint32(4,755182848),o.setUint16(8,2048|e),A(t.t,o,12),o.setUint32(16,t.isFile?t.l:0,1),o.setUint32(20,c(t.o),1),o.setUint32(24,c(t.o),1),o.setUint16(28,t.i.length,1),o.setUint16(30,i,1),o.setUint16(40,t.mode|(t.isFile?32768:16384),1),o.setUint32(42,c(n),1),u(o)}function j(t,n,e){const i=U(e);return i.setUint16(0,1,1),i.setUint16(2,e-4,1),16&e&&(i.setBigUint64(4,t.o,1),i.setBigUint64(12,t.o,1)),i.setBigUint64(e-8,n,1),u(i)}function S(t){return t instanceof File||t instanceof Response?[[t],[t]]:[[t.input,t.name,t.size],[t.input,t.lastModified,t.mode]]}var D=t=>function(n){let e=BigInt(22),i=0n,o=0;for(const r of n){if(!r.i)throw new Error("Every file must have a non-empty name.");if(r.o===void 0)throw new Error(`Missing size for file "${new TextDecoder().decode(r.i)}".`);const f=r.o>=0xffffffffn,a=i>=0xffffffffn;i+=BigInt(46+r.i.length+(f&&8))+r.o,e+=BigInt(r.i.length+46+(12*a|28*f)),o||(o=f)}return(o||i>=0xffffffffn)&&(e+=BigInt(76)),e+i}(function*(n){for(const e of n)yield I(...S(e)[0])}(t));function O(t,n={}){const e={"Content-Type":"application/zip","Content-Disposition":"attachment"};return(typeof n.length=="bigint"||Number.isInteger(n.length))&&n.length>0&&(e["Content-Length"]=String(n.length)),n.metadata&&(e["Content-Length"]=String(D(n.metadata))),new Response(x(t,n),{headers:e})}function x(t,n={}){const e=function(i){var r;const o=i[Symbol.iterator in i?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const f=await o.next();if(f.done)return f;const[a,l]=S(f.value);return{done:0,value:Object.assign(R(...l),I(...a))}},throw:(r=o.throw)==null?void 0:r.bind(o),[Symbol.asyncIterator](){return this}}}(t);return v(async function*(i,o){const r=[];let f=0n,a=0n,l=0;for await(const s of i){const w=L(s,o.buffersAreUTF8);yield E(s,w),yield new Uint8Array(s.i),s.isFile&&(yield*z(s));const h=s.o>=0xffffffffn,m=12*(f>=0xffffffffn)|28*h;yield V(s,h),r.push(C(s,f,w,m)),r.push(s.i),m&&r.push(j(s,f,m)),h&&(f+=8n),a++,f+=BigInt(46+s.i.length)+s.o,l||(l=h)}let d=0n;for(const s of r)yield s,d+=BigInt(s.length);if(l||f>=0xffffffffn){const s=U(76);s.setUint32(0,1347094022),s.setBigUint64(4,BigInt(44),1),s.setUint32(12,755182848),s.setBigUint64(24,a,1),s.setBigUint64(32,a,1),s.setBigUint64(40,d,1),s.setBigUint64(48,f,1),s.setUint32(56,1347094023),s.setBigUint64(64,f+d,1),s.setUint32(72,1,1),yield u(s)}const g=U(22);g.setUint32(0,1347093766),g.setUint16(8,b(a),1),g.setUint16(10,b(a),1),g.setUint32(12,c(d),1),g.setUint32(16,c(f),1),yield u(g)}(e,n),e)}exports.downloadZip=O;exports.makeZip=x;exports.predictLength=D;
|
|
@@ -1,51 +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
|
-
export type ResolveBackgroundRemovalOptions = {
|
|
21
|
-
/** The field's `removeBackground` prop. */
|
|
22
|
-
enabled: boolean;
|
|
23
|
-
/** Host capability — see `hostSupportsImageAi`. */
|
|
24
|
-
capable: boolean;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Decide the `src` an image field should store.
|
|
28
|
-
*
|
|
29
|
-
* Three properties this relies on, all provided by `withCloudflareTransform`:
|
|
30
|
-
*
|
|
31
|
-
* - **Idempotent** — safe to run on a src that already carries the transform,
|
|
32
|
-
* which happens on every re-render and every draft reload.
|
|
33
|
-
* - **Reversible** — turning the setting off restores the plain variant, so
|
|
34
|
-
* existing drafts follow the toggle instead of freezing at whatever they
|
|
35
|
-
* were uploaded with.
|
|
36
|
-
* - **Silent passthrough** — legacy R2 srcs, Pexels and shared-drive links
|
|
37
|
-
* are not delivery URLs and come back untouched rather than mangled.
|
|
38
|
-
*
|
|
39
|
-
* Never throws; the worst case is "the image is unchanged".
|
|
40
|
-
*/
|
|
41
|
-
export declare function resolveBackgroundRemoval(src: string, opts: ResolveBackgroundRemovalOptions): string;
|
|
42
|
-
/**
|
|
43
|
-
* The untransformed counterpart of a src, for use as an `<img>` error
|
|
44
|
-
* fallback.
|
|
45
|
-
*
|
|
46
|
-
* `segment=foreground` is a Cloudflare open beta. When it fails the browser
|
|
47
|
-
* renders a broken image, which is strictly worse than showing the original —
|
|
48
|
-
* so every surface that applies the transform should also be able to fall back.
|
|
49
|
-
* Returns `null` when there is nothing to fall back to.
|
|
50
|
-
*/
|
|
51
|
-
export declare function backgroundRemovalFallbackSrc(src: string): string | null;
|