@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,80 @@
|
|
|
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
|
+
*/ // The native QRScanner keeps the web block's name and onScan event (blocks-qr). It draws the
|
|
16
|
+
// camera of a shell that carries it (profile field) through the device registry.
|
|
17
|
+
export default {
|
|
18
|
+
category: 'display',
|
|
19
|
+
icons: [],
|
|
20
|
+
valueType: null,
|
|
21
|
+
cssKeys: {
|
|
22
|
+
element: 'The camera view.'
|
|
23
|
+
},
|
|
24
|
+
events: {
|
|
25
|
+
onScan: {
|
|
26
|
+
description: 'Trigger actions when a code is read.',
|
|
27
|
+
event: {
|
|
28
|
+
data: 'The text the code holds.',
|
|
29
|
+
type: 'The code type, like qr or ean13.'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
properties: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
properties: {
|
|
37
|
+
continuous: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
default: false,
|
|
40
|
+
description: 'Keep scanning after a read: each code fires onScan once, and again after 2 seconds. Otherwise the scanner stops after its first read until its reset method is called.'
|
|
41
|
+
},
|
|
42
|
+
height: {
|
|
43
|
+
type: 'number',
|
|
44
|
+
default: 300,
|
|
45
|
+
description: 'The height of the camera view.'
|
|
46
|
+
},
|
|
47
|
+
prompt: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Text shown over the camera.'
|
|
50
|
+
},
|
|
51
|
+
torch: {
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
default: false,
|
|
54
|
+
description: 'Turn the torch on.'
|
|
55
|
+
},
|
|
56
|
+
types: {
|
|
57
|
+
type: 'array',
|
|
58
|
+
items: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
enum: [
|
|
61
|
+
'qr',
|
|
62
|
+
'ean13',
|
|
63
|
+
'ean8',
|
|
64
|
+
'code128',
|
|
65
|
+
'code39',
|
|
66
|
+
'code93',
|
|
67
|
+
'upc_a',
|
|
68
|
+
'upc_e',
|
|
69
|
+
'pdf417',
|
|
70
|
+
'datamatrix',
|
|
71
|
+
'aztec',
|
|
72
|
+
'itf14',
|
|
73
|
+
'codabar'
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
description: 'Code types to read; all by default.'
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
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
|
+
*/ // The mobile page type. Its component lives in @lowdefy/client-native, which owns how a page meets
|
|
16
|
+
// the shell's router; this meta lets the build accept mobile pages of type Screen.
|
|
17
|
+
export default {
|
|
18
|
+
category: 'container',
|
|
19
|
+
icons: [],
|
|
20
|
+
valueType: null,
|
|
21
|
+
slots: {
|
|
22
|
+
content: 'The page content, in a scroll view.',
|
|
23
|
+
headerBackdrop: "Blocks drawn in the space above the content, behind the large title and the translucent bar, such as art beside the title. Their box's bottom edge sits at the top of the content, so they scroll away with the title; a negative bottom margin lets a block reach down beside the first content blocks. They take no room in the content and never take touches. Align a block with its own style, such as `alignSelf: flex-end` for the right edge.",
|
|
24
|
+
headerBottom: 'Blocks pinned directly under the screen header (under the large title or the search field), such as a ChipSelector or a SegmentedControl, which stay in view as the page scrolls. Once the page scrolls they take the screen background and a hairline under them. They sit at the 16pt screen inset; a ChipSelector runs edge to edge.',
|
|
25
|
+
headerLeft: 'Blocks drawn at the left of the screen header, at their natural size. Prefer `headerActions` for icon buttons.',
|
|
26
|
+
headerRight: 'Blocks drawn at the right of the screen header, at their natural size. Prefer `headerActions` for icon buttons.',
|
|
27
|
+
footer: 'Blocks pinned to the bottom of the screen, outside the scroll view, above the tab bar and the keyboard, on the bar background with a hairline above. For a Composer, or actions that stay in reach.'
|
|
28
|
+
},
|
|
29
|
+
events: {
|
|
30
|
+
onFocus: 'Trigger actions each time the screen becomes the one shown: on its first show (after onMount), when its tab is picked again, and when the screen above it is closed.',
|
|
31
|
+
onRefresh: 'Turns on pull-to-refresh. Trigger actions when the page is pulled down; the spinner shows until they finish.',
|
|
32
|
+
onSearch: 'Trigger actions when the search is submitted in the header search bar. `_event: value` is the search text.',
|
|
33
|
+
onSearchChange: 'Trigger actions when the header search text changes, once typing pauses (`headerSearch.debounce`), and with an empty value when the search is cancelled. `_event: value` is the search text.',
|
|
34
|
+
onHeaderAction: 'Trigger actions when a header action without its own `event` is pressed, or an item of its menu is picked. `_event: id` is the action id, or the picked item id.'
|
|
35
|
+
},
|
|
36
|
+
properties: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
additionalProperties: false,
|
|
39
|
+
properties: {
|
|
40
|
+
title: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'The screen title, shown in the header.'
|
|
43
|
+
},
|
|
44
|
+
largeTitle: {
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
default: false,
|
|
47
|
+
description: 'Show the title as an iOS large title, which collapses into the header as the page scrolls. Other platforms show the standard title.'
|
|
48
|
+
},
|
|
49
|
+
backgroundTint: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
additionalProperties: false,
|
|
52
|
+
required: [
|
|
53
|
+
'color'
|
|
54
|
+
],
|
|
55
|
+
description: "A soft wash of colour at the top of the screen, such as a record's space colour: a vertical gradient from the colour at the top (35% in light mode, 45% in dark mode) easing to clear at `height` of the screen height. It is fixed to the screen, behind the large title, the translucent navigation bar and the content, and continues behind a pinned `headerBottom`. A change of colour cross-fades over 250ms.",
|
|
56
|
+
properties: {
|
|
57
|
+
color: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'The tint colour: a hex or CSS colour, a theme token such as `colorPrimary`, or a palette hue such as `blue`.'
|
|
60
|
+
},
|
|
61
|
+
colorDark: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: 'The tint colour in dark mode. Defaults to `color`.'
|
|
64
|
+
},
|
|
65
|
+
height: {
|
|
66
|
+
type: 'number',
|
|
67
|
+
minimum: 0,
|
|
68
|
+
maximum: 1,
|
|
69
|
+
default: 0.15,
|
|
70
|
+
description: 'Where the tint has faded to clear, as a fraction of the screen height from the top.'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
presentation: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
enum: [
|
|
77
|
+
'card',
|
|
78
|
+
'modal',
|
|
79
|
+
'sheet'
|
|
80
|
+
],
|
|
81
|
+
default: 'card',
|
|
82
|
+
description: 'How the screen is presented when opened.'
|
|
83
|
+
},
|
|
84
|
+
headerSearch: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
additionalProperties: false,
|
|
87
|
+
description: 'A native search bar in the header (under a large title on iOS). Its text reaches the `onSearchChange` and `onSearch` events.',
|
|
88
|
+
properties: {
|
|
89
|
+
placeholder: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'Text shown in the empty search field.'
|
|
92
|
+
},
|
|
93
|
+
autoFocus: {
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
default: false,
|
|
96
|
+
description: 'Focus the search field, with the keyboard up, each time the screen is shown. For a search page, such as the page of a `role: search` tab.'
|
|
97
|
+
},
|
|
98
|
+
debounce: {
|
|
99
|
+
type: 'number',
|
|
100
|
+
default: 300,
|
|
101
|
+
description: 'Milliseconds the text must stay unchanged before `onSearchChange` fires.'
|
|
102
|
+
},
|
|
103
|
+
hideWhenScrolling: {
|
|
104
|
+
type: 'boolean',
|
|
105
|
+
default: false,
|
|
106
|
+
description: 'Hide the search bar as the page scrolls (iOS).'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
headerActions: {
|
|
111
|
+
type: 'array',
|
|
112
|
+
description: 'Icon buttons in the header, at their natural size. On iOS each is a native bar button drawing the icon as an SF Symbol (`sfSymbol`, or the symbol for the Lucide or semantic name); an icon with no symbol, and every icon elsewhere, draws as its Lucide icon.',
|
|
113
|
+
items: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
required: [
|
|
117
|
+
'id',
|
|
118
|
+
'icon'
|
|
119
|
+
],
|
|
120
|
+
properties: {
|
|
121
|
+
id: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'The action id, the `_event: id` of the event it triggers.'
|
|
124
|
+
},
|
|
125
|
+
icon: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: 'Icon name: a semantic name like `edit`, a Lucide icon name like `Pencil`, or a set-qualified name like `tabler:Pencil`.'
|
|
128
|
+
},
|
|
129
|
+
sfSymbol: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'The SF Symbol iOS draws, such as `square.and.pencil`. Defaults to the symbol mapped from `icon`.'
|
|
132
|
+
},
|
|
133
|
+
title: {
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'The label screen readers read and iOS shows in a long press. Defaults to a title from the icon name.'
|
|
136
|
+
},
|
|
137
|
+
placement: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
enum: [
|
|
140
|
+
'left',
|
|
141
|
+
'right'
|
|
142
|
+
],
|
|
143
|
+
default: 'right',
|
|
144
|
+
description: 'The side of the header the button is on.'
|
|
145
|
+
},
|
|
146
|
+
event: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
default: 'onHeaderAction',
|
|
149
|
+
description: 'The Screen event the button triggers, such as `onAdd`; list it under the Screen `events`.'
|
|
150
|
+
},
|
|
151
|
+
disabled: {
|
|
152
|
+
type: 'boolean',
|
|
153
|
+
default: false,
|
|
154
|
+
description: 'Draw the button dimmed and ignore presses.'
|
|
155
|
+
},
|
|
156
|
+
items: {
|
|
157
|
+
type: 'array',
|
|
158
|
+
description: "Make the button open a menu of these items, a native menu on iOS, such as a ⋯ menu of a detail page. Picking an item triggers the button's `event` with the item's id as `_event: id`.",
|
|
159
|
+
items: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
required: [
|
|
163
|
+
'id',
|
|
164
|
+
'title'
|
|
165
|
+
],
|
|
166
|
+
properties: {
|
|
167
|
+
id: {
|
|
168
|
+
type: 'string',
|
|
169
|
+
description: 'The item id, the `_event: id` it triggers.'
|
|
170
|
+
},
|
|
171
|
+
title: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
description: 'The item text.'
|
|
174
|
+
},
|
|
175
|
+
symbol: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
description: 'An SF Symbol name, such as `link` or `trash`, drawn beside the item on iOS.'
|
|
178
|
+
},
|
|
179
|
+
destructive: {
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
default: false,
|
|
182
|
+
description: 'Draw the item in red, for actions such as Delete.'
|
|
183
|
+
},
|
|
184
|
+
disabled: {
|
|
185
|
+
type: 'boolean',
|
|
186
|
+
default: false,
|
|
187
|
+
description: 'Show the item, dimmed.'
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
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 { View } from 'react-native';
|
|
17
|
+
import { SegmentedControl as NativeSegmentedControl } from '@expo/ui/community/segmented-control';
|
|
18
|
+
import getOptionIndex from '../Selector/getOptionIndex.js';
|
|
19
|
+
import getOptionLabel from '../Selector/getOptionLabel.js';
|
|
20
|
+
import getOptionValue from '../Selector/getOptionValue.js';
|
|
21
|
+
import meta from './meta.js';
|
|
22
|
+
import useBlockTokens from '../../shared/useBlockTokens.js';
|
|
23
|
+
import playFeedback from '../../device/playFeedback.js';
|
|
24
|
+
// No segment is selected while the value matches no option.
|
|
25
|
+
const NO_SEGMENT = -1;
|
|
26
|
+
/**
|
|
27
|
+
* The platform segmented control (a SwiftUI segmented Picker on iOS, Material segmented buttons
|
|
28
|
+
* on Android) as an input: one segment per option, the value is the picked option's value, as a
|
|
29
|
+
* Selector's is. It fills the width of its container.
|
|
30
|
+
*/ function SegmentedControl({ blockId, loading, methods, properties, styles = {}, value }) {
|
|
31
|
+
const { isDark, tokens } = useBlockTokens({
|
|
32
|
+
properties
|
|
33
|
+
});
|
|
34
|
+
const options = properties.options ?? [];
|
|
35
|
+
const selectedIndex = getOptionIndex({
|
|
36
|
+
options,
|
|
37
|
+
value
|
|
38
|
+
}) ?? NO_SEGMENT;
|
|
39
|
+
const disabled = loading === true || properties.disabled === true;
|
|
40
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
41
|
+
accessibilityLabel: properties.title ?? undefined,
|
|
42
|
+
style: [
|
|
43
|
+
{
|
|
44
|
+
alignSelf: 'stretch'
|
|
45
|
+
},
|
|
46
|
+
styles.element
|
|
47
|
+
]
|
|
48
|
+
}, /*#__PURE__*/ React.createElement(NativeSegmentedControl, {
|
|
49
|
+
appearance: isDark ? 'dark' : 'light',
|
|
50
|
+
enabled: !disabled,
|
|
51
|
+
onChange: ({ nativeEvent })=>{
|
|
52
|
+
const index = nativeEvent.selectedSegmentIndex;
|
|
53
|
+
if (index === selectedIndex) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const next = getOptionValue({
|
|
57
|
+
option: options[index]
|
|
58
|
+
});
|
|
59
|
+
playFeedback();
|
|
60
|
+
methods.setValue(next);
|
|
61
|
+
methods.triggerEvent({
|
|
62
|
+
name: 'onChange',
|
|
63
|
+
event: {
|
|
64
|
+
value: next
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
selectedIndex: selectedIndex,
|
|
69
|
+
testID: `${blockId}_input`,
|
|
70
|
+
tintColor: tokens.colorPrimary,
|
|
71
|
+
values: options.map((option)=>getOptionLabel({
|
|
72
|
+
option
|
|
73
|
+
}))
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
SegmentedControl.meta = meta;
|
|
77
|
+
export default SegmentedControl;
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { disabled, theme } from '../../schemas/inputProperties.js';
|
|
16
|
+
const primitiveOption = {
|
|
17
|
+
type: [
|
|
18
|
+
'string',
|
|
19
|
+
'number',
|
|
20
|
+
'boolean'
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
export default {
|
|
24
|
+
category: 'input',
|
|
25
|
+
icons: [],
|
|
26
|
+
valueType: 'any',
|
|
27
|
+
cssKeys: {
|
|
28
|
+
element: 'The SegmentedControl.'
|
|
29
|
+
},
|
|
30
|
+
events: {
|
|
31
|
+
onChange: {
|
|
32
|
+
description: 'Trigger actions when a segment is picked.',
|
|
33
|
+
event: {
|
|
34
|
+
value: 'The value of the picked option.'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
properties: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
properties: {
|
|
42
|
+
disabled,
|
|
43
|
+
options: {
|
|
44
|
+
description: 'The segments, in order: primitives, or objects with a label and a value. Keep labels short; two to four segments fit a phone.',
|
|
45
|
+
oneOf: [
|
|
46
|
+
{
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: primitiveOption
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'array',
|
|
52
|
+
items: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
required: [
|
|
55
|
+
'value'
|
|
56
|
+
],
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
properties: {
|
|
59
|
+
label: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Segment label, shown as plain text.'
|
|
62
|
+
},
|
|
63
|
+
value: {
|
|
64
|
+
description: 'The value the segment sets. Can be any type.'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
theme,
|
|
72
|
+
title: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'The label screen readers read for the control. Not drawn.'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 Svg, { Circle } from 'react-native-svg';
|
|
17
|
+
/**
|
|
18
|
+
* The avatar of a picker row that stands for no value, such as "Unassigned": an empty dashed
|
|
19
|
+
* circle in the tertiary label colour, as Linear and GitHub draw nobody.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props
|
|
22
|
+
* @param {string} props.color
|
|
23
|
+
* @param {number} props.size
|
|
24
|
+
* @param {string} [props.testID]
|
|
25
|
+
*/ function NoValueAvatar({ color, size, testID }) {
|
|
26
|
+
const strokeWidth = 1.5;
|
|
27
|
+
return /*#__PURE__*/ React.createElement(Svg, {
|
|
28
|
+
height: size,
|
|
29
|
+
testID: testID,
|
|
30
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
31
|
+
width: size
|
|
32
|
+
}, /*#__PURE__*/ React.createElement(Circle, {
|
|
33
|
+
cx: size / 2,
|
|
34
|
+
cy: size / 2,
|
|
35
|
+
fill: "none",
|
|
36
|
+
r: (size - strokeWidth) / 2,
|
|
37
|
+
stroke: color,
|
|
38
|
+
strokeDasharray: "3 2.5",
|
|
39
|
+
strokeWidth: strokeWidth
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
export default NoValueAvatar;
|
|
@@ -0,0 +1,130 @@
|
|
|
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 { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
17
|
+
import { ROW_HEIGHT } from './getPickerSheetDetents.js';
|
|
18
|
+
import iosTextStyles from '../../shared/iosTextStyles.js';
|
|
19
|
+
import PickerRowLeading, { AVATAR_SIZE } from './PickerRowLeading.js';
|
|
20
|
+
import SystemIcon from '../../shared/SystemIcon.js';
|
|
21
|
+
const GAP = 12;
|
|
22
|
+
const PADDING = 16;
|
|
23
|
+
/**
|
|
24
|
+
* One row of a picker sheet, 52pt high: the leading avatar (the option's picture or initials, or
|
|
25
|
+
* the dashed circle of the no-value row) or the option's glyph, the label in body text with the
|
|
26
|
+
* option's description under it in footnote, and a checkmark in the tint colour on a chosen
|
|
27
|
+
* row. The separator under it is inset to the label, or spans the sheet under the pinned group.
|
|
28
|
+
* To a screen reader it is a button, selected when chosen, or in a multiple picker a checkbox,
|
|
29
|
+
* checked when chosen.
|
|
30
|
+
*
|
|
31
|
+
* The row that adds the search text draws its label in the tint colour; while the text is
|
|
32
|
+
* refused, its label is in the tertiary label colour with the refusal under it in the error
|
|
33
|
+
* colour, not dimmed, so the message reads.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} props
|
|
36
|
+
* @param {string} props.blockId
|
|
37
|
+
* @param {Object} props.colors getSemanticColors' colours.
|
|
38
|
+
* @param {Object} props.components
|
|
39
|
+
* @param {boolean} props.isDark
|
|
40
|
+
* @param {boolean} [props.multiple] The row is one of several that can be checked.
|
|
41
|
+
* @param {(row: Object) => void} props.onPick
|
|
42
|
+
* @param {Object} props.row A getPickerSheetRows row.
|
|
43
|
+
* @param {boolean} props.showLeading The list has leading glyphs, so every row keeps their space.
|
|
44
|
+
* @param {Object} props.tokens
|
|
45
|
+
*/ function PickerOptionRow({ blockId, colors, components, isDark, multiple = false, onPick, row, showLeading, tokens }) {
|
|
46
|
+
const labelInset = showLeading ? PADDING + AVATAR_SIZE + GAP : PADDING;
|
|
47
|
+
let labelColor = colors.label;
|
|
48
|
+
if (row.invalid) {
|
|
49
|
+
labelColor = colors.tertiaryLabel;
|
|
50
|
+
} else if (row.create) {
|
|
51
|
+
labelColor = tokens.colorTint;
|
|
52
|
+
}
|
|
53
|
+
return /*#__PURE__*/ React.createElement(Pressable, {
|
|
54
|
+
accessibilityLabel: row.description === null ? row.label : `${row.label}, ${row.description}`,
|
|
55
|
+
accessibilityRole: multiple && !row.create ? 'checkbox' : 'button',
|
|
56
|
+
accessibilityState: multiple && !row.create ? {
|
|
57
|
+
checked: row.selected,
|
|
58
|
+
disabled: row.disabled
|
|
59
|
+
} : {
|
|
60
|
+
disabled: row.disabled,
|
|
61
|
+
selected: row.selected
|
|
62
|
+
},
|
|
63
|
+
disabled: row.disabled,
|
|
64
|
+
onPress: ()=>onPick(row),
|
|
65
|
+
style: ({ pressed })=>({
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
backgroundColor: pressed ? colors.cellPressed : 'transparent',
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
gap: GAP,
|
|
70
|
+
height: ROW_HEIGHT,
|
|
71
|
+
opacity: row.disabled && !row.invalid ? 0.4 : 1,
|
|
72
|
+
paddingHorizontal: PADDING
|
|
73
|
+
}),
|
|
74
|
+
testID: `${blockId}_option_${row.key}`
|
|
75
|
+
}, showLeading ? /*#__PURE__*/ React.createElement(View, {
|
|
76
|
+
style: {
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
height: AVATAR_SIZE,
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
width: AVATAR_SIZE
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/ React.createElement(PickerRowLeading, {
|
|
83
|
+
blockId: blockId,
|
|
84
|
+
colors: colors,
|
|
85
|
+
components: components,
|
|
86
|
+
isDark: isDark,
|
|
87
|
+
row: row,
|
|
88
|
+
tokens: tokens
|
|
89
|
+
})) : null, /*#__PURE__*/ React.createElement(View, {
|
|
90
|
+
style: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
justifyContent: 'center'
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/ React.createElement(Text, {
|
|
95
|
+
numberOfLines: 1,
|
|
96
|
+
style: [
|
|
97
|
+
iosTextStyles.body,
|
|
98
|
+
{
|
|
99
|
+
color: labelColor
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}, row.label), row.description === null ? null : /*#__PURE__*/ React.createElement(Text, {
|
|
103
|
+
numberOfLines: 1,
|
|
104
|
+
style: [
|
|
105
|
+
iosTextStyles.footnote,
|
|
106
|
+
{
|
|
107
|
+
color: row.invalid ? tokens.colorError : colors.secondaryLabel
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}, row.description)), row.selected ? /*#__PURE__*/ React.createElement(SystemIcon, {
|
|
111
|
+
color: tokens.colorTint,
|
|
112
|
+
components: components,
|
|
113
|
+
fallback: "Check",
|
|
114
|
+
size: 17,
|
|
115
|
+
symbol: "checkmark",
|
|
116
|
+
testID: `${blockId}_option_${row.key}_check`
|
|
117
|
+
}) : null, row.separator === 'none' ? null : /*#__PURE__*/ React.createElement(View, {
|
|
118
|
+
pointerEvents: "none",
|
|
119
|
+
style: {
|
|
120
|
+
backgroundColor: colors.separator,
|
|
121
|
+
bottom: 0,
|
|
122
|
+
height: StyleSheet.hairlineWidth,
|
|
123
|
+
left: row.separator === 'group' ? 0 : labelInset,
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
right: 0
|
|
126
|
+
},
|
|
127
|
+
testID: `${blockId}_option_${row.key}_separator`
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
export default PickerOptionRow;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { type } from '@lowdefy/helpers';
|
|
17
|
+
import NoValueAvatar from './NoValueAvatar.js';
|
|
18
|
+
import OptionGlyph from '../../shared/OptionGlyph.js';
|
|
19
|
+
const AVATAR_SIZE = 28;
|
|
20
|
+
const GLYPH_SIZE = 20;
|
|
21
|
+
/**
|
|
22
|
+
* The leading glyph of a picker sheet row: the dashed circle of the row that stands for no
|
|
23
|
+
* value, an option's avatar at 28pt (its picture, or its initials), or its SF Symbol or icon at
|
|
24
|
+
* 20pt. Nothing for an option with none of them.
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} props
|
|
27
|
+
* @param {string} props.blockId
|
|
28
|
+
* @param {Object} props.colors getSemanticColors' colours.
|
|
29
|
+
* @param {Object} props.components
|
|
30
|
+
* @param {boolean} props.isDark
|
|
31
|
+
* @param {Object} props.row A getPickerSheetRows row.
|
|
32
|
+
* @param {Object} props.tokens
|
|
33
|
+
*/ function PickerRowLeading({ blockId, colors, components, isDark, row, tokens }) {
|
|
34
|
+
if (row.noValue) {
|
|
35
|
+
return /*#__PURE__*/ React.createElement(NoValueAvatar, {
|
|
36
|
+
color: colors.tertiaryLabel,
|
|
37
|
+
size: AVATAR_SIZE,
|
|
38
|
+
testID: `${blockId}_option_${row.key}_none`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (row.option === null) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/ React.createElement(OptionGlyph, {
|
|
45
|
+
avatar: row.option.avatar,
|
|
46
|
+
color: row.option.iconColor,
|
|
47
|
+
components: components,
|
|
48
|
+
icon: row.option.icon,
|
|
49
|
+
isDark: isDark,
|
|
50
|
+
size: type.isObject(row.option.avatar) ? AVATAR_SIZE : GLYPH_SIZE,
|
|
51
|
+
symbol: row.option.symbol,
|
|
52
|
+
testID: `${blockId}_option_${row.key}_glyph`,
|
|
53
|
+
tokens: tokens
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export { AVATAR_SIZE };
|
|
57
|
+
export default PickerRowLeading;
|