@anvilkit/plugin-asset-manager 0.1.6 → 0.1.8
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 +28 -20
- package/dist/adapters/data-url.d.cts +13 -0
- package/dist/adapters/data-url.d.cts.map +1 -1
- package/dist/adapters/data-url.d.ts +13 -0
- package/dist/adapters/data-url.d.ts.map +1 -1
- package/dist/adapters/in-memory.d.cts +8 -1
- package/dist/adapters/in-memory.d.cts.map +1 -1
- package/dist/adapters/in-memory.d.ts +8 -1
- package/dist/adapters/in-memory.d.ts.map +1 -1
- package/dist/i18n/entry.cjs +75 -0
- package/dist/i18n/entry.d.cts +15 -0
- package/dist/i18n/entry.d.cts.map +1 -0
- package/dist/i18n/entry.d.ts +15 -0
- package/dist/i18n/entry.d.ts.map +1 -0
- package/dist/i18n/entry.js +29 -0
- package/dist/i18n/provider.cjs +49 -0
- package/dist/i18n/provider.d.cts +20 -0
- package/dist/i18n/provider.d.cts.map +1 -0
- package/dist/i18n/provider.d.ts +20 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +11 -0
- package/dist/index.cjs +7 -0
- 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 +70 -5
- 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 +70 -5
- package/dist/sources/composite-source.cjs +138 -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 +100 -0
- package/dist/sources/federated-search.cjs +173 -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 +123 -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 +194 -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 +150 -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/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 +21 -27
- package/dist/types/types.d.cts.map +1 -1
- package/dist/types/types.d.ts +21 -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 +183 -121
- package/dist/ui/AssetBrowser.d.cts +12 -1
- package/dist/ui/AssetBrowser.d.cts.map +1 -1
- package/dist/ui/AssetBrowser.d.ts +12 -1
- package/dist/ui/AssetBrowser.d.ts.map +1 -1
- package/dist/ui/AssetBrowser.js +183 -121
- package/dist/ui/AssetCommandPalette.cjs +20 -18
- package/dist/ui/AssetCommandPalette.d.cts.map +1 -1
- package/dist/ui/AssetCommandPalette.d.ts.map +1 -1
- package/dist/ui/AssetCommandPalette.js +20 -18
- package/dist/ui/AssetManagerUI.cjs +31 -17
- 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 +31 -17
- package/dist/ui/DeleteAssetDialog.cjs +5 -3
- package/dist/ui/DeleteAssetDialog.d.cts.map +1 -1
- package/dist/ui/DeleteAssetDialog.d.ts.map +1 -1
- package/dist/ui/DeleteAssetDialog.js +5 -3
- package/dist/ui/DeleteFolderDialog.cjs +80 -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 +42 -0
- package/dist/ui/EmptyFolderState.cjs +56 -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 +18 -0
- package/dist/ui/FolderBreadcrumb.cjs +76 -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 +38 -0
- package/dist/ui/FolderNameDialog.cjs +105 -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 +67 -0
- package/dist/ui/FolderTree.cjs +85 -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 +44 -0
- package/dist/ui/MetadataPanel.cjs +23 -17
- package/dist/ui/MetadataPanel.d.cts.map +1 -1
- package/dist/ui/MetadataPanel.d.ts.map +1 -1
- package/dist/ui/MetadataPanel.js +23 -17
- package/dist/ui/MoveTargetPicker.cjs +87 -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 +49 -0
- package/dist/ui/ReplaceAssetDialog.cjs +19 -17
- 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/ReplaceAssetDialog.js +19 -17
- package/dist/ui/UnsplashPanel.cjs +137 -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 +99 -0
- package/dist/ui/UploadButton.cjs +12 -13
- 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 +12 -13
- package/dist/ui/index.cjs +41 -0
- package/dist/ui/index.d.cts +15 -0
- package/dist/ui/index.d.cts.map +1 -1
- package/dist/ui/index.d.ts +15 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +8 -0
- package/dist/utils/data-source.cjs +190 -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 +149 -0
- package/dist/utils/errors.cjs +18 -0
- 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 +335 -0
- package/dist/utils/folders.d.cts +54 -0
- package/dist/utils/folders.d.cts.map +1 -0
- package/dist/utils/folders.d.ts +54 -0
- package/dist/utils/folders.d.ts.map +1 -0
- package/dist/utils/folders.js +297 -0
- package/dist/utils/header-action.cjs +1 -1
- package/dist/utils/header-action.d.cts.map +1 -1
- package/dist/utils/header-action.d.ts.map +1 -1
- package/dist/utils/header-action.js +1 -1
- package/dist/utils/registry.cjs +38 -12
- package/dist/utils/registry.d.cts +29 -1
- package/dist/utils/registry.d.cts.map +1 -1
- package/dist/utils/registry.d.ts +29 -1
- package/dist/utils/registry.d.ts.map +1 -1
- package/dist/utils/registry.js +31 -11
- package/dist/utils/resolver.cjs +5 -4
- package/dist/utils/resolver.d.cts.map +1 -1
- package/dist/utils/resolver.d.ts.map +1 -1
- package/dist/utils/resolver.js +5 -4
- package/dist/utils/studio-asset-source.cjs +13 -4
- 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 +9 -3
- 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 +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/i18n/messages/en.json +99 -0
- package/i18n/messages/ja.json +99 -0
- package/i18n/messages/ko.json +99 -0
- package/i18n/messages/zh.json +99 -0
- package/meta/config.json +1 -1
- package/package.json +19 -8
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
function resolveFolderId(folderId) {
|
|
31
|
+
return folderId ?? null;
|
|
32
|
+
}
|
|
33
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
34
|
+
resolveFolderId: ()=>resolveFolderId
|
|
35
|
+
});
|
|
36
|
+
exports.resolveFolderId = __webpack_exports__.resolveFolderId;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"resolveFolderId"
|
|
39
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
+
Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: true
|
|
42
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Folder model for the asset library (PRD 0002 §3.1).
|
|
3
|
+
*
|
|
4
|
+
* Folders form an arbitrarily-deep tree keyed by {@link AssetFolder.parentId};
|
|
5
|
+
* `null` is the single root convention everywhere a folder id is accepted —
|
|
6
|
+
* there is no string sentinel. Folder *membership* (which folder an asset lives
|
|
7
|
+
* in) is a registry-owned side-index, NOT a field on `UploadResult`, so these
|
|
8
|
+
* types never bleed into the freeze/validate reconstruction of an asset.
|
|
9
|
+
*/
|
|
10
|
+
/** Canonical id of a folder. `null` (never a real id) denotes the root. */
|
|
11
|
+
export type FolderId = string;
|
|
12
|
+
export interface AssetFolder {
|
|
13
|
+
readonly id: FolderId;
|
|
14
|
+
/** Display name; trimmed, non-empty. Siblings are case-insensitively unique. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** Parent container. `null` ⇒ top level. */
|
|
17
|
+
readonly parentId: FolderId | null;
|
|
18
|
+
/** Epoch-ms creation timestamp (stamped via an injected clock, test-friendly). */
|
|
19
|
+
readonly createdAt: number;
|
|
20
|
+
/** Epoch-ms last-mutation timestamp. */
|
|
21
|
+
readonly updatedAt: number;
|
|
22
|
+
/**
|
|
23
|
+
* Denormalized direct-child counts for cheap tree rendering. NEVER the
|
|
24
|
+
* source of truth for membership — the asset→folder side-index is.
|
|
25
|
+
*/
|
|
26
|
+
readonly counts: {
|
|
27
|
+
readonly assets: number;
|
|
28
|
+
readonly folders: number;
|
|
29
|
+
};
|
|
30
|
+
/** Optional host-opaque metadata (e.g. color label, ACL). */
|
|
31
|
+
readonly meta?: Readonly<Record<string, string | number | boolean>>;
|
|
32
|
+
}
|
|
33
|
+
export interface FolderOptions {
|
|
34
|
+
/** Maximum nesting depth. `undefined` ⇒ unbounded. */
|
|
35
|
+
readonly maxDepth?: number;
|
|
36
|
+
/** Allow moving assets/folders. `undefined` ⇒ treated as `true`. */
|
|
37
|
+
readonly allowMove?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalize a folder-id input to the canonical root convention: `undefined`
|
|
41
|
+
* and `null` both collapse to `null` (root); a real id is returned unchanged.
|
|
42
|
+
* This is the only folder-id normalization helper — there is no `__root__`
|
|
43
|
+
* sentinel to expand or collapse.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveFolderId(folderId?: FolderId | null): FolderId | null;
|
|
46
|
+
//# sourceMappingURL=folders.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folders.d.cts","sourceRoot":"","sources":["../../src/types/folders.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,aAAa;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAE3E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Folder model for the asset library (PRD 0002 §3.1).
|
|
3
|
+
*
|
|
4
|
+
* Folders form an arbitrarily-deep tree keyed by {@link AssetFolder.parentId};
|
|
5
|
+
* `null` is the single root convention everywhere a folder id is accepted —
|
|
6
|
+
* there is no string sentinel. Folder *membership* (which folder an asset lives
|
|
7
|
+
* in) is a registry-owned side-index, NOT a field on `UploadResult`, so these
|
|
8
|
+
* types never bleed into the freeze/validate reconstruction of an asset.
|
|
9
|
+
*/
|
|
10
|
+
/** Canonical id of a folder. `null` (never a real id) denotes the root. */
|
|
11
|
+
export type FolderId = string;
|
|
12
|
+
export interface AssetFolder {
|
|
13
|
+
readonly id: FolderId;
|
|
14
|
+
/** Display name; trimmed, non-empty. Siblings are case-insensitively unique. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** Parent container. `null` ⇒ top level. */
|
|
17
|
+
readonly parentId: FolderId | null;
|
|
18
|
+
/** Epoch-ms creation timestamp (stamped via an injected clock, test-friendly). */
|
|
19
|
+
readonly createdAt: number;
|
|
20
|
+
/** Epoch-ms last-mutation timestamp. */
|
|
21
|
+
readonly updatedAt: number;
|
|
22
|
+
/**
|
|
23
|
+
* Denormalized direct-child counts for cheap tree rendering. NEVER the
|
|
24
|
+
* source of truth for membership — the asset→folder side-index is.
|
|
25
|
+
*/
|
|
26
|
+
readonly counts: {
|
|
27
|
+
readonly assets: number;
|
|
28
|
+
readonly folders: number;
|
|
29
|
+
};
|
|
30
|
+
/** Optional host-opaque metadata (e.g. color label, ACL). */
|
|
31
|
+
readonly meta?: Readonly<Record<string, string | number | boolean>>;
|
|
32
|
+
}
|
|
33
|
+
export interface FolderOptions {
|
|
34
|
+
/** Maximum nesting depth. `undefined` ⇒ unbounded. */
|
|
35
|
+
readonly maxDepth?: number;
|
|
36
|
+
/** Allow moving assets/folders. `undefined` ⇒ treated as `true`. */
|
|
37
|
+
readonly allowMove?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalize a folder-id input to the canonical root convention: `undefined`
|
|
41
|
+
* and `null` both collapse to `null` (root); a real id is returned unchanged.
|
|
42
|
+
* This is the only folder-id normalization helper — there is no `__root__`
|
|
43
|
+
* sentinel to expand or collapse.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveFolderId(folderId?: FolderId | null): FolderId | null;
|
|
46
|
+
//# sourceMappingURL=folders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folders.d.ts","sourceRoot":"","sources":["../../src/types/folders.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,aAAa;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAE3E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The asset-manager plugin's public options surface (PRD 0002 §4).
|
|
3
|
+
*
|
|
4
|
+
* Hoisted out of `types.ts` into its own module so it can aggregate the new
|
|
5
|
+
* data-source / folder / provider / category / Unsplash contracts WITHOUT
|
|
6
|
+
* forming an import cycle (those modules depend on `types.ts`; this one sits
|
|
7
|
+
* above them). The public name `AssetManagerOptions` is unchanged and
|
|
8
|
+
* re-exported from the package barrel — a pure relocation, not a rename.
|
|
9
|
+
*/
|
|
10
|
+
import type { AssetSourceProvider } from "../sources/provider.js";
|
|
11
|
+
import type { AssetCategory, AssetFacetDefinition } from "./categories.js";
|
|
12
|
+
import type { AssetDataSource } from "./data-source.js";
|
|
13
|
+
import type { FolderOptions } from "./folders.js";
|
|
14
|
+
import type { UploadAdapter, UploadResult } from "./types.js";
|
|
15
|
+
import type { UnsplashSourceOptions } from "./unsplash.js";
|
|
16
|
+
export interface AssetManagerOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Binary ingest: `File → UploadResult`. WIDENED to optional in PRD 0002 —
|
|
19
|
+
* omitted ⇒ the plugin resolves the built-in `inMemoryUploader()`, so
|
|
20
|
+
* `createAssetManagerPlugin()` works with zero config. The resolved value is
|
|
21
|
+
* always non-optional internally; every existing `{ uploader }` caller still
|
|
22
|
+
* assigns (pure widening).
|
|
23
|
+
*/
|
|
24
|
+
readonly uploader?: UploadAdapter;
|
|
25
|
+
/**
|
|
26
|
+
* Unified local-library data plane (list + asset/folder CRUD). Omitted ⇒ a
|
|
27
|
+
* full in-memory default over the built-in registry + a folder side-index.
|
|
28
|
+
*/
|
|
29
|
+
readonly dataSource?: AssetDataSource;
|
|
30
|
+
/**
|
|
31
|
+
* Enable folder management. `true` (default) ⇒ in-memory folder store;
|
|
32
|
+
* `false` ⇒ flat library (today's UX); an object tunes depth / move.
|
|
33
|
+
*/
|
|
34
|
+
readonly folders?: boolean | FolderOptions;
|
|
35
|
+
/** Additional external read-only sources (federated tabs, e.g. Unsplash). */
|
|
36
|
+
readonly providers?: readonly AssetSourceProvider[];
|
|
37
|
+
/**
|
|
38
|
+
* Built-in Unsplash source config — sugar that builds + registers an Unsplash
|
|
39
|
+
* provider. Enabled when a proxy endpoint or access key is present; the
|
|
40
|
+
* package never bundles a key.
|
|
41
|
+
*/
|
|
42
|
+
readonly unsplash?: UnsplashSourceOptions;
|
|
43
|
+
/** Host saved-view chips shown beside the kind chips. */
|
|
44
|
+
readonly categories?: readonly AssetCategory[];
|
|
45
|
+
/** Host-registered custom facets, merged onto the built-ins. */
|
|
46
|
+
readonly facets?: readonly AssetFacetDefinition[];
|
|
47
|
+
readonly maxFileSize?: number;
|
|
48
|
+
readonly acceptedMimeTypes?: readonly string[];
|
|
49
|
+
/**
|
|
50
|
+
* Permit `data:` URLs through the trust boundary. Defaults to `false` —
|
|
51
|
+
* `http`, `https`, and `blob` are always allowed; every other scheme is
|
|
52
|
+
* rejected. Replaced the previous `urlAllowlist: ["data"]` pattern in v1.0.
|
|
53
|
+
*/
|
|
54
|
+
readonly dataUrlAllowlistOptIn?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Permit `http(s)` URLs whose hostname mixes Unicode scripts. Defaults to
|
|
57
|
+
* `false` (homoglyph-attack guard). Single-script IDN hosts are always
|
|
58
|
+
* allowed regardless of this flag.
|
|
59
|
+
*/
|
|
60
|
+
readonly allowMixedScriptHostnames?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional thumbnail derivation. Returning a string sets
|
|
63
|
+
* `StudioAsset.thumbnailUrl`; returning `undefined` suppresses the thumbnail
|
|
64
|
+
* (overriding the default-for-images behavior).
|
|
65
|
+
*/
|
|
66
|
+
readonly getThumbnail?: (entry: UploadResult) => string | undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=options.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.cts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAC1C,yDAAyD;IACzD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAGlD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,GAAG,SAAS,CAAC;CACpE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The asset-manager plugin's public options surface (PRD 0002 §4).
|
|
3
|
+
*
|
|
4
|
+
* Hoisted out of `types.ts` into its own module so it can aggregate the new
|
|
5
|
+
* data-source / folder / provider / category / Unsplash contracts WITHOUT
|
|
6
|
+
* forming an import cycle (those modules depend on `types.ts`; this one sits
|
|
7
|
+
* above them). The public name `AssetManagerOptions` is unchanged and
|
|
8
|
+
* re-exported from the package barrel — a pure relocation, not a rename.
|
|
9
|
+
*/
|
|
10
|
+
import type { AssetSourceProvider } from "../sources/provider.js";
|
|
11
|
+
import type { AssetCategory, AssetFacetDefinition } from "./categories.js";
|
|
12
|
+
import type { AssetDataSource } from "./data-source.js";
|
|
13
|
+
import type { FolderOptions } from "./folders.js";
|
|
14
|
+
import type { UploadAdapter, UploadResult } from "./types.js";
|
|
15
|
+
import type { UnsplashSourceOptions } from "./unsplash.js";
|
|
16
|
+
export interface AssetManagerOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Binary ingest: `File → UploadResult`. WIDENED to optional in PRD 0002 —
|
|
19
|
+
* omitted ⇒ the plugin resolves the built-in `inMemoryUploader()`, so
|
|
20
|
+
* `createAssetManagerPlugin()` works with zero config. The resolved value is
|
|
21
|
+
* always non-optional internally; every existing `{ uploader }` caller still
|
|
22
|
+
* assigns (pure widening).
|
|
23
|
+
*/
|
|
24
|
+
readonly uploader?: UploadAdapter;
|
|
25
|
+
/**
|
|
26
|
+
* Unified local-library data plane (list + asset/folder CRUD). Omitted ⇒ a
|
|
27
|
+
* full in-memory default over the built-in registry + a folder side-index.
|
|
28
|
+
*/
|
|
29
|
+
readonly dataSource?: AssetDataSource;
|
|
30
|
+
/**
|
|
31
|
+
* Enable folder management. `true` (default) ⇒ in-memory folder store;
|
|
32
|
+
* `false` ⇒ flat library (today's UX); an object tunes depth / move.
|
|
33
|
+
*/
|
|
34
|
+
readonly folders?: boolean | FolderOptions;
|
|
35
|
+
/** Additional external read-only sources (federated tabs, e.g. Unsplash). */
|
|
36
|
+
readonly providers?: readonly AssetSourceProvider[];
|
|
37
|
+
/**
|
|
38
|
+
* Built-in Unsplash source config — sugar that builds + registers an Unsplash
|
|
39
|
+
* provider. Enabled when a proxy endpoint or access key is present; the
|
|
40
|
+
* package never bundles a key.
|
|
41
|
+
*/
|
|
42
|
+
readonly unsplash?: UnsplashSourceOptions;
|
|
43
|
+
/** Host saved-view chips shown beside the kind chips. */
|
|
44
|
+
readonly categories?: readonly AssetCategory[];
|
|
45
|
+
/** Host-registered custom facets, merged onto the built-ins. */
|
|
46
|
+
readonly facets?: readonly AssetFacetDefinition[];
|
|
47
|
+
readonly maxFileSize?: number;
|
|
48
|
+
readonly acceptedMimeTypes?: readonly string[];
|
|
49
|
+
/**
|
|
50
|
+
* Permit `data:` URLs through the trust boundary. Defaults to `false` —
|
|
51
|
+
* `http`, `https`, and `blob` are always allowed; every other scheme is
|
|
52
|
+
* rejected. Replaced the previous `urlAllowlist: ["data"]` pattern in v1.0.
|
|
53
|
+
*/
|
|
54
|
+
readonly dataUrlAllowlistOptIn?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Permit `http(s)` URLs whose hostname mixes Unicode scripts. Defaults to
|
|
57
|
+
* `false` (homoglyph-attack guard). Single-script IDN hosts are always
|
|
58
|
+
* allowed regardless of this flag.
|
|
59
|
+
*/
|
|
60
|
+
readonly allowMixedScriptHostnames?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional thumbnail derivation. Returning a string sets
|
|
63
|
+
* `StudioAsset.thumbnailUrl`; returning `undefined` suppresses the thumbnail
|
|
64
|
+
* (overriding the default-for-images behavior).
|
|
65
|
+
*/
|
|
66
|
+
readonly getThumbnail?: (entry: UploadResult) => string | undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc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|
+
* Optional provenance/attribution for externally-sourced assets (PRD 0002
|
|
8
|
+
* §8.4). Set when an asset is inserted from a credit-requiring provider such
|
|
9
|
+
* as Unsplash; export plugins read it to emit the required photographer +
|
|
10
|
+
* source credit. NOTE: the in-memory registry's freeze reconstructor is
|
|
11
|
+
* extended to preserve this field in Phase 1 (M5); the type is additive here.
|
|
12
|
+
*/
|
|
13
|
+
readonly attribution?: {
|
|
14
|
+
/**
|
|
15
|
+
* Provider that requires the credit. Open string union: `"unsplash"`
|
|
16
|
+
* keeps autocomplete while a future credit-requiring provider (Pexels,
|
|
17
|
+
* etc.) can set its own id without a breaking type change. Mirrors the
|
|
18
|
+
* `AssetSourceId` idiom.
|
|
19
|
+
*/
|
|
20
|
+
readonly source: "unsplash" | (string & {});
|
|
21
|
+
readonly photographerName: string;
|
|
22
|
+
readonly photographerUrl: string;
|
|
23
|
+
readonly unsplashUrl: string;
|
|
24
|
+
readonly photoUrl: string;
|
|
25
|
+
readonly downloadLocation: string;
|
|
26
|
+
};
|
|
6
27
|
}
|
|
7
28
|
/**
|
|
8
29
|
* Library-management kind union surfaced by `AssetRegistry.search` and
|
|
@@ -40,33 +61,6 @@ export interface UploadAdapterOptions {
|
|
|
40
61
|
readonly signal?: AbortSignal;
|
|
41
62
|
}
|
|
42
63
|
export type UploadAdapter = (file: File, options?: UploadAdapterOptions) => Promise<UploadResult>;
|
|
43
|
-
export interface AssetManagerOptions {
|
|
44
|
-
readonly uploader: UploadAdapter;
|
|
45
|
-
readonly maxFileSize?: number;
|
|
46
|
-
readonly acceptedMimeTypes?: readonly string[];
|
|
47
|
-
/**
|
|
48
|
-
* Permit `data:` URLs to flow through the trust boundary. Defaults to
|
|
49
|
-
* `false` — `http`, `https`, and `blob` are always allowed; every
|
|
50
|
-
* other scheme is rejected. The previous `urlAllowlist: ["data"]`
|
|
51
|
-
* pattern is replaced by this typed flag in v1.0.
|
|
52
|
-
*/
|
|
53
|
-
readonly dataUrlAllowlistOptIn?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Permit `http(s)` URLs whose hostname mixes Unicode scripts (e.g.
|
|
56
|
-
* `аpple.com` blending Cyrillic and Latin). Defaults to `false` —
|
|
57
|
-
* mixed-script hostnames are rejected as a homoglyph-attack guard.
|
|
58
|
-
* Single-script IDN hosts (e.g. `münchen.de`, `日本.jp`) are always
|
|
59
|
-
* allowed regardless of this flag.
|
|
60
|
-
*/
|
|
61
|
-
readonly allowMixedScriptHostnames?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Optional thumbnail derivation passed to {@link createStudioAssetSource}.
|
|
64
|
-
* Returning a string sets `StudioAsset.thumbnailUrl`; returning
|
|
65
|
-
* `undefined` suppresses the thumbnail (overriding the default-for-images
|
|
66
|
-
* behavior).
|
|
67
|
-
*/
|
|
68
|
-
readonly getThumbnail?: (entry: UploadResult) => string | undefined;
|
|
69
|
-
}
|
|
70
64
|
/**
|
|
71
65
|
* Listener invoked after every registry mutation
|
|
72
66
|
* (`register` / `delete` / `rename` / `replace` / `setTags`). The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,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CAAC;IACnE;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,MAAM,IAAI,CAAC;CACpE"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,6 +3,27 @@ export interface AssetMeta {
|
|
|
3
3
|
readonly mimeType?: string;
|
|
4
4
|
readonly width?: number;
|
|
5
5
|
readonly height?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Optional provenance/attribution for externally-sourced assets (PRD 0002
|
|
8
|
+
* §8.4). Set when an asset is inserted from a credit-requiring provider such
|
|
9
|
+
* as Unsplash; export plugins read it to emit the required photographer +
|
|
10
|
+
* source credit. NOTE: the in-memory registry's freeze reconstructor is
|
|
11
|
+
* extended to preserve this field in Phase 1 (M5); the type is additive here.
|
|
12
|
+
*/
|
|
13
|
+
readonly attribution?: {
|
|
14
|
+
/**
|
|
15
|
+
* Provider that requires the credit. Open string union: `"unsplash"`
|
|
16
|
+
* keeps autocomplete while a future credit-requiring provider (Pexels,
|
|
17
|
+
* etc.) can set its own id without a breaking type change. Mirrors the
|
|
18
|
+
* `AssetSourceId` idiom.
|
|
19
|
+
*/
|
|
20
|
+
readonly source: "unsplash" | (string & {});
|
|
21
|
+
readonly photographerName: string;
|
|
22
|
+
readonly photographerUrl: string;
|
|
23
|
+
readonly unsplashUrl: string;
|
|
24
|
+
readonly photoUrl: string;
|
|
25
|
+
readonly downloadLocation: string;
|
|
26
|
+
};
|
|
6
27
|
}
|
|
7
28
|
/**
|
|
8
29
|
* Library-management kind union surfaced by `AssetRegistry.search` and
|
|
@@ -40,33 +61,6 @@ export interface UploadAdapterOptions {
|
|
|
40
61
|
readonly signal?: AbortSignal;
|
|
41
62
|
}
|
|
42
63
|
export type UploadAdapter = (file: File, options?: UploadAdapterOptions) => Promise<UploadResult>;
|
|
43
|
-
export interface AssetManagerOptions {
|
|
44
|
-
readonly uploader: UploadAdapter;
|
|
45
|
-
readonly maxFileSize?: number;
|
|
46
|
-
readonly acceptedMimeTypes?: readonly string[];
|
|
47
|
-
/**
|
|
48
|
-
* Permit `data:` URLs to flow through the trust boundary. Defaults to
|
|
49
|
-
* `false` — `http`, `https`, and `blob` are always allowed; every
|
|
50
|
-
* other scheme is rejected. The previous `urlAllowlist: ["data"]`
|
|
51
|
-
* pattern is replaced by this typed flag in v1.0.
|
|
52
|
-
*/
|
|
53
|
-
readonly dataUrlAllowlistOptIn?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Permit `http(s)` URLs whose hostname mixes Unicode scripts (e.g.
|
|
56
|
-
* `аpple.com` blending Cyrillic and Latin). Defaults to `false` —
|
|
57
|
-
* mixed-script hostnames are rejected as a homoglyph-attack guard.
|
|
58
|
-
* Single-script IDN hosts (e.g. `münchen.de`, `日本.jp`) are always
|
|
59
|
-
* allowed regardless of this flag.
|
|
60
|
-
*/
|
|
61
|
-
readonly allowMixedScriptHostnames?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Optional thumbnail derivation passed to {@link createStudioAssetSource}.
|
|
64
|
-
* Returning a string sets `StudioAsset.thumbnailUrl`; returning
|
|
65
|
-
* `undefined` suppresses the thumbnail (overriding the default-for-images
|
|
66
|
-
* behavior).
|
|
67
|
-
*/
|
|
68
|
-
readonly getThumbnail?: (entry: UploadResult) => string | undefined;
|
|
69
|
-
}
|
|
70
64
|
/**
|
|
71
65
|
* Listener invoked after every registry mutation
|
|
72
66
|
* (`register` / `delete` / `rename` / `replace` / `setTags`). The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;
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,EAAE,YAAY,KACd,YAAY,GAAG,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,CACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,MAAM,EAAE,KACnB,YAAY,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,eAAe,CAAC;IACnE;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,MAAM,IAAI,CAAC;CACpE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Unsplash configuration types (PRD 0002 §8.2, §8.3).
|
|
3
|
+
*
|
|
4
|
+
* Types only — the runtime client, default themes, and `resolveThemes` land in
|
|
5
|
+
* Phase 1 under the lazy `./sources/unsplash` subpath. Defining the config shape
|
|
6
|
+
* here keeps the `AssetManagerOptions.unsplash` field fully typed now.
|
|
7
|
+
*/
|
|
8
|
+
export interface UnsplashTheme {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
/** i18n message key (not inline copy). */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Tried first via `GET /topics/:id/photos`. */
|
|
13
|
+
readonly topicSlugs?: readonly string[];
|
|
14
|
+
/** Fallback / supplement via `GET /search/photos`. */
|
|
15
|
+
readonly query?: string;
|
|
16
|
+
readonly orientation?: "landscape" | "portrait" | "squarish";
|
|
17
|
+
/** Defaults to `"high"`. */
|
|
18
|
+
readonly contentFilter?: "low" | "high";
|
|
19
|
+
}
|
|
20
|
+
export interface UnsplashThemeConfig {
|
|
21
|
+
/** Replace the default theme set entirely. */
|
|
22
|
+
readonly themes?: readonly UnsplashTheme[];
|
|
23
|
+
/** Append to the defaults. */
|
|
24
|
+
readonly additionalThemes?: readonly UnsplashTheme[];
|
|
25
|
+
/** Theme ids to drop from the defaults. */
|
|
26
|
+
readonly excludeThemes?: readonly string[];
|
|
27
|
+
readonly defaultThemeId?: string;
|
|
28
|
+
/** When `false`, the `__all__` free-search pseudo-theme is not prepended. */
|
|
29
|
+
readonly allowFreeSearch?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface UnsplashSourceOptions {
|
|
32
|
+
/** RECOMMENDED — proxy injects the `Client-ID` server-side. */
|
|
33
|
+
readonly proxyEndpoint?: string | URL;
|
|
34
|
+
/** DEV ONLY — ships the key to the browser; ignored when `proxyEndpoint` is set. */
|
|
35
|
+
readonly accessKey?: string;
|
|
36
|
+
/** Defaults to `!!(proxyEndpoint || accessKey)`; the package never bundles a key. */
|
|
37
|
+
readonly enabled?: boolean;
|
|
38
|
+
/** REQUIRED when enabled — `utm_source` for mandatory attribution. */
|
|
39
|
+
readonly appName: string;
|
|
40
|
+
readonly themes?: UnsplashThemeConfig;
|
|
41
|
+
/** Default 24 (clamped 1–30). */
|
|
42
|
+
readonly perPage?: number;
|
|
43
|
+
/** Throttle floor between JSON requests. Default 1200. */
|
|
44
|
+
readonly minRequestIntervalMs?: number;
|
|
45
|
+
/** Result LRU TTL. Default 300_000. */
|
|
46
|
+
readonly cacheTtlMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Per-request timeout for search / topic / photo lookups (ms). A request
|
|
49
|
+
* that exceeds it aborts and surfaces as a retryable `PROVIDER_NETWORK`
|
|
50
|
+
* error, so a blocked or flaky network path (e.g. a VPN/proxy black-holing
|
|
51
|
+
* `api.unsplash.com`) lets the sidebar fall back to "Unsplash unavailable"
|
|
52
|
+
* instead of spinning. Default 15_000. Ignored if not a positive number.
|
|
53
|
+
*/
|
|
54
|
+
readonly requestTimeoutMs?: number;
|
|
55
|
+
/** Injectable fetch for tests / SSR. */
|
|
56
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
57
|
+
/** Opt-in re-host instead of hotlinking. Default false. */
|
|
58
|
+
readonly rehostOnPick?: boolean;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=unsplash.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsplash.d.cts","sourceRoot":"","sources":["../../src/types/unsplash.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IAC7D,4BAA4B;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IACnC,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACrD,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,qBAAqB;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACtC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACtC,iCAAiC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,uCAAuC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CAChC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Unsplash configuration types (PRD 0002 §8.2, §8.3).
|
|
3
|
+
*
|
|
4
|
+
* Types only — the runtime client, default themes, and `resolveThemes` land in
|
|
5
|
+
* Phase 1 under the lazy `./sources/unsplash` subpath. Defining the config shape
|
|
6
|
+
* here keeps the `AssetManagerOptions.unsplash` field fully typed now.
|
|
7
|
+
*/
|
|
8
|
+
export interface UnsplashTheme {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
/** i18n message key (not inline copy). */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Tried first via `GET /topics/:id/photos`. */
|
|
13
|
+
readonly topicSlugs?: readonly string[];
|
|
14
|
+
/** Fallback / supplement via `GET /search/photos`. */
|
|
15
|
+
readonly query?: string;
|
|
16
|
+
readonly orientation?: "landscape" | "portrait" | "squarish";
|
|
17
|
+
/** Defaults to `"high"`. */
|
|
18
|
+
readonly contentFilter?: "low" | "high";
|
|
19
|
+
}
|
|
20
|
+
export interface UnsplashThemeConfig {
|
|
21
|
+
/** Replace the default theme set entirely. */
|
|
22
|
+
readonly themes?: readonly UnsplashTheme[];
|
|
23
|
+
/** Append to the defaults. */
|
|
24
|
+
readonly additionalThemes?: readonly UnsplashTheme[];
|
|
25
|
+
/** Theme ids to drop from the defaults. */
|
|
26
|
+
readonly excludeThemes?: readonly string[];
|
|
27
|
+
readonly defaultThemeId?: string;
|
|
28
|
+
/** When `false`, the `__all__` free-search pseudo-theme is not prepended. */
|
|
29
|
+
readonly allowFreeSearch?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface UnsplashSourceOptions {
|
|
32
|
+
/** RECOMMENDED — proxy injects the `Client-ID` server-side. */
|
|
33
|
+
readonly proxyEndpoint?: string | URL;
|
|
34
|
+
/** DEV ONLY — ships the key to the browser; ignored when `proxyEndpoint` is set. */
|
|
35
|
+
readonly accessKey?: string;
|
|
36
|
+
/** Defaults to `!!(proxyEndpoint || accessKey)`; the package never bundles a key. */
|
|
37
|
+
readonly enabled?: boolean;
|
|
38
|
+
/** REQUIRED when enabled — `utm_source` for mandatory attribution. */
|
|
39
|
+
readonly appName: string;
|
|
40
|
+
readonly themes?: UnsplashThemeConfig;
|
|
41
|
+
/** Default 24 (clamped 1–30). */
|
|
42
|
+
readonly perPage?: number;
|
|
43
|
+
/** Throttle floor between JSON requests. Default 1200. */
|
|
44
|
+
readonly minRequestIntervalMs?: number;
|
|
45
|
+
/** Result LRU TTL. Default 300_000. */
|
|
46
|
+
readonly cacheTtlMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Per-request timeout for search / topic / photo lookups (ms). A request
|
|
49
|
+
* that exceeds it aborts and surfaces as a retryable `PROVIDER_NETWORK`
|
|
50
|
+
* error, so a blocked or flaky network path (e.g. a VPN/proxy black-holing
|
|
51
|
+
* `api.unsplash.com`) lets the sidebar fall back to "Unsplash unavailable"
|
|
52
|
+
* instead of spinning. Default 15_000. Ignored if not a positive number.
|
|
53
|
+
*/
|
|
54
|
+
readonly requestTimeoutMs?: number;
|
|
55
|
+
/** Injectable fetch for tests / SSR. */
|
|
56
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
57
|
+
/** Opt-in re-host instead of hotlinking. Default false. */
|
|
58
|
+
readonly rehostOnPick?: boolean;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=unsplash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsplash.d.ts","sourceRoot":"","sources":["../../src/types/unsplash.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IAC7D,4BAA4B;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IACnC,8CAA8C;IAC9C,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