@lark-project/js-sdk 2.0.4-dev.4 → 2.0.6-alpha.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.
package/dist/es/index.js CHANGED
@@ -430,16 +430,6 @@ _a23 = IMPL_KEY;
430
430
  */
431
431
  View[_a23] = "view";
432
432
 
433
- // src/features/CustomComponent.ts
434
- var _a24;
435
- var CustomComponent = class extends BaseModel {
436
- };
437
- _a24 = IMPL_KEY;
438
- /**
439
- * @internal
440
- */
441
- CustomComponent[_a24] = "customComponent";
442
-
443
433
  // src/client.ts
444
434
  function getImplClass(decl, impls) {
445
435
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -624,7 +614,7 @@ var SDKClient = _SDKClient;
624
614
  /**
625
615
  * SDK 版本号
626
616
  */
627
- SDKClient.version = "2.0.4-dev.4";
617
+ SDKClient.version = "2.0.6-alpha.0";
628
618
 
629
619
  // src/types/biz.ts
630
620
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -695,16 +685,6 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
695
685
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
696
686
  return InterceptEvent2;
697
687
  })(InterceptEvent || {});
698
- var ComponentScheduleScene = /* @__PURE__ */ ((ComponentScheduleScene2) => {
699
- ComponentScheduleScene2[ComponentScheduleScene2["ALL"] = 0] = "ALL";
700
- ComponentScheduleScene2[ComponentScheduleScene2["workItemNode"] = 1] = "workItemNode";
701
- ComponentScheduleScene2[ComponentScheduleScene2["scheduleTable"] = 2] = "scheduleTable";
702
- return ComponentScheduleScene2;
703
- })(ComponentScheduleScene || {});
704
- var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
705
- CustomComponentType2["Schedule"] = "schedule";
706
- return CustomComponentType2;
707
- })(CustomComponentType || {});
708
688
 
709
689
  // src/errors/CustomError.ts
710
690
  var CustomError = class extends Error {
@@ -788,13 +768,10 @@ export {
788
768
  Button,
789
769
  ButtonScene,
790
770
  Clipboard,
791
- ComponentScheduleScene,
792
771
  Configuration,
793
772
  ContainerModal,
794
773
  Context,
795
774
  Control,
796
- CustomComponent,
797
- CustomComponentType,
798
775
  Field,
799
776
  FieldType,
800
777
  FlowMode,
package/dist/lib/index.js CHANGED
@@ -53,13 +53,10 @@ __export(src_exports, {
53
53
  Button: () => Button,
54
54
  ButtonScene: () => ButtonScene,
55
55
  Clipboard: () => Clipboard,
56
- ComponentScheduleScene: () => ComponentScheduleScene,
57
56
  Configuration: () => Configuration,
58
57
  ContainerModal: () => ContainerModal,
59
58
  Context: () => Context,
60
59
  Control: () => Control,
61
- CustomComponent: () => CustomComponent,
62
- CustomComponentType: () => CustomComponentType,
63
60
  Field: () => Field,
64
61
  FieldType: () => FieldType,
65
62
  FlowMode: () => FlowMode,
@@ -495,16 +492,6 @@ _a23 = IMPL_KEY;
495
492
  */
496
493
  View[_a23] = "view";
497
494
 
498
- // src/features/CustomComponent.ts
499
- var _a24;
500
- var CustomComponent = class extends BaseModel {
501
- };
502
- _a24 = IMPL_KEY;
503
- /**
504
- * @internal
505
- */
506
- CustomComponent[_a24] = "customComponent";
507
-
508
495
  // src/client.ts
509
496
  function getImplClass(decl, impls) {
510
497
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -689,7 +676,7 @@ var SDKClient = _SDKClient;
689
676
  /**
690
677
  * SDK 版本号
691
678
  */
692
- SDKClient.version = "2.0.4-dev.4";
679
+ SDKClient.version = "2.0.6-alpha.0";
693
680
 
694
681
  // src/types/biz.ts
695
682
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -760,16 +747,6 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
760
747
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
761
748
  return InterceptEvent2;
762
749
  })(InterceptEvent || {});
763
- var ComponentScheduleScene = /* @__PURE__ */ ((ComponentScheduleScene2) => {
764
- ComponentScheduleScene2[ComponentScheduleScene2["ALL"] = 0] = "ALL";
765
- ComponentScheduleScene2[ComponentScheduleScene2["workItemNode"] = 1] = "workItemNode";
766
- ComponentScheduleScene2[ComponentScheduleScene2["scheduleTable"] = 2] = "scheduleTable";
767
- return ComponentScheduleScene2;
768
- })(ComponentScheduleScene || {});
769
- var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
770
- CustomComponentType2["Schedule"] = "schedule";
771
- return CustomComponentType2;
772
- })(CustomComponentType || {});
773
750
 
774
751
  // src/errors/CustomError.ts
775
752
  var CustomError = class extends Error {
@@ -854,13 +831,10 @@ var src_default = SDKClient;
854
831
  Button,
855
832
  ButtonScene,
856
833
  Clipboard,
857
- ComponentScheduleScene,
858
834
  Configuration,
859
835
  ContainerModal,
860
836
  Context,
861
837
  Control,
862
- CustomComponent,
863
- CustomComponentType,
864
838
  Field,
865
839
  FieldType,
866
840
  FlowMode,
@@ -522,113 +522,6 @@ interface InterceptFeatureContext<T> {
522
522
  }>;
523
523
  customData: T;
524
524
  }
525
- /** ----------------------- 拓展组件-排期组件特化属性 ----------------------- */
526
- /**
527
- * 排期组件位置
528
- */
529
- declare enum ComponentScheduleScene {
530
- /**
531
- * 全部
532
- */
533
- ALL = 0,
534
- /**
535
- * 工作项节点/子任务
536
- */
537
- workItemNode = 1,
538
- /**
539
- * 计划表
540
- */
541
- scheduleTable = 2
542
- }
543
- declare enum WorkItemNodeType {
544
- Node = "node",
545
- SubTask = "sub_task",
546
- SubWorkItem = "sub_workitem",
547
- SuInstance = "sub_instance"
548
- }
549
- interface WorkItemInfo {
550
- spaceId: string;
551
- workObjectId: string;
552
- workItemId: string;
553
- }
554
- type ComponentScheduleIdentity = WorkItemInfo & {
555
- type: WorkItemNodeType;
556
- nodeId: string;
557
- taskId: string;
558
- };
559
- interface WbsStatus {
560
- wbsStatus: string;
561
- }
562
- interface UserInfo {
563
- role: string;
564
- userName: string;
565
- id: string;
566
- }
567
- type ScheduleCompValueType = string[];
568
- /**
569
- * schedule 组件类型校验返回值
570
- */
571
- interface ScheduleCompValidateMsg {
572
- code: 200 | number;
573
- msg: string;
574
- }
575
- /** ----------------------- 拓展点位通用类型 ----------------------- */
576
- /**
577
- * 自定义组件构成
578
- * 支持的定义组件类型
579
- */
580
- declare enum CustomComponentType {
581
- Schedule = "schedule"
582
- }
583
- /**
584
- * 自定义组件构成
585
- * 允许用户定制指定业务组件类型的UI
586
- */
587
- interface CustomComponentFeatureContext<I extends {
588
- /**
589
- * 组件节点标识
590
- * 适用场景:详情页为节点流时,且当前控件位于节点表单/计划表内,该字段才有数据
591
- */
592
- nodeId?: string;
593
- /**
594
- * 组件子任务标识
595
- * 适用场景:详情页为节点流时,且当前控件位于节点表单/计划表内,该字段才有数据
596
- */
597
- taskId?: string;
598
- }, S extends ComponentScheduleScene> {
599
- /**
600
- * 组件所处场景
601
- */
602
- scene: S;
603
- /**
604
- * 组件当前所属空间标识
605
- */
606
- spaceId: string;
607
- /**
608
- * 组件当前所属工作项类型标识
609
- */
610
- workObjectId: string;
611
- /**
612
- * 组件当前所属工作项实例标识
613
- * 新建页表单内该值为空
614
- */
615
- workItemId?: number;
616
- /**
617
- * 组件唯一标识
618
- * 组件所属节点的所属空间/工作项/工作项实例以及节点任务标识
619
- */
620
- identity?: I;
621
- }
622
- /**
623
- * 自定义组件构成
624
- * 各业务组件类型拥有的 props
625
- */
626
- interface CustomComponentProps {
627
- [CustomComponentType.Schedule]: {
628
- value: ScheduleCompValueType;
629
- disabled?: boolean;
630
- };
631
- }
632
525
 
633
526
  /**
634
527
  * @internal
@@ -689,10 +582,6 @@ declare abstract class Context extends BaseModel {
689
582
  * 当前登录用户信息
690
583
  */
691
584
  abstract loginUser: User;
692
- /**
693
- * 主空间信息(左侧导航栏选中的空间)
694
- */
695
- abstract mainSpace?: BriefSpace;
696
585
  /**
697
586
  * 当前打开的工作项(仅工作项详情页可用)
698
587
  */
@@ -1213,7 +1102,11 @@ interface ModalConfirmOptions {
1213
1102
  /**
1214
1103
  * Modal 展示配置
1215
1104
  */
1216
- interface ModalOptions<Context> {
1105
+ interface ModalOpenOptions<Context> {
1106
+ /**
1107
+ * 指定 modal 内容的代码入口,即在入口文件中导出的模块名
1108
+ */
1109
+ entry: string;
1217
1110
  /**
1218
1111
  * 宽度
1219
1112
  * 默认: 448
@@ -1273,11 +1166,16 @@ declare abstract class Modal extends BaseModel {
1273
1166
  * @param options
1274
1167
  * @returns 当前打开 Modal 的关闭方法
1275
1168
  */
1276
- abstract open<Context>(options: ModalOptions<Context>): Promise<{
1169
+ abstract open<Context>(options: ModalOpenOptions<Context>): Promise<{
1277
1170
  close: () => void;
1278
1171
  }>;
1279
1172
  }
1280
1173
 
1174
+ interface IRichTextEditorImageUploadComplete {
1175
+ code: number;
1176
+ errMsg: string;
1177
+ responseData: any;
1178
+ }
1281
1179
  /**
1282
1180
  * RichTextEditor 配置
1283
1181
  */
@@ -1315,6 +1213,12 @@ interface RichTextEditorOptions {
1315
1213
  * token 会通过 request header 的 x-plugin-custom-token 提供
1316
1214
  */
1317
1215
  token?: string;
1216
+ /**
1217
+ * 上传完成回调
1218
+ * @param info
1219
+ * @returns
1220
+ */
1221
+ onUploadComplete?: (info: IRichTextEditorImageUploadComplete) => void;
1318
1222
  };
1319
1223
  }
1320
1224
  /**
@@ -1646,32 +1550,6 @@ declare abstract class View extends BaseModel {
1646
1550
  abstract getContext(): Promise<ViewFeatureContext>;
1647
1551
  }
1648
1552
 
1649
- /**
1650
- * @public
1651
- * 自定义组件构成
1652
- */
1653
- declare abstract class CustomComponent extends BaseModel {
1654
- /**
1655
- * @internal
1656
- */
1657
- protected static [IMPL_KEY]: string;
1658
- abstract [CustomComponentType.Schedule]: {
1659
- getProps: () => Promise<CustomComponentProps[CustomComponentType.Schedule]>;
1660
- /**
1661
- * 用于监听 props 变更
1662
- * @param callback 返回 schedule 组件新的 props
1663
- * @param watchKeys 监听的 key,只能监听属性的 key(不能监听 api key),不传默认监听所有 key。监听的 key 对应的值变更会触发回调
1664
- * @returns
1665
- */
1666
- watch: (callback: (next: CustomComponentProps[CustomComponentType.Schedule]) => void, watchKeys?: (keyof CustomComponentProps[CustomComponentType.Schedule])[]) => Off;
1667
- getContext: () => Promise<CustomComponentFeatureContext<ComponentScheduleIdentity, ComponentScheduleScene>>;
1668
- resizeContainer: (width?: number, height?: number) => Promise<undefined>;
1669
- getWbsStatus?: () => Promise<WbsStatus>;
1670
- getOwnersInfo?: () => Promise<UserInfo[]>;
1671
- handleSubmit: (value: ScheduleCompValueType) => Promise<ScheduleCompValidateMsg>;
1672
- };
1673
- }
1674
-
1675
1553
  /**
1676
1554
  * @public
1677
1555
  * SDKClient 的配置项
@@ -1885,4 +1763,4 @@ declare class NotSupportedError extends CustomError {
1885
1763
  * @packageDocumentation
1886
1764
  */
1887
1765
 
1888
- export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, ScheduleCompValidateMsg, ScheduleCompValueType, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, UserInfo, Utils, View, ViewFeatureContext, WbsStatus, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
1766
+ export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, Utils, View, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/js-sdk",
3
- "version": "2.0.4-dev.4",
3
+ "version": "2.0.6-alpha.0",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"