@servicetitan/toolbelt-shared-registry 1.3.1 → 1.5.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,21 @@
1
+ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/shared-data-registry';
2
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
3
+ export declare const commHubLeftPanelRegistryId = "toolbelt:comm-hub-left-panel-registry-id";
4
+ export declare const CommHubLeftPanelStateItemId = "left-panel-state";
5
+ export interface CommHubLeftPanelState {
6
+ isOpen: boolean;
7
+ }
8
+ export declare class CommHubLeftPanelRegistry extends RegistryService<CommHubLeftPanelState> {
9
+ constructor();
10
+ }
11
+ export declare class CommHubLeftPanelRegistryReader extends RegistryReader<CommHubLeftPanelState> {
12
+ constructor();
13
+ }
14
+ export declare class CommHubLeftPanelRegistryWriter extends RegistryWriter<CommHubLeftPanelState> {
15
+ constructor();
16
+ }
17
+ export declare class CommHubLeftPanelRegistryStore extends RegistryStore<CommHubLeftPanelState> {
18
+ constructor();
19
+ }
20
+ export declare const CommHubLeftPanelRegistryProvider: (({ children }: any) => any) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<({ children }: any) => any>;
21
+ //# sourceMappingURL=comm-hub-left-panel-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comm-hub-left-panel-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-left-panel-registry.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,eAAO,MAAM,0BAA0B,6CAA6C,CAAC;AACrF,eAAO,MAAM,2BAA2B,qBAAqB,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,qBACa,wBAAyB,SAAQ,eAAe,CAAC,qBAAqB,CAAC;;CAInF;AAED,qBACa,8BAA+B,SAAQ,cAAc,CAAC,qBAAqB,CAAC;;CAIxF;AAED,qBACa,8BAA+B,SAAQ,cAAc,CAAC,qBAAqB,CAAC;;CAIxF;AAED,qBACa,6BAA8B,SAAQ,aAAa,CAAC,qBAAqB,CAAC;;CAItF;AAED,eAAO,MAAM,gCAAgC,4HAU3C,CAAC"}
@@ -0,0 +1,66 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ function _ts_metadata(k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ }
10
+ import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
11
+ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/shared-data-registry';
12
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
13
+ export const commHubLeftPanelRegistryId = 'toolbelt:comm-hub-left-panel-registry-id';
14
+ export const CommHubLeftPanelStateItemId = 'left-panel-state';
15
+ export class CommHubLeftPanelRegistry extends RegistryService {
16
+ constructor(){
17
+ super(commHubLeftPanelRegistryId);
18
+ }
19
+ }
20
+ CommHubLeftPanelRegistry = _ts_decorate([
21
+ injectable(),
22
+ _ts_metadata("design:type", Function),
23
+ _ts_metadata("design:paramtypes", [])
24
+ ], CommHubLeftPanelRegistry);
25
+ export class CommHubLeftPanelRegistryReader extends RegistryReader {
26
+ constructor(){
27
+ super(commHubLeftPanelRegistryId);
28
+ }
29
+ }
30
+ CommHubLeftPanelRegistryReader = _ts_decorate([
31
+ injectable(),
32
+ _ts_metadata("design:type", Function),
33
+ _ts_metadata("design:paramtypes", [])
34
+ ], CommHubLeftPanelRegistryReader);
35
+ export class CommHubLeftPanelRegistryWriter extends RegistryWriter {
36
+ constructor(){
37
+ super(commHubLeftPanelRegistryId);
38
+ }
39
+ }
40
+ CommHubLeftPanelRegistryWriter = _ts_decorate([
41
+ injectable(),
42
+ _ts_metadata("design:type", Function),
43
+ _ts_metadata("design:paramtypes", [])
44
+ ], CommHubLeftPanelRegistryWriter);
45
+ export class CommHubLeftPanelRegistryStore extends RegistryStore {
46
+ constructor(){
47
+ super(commHubLeftPanelRegistryId);
48
+ }
49
+ }
50
+ CommHubLeftPanelRegistryStore = _ts_decorate([
51
+ injectable(),
52
+ _ts_metadata("design:type", Function),
53
+ _ts_metadata("design:paramtypes", [])
54
+ ], CommHubLeftPanelRegistryStore);
55
+ export const CommHubLeftPanelRegistryProvider = provide({
56
+ singletons: [
57
+ CommHubLeftPanelRegistry,
58
+ CommHubLeftPanelRegistryWriter,
59
+ CommHubLeftPanelRegistryReader
60
+ ]
61
+ })(({ children })=>{
62
+ useDependencies(CommHubLeftPanelRegistry);
63
+ return children;
64
+ });
65
+
66
+ //# sourceMappingURL=comm-hub-left-panel-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/comm-hub-left-panel-registry.ts"],"sourcesContent":["import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';\nimport {\n RegistryReader,\n RegistryService,\n RegistryWriter,\n} from '@servicetitan/shared-data-registry';\nimport { RegistryStore } from '@servicetitan/shared-data-registry/mobx';\n\nexport const commHubLeftPanelRegistryId = 'toolbelt:comm-hub-left-panel-registry-id';\nexport const CommHubLeftPanelStateItemId = 'left-panel-state';\n\nexport interface CommHubLeftPanelState {\n isOpen: boolean;\n}\n\n@injectable()\nexport class CommHubLeftPanelRegistry extends RegistryService<CommHubLeftPanelState> {\n constructor() {\n super(commHubLeftPanelRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubLeftPanelRegistryReader extends RegistryReader<CommHubLeftPanelState> {\n constructor() {\n super(commHubLeftPanelRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubLeftPanelRegistryWriter extends RegistryWriter<CommHubLeftPanelState> {\n constructor() {\n super(commHubLeftPanelRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubLeftPanelRegistryStore extends RegistryStore<CommHubLeftPanelState> {\n constructor() {\n super(commHubLeftPanelRegistryId);\n }\n}\n\nexport const CommHubLeftPanelRegistryProvider = provide({\n singletons: [\n CommHubLeftPanelRegistry,\n CommHubLeftPanelRegistryWriter,\n CommHubLeftPanelRegistryReader,\n ],\n})(({ children }) => {\n useDependencies(CommHubLeftPanelRegistry);\n\n return children;\n});\n"],"names":["injectable","provide","useDependencies","RegistryReader","RegistryService","RegistryWriter","RegistryStore","commHubLeftPanelRegistryId","CommHubLeftPanelStateItemId","CommHubLeftPanelRegistry","constructor","CommHubLeftPanelRegistryReader","CommHubLeftPanelRegistryWriter","CommHubLeftPanelRegistryStore","CommHubLeftPanelRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AAAA,SAASA,UAAU,EAAEC,OAAO,EAAEC,eAAe,QAAQ,0BAA0B;AAC/E,SACIC,cAAc,EACdC,eAAe,EACfC,cAAc,QACX,qCAAqC;AAC5C,SAASC,aAAa,QAAQ,0CAA0C;AAExE,OAAO,MAAMC,6BAA6B,2CAA2C;AACrF,OAAO,MAAMC,8BAA8B,mBAAmB;AAO9D,OAAO,MAAMC,iCAAiCL;IAC1CM,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,uCAAuCR;IAChDO,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,uCAAuCP;IAChDK,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMM,sCAAsCP;IAC/CI,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAEA,OAAO,MAAMO,mCAAmCb,QAAQ;IACpDc,YAAY;QACRN;QACAG;QACAD;KACH;AACL,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZd,gBAAgBO;IAEhB,OAAOO;AACX,GAAG"}
@@ -2,7 +2,7 @@ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/s
2
2
  import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
3
3
  export declare const commHubRegistryId = "toolbelt:comm-hub-registry-id";
4
4
  export declare const CommHubActivePanelItemId = "active-panel";
5
- export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'chat:entity' | 'email';
5
+ export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'chat:entity' | 'email:entity' | 'email';
6
6
  interface ChatPanelChannelData {
7
7
  conversationId: string;
8
8
  }
@@ -23,18 +23,30 @@ interface ChatPanelMentionData {
23
23
  };
24
24
  parentMessageChatId?: string;
25
25
  }
26
- interface ChatPanelEntityData {
26
+ /**
27
+ * Data structure for entity panel information in the communication hub.
28
+ * Used for both chat and email entity panels.
29
+ */
30
+ interface PanelEntityData {
31
+ /** Unique identifier for the entity */
27
32
  id: string;
33
+ /** Display name of the entity */
28
34
  name: string;
35
+ /** Entity type identifier */
29
36
  type: string;
37
+ /** Human-readable type name */
30
38
  typeName: string;
39
+ /** Panel title text (including id, type name and name) */
40
+ title: string;
41
+ /** Optional URL link to the entity */
42
+ link?: string;
31
43
  }
32
44
  interface EmailPanelData {
33
45
  conversationId: string;
34
46
  }
35
47
  export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
36
48
  type: T;
37
- data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : T extends 'chat:entity' ? ChatPanelEntityData : EmailPanelData;
49
+ data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : T extends 'chat:entity' ? PanelEntityData : T extends 'email:entity' ? PanelEntityData : EmailPanelData;
38
50
  }
39
51
  export declare class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<CommHubRegistryItem<T>> {
40
52
  constructor();
@@ -1 +1 @@
1
- {"version":3,"file":"comm-hub-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-registry.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,eAAO,MAAM,iBAAiB,kCAAkC,CAAC;AAEjE,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAC5B,cAAc,GACd,aAAa,GACb,cAAc,GACd,aAAa,GACb,OAAO,CAAC;AAEd,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,UAAU,mBAAmB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB,CA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;AAED,qBACa,qBAAqB,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,cAAc,CACvF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,qBACa,oBAAoB,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,aAAa,CACrF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,eAAO,MAAM,uBAAuB,4HAMlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/comm-hub-registry.ts"],"sourcesContent":["import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';\nimport {\n RegistryReader,\n RegistryService,\n RegistryWriter,\n} from '@servicetitan/shared-data-registry';\nimport { RegistryStore } from '@servicetitan/shared-data-registry/mobx';\n\nexport const commHubRegistryId = 'toolbelt:comm-hub-registry-id';\n\nexport const CommHubActivePanelItemId = 'active-panel';\n\nexport type CommHubActivePanelType =\n | 'chat:channel'\n | 'chat:thread'\n | 'chat:mention'\n | 'chat:entity'\n | 'email';\n\ninterface ChatPanelChannelData {\n conversationId: string;\n}\n\ninterface ChatPanelThreadData {\n conversationId: string;\n parentConversation: {\n conversationId: string;\n conversationThreadId: string;\n };\n chatMessageId: string;\n}\n\ninterface ChatPanelMentionData {\n conversationId: string;\n mentionMessageChatId: string;\n parentConversation?: {\n conversationId: string;\n conversationThreadId: string;\n };\n parentMessageChatId?: string;\n}\n\ninterface ChatPanelEntityData {\n id: string;\n name: string;\n type: string;\n typeName: string;\n}\n\ninterface EmailPanelData {\n conversationId: string;\n}\n\nexport interface CommHubRegistryItem<T extends CommHubActivePanelType> {\n type: T;\n data: T extends 'chat:channel'\n ? ChatPanelChannelData\n : T extends 'chat:thread'\n ? ChatPanelThreadData\n : T extends 'chat:mention'\n ? ChatPanelMentionData\n : T extends 'chat:entity'\n ? ChatPanelEntityData\n : EmailPanelData;\n}\n\n@injectable()\nexport class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryReader<T extends CommHubActivePanelType> extends RegistryReader<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryWriter<T extends CommHubActivePanelType> extends RegistryWriter<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryStore<T extends CommHubActivePanelType> extends RegistryStore<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\nexport const CommHubRegistryProvider = provide({\n singletons: [CommHubRegistry, CommHubRegistryWriter, CommHubRegistryReader],\n})(({ children }) => {\n useDependencies(CommHubRegistry);\n\n return children;\n});\n"],"names":["injectable","provide","useDependencies","RegistryReader","RegistryService","RegistryWriter","RegistryStore","commHubRegistryId","CommHubActivePanelItemId","CommHubRegistry","constructor","CommHubRegistryReader","CommHubRegistryWriter","CommHubRegistryStore","CommHubRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AAAA,SAASA,UAAU,EAAEC,OAAO,EAAEC,eAAe,QAAQ,0BAA0B;AAC/E,SACIC,cAAc,EACdC,eAAe,EACfC,cAAc,QACX,qCAAqC;AAC5C,SAASC,aAAa,QAAQ,0CAA0C;AAExE,OAAO,MAAMC,oBAAoB,gCAAgC;AAEjE,OAAO,MAAMC,2BAA2B,eAAe;AAyDvD,OAAO,MAAMC,wBAA0DL;IAGnEM,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,8BAAgER;IAGzEO,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,8BAAgEP;IAGzEK,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMM,6BAA+DP;IAGxEI,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAEA,OAAO,MAAMO,0BAA0Bb,QAAQ;IAC3Cc,YAAY;QAACN;QAAiBG;QAAuBD;KAAsB;AAC/E,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZd,gBAAgBO;IAEhB,OAAOO;AACX,GAAG"}
1
+ {"version":3,"sources":["../src/comm-hub-registry.ts"],"sourcesContent":["import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';\nimport {\n RegistryReader,\n RegistryService,\n RegistryWriter,\n} from '@servicetitan/shared-data-registry';\nimport { RegistryStore } from '@servicetitan/shared-data-registry/mobx';\n\nexport const commHubRegistryId = 'toolbelt:comm-hub-registry-id';\n\nexport const CommHubActivePanelItemId = 'active-panel';\n\nexport type CommHubActivePanelType =\n | 'chat:channel'\n | 'chat:thread'\n | 'chat:mention'\n | 'chat:entity'\n | 'email:entity'\n | 'email';\n\ninterface ChatPanelChannelData {\n conversationId: string;\n}\n\ninterface ChatPanelThreadData {\n conversationId: string;\n parentConversation: {\n conversationId: string;\n conversationThreadId: string;\n };\n chatMessageId: string;\n}\n\ninterface ChatPanelMentionData {\n conversationId: string;\n mentionMessageChatId: string;\n parentConversation?: {\n conversationId: string;\n conversationThreadId: string;\n };\n parentMessageChatId?: string;\n}\n\n/**\n * Data structure for entity panel information in the communication hub.\n * Used for both chat and email entity panels.\n */\ninterface PanelEntityData {\n /** Unique identifier for the entity */\n id: string;\n /** Display name of the entity */\n name: string;\n /** Entity type identifier */\n type: string;\n /** Human-readable type name */\n typeName: string;\n /** Panel title text (including id, type name and name) */\n title: string;\n /** Optional URL link to the entity */\n link?: string;\n}\n\ninterface EmailPanelData {\n conversationId: string;\n}\n\nexport interface CommHubRegistryItem<T extends CommHubActivePanelType> {\n type: T;\n data: T extends 'chat:channel'\n ? ChatPanelChannelData\n : T extends 'chat:thread'\n ? ChatPanelThreadData\n : T extends 'chat:mention'\n ? ChatPanelMentionData\n : T extends 'chat:entity'\n ? PanelEntityData\n : T extends 'email:entity'\n ? PanelEntityData\n : EmailPanelData;\n}\n\n@injectable()\nexport class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryReader<T extends CommHubActivePanelType> extends RegistryReader<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryWriter<T extends CommHubActivePanelType> extends RegistryWriter<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryStore<T extends CommHubActivePanelType> extends RegistryStore<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\nexport const CommHubRegistryProvider = provide({\n singletons: [CommHubRegistry, CommHubRegistryWriter, CommHubRegistryReader],\n})(({ children }) => {\n useDependencies(CommHubRegistry);\n\n return children;\n});\n"],"names":["injectable","provide","useDependencies","RegistryReader","RegistryService","RegistryWriter","RegistryStore","commHubRegistryId","CommHubActivePanelItemId","CommHubRegistry","constructor","CommHubRegistryReader","CommHubRegistryWriter","CommHubRegistryStore","CommHubRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AAAA,SAASA,UAAU,EAAEC,OAAO,EAAEC,eAAe,QAAQ,0BAA0B;AAC/E,SACIC,cAAc,EACdC,eAAe,EACfC,cAAc,QACX,qCAAqC;AAC5C,SAASC,aAAa,QAAQ,0CAA0C;AAExE,OAAO,MAAMC,oBAAoB,gCAAgC;AAEjE,OAAO,MAAMC,2BAA2B,eAAe;AAwEvD,OAAO,MAAMC,wBAA0DL;IAGnEM,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,8BAAgER;IAGzEO,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,8BAAgEP;IAGzEK,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMM,6BAA+DP;IAGxEI,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAEA,OAAO,MAAMO,0BAA0Bb,QAAQ;IAC3Cc,YAAY;QAACN;QAAiBG;QAAuBD;KAAsB;AAC/E,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZd,gBAAgBO;IAEhB,OAAOO;AACX,GAAG"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './comm-hub-registry';
2
2
  export * from './comm-hub-notifications-registry';
3
+ export * from './comm-hub-left-panel-registry';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './comm-hub-registry';
2
2
  export * from './comm-hub-notifications-registry';
3
+ export * from './comm-hub-left-panel-registry';
3
4
 
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './comm-hub-registry';\nexport * from './comm-hub-notifications-registry';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,oCAAoC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './comm-hub-registry';\nexport * from './comm-hub-notifications-registry';\nexport * from './comm-hub-left-panel-registry';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,oCAAoC;AAClD,cAAc,iCAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/toolbelt-shared-registry",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",
@@ -24,5 +24,5 @@
24
24
  "cli": {
25
25
  "webpack": false
26
26
  },
27
- "gitHead": "39e76910a22a9f965cb4fde2d81e79788f91d100"
27
+ "gitHead": "a561c50202c18af0e275027e04ab3432a9c270fa"
28
28
  }
@@ -0,0 +1,54 @@
1
+ import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
2
+ import {
3
+ RegistryReader,
4
+ RegistryService,
5
+ RegistryWriter,
6
+ } from '@servicetitan/shared-data-registry';
7
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
8
+
9
+ export const commHubLeftPanelRegistryId = 'toolbelt:comm-hub-left-panel-registry-id';
10
+ export const CommHubLeftPanelStateItemId = 'left-panel-state';
11
+
12
+ export interface CommHubLeftPanelState {
13
+ isOpen: boolean;
14
+ }
15
+
16
+ @injectable()
17
+ export class CommHubLeftPanelRegistry extends RegistryService<CommHubLeftPanelState> {
18
+ constructor() {
19
+ super(commHubLeftPanelRegistryId);
20
+ }
21
+ }
22
+
23
+ @injectable()
24
+ export class CommHubLeftPanelRegistryReader extends RegistryReader<CommHubLeftPanelState> {
25
+ constructor() {
26
+ super(commHubLeftPanelRegistryId);
27
+ }
28
+ }
29
+
30
+ @injectable()
31
+ export class CommHubLeftPanelRegistryWriter extends RegistryWriter<CommHubLeftPanelState> {
32
+ constructor() {
33
+ super(commHubLeftPanelRegistryId);
34
+ }
35
+ }
36
+
37
+ @injectable()
38
+ export class CommHubLeftPanelRegistryStore extends RegistryStore<CommHubLeftPanelState> {
39
+ constructor() {
40
+ super(commHubLeftPanelRegistryId);
41
+ }
42
+ }
43
+
44
+ export const CommHubLeftPanelRegistryProvider = provide({
45
+ singletons: [
46
+ CommHubLeftPanelRegistry,
47
+ CommHubLeftPanelRegistryWriter,
48
+ CommHubLeftPanelRegistryReader,
49
+ ],
50
+ })(({ children }) => {
51
+ useDependencies(CommHubLeftPanelRegistry);
52
+
53
+ return children;
54
+ });
@@ -15,6 +15,7 @@ export type CommHubActivePanelType =
15
15
  | 'chat:thread'
16
16
  | 'chat:mention'
17
17
  | 'chat:entity'
18
+ | 'email:entity'
18
19
  | 'email';
19
20
 
20
21
  interface ChatPanelChannelData {
@@ -40,11 +41,23 @@ interface ChatPanelMentionData {
40
41
  parentMessageChatId?: string;
41
42
  }
42
43
 
43
- interface ChatPanelEntityData {
44
+ /**
45
+ * Data structure for entity panel information in the communication hub.
46
+ * Used for both chat and email entity panels.
47
+ */
48
+ interface PanelEntityData {
49
+ /** Unique identifier for the entity */
44
50
  id: string;
51
+ /** Display name of the entity */
45
52
  name: string;
53
+ /** Entity type identifier */
46
54
  type: string;
55
+ /** Human-readable type name */
47
56
  typeName: string;
57
+ /** Panel title text (including id, type name and name) */
58
+ title: string;
59
+ /** Optional URL link to the entity */
60
+ link?: string;
48
61
  }
49
62
 
50
63
  interface EmailPanelData {
@@ -60,8 +73,10 @@ export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
60
73
  : T extends 'chat:mention'
61
74
  ? ChatPanelMentionData
62
75
  : T extends 'chat:entity'
63
- ? ChatPanelEntityData
64
- : EmailPanelData;
76
+ ? PanelEntityData
77
+ : T extends 'email:entity'
78
+ ? PanelEntityData
79
+ : EmailPanelData;
65
80
  }
66
81
 
67
82
  @injectable()
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './comm-hub-registry';
2
2
  export * from './comm-hub-notifications-registry';
3
+ export * from './comm-hub-left-panel-registry';