@hiver/connector-agent 4.25.0-prefillAuto-beta.1 → 4.25.0-prefillAuto-beta.4

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.
Files changed (71) hide show
  1. package/app/connector-cards.d.ts.map +1 -1
  2. package/components/ui/layover/view.d.ts +2 -1
  3. package/components/ui/layover/view.d.ts.map +1 -1
  4. package/constants/endpoints.d.ts +1 -0
  5. package/constants/endpoints.d.ts.map +1 -1
  6. package/constants/global-constants.d.ts +1 -0
  7. package/constants/global-constants.d.ts.map +1 -1
  8. package/constants/tracking-events.d.ts +6 -0
  9. package/constants/tracking-events.d.ts.map +1 -1
  10. package/features/connector-cards/components/connector-header/index.d.ts +1 -0
  11. package/features/connector-cards/components/connector-header/index.d.ts.map +1 -1
  12. package/features/write-form/api/getFormDefaultValues.d.ts +14 -14
  13. package/features/write-form/api/getFormDefaultValues.d.ts.map +1 -1
  14. package/features/write-form/api/getFormDefaults.d.ts +23 -16
  15. package/features/write-form/api/getFormDefaults.d.ts.map +1 -1
  16. package/features/write-form/api/linkSearch.d.ts +13 -0
  17. package/features/write-form/api/linkSearch.d.ts.map +1 -0
  18. package/features/write-form/components/card-linking/card-linking.d.ts +2 -1
  19. package/features/write-form/components/card-linking/card-linking.d.ts.map +1 -1
  20. package/features/write-form/components/link-search/constants.d.ts +38 -0
  21. package/features/write-form/components/link-search/constants.d.ts.map +1 -0
  22. package/features/write-form/components/link-search/index.d.ts +23 -0
  23. package/features/write-form/components/link-search/index.d.ts.map +1 -0
  24. package/features/write-form/components/link-search/kit.d.ts +85 -0
  25. package/features/write-form/components/link-search/kit.d.ts.map +1 -0
  26. package/features/write-form/components/link-search/level-fields.d.ts +18 -0
  27. package/features/write-form/components/link-search/level-fields.d.ts.map +1 -0
  28. package/features/write-form/components/link-search/link-menu.d.ts +30 -0
  29. package/features/write-form/components/link-search/link-menu.d.ts.map +1 -0
  30. package/features/write-form/components/link-search/link-select.d.ts +26 -0
  31. package/features/write-form/components/link-search/link-select.d.ts.map +1 -0
  32. package/features/write-form/components/link-search/parts.d.ts +7 -0
  33. package/features/write-form/components/link-search/parts.d.ts.map +1 -0
  34. package/features/write-form/components/link-search/styles.d.ts +12 -0
  35. package/features/write-form/components/link-search/styles.d.ts.map +1 -0
  36. package/features/write-form/components/link-search/task-search.d.ts +24 -0
  37. package/features/write-form/components/link-search/task-search.d.ts.map +1 -0
  38. package/features/write-form/components/link-search/use-link-search.d.ts +23 -0
  39. package/features/write-form/components/link-search/use-link-search.d.ts.map +1 -0
  40. package/features/write-form/components/link-search/use-menu-keys.d.ts +12 -0
  41. package/features/write-form/components/link-search/use-menu-keys.d.ts.map +1 -0
  42. package/features/write-form/components/link-search/utils.d.ts +13 -0
  43. package/features/write-form/components/link-search/utils.d.ts.map +1 -0
  44. package/features/write-form/components/link-search/v2-theme.d.ts +10 -0
  45. package/features/write-form/components/link-search/v2-theme.d.ts.map +1 -0
  46. package/features/write-form/components/map-form-defaults/index.d.ts +5 -1
  47. package/features/write-form/components/map-form-defaults/index.d.ts.map +1 -1
  48. package/features/write-form/components/write-form/index.d.ts.map +1 -1
  49. package/features/write-form/hooks/usePrefillPlacement.d.ts +5 -4
  50. package/features/write-form/hooks/usePrefillPlacement.d.ts.map +1 -1
  51. package/features/write-form/utils/prefillTaskProperties.d.ts +3 -3
  52. package/features/write-form/utils/prefillTaskProperties.d.ts.map +1 -1
  53. package/features/write-form/utils/prefillTracking.d.ts +2 -2
  54. package/features/write-form/utils/prefillTracking.d.ts.map +1 -1
  55. package/features/write-form/utils/prefillTruncation.d.ts +8 -8
  56. package/features/write-form/utils/prefillTruncation.d.ts.map +1 -1
  57. package/features/write-form/utils/summaryMaxChars.d.ts +22 -5
  58. package/features/write-form/utils/summaryMaxChars.d.ts.map +1 -1
  59. package/index.es.js +13206 -12146
  60. package/index.umd.js +778 -706
  61. package/main-dev.d.ts.map +1 -1
  62. package/package.json +4 -2
  63. package/store/slice.d.ts +3 -1
  64. package/store/slice.d.ts.map +1 -1
  65. package/testing/mocks/handlers/write-capability.d.ts.map +1 -1
  66. package/testing/test-utils.d.ts +4 -2
  67. package/testing/test-utils.d.ts.map +1 -1
  68. package/types/form.d.ts +25 -0
  69. package/types/form.d.ts.map +1 -1
  70. package/features/write-form/utils/charLimit.d.ts +0 -11
  71. package/features/write-form/utils/charLimit.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- export interface PrefillTrackingContext {
1
+ export interface IPrefillTrackingContext {
2
2
  tenant?: string;
3
3
  UG_Id?: string;
4
4
  SM_id?: string[];
@@ -14,5 +14,5 @@ export interface PrefillTrackingContext {
14
14
  export declare const getPrefillTrackingContext: ({ conversationId, smIds }: {
15
15
  conversationId?: number;
16
16
  smIds?: (string | number)[];
17
- }) => PrefillTrackingContext;
17
+ }) => IPrefillTrackingContext;
18
18
  //# sourceMappingURL=prefillTracking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prefillTracking.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/prefillTracking.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,8BAGnC;IACD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC7B,KAAG,sBASH,CAAC"}
1
+ {"version":3,"file":"prefillTracking.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/prefillTracking.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,8BAGnC;IACD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC7B,KAAG,uBASH,CAAC"}
@@ -3,7 +3,7 @@ export declare const PREFILL_TRUNCATION_ELLIPSIS = "\u2026";
3
3
  * The slice of a form field the truncation needs. Structural on purpose, so both
4
4
  * the raw `FieldListResponse` and the `@connector/ui` field configs satisfy it.
5
5
  */
6
- export interface PrefillLimitField {
6
+ export interface IPrefillLimitField {
7
7
  name: string;
8
8
  type?: string;
9
9
  multiline?: boolean;
@@ -14,23 +14,23 @@ export interface PrefillLimitField {
14
14
  isEmail?: unknown;
15
15
  };
16
16
  }
17
- export interface PrefillTruncation {
17
+ export interface IPrefillTruncation {
18
18
  field: string;
19
19
  originalLength: number;
20
20
  limit: number;
21
21
  }
22
22
  /**
23
- * The field's character limit: `field.limit`, else `validations.maxCharacters`.
24
- * A numeric string (`"255"`) is parsed; anything else non-positive is no limit.
23
+ * The field's character limit (the shared `resolveFieldCharLimit`): `field.limit`
24
+ * when it is a limit, else `validations.maxCharacters`. Numeric strings parse.
25
25
  */
26
- export declare const getPrefillFieldLimit: (field: PrefillLimitField) => number | undefined;
26
+ export declare const getPrefillFieldLimit: (field: IPrefillLimitField) => number | undefined;
27
27
  /**
28
28
  * Title-like = a single-line text input. Multiline (description) fields are not
29
29
  * cut here; their summary is sized to fit instead. URL / email inputs are left
30
30
  * alone too: a cut value would fail their format validation anyway, and a
31
31
  * silently broken link is worse than the visible length error.
32
32
  */
33
- export declare const isTitleLikeField: (field: PrefillLimitField) => boolean;
33
+ export declare const isTitleLikeField: (field: IPrefillLimitField) => boolean;
34
34
  /**
35
35
  * Cuts `value` to exactly `limit` characters ending in "…" when it is longer
36
36
  * than `limit`; returns it untouched otherwise. Never splits a surrogate pair
@@ -47,8 +47,8 @@ export declare const truncateToLimit: (value: string, limit: number) => string;
47
47
  * Returns a new values object (the input is not mutated) and one entry per
48
48
  * field that was shortened.
49
49
  */
50
- export declare const truncatePrefillValues: <T extends Record<string, unknown>>(values: T, fields: readonly PrefillLimitField[]) => {
50
+ export declare const truncatePrefillValues: <T extends Record<string, unknown>>(values: T, fields: readonly IPrefillLimitField[]) => {
51
51
  values: T;
52
- truncations: PrefillTruncation[];
52
+ truncations: IPrefillTruncation[];
53
53
  };
54
54
  //# sourceMappingURL=prefillTruncation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prefillTruncation.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/prefillTruncation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B,WAAM,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE;QACZ,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAChC,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,iBAAiB,KAAG,MAAM,GAAG,SACR,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,iBAAiB,KAAG,OAC2C,CAAC;AAExG;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,SAAS,MAAM,KAAG,MAM9D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAC7D,CAAC,UACD,SAAS,iBAAiB,EAAE,KACnC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,WAAW,EAAE,iBAAiB,EAAE,CAAA;CAe/C,CAAC"}
1
+ {"version":3,"file":"prefillTruncation.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/prefillTruncation.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,2BAA2B,WAAM,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE;QACZ,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAChC,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,kBAAkB,KAAG,MAAM,GAAG,SAAyC,CAAC;AAEpH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAG,OAC0C,CAAC;AAExG;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,SAAS,MAAM,KAAG,MAM9D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAC7D,CAAC,UACD,SAAS,kBAAkB,EAAE,KACpC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,WAAW,EAAE,kBAAkB,EAAE,CAAA;CAehD,CAAC"}
@@ -1,5 +1,17 @@
1
1
  export declare const PERMALINK_LINE_PREFIX = "\nLinked Hiver conversation: ";
2
2
  export declare const PERMALINK_URL_ALLOWANCE = 100;
3
+ export declare const HIVERWEB_TENANT = "HIVERWEB";
4
+ export declare const PERMALINK_HOST_ALLOWANCE = 60;
5
+ export interface IPermalinkContext {
6
+ tenant?: string | null;
7
+ ugId?: string | number | null;
8
+ conversationId?: string | number | null;
9
+ }
10
+ /**
11
+ * Characters reserved for the permalink URL the backend appends on submit.
12
+ * Never less than `PERMALINK_URL_ALLOWANCE`, so Gmail (HiG) keeps today's budget.
13
+ */
14
+ export declare const getPermalinkUrlAllowance: (context?: IPermalinkContext) => number;
3
15
  export declare const PERMALINK_LINE_ALLOWANCE: number;
4
16
  export declare const MIN_SUMMARY_MAX_CHARS = 50;
5
17
  export interface ISummaryFieldConfig {
@@ -21,16 +33,21 @@ export declare const hasAppendPermalink: (field?: ISummaryFieldConfig) => boolea
21
33
  /**
22
34
  * `max_chars` for one summary field: the field limit, minus the rest of the
23
35
  * resolved text around the token, minus the permalink line appended on submit
24
- * when `appendPermalink` applies. If the token appears more than once, the
36
+ * when `appendPermalink` applies (`permalinkUrlAllowance`, see
37
+ * `getPermalinkUrlAllowance`, reserved for the URL). If the token appears more than once, the
25
38
  * remaining budget is split between the copies.
26
39
  *
27
- * Returns `undefined` when the field has no limit (no cap, as before), and never
28
- * less than `MIN_SUMMARY_MAX_CHARS`.
40
+ * Returns `undefined` when the field has no limit (no cap, as before).
41
+ *
42
+ * `MIN_SUMMARY_MAX_CHARS` keeps a readable summary only when the field has no
43
+ * `appendPermalink`. With a permalink the budget is a hard cap, so the value
44
+ * plus the permalink line always fits the limit and the PM tool never clips the
45
+ * link; a budget of 0 or less returns 0, meaning "no room for a summary".
29
46
  */
30
- export declare const getSummaryMaxCharsForField: (field: ISummaryFieldConfig | undefined, value: string) => number | undefined;
47
+ export declare const getSummaryMaxCharsForField: (field: ISummaryFieldConfig | undefined, value: string, permalinkUrlAllowance?: number) => number | undefined;
31
48
  /**
32
49
  * One summary request feeds every mapped field, so the tightest per-field cap
33
50
  * wins. `undefined` when none of the fields has a limit.
34
51
  */
35
- export declare const getSummaryMaxChars: (fieldNames: string[], fields: ISummaryFieldConfig[] | undefined, defaults: Record<string, unknown> | null | undefined) => number | undefined;
52
+ export declare const getSummaryMaxChars: (fieldNames: string[], fields: ISummaryFieldConfig[] | undefined, defaults: Record<string, unknown> | null | undefined, permalinkUrlAllowance?: number) => number | undefined;
36
53
  //# sourceMappingURL=summaryMaxChars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summaryMaxChars.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/summaryMaxChars.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAOrE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,wBAAwB,QAAyD,CAAC;AAM/F,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5E,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACnC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,mBAAmB,KAAG,MAAM,GAAG,SAMxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,WAAY,mBAAmB,KAAG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