@lowdefy/blocks-native 0.0.0-stage → 7.2.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/LICENSE +201 -0
- package/README.md +9 -2
- package/dist/actions/AddCalendarEvent/AddCalendarEvent.js +31 -0
- package/dist/actions/AddCalendarEvent/schema.js +55 -0
- package/dist/actions/AddContact/AddContact.js +24 -0
- package/dist/actions/AddContact/schema.js +49 -0
- package/dist/actions/CancelNotification/CancelNotification.js +23 -0
- package/dist/actions/CancelNotification/schema.js +31 -0
- package/dist/actions/DiscardQueuedRequest/DiscardQueuedRequest.js +23 -0
- package/dist/actions/DiscardQueuedRequest/schema.js +31 -0
- package/dist/actions/GetCalendarEvents/GetCalendarEvents.js +32 -0
- package/dist/actions/GetCalendarEvents/schema.js +35 -0
- package/dist/actions/GetRequestQueue/GetRequestQueue.js +24 -0
- package/dist/actions/GetRequestQueue/schema.js +22 -0
- package/dist/actions/Haptic/Haptic.js +38 -0
- package/dist/actions/Haptic/schema.js +37 -0
- package/dist/actions/KeepAwake/KeepAwake.js +23 -0
- package/dist/actions/KeepAwake/schema.js +28 -0
- package/dist/actions/PickContact/PickContact.js +24 -0
- package/dist/actions/PickContact/schema.js +22 -0
- package/dist/actions/PickFile/PickFile.js +32 -0
- package/dist/actions/PickFile/schema.js +58 -0
- package/dist/actions/PickImage/PickImage.js +32 -0
- package/dist/actions/PickImage/schema.js +76 -0
- package/dist/actions/ReadNfc/ReadNfc.js +24 -0
- package/dist/actions/ReadNfc/schema.js +27 -0
- package/dist/actions/RefreshWidgets/RefreshWidgets.js +24 -0
- package/dist/actions/RefreshWidgets/schema.js +22 -0
- package/dist/actions/RequestNotificationPermission/RequestNotificationPermission.js +24 -0
- package/dist/actions/RequestNotificationPermission/schema.js +22 -0
- package/dist/actions/RetryRequestQueue/RetryRequestQueue.js +24 -0
- package/dist/actions/RetryRequestQueue/schema.js +27 -0
- package/dist/actions/ScanCode/ScanCode.js +24 -0
- package/dist/actions/ScanCode/schema.js +54 -0
- package/dist/actions/ScanDocument/ScanDocument.js +32 -0
- package/dist/actions/ScanDocument/schema.js +57 -0
- package/dist/actions/ScheduleNotification/ScheduleNotification.js +27 -0
- package/dist/actions/ScheduleNotification/schema.js +67 -0
- package/dist/actions/SetBadgeCount/SetBadgeCount.js +27 -0
- package/dist/actions/SetBadgeCount/schema.js +31 -0
- package/dist/actions/SetBrightness/SetBrightness.js +24 -0
- package/dist/actions/SetBrightness/schema.js +33 -0
- package/dist/actions/Share/Share.js +50 -0
- package/dist/actions/Share/schema.js +51 -0
- package/dist/actions/Speak/Speak.js +27 -0
- package/dist/actions/Speak/schema.js +44 -0
- package/dist/actions/StartGeofencing/StartGeofencing.js +29 -0
- package/dist/actions/StartGeofencing/schema.js +63 -0
- package/dist/actions/StartLocationTracking/StartLocationTracking.js +29 -0
- package/dist/actions/StartLocationTracking/schema.js +59 -0
- package/dist/actions/StartRecording/StartRecording.js +23 -0
- package/dist/actions/StartRecording/schema.js +32 -0
- package/dist/actions/StopGeofencing/StopGeofencing.js +23 -0
- package/dist/actions/StopGeofencing/schema.js +22 -0
- package/dist/actions/StopLocationTracking/StopLocationTracking.js +23 -0
- package/dist/actions/StopLocationTracking/schema.js +22 -0
- package/dist/actions/StopRecording/StopRecording.js +37 -0
- package/dist/actions/StopRecording/schema.js +46 -0
- package/dist/actions/StopSpeaking/StopSpeaking.js +23 -0
- package/dist/actions/StopSpeaking/schema.js +22 -0
- package/dist/actions/TakePhoto/TakePhoto.js +31 -0
- package/dist/actions/TakePhoto/schema.js +67 -0
- package/dist/actions/WriteNfc/WriteNfc.js +28 -0
- package/dist/actions/WriteNfc/schema.js +61 -0
- package/dist/actions/uploadFiles.js +51 -0
- package/dist/actions.js +47 -0
- package/dist/blocks/ActivityTimeline/ActivityTimeline.js +507 -0
- package/dist/blocks/ActivityTimeline/CommentBody.js +176 -0
- package/dist/blocks/ActivityTimeline/CommentItem.js +302 -0
- package/dist/blocks/ActivityTimeline/EditBox.js +143 -0
- package/dist/blocks/ActivityTimeline/LineText.js +71 -0
- package/dist/blocks/ActivityTimeline/RailIcon.js +41 -0
- package/dist/blocks/ActivityTimeline/RailRow.js +74 -0
- package/dist/blocks/ActivityTimeline/ReactionPicker.js +68 -0
- package/dist/blocks/ActivityTimeline/ReactionPills.js +112 -0
- package/dist/blocks/ActivityTimeline/ThreadCard.js +160 -0
- package/dist/blocks/ActivityTimeline/TimelineMarkdownRenderer.js +48 -0
- package/dist/blocks/ActivityTimeline/buildTimelineRows.js +194 -0
- package/dist/blocks/ActivityTimeline/describeEvent.js +61 -0
- package/dist/blocks/ActivityTimeline/describeGap.js +71 -0
- package/dist/blocks/ActivityTimeline/fillTemplate.js +84 -0
- package/dist/blocks/ActivityTimeline/fillText.js +38 -0
- package/dist/blocks/ActivityTimeline/formatRelativeTime.js +68 -0
- package/dist/blocks/ActivityTimeline/getActor.js +41 -0
- package/dist/blocks/ActivityTimeline/getCommentMenuActions.js +85 -0
- package/dist/blocks/ActivityTimeline/getCommentView.js +72 -0
- package/dist/blocks/ActivityTimeline/getTimelineColors.js +71 -0
- package/dist/blocks/ActivityTimeline/getToneColor.js +49 -0
- package/dist/blocks/ActivityTimeline/getVisibleReplies.js +36 -0
- package/dist/blocks/ActivityTimeline/isThreadShown.js +28 -0
- package/dist/blocks/ActivityTimeline/joinList.js +21 -0
- package/dist/blocks/ActivityTimeline/meta.js +320 -0
- package/dist/blocks/ActivityTimeline/parseTimelineHref.js +43 -0
- package/dist/blocks/ActivityTimeline/selectEventRule.js +69 -0
- package/dist/blocks/ActivityTimeline/summariseEvents.js +51 -0
- package/dist/blocks/ActivityTimeline/toPlainText.js +32 -0
- package/dist/blocks/ActivityTimeline/toTime.js +36 -0
- package/dist/blocks/ActivityTimeline/toTimelineMarkdown.js +57 -0
- package/dist/blocks/ActivityTimeline/toggleReaction.js +74 -0
- package/dist/blocks/ActivityTimeline/useNow.js +24 -0
- package/dist/blocks/AgentChat/AgentChat.js +726 -0
- package/dist/blocks/AgentChat/AssistantMessage.js +243 -0
- package/dist/blocks/AgentChat/ChatComposer.js +401 -0
- package/dist/blocks/AgentChat/ChatError.js +129 -0
- package/dist/blocks/AgentChat/ChatSkeleton.js +97 -0
- package/dist/blocks/AgentChat/ReasoningDisclosure.js +125 -0
- package/dist/blocks/AgentChat/ThinkingIndicator.js +103 -0
- package/dist/blocks/AgentChat/ThreadsSheet.js +347 -0
- package/dist/blocks/AgentChat/ToolApprovalCard.js +190 -0
- package/dist/blocks/AgentChat/ToolCallRow.js +187 -0
- package/dist/blocks/AgentChat/ToolDetail.js +137 -0
- package/dist/blocks/AgentChat/UserMessage.js +84 -0
- package/dist/blocks/AgentChat/WelcomeView.js +100 -0
- package/dist/blocks/AgentChat/createAgentTransport.js +74 -0
- package/dist/blocks/AgentChat/describeToolPart.js +133 -0
- package/dist/blocks/AgentChat/getChatSeed.js +44 -0
- package/dist/blocks/AgentChat/getFirstExchange.js +43 -0
- package/dist/blocks/AgentChat/getMessageSegments.js +73 -0
- package/dist/blocks/AgentChat/getMessageText.js +25 -0
- package/dist/blocks/AgentChat/getPageStateUpdates.js +47 -0
- package/dist/blocks/AgentChat/getProvisionalTitle.js +32 -0
- package/dist/blocks/AgentChat/getReadableRows.js +157 -0
- package/dist/blocks/AgentChat/getThreadEndpoints.js +54 -0
- package/dist/blocks/AgentChat/getToolIcon.js +110 -0
- package/dist/blocks/AgentChat/humanizeToolName.js +30 -0
- package/dist/blocks/AgentChat/messageParts.js +86 -0
- package/dist/blocks/AgentChat/meta.js +530 -0
- package/dist/blocks/AgentChat/mintConversationId.js +29 -0
- package/dist/blocks/AgentChat/replayableMessages.js +62 -0
- package/dist/blocks/AgentChat/showMessageMenu.js +49 -0
- package/dist/blocks/AgentChat/summarizeToolInput.js +36 -0
- package/dist/blocks/AgentChat/summarizeToolOutput.js +49 -0
- package/dist/blocks/AgentChat/useAgentEvents.js +218 -0
- package/dist/blocks/AgentChat/useChatDictation.js +151 -0
- package/dist/blocks/AgentChat/useChatThreads.js +450 -0
- package/dist/blocks/AgentChat/useFollowScroll.js +80 -0
- package/dist/blocks/AgentChat/useThinkingMessage.js +77 -0
- package/dist/blocks/Alert/Alert.js +167 -0
- package/dist/blocks/Alert/meta.js +200 -0
- package/dist/blocks/Avatar/Avatar.js +51 -0
- package/dist/blocks/Avatar/AvatarCircle.js +114 -0
- package/dist/blocks/Avatar/AvatarPhoto.js +68 -0
- package/dist/blocks/Avatar/AvatarStack.js +89 -0
- package/dist/blocks/Avatar/getAvatarColor.js +84 -0
- package/dist/blocks/Avatar/getAvatarImage.js +97 -0
- package/dist/blocks/Avatar/getInitials.js +51 -0
- package/dist/blocks/Avatar/meta.js +57 -0
- package/dist/blocks/Box/Box.js +118 -0
- package/dist/blocks/Box/getRubberBand.js +29 -0
- package/dist/blocks/Box/getSwipeDirection.js +45 -0
- package/dist/blocks/Box/isSwipeGesture.js +41 -0
- package/dist/blocks/Box/meta.js +46 -0
- package/dist/blocks/Box/useSwipeGesture.js +113 -0
- package/dist/blocks/Button/Button.js +136 -0
- package/dist/blocks/Button/getButtonColors.js +216 -0
- package/dist/blocks/Button/meta.js +137 -0
- package/dist/blocks/Card/Card.js +185 -0
- package/dist/blocks/Card/meta.js +203 -0
- package/dist/blocks/ChipSelector/Chip.js +178 -0
- package/dist/blocks/ChipSelector/ChipSelector.js +313 -0
- package/dist/blocks/ChipSelector/EdgeFade.js +68 -0
- package/dist/blocks/ChipSelector/getChipColors.js +88 -0
- package/dist/blocks/ChipSelector/getFadeRanges.js +55 -0
- package/dist/blocks/ChipSelector/getOverscrollSwipe.js +44 -0
- package/dist/blocks/ChipSelector/getScrollTarget.js +41 -0
- package/dist/blocks/ChipSelector/meta.js +156 -0
- package/dist/blocks/Composer/Composer.js +511 -0
- package/dist/blocks/Composer/MentionTextInput.js +91 -0
- package/dist/blocks/Composer/SuggestionList.js +165 -0
- package/dist/blocks/Composer/applyDisplayEdit.js +81 -0
- package/dist/blocks/Composer/convertSpokenMentions.js +234 -0
- package/dist/blocks/Composer/createMentionPattern.js +40 -0
- package/dist/blocks/Composer/findTrigger.js +51 -0
- package/dist/blocks/Composer/getSendState.js +38 -0
- package/dist/blocks/Composer/getSpokenMentionWords.js +35 -0
- package/dist/blocks/Composer/indexSpokenNames.js +50 -0
- package/dist/blocks/Composer/insertLink.js +36 -0
- package/dist/blocks/Composer/insertMention.js +43 -0
- package/dist/blocks/Composer/matchSpokenName.js +88 -0
- package/dist/blocks/Composer/meta.js +212 -0
- package/dist/blocks/Composer/parseMentionValue.js +55 -0
- package/dist/blocks/Composer/placeDictation.js +51 -0
- package/dist/blocks/Composer/rankMentions.js +51 -0
- package/dist/blocks/Composer/replaceRange.js +48 -0
- package/dist/blocks/Composer/segmentText.js +78 -0
- package/dist/blocks/Composer/shiftOffset.js +37 -0
- package/dist/blocks/Composer/snapSelection.js +37 -0
- package/dist/blocks/Composer/useMentionEditor.js +381 -0
- package/dist/blocks/Composer/withPartial.js +50 -0
- package/dist/blocks/DateSelector/DateSelector.js +250 -0
- package/dist/blocks/DateSelector/formatDateValue.js +34 -0
- package/dist/blocks/DateSelector/getDateMenuActions.js +96 -0
- package/dist/blocks/DateSelector/meta.js +109 -0
- package/dist/blocks/DateSelector/toBoundDate.js +40 -0
- package/dist/blocks/DateSelector/toPickerDate.js +31 -0
- package/dist/blocks/DateSelector/toUtcDay.js +25 -0
- package/dist/blocks/Divider/Divider.js +159 -0
- package/dist/blocks/Divider/meta.js +108 -0
- package/dist/blocks/Empty/Empty.js +107 -0
- package/dist/blocks/Empty/meta.js +61 -0
- package/dist/blocks/FileInput/FileInput.js +253 -0
- package/dist/blocks/FileInput/formatFileSize.js +28 -0
- package/dist/blocks/FileInput/getFileSources.js +48 -0
- package/dist/blocks/FileInput/meta.js +123 -0
- package/dist/blocks/Icon/Icon.js +41 -0
- package/dist/blocks/Icon/meta.js +80 -0
- package/dist/blocks/Illustration/Illustration.js +154 -0
- package/dist/blocks/Illustration/IllustrationLayer.js +105 -0
- package/dist/blocks/Illustration/colorNodes.js +72 -0
- package/dist/blocks/Illustration/createIllustrationMotion.js +172 -0
- package/dist/blocks/Illustration/getIllustrationBox.js +54 -0
- package/dist/blocks/Illustration/getIllustrationColors.js +48 -0
- package/dist/blocks/Illustration/getKeyframeRange.js +99 -0
- package/dist/blocks/Illustration/getLayerBounds.js +74 -0
- package/dist/blocks/Illustration/getLayers.js +113 -0
- package/dist/blocks/Illustration/getNodePoints.js +210 -0
- package/dist/blocks/Illustration/meta.js +196 -0
- package/dist/blocks/Illustration/parseIllustration.js +84 -0
- package/dist/blocks/Illustration/toBoundingBoxGradients.js +188 -0
- package/dist/blocks/Illustration/useIllustrationMotion.js +75 -0
- package/dist/blocks/Label/Label.js +111 -0
- package/dist/blocks/Label/getLabelProperties.js +38 -0
- package/dist/blocks/Label/getLabelState.js +59 -0
- package/dist/blocks/List/List.js +159 -0
- package/dist/blocks/List/ListRow.js +74 -0
- package/dist/blocks/List/ListRowContext.js +20 -0
- package/dist/blocks/List/SectionHeader.js +119 -0
- package/dist/blocks/List/getSections.js +161 -0
- package/dist/blocks/List/meta.js +190 -0
- package/dist/blocks/ListItem/ListItem.js +440 -0
- package/dist/blocks/ListItem/ListItemContextMenu.js +58 -0
- package/dist/blocks/ListItem/getListItemParts.js +101 -0
- package/dist/blocks/ListItem/getSfSymbol.js +33 -0
- package/dist/blocks/ListItem/meta.js +284 -0
- package/dist/blocks/Map/Map.js +78 -0
- package/dist/blocks/Map/meta.js +153 -0
- package/dist/blocks/Markdown/ChipWidthContext.js +20 -0
- package/dist/blocks/Markdown/ChipWidthView.js +40 -0
- package/dist/blocks/Markdown/LinkChip.js +151 -0
- package/dist/blocks/Markdown/Markdown.js +70 -0
- package/dist/blocks/Markdown/MarkdownCode.js +67 -0
- package/dist/blocks/Markdown/MarkdownContent.js +119 -0
- package/dist/blocks/Markdown/MarkdownImage.js +77 -0
- package/dist/blocks/Markdown/MarkdownList.js +97 -0
- package/dist/blocks/Markdown/MarkdownListContext.js +22 -0
- package/dist/blocks/Markdown/MarkdownRenderer.js +231 -0
- package/dist/blocks/Markdown/MarkdownTable.js +96 -0
- package/dist/blocks/Markdown/MarkdownTokenizer.js +43 -0
- package/dist/blocks/Markdown/TaskBox.js +58 -0
- package/dist/blocks/Markdown/TaskMark.js +37 -0
- package/dist/blocks/Markdown/getChipMaxWidth.js +33 -0
- package/dist/blocks/Markdown/getLinkChip.js +95 -0
- package/dist/blocks/Markdown/getLinkChipColors.js +51 -0
- package/dist/blocks/Markdown/getListMarker.js +116 -0
- package/dist/blocks/Markdown/getMarkdownStyles.js +206 -0
- package/dist/blocks/Markdown/getNodeText.js +37 -0
- package/dist/blocks/Markdown/layoutLinkChips.js +209 -0
- package/dist/blocks/Markdown/matchLinkChip.js +82 -0
- package/dist/blocks/Markdown/meta.js +56 -0
- package/dist/blocks/Markdown/restyleText.js +40 -0
- package/dist/blocks/Markdown/trimOuterSpace.js +42 -0
- package/dist/blocks/Menu/Menu.js +96 -0
- package/dist/blocks/Menu/getMenuActions.js +66 -0
- package/dist/blocks/Menu/meta.js +159 -0
- package/dist/blocks/MultipleSelector/MultipleSelector.js +290 -0
- package/dist/blocks/MultipleSelector/MultipleSelectorRow.js +71 -0
- package/dist/blocks/MultipleSelector/ValueSummary.js +130 -0
- package/dist/blocks/MultipleSelector/getOptionIndices.js +30 -0
- package/dist/blocks/MultipleSelector/getSessionOptions.js +38 -0
- package/dist/blocks/MultipleSelector/getSummaryCount.js +35 -0
- package/dist/blocks/MultipleSelector/meta.js +284 -0
- package/dist/blocks/MultipleSelector/toggleValue.js +50 -0
- package/dist/blocks/NumberInput/NumberInput.js +251 -0
- package/dist/blocks/NumberInput/StepButton.js +46 -0
- package/dist/blocks/NumberInput/formatNumber.js +35 -0
- package/dist/blocks/NumberInput/getNumberKeyboardType.js +32 -0
- package/dist/blocks/NumberInput/meta.js +123 -0
- package/dist/blocks/NumberInput/normalizeNumber.js +38 -0
- package/dist/blocks/NumberInput/parseNumberText.js +46 -0
- package/dist/blocks/PageDots/PageDots.js +131 -0
- package/dist/blocks/PageDots/meta.js +48 -0
- package/dist/blocks/Paragraph/Paragraph.js +52 -0
- package/dist/blocks/Paragraph/meta.js +295 -0
- package/dist/blocks/QRScanner/QRScanner.js +94 -0
- package/dist/blocks/QRScanner/createScanFilter.js +44 -0
- package/dist/blocks/QRScanner/meta.js +80 -0
- package/dist/blocks/Screen/meta.js +197 -0
- package/dist/blocks/SegmentedControl/SegmentedControl.js +77 -0
- package/dist/blocks/SegmentedControl/meta.js +78 -0
- package/dist/blocks/Selector/NoValueAvatar.js +42 -0
- package/dist/blocks/Selector/PickerOptionRow.js +130 -0
- package/dist/blocks/Selector/PickerRowLeading.js +57 -0
- package/dist/blocks/Selector/PickerSearchField.js +85 -0
- package/dist/blocks/Selector/PickerSheet.js +239 -0
- package/dist/blocks/Selector/Selector.js +122 -0
- package/dist/blocks/Selector/SelectorMenu.js +97 -0
- package/dist/blocks/Selector/SelectorRow.js +86 -0
- package/dist/blocks/Selector/SelectorSheet.js +131 -0
- package/dist/blocks/Selector/getOptionIndex.js +39 -0
- package/dist/blocks/Selector/getOptionLabel.js +32 -0
- package/dist/blocks/Selector/getOptionValue.js +20 -0
- package/dist/blocks/Selector/getPickerSheetDetents.js +45 -0
- package/dist/blocks/Selector/getPickerSheetRows.js +174 -0
- package/dist/blocks/Selector/getPickerSheetScrollIndex.js +35 -0
- package/dist/blocks/Selector/getSelectorMenuActions.js +61 -0
- package/dist/blocks/Selector/meta.js +195 -0
- package/dist/blocks/Selector/normalizeSearchText.js +27 -0
- package/dist/blocks/Selector/setSelectorValue.js +54 -0
- package/dist/blocks/Sheet/Sheet.js +174 -0
- package/dist/blocks/Sheet/getSheetDetents.js +56 -0
- package/dist/blocks/Sheet/meta.js +72 -0
- package/dist/blocks/SignaturePad/SignaturePad.js +182 -0
- package/dist/blocks/SignaturePad/meta.js +74 -0
- package/dist/blocks/SignaturePad/toSignatureValue.js +52 -0
- package/dist/blocks/Skeleton/Skeleton.js +131 -0
- package/dist/blocks/Skeleton/SkeletonCard.js +42 -0
- package/dist/blocks/Skeleton/SkeletonHero.js +72 -0
- package/dist/blocks/Skeleton/SkeletonInsetGroup.js +82 -0
- package/dist/blocks/Skeleton/SkeletonListRow.js +90 -0
- package/dist/blocks/Skeleton/SkeletonParagraph.js +36 -0
- package/dist/blocks/Skeleton/SkeletonRows.js +58 -0
- package/dist/blocks/Skeleton/SkeletonTimeline.js +88 -0
- package/dist/blocks/Skeleton/getBarWidth.js +45 -0
- package/dist/blocks/Skeleton/getParagraphWidths.js +56 -0
- package/dist/blocks/Skeleton/getSectionCounts.js +33 -0
- package/dist/blocks/Skeleton/getSkeletonVariant.js +27 -0
- package/dist/blocks/Skeleton/meta.js +98 -0
- package/dist/blocks/Spinner/Spinner.js +68 -0
- package/dist/blocks/Spinner/meta.js +35 -0
- package/dist/blocks/StatusIcon/StatusGlyph.js +247 -0
- package/dist/blocks/StatusIcon/StatusIcon.js +34 -0
- package/dist/blocks/StatusIcon/StatusMark.js +87 -0
- package/dist/blocks/StatusIcon/getPiePath.js +41 -0
- package/dist/blocks/StatusIcon/getStatusColor.js +61 -0
- package/dist/blocks/StatusIcon/meta.js +38 -0
- package/dist/blocks/StatusIcon/statusLabels.js +33 -0
- package/dist/blocks/Switch/Switch.js +85 -0
- package/dist/blocks/Switch/meta.js +78 -0
- package/dist/blocks/Tabs/Tabs.js +269 -0
- package/dist/blocks/Tabs/meta.js +305 -0
- package/dist/blocks/Tag/TONE_PALETTES.js +34 -0
- package/dist/blocks/Tag/Tag.js +173 -0
- package/dist/blocks/Tag/getTagColors.js +120 -0
- package/dist/blocks/Tag/getTagDotColor.js +32 -0
- package/dist/blocks/Tag/meta.js +131 -0
- package/dist/blocks/TextArea/ComposerSendButton.js +69 -0
- package/dist/blocks/TextArea/TextArea.js +167 -0
- package/dist/blocks/TextArea/meta.js +96 -0
- package/dist/blocks/TextInput/TextInput.js +253 -0
- package/dist/blocks/TextInput/applyReplaceInput.js +30 -0
- package/dist/blocks/TextInput/getKeyboardProps.js +64 -0
- package/dist/blocks/TextInput/getSearchBoxStyle.js +39 -0
- package/dist/blocks/TextInput/meta.js +113 -0
- package/dist/blocks/Title/Title.js +62 -0
- package/dist/blocks/Title/meta.js +355 -0
- package/dist/blocks.js +52 -0
- package/dist/device/getDeviceFeature.js +81 -0
- package/dist/device/playFeedback.js +32 -0
- package/dist/device.js +18 -0
- package/dist/dictation.js +17 -0
- package/dist/htmlToText.js +32 -0
- package/dist/metas.js +53 -0
- package/dist/schemas/avatar.js +40 -0
- package/dist/schemas/icon.js +65 -0
- package/dist/schemas/inputLabel.js +96 -0
- package/dist/schemas/inputProperties.js +92 -0
- package/dist/schemas/linkChips.js +85 -0
- package/dist/schemas/status.js +75 -0
- package/dist/schemas/textStyle.js +33 -0
- package/dist/schemas/tone.js +28 -0
- package/dist/schemas.js +47 -0
- package/dist/shared/ClearButton.js +53 -0
- package/dist/shared/CountText.js +38 -0
- package/dist/shared/MissingFeature.js +43 -0
- package/dist/shared/NativeMenu.js +69 -0
- package/dist/shared/OptionGlyph.js +59 -0
- package/dist/shared/PropertyRow.js +89 -0
- package/dist/shared/SheetCloseButton.js +51 -0
- package/dist/shared/SheetDoneButton.js +44 -0
- package/dist/shared/SwipeContext.js +20 -0
- package/dist/shared/SwipeableRow.js +294 -0
- package/dist/shared/SystemIcon.js +72 -0
- package/dist/shared/dictation/DictationButton.js +77 -0
- package/dist/shared/dictation/DictationWarning.js +89 -0
- package/dist/shared/dictation/LevelMeter.js +57 -0
- package/dist/shared/dictation/ListeningRow.js +100 -0
- package/dist/shared/dictation/PartialSpans.js +50 -0
- package/dist/shared/dictation/checkDictationAvailable.js +65 -0
- package/dist/shared/dictation/claimMic.js +68 -0
- package/dist/shared/dictation/createQueuedRecognizer.js +213 -0
- package/dist/shared/dictation/getDictationLevel.js +30 -0
- package/dist/shared/dictation/getDictationWarning.js +40 -0
- package/dist/shared/dictation/getLevelBars.js +38 -0
- package/dist/shared/dictation/getRecognizer.js +46 -0
- package/dist/shared/dictation/getStartOptions.js +42 -0
- package/dist/shared/dictation/insertAtSelection.js +48 -0
- package/dist/shared/dictation/pickRecognitionLocale.js +37 -0
- package/dist/shared/dictation/useDictation.js +299 -0
- package/dist/shared/getControlSize.js +50 -0
- package/dist/shared/getInputBoxStyle.js +93 -0
- package/dist/shared/getPropertyRowTextStyles.js +40 -0
- package/dist/shared/getSemanticColors.js +96 -0
- package/dist/shared/getToneColor.js +51 -0
- package/dist/shared/iosTextStyles.js +49 -0
- package/dist/shared/useBlockTokens.js +41 -0
- package/dist/skeleton/SkeletonFrameContext.js +21 -0
- package/dist/skeleton/SkeletonLine.js +46 -0
- package/dist/skeleton/SkeletonShape.js +140 -0
- package/dist/skeleton/createShimmerClock.js +57 -0
- package/dist/skeleton/shimmerClock.js +20 -0
- package/dist/skeleton/skeletonText.js +44 -0
- package/dist/skeleton/useShimmer.js +34 -0
- package/dist/types.js +23 -0
- package/dist/typography/TITLE_LEVEL_STYLES.js +24 -0
- package/dist/typography/TypographyText.js +78 -0
- package/dist/typography/getIosTextStyle.js +33 -0
- package/dist/typography/getTextStyle.js +94 -0
- package/dist/useComponentTokens.js +38 -0
- package/package.json +94 -3
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { useState } from 'react';
|
|
16
|
+
import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
17
|
+
import { type } from '@lowdefy/helpers';
|
|
18
|
+
import SystemIcon from '../../shared/SystemIcon.js';
|
|
19
|
+
import ToolDetail from './ToolDetail.js';
|
|
20
|
+
const TILE = 28;
|
|
21
|
+
function StatusGlyph({ colors, components, expanded, status, hasDetail }) {
|
|
22
|
+
if (status === 'running' || status === 'approval') {
|
|
23
|
+
return /*#__PURE__*/ React.createElement(ActivityIndicator, {
|
|
24
|
+
color: colors.secondary,
|
|
25
|
+
size: "small"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (status === 'error') {
|
|
29
|
+
return /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
30
|
+
color: colors.danger,
|
|
31
|
+
components: components,
|
|
32
|
+
fallback: "CircleAlert",
|
|
33
|
+
size: 16,
|
|
34
|
+
symbol: "exclamationmark.circle.fill"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (status === 'denied') {
|
|
38
|
+
return /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
39
|
+
color: colors.tertiary,
|
|
40
|
+
components: components,
|
|
41
|
+
fallback: "CircleX",
|
|
42
|
+
size: 16,
|
|
43
|
+
symbol: "xmark.circle.fill"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (!hasDetail) {
|
|
47
|
+
return /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
48
|
+
color: colors.success,
|
|
49
|
+
components: components,
|
|
50
|
+
fallback: "CircleCheck",
|
|
51
|
+
size: 16,
|
|
52
|
+
symbol: "checkmark.circle.fill"
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
56
|
+
color: colors.tertiary,
|
|
57
|
+
components: components,
|
|
58
|
+
fallback: expanded ? 'ChevronUp' : 'ChevronDown',
|
|
59
|
+
size: 12,
|
|
60
|
+
symbol: expanded ? 'chevron.up' : 'chevron.down'
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One tool call, as a compact row: the tool's glyph on a tile, its readable name, a one-line
|
|
65
|
+
* summary, and its status at the end (a spinner while it runs, a check when it finished with
|
|
66
|
+
* nothing to show, a chevron when it can open). Pressing a finished call opens its output.
|
|
67
|
+
*
|
|
68
|
+
* @param {Object} props
|
|
69
|
+
* @param {Object} props.colors
|
|
70
|
+
* @param {Object} props.components
|
|
71
|
+
* @param {Object} props.description describeToolPart.
|
|
72
|
+
* @param {Object[]} [props.linkChips]
|
|
73
|
+
* @param {(href: string) => void} props.onLinkPress
|
|
74
|
+
* @param {string} props.testID
|
|
75
|
+
*/ function ToolCallRow({ colors, components, description, linkChips, onLinkPress, testID }) {
|
|
76
|
+
const [expanded, setExpanded] = useState(false);
|
|
77
|
+
const hasDetail = !type.isNone(description.detail);
|
|
78
|
+
return /*#__PURE__*/ React.createElement(View, null, /*#__PURE__*/ React.createElement(Pressable, {
|
|
79
|
+
accessibilityHint: description.summary,
|
|
80
|
+
accessibilityLabel: description.title,
|
|
81
|
+
accessibilityRole: hasDetail ? 'button' : undefined,
|
|
82
|
+
accessibilityState: hasDetail ? {
|
|
83
|
+
expanded
|
|
84
|
+
} : undefined,
|
|
85
|
+
disabled: !hasDetail,
|
|
86
|
+
onPress: ()=>setExpanded((open)=>!open),
|
|
87
|
+
style: ({ pressed })=>[
|
|
88
|
+
styles.row,
|
|
89
|
+
pressed ? {
|
|
90
|
+
backgroundColor: colors.pressed
|
|
91
|
+
} : null
|
|
92
|
+
],
|
|
93
|
+
testID: testID
|
|
94
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
95
|
+
style: [
|
|
96
|
+
styles.tile,
|
|
97
|
+
{
|
|
98
|
+
backgroundColor: colors.fill
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}, /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
102
|
+
color: colors.secondary,
|
|
103
|
+
components: components,
|
|
104
|
+
fallback: description.icon.fallback,
|
|
105
|
+
size: 14,
|
|
106
|
+
symbol: description.icon.symbol
|
|
107
|
+
})), /*#__PURE__*/ React.createElement(View, {
|
|
108
|
+
style: styles.text
|
|
109
|
+
}, /*#__PURE__*/ React.createElement(Text, {
|
|
110
|
+
numberOfLines: 1,
|
|
111
|
+
style: [
|
|
112
|
+
styles.title,
|
|
113
|
+
{
|
|
114
|
+
color: colors.label
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}, description.title), /*#__PURE__*/ React.createElement(Text, {
|
|
118
|
+
numberOfLines: 1,
|
|
119
|
+
style: [
|
|
120
|
+
styles.summary,
|
|
121
|
+
{
|
|
122
|
+
color: description.status === 'error' ? colors.danger : colors.secondary
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}, description.summary)), /*#__PURE__*/ React.createElement(StatusGlyph, {
|
|
126
|
+
colors: colors,
|
|
127
|
+
components: components,
|
|
128
|
+
expanded: expanded,
|
|
129
|
+
hasDetail: hasDetail,
|
|
130
|
+
status: description.status
|
|
131
|
+
})), expanded && hasDetail ? /*#__PURE__*/ React.createElement(View, {
|
|
132
|
+
style: [
|
|
133
|
+
styles.detail,
|
|
134
|
+
{
|
|
135
|
+
borderTopColor: colors.separator
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
testID: `${testID}_detail`
|
|
139
|
+
}, /*#__PURE__*/ React.createElement(ToolDetail, {
|
|
140
|
+
colors: colors,
|
|
141
|
+
components: components,
|
|
142
|
+
detail: description.detail,
|
|
143
|
+
linkChips: linkChips,
|
|
144
|
+
onLinkPress: onLinkPress
|
|
145
|
+
})) : null);
|
|
146
|
+
}
|
|
147
|
+
const styles = StyleSheet.create({
|
|
148
|
+
row: {
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
gap: 10,
|
|
152
|
+
minHeight: 48,
|
|
153
|
+
paddingHorizontal: 12,
|
|
154
|
+
paddingVertical: 8
|
|
155
|
+
},
|
|
156
|
+
tile: {
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
borderCurve: 'continuous',
|
|
159
|
+
borderRadius: 7,
|
|
160
|
+
height: TILE,
|
|
161
|
+
justifyContent: 'center',
|
|
162
|
+
width: TILE
|
|
163
|
+
},
|
|
164
|
+
text: {
|
|
165
|
+
flex: 1,
|
|
166
|
+
gap: 1
|
|
167
|
+
},
|
|
168
|
+
title: {
|
|
169
|
+
fontSize: 15,
|
|
170
|
+
fontWeight: '600',
|
|
171
|
+
letterSpacing: -0.24,
|
|
172
|
+
lineHeight: 20
|
|
173
|
+
},
|
|
174
|
+
summary: {
|
|
175
|
+
fontSize: 13,
|
|
176
|
+
letterSpacing: -0.08,
|
|
177
|
+
lineHeight: 18
|
|
178
|
+
},
|
|
179
|
+
detail: {
|
|
180
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
181
|
+
marginLeft: 12 + TILE + 10,
|
|
182
|
+
paddingBottom: 10,
|
|
183
|
+
paddingRight: 12,
|
|
184
|
+
paddingTop: 8
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
export default ToolCallRow;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { Platform, StyleSheet, Text, View } from 'react-native';
|
|
17
|
+
import MarkdownContent from '../Markdown/MarkdownContent.js';
|
|
18
|
+
const monospace = Platform.select({
|
|
19
|
+
ios: 'Menlo',
|
|
20
|
+
default: 'monospace'
|
|
21
|
+
});
|
|
22
|
+
function Rows({ colors, onLinkPress, rows }) {
|
|
23
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
24
|
+
style: styles.rows
|
|
25
|
+
}, rows.map((row, index)=>{
|
|
26
|
+
const indent = {
|
|
27
|
+
paddingLeft: row.depth * 12
|
|
28
|
+
};
|
|
29
|
+
if (row.kind === 'group') {
|
|
30
|
+
return /*#__PURE__*/ React.createElement(Text, {
|
|
31
|
+
key: index,
|
|
32
|
+
style: [
|
|
33
|
+
styles.group,
|
|
34
|
+
indent,
|
|
35
|
+
{
|
|
36
|
+
color: colors.label
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}, row.label);
|
|
40
|
+
}
|
|
41
|
+
if (row.kind === 'more') {
|
|
42
|
+
return /*#__PURE__*/ React.createElement(Text, {
|
|
43
|
+
key: index,
|
|
44
|
+
style: [
|
|
45
|
+
styles.value,
|
|
46
|
+
indent,
|
|
47
|
+
{
|
|
48
|
+
color: colors.tertiary
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}, row.text);
|
|
52
|
+
}
|
|
53
|
+
let color = colors.label;
|
|
54
|
+
if (row.kind === 'empty') color = colors.tertiary;
|
|
55
|
+
if (row.kind === 'link') color = colors.tint;
|
|
56
|
+
return /*#__PURE__*/ React.createElement(Text, {
|
|
57
|
+
key: index,
|
|
58
|
+
selectable: true,
|
|
59
|
+
style: [
|
|
60
|
+
styles.value,
|
|
61
|
+
indent,
|
|
62
|
+
{
|
|
63
|
+
color: colors.secondary
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}, row.label ? /*#__PURE__*/ React.createElement(Text, {
|
|
67
|
+
style: styles.label
|
|
68
|
+
}, `${row.label} `) : null, /*#__PURE__*/ React.createElement(Text, {
|
|
69
|
+
onPress: row.kind === 'link' ? ()=>onLinkPress(row.text) : undefined,
|
|
70
|
+
style: {
|
|
71
|
+
color
|
|
72
|
+
}
|
|
73
|
+
}, row.text));
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The expanded part of a tool call's card: a markdown `display` or sub-agent answer, the output as
|
|
78
|
+
* JSON (toolResultDisplay `full`), or its readable rows.
|
|
79
|
+
*
|
|
80
|
+
* @param {Object} props
|
|
81
|
+
* @param {Object} props.colors
|
|
82
|
+
* @param {Object} props.components
|
|
83
|
+
* @param {{ kind: 'markdown'|'json'|'rows', text?: string, rows?: Object[] }} props.detail
|
|
84
|
+
* @param {Object[]} [props.linkChips]
|
|
85
|
+
* @param {(href: string) => void} props.onLinkPress
|
|
86
|
+
*/ function ToolDetail({ colors, components, detail, linkChips, onLinkPress }) {
|
|
87
|
+
if (detail.kind === 'markdown') {
|
|
88
|
+
return /*#__PURE__*/ React.createElement(MarkdownContent, {
|
|
89
|
+
components: components,
|
|
90
|
+
content: detail.text,
|
|
91
|
+
linkChips: linkChips,
|
|
92
|
+
onLinkPress: onLinkPress
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (detail.kind === 'json') {
|
|
96
|
+
return /*#__PURE__*/ React.createElement(Text, {
|
|
97
|
+
selectable: true,
|
|
98
|
+
style: [
|
|
99
|
+
styles.json,
|
|
100
|
+
{
|
|
101
|
+
color: colors.label
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}, detail.text);
|
|
105
|
+
}
|
|
106
|
+
return /*#__PURE__*/ React.createElement(Rows, {
|
|
107
|
+
colors: colors,
|
|
108
|
+
onLinkPress: onLinkPress,
|
|
109
|
+
rows: detail.rows
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const styles = StyleSheet.create({
|
|
113
|
+
rows: {
|
|
114
|
+
gap: 4
|
|
115
|
+
},
|
|
116
|
+
group: {
|
|
117
|
+
fontSize: 13,
|
|
118
|
+
fontWeight: '600',
|
|
119
|
+
letterSpacing: -0.08,
|
|
120
|
+
lineHeight: 18,
|
|
121
|
+
marginTop: 2
|
|
122
|
+
},
|
|
123
|
+
label: {
|
|
124
|
+
fontWeight: '500'
|
|
125
|
+
},
|
|
126
|
+
value: {
|
|
127
|
+
fontSize: 13,
|
|
128
|
+
letterSpacing: -0.08,
|
|
129
|
+
lineHeight: 18
|
|
130
|
+
},
|
|
131
|
+
json: {
|
|
132
|
+
fontFamily: monospace,
|
|
133
|
+
fontSize: 12,
|
|
134
|
+
lineHeight: 17
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export default ToolDetail;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { memo } from 'react';
|
|
16
|
+
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
17
|
+
import getMessageText from './getMessageText.js';
|
|
18
|
+
/**
|
|
19
|
+
* A message the person sent: their text in a tinted bubble at the trailing edge, as Messages and
|
|
20
|
+
* the chat apps draw it. A long press opens its actions (Copy).
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} props
|
|
23
|
+
* @param {Object} props.colors
|
|
24
|
+
* @param {Object} props.message
|
|
25
|
+
* @param {(message: Object) => void} props.onLongPress
|
|
26
|
+
* @param {string} props.testID
|
|
27
|
+
*/ function UserMessage({ colors, message, onLongPress, testID }) {
|
|
28
|
+
const text = getMessageText(message);
|
|
29
|
+
const files = (message.parts ?? []).filter((part)=>part.type === 'file');
|
|
30
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
31
|
+
style: styles.row
|
|
32
|
+
}, /*#__PURE__*/ React.createElement(Pressable, {
|
|
33
|
+
accessibilityHint: "Long press for actions",
|
|
34
|
+
delayLongPress: 300,
|
|
35
|
+
onLongPress: ()=>onLongPress(message),
|
|
36
|
+
style: ({ pressed })=>[
|
|
37
|
+
styles.bubble,
|
|
38
|
+
{
|
|
39
|
+
backgroundColor: colors.tintFill
|
|
40
|
+
},
|
|
41
|
+
pressed ? {
|
|
42
|
+
opacity: 0.85
|
|
43
|
+
} : null
|
|
44
|
+
],
|
|
45
|
+
testID: testID
|
|
46
|
+
}, files.length > 0 ? /*#__PURE__*/ React.createElement(Text, {
|
|
47
|
+
style: [
|
|
48
|
+
styles.files,
|
|
49
|
+
{
|
|
50
|
+
color: colors.secondary
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}, files.map((part)=>part.filename ?? 'File').join(', ')) : null, text === '' ? null : /*#__PURE__*/ React.createElement(Text, {
|
|
54
|
+
style: [
|
|
55
|
+
styles.text,
|
|
56
|
+
{
|
|
57
|
+
color: colors.label
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}, text)));
|
|
61
|
+
}
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
row: {
|
|
64
|
+
alignItems: 'flex-end',
|
|
65
|
+
paddingLeft: 48
|
|
66
|
+
},
|
|
67
|
+
bubble: {
|
|
68
|
+
borderCurve: 'continuous',
|
|
69
|
+
borderRadius: 20,
|
|
70
|
+
paddingHorizontal: 14,
|
|
71
|
+
paddingVertical: 9
|
|
72
|
+
},
|
|
73
|
+
files: {
|
|
74
|
+
fontSize: 13,
|
|
75
|
+
lineHeight: 18,
|
|
76
|
+
marginBottom: 2
|
|
77
|
+
},
|
|
78
|
+
text: {
|
|
79
|
+
fontSize: 17,
|
|
80
|
+
letterSpacing: -0.41,
|
|
81
|
+
lineHeight: 22
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export default /*#__PURE__*/ memo(UserMessage);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { StyleSheet, Text, View, useWindowDimensions } from 'react-native';
|
|
17
|
+
import { type } from '@lowdefy/helpers';
|
|
18
|
+
import SystemIcon from '../../shared/SystemIcon.js';
|
|
19
|
+
/**
|
|
20
|
+
* An empty conversation: the welcome's glyph on a tinted circle, its title and its description,
|
|
21
|
+
* a little above the middle of the screen. Its prompts are chips above the composer.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} props
|
|
24
|
+
* @param {Object} props.colors
|
|
25
|
+
* @param {Object} props.components
|
|
26
|
+
* @param {string} props.testID
|
|
27
|
+
* @param {{ title?: string, description?: string, icon?: string, symbol?: string }} [props.welcome]
|
|
28
|
+
*/ function WelcomeView({ colors, components, testID, welcome }) {
|
|
29
|
+
const { height } = useWindowDimensions();
|
|
30
|
+
const title = type.isString(welcome?.title) ? welcome.title : null;
|
|
31
|
+
const description = type.isString(welcome?.description) ? welcome.description : null;
|
|
32
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
33
|
+
style: [
|
|
34
|
+
styles.root,
|
|
35
|
+
{
|
|
36
|
+
minHeight: height * 0.5
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
testID: testID
|
|
40
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
41
|
+
style: [
|
|
42
|
+
styles.mark,
|
|
43
|
+
{
|
|
44
|
+
backgroundColor: colors.tintFill
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}, /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
48
|
+
color: colors.tint,
|
|
49
|
+
components: components,
|
|
50
|
+
fallback: type.isString(welcome?.icon) ? welcome.icon : 'Sparkles',
|
|
51
|
+
size: 26,
|
|
52
|
+
symbol: type.isString(welcome?.symbol) ? welcome.symbol : 'sparkles'
|
|
53
|
+
})), title === null ? null : /*#__PURE__*/ React.createElement(Text, {
|
|
54
|
+
accessibilityRole: "header",
|
|
55
|
+
style: [
|
|
56
|
+
styles.title,
|
|
57
|
+
{
|
|
58
|
+
color: colors.label
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}, title), description === null ? null : /*#__PURE__*/ React.createElement(Text, {
|
|
62
|
+
style: [
|
|
63
|
+
styles.description,
|
|
64
|
+
{
|
|
65
|
+
color: colors.secondary
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}, description));
|
|
69
|
+
}
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
root: {
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
paddingHorizontal: 24
|
|
75
|
+
},
|
|
76
|
+
mark: {
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
borderRadius: 32,
|
|
79
|
+
height: 64,
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
marginBottom: 16,
|
|
82
|
+
width: 64
|
|
83
|
+
},
|
|
84
|
+
title: {
|
|
85
|
+
fontSize: 22,
|
|
86
|
+
fontWeight: '700',
|
|
87
|
+
letterSpacing: -0.26,
|
|
88
|
+
lineHeight: 28,
|
|
89
|
+
textAlign: 'center'
|
|
90
|
+
},
|
|
91
|
+
description: {
|
|
92
|
+
fontSize: 15,
|
|
93
|
+
letterSpacing: -0.24,
|
|
94
|
+
lineHeight: 20,
|
|
95
|
+
marginTop: 6,
|
|
96
|
+
maxWidth: 320,
|
|
97
|
+
textAlign: 'center'
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export default WelcomeView;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { DefaultChatTransport } from 'ai';
|
|
16
|
+
/**
|
|
17
|
+
* The chat transport: the AI SDK's DefaultChatTransport posting to the app's agent route, as the
|
|
18
|
+
* web block's does, with its fetch the block's streamFetch (the host's streaming fetch to the
|
|
19
|
+
* app's server, sent with the caller's bearer session and the shell header). The request is
|
|
20
|
+
* `POST /api/agent/{pageId}/{agentId}?conversationId=…` with `{ messages, urlQuery, pathParams,
|
|
21
|
+
* sharedState, sharedStateReadOnly }`, and the answer is the AI SDK UI message stream as
|
|
22
|
+
* server-sent events.
|
|
23
|
+
*
|
|
24
|
+
* The shared state is read from refs at send time, so a send carries the page's latest values
|
|
25
|
+
* without the transport being rebuilt. onRequest is told of each request as it is made, with the
|
|
26
|
+
* messages it sends, before any of the reply arrives (the threads keep a sent message then).
|
|
27
|
+
*
|
|
28
|
+
* @param {Object} params
|
|
29
|
+
* @param {string} params.agentId Module agent ids hold "/", so it is encoded as one segment.
|
|
30
|
+
* @param {string} params.conversationId
|
|
31
|
+
* @param {string} params.pageId
|
|
32
|
+
* @param {Object} [params.pathParams]
|
|
33
|
+
* @param {{ current: Object|null }} params.sharedStateRef
|
|
34
|
+
* @param {{ current: boolean }} params.sharedStateReadOnlyRef
|
|
35
|
+
* @param {(path: string, init: Object) => Promise<Response>} params.streamFetch
|
|
36
|
+
* @param {Object} [params.urlQuery]
|
|
37
|
+
* @returns {{ sendMessages: Function, reconnectToStream: Function }} A ChatTransport.
|
|
38
|
+
*/ function createAgentTransport({ agentId, conversationId, onRequest, pageId, pathParams, sharedStateRef, sharedStateReadOnlyRef, streamFetch, urlQuery }) {
|
|
39
|
+
const base = `/api/agent/${pageId}/${encodeURIComponent(agentId)}`;
|
|
40
|
+
const transport = new DefaultChatTransport({
|
|
41
|
+
api: `${base}?conversationId=${encodeURIComponent(conversationId)}`,
|
|
42
|
+
// The shell sends no cookies: the session travels as the bearer token streamFetch adds.
|
|
43
|
+
credentials: 'omit',
|
|
44
|
+
fetch: (path, init)=>streamFetch(path, init),
|
|
45
|
+
body: ()=>{
|
|
46
|
+
const sharedState = sharedStateRef.current;
|
|
47
|
+
return {
|
|
48
|
+
...urlQuery ? {
|
|
49
|
+
urlQuery
|
|
50
|
+
} : {},
|
|
51
|
+
...pathParams ? {
|
|
52
|
+
pathParams
|
|
53
|
+
} : {},
|
|
54
|
+
...sharedState ? {
|
|
55
|
+
sharedState
|
|
56
|
+
} : {},
|
|
57
|
+
...sharedStateReadOnlyRef.current ? {
|
|
58
|
+
sharedStateReadOnly: true
|
|
59
|
+
} : {}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
sendMessages: (options)=>{
|
|
65
|
+
onRequest({
|
|
66
|
+
messages: options.messages,
|
|
67
|
+
trigger: options.trigger
|
|
68
|
+
});
|
|
69
|
+
return transport.sendMessages(options);
|
|
70
|
+
},
|
|
71
|
+
reconnectToStream: (options)=>transport.reconnectToStream(options)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export default createAgentTransport;
|