@anvilkit/plugin-asset-manager 0.1.5 → 0.1.7
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 +27 -19
- package/dist/adapters/data-url.cjs +9 -5
- package/dist/adapters/extract-image-dimensions.cjs +12 -8
- package/dist/adapters/in-memory.cjs +9 -5
- package/dist/adapters/s3-presigned.cjs +9 -5
- package/dist/index.cjs +16 -5
- package/dist/index.d.cts +11 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/plugin.cjs +76 -9
- package/dist/plugin.d.cts +3 -2
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.ts +3 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +67 -4
- package/dist/sources/composite-source.cjs +137 -0
- package/dist/sources/composite-source.d.cts +39 -0
- package/dist/sources/composite-source.d.cts.map +1 -0
- package/dist/sources/composite-source.d.ts +39 -0
- package/dist/sources/composite-source.d.ts.map +1 -0
- package/dist/sources/composite-source.js +99 -0
- package/dist/sources/federated-search.cjs +163 -0
- package/dist/sources/federated-search.d.cts +33 -0
- package/dist/sources/federated-search.d.cts.map +1 -0
- package/dist/sources/federated-search.d.ts +33 -0
- package/dist/sources/federated-search.d.ts.map +1 -0
- package/dist/sources/federated-search.js +113 -0
- package/dist/sources/provider.cjs +18 -0
- package/dist/sources/provider.d.cts +51 -0
- package/dist/sources/provider.d.cts.map +1 -0
- package/dist/sources/provider.d.ts +51 -0
- package/dist/sources/provider.d.ts.map +1 -0
- package/dist/sources/provider.js +1 -0
- package/dist/sources/unsplash/client.cjs +189 -0
- package/dist/sources/unsplash/client.d.cts +87 -0
- package/dist/sources/unsplash/client.d.cts.map +1 -0
- package/dist/sources/unsplash/client.d.ts +87 -0
- package/dist/sources/unsplash/client.d.ts.map +1 -0
- package/dist/sources/unsplash/client.js +151 -0
- package/dist/sources/unsplash/index.cjs +192 -0
- package/dist/sources/unsplash/index.d.cts +16 -0
- package/dist/sources/unsplash/index.d.cts.map +1 -0
- package/dist/sources/unsplash/index.d.ts +16 -0
- package/dist/sources/unsplash/index.d.ts.map +1 -0
- package/dist/sources/unsplash/index.js +148 -0
- package/dist/sources/unsplash/themes.cjs +141 -0
- package/dist/sources/unsplash/themes.d.cts +18 -0
- package/dist/sources/unsplash/themes.d.cts.map +1 -0
- package/dist/sources/unsplash/themes.d.ts +18 -0
- package/dist/sources/unsplash/themes.d.ts.map +1 -0
- package/dist/sources/unsplash/themes.js +93 -0
- package/dist/sources/unsplash/throttle-cache.cjs +86 -0
- package/dist/sources/unsplash/throttle-cache.d.cts +25 -0
- package/dist/sources/unsplash/throttle-cache.d.cts.map +1 -0
- package/dist/sources/unsplash/throttle-cache.d.ts +25 -0
- package/dist/sources/unsplash/throttle-cache.d.ts.map +1 -0
- package/dist/sources/unsplash/throttle-cache.js +45 -0
- package/dist/testing/index.cjs +9 -5
- package/dist/types/categories.cjs +18 -0
- package/dist/types/categories.d.cts +48 -0
- package/dist/types/categories.d.cts.map +1 -0
- package/dist/types/categories.d.ts +48 -0
- package/dist/types/categories.d.ts.map +1 -0
- package/dist/types/categories.js +1 -0
- package/dist/types/data-source.cjs +18 -0
- package/dist/types/data-source.d.cts +59 -0
- package/dist/types/data-source.d.cts.map +1 -0
- package/dist/types/data-source.d.ts +59 -0
- package/dist/types/data-source.d.ts.map +1 -0
- package/dist/types/data-source.js +1 -0
- package/dist/types/filter.cjs +18 -0
- package/dist/types/filter.d.cts +55 -0
- package/dist/types/filter.d.cts.map +1 -0
- package/dist/types/filter.d.ts +55 -0
- package/dist/types/filter.d.ts.map +1 -0
- package/dist/types/filter.js +1 -0
- package/dist/types/folders.cjs +42 -0
- package/dist/types/folders.d.cts +46 -0
- package/dist/types/folders.d.cts.map +1 -0
- package/dist/types/folders.d.ts +46 -0
- package/dist/types/folders.d.ts.map +1 -0
- package/dist/types/folders.js +4 -0
- package/dist/types/options.cjs +18 -0
- package/dist/types/options.d.cts +68 -0
- package/dist/types/options.d.cts.map +1 -0
- package/dist/types/options.d.ts +68 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +1 -0
- package/dist/types/types.d.cts +15 -27
- package/dist/types/types.d.cts.map +1 -1
- package/dist/types/types.d.ts +15 -27
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/unsplash.cjs +18 -0
- package/dist/types/unsplash.d.cts +60 -0
- package/dist/types/unsplash.d.cts.map +1 -0
- package/dist/types/unsplash.d.ts +60 -0
- package/dist/types/unsplash.d.ts.map +1 -0
- package/dist/types/unsplash.js +1 -0
- package/dist/ui/AssetBrowser.cjs +69 -104
- package/dist/ui/AssetBrowser.d.cts +17 -7
- package/dist/ui/AssetBrowser.d.cts.map +1 -1
- package/dist/ui/AssetBrowser.d.ts +17 -7
- package/dist/ui/AssetBrowser.d.ts.map +1 -1
- package/dist/ui/AssetBrowser.js +60 -99
- package/dist/ui/AssetCommandPalette.cjs +9 -5
- package/dist/ui/AssetManagerUI.cjs +17 -7
- package/dist/ui/AssetManagerUI.d.cts +19 -3
- package/dist/ui/AssetManagerUI.d.cts.map +1 -1
- package/dist/ui/AssetManagerUI.d.ts +19 -3
- package/dist/ui/AssetManagerUI.d.ts.map +1 -1
- package/dist/ui/AssetManagerUI.js +8 -2
- package/dist/ui/DeleteAssetDialog.cjs +9 -5
- package/dist/ui/DeleteFolderDialog.cjs +78 -0
- package/dist/ui/DeleteFolderDialog.d.cts +11 -0
- package/dist/ui/DeleteFolderDialog.d.cts.map +1 -0
- package/dist/ui/DeleteFolderDialog.d.ts +11 -0
- package/dist/ui/DeleteFolderDialog.d.ts.map +1 -0
- package/dist/ui/DeleteFolderDialog.js +40 -0
- package/dist/ui/EmptyFolderState.cjs +53 -0
- package/dist/ui/EmptyFolderState.d.cts +6 -0
- package/dist/ui/EmptyFolderState.d.cts.map +1 -0
- package/dist/ui/EmptyFolderState.d.ts +6 -0
- package/dist/ui/EmptyFolderState.d.ts.map +1 -0
- package/dist/ui/EmptyFolderState.js +15 -0
- package/dist/ui/FolderBreadcrumb.cjs +73 -0
- package/dist/ui/FolderBreadcrumb.d.cts +9 -0
- package/dist/ui/FolderBreadcrumb.d.cts.map +1 -0
- package/dist/ui/FolderBreadcrumb.d.ts +9 -0
- package/dist/ui/FolderBreadcrumb.d.ts.map +1 -0
- package/dist/ui/FolderBreadcrumb.js +35 -0
- package/dist/ui/FolderNameDialog.cjs +98 -0
- package/dist/ui/FolderNameDialog.d.cts +14 -0
- package/dist/ui/FolderNameDialog.d.cts.map +1 -0
- package/dist/ui/FolderNameDialog.d.ts +14 -0
- package/dist/ui/FolderNameDialog.d.ts.map +1 -0
- package/dist/ui/FolderNameDialog.js +60 -0
- package/dist/ui/FolderTree.cjs +83 -0
- package/dist/ui/FolderTree.d.cts +13 -0
- package/dist/ui/FolderTree.d.cts.map +1 -0
- package/dist/ui/FolderTree.d.ts +13 -0
- package/dist/ui/FolderTree.d.ts.map +1 -0
- package/dist/ui/FolderTree.js +42 -0
- package/dist/ui/MetadataPanel.cjs +16 -9
- package/dist/ui/MetadataPanel.d.cts.map +1 -1
- package/dist/ui/MetadataPanel.d.ts.map +1 -1
- package/dist/ui/MetadataPanel.js +7 -4
- package/dist/ui/MoveTargetPicker.cjs +84 -0
- package/dist/ui/MoveTargetPicker.d.cts +16 -0
- package/dist/ui/MoveTargetPicker.d.cts.map +1 -0
- package/dist/ui/MoveTargetPicker.d.ts +16 -0
- package/dist/ui/MoveTargetPicker.d.ts.map +1 -0
- package/dist/ui/MoveTargetPicker.js +46 -0
- package/dist/ui/ReplaceAssetDialog.cjs +9 -5
- package/dist/ui/ReplaceAssetDialog.d.cts +2 -1
- package/dist/ui/ReplaceAssetDialog.d.cts.map +1 -1
- package/dist/ui/ReplaceAssetDialog.d.ts +2 -1
- package/dist/ui/ReplaceAssetDialog.d.ts.map +1 -1
- package/dist/ui/UnsplashPanel.cjs +134 -0
- package/dist/ui/UnsplashPanel.d.cts +28 -0
- package/dist/ui/UnsplashPanel.d.cts.map +1 -0
- package/dist/ui/UnsplashPanel.d.ts +28 -0
- package/dist/ui/UnsplashPanel.d.ts.map +1 -0
- package/dist/ui/UnsplashPanel.js +96 -0
- package/dist/ui/UploadButton.cjs +10 -10
- package/dist/ui/UploadButton.d.cts +9 -2
- package/dist/ui/UploadButton.d.cts.map +1 -1
- package/dist/ui/UploadButton.d.ts +9 -2
- package/dist/ui/UploadButton.d.ts.map +1 -1
- package/dist/ui/UploadButton.js +1 -5
- package/dist/ui/index.cjs +46 -5
- package/dist/ui/index.d.cts +14 -0
- package/dist/ui/index.d.cts.map +1 -1
- package/dist/ui/index.d.ts +14 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +7 -0
- package/dist/utils/asset-reference.cjs +12 -8
- package/dist/utils/csp.cjs +12 -8
- package/dist/utils/data-source.cjs +177 -0
- package/dist/utils/data-source.d.cts +63 -0
- package/dist/utils/data-source.d.cts.map +1 -0
- package/dist/utils/data-source.d.ts +63 -0
- package/dist/utils/data-source.d.ts.map +1 -0
- package/dist/utils/data-source.js +136 -0
- package/dist/utils/errors.cjs +31 -9
- package/dist/utils/errors.d.cts +27 -0
- package/dist/utils/errors.d.cts.map +1 -1
- package/dist/utils/errors.d.ts +27 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +16 -1
- package/dist/utils/folders.cjs +261 -0
- package/dist/utils/folders.d.cts +49 -0
- package/dist/utils/folders.d.cts.map +1 -0
- package/dist/utils/folders.d.ts +49 -0
- package/dist/utils/folders.d.ts.map +1 -0
- package/dist/utils/folders.js +223 -0
- package/dist/utils/header-action.cjs +12 -8
- package/dist/utils/infer-kind.cjs +12 -8
- package/dist/utils/registry.cjs +36 -17
- package/dist/utils/registry.d.cts +21 -1
- package/dist/utils/registry.d.cts.map +1 -1
- package/dist/utils/registry.d.ts +21 -1
- package/dist/utils/registry.d.ts.map +1 -1
- package/dist/utils/registry.js +20 -11
- package/dist/utils/resolver.cjs +9 -5
- package/dist/utils/retry.cjs +13 -9
- package/dist/utils/studio-asset-source.cjs +14 -7
- package/dist/utils/studio-asset-source.d.cts +6 -1
- package/dist/utils/studio-asset-source.d.cts.map +1 -1
- package/dist/utils/studio-asset-source.d.ts +6 -1
- package/dist/utils/studio-asset-source.d.ts.map +1 -1
- package/dist/utils/studio-asset-source.js +1 -1
- package/dist/utils/validate-upload-result.cjs +9 -5
- package/dist/utils/validate-upload-result.d.cts +2 -1
- package/dist/utils/validate-upload-result.d.cts.map +1 -1
- package/dist/utils/validate-upload-result.d.ts +2 -1
- package/dist/utils/validate-upload-result.d.ts.map +1 -1
- package/dist/version.cjs +12 -8
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/meta/config.json +1 -1
- package/package.json +19 -9
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "@anvilkit/ui/button";
|
|
3
|
+
import { Input } from "@anvilkit/ui/input";
|
|
4
|
+
import * as __rspack_external_react from "react";
|
|
5
|
+
function UnsplashPanel({ themes, activeThemeId, onThemeChange, query, onQueryChange, results, status, onPick, onLoadMore, themeLabel = (key)=>key, skeletonCount = 12 }) {
|
|
6
|
+
if ("disabled" === status) return /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
7
|
+
role: "status",
|
|
8
|
+
"data-testid": "ak-unsplash-disabled",
|
|
9
|
+
className: "flex flex-col items-center gap-2 p-6 text-center text-sm text-[var(--ak-studio-muted-fg)]"
|
|
10
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement("p", null, "Connect Unsplash — add an access key via a server proxy."));
|
|
11
|
+
return /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
12
|
+
"data-testid": "ak-unsplash-panel",
|
|
13
|
+
className: "flex flex-col gap-2"
|
|
14
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement("span", {
|
|
15
|
+
role: "status",
|
|
16
|
+
"aria-live": "polite",
|
|
17
|
+
"data-testid": "ak-unsplash-status",
|
|
18
|
+
className: "sr-only"
|
|
19
|
+
}, "loading" === status ? "Loading photos…" : ""), /*#__PURE__*/ __rspack_external_react.createElement(Input, {
|
|
20
|
+
value: query,
|
|
21
|
+
placeholder: "Search Unsplash…",
|
|
22
|
+
"data-testid": "ak-unsplash-search",
|
|
23
|
+
onChange: (event)=>onQueryChange(event.currentTarget.value)
|
|
24
|
+
}), themes.length > 0 ? /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
25
|
+
role: "group",
|
|
26
|
+
"aria-label": "Unsplash themes",
|
|
27
|
+
"data-testid": "ak-unsplash-themes",
|
|
28
|
+
className: "flex flex-wrap gap-1"
|
|
29
|
+
}, themes.map((theme)=>/*#__PURE__*/ __rspack_external_react.createElement(Button, {
|
|
30
|
+
key: theme.id,
|
|
31
|
+
type: "button",
|
|
32
|
+
size: "sm",
|
|
33
|
+
variant: theme.id === activeThemeId ? "secondary" : "ghost",
|
|
34
|
+
"aria-pressed": theme.id === activeThemeId,
|
|
35
|
+
"data-theme-id": theme.id,
|
|
36
|
+
onClick: ()=>onThemeChange(theme.id === activeThemeId ? void 0 : theme.id)
|
|
37
|
+
}, themeLabel(theme.label)))) : null, "rateLimited" === status ? /*#__PURE__*/ __rspack_external_react.createElement("p", {
|
|
38
|
+
role: "alert",
|
|
39
|
+
"data-testid": "ak-unsplash-rate-limited",
|
|
40
|
+
className: "text-sm"
|
|
41
|
+
}, "Unsplash rate limit reached — try again shortly.") : null, "error" === status ? /*#__PURE__*/ __rspack_external_react.createElement("p", {
|
|
42
|
+
role: "alert",
|
|
43
|
+
"data-testid": "ak-unsplash-error",
|
|
44
|
+
className: "text-sm"
|
|
45
|
+
}, "Couldn’t reach Unsplash. Retry.") : null, "loading" === status && 0 === results.length ? /*#__PURE__*/ __rspack_external_react.createElement("ul", {
|
|
46
|
+
"data-testid": "ak-unsplash-skeletons",
|
|
47
|
+
className: "grid grid-cols-3 gap-2",
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}, Array.from({
|
|
50
|
+
length: skeletonCount
|
|
51
|
+
}, (_, index)=>/*#__PURE__*/ __rspack_external_react.createElement("li", {
|
|
52
|
+
key: `skeleton-${index}`,
|
|
53
|
+
className: "aspect-square animate-pulse rounded bg-[var(--ak-studio-muted,#e5e7eb)]"
|
|
54
|
+
}))) : 0 === results.length && "idle" === status ? /*#__PURE__*/ __rspack_external_react.createElement("p", {
|
|
55
|
+
"data-testid": "ak-unsplash-empty",
|
|
56
|
+
className: "p-4 text-center text-sm"
|
|
57
|
+
}, "Search Unsplash to browse photos.") : /*#__PURE__*/ __rspack_external_react.createElement("ul", {
|
|
58
|
+
"data-testid": "ak-unsplash-results",
|
|
59
|
+
className: "grid grid-cols-3 gap-2"
|
|
60
|
+
}, results.map((result)=>/*#__PURE__*/ __rspack_external_react.createElement("li", {
|
|
61
|
+
key: result.id,
|
|
62
|
+
className: "flex flex-col gap-0.5"
|
|
63
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
"data-unsplash-id": result.id,
|
|
66
|
+
"aria-label": `Insert photo by ${result.photographerName}`,
|
|
67
|
+
className: "overflow-hidden rounded",
|
|
68
|
+
onClick: ()=>void onPick(result.id)
|
|
69
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement("img", {
|
|
70
|
+
src: result.thumbnailUrl,
|
|
71
|
+
alt: `Photo by ${result.photographerName}`,
|
|
72
|
+
className: "aspect-square w-full object-cover",
|
|
73
|
+
loading: "lazy"
|
|
74
|
+
})), /*#__PURE__*/ __rspack_external_react.createElement("p", {
|
|
75
|
+
className: "truncate text-[10px] text-[var(--ak-studio-muted-fg)]"
|
|
76
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement("a", {
|
|
77
|
+
href: result.photographerUrl,
|
|
78
|
+
target: "_blank",
|
|
79
|
+
rel: "noreferrer noopener",
|
|
80
|
+
className: "underline"
|
|
81
|
+
}, result.photographerName), " ", "\xb7", " ", /*#__PURE__*/ __rspack_external_react.createElement("a", {
|
|
82
|
+
href: result.unsplashUrl,
|
|
83
|
+
target: "_blank",
|
|
84
|
+
rel: "noreferrer noopener",
|
|
85
|
+
className: "underline"
|
|
86
|
+
}, "Unsplash"))))), onLoadMore && results.length > 0 ? /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
87
|
+
className: "flex justify-center"
|
|
88
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement(Button, {
|
|
89
|
+
type: "button",
|
|
90
|
+
variant: "outline",
|
|
91
|
+
size: "sm",
|
|
92
|
+
disabled: "loading" === status,
|
|
93
|
+
onClick: onLoadMore
|
|
94
|
+
}, "Load more")) : null);
|
|
95
|
+
}
|
|
96
|
+
export { UnsplashPanel };
|
package/dist/ui/UploadButton.cjs
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
4
|
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
6
|
+
var define = (defs, kind)=>{
|
|
7
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
[kind]: defs[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
define(getters, "get");
|
|
13
|
+
define(values, "value");
|
|
10
14
|
};
|
|
11
15
|
})();
|
|
12
16
|
(()=>{
|
|
@@ -172,13 +176,9 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
|
|
|
172
176
|
function UploadSpinner() {
|
|
173
177
|
return /*#__PURE__*/ external_react_namespaceObject.createElement("svg", {
|
|
174
178
|
"aria-hidden": true,
|
|
179
|
+
className: "mr-1.5 inline-block animate-spin",
|
|
175
180
|
fill: "none",
|
|
176
181
|
height: 14,
|
|
177
|
-
style: {
|
|
178
|
-
display: "inline-block",
|
|
179
|
-
marginRight: 6,
|
|
180
|
-
animation: "spin 1s linear infinite"
|
|
181
|
-
},
|
|
182
182
|
viewBox: "0 0 24 24",
|
|
183
183
|
width: 14
|
|
184
184
|
}, /*#__PURE__*/ external_react_namespaceObject.createElement("circle", {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { AssetManagerOptions
|
|
1
|
+
import type { AssetManagerOptions } from "../types/options.js";
|
|
2
|
+
import type { UploadAdapter, UploadResult } from "../types/types.js";
|
|
2
3
|
export interface UploadProgressSnapshot {
|
|
3
4
|
readonly completed: number;
|
|
4
5
|
readonly total: number;
|
|
5
6
|
}
|
|
6
|
-
export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "
|
|
7
|
+
export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
|
|
8
|
+
/**
|
|
9
|
+
* Binary uploader. Required at the UI boundary even though
|
|
10
|
+
* `AssetManagerOptions.uploader` is optional — the plugin passes the
|
|
11
|
+
* resolved (defaulted) uploader, so the component never sees `undefined`.
|
|
12
|
+
*/
|
|
13
|
+
readonly uploader: UploadAdapter;
|
|
7
14
|
readonly onUploaded?: (asset: UploadResult) => void;
|
|
8
15
|
readonly onError?: (error: unknown) => void;
|
|
9
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.d.cts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UploadButton.d.cts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,mBAAmB,EACjB,mBAAmB,GACnB,aAAa,GACb,uBAAuB,GACvB,2BAA2B,CAC7B;IACD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,YAAY,CAAC,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,2CAgLnB"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { AssetManagerOptions
|
|
1
|
+
import type { AssetManagerOptions } from "../types/options.js";
|
|
2
|
+
import type { UploadAdapter, UploadResult } from "../types/types.js";
|
|
2
3
|
export interface UploadProgressSnapshot {
|
|
3
4
|
readonly completed: number;
|
|
4
5
|
readonly total: number;
|
|
5
6
|
}
|
|
6
|
-
export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "
|
|
7
|
+
export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
|
|
8
|
+
/**
|
|
9
|
+
* Binary uploader. Required at the UI boundary even though
|
|
10
|
+
* `AssetManagerOptions.uploader` is optional — the plugin passes the
|
|
11
|
+
* resolved (defaulted) uploader, so the component never sees `undefined`.
|
|
12
|
+
*/
|
|
13
|
+
readonly uploader: UploadAdapter;
|
|
7
14
|
readonly onUploaded?: (asset: UploadResult) => void;
|
|
8
15
|
readonly onError?: (error: unknown) => void;
|
|
9
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,mBAAmB,EACjB,mBAAmB,GACnB,aAAa,GACb,uBAAuB,GACvB,2BAA2B,CAC7B;IACD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,YAAY,CAAC,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,2CAgLnB"}
|
package/dist/ui/UploadButton.js
CHANGED
|
@@ -144,13 +144,9 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
|
|
|
144
144
|
function UploadSpinner() {
|
|
145
145
|
return /*#__PURE__*/ __rspack_external_react.createElement("svg", {
|
|
146
146
|
"aria-hidden": true,
|
|
147
|
+
className: "mr-1.5 inline-block animate-spin",
|
|
147
148
|
fill: "none",
|
|
148
149
|
height: 14,
|
|
149
|
-
style: {
|
|
150
|
-
display: "inline-block",
|
|
151
|
-
marginRight: 6,
|
|
152
|
-
animation: "spin 1s linear infinite"
|
|
153
|
-
},
|
|
154
150
|
viewBox: "0 0 24 24",
|
|
155
151
|
width: 14
|
|
156
152
|
}, /*#__PURE__*/ __rspack_external_react.createElement("circle", {
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -24,35 +28,72 @@ var __webpack_require__ = {};
|
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
ASSET_DRAG_MIME: ()=>external_FolderTree_cjs_namespaceObject.ASSET_DRAG_MIME,
|
|
27
32
|
AssetBrowser: ()=>external_AssetBrowser_cjs_namespaceObject.AssetBrowser,
|
|
28
33
|
AssetCommandPalette: ()=>external_AssetCommandPalette_cjs_namespaceObject.AssetCommandPalette,
|
|
29
34
|
AssetManagerUI: ()=>external_AssetManagerUI_cjs_namespaceObject.AssetManagerUI,
|
|
35
|
+
CreateFolderDialog: ()=>external_FolderNameDialog_cjs_namespaceObject.FolderNameDialog,
|
|
30
36
|
DeleteAssetDialog: ()=>external_DeleteAssetDialog_cjs_namespaceObject.DeleteAssetDialog,
|
|
37
|
+
DeleteFolderDialog: ()=>external_DeleteFolderDialog_cjs_namespaceObject.DeleteFolderDialog,
|
|
38
|
+
EmptyFolderState: ()=>external_EmptyFolderState_cjs_namespaceObject.EmptyFolderState,
|
|
39
|
+
FolderBreadcrumb: ()=>external_FolderBreadcrumb_cjs_namespaceObject.FolderBreadcrumb,
|
|
40
|
+
FolderNameDialog: ()=>external_FolderNameDialog_cjs_namespaceObject.FolderNameDialog,
|
|
41
|
+
FolderTree: ()=>external_FolderTree_cjs_namespaceObject.FolderTree,
|
|
31
42
|
MetadataPanel: ()=>external_MetadataPanel_cjs_namespaceObject.MetadataPanel,
|
|
43
|
+
MoveTargetPicker: ()=>external_MoveTargetPicker_cjs_namespaceObject.MoveTargetPicker,
|
|
44
|
+
RenameFolderDialog: ()=>external_FolderNameDialog_cjs_namespaceObject.FolderNameDialog,
|
|
32
45
|
ReplaceAssetDialog: ()=>external_ReplaceAssetDialog_cjs_namespaceObject.ReplaceAssetDialog,
|
|
46
|
+
UnsplashPanel: ()=>external_UnsplashPanel_cjs_namespaceObject.UnsplashPanel,
|
|
33
47
|
UploadButton: ()=>external_UploadButton_cjs_namespaceObject.UploadButton
|
|
34
48
|
});
|
|
35
49
|
const external_AssetBrowser_cjs_namespaceObject = require("./AssetBrowser.cjs");
|
|
36
50
|
const external_AssetCommandPalette_cjs_namespaceObject = require("./AssetCommandPalette.cjs");
|
|
37
51
|
const external_AssetManagerUI_cjs_namespaceObject = require("./AssetManagerUI.cjs");
|
|
38
52
|
const external_DeleteAssetDialog_cjs_namespaceObject = require("./DeleteAssetDialog.cjs");
|
|
53
|
+
const external_DeleteFolderDialog_cjs_namespaceObject = require("./DeleteFolderDialog.cjs");
|
|
54
|
+
const external_EmptyFolderState_cjs_namespaceObject = require("./EmptyFolderState.cjs");
|
|
55
|
+
const external_FolderBreadcrumb_cjs_namespaceObject = require("./FolderBreadcrumb.cjs");
|
|
56
|
+
const external_FolderNameDialog_cjs_namespaceObject = require("./FolderNameDialog.cjs");
|
|
57
|
+
const external_FolderTree_cjs_namespaceObject = require("./FolderTree.cjs");
|
|
39
58
|
const external_MetadataPanel_cjs_namespaceObject = require("./MetadataPanel.cjs");
|
|
59
|
+
const external_MoveTargetPicker_cjs_namespaceObject = require("./MoveTargetPicker.cjs");
|
|
40
60
|
const external_ReplaceAssetDialog_cjs_namespaceObject = require("./ReplaceAssetDialog.cjs");
|
|
61
|
+
const external_UnsplashPanel_cjs_namespaceObject = require("./UnsplashPanel.cjs");
|
|
41
62
|
const external_UploadButton_cjs_namespaceObject = require("./UploadButton.cjs");
|
|
63
|
+
exports.ASSET_DRAG_MIME = __webpack_exports__.ASSET_DRAG_MIME;
|
|
42
64
|
exports.AssetBrowser = __webpack_exports__.AssetBrowser;
|
|
43
65
|
exports.AssetCommandPalette = __webpack_exports__.AssetCommandPalette;
|
|
44
66
|
exports.AssetManagerUI = __webpack_exports__.AssetManagerUI;
|
|
67
|
+
exports.CreateFolderDialog = __webpack_exports__.CreateFolderDialog;
|
|
45
68
|
exports.DeleteAssetDialog = __webpack_exports__.DeleteAssetDialog;
|
|
69
|
+
exports.DeleteFolderDialog = __webpack_exports__.DeleteFolderDialog;
|
|
70
|
+
exports.EmptyFolderState = __webpack_exports__.EmptyFolderState;
|
|
71
|
+
exports.FolderBreadcrumb = __webpack_exports__.FolderBreadcrumb;
|
|
72
|
+
exports.FolderNameDialog = __webpack_exports__.FolderNameDialog;
|
|
73
|
+
exports.FolderTree = __webpack_exports__.FolderTree;
|
|
46
74
|
exports.MetadataPanel = __webpack_exports__.MetadataPanel;
|
|
75
|
+
exports.MoveTargetPicker = __webpack_exports__.MoveTargetPicker;
|
|
76
|
+
exports.RenameFolderDialog = __webpack_exports__.RenameFolderDialog;
|
|
47
77
|
exports.ReplaceAssetDialog = __webpack_exports__.ReplaceAssetDialog;
|
|
78
|
+
exports.UnsplashPanel = __webpack_exports__.UnsplashPanel;
|
|
48
79
|
exports.UploadButton = __webpack_exports__.UploadButton;
|
|
49
80
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
81
|
+
"ASSET_DRAG_MIME",
|
|
50
82
|
"AssetBrowser",
|
|
51
83
|
"AssetCommandPalette",
|
|
52
84
|
"AssetManagerUI",
|
|
85
|
+
"CreateFolderDialog",
|
|
53
86
|
"DeleteAssetDialog",
|
|
87
|
+
"DeleteFolderDialog",
|
|
88
|
+
"EmptyFolderState",
|
|
89
|
+
"FolderBreadcrumb",
|
|
90
|
+
"FolderNameDialog",
|
|
91
|
+
"FolderTree",
|
|
54
92
|
"MetadataPanel",
|
|
93
|
+
"MoveTargetPicker",
|
|
94
|
+
"RenameFolderDialog",
|
|
55
95
|
"ReplaceAssetDialog",
|
|
96
|
+
"UnsplashPanel",
|
|
56
97
|
"UploadButton"
|
|
57
98
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
58
99
|
Object.defineProperty(exports, '__esModule', {
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -6,10 +6,24 @@ export type { AssetManagerUIProps } from "./AssetManagerUI.js";
|
|
|
6
6
|
export { AssetManagerUI } from "./AssetManagerUI.js";
|
|
7
7
|
export type { DeleteAssetDialogProps } from "./DeleteAssetDialog.js";
|
|
8
8
|
export { DeleteAssetDialog } from "./DeleteAssetDialog.js";
|
|
9
|
+
export type { DeleteFolderDialogProps } from "./DeleteFolderDialog.js";
|
|
10
|
+
export { DeleteFolderDialog } from "./DeleteFolderDialog.js";
|
|
11
|
+
export type { EmptyFolderStateProps } from "./EmptyFolderState.js";
|
|
12
|
+
export { EmptyFolderState } from "./EmptyFolderState.js";
|
|
13
|
+
export type { FolderBreadcrumbProps } from "./FolderBreadcrumb.js";
|
|
14
|
+
export { FolderBreadcrumb } from "./FolderBreadcrumb.js";
|
|
15
|
+
export type { FolderNameDialogProps } from "./FolderNameDialog.js";
|
|
16
|
+
export { FolderNameDialog, FolderNameDialog as CreateFolderDialog, FolderNameDialog as RenameFolderDialog, } from "./FolderNameDialog.js";
|
|
17
|
+
export type { FolderTreeProps } from "./FolderTree.js";
|
|
18
|
+
export { ASSET_DRAG_MIME, FolderTree } from "./FolderTree.js";
|
|
9
19
|
export type { MetadataPanelProps } from "./MetadataPanel.js";
|
|
10
20
|
export { MetadataPanel } from "./MetadataPanel.js";
|
|
21
|
+
export type { MoveTargetPickerProps } from "./MoveTargetPicker.js";
|
|
22
|
+
export { MoveTargetPicker } from "./MoveTargetPicker.js";
|
|
11
23
|
export type { ReplaceAssetDialogProps } from "./ReplaceAssetDialog.js";
|
|
12
24
|
export { ReplaceAssetDialog } from "./ReplaceAssetDialog.js";
|
|
25
|
+
export type { UnsplashPanelProps, UnsplashPanelStatus, UnsplashResult, } from "./UnsplashPanel.js";
|
|
26
|
+
export { UnsplashPanel } from "./UnsplashPanel.js";
|
|
13
27
|
export type { UploadButtonProps, UploadProgressSnapshot, } from "./UploadButton.js";
|
|
14
28
|
export { UploadButton } from "./UploadButton.js";
|
|
15
29
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/ui/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EACN,gBAAgB,EAChB,gBAAgB,IAAI,kBAAkB,EACtC,gBAAgB,IAAI,kBAAkB,GACtC,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACX,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -6,10 +6,24 @@ export type { AssetManagerUIProps } from "./AssetManagerUI.js";
|
|
|
6
6
|
export { AssetManagerUI } from "./AssetManagerUI.js";
|
|
7
7
|
export type { DeleteAssetDialogProps } from "./DeleteAssetDialog.js";
|
|
8
8
|
export { DeleteAssetDialog } from "./DeleteAssetDialog.js";
|
|
9
|
+
export type { DeleteFolderDialogProps } from "./DeleteFolderDialog.js";
|
|
10
|
+
export { DeleteFolderDialog } from "./DeleteFolderDialog.js";
|
|
11
|
+
export type { EmptyFolderStateProps } from "./EmptyFolderState.js";
|
|
12
|
+
export { EmptyFolderState } from "./EmptyFolderState.js";
|
|
13
|
+
export type { FolderBreadcrumbProps } from "./FolderBreadcrumb.js";
|
|
14
|
+
export { FolderBreadcrumb } from "./FolderBreadcrumb.js";
|
|
15
|
+
export type { FolderNameDialogProps } from "./FolderNameDialog.js";
|
|
16
|
+
export { FolderNameDialog, FolderNameDialog as CreateFolderDialog, FolderNameDialog as RenameFolderDialog, } from "./FolderNameDialog.js";
|
|
17
|
+
export type { FolderTreeProps } from "./FolderTree.js";
|
|
18
|
+
export { ASSET_DRAG_MIME, FolderTree } from "./FolderTree.js";
|
|
9
19
|
export type { MetadataPanelProps } from "./MetadataPanel.js";
|
|
10
20
|
export { MetadataPanel } from "./MetadataPanel.js";
|
|
21
|
+
export type { MoveTargetPickerProps } from "./MoveTargetPicker.js";
|
|
22
|
+
export { MoveTargetPicker } from "./MoveTargetPicker.js";
|
|
11
23
|
export type { ReplaceAssetDialogProps } from "./ReplaceAssetDialog.js";
|
|
12
24
|
export { ReplaceAssetDialog } from "./ReplaceAssetDialog.js";
|
|
25
|
+
export type { UnsplashPanelProps, UnsplashPanelStatus, UnsplashResult, } from "./UnsplashPanel.js";
|
|
26
|
+
export { UnsplashPanel } from "./UnsplashPanel.js";
|
|
13
27
|
export type { UploadButtonProps, UploadProgressSnapshot, } from "./UploadButton.js";
|
|
14
28
|
export { UploadButton } from "./UploadButton.js";
|
|
15
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EACN,gBAAgB,EAChB,gBAAgB,IAAI,kBAAkB,EACtC,gBAAgB,IAAI,kBAAkB,GACtC,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACX,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/ui/index.js
CHANGED
|
@@ -2,6 +2,13 @@ export { AssetBrowser } from "./AssetBrowser.js";
|
|
|
2
2
|
export { AssetCommandPalette } from "./AssetCommandPalette.js";
|
|
3
3
|
export { AssetManagerUI } from "./AssetManagerUI.js";
|
|
4
4
|
export { DeleteAssetDialog } from "./DeleteAssetDialog.js";
|
|
5
|
+
export { DeleteFolderDialog } from "./DeleteFolderDialog.js";
|
|
6
|
+
export { EmptyFolderState } from "./EmptyFolderState.js";
|
|
7
|
+
export { FolderBreadcrumb } from "./FolderBreadcrumb.js";
|
|
8
|
+
export { FolderNameDialog as CreateFolderDialog, FolderNameDialog, FolderNameDialog as RenameFolderDialog } from "./FolderNameDialog.js";
|
|
9
|
+
export { ASSET_DRAG_MIME, FolderTree } from "./FolderTree.js";
|
|
5
10
|
export { MetadataPanel } from "./MetadataPanel.js";
|
|
11
|
+
export { MoveTargetPicker } from "./MoveTargetPicker.js";
|
|
6
12
|
export { ReplaceAssetDialog } from "./ReplaceAssetDialog.js";
|
|
13
|
+
export { UnsplashPanel } from "./UnsplashPanel.js";
|
|
7
14
|
export { UploadButton } from "./UploadButton.js";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,12 +27,12 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
createAssetReference: ()=>createAssetReference
|
|
28
|
-
});
|
|
29
30
|
function createAssetReference(id) {
|
|
30
31
|
return `asset://${id}`;
|
|
31
32
|
}
|
|
33
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
34
|
+
createAssetReference: ()=>createAssetReference
|
|
35
|
+
});
|
|
32
36
|
exports.createAssetReference = __webpack_exports__.createAssetReference;
|
|
33
37
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
34
38
|
"createAssetReference"
|
package/dist/utils/csp.cjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,9 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
getRequiredCsp: ()=>getRequiredCsp
|
|
28
|
-
});
|
|
29
30
|
function getRequiredCsp(options = {}) {
|
|
30
31
|
const connectSrc = new Set();
|
|
31
32
|
const imgSrc = new Set();
|
|
@@ -74,6 +75,9 @@ function parseOrigin(value) {
|
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
79
|
+
getRequiredCsp: ()=>getRequiredCsp
|
|
80
|
+
});
|
|
77
81
|
exports.getRequiredCsp = __webpack_exports__.getRequiredCsp;
|
|
78
82
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
83
|
"getRequiredCsp"
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
createInMemoryDataSource: ()=>createInMemoryDataSource,
|
|
32
|
+
resolveDataSource: ()=>resolveDataSource
|
|
33
|
+
});
|
|
34
|
+
const folders_cjs_namespaceObject = require("../types/folders.cjs");
|
|
35
|
+
const external_errors_cjs_namespaceObject = require("./errors.cjs");
|
|
36
|
+
const external_folders_cjs_namespaceObject = require("./folders.cjs");
|
|
37
|
+
const external_registry_cjs_namespaceObject = require("./registry.cjs");
|
|
38
|
+
function makeAbortError() {
|
|
39
|
+
if ("u" > typeof DOMException) return new DOMException("Operation aborted", "AbortError");
|
|
40
|
+
const error = new Error("Operation aborted");
|
|
41
|
+
error.name = "AbortError";
|
|
42
|
+
return error;
|
|
43
|
+
}
|
|
44
|
+
function createInMemoryDataSource(options) {
|
|
45
|
+
const { registry, upload, maxDepth } = options;
|
|
46
|
+
const folders = options.folderStore ?? (0, external_folders_cjs_namespaceObject.createFolderStore)();
|
|
47
|
+
const buildPage = (page, query)=>{
|
|
48
|
+
const base = {
|
|
49
|
+
items: page.items,
|
|
50
|
+
total: page.total,
|
|
51
|
+
nextCursor: page.nextCursor
|
|
52
|
+
};
|
|
53
|
+
if (void 0 === query.folderId) return base;
|
|
54
|
+
return {
|
|
55
|
+
...base,
|
|
56
|
+
folders: folders.listChildren(query.folderId),
|
|
57
|
+
folderPath: folders.path(query.folderId)
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
folders,
|
|
62
|
+
list (query) {
|
|
63
|
+
if (void 0 === query.folderId) return Promise.resolve(buildPage(registry.search(query), query));
|
|
64
|
+
const target = (0, folders_cjs_namespaceObject.resolveFolderId)(query.folderId);
|
|
65
|
+
const recursive = true === query.recursive;
|
|
66
|
+
const subtree = recursive && null !== target ? folders.subtreeIds(target) : void 0;
|
|
67
|
+
const matches = registry.list().filter((entry)=>{
|
|
68
|
+
const owner = folders.folderOf(entry.id);
|
|
69
|
+
const folderOk = recursive ? null === target ? true : null !== owner && subtree?.has(owner) === true : owner === target;
|
|
70
|
+
return folderOk && (0, external_registry_cjs_namespaceObject.assetMatchesSearch)(entry, query);
|
|
71
|
+
});
|
|
72
|
+
return Promise.resolve(buildPage((0, external_registry_cjs_namespaceObject.paginateMatches)(matches, query), query));
|
|
73
|
+
},
|
|
74
|
+
remove (id) {
|
|
75
|
+
registry.delete(id);
|
|
76
|
+
folders.removeAsset(id);
|
|
77
|
+
return Promise.resolve();
|
|
78
|
+
},
|
|
79
|
+
async replace (id, payload, signal) {
|
|
80
|
+
const result = await upload(payload, signal ? {
|
|
81
|
+
signal
|
|
82
|
+
} : void 0);
|
|
83
|
+
if (signal?.aborted) throw makeAbortError();
|
|
84
|
+
const replaced = registry.replace(id, result);
|
|
85
|
+
return replaced ?? result;
|
|
86
|
+
},
|
|
87
|
+
rename (id, name) {
|
|
88
|
+
const updated = registry.rename(id, name);
|
|
89
|
+
if (void 0 === updated) return Promise.reject(new external_errors_cjs_namespaceObject.AssetSourceError("ASSET_MUTATION_REJECTED", `Cannot rename unknown asset "${id}".`));
|
|
90
|
+
return Promise.resolve(updated);
|
|
91
|
+
},
|
|
92
|
+
move (id, folderId) {
|
|
93
|
+
folders.moveAsset(id, folderId);
|
|
94
|
+
return Promise.resolve();
|
|
95
|
+
},
|
|
96
|
+
createFolder (parentId, name) {
|
|
97
|
+
return Promise.resolve(folders.createFolder(parentId, name, maxDepth));
|
|
98
|
+
},
|
|
99
|
+
renameFolder (id, name) {
|
|
100
|
+
return Promise.resolve(folders.renameFolder(id, name));
|
|
101
|
+
},
|
|
102
|
+
removeFolder (id, opts) {
|
|
103
|
+
const { removedAssetIds } = folders.removeFolder(id, opts);
|
|
104
|
+
for (const assetId of removedAssetIds)registry.delete(assetId);
|
|
105
|
+
return Promise.resolve();
|
|
106
|
+
},
|
|
107
|
+
moveFolder (id, parentId) {
|
|
108
|
+
return Promise.resolve(folders.moveFolder(id, parentId, maxDepth));
|
|
109
|
+
},
|
|
110
|
+
subscribe (listener) {
|
|
111
|
+
const offRegistry = registry.subscribe(listener);
|
|
112
|
+
const offFolders = folders.subscribe(listener);
|
|
113
|
+
return ()=>{
|
|
114
|
+
offRegistry();
|
|
115
|
+
offFolders();
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
subscribeStatus (listener) {
|
|
119
|
+
listener({
|
|
120
|
+
phase: "idle"
|
|
121
|
+
});
|
|
122
|
+
return ()=>{};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const ASSET_PLANE = [
|
|
127
|
+
"list",
|
|
128
|
+
"remove",
|
|
129
|
+
"replace",
|
|
130
|
+
"rename",
|
|
131
|
+
"move"
|
|
132
|
+
];
|
|
133
|
+
const FOLDER_PLANE = [
|
|
134
|
+
"createFolder",
|
|
135
|
+
"renameFolder",
|
|
136
|
+
"removeFolder",
|
|
137
|
+
"moveFolder"
|
|
138
|
+
];
|
|
139
|
+
function resolveDataSource(input) {
|
|
140
|
+
const fallback = createInMemoryDataSource(input);
|
|
141
|
+
const host = input.hostDataSource;
|
|
142
|
+
if (void 0 === host) return fallback;
|
|
143
|
+
const ownsPlane = (plane, label)=>{
|
|
144
|
+
const provided = plane.filter((m)=>"function" == typeof host[m]);
|
|
145
|
+
if (0 === provided.length) return false;
|
|
146
|
+
if (provided.length === plane.length) return true;
|
|
147
|
+
input.warn?.(`asset-manager: dataSource provides a partial ${label} method set (${provided.join(", ")}) — falling back to the in-memory default for the whole ${label} plane. Provide all of {${plane.join(", ")}} or none.`);
|
|
148
|
+
return false;
|
|
149
|
+
};
|
|
150
|
+
const resolved = {
|
|
151
|
+
...fallback
|
|
152
|
+
};
|
|
153
|
+
if (ownsPlane(ASSET_PLANE, "asset")) {
|
|
154
|
+
resolved.list = host.list.bind(host);
|
|
155
|
+
resolved.remove = host.remove.bind(host);
|
|
156
|
+
resolved.replace = host.replace.bind(host);
|
|
157
|
+
resolved.rename = host.rename.bind(host);
|
|
158
|
+
resolved.move = host.move.bind(host);
|
|
159
|
+
}
|
|
160
|
+
if (ownsPlane(FOLDER_PLANE, "folder")) {
|
|
161
|
+
resolved.createFolder = host.createFolder.bind(host);
|
|
162
|
+
resolved.renameFolder = host.renameFolder.bind(host);
|
|
163
|
+
resolved.removeFolder = host.removeFolder.bind(host);
|
|
164
|
+
resolved.moveFolder = host.moveFolder.bind(host);
|
|
165
|
+
}
|
|
166
|
+
if ("function" == typeof host.subscribeStatus) resolved.subscribeStatus = host.subscribeStatus.bind(host);
|
|
167
|
+
return resolved;
|
|
168
|
+
}
|
|
169
|
+
exports.createInMemoryDataSource = __webpack_exports__.createInMemoryDataSource;
|
|
170
|
+
exports.resolveDataSource = __webpack_exports__.resolveDataSource;
|
|
171
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
172
|
+
"createInMemoryDataSource",
|
|
173
|
+
"resolveDataSource"
|
|
174
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
175
|
+
Object.defineProperty(exports, '__esModule', {
|
|
176
|
+
value: true
|
|
177
|
+
});
|