@blueking/bkflow-canvas-editor 0.0.21 → 0.0.22

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 CHANGED
@@ -128,6 +128,7 @@ npm install bkflow-canvas-editor
128
128
  | `onBeforeLeave` | `(isEdited: boolean) => Promise<boolean>` | - | 离开前回调,返回 `false` 可阻止离开 |
129
129
  | `defaultZoom` | `number` | `1` | x6 画布的默认缩放比例,用于控制画布的初始显示效果。取值范围建议在 0.25 到 1.5 之间 |
130
130
  | `bkflowSaasUrl` | `string` | - | bkflow-saas-url,用于设置 `$.context.site_url` 的值,供插件内部使用 |
131
+ | `is_third_plugin_enabled` | `boolean` | `true` | 是否启用第三方插件。设置为 `false` 时,将不加载第三方插件列表和详情,只显示内置插件 |
131
132
 
132
133
  #### Slots
133
134
 
@@ -613,6 +614,39 @@ interface AgentSelectPanelConfig {
613
614
 
614
615
  > **说明**:`bkflowSaasUrl` 会被设置到 `window.$.context.site_url` 中,供插件内部使用。如果不提供,`site_url` 默认为空字符串。
615
616
 
617
+ ### 禁用第三方插件
618
+
619
+ 可以通过 `is_third_plugin_enabled` props 控制是否加载第三方插件。当设置为 `false` 时,将不加载第三方插件列表和详情,只显示内置插件:
620
+
621
+ ```vue
622
+ <template>
623
+ <FlowEdit
624
+ :flow-id="flowId"
625
+ :api-config="apiConfig"
626
+ :is-third-plugin-enabled="false" />
627
+ </template>
628
+
629
+ <script setup>
630
+ import { FlowEdit } from 'bkflow-canvas-editor';
631
+
632
+ const flowId = '123';
633
+ const apiConfig = {
634
+ scopeData: {
635
+ scope_type: 'space',
636
+ scope_value: 123,
637
+ },
638
+ };
639
+ </script>
640
+ ```
641
+
642
+ > **说明**:
643
+ > - `is_third_plugin_enabled` 默认值为 `true`,即默认启用第三方插件
644
+ > - 当设置为 `false` 时:
645
+ > - 插件选择面板中的第三方插件标签将不会显示
646
+ > - 不会请求第三方插件列表和详情
647
+ > - 如果流程中已存在第三方插件节点,尝试打开节点配置时会提示错误
648
+ > - 也可以通过 `apiConfig.is_third_plugin_enabled` 来设置,效果相同
649
+
616
650
  ### 使用 FlowEdit 的调试功能
617
651
 
618
652
  启用 FlowEdit 组件的调试功能,点击调试按钮会打开 FlowDebug 组件:
@@ -875,6 +909,8 @@ interface FlowApiConfig {
875
909
  };
876
910
  /** 用户查询 API 地址(可选) */
877
911
  fetchUserApi?: string;
912
+ /** 是否启用第三方插件(可选,默认为 true) */
913
+ is_third_plugin_enabled?: boolean;
878
914
  }
879
915
  ```
880
916