@imgly/plugin-ai-generation-web 0.2.5 → 0.2.6

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/CHANGELOG.md CHANGED
@@ -2,12 +2,22 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.6] - 2025-09-09
6
+
7
+ ### New Features
8
+
9
+ - [all] **Feature API Integration**: Added comprehensive Feature API support across all AI plugins to control visibility and availability of features through feature flags. Core features include `providerSelect`, `quickAction`, `quickAction.providerSelect`, `fromText`, and `fromImage` flags.
10
+ - [all] **Quick Action Feature Flags**: Each quick action now automatically registers and respects its own feature flag (e.g., `ly.img.plugin-ai-image-generation-web.quickAction.editImage`), allowing fine-grained control over which quick actions are available to users.
11
+ - [image-generation] **Provider Style Group Control**: Added Feature API support for Recraft providers to control style group visibility. RecraftV3 supports `style.image` and `style.vector` flags, while Recraft20b adds `style.icon` flag for controlling icon style availability.
12
+ - [all] **Provider Selection Feature Flags**: Added support for controlling provider selection UI in both panels (`providerSelect`) and quick actions (`quickAction.providerSelect`), with proper handling when multiple providers are configured.
13
+
5
14
  ## [0.2.5] - 2025-09-03
6
15
 
7
16
  ### New Features
8
17
 
9
18
  - [image-generation] **NanoBanana Provider**: Added NanoBanana text-to-image provider via fal.ai with fast generation times, 1024×1024 resolution, support for multiple output formats (JPEG, PNG), configurable number of images (1-4), and remixPageWithPrompt quick action
10
19
  - [image-generation] **NanoBananaEdit Provider**: Added NanoBananaEdit image-to-image provider via fal.ai for editing existing images with text prompts, supporting all standard quick actions (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages with up to 10 images, remixPage, remixPageWithPrompt)
20
+ - [all] **AI Style Asset Library Translations**: AI style presets in asset libraries now automatically use localized names and descriptions from provider translation files, eliminating the need for manual translation configuration
11
21
 
12
22
  ### Bug Fixes
13
23
 
package/README.md CHANGED
@@ -902,6 +902,161 @@ For example:
902
902
  - Audio quick actions: `ly.img.plugin-ai-audio-generation-web.canvasMenu`
903
903
  - Text quick actions: `ly.img.plugin-ai-text-generation-web.canvasMenu`
904
904
 
905
+ ### Customizing Quick Action Availability
906
+
907
+ You can control which quick actions appear in your application using the Feature API. This is useful when you want to:
908
+ - Show only specific AI capabilities to certain user groups
909
+ - Simplify the UI by hiding advanced features
910
+ - Create different feature sets for different subscription tiers
911
+ - Disable actions that aren't relevant to your use case
912
+
913
+ #### Disabling Specific Quick Actions
914
+
915
+ All quick actions are enabled by default. To hide specific quick actions from the UI:
916
+
917
+ ```typescript
918
+ // Hide the "Edit Image" quick action from users
919
+ cesdk.feature.enable(
920
+ 'ly.img.plugin-ai-image-generation-web.quickAction.editImage',
921
+ false
922
+ );
923
+
924
+ // Hide multiple text quick actions for a simpler experience
925
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.changeTone', false);
926
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.translate', false);
927
+ ```
928
+
929
+ #### Dynamic Feature Control
930
+
931
+ You can also pass a function to dynamically control feature availability based on context. This is powerful for implementing complex business logic, time-based features, or context-sensitive UI. See the [CE.SDK Feature API documentation](https://img.ly/docs/cesdk/js/user-interface/customization/disable-or-enable-f058e2/) for more details.
932
+
933
+ ```typescript
934
+ // Show advanced AI features only during business hours
935
+ cesdk.feature.enable(
936
+ 'ly.img.plugin-ai-image-generation-web.quickAction.artistTransfer',
937
+ ({ isPreviousEnable }) => {
938
+ const hour = new Date().getHours();
939
+ const isBusinessHours = hour >= 9 && hour < 18;
940
+ return isBusinessHours && isPreviousEnable();
941
+ }
942
+ );
943
+
944
+ // Disable certain quick actions based on selected content
945
+ cesdk.feature.enable(
946
+ 'ly.img.plugin-ai-text-generation-web.quickAction.translate',
947
+ ({ engine, isPreviousEnable }) => {
948
+ const selectedBlocks = engine.block.findAllSelected();
949
+ if (selectedBlocks.length === 0) return false;
950
+
951
+ const blockId = selectedBlocks[0];
952
+ const textContent = engine.block.getString(blockId, 'text/text');
953
+
954
+ // Only show translate if text is long enough
955
+ const hasEnoughText = textContent && textContent.length > 20;
956
+ return hasEnoughText && isPreviousEnable();
957
+ }
958
+ );
959
+ ```
960
+
961
+ #### Creating Feature Sets for Different User Tiers
962
+
963
+ ```typescript
964
+ // Configure features based on user subscription
965
+ function configureAIFeatures(cesdk, userTier) {
966
+ if (userTier === 'basic') {
967
+ // Basic users only get simple text improvements
968
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.improve', true);
969
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.fix', true);
970
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.translate', false);
971
+ cesdk.feature.enable('ly.img.plugin-ai-text-generation-web.quickAction.changeTone', false);
972
+
973
+ // Disable advanced image features
974
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.quickAction.artistTransfer', false);
975
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.quickAction.styleTransfer', false);
976
+ } else if (userTier === 'premium') {
977
+ // Premium users get all features (default behavior)
978
+ // All quick actions are enabled by default
979
+ }
980
+ }
981
+ ```
982
+
983
+ #### Available Feature Flags
984
+
985
+ ##### Core Plugin Features
986
+
987
+ These feature flags control the main functionality of each AI plugin:
988
+
989
+ **General Features:**
990
+ - `ly.img.plugin-ai-{kind}-generation-web.providerSelect` - Enable/disable provider selection dropdown in panels
991
+ - `ly.img.plugin-ai-{kind}-generation-web.quickAction` - Enable/disable all quick actions for a plugin
992
+ - `ly.img.plugin-ai-{kind}-generation-web.quickAction.providerSelect` - Enable/disable provider selection dropdown in quick actions
993
+
994
+ **Input Type Features (Image & Video only):**
995
+ - `ly.img.plugin-ai-image-generation-web.fromText` - Enable/disable text-to-image generation
996
+ - `ly.img.plugin-ai-image-generation-web.fromImage` - Enable/disable image-to-image generation
997
+ - `ly.img.plugin-ai-video-generation-web.fromText` - Enable/disable text-to-video generation
998
+ - `ly.img.plugin-ai-video-generation-web.fromImage` - Enable/disable image-to-video generation
999
+
1000
+ **Usage Examples:**
1001
+
1002
+ ```typescript
1003
+ // Hide provider selection dropdown in video generation panel
1004
+ cesdk.feature.enable('ly.img.plugin-ai-video-generation-web.providerSelect', false);
1005
+
1006
+ // Only allow text-to-image, disable image-to-image editing
1007
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.fromImage', false);
1008
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.fromText', true);
1009
+
1010
+ // Hide provider selection dropdown in quick actions (use default provider only)
1011
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.quickAction.providerSelect', false);
1012
+
1013
+ // Disable all quick actions but keep panel generation available
1014
+ cesdk.feature.enable('ly.img.plugin-ai-image-generation-web.quickAction', false);
1015
+ ```
1016
+
1017
+ ##### Quick Action Features
1018
+
1019
+ The quick action feature flags follow this pattern: `ly.img.plugin-ai-{kind}-generation-web.quickAction.{actionName}`
1020
+
1021
+ **Image Quick Actions:**
1022
+ - `ly.img.plugin-ai-image-generation-web.quickAction.editImage`
1023
+ - `ly.img.plugin-ai-image-generation-web.quickAction.swapBackground`
1024
+ - `ly.img.plugin-ai-image-generation-web.quickAction.styleTransfer`
1025
+ - `ly.img.plugin-ai-image-generation-web.quickAction.artistTransfer`
1026
+ - `ly.img.plugin-ai-image-generation-web.quickAction.createVariant`
1027
+ - `ly.img.plugin-ai-image-generation-web.quickAction.combineImages`
1028
+ - `ly.img.plugin-ai-image-generation-web.quickAction.remixPage`
1029
+ - `ly.img.plugin-ai-image-generation-web.quickAction.remixPageWithPrompt`
1030
+
1031
+ **Text Quick Actions:**
1032
+ - `ly.img.plugin-ai-text-generation-web.quickAction.improve`
1033
+ - `ly.img.plugin-ai-text-generation-web.quickAction.fix`
1034
+ - `ly.img.plugin-ai-text-generation-web.quickAction.shorter`
1035
+ - `ly.img.plugin-ai-text-generation-web.quickAction.longer`
1036
+ - `ly.img.plugin-ai-text-generation-web.quickAction.changeTone`
1037
+ - `ly.img.plugin-ai-text-generation-web.quickAction.translate`
1038
+ - `ly.img.plugin-ai-text-generation-web.quickAction.changeTextTo`
1039
+
1040
+ **Video Quick Actions:**
1041
+ - `ly.img.plugin-ai-video-generation-web.quickAction.createVideo`
1042
+
1043
+ **Note:** Quick actions are automatically enabled when their plugin is loaded. Each quick action manages its own feature flag internally, ensuring proper initialization and registration.
1044
+
1045
+ ##### Provider-Specific Style Features
1046
+
1047
+ Some providers (like RecraftV3 and Recraft20b) support style groups that can be controlled independently:
1048
+
1049
+ **RecraftV3 Style Groups:**
1050
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.style.image` - Enable/disable image styles (realistic, digital illustration)
1051
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.style.vector` - Enable/disable vector styles (vector illustration and variants)
1052
+
1053
+ **Recraft20b Style Groups:**
1054
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.style.image` - Enable/disable image styles
1055
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.style.vector` - Enable/disable vector styles
1056
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.style.icon` - Enable/disable icon styles
1057
+
1058
+ When all style groups are disabled for a provider, it automatically falls back to the 'any' style. For more details on style control, see the [@imgly/plugin-ai-image-generation-web documentation](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-image-generation-web).
1059
+
905
1060
  ### Using with Existing AI Generation Plugins
906
1061
 
907
1062
  IMG.LY offers several pre-built AI generation packages that work with this base plugin:
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -26,3 +26,4 @@ export { default as initializeProvider } from './providers/initializeProvider';
26
26
  export { default as initializeQuickActionComponents } from './ui/quickActions/initializeQuickActionComponents';
27
27
  export { extractAndSetSchemaTranslations } from './openapi/extractSchemaTranslations';
28
28
  export { AI_EDIT_MODE, AI_METADATA_KEY } from './ui/quickActions/utils';
29
+ export { createTranslationCallback, buildTranslationKeys } from './utils/translationHelpers';