@imgly/plugin-ai-sticker-generation-web 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ import { type EditorPlugin } from '@cesdk/cesdk-js';
2
+ import { Output } from '@imgly/plugin-ai-generation-web';
3
+ import { PluginConfiguration } from './types';
4
+ export { PLUGIN_ID } from './constants';
5
+ export declare function StickerGeneration<I, O extends Output>(config: PluginConfiguration<I, O>): Omit<EditorPlugin, 'name' | 'version'>;
6
+ export default StickerGeneration;
@@ -0,0 +1,52 @@
1
+ import { CommonPluginConfiguration, GetProvider, Output } from '@imgly/plugin-ai-generation-web';
2
+ /**
3
+ * Configuration to set provider and models for sticker generation.
4
+ */
5
+ export interface PluginConfiguration<I, O extends Output> extends CommonPluginConfiguration<any, I, O> {
6
+ providers: {
7
+ /**
8
+ * Provider of a model for sticker generation just from a (prompt) text.
9
+ */
10
+ text2sticker?: GetProvider<'sticker'>[] | GetProvider<'sticker'>;
11
+ };
12
+ }
13
+ /**
14
+ * Input types for sticker-specific quick actions
15
+ * This interface is extended by individual quick action files using module augmentation
16
+ */
17
+ export interface StickerQuickActionInputs {
18
+ }
19
+ /**
20
+ * Type-safe support mapping for sticker quick actions
21
+ * Allows `true` or `{}` when the quick action input type extends the provider input type
22
+ */
23
+ export type StickerQuickActionSupport<I, K extends keyof StickerQuickActionInputs> = StickerQuickActionInputs[K] extends I ? true | {
24
+ mapInput: (input: StickerQuickActionInputs[K]) => I;
25
+ } | {
26
+ [key: string]: any;
27
+ } : {
28
+ mapInput: (input: StickerQuickActionInputs[K]) => I;
29
+ };
30
+ /**
31
+ * Type-safe mapping for sticker quick action support
32
+ */
33
+ export type StickerQuickActionSupportMap<I> = {
34
+ [K in keyof StickerQuickActionInputs]?: StickerQuickActionSupport<I, K>;
35
+ } & {
36
+ [key: string]: true | {
37
+ mapInput: (input: any) => I;
38
+ } | {
39
+ [key: string]: any;
40
+ };
41
+ };
42
+ /**
43
+ * Sticker provider extension with type-safe quick action support
44
+ * Only parameterized by K (the quick action key), O is fixed to StickerOutput
45
+ */
46
+ export interface StickerProvider<I> {
47
+ input: any & {
48
+ quickActions?: {
49
+ supported?: StickerQuickActionSupportMap<I>;
50
+ };
51
+ };
52
+ }
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@imgly/plugin-ai-sticker-generation-web",
3
+ "version": "0.2.0",
4
+ "description": "AI sticker generation plugin for the CE.SDK editor",
5
+ "keywords": [
6
+ "CE.SDK",
7
+ "plugin",
8
+ "AI",
9
+ "sticker-generation"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/imgly/plugins.git"
14
+ },
15
+ "license": "SEE LICENSE IN LICENSE.md",
16
+ "author": {
17
+ "name": "IMG.LY GmbH",
18
+ "email": "support@img.ly",
19
+ "url": "https://img.ly"
20
+ },
21
+ "bugs": {
22
+ "email": "support@img.ly"
23
+ },
24
+ "source": "./src/index.ts",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./dist/index.mjs",
30
+ "types": "./dist/index.d.ts"
31
+ },
32
+ "./fal-ai": {
33
+ "import": "./dist/fal-ai/index.mjs",
34
+ "types": "./dist/fal-ai/index.d.ts"
35
+ }
36
+ },
37
+ "homepage": "https://img.ly/products/creative-sdk",
38
+ "files": [
39
+ "LICENSE.md",
40
+ "README.md",
41
+ "CHANGELOG.md",
42
+ "dist/",
43
+ "bin/"
44
+ ],
45
+ "scripts": {
46
+ "start": "npm run watch",
47
+ "clean": "pnpm exec rimraf dist",
48
+ "purge": "pnpm exec rimraf node_modules",
49
+ "build": "pnpm run clean && pnpm _syncPnpm && pnpm exec node scripts/build.mjs",
50
+ "test": "echo No tests",
51
+ "dev": "pnpm --filter \"${npm_package_name}^...\" --parallel run dev:wait && pnpm exec concurrently 'node scripts/watch.mjs' 'pnpm _syncPnpm --watch' --names 'build,sync deps'",
52
+ "dev:wait": "pnpm exec wait-on ./dist/index.mjs ./dist/index.d.ts ./dist/fal-ai/index.mjs ./dist/fal-ai/index.d.ts --window 250 --timeout 60000",
53
+ "dev:types": "tsc --emitDeclarationOnly --watch --preserveWatchOutput",
54
+ "publish:latest": "pnpm run build && npm publish --tag latest --access public",
55
+ "publish:next": "pnpm run build && npm publish --tag next --access public",
56
+ "check:all": "concurrently -n lint,type,pretty \"pnpm run check:lint\" \"pnpm run check:types\" \"pnpm run check:pretty\"",
57
+ "check:lint": "eslint --max-warnings 0 './src/**/*.{ts,tsx}'",
58
+ "check:pretty": "prettier --list-different './src/**/*.{ts,tsx}'",
59
+ "check:types": "tsc --noEmit",
60
+ "types:create": "tsc --emitDeclarationOnly",
61
+ "_syncPnpm": "pnpm sync-dependencies-meta-injected"
62
+ },
63
+ "devDependencies": {
64
+ "@imgly/plugin-ai-generation-web": "workspace:*",
65
+ "@imgly/plugin-utils": "workspace:*",
66
+ "@types/ndarray": "^1.0.14",
67
+ "chalk": "^5.3.0",
68
+ "concurrently": "^8.2.2",
69
+ "esbuild": "^0.19.11",
70
+ "eslint": "^8.51.0",
71
+ "lodash-es": "^4.17.21",
72
+ "openapi-types": "^12.1.3",
73
+ "typescript": "^5.3.3"
74
+ },
75
+ "dependenciesMeta": {
76
+ "@imgly/plugin-utils": {
77
+ "injected": true
78
+ },
79
+ "@imgly/plugin-ai-generation-web": {
80
+ "injected": true
81
+ }
82
+ },
83
+ "peerDependencies": {
84
+ "@cesdk/cesdk-js": "^1.49.1"
85
+ },
86
+ "dependencies": {
87
+ "@fal-ai/client": "^1.3.0"
88
+ }
89
+ }