@servicetitan/dte-pdf-editor 1.73.0 → 1.74.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.
Files changed (209) hide show
  1. package/dist/components/display-conditions/condition-row.d.ts +1 -1
  2. package/dist/components/display-conditions/condition-row.d.ts.map +1 -1
  3. package/dist/components/display-conditions/display-condition.d.ts +1 -1
  4. package/dist/components/display-conditions/display-condition.d.ts.map +1 -1
  5. package/dist/components/display-conditions/display-condition.js.map +1 -1
  6. package/dist/components/field-config-panel/advanced-settings.d.ts +1 -1
  7. package/dist/components/field-config-panel/advanced-settings.d.ts.map +1 -1
  8. package/dist/components/field-config-panel/field-config-panel-overlay.d.ts +1 -1
  9. package/dist/components/field-config-panel/field-config-panel-overlay.d.ts.map +1 -1
  10. package/dist/components/field-config-panel/field-config-panel.d.ts +1 -1
  11. package/dist/components/field-config-panel/field-config-panel.d.ts.map +1 -1
  12. package/dist/components/field-config-panel/field-sidebar.d.ts +1 -1
  13. package/dist/components/field-config-panel/field-sidebar.d.ts.map +1 -1
  14. package/dist/components/field-config-panel/field-sidebar.js.map +1 -1
  15. package/dist/components/field-config-panel/formula-generator.d.ts +1 -1
  16. package/dist/components/field-config-panel/formula-generator.d.ts.map +1 -1
  17. package/dist/components/field-config-panel/formula-modal.d.ts +1 -1
  18. package/dist/components/field-config-panel/formula-modal.d.ts.map +1 -1
  19. package/dist/components/field-config-panel/formula-workspace.d.ts +1 -1
  20. package/dist/components/field-config-panel/formula-workspace.d.ts.map +1 -1
  21. package/dist/components/field-config-panel/result-type-selector.d.ts +1 -1
  22. package/dist/components/field-config-panel/result-type-selector.d.ts.map +1 -1
  23. package/dist/components/field-config-panel/table-configs.d.ts +1 -1
  24. package/dist/components/field-config-panel/table-configs.d.ts.map +1 -1
  25. package/dist/components/field-sidebar/calculated-field-type-list.d.ts +1 -1
  26. package/dist/components/field-sidebar/calculated-field-type-list.d.ts.map +1 -1
  27. package/dist/components/field-sidebar/data-model-field-type-list.d.ts +1 -1
  28. package/dist/components/field-sidebar/data-model-field-type-list.d.ts.map +1 -1
  29. package/dist/components/field-sidebar/e-sign-field-type-list.d.ts +1 -1
  30. package/dist/components/field-sidebar/e-sign-field-type-list.d.ts.map +1 -1
  31. package/dist/components/field-sidebar/field-sidebar.d.ts +1 -1
  32. package/dist/components/field-sidebar/field-sidebar.d.ts.map +1 -1
  33. package/dist/components/field-sidebar/fillable-field-type-list.d.ts +1 -1
  34. package/dist/components/field-sidebar/fillable-field-type-list.d.ts.map +1 -1
  35. package/dist/components/field-sidebar/form-fields-type-list.d.ts +1 -1
  36. package/dist/components/field-sidebar/form-fields-type-list.d.ts.map +1 -1
  37. package/dist/components/field-sidebar/generic-field-type-list.d.ts +1 -1
  38. package/dist/components/field-sidebar/generic-field-type-list.d.ts.map +1 -1
  39. package/dist/components/pdf-canvas/pdf-canvas.d.ts +1 -1
  40. package/dist/components/pdf-canvas/pdf-canvas.d.ts.map +1 -1
  41. package/dist/components/pdf-editor/pdf-editor.d.ts +1 -1
  42. package/dist/components/pdf-editor/pdf-editor.d.ts.map +1 -1
  43. package/dist/components/pdf-fields-overlay/pdf-fields-overlay.d.ts +1 -1
  44. package/dist/components/pdf-fields-overlay/pdf-fields-overlay.d.ts.map +1 -1
  45. package/dist/components/pdf-fields-overlay/pdf-overlay-field-calculated.d.ts +1 -1
  46. package/dist/components/pdf-fields-overlay/pdf-overlay-field-calculated.d.ts.map +1 -1
  47. package/dist/components/pdf-fields-overlay/pdf-overlay-field-data-model.d.ts +1 -1
  48. package/dist/components/pdf-fields-overlay/pdf-overlay-field-data-model.d.ts.map +1 -1
  49. package/dist/components/pdf-fields-overlay/pdf-overlay-field-e-sign.d.ts +1 -1
  50. package/dist/components/pdf-fields-overlay/pdf-overlay-field-e-sign.d.ts.map +1 -1
  51. package/dist/components/pdf-fields-overlay/pdf-overlay-field-fillable.d.ts +1 -1
  52. package/dist/components/pdf-fields-overlay/pdf-overlay-field-fillable.d.ts.map +1 -1
  53. package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.d.ts +1 -1
  54. package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.d.ts.map +1 -1
  55. package/dist/components/pdf-fields-overlay/pdf-overlay-field.d.ts +1 -1
  56. package/dist/components/pdf-fields-overlay/pdf-overlay-field.d.ts.map +1 -1
  57. package/dist/components/pdf-fields-overlay/pdf-overlay-field.js.map +1 -1
  58. package/dist/components/pdf-view/pdf-view-calculated.d.ts +1 -1
  59. package/dist/components/pdf-view/pdf-view-calculated.d.ts.map +1 -1
  60. package/dist/components/pdf-view/pdf-view-data-model.d.ts +1 -1
  61. package/dist/components/pdf-view/pdf-view-data-model.d.ts.map +1 -1
  62. package/dist/components/pdf-view/pdf-view-e-sign.d.ts +1 -1
  63. package/dist/components/pdf-view/pdf-view-e-sign.d.ts.map +1 -1
  64. package/dist/components/pdf-view/pdf-view-field-container.d.ts +1 -1
  65. package/dist/components/pdf-view/pdf-view-field-container.d.ts.map +1 -1
  66. package/dist/components/pdf-view/pdf-view-fillable.d.ts +1 -1
  67. package/dist/components/pdf-view/pdf-view-fillable.d.ts.map +1 -1
  68. package/dist/components/pdf-view/pdf-view-fillable.js.map +1 -1
  69. package/dist/components/pdf-view/pdf-view-generic.d.ts +1 -1
  70. package/dist/components/pdf-view/pdf-view-generic.d.ts.map +1 -1
  71. package/dist/components/pdf-view/pdf-view.d.ts +1 -1
  72. package/dist/components/pdf-view/pdf-view.d.ts.map +1 -1
  73. package/dist/constants/field.constants.d.ts +1 -1
  74. package/dist/constants/field.constants.d.ts.map +1 -1
  75. package/dist/hooks/useFieldDrag.d.ts +1 -1
  76. package/dist/hooks/useFieldDrag.d.ts.map +1 -1
  77. package/dist/hooks/useFieldResize.d.ts +1 -1
  78. package/dist/hooks/useFieldResize.d.ts.map +1 -1
  79. package/dist/hooks/useFormFields.d.ts +1 -1
  80. package/dist/hooks/useFormFields.d.ts.map +1 -1
  81. package/dist/hooks/usePdfFieldDnD.d.ts +1 -1
  82. package/dist/hooks/usePdfFieldDnD.d.ts.map +1 -1
  83. package/dist/hooks/usePdfFieldSelection.d.ts +1 -1
  84. package/dist/hooks/usePdfFieldSelection.d.ts.map +1 -1
  85. package/dist/styles/field-sidebar.css +2 -3
  86. package/dist/utils/conditions/evaluate.utils.d.ts +1 -1
  87. package/dist/utils/conditions/evaluate.utils.d.ts.map +1 -1
  88. package/dist/utils/conditions/schema-data-points.utils.d.ts +1 -1
  89. package/dist/utils/conditions/schema-data-points.utils.d.ts.map +1 -1
  90. package/dist/utils/data-model/extract-fields.utils.d.ts +1 -1
  91. package/dist/utils/data-model/extract-fields.utils.d.ts.map +1 -1
  92. package/dist/utils/data-model/resolve-values.utils.d.ts +1 -1
  93. package/dist/utils/data-model/resolve-values.utils.d.ts.map +1 -1
  94. package/dist/utils/field/field-drag.utils.d.ts +1 -1
  95. package/dist/utils/field/field-drag.utils.d.ts.map +1 -1
  96. package/dist/utils/field/field-placeholder-text.utils.d.ts +1 -1
  97. package/dist/utils/field/field-placeholder-text.utils.d.ts.map +1 -1
  98. package/dist/utils/field/field-resize.utils.d.ts +1 -1
  99. package/dist/utils/field/field-resize.utils.d.ts.map +1 -1
  100. package/dist/utils/field/get-field-bounds-style.utils.d.ts +1 -1
  101. package/dist/utils/field/get-field-bounds-style.utils.d.ts.map +1 -1
  102. package/dist/utils/field/get-field-bounds-style.utils.js.map +1 -1
  103. package/dist/utils/field/get-field-font-size.utils.d.ts +1 -1
  104. package/dist/utils/field/get-field-font-size.utils.d.ts.map +1 -1
  105. package/dist/utils/field/get-field-font-size.utils.js.map +1 -1
  106. package/dist/utils/field/get-field-text-clip.utils.d.ts +1 -1
  107. package/dist/utils/field/get-field-text-clip.utils.d.ts.map +1 -1
  108. package/dist/utils/field/get-field-text-clip.utils.js.map +1 -1
  109. package/dist/utils/field/get-field-typography.utils.d.ts +1 -1
  110. package/dist/utils/field/get-field-typography.utils.d.ts.map +1 -1
  111. package/dist/utils/formula/evaluate-formula.utils.d.ts +1 -1
  112. package/dist/utils/formula/evaluate-formula.utils.d.ts.map +1 -1
  113. package/dist/utils/formula/expression.utils.d.ts +1 -1
  114. package/dist/utils/formula/expression.utils.d.ts.map +1 -1
  115. package/dist/utils/formula/form-fields.utils.d.ts +1 -1
  116. package/dist/utils/formula/form-fields.utils.d.ts.map +1 -1
  117. package/dist/utils/formula/format-calculated-result.utils.d.ts +1 -1
  118. package/dist/utils/formula/format-calculated-result.utils.d.ts.map +1 -1
  119. package/dist/utils/formula/validate-formula.utils.d.ts +1 -1
  120. package/dist/utils/formula/validate-formula.utils.d.ts.map +1 -1
  121. package/dist/utils/pdf/pdfjs-init.js +9 -1
  122. package/dist/utils/pdf/pdfjs-init.js.map +1 -1
  123. package/dist/utils/recipients/map-colors.d.ts +1 -1
  124. package/dist/utils/recipients/map-colors.d.ts.map +1 -1
  125. package/dist/utils/shared/sample-data.utils.d.ts +1 -1
  126. package/dist/utils/shared/sample-data.utils.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/src/__tests__/field-types/date-fields.test.ts +3 -3
  129. package/src/__tests__/field-types/display-condition-fields.test.ts +5 -5
  130. package/src/__tests__/field-types/e-sign-fields.test.ts +2 -2
  131. package/src/__tests__/field-types/fillable-fields.test.ts +2 -4
  132. package/src/__tests__/field-types/form-fields.test.ts +10 -18
  133. package/src/__tests__/field-types/formula-fields.test.ts +6 -11
  134. package/src/__tests__/field-types/merge-tag-fields.test.ts +1 -5
  135. package/src/components/display-conditions/condition-row.tsx +6 -6
  136. package/src/components/display-conditions/display-condition.tsx +11 -12
  137. package/src/components/field-config-panel/advanced-settings.tsx +1 -1
  138. package/src/components/field-config-panel/field-config-panel-overlay.tsx +5 -5
  139. package/src/components/field-config-panel/field-config-panel.tsx +5 -5
  140. package/src/components/field-config-panel/field-sidebar.tsx +5 -1
  141. package/src/components/field-config-panel/formula-generator.tsx +8 -8
  142. package/src/components/field-config-panel/formula-modal.tsx +7 -7
  143. package/src/components/field-config-panel/formula-workspace.tsx +1 -1
  144. package/src/components/field-config-panel/result-type-selector.tsx +1 -1
  145. package/src/components/field-config-panel/table-configs.tsx +1 -1
  146. package/src/components/field-sidebar/calculated-field-type-list.tsx +1 -1
  147. package/src/components/field-sidebar/data-model-field-type-list.tsx +1 -1
  148. package/src/components/field-sidebar/e-sign-field-type-list.tsx +1 -1
  149. package/src/components/field-sidebar/field-sidebar.tsx +3 -3
  150. package/src/components/field-sidebar/fillable-field-type-list.tsx +1 -1
  151. package/src/components/field-sidebar/form-fields-type-list.tsx +1 -1
  152. package/src/components/field-sidebar/generic-field-type-list.tsx +1 -1
  153. package/src/components/pdf-canvas/pdf-canvas.tsx +1 -1
  154. package/src/components/pdf-editor/pdf-editor.tsx +5 -5
  155. package/src/components/pdf-fields-overlay/pdf-fields-overlay.tsx +1 -1
  156. package/src/components/pdf-fields-overlay/pdf-overlay-field-calculated.tsx +1 -1
  157. package/src/components/pdf-fields-overlay/pdf-overlay-field-data-model.tsx +1 -1
  158. package/src/components/pdf-fields-overlay/pdf-overlay-field-e-sign.tsx +1 -1
  159. package/src/components/pdf-fields-overlay/pdf-overlay-field-fillable.tsx +1 -1
  160. package/src/components/pdf-fields-overlay/pdf-overlay-field-generic.tsx +3 -3
  161. package/src/components/pdf-fields-overlay/pdf-overlay-field.tsx +1 -1
  162. package/src/components/pdf-view/pdf-view-calculated.tsx +1 -1
  163. package/src/components/pdf-view/pdf-view-data-model.tsx +1 -1
  164. package/src/components/pdf-view/pdf-view-e-sign.tsx +1 -1
  165. package/src/components/pdf-view/pdf-view-field-container.tsx +1 -1
  166. package/src/components/pdf-view/pdf-view-fillable.tsx +6 -1
  167. package/src/components/pdf-view/pdf-view-generic.tsx +3 -3
  168. package/src/components/pdf-view/pdf-view.tsx +5 -5
  169. package/src/constants/field.constants.ts +4 -4
  170. package/src/hooks/useFieldDrag.ts +1 -1
  171. package/src/hooks/useFieldResize.ts +1 -1
  172. package/src/hooks/useFormFields.ts +4 -4
  173. package/src/hooks/usePdfFieldDnD.ts +3 -3
  174. package/src/hooks/usePdfFieldSelection.ts +1 -1
  175. package/src/styles/field-sidebar.css +2 -3
  176. package/src/utils/conditions/__tests__/evaluate.utils.test.ts +16 -24
  177. package/src/utils/conditions/__tests__/schema-data-points.utils.test.ts +7 -2
  178. package/src/utils/conditions/evaluate.utils.ts +4 -4
  179. package/src/utils/conditions/schema-data-points.utils.ts +1 -1
  180. package/src/utils/data-model/__tests__/extract-fields.utils.test.ts +1 -1
  181. package/src/utils/data-model/__tests__/resolve-values.utils.test.ts +1 -1
  182. package/src/utils/data-model/extract-fields.utils.ts +7 -7
  183. package/src/utils/data-model/resolve-values.utils.ts +1 -1
  184. package/src/utils/field/__tests__/field-placeholder-text.utils.test.ts +1 -1
  185. package/src/utils/field/__tests__/get-field-bounds-style.utils.test.ts +1 -1
  186. package/src/utils/field/__tests__/get-field-text-clip.utils.test.ts +4 -4
  187. package/src/utils/field/__tests__/get-field-typography.utils.test.ts +1 -1
  188. package/src/utils/field/field-drag.utils.ts +1 -1
  189. package/src/utils/field/field-placeholder-text.utils.ts +1 -1
  190. package/src/utils/field/field-resize.utils.ts +1 -1
  191. package/src/utils/field/get-field-bounds-style.utils.ts +1 -1
  192. package/src/utils/field/get-field-font-size.utils.ts +1 -1
  193. package/src/utils/field/get-field-text-clip.utils.ts +1 -1
  194. package/src/utils/field/get-field-typography.utils.ts +1 -1
  195. package/src/utils/formula/__tests__/evaluate-formula.utils.test.ts +2 -6
  196. package/src/utils/formula/__tests__/expression.utils.test.ts +4 -11
  197. package/src/utils/formula/__tests__/form-fields.utils.test.ts +4 -4
  198. package/src/utils/formula/__tests__/format-calculated-result.utils.test.ts +6 -6
  199. package/src/utils/formula/__tests__/validate-formula.utils.test.ts +6 -10
  200. package/src/utils/formula/evaluate-formula.utils.ts +4 -4
  201. package/src/utils/formula/expression.utils.ts +4 -4
  202. package/src/utils/formula/form-fields.utils.ts +8 -8
  203. package/src/utils/formula/format-calculated-result.utils.ts +1 -1
  204. package/src/utils/formula/validate-formula.utils.ts +1 -1
  205. package/src/utils/pdf/pdfjs-init.ts +11 -1
  206. package/src/utils/recipients/__tests__/map-colors.test.ts +1 -1
  207. package/src/utils/recipients/map-colors.ts +1 -1
  208. package/src/utils/shared/sample-data.utils.ts +1 -1
  209. package/src/vite-env.d.ts +1 -1
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  FieldTypeEnum,
3
- FormFieldInfo,
4
- FormFieldsByFormIdI,
5
- FormInfo,
6
- StructuredFormula,
3
+ type FormFieldInfo,
4
+ type FormFieldsByFormIdI,
5
+ type FormInfo,
6
+ type StructuredFormula,
7
7
  } from '../../interface/types';
8
8
  import {
9
9
  buildFormFieldKey,
@@ -59,11 +59,7 @@ describe('form field scenarios', () => {
59
59
  '__submission_field.7.score-uuid-1',
60
60
  { formId: 7, fieldId: 'scoreuuid1' },
61
61
  ],
62
- [
63
- 'legacy __form_ path',
64
- '__form_7_abc123',
65
- { formId: 7, fieldId: 'abc123' },
66
- ],
62
+ ['legacy __form_ path', '__form_7_abc123', { formId: 7, fieldId: 'abc123' }],
67
63
  ])('parses %s', (_, key, expected) => {
68
64
  expect(parseFormFieldKey(key)).toEqual(expected);
69
65
  });
@@ -74,8 +70,7 @@ describe('form field scenarios', () => {
74
70
  });
75
71
 
76
72
  describe('with calculation options', () => {
77
- const subject = () =>
78
- formFieldInfosToCalculationOptions(form.id, formFields, form.name);
73
+ const subject = () => formFieldInfosToCalculationOptions(form.id, formFields, form.name);
79
74
 
80
75
  test('includes only number and date fields', () => {
81
76
  expect(subject().map(o => o.label)).toEqual(['Score', 'When']);
@@ -115,13 +110,10 @@ describe('form field scenarios', () => {
115
110
  ['number', formFields[0], 'number'],
116
111
  ['date', formFields[1], 'string'],
117
112
  ['text', formFields[2], 'string'],
118
- ] as const)(
119
- 'maps %s field to display-condition fieldType %s',
120
- (_, field, expectedType) => {
121
- const option = formFieldToDisplayConditionDataPointOption(form, field);
122
- expect(option.fieldType).toBe(expectedType);
123
- },
124
- );
113
+ ] as const)('maps %s field to display-condition fieldType %s', (_, field, expectedType) => {
114
+ const option = formFieldToDisplayConditionDataPointOption(form, field);
115
+ expect(option.fieldType).toBe(expectedType);
116
+ });
125
117
 
126
118
  test('uses field header as the display title', () => {
127
119
  const option = formFieldToDisplayConditionDataPointOption(form, formFields[0]);
@@ -1,8 +1,8 @@
1
1
  import {
2
- CalculatedFormatForNumber,
3
- FormFieldsByFormIdI,
4
- FormInfo,
5
- StructuredFormula,
2
+ type CalculatedFormatForNumber,
3
+ type FormFieldsByFormIdI,
4
+ type FormInfo,
5
+ type StructuredFormula,
6
6
  } from '../../interface/types';
7
7
  import {
8
8
  buildFormFieldKey,
@@ -101,14 +101,9 @@ describe('formula (calculated) field scenarios', () => {
101
101
 
102
102
  test('rejects a formula with unbalanced parentheses', () => {
103
103
  const formula: StructuredFormula = {
104
- tokens: [
105
- { type: 'lparen' },
106
- { type: 'number', value: '1' },
107
- ],
104
+ tokens: [{ type: 'lparen' }, { type: 'number', value: '1' }],
108
105
  };
109
- expect(validateFormula(formula, validPaths).errors).toContain(
110
- 'Unbalanced parentheses',
111
- );
106
+ expect(validateFormula(formula, validPaths).errors).toContain('Unbalanced parentheses');
112
107
  });
113
108
 
114
109
  test('rejects a formula referencing an unknown field', () => {
@@ -1,8 +1,4 @@
1
- import {
2
- FieldTypeEnum,
3
- SchemaObject,
4
- StructuredFormula,
5
- } from '../../interface/types';
1
+ import { FieldTypeEnum, type SchemaObject, type StructuredFormula } from '../../interface/types';
6
2
  import {
7
3
  evaluateFormula,
8
4
  extractGroupedFieldsFromDataModel,
@@ -4,15 +4,15 @@ import { useEffect, useMemo, useState } from 'react';
4
4
  import {
5
5
  CHECKBOX_CONDITION_VALUE,
6
6
  CHECKBOX_OPERATORS,
7
- ConditionOperator,
8
- DataPointOption,
9
- DisplayConditionSingle,
7
+ type ConditionOperator,
8
+ type DataPointOption,
9
+ type DisplayConditionSingle,
10
10
  FieldTypeEnum,
11
- FormFieldsByFormIdI,
12
- FormInfo,
11
+ type FormFieldsByFormIdI,
12
+ type FormInfo,
13
13
  NUMBER_OPERATORS,
14
14
  RADIO_OPERATORS,
15
- RadioGroupOption,
15
+ type RadioGroupOption,
16
16
  STRING_OPERATORS,
17
17
  VALUE_LESS_OPERATORS,
18
18
  } from '../../interface/types';
@@ -3,20 +3,19 @@ import PlusIcon from '@servicetitan/anvil2/assets/icons/material/round/add.svg';
3
3
  import DeleteIcon from '@servicetitan/anvil2/assets/icons/material/round/delete.svg';
4
4
  import EditIcon from '@servicetitan/anvil2/assets/icons/material/round/edit.svg';
5
5
  import { FC, Fragment, useState } from 'react';
6
- import { PdfField } from '../../interface/types';
6
+ import { type PdfField } from '../../interface/types';
7
7
  import { DisplayConditionModal, DisplayConditionModalProps } from './display-condition-modal';
8
8
 
9
- interface DisplayConditionProps
10
- extends Pick<
11
- DisplayConditionModalProps,
12
- | 'documentFields'
13
- | 'formFieldsByFormId'
14
- | 'formFieldsLoadingFormId'
15
- | 'forms'
16
- | 'initialState'
17
- | 'onRequestFormFields'
18
- | 'schema'
19
- > {
9
+ interface DisplayConditionProps extends Pick<
10
+ DisplayConditionModalProps,
11
+ | 'documentFields'
12
+ | 'formFieldsByFormId'
13
+ | 'formFieldsLoadingFormId'
14
+ | 'forms'
15
+ | 'initialState'
16
+ | 'onRequestFormFields'
17
+ | 'schema'
18
+ > {
20
19
  onSave: (state: Partial<PdfField>) => void;
21
20
  }
22
21
 
@@ -1,7 +1,7 @@
1
1
  import { Flex, SegmentedControl, Switch, Text } from '@servicetitan/anvil2';
2
2
  import { Dispatch, FC, SetStateAction } from 'react';
3
3
  import { DEFAULT_DATE_FORMAT, ROUNDING_OPTIONS } from '../../constants';
4
- import { CalculatedFieldFormat, CalculatedFormatForNumber } from '../../interface/types';
4
+ import { type CalculatedFieldFormat, type CalculatedFormatForNumber } from '../../interface/types';
5
5
 
6
6
  interface AdvancedSettingsProps {
7
7
  format: CalculatedFieldFormat;
@@ -2,11 +2,11 @@ import { Button, Flex, Text } from '@servicetitan/anvil2';
2
2
  import IconClose from '@servicetitan/anvil2/assets/icons/material/round/close.svg';
3
3
  import { FC } from 'react';
4
4
  import {
5
- FormFieldsByFormIdI,
6
- FormInfo,
7
- PdfField,
8
- RecipientInfo,
9
- SchemaObject,
5
+ type FormFieldsByFormIdI,
6
+ type FormInfo,
7
+ type PdfField,
8
+ type RecipientInfo,
9
+ type SchemaObject,
10
10
  } from '../../interface/types';
11
11
  import { FieldConfigPanel } from './field-config-panel';
12
12
 
@@ -4,11 +4,11 @@ import { E_SIGN_FIELD_TYPE_OPTIONS, FIELD_FONT_SIZE_OPTIONS } from '../../consta
4
4
  import {
5
5
  ESignFieldType,
6
6
  FieldTypeEnum,
7
- FormFieldsByFormIdI,
8
- FormInfo,
9
- PdfField,
10
- RecipientInfo,
11
- SchemaObject,
7
+ type FormFieldsByFormIdI,
8
+ type FormInfo,
9
+ type PdfField,
10
+ type RecipientInfo,
11
+ type SchemaObject,
12
12
  } from '../../interface/types';
13
13
  import {
14
14
  generateESignPath,
@@ -2,7 +2,11 @@ import { Button, Flex, SearchField, Text } from '@servicetitan/anvil2';
2
2
  import IconArrowBack from '@servicetitan/anvil2/assets/icons/material/round/keyboard_arrow_left.svg';
3
3
  import IconArrowForward from '@servicetitan/anvil2/assets/icons/material/round/keyboard_arrow_right.svg';
4
4
  import { FC, Fragment, useMemo, useState } from 'react';
5
- import { FieldTypeOption, FormFieldsByFormIdI, FormInfo } from '../../interface/types';
5
+ import {
6
+ type FieldTypeOption,
7
+ type FormFieldsByFormIdI,
8
+ type FormInfo,
9
+ } from '../../interface/types';
6
10
  import {
7
11
  formFieldInfosToCalculationOptions,
8
12
  getFieldSampleData,
@@ -2,15 +2,15 @@ import { Button } from '@servicetitan/anvil2';
2
2
  import EditIcon from '@servicetitan/anvil2/assets/icons/material/round/edit.svg';
3
3
  import { FC, Fragment, useMemo, useState } from 'react';
4
4
  import {
5
- CalculatedFieldFormat,
5
+ type CalculatedFieldFormat,
6
6
  FieldTypeEnum,
7
- FieldTypeOption,
8
- FormFieldsByFormIdI,
9
- FormInfo,
10
- PdfField,
11
- PdfFieldSubType,
12
- SchemaObject,
13
- StructuredFormula,
7
+ type FieldTypeOption,
8
+ type FormFieldsByFormIdI,
9
+ type FormInfo,
10
+ type PdfField,
11
+ type PdfFieldSubType,
12
+ type SchemaObject,
13
+ type StructuredFormula,
14
14
  } from '../../interface/types';
15
15
  import { extractGroupedFieldsFromDataModel } from '../../utils';
16
16
  import { FormulaModal } from './formula-modal';
@@ -9,13 +9,13 @@ import {
9
9
  } from '../../constants';
10
10
  import { useFormulaEditor } from '../../hooks';
11
11
  import {
12
- CalculatedFieldFormat,
13
- DataModelFieldGroup,
14
- DataModelValues,
15
- FieldTypeOption,
16
- FormFieldsByFormIdI,
17
- FormInfo,
18
- StructuredFormula,
12
+ type CalculatedFieldFormat,
13
+ type DataModelFieldGroup,
14
+ type DataModelValues,
15
+ type FieldTypeOption,
16
+ type FormFieldsByFormIdI,
17
+ type FormInfo,
18
+ type StructuredFormula,
19
19
  } from '../../interface/types';
20
20
  import {
21
21
  evaluateFormula,
@@ -10,7 +10,7 @@ import {
10
10
  useCallback,
11
11
  } from 'react';
12
12
  import { CALCULATED_OPERATIONS } from '../../constants';
13
- import { CalculatedFieldFormat } from '../../interface/types';
13
+ import { type CalculatedFieldFormat } from '../../interface/types';
14
14
  import { AdvancedSettings } from './advanced-settings';
15
15
  import { ResultTypeSelector } from './result-type-selector';
16
16
 
@@ -1,6 +1,6 @@
1
1
  import { Flex, SegmentedControl, Text } from '@servicetitan/anvil2';
2
2
  import { FC, Fragment } from 'react';
3
- import { CalculatedFieldFormat } from '../../interface/types';
3
+ import { type CalculatedFieldFormat } from '../../interface/types';
4
4
 
5
5
  interface ResultTypeSelectorProps {
6
6
  format: CalculatedFieldFormat;
@@ -1,7 +1,7 @@
1
1
  import { Button, Flex, Switch } from '@servicetitan/anvil2';
2
2
  import { FC, Fragment } from 'react';
3
3
  import { GENERIC_FIELD_TABLE_ROW_HEIGHT } from '../../constants';
4
- import { GenericFieldTableDataType, PdfField } from '../../interface/types';
4
+ import { type GenericFieldTableDataType, type PdfField } from '../../interface/types';
5
5
 
6
6
  interface TableConfigsProps {
7
7
  field: PdfField;
@@ -1,6 +1,6 @@
1
1
  import { FC, Fragment } from 'react';
2
2
  import { CALCULATED_FIELD_TYPES } from '../../constants';
3
- import { FieldTypeOption } from '../../interface/types';
3
+ import { type FieldTypeOption } from '../../interface/types';
4
4
  import { FieldType } from './field-type';
5
5
 
6
6
  interface CalculatedFieldTypeListProps {
@@ -1,6 +1,6 @@
1
1
  import { Flex, SearchField, Text } from '@servicetitan/anvil2';
2
2
  import { FC, Fragment, useMemo, useState } from 'react';
3
- import { DataModelFieldGroup, FieldTypeOption } from '../../interface/types';
3
+ import { type DataModelFieldGroup, type FieldTypeOption } from '../../interface/types';
4
4
  import { getFieldSampleData } from '../../utils';
5
5
  import { FieldType } from './field-type';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { FC, Fragment } from 'react';
2
2
  import { E_SIGN_FIELD_TYPES } from '../../constants';
3
- import { FieldTypeOption } from '../../interface/types';
3
+ import { type FieldTypeOption } from '../../interface/types';
4
4
  import { FieldType } from './field-type';
5
5
 
6
6
  interface ESignFieldTypeListProps {
@@ -4,10 +4,10 @@ import { FC, useMemo, useState } from 'react';
4
4
  import { menuGroups } from '../../constants';
5
5
  import { useToggle } from '../../hooks';
6
6
  import {
7
- DataModelFieldGroup,
7
+ type DataModelFieldGroup,
8
8
  FieldTypeEnum,
9
- FieldTypeOption,
10
- FormInfo,
9
+ type FieldTypeOption,
10
+ type FormInfo,
11
11
  } from '../../interface/types';
12
12
  import { CalculatedFieldTypeList } from './calculated-field-type-list';
13
13
  import { DataModelFieldTypeList } from './data-model-field-type-list';
@@ -1,7 +1,7 @@
1
1
  import { SearchField } from '@servicetitan/anvil2';
2
2
  import { FC, Fragment, useMemo, useState } from 'react';
3
3
  import { FILLABLE_FIELD_TYPES } from '../../constants';
4
- import { FieldTypeOption } from '../../interface/types';
4
+ import { type FieldTypeOption } from '../../interface/types';
5
5
  import { FieldType } from './field-type';
6
6
 
7
7
  interface FillableFieldTypeListProps {
@@ -3,7 +3,7 @@ import IconArrowBack from '@servicetitan/anvil2/assets/icons/material/round/keyb
3
3
  import IconArrowForward from '@servicetitan/anvil2/assets/icons/material/round/keyboard_arrow_right.svg';
4
4
  import { Stack } from '@servicetitan/design-system';
5
5
  import { FC, Fragment } from 'react';
6
- import { FieldTypeOption, FormInfo } from '../../interface/types';
6
+ import { type FieldTypeOption, type FormInfo } from '../../interface/types';
7
7
  import { getFieldSampleData } from '../../utils';
8
8
  import { FieldType } from './field-type';
9
9
 
@@ -1,6 +1,6 @@
1
1
  import { FC, Fragment } from 'react';
2
2
  import { GENERIC_FIELD_TYPES } from '../../constants';
3
- import { FieldTypeOption } from '../../interface/types';
3
+ import { type FieldTypeOption } from '../../interface/types';
4
4
  import { FieldType } from './field-type';
5
5
 
6
6
  interface GenericFieldTypeListProps {
@@ -1,7 +1,7 @@
1
1
  import { Flex } from '@servicetitan/anvil2';
2
2
  import { DragEvent, FC, MouseEvent, ReactNode, RefObject, useEffect, useState } from 'react';
3
3
  import { BASE_PAGE_WIDTH } from '../../constants';
4
- import { PdfField } from '../../interface/types';
4
+ import { type PdfField } from '../../interface/types';
5
5
  import { PdfFieldsOverlay } from '../pdf-fields-overlay/pdf-fields-overlay';
6
6
  import { PdfDocumentRenderer } from './pdf-document-renderer';
7
7
 
@@ -3,11 +3,11 @@ import { FC, ReactNode, useCallback, useMemo, useRef } from 'react';
3
3
  import { useFormFields, usePdfFieldDnD, usePdfFieldSelection } from '../../hooks';
4
4
  import {
5
5
  FieldTypeEnum,
6
- FormFieldsByFormIdI,
7
- FormInfo,
8
- PdfField,
9
- RecipientInfo,
10
- SchemaObject,
6
+ type FormFieldsByFormIdI,
7
+ type FormInfo,
8
+ type PdfField,
9
+ type RecipientInfo,
10
+ type SchemaObject,
11
11
  } from '../../interface/types';
12
12
  import { extractGroupedFieldsFromDataModel, mapColorsToRecipients } from '../../utils';
13
13
  import { FieldConfigPanelOverlay } from '../field-config-panel/field-config-panel-overlay';
@@ -1,5 +1,5 @@
1
1
  import { FC, MouseEvent, RefObject, useMemo } from 'react';
2
- import { PdfField } from '../../interface/types';
2
+ import { type PdfField } from '../../interface/types';
3
3
  import { PdfOverlayField } from './pdf-overlay-field';
4
4
 
5
5
  interface PdfFieldsOverlayProps {
@@ -1,5 +1,5 @@
1
1
  import { FC, useMemo } from 'react';
2
- import { PdfField } from '../../interface/types';
2
+ import { type PdfField } from '../../interface/types';
3
3
  import { formulaToDisplayText, getFieldTextClipClassName } from '../../utils';
4
4
 
5
5
  interface PdfOverlayFieldCalculatedProps {
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { PdfField } from '../../interface/types';
2
+ import { type PdfField } from '../../interface/types';
3
3
  import { getFieldTextClipClassName } from '../../utils';
4
4
 
5
5
  interface PdfOverlayFieldDataModelProps {
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { PdfField } from '../../interface/types';
2
+ import { type PdfField } from '../../interface/types';
3
3
 
4
4
  interface PdfOverlayFieldESignProps {
5
5
  field: PdfField;
@@ -1,6 +1,6 @@
1
1
  import { FC, Fragment } from 'react';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
- import { PdfField } from '../../interface/types';
3
+ import { type PdfField } from '../../interface/types';
4
4
  import { getFieldPlaceholderText, getFieldTextClipClassName } from '../../utils';
5
5
  import { AddHandle } from './add-handle';
6
6
 
@@ -1,9 +1,9 @@
1
1
  import { FC, useMemo, useState } from 'react';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import {
4
- GenericFieldTableDataType,
5
- GenericFieldTextDataType,
6
- PdfField,
4
+ type GenericFieldTableDataType,
5
+ type GenericFieldTextDataType,
6
+ type PdfField,
7
7
  } from '../../interface/types';
8
8
  import { InlineEditable } from '../shared';
9
9
 
@@ -1,7 +1,7 @@
1
1
  import { FC, MouseEvent, RefObject } from 'react';
2
2
  import { DISABLE_FIELD_RESIZE } from '../../constants';
3
3
  import { useFieldDrag, useFieldResize } from '../../hooks';
4
- import { FieldTypeEnum, PdfField } from '../../interface/types';
4
+ import { FieldTypeEnum, type PdfField } from '../../interface/types';
5
5
  import { getFieldBackgroundColor, getFieldBoundsStyle, getPagePosition } from '../../utils';
6
6
  import { PdfOverlayFieldCalculated } from './pdf-overlay-field-calculated';
7
7
  import { PdfOverlayFieldDataModel } from './pdf-overlay-field-data-model';
@@ -1,5 +1,5 @@
1
1
  import { FC, useMemo } from 'react';
2
- import { DataModelValues, PdfField, PdfViewMode } from '../../interface/types';
2
+ import { type DataModelValues, type PdfField, type PdfViewMode } from '../../interface/types';
3
3
  import {
4
4
  evaluateFormula,
5
5
  formatCalculatedResult,
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { DataModelValues, PdfField } from '../../interface/types';
2
+ import { type DataModelValues, type PdfField } from '../../interface/types';
3
3
  import { getFieldTextClipClassName, nl2br, resolvePdfDataValues } from '../../utils';
4
4
 
5
5
  interface PdfViewDataModelProps {
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { PdfField } from '../../interface/types';
2
+ import { type PdfField } from '../../interface/types';
3
3
 
4
4
  interface PdfViewESignProps {
5
5
  field: PdfField;
@@ -1,5 +1,5 @@
1
1
  import { FC, Fragment, PropsWithChildren, RefObject } from 'react';
2
- import { DataModelValues, PdfField } from '../../interface/types';
2
+ import { type DataModelValues, type PdfField } from '../../interface/types';
3
3
  import {
4
4
  evaluateDisplayCondition,
5
5
  getFieldBackgroundColor,
@@ -1,5 +1,10 @@
1
1
  import { FC } from 'react';
2
- import { DataChangePayload, DataModelValues, PdfField, PdfViewMode } from '../../interface/types';
2
+ import {
3
+ type DataChangePayload,
4
+ type DataModelValues,
5
+ type PdfField,
6
+ type PdfViewMode,
7
+ } from '../../interface/types';
3
8
  import {
4
9
  dateToUtcZero,
5
10
  getFieldPlaceholderText,
@@ -1,9 +1,9 @@
1
1
  import { type CSSProperties, FC, useMemo } from 'react';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import {
4
- GenericFieldTableDataType,
5
- GenericFieldTextDataType,
6
- PdfField,
4
+ type GenericFieldTableDataType,
5
+ type GenericFieldTextDataType,
6
+ type PdfField,
7
7
  } from '../../interface/types';
8
8
 
9
9
  interface PdfViewGenericProps {
@@ -2,12 +2,12 @@ import { Flex } from '@servicetitan/anvil2';
2
2
  import { FC, ReactNode, useRef, useState } from 'react';
3
3
  import { BASE_PAGE_WIDTH } from '../../constants';
4
4
  import {
5
- DataChangePayload,
6
- DataModelValues,
5
+ type DataChangePayload,
6
+ type DataModelValues,
7
7
  FieldTypeEnum,
8
- PdfField,
9
- PdfViewMode,
10
- RecipientInfo,
8
+ type PdfField,
9
+ type PdfViewMode,
10
+ type RecipientInfo,
11
11
  } from '../../interface/types';
12
12
  import { mapColorsToRecipients } from '../../utils';
13
13
  import { PdfDocumentRenderer } from '../pdf-canvas/pdf-document-renderer';
@@ -1,10 +1,10 @@
1
1
  import {
2
- CalculatedFormatForDate,
3
- CalculatedFormatForNumber,
2
+ type CalculatedFormatForDate,
3
+ type CalculatedFormatForNumber,
4
4
  ESignFieldType,
5
5
  FieldTypeEnum,
6
- FieldTypeOption,
7
- PdfFieldSubType,
6
+ type FieldTypeOption,
7
+ type PdfFieldSubType,
8
8
  } from '../interface/types';
9
9
  import { DEFAULT_DATE_FORMAT } from './calculated.constants';
10
10
  import { BASE_PAGE_WIDTH } from './pdf-editor.constants';
@@ -1,5 +1,5 @@
1
1
  import { DragEvent, MutableRefObject, RefObject, useCallback, useRef, useState } from 'react';
2
- import { PdfField } from '../interface/types';
2
+ import { type PdfField } from '../interface/types';
3
3
  import {
4
4
  getPageDimensions,
5
5
  getPageNumberFromClientY,
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent, RefObject, useEffect, useRef, useState } from 'react';
2
- import { PdfField } from '../interface/types';
2
+ import { type PdfField } from '../interface/types';
3
3
  import { handleFieldResize, handleFieldResizeStart } from '../utils';
4
4
 
5
5
  interface UseFieldResizeOptions {
@@ -1,10 +1,10 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import {
3
3
  FieldTypeEnum,
4
- FieldTypeOption,
5
- FormFieldsByFormIdI,
6
- FormInfo,
7
- PdfField,
4
+ type FieldTypeOption,
5
+ type FormFieldsByFormIdI,
6
+ type FormInfo,
7
+ type PdfField,
8
8
  } from '../interface/types';
9
9
  import { formFieldInfoToFieldTypeOption } from '../utils';
10
10
 
@@ -10,9 +10,9 @@ import {
10
10
  import {
11
11
  ESignFieldType,
12
12
  FieldTypeEnum,
13
- FieldTypeOption,
14
- PdfField,
15
- RecipientInfo,
13
+ type FieldTypeOption,
14
+ type PdfField,
15
+ type RecipientInfo,
16
16
  } from '../interface/types';
17
17
  import {
18
18
  calculateDropCoordinates,
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent, useMemo, useState } from 'react';
2
- import { PdfField } from '../interface/types';
2
+ import { type PdfField } from '../interface/types';
3
3
 
4
4
  export const usePdfFieldSelection = (
5
5
  fields: PdfField[],
@@ -8,7 +8,6 @@
8
8
  }
9
9
 
10
10
  .dte-field-sidebar-menu-item {
11
- --sub-item-color: unset;
12
11
  cursor: pointer;
13
12
  }
14
13
 
@@ -27,15 +26,15 @@
27
26
  .dte-field-sidebar-menu-item-text,
28
27
  .dte-field-sidebar-menu-item-icon {
29
28
  transition: color 0.2s ease-out;
30
- color: var(--sub-item-color);
29
+ color: var(--sub-item-color) !important;
31
30
  }
32
31
 
33
32
  .dte-field-sidebar-toggler {
34
- position: absolute;
35
33
  top: 0;
36
34
  right: -5px;
37
35
  cursor: pointer;
38
36
  background: transparent;
37
+ position: absolute !important;
39
38
  }
40
39
 
41
40
  .dte-field-sidebar-content {