@ezychat/web 0.1.73 → 0.1.75

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.
@@ -1482,6 +1482,127 @@ export declare const enResources: {
1482
1482
  admin: string;
1483
1483
  noName: string;
1484
1484
  };
1485
+ groupAdmin: {
1486
+ title: string;
1487
+ agentOnly: string;
1488
+ notAdminTitle: string;
1489
+ notAdminBody: string;
1490
+ offline: string;
1491
+ inviteOnly: string;
1492
+ inviteOnlyNoMax: string;
1493
+ edit: string;
1494
+ add: string;
1495
+ link: string;
1496
+ invite: string;
1497
+ settings: string;
1498
+ full: string;
1499
+ requests_one: string;
1500
+ requests_other: string;
1501
+ approve: string;
1502
+ reject: string;
1503
+ approved: string;
1504
+ editTitle: string;
1505
+ editHint: string;
1506
+ name: string;
1507
+ description: string;
1508
+ descriptionPlaceholder: string;
1509
+ saved: string;
1510
+ cancel: string;
1511
+ save: string;
1512
+ done: string;
1513
+ addTitle: string;
1514
+ addHint: string;
1515
+ phone: string;
1516
+ banRisk: string;
1517
+ addButton: string;
1518
+ addedToast: string;
1519
+ privacyTitle: string;
1520
+ privacyBody: string;
1521
+ sendInvite: string;
1522
+ invitedTitle: string;
1523
+ invitedBody: string;
1524
+ linkTitle: string;
1525
+ linkHint: string;
1526
+ linkHintApi: string;
1527
+ linkApproval: string;
1528
+ copy: string;
1529
+ copied: string;
1530
+ reset: string;
1531
+ resetTitle: string;
1532
+ resetBody: string;
1533
+ resetConfirm: string;
1534
+ resetDone: string;
1535
+ settingsTitle: string;
1536
+ settingsHint: string;
1537
+ settingsApi: string;
1538
+ set: {
1539
+ announce: string;
1540
+ announceHint: string;
1541
+ locked: string;
1542
+ lockedHint: string;
1543
+ memberAdd: string;
1544
+ onlyAdmins: string;
1545
+ everyone: string;
1546
+ approval: string;
1547
+ approvalHint: string;
1548
+ };
1549
+ history: string;
1550
+ historyNote: string;
1551
+ log: {
1552
+ name: string;
1553
+ description: string;
1554
+ added: string;
1555
+ invited: string;
1556
+ removed: string;
1557
+ promoted: string;
1558
+ demoted: string;
1559
+ linkReset: string;
1560
+ approved: string;
1561
+ rejected: string;
1562
+ setting: {
1563
+ announce: string;
1564
+ locked: string;
1565
+ memberAdd: string;
1566
+ approval: string;
1567
+ };
1568
+ someone: string;
1569
+ someMember: string;
1570
+ };
1571
+ memberActions: string;
1572
+ ownerNote: string;
1573
+ makeAdmin: string;
1574
+ removeAdmin: string;
1575
+ remove: string;
1576
+ promoted: string;
1577
+ demoted: string;
1578
+ removed: string;
1579
+ removeTitle: string;
1580
+ removeBody: string;
1581
+ removeBodyApi: string;
1582
+ removeConfirm: string;
1583
+ demoteTitle: string;
1584
+ demoteBody: string;
1585
+ demoteConfirm: string;
1586
+ err: {
1587
+ offline: string;
1588
+ notAdmin: string;
1589
+ already: string;
1590
+ notOnWhatsApp: string;
1591
+ tooMany: string;
1592
+ owner: string;
1593
+ notSupported: string;
1594
+ notMember: string;
1595
+ full: string;
1596
+ inviteExpired: string;
1597
+ inboxRemoved: string;
1598
+ failed: string;
1599
+ };
1600
+ historyEmpty: string;
1601
+ settingsNone: string;
1602
+ linkUnavailable: string;
1603
+ tipTitle: string;
1604
+ tipBody: string;
1605
+ };
1485
1606
  };
1486
1607
  admin: {
1487
1608
  title: string;
@@ -2689,6 +2810,7 @@ export declare const enResources: {
2689
2810
  services: string;
2690
2811
  shops: string;
2691
2812
  education: string;
2813
+ operations: string;
2692
2814
  };
2693
2815
  noMatch: string;
2694
2816
  dental: {
@@ -2831,6 +2953,28 @@ export declare const enResources: {
2831
2953
  contextName: string;
2832
2954
  contextText: string;
2833
2955
  };
2956
+ groupAgentTag: string;
2957
+ groupSetupNew: string;
2958
+ groupSetupExisting: string;
2959
+ groupSetupNext: string;
2960
+ groupSetupDone: string;
2961
+ groupSetupFailed: string;
2962
+ claims: {
2963
+ name: string;
2964
+ description: string;
2965
+ keywords: string;
2966
+ agentName: string;
2967
+ focus: string;
2968
+ handoffRules: string;
2969
+ contextName: string;
2970
+ contextText: string;
2971
+ };
2972
+ source: {
2973
+ loaded: string;
2974
+ builtin: string;
2975
+ offline: string;
2976
+ };
2977
+ worksWith: string;
2834
2978
  };
2835
2979
  resolution: {
2836
2980
  title: string;
@@ -28,6 +28,27 @@ export declare function shiftIssues<T extends {
28
28
  }>(issues: T[], before: string, after: string): T[];
29
29
  /** Applies the marks that have a fix (they never overlap); a mark whose text changed is skipped. */
30
30
  export declare function applyFixes(text: string, issues: readonly FixIssue[], pick?: string): string;
31
+ /**
32
+ * What a fix adds when it only inserts text ("email" → "email." adds "."; "email" → "your email"
33
+ * adds "your "), else ''.
34
+ */
35
+ export declare function insertedText(original: string, replacement: string): string;
36
+ /** A fix applied in this draft: where its text now stands, and what it inserted. */
37
+ interface AppliedFix {
38
+ start: number;
39
+ end: number;
40
+ inserted: string;
41
+ }
42
+ /**
43
+ * The grammar marks of one answer: in order, never two on the same text (the first wins), and
44
+ * never the same insertion again where this draft already got it ("email." + "." → "email..").
45
+ */
46
+ export declare function grammarMarks(issues: readonly {
47
+ start: number;
48
+ end: number;
49
+ original: string;
50
+ replacement: string;
51
+ }[], applied: readonly AppliedFix[]): FixIssue[];
31
52
  export declare function useFixEnglish(text: string, { jid, status, chatName, teamWords, disabled, }: {
32
53
  jid: string | null;
33
54
  status: FixEnglishStatus | undefined;
@@ -39,6 +60,11 @@ export declare function useFixEnglish(text: string, { jid, status, chatName, tea
39
60
  issues: FixIssue[];
40
61
  fixable: FixIssue[];
41
62
  grammarStatus: GrammarStatus;
63
+ /**
64
+ * The text with these fixes applied (`pick` for a choice in the card), remembered for this
65
+ * draft so a later check never offers the same insertion at the same place again.
66
+ */
67
+ apply(current: string, list: readonly FixIssue[], pick?: string): string;
42
68
  ignore(issue: FixIssue): void;
43
69
  };
44
70
  /**
@@ -86,3 +112,4 @@ export declare function FixEnglishButton({ count, marks, grammarStatus, grammar,
86
112
  onFixAll(): void;
87
113
  onUndo(): void;
88
114
  }): import("react").JSX.Element;
115
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { GroupInfoResponse, GroupMember } from '@ezychat/shared';
2
+ /**
3
+ * Manage group (design docs/features/group-management/design.md): EzyChat admins change a WhatsApp
4
+ * group from Group info, with only the actions this connection supports (`caps`, never a type
5
+ * name) while the linked number is a group admin; agents and non-admin numbers see why they can't.
6
+ */
7
+ export declare function GroupAdminBar({ data }: Readonly<{
8
+ data: GroupInfoResponse;
9
+ }>): import("react").JSX.Element | null;
10
+ /** Member details: make / remove group admin and remove from the group. Never for me. */
11
+ export declare function MemberAdminActions({ groupJid, member, label, onRemoved, }: Readonly<{
12
+ groupJid: string;
13
+ member: GroupMember;
14
+ label: string;
15
+ onRemoved(): void;
16
+ }>): import("react").JSX.Element | null;
@@ -0,0 +1,23 @@
1
+ import { type GroupAdminResponse, type GroupChange, type GroupInfoResponse } from '@ezychat/shared';
2
+ import { type T } from './GroupAdminShared';
3
+ export declare function EditGroupDialog({ jid, data, view, onClose, }: Readonly<{
4
+ jid: string;
5
+ data: GroupInfoResponse;
6
+ view: GroupAdminResponse;
7
+ onClose(): void;
8
+ }>): import("react").JSX.Element;
9
+ export declare function AddMemberDialog({ jid, onClose }: Readonly<{
10
+ jid: string;
11
+ onClose(): void;
12
+ }>): import("react").JSX.Element;
13
+ export declare function InviteLinkDialog({ jid, view, onClose, }: Readonly<{
14
+ jid: string;
15
+ view: GroupAdminResponse;
16
+ onClose(): void;
17
+ }>): import("react").JSX.Element;
18
+ export declare function changeLine(c: GroupChange, t: T): string;
19
+ export declare function GroupSettingsDialog({ jid, view, onClose, }: Readonly<{
20
+ jid: string;
21
+ view: GroupAdminResponse;
22
+ onClose(): void;
23
+ }>): import("react").JSX.Element;
@@ -0,0 +1,60 @@
1
+ import type { useTranslation } from 'react-i18next';
2
+ import type { GroupAdminCaps, GroupAdminResponse } from '@ezychat/shared';
3
+ export type T = ReturnType<typeof useTranslation<'inbox'>>['t'];
4
+ export declare function groupAdminErrorText(err: unknown, t: T): string;
5
+ /** Whether the connection lets EzyChat change anything in this group. */
6
+ export declare function hasAnyGroupCap(caps: GroupAdminCaps): boolean;
7
+ /** Why nothing can be changed right now: one reason, in this order. */
8
+ export type GroupAdminBlock = 'agent' | 'notAdmin' | 'offline' | null;
9
+ export declare function groupAdminBlock(view: GroupAdminResponse): GroupAdminBlock;
10
+ /** The admin view of a group, and whether this user may change it now. */
11
+ export declare function useGroupAdminState(jid: string): {
12
+ view: {
13
+ caps: {
14
+ editInfo: boolean;
15
+ addMembers: boolean;
16
+ inviteOnly: boolean;
17
+ removeMembers: boolean;
18
+ admins: boolean;
19
+ inviteLink: boolean;
20
+ resetInviteLink: boolean;
21
+ settings: ("locked" | "announce" | "memberAdd" | "approval")[];
22
+ joinRequests: boolean;
23
+ maxMembers: number | null;
24
+ nameMax: number;
25
+ descriptionMax: number;
26
+ };
27
+ canManage: boolean;
28
+ online: boolean;
29
+ myRole: "admin" | "member" | "superadmin" | null;
30
+ settings: {
31
+ announce?: boolean | undefined;
32
+ locked?: boolean | undefined;
33
+ memberAdd?: "all" | "admins" | undefined;
34
+ approval?: boolean | undefined;
35
+ };
36
+ inviteLink: string | null;
37
+ requests: {
38
+ jid: string;
39
+ phone: string | null;
40
+ name: string | null;
41
+ at: number | null;
42
+ }[];
43
+ changes: {
44
+ at: number;
45
+ byUserId: number | null;
46
+ byName: string | null;
47
+ action: "description" | "setting" | "rename" | "member_add" | "member_invite" | "member_remove" | "admin_promote" | "admin_demote" | "invite_reset" | "join_approve" | "join_reject";
48
+ memberJid: string | null;
49
+ memberName: string | null;
50
+ setting: "locked" | "announce" | "memberAdd" | "approval" | null;
51
+ value: boolean | "all" | "admins" | null;
52
+ }[];
53
+ size: number | null;
54
+ } | undefined;
55
+ anyCap: boolean;
56
+ block: GroupAdminBlock;
57
+ can: boolean;
58
+ };
59
+ /** Members besides the business number (the count the Business API limit uses). */
60
+ export declare function othersCount(view: GroupAdminResponse, fallbackSize: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.73",
3
+ "version": "0.1.75",
4
4
  "type": "module",
5
5
  "description": "EzyChat core: the team inbox web app (React) as a library, with createInboxApp and its extension API.",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "build:lib": "node ../../scripts/build-web-lib.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@ezychat/shared": "0.1.73",
43
+ "@ezychat/shared": "0.1.75",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.105.0",
46
46
  "@types/react": "^19.3.0",