@tellescope/react-components 1.206.0 → 1.207.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/lib/cjs/Forms/forms.d.ts +1 -0
- package/lib/cjs/Forms/forms.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +6 -2
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +4 -5
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/inputs_shared.d.ts.map +1 -1
- package/lib/cjs/inputs_shared.js +25 -1
- package/lib/cjs/inputs_shared.js.map +1 -1
- package/lib/cjs/state.d.ts +37 -0
- package/lib/cjs/state.d.ts.map +1 -1
- package/lib/cjs/state.js +19 -3
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +0 -1
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/form_responses.d.ts +0 -1
- package/lib/esm/Forms/form_responses.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +4 -3
- package/lib/esm/Forms/forms.d.ts.map +1 -1
- package/lib/esm/Forms/forms.js +6 -2
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +0 -1
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +4 -5
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/inputs.native.d.ts +0 -1
- package/lib/esm/inputs.native.d.ts.map +1 -1
- package/lib/esm/inputs_shared.d.ts.map +1 -1
- package/lib/esm/inputs_shared.js +25 -1
- package/lib/esm/inputs_shared.js.map +1 -1
- package/lib/esm/state.d.ts +81 -44
- package/lib/esm/state.d.ts.map +1 -1
- package/lib/esm/state.js +15 -0
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/Forms/forms.tsx +4 -1
- package/src/Forms/hooks.tsx +1 -3
- package/src/inputs_shared.tsx +17 -1
- package/src/state.tsx +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.207.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.9.0",
|
|
49
49
|
"@stripe/stripe-js": "^1.52.1",
|
|
50
|
-
"@tellescope/constants": "^1.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.207.0",
|
|
51
|
+
"@tellescope/sdk": "^1.207.0",
|
|
52
|
+
"@tellescope/types-client": "^1.207.0",
|
|
53
|
+
"@tellescope/types-models": "^1.207.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.207.0",
|
|
55
|
+
"@tellescope/utilities": "^1.207.0",
|
|
56
|
+
"@tellescope/validation": "^1.207.0",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
58
|
"@typescript-eslint/parser": "^4.33.0",
|
|
59
59
|
"css-to-react-native": "^3.0.0",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"yup": "^0.32.10"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
84
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
83
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
84
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
85
85
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "ddf48910e1681e4fc241e85af98f4c6a0f3f42bb",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/Forms/forms.tsx
CHANGED
|
@@ -35,6 +35,7 @@ export const TellescopeFormContainer = ({ businessId, organizationIds, ...props
|
|
|
35
35
|
|
|
36
36
|
const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ children, language, onChangeLanguage, style, hideBg, backgroundColor, hideLogo, logoHeight }) => {
|
|
37
37
|
const theme = useOrganizationTheme()
|
|
38
|
+
console.log('logoHeight',logoHeight)
|
|
38
39
|
|
|
39
40
|
const formContent = (
|
|
40
41
|
<Flex flex={1} column>
|
|
@@ -96,12 +97,13 @@ export interface TellescopeFormProps extends ReturnType<typeof useTellescopeForm
|
|
|
96
97
|
enduser?: Partial<Enduser>,
|
|
97
98
|
groupId?: string,
|
|
98
99
|
groupInstance?: string,
|
|
100
|
+
logoHeight?: number,
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
const LOGO_HEIGHT = 40
|
|
102
104
|
export const TellescopeForm = (props : TellescopeFormProps & Styled & { hideBg?: boolean, theme?: OrganizationTheme, inputStyle?: React.CSSProperties }) => (
|
|
103
105
|
<WithOrganizationTheme>
|
|
104
|
-
<TellescopeFormWithContext {...props} />
|
|
106
|
+
<TellescopeFormWithContext {...props} logoHeight={props?.logoHeight || props?.form?.customization?.logoHeight} />
|
|
105
107
|
</WithOrganizationTheme>
|
|
106
108
|
)
|
|
107
109
|
|
|
@@ -697,6 +699,7 @@ const TellescopeFormWithContext: typeof TellescopeForm = (props) => {
|
|
|
697
699
|
return (
|
|
698
700
|
<TellescopeFormContainer style={props.style} dontAddContext
|
|
699
701
|
hideBg={props.hideBg || props.form?.customization?.hideBg}
|
|
702
|
+
logoHeight={props.logoHeight}
|
|
700
703
|
backgroundColor={props.backgroundColor}
|
|
701
704
|
hideLogo={props?.customization?.hideLogo}
|
|
702
705
|
>
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -653,9 +653,7 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
|
|
|
653
653
|
? (
|
|
654
654
|
(f.options?.default && !isNaN(parseInt(f.options.default)))
|
|
655
655
|
? parseInt(f.options.default)
|
|
656
|
-
:
|
|
657
|
-
? undefined
|
|
658
|
-
: (f.options?.from || 1)
|
|
656
|
+
: undefined // shows no selection on slider
|
|
659
657
|
)
|
|
660
658
|
: f.type === 'Related Contacts'
|
|
661
659
|
? (f.isOptional ? [] : [{ relationships: f?.options?.relatedContactTypes?.length === 1 ? [{ type: f.options.relatedContactTypes[0] as EnduserRelationship['type'], id: ''! } ] : [] }])
|
package/src/inputs_shared.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import { AgentRecord, AllergyCode, AppointmentBookingPage, AppointmentLocation,
|
|
|
9
9
|
import { Button, Checkbox, Flex, HoverPaper, LoadingButton, LoadingData, ScrollingList, SearchTextInput, Typography, useAgentRecords, useAllergyCodes, useAppointmentBookingPages, useAppointmentLocations, useAutomationTriggers, useCalendarEventTemplates, useCallHoldQueues, useChatRooms, useDatabaseRecords, useDatabases, useDiagnosisCodes, useEnduserCustomTypes, useEnduserOrders, useEndusers, useFaxLogs, useFiles, useFormGroups, useForms, useForums, useJourneys, useManagedContentRecords, useMessageTemplateSnippets, useNotifications, useOrganization, useOrganizations, usePrescriptionRoutes, useResolvedSession, useSession, useSuggestedContacts, useTemplates, useTicketQueues, useTickets, useUsers, useWaitlists, value_is_loaded } from "."
|
|
10
10
|
import { SxProps } from "@mui/material"
|
|
11
11
|
import { AccessPermissions, ListOfStringsWithQualifier } from "@tellescope/types-models"
|
|
12
|
+
import { phoneValidator } from "@tellescope/validation"
|
|
12
13
|
|
|
13
14
|
export type FilterV2 = Record<string, any>
|
|
14
15
|
export type FiltersV2 = Record<string, FilterV2>
|
|
@@ -885,7 +886,22 @@ export const EnduserSearch = (props: Omit<GenericSearchProps<Enduser>, 'filterKe
|
|
|
885
886
|
if (((session.userInfo as any)?.access as AccessPermissions)?.users?.read === ALL_ACCESS && !value_is_loaded(usersLoading)) return null
|
|
886
887
|
return (
|
|
887
888
|
<ModelSearchInput filterKey="endusers" {...props}
|
|
888
|
-
searchAPI={
|
|
889
|
+
searchAPI={async ({ search }) => {
|
|
890
|
+
// handle case of formatted phone number in search bar by parsing to standard phone format and searching explicitly by phone
|
|
891
|
+
// in this case, also search by generic search term in case user is intending to search by something else (e.g. externalId)
|
|
892
|
+
try {
|
|
893
|
+
const phone = phoneValidator.validate()(search.query)
|
|
894
|
+
if (phone) {
|
|
895
|
+
return (
|
|
896
|
+
await Promise.all([
|
|
897
|
+
session.api.endusers.getSome({ filter: { phone }}),
|
|
898
|
+
session.api.endusers.getSome({ search }),
|
|
899
|
+
])
|
|
900
|
+
).flatMap(v => v)
|
|
901
|
+
}
|
|
902
|
+
} catch(err) {}
|
|
903
|
+
return session.api.endusers.getSome({ search })
|
|
904
|
+
}}
|
|
889
905
|
onLoad={addLocalElements}
|
|
890
906
|
attachSearchableFields={t => {
|
|
891
907
|
const users = t.assignedTo?.map(userId => findUser(userId, { batch: true })).filter(u => u) as User[]
|
package/src/state.tsx
CHANGED
|
@@ -99,6 +99,7 @@ import {
|
|
|
99
99
|
EnduserEligibilityResult,
|
|
100
100
|
AgentRecord,
|
|
101
101
|
Waitlist,
|
|
102
|
+
AIConversation,
|
|
102
103
|
} from "@tellescope/types-client"
|
|
103
104
|
|
|
104
105
|
import {
|
|
@@ -366,6 +367,7 @@ const integrationLogsSlice = createSliceForList<IntegrationLog, 'integration_log
|
|
|
366
367
|
const enduserEligibilityResultsSlice = createSliceForList<EnduserEligibilityResult, 'enduser_eligibility_results'>('enduser_eligibility_results')
|
|
367
368
|
const agentRecordsSlice = createSliceForList<AgentRecord, 'agent_records'>('agent_records')
|
|
368
369
|
const waitlistsSlice = createSliceForList<Waitlist, 'waitlists'>('waitlists')
|
|
370
|
+
const aiConversationsSlice = createSliceForList<AIConversation, 'ai_conversations'>('ai_conversations')
|
|
369
371
|
|
|
370
372
|
const roleBasedAccessPermissionsSlice = createSliceForList<RoleBasedAccessPermission, 'role_based_access_permissions'>('role_based_access_permissions')
|
|
371
373
|
|
|
@@ -374,6 +376,7 @@ const userLogsSlice = createSliceForList<UserLog, 'user_logs'>('user_logs')
|
|
|
374
376
|
|
|
375
377
|
export const sharedConfig = {
|
|
376
378
|
reducer: {
|
|
379
|
+
ai_conversations: aiConversationsSlice.reducer,
|
|
377
380
|
agent_records: agentRecordsSlice.reducer,
|
|
378
381
|
enduser_eligibility_results: enduserEligibilityResultsSlice.reducer,
|
|
379
382
|
integration_logs: integrationLogsSlice.reducer,
|
|
@@ -1312,6 +1315,25 @@ export const useEnduserEligibilityResults = (options={} as HookOptions<EnduserEl
|
|
|
1312
1315
|
)
|
|
1313
1316
|
}
|
|
1314
1317
|
|
|
1318
|
+
export const useAIConversations = (options={} as HookOptions<AIConversation>) => {
|
|
1319
|
+
const session = useSession()
|
|
1320
|
+
|
|
1321
|
+
return useListStateHook('ai_conversations', useTypedSelector(s => s.ai_conversations), session, aiConversationsSlice,
|
|
1322
|
+
{
|
|
1323
|
+
loadQuery: session.api.ai_conversations.getSome,
|
|
1324
|
+
findOne: session.api.ai_conversations.getOne,
|
|
1325
|
+
findByIds: session.api.ai_conversations.getByIds,
|
|
1326
|
+
addOne: session.api.ai_conversations.createOne,
|
|
1327
|
+
addSome: session.api.ai_conversations.createSome,
|
|
1328
|
+
deleteOne: session.api.ai_conversations.deleteOne,
|
|
1329
|
+
updateOne: session.api.ai_conversations.updateOne,
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
...options,
|
|
1333
|
+
},
|
|
1334
|
+
)
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1315
1337
|
export const useAgentRecords = (options={} as HookOptions<AgentRecord>) => {
|
|
1316
1338
|
const session = useSession()
|
|
1317
1339
|
|