@lowdefy/blocks-native 0.0.0-stage → 7.3.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,284 @@
|
|
|
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 avatar from '../../schemas/avatar.js';
|
|
16
|
+
import icon from '../../schemas/icon.js';
|
|
17
|
+
import { theme } from '../../schemas/inputProperties.js';
|
|
18
|
+
import status from '../../schemas/status.js';
|
|
19
|
+
import tone from '../../schemas/tone.js';
|
|
20
|
+
const sizedAvatar = {
|
|
21
|
+
...avatar,
|
|
22
|
+
properties: {
|
|
23
|
+
...avatar.properties,
|
|
24
|
+
size: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
description: 'The avatar diameter in points.'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const swipeAction = {
|
|
31
|
+
type: 'object',
|
|
32
|
+
required: [
|
|
33
|
+
'id'
|
|
34
|
+
],
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
properties: {
|
|
37
|
+
id: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'Passed to onSwipeAction as `_event: id`.'
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'The button title.'
|
|
44
|
+
},
|
|
45
|
+
icon,
|
|
46
|
+
tone,
|
|
47
|
+
color: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'The button colour in place of its tone: a palette hue, token name or colour.',
|
|
50
|
+
docs: {
|
|
51
|
+
displayType: 'color'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
// A mobile-only block: an iOS-style list row. On a phone a table is a List of ListItems.
|
|
57
|
+
export default {
|
|
58
|
+
category: 'container',
|
|
59
|
+
icons: [
|
|
60
|
+
'Check',
|
|
61
|
+
'chevron-right'
|
|
62
|
+
],
|
|
63
|
+
valueType: null,
|
|
64
|
+
slots: {
|
|
65
|
+
leading: 'Blocks at the start of the row, in place of the leading property.',
|
|
66
|
+
trailing: 'Blocks at the end of the row, before the trailing property parts.'
|
|
67
|
+
},
|
|
68
|
+
cssKeys: {
|
|
69
|
+
element: 'The ListItem row.',
|
|
70
|
+
avatar: 'The leading avatar.',
|
|
71
|
+
icon: 'The leading icon.',
|
|
72
|
+
title: 'The title.',
|
|
73
|
+
subtitle: 'The subtitle.',
|
|
74
|
+
description: 'The subtitle (the phase 1 name).',
|
|
75
|
+
extra: 'The trailing text.'
|
|
76
|
+
},
|
|
77
|
+
events: {
|
|
78
|
+
onClick: 'Trigger actions when the row is pressed. The row then shows a chevron.',
|
|
79
|
+
onSwipeAction: 'Trigger actions when a swipe action is pressed or fully swiped, with the action id as `_event: id`.',
|
|
80
|
+
onContextMenu: 'Trigger actions when a context menu item is picked, with the item id as `_event: id`.'
|
|
81
|
+
},
|
|
82
|
+
properties: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
properties: {
|
|
86
|
+
avatar: {
|
|
87
|
+
...avatar,
|
|
88
|
+
description: 'The same as leading.avatar.'
|
|
89
|
+
},
|
|
90
|
+
chevron: {
|
|
91
|
+
type: 'boolean',
|
|
92
|
+
description: 'Show a chevron at the end of the row. Defaults to true when the row has an onClick event.'
|
|
93
|
+
},
|
|
94
|
+
contextMenu: {
|
|
95
|
+
type: 'array',
|
|
96
|
+
description: "Items of the menu a long press opens: iOS's native context menu, or an alert on Android. Picking one fires onContextMenu.",
|
|
97
|
+
items: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
required: [
|
|
100
|
+
'id',
|
|
101
|
+
'title'
|
|
102
|
+
],
|
|
103
|
+
additionalProperties: false,
|
|
104
|
+
properties: {
|
|
105
|
+
id: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
description: 'Passed to onContextMenu as `_event: id`.'
|
|
108
|
+
},
|
|
109
|
+
title: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
description: 'The item title.'
|
|
112
|
+
},
|
|
113
|
+
icon: {
|
|
114
|
+
type: [
|
|
115
|
+
'string',
|
|
116
|
+
'object'
|
|
117
|
+
],
|
|
118
|
+
description: 'An SF Symbol name (doc.on.doc, trash), or { sf, name }. A native menu cannot draw Lucide icons, so a Lucide name shows no icon.',
|
|
119
|
+
properties: {
|
|
120
|
+
sf: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
description: 'The SF Symbol name.'
|
|
123
|
+
},
|
|
124
|
+
name: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
description: 'An icon name.'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
destructive: {
|
|
131
|
+
type: 'boolean',
|
|
132
|
+
default: false,
|
|
133
|
+
description: 'Draw the item in red, for an action that deletes or removes.'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
description: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'The same as subtitle.'
|
|
141
|
+
},
|
|
142
|
+
disabled: {
|
|
143
|
+
type: 'boolean',
|
|
144
|
+
default: false,
|
|
145
|
+
description: 'Dim the row and stop it from being pressed.'
|
|
146
|
+
},
|
|
147
|
+
extra: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
description: 'The same as trailing.text.'
|
|
150
|
+
},
|
|
151
|
+
icon: {
|
|
152
|
+
...icon,
|
|
153
|
+
description: 'The same as leading.icon.'
|
|
154
|
+
},
|
|
155
|
+
leading: {
|
|
156
|
+
type: 'object',
|
|
157
|
+
additionalProperties: false,
|
|
158
|
+
description: 'What starts the row: a status glyph, an avatar or an icon. With more than one, status wins, then avatar.',
|
|
159
|
+
properties: {
|
|
160
|
+
avatar: {
|
|
161
|
+
...sizedAvatar,
|
|
162
|
+
description: "A person's avatar, 40pt with a subtitle and 28pt without."
|
|
163
|
+
},
|
|
164
|
+
icon: {
|
|
165
|
+
...icon,
|
|
166
|
+
description: 'An icon, drawn at 22pt in the secondary label colour.'
|
|
167
|
+
},
|
|
168
|
+
status: {
|
|
169
|
+
...status,
|
|
170
|
+
description: 'A StatusIcon glyph (inProgress, done, dot, ...), or { name, color, size }.'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
subtitle: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: 'One line of meta under the title, such as `ACME-644 · Design title`.'
|
|
177
|
+
},
|
|
178
|
+
subtitleLines: {
|
|
179
|
+
type: 'integer',
|
|
180
|
+
minimum: 1,
|
|
181
|
+
default: 1,
|
|
182
|
+
description: 'The most lines the subtitle takes before it is cut short.'
|
|
183
|
+
},
|
|
184
|
+
swipeActions: {
|
|
185
|
+
type: 'object',
|
|
186
|
+
additionalProperties: false,
|
|
187
|
+
description: 'Buttons the row shows when it is swiped: leading ones when swiped right, trailing ones when swiped left. The first of each side sits at the edge. Each fires onSwipeAction with its id.',
|
|
188
|
+
properties: {
|
|
189
|
+
leading: {
|
|
190
|
+
type: 'array',
|
|
191
|
+
items: swipeAction,
|
|
192
|
+
description: 'Shown when swiped right.'
|
|
193
|
+
},
|
|
194
|
+
trailing: {
|
|
195
|
+
type: 'array',
|
|
196
|
+
items: swipeAction,
|
|
197
|
+
description: 'Shown when swiped left.'
|
|
198
|
+
},
|
|
199
|
+
fullSwipe: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
enum: [
|
|
202
|
+
'leading',
|
|
203
|
+
'trailing',
|
|
204
|
+
'both',
|
|
205
|
+
'none'
|
|
206
|
+
],
|
|
207
|
+
default: 'leading',
|
|
208
|
+
description: "The sides on which swiping most of the way across runs the side's first action, as Mail's swipe to mark read."
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
theme,
|
|
213
|
+
title: {
|
|
214
|
+
type: 'string',
|
|
215
|
+
description: 'The row title.'
|
|
216
|
+
},
|
|
217
|
+
titleLines: {
|
|
218
|
+
type: 'integer',
|
|
219
|
+
minimum: 1,
|
|
220
|
+
default: 2,
|
|
221
|
+
description: 'The most lines the title takes before it is cut short.'
|
|
222
|
+
},
|
|
223
|
+
trailing: {
|
|
224
|
+
type: 'object',
|
|
225
|
+
additionalProperties: false,
|
|
226
|
+
description: 'What ends the row, in this order: badges, text, a status glyph, an icon, then avatars, and last the checkmark.',
|
|
227
|
+
properties: {
|
|
228
|
+
avatar: {
|
|
229
|
+
...sizedAvatar,
|
|
230
|
+
description: "A person's avatar, 20pt unless sized."
|
|
231
|
+
},
|
|
232
|
+
avatars: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
items: avatar,
|
|
235
|
+
description: 'Several people as stacked 20pt avatars, at most three and a count.'
|
|
236
|
+
},
|
|
237
|
+
check: {
|
|
238
|
+
type: 'boolean',
|
|
239
|
+
default: false,
|
|
240
|
+
description: "Draw the iOS checkmark (17pt semibold, in the tint colour) at the end of the row, where the chevron goes, as a picked row of a multi-select list shows it. A checked row has no chevron unless `chevron` is true, and a screen reader reads it as selected. Set it from state, such as whether the picked values include the row's value."
|
|
241
|
+
},
|
|
242
|
+
badges: {
|
|
243
|
+
type: 'array',
|
|
244
|
+
description: 'Small counts with an icon, such as open questions: [{ icon: questionmark.circle, text: 2 }].',
|
|
245
|
+
items: {
|
|
246
|
+
type: 'object',
|
|
247
|
+
additionalProperties: false,
|
|
248
|
+
properties: {
|
|
249
|
+
icon,
|
|
250
|
+
text: {
|
|
251
|
+
type: [
|
|
252
|
+
'string',
|
|
253
|
+
'number'
|
|
254
|
+
],
|
|
255
|
+
description: 'The count or short text.'
|
|
256
|
+
},
|
|
257
|
+
color: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
description: 'The badge colour: a palette hue, token name or colour.'
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
icon: {
|
|
265
|
+
...icon,
|
|
266
|
+
description: 'An icon in the secondary label colour.'
|
|
267
|
+
},
|
|
268
|
+
status: {
|
|
269
|
+
...status,
|
|
270
|
+
description: 'A StatusIcon glyph, such as the priority (priorityHigh).'
|
|
271
|
+
},
|
|
272
|
+
text: {
|
|
273
|
+
type: 'string',
|
|
274
|
+
description: 'Meta text, such as a time (2d) or a value.'
|
|
275
|
+
},
|
|
276
|
+
textColor: {
|
|
277
|
+
type: 'string',
|
|
278
|
+
description: 'The text colour, such as orange for "waiting": a palette hue, token name or colour.'
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
@@ -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 React from 'react';
|
|
16
|
+
import { View } from 'react-native';
|
|
17
|
+
import { useTheme } from '@lowdefy/client-native';
|
|
18
|
+
import getDeviceFeature, { hasDeviceFeature } from '../../device/getDeviceFeature.js';
|
|
19
|
+
import meta from './meta.js';
|
|
20
|
+
import MissingFeature from '../../shared/MissingFeature.js';
|
|
21
|
+
// A native map: the shell's maps feature draws it (expo-maps: Apple Maps on iOS, Google Maps on
|
|
22
|
+
// Android) from the block's markers, lines and camera, and reports taps and moves as events.
|
|
23
|
+
function Map({ blockId, methods, properties, styles = {} }) {
|
|
24
|
+
const { tokens } = useTheme();
|
|
25
|
+
const height = properties.height ?? 300;
|
|
26
|
+
if (!hasDeviceFeature('maps')) {
|
|
27
|
+
return /*#__PURE__*/ React.createElement(MissingFeature, {
|
|
28
|
+
blockId: blockId,
|
|
29
|
+
feature: "maps",
|
|
30
|
+
height: height,
|
|
31
|
+
style: styles.element,
|
|
32
|
+
title: "The map"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const { MapView } = getDeviceFeature({
|
|
36
|
+
feature: 'maps',
|
|
37
|
+
action: 'Map'
|
|
38
|
+
});
|
|
39
|
+
const markers = properties.markers ?? [];
|
|
40
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
41
|
+
style: [
|
|
42
|
+
{
|
|
43
|
+
borderRadius: 12,
|
|
44
|
+
height,
|
|
45
|
+
overflow: 'hidden'
|
|
46
|
+
},
|
|
47
|
+
styles.element
|
|
48
|
+
],
|
|
49
|
+
testID: blockId
|
|
50
|
+
}, /*#__PURE__*/ React.createElement(MapView, {
|
|
51
|
+
center: properties.center ?? markers[0] ?? null,
|
|
52
|
+
mapType: properties.mapType ?? 'standard',
|
|
53
|
+
markerColor: tokens.colorTint,
|
|
54
|
+
markers: markers,
|
|
55
|
+
onMapClick: (event)=>methods.triggerEvent({
|
|
56
|
+
name: 'onMapClick',
|
|
57
|
+
event
|
|
58
|
+
}),
|
|
59
|
+
onMarkerClick: (marker)=>methods.triggerEvent({
|
|
60
|
+
name: 'onMarkerClick',
|
|
61
|
+
event: {
|
|
62
|
+
marker
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
onRegionChange: (event)=>methods.triggerEvent({
|
|
66
|
+
name: 'onRegionChange',
|
|
67
|
+
event
|
|
68
|
+
}),
|
|
69
|
+
polylines: properties.polylines ?? [],
|
|
70
|
+
showsUserLocation: properties.showsUserLocation === true,
|
|
71
|
+
style: {
|
|
72
|
+
flex: 1
|
|
73
|
+
},
|
|
74
|
+
zoom: properties.zoom ?? 12
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
Map.meta = meta;
|
|
78
|
+
export default Map;
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
*/ const coordinate = {
|
|
16
|
+
type: 'object',
|
|
17
|
+
required: [
|
|
18
|
+
'latitude',
|
|
19
|
+
'longitude'
|
|
20
|
+
],
|
|
21
|
+
properties: {
|
|
22
|
+
latitude: {
|
|
23
|
+
type: 'number'
|
|
24
|
+
},
|
|
25
|
+
longitude: {
|
|
26
|
+
type: 'number'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// Map has no web block of its name (blocks-google-maps draws GoogleMaps on the web): a page that
|
|
31
|
+
// uses it is mobile only. Apple Maps on iOS and Google Maps on Android (expo-maps), in shells that
|
|
32
|
+
// carry maps (profile field).
|
|
33
|
+
export default {
|
|
34
|
+
category: 'display',
|
|
35
|
+
icons: [],
|
|
36
|
+
valueType: null,
|
|
37
|
+
cssKeys: {
|
|
38
|
+
element: 'The map.'
|
|
39
|
+
},
|
|
40
|
+
events: {
|
|
41
|
+
onMarkerClick: {
|
|
42
|
+
description: 'Trigger actions when a marker is tapped.',
|
|
43
|
+
event: {
|
|
44
|
+
marker: 'The marker, as given in markers.'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
onMapClick: {
|
|
48
|
+
description: 'Trigger actions when the map is tapped away from a marker.',
|
|
49
|
+
event: {
|
|
50
|
+
latitude: 'The latitude tapped.',
|
|
51
|
+
longitude: 'The longitude tapped.'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
onRegionChange: {
|
|
55
|
+
description: 'Trigger actions when the person moves or zooms the map.',
|
|
56
|
+
event: {
|
|
57
|
+
center: '{ latitude, longitude }',
|
|
58
|
+
zoom: 'The zoom level.'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
properties: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
properties: {
|
|
66
|
+
center: {
|
|
67
|
+
...coordinate,
|
|
68
|
+
description: 'Where the map opens. The first marker by default.'
|
|
69
|
+
},
|
|
70
|
+
height: {
|
|
71
|
+
type: 'number',
|
|
72
|
+
default: 300,
|
|
73
|
+
description: 'The height of the map.'
|
|
74
|
+
},
|
|
75
|
+
mapType: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
enum: [
|
|
78
|
+
'standard',
|
|
79
|
+
'satellite',
|
|
80
|
+
'hybrid'
|
|
81
|
+
],
|
|
82
|
+
default: 'standard',
|
|
83
|
+
description: 'The map style.'
|
|
84
|
+
},
|
|
85
|
+
markers: {
|
|
86
|
+
type: 'array',
|
|
87
|
+
description: 'Markers on the map.',
|
|
88
|
+
items: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
required: [
|
|
91
|
+
'latitude',
|
|
92
|
+
'longitude'
|
|
93
|
+
],
|
|
94
|
+
properties: {
|
|
95
|
+
id: {
|
|
96
|
+
type: 'string'
|
|
97
|
+
},
|
|
98
|
+
latitude: {
|
|
99
|
+
type: 'number'
|
|
100
|
+
},
|
|
101
|
+
longitude: {
|
|
102
|
+
type: 'number'
|
|
103
|
+
},
|
|
104
|
+
title: {
|
|
105
|
+
type: 'string'
|
|
106
|
+
},
|
|
107
|
+
description: {
|
|
108
|
+
type: 'string'
|
|
109
|
+
},
|
|
110
|
+
color: {
|
|
111
|
+
type: 'string'
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
polylines: {
|
|
117
|
+
type: 'array',
|
|
118
|
+
description: 'Lines on the map, like a route.',
|
|
119
|
+
items: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
required: [
|
|
122
|
+
'coordinates'
|
|
123
|
+
],
|
|
124
|
+
properties: {
|
|
125
|
+
id: {
|
|
126
|
+
type: 'string'
|
|
127
|
+
},
|
|
128
|
+
coordinates: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
items: coordinate
|
|
131
|
+
},
|
|
132
|
+
color: {
|
|
133
|
+
type: 'string'
|
|
134
|
+
},
|
|
135
|
+
width: {
|
|
136
|
+
type: 'number'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
showsUserLocation: {
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
default: false,
|
|
144
|
+
description: "Show the person's location (asks for location permission)."
|
|
145
|
+
},
|
|
146
|
+
zoom: {
|
|
147
|
+
type: 'number',
|
|
148
|
+
default: 12,
|
|
149
|
+
description: 'The zoom level, 1 (world) to 20.'
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { createContext } from 'react';
|
|
16
|
+
// The width of the text a link chip sits in: the Markdown's, a list item's text column's or a
|
|
17
|
+
// quote's (ChipWidthView), once laid out. A chip is one line at most this wide, less when text
|
|
18
|
+
// follows it (getChipMaxWidth), so its title is cut short rather than pushing past the text.
|
|
19
|
+
const ChipWidthContext = /*#__PURE__*/ createContext(320);
|
|
20
|
+
export default ChipWidthContext;
|
|
@@ -0,0 +1,40 @@
|
|
|
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, { useContext, useState } from 'react';
|
|
16
|
+
import { View } from 'react-native';
|
|
17
|
+
import ChipWidthContext from './ChipWidthContext.js';
|
|
18
|
+
/**
|
|
19
|
+
* A View that gives the link chips in it its own width (ChipWidthContext), less `inset` for its
|
|
20
|
+
* horizontal padding: the Markdown, a list item's text column and a quote's text each measure
|
|
21
|
+
* theirs, so a chip in a list item is capped by the item's line rather than the block's. Until
|
|
22
|
+
* it is laid out the width around it stands in.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} props
|
|
25
|
+
* @param {React.ReactNode} props.children
|
|
26
|
+
* @param {number} [props.inset] The View's horizontal padding.
|
|
27
|
+
* @param {Object} [props.style]
|
|
28
|
+
* @param {string} [props.testID]
|
|
29
|
+
*/ function ChipWidthView({ children, inset = 0, style, testID }) {
|
|
30
|
+
const outer = useContext(ChipWidthContext);
|
|
31
|
+
const [width, setWidth] = useState(null);
|
|
32
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
33
|
+
onLayout: (event)=>setWidth(Math.max(0, event.nativeEvent.layout.width - inset)),
|
|
34
|
+
style: style,
|
|
35
|
+
testID: testID
|
|
36
|
+
}, /*#__PURE__*/ React.createElement(ChipWidthContext.Provider, {
|
|
37
|
+
value: width ?? outer
|
|
38
|
+
}, children));
|
|
39
|
+
}
|
|
40
|
+
export default ChipWidthView;
|