#pragma once // Spec: INV-social 9, 10, 17..20 and INV-posts 4, 6, 10. Metrics, caps and strings of the compose area // (CreatePost, DevPlaceTextEditor, SelectableTextPopover, EmojiPicker, attachments, mentions, poll creation). #include namespace dp::spec { struct ComposeSpec { // ---- DevPlaceTextEditor (INV-social 10) ---- static constexpr float kEditorResizeBand = 24; // bottom drag band static constexpr float kEditorGripSize = 10; static constexpr float kEditorGripPadding = 8; static constexpr float kEditorGripStroke = 1.5f; static constexpr float kEditorGripOpacity = 0.7f; static constexpr float kEditorInsetX = 10; // 5 padding + 5 line fragment padding static constexpr float kEditorInsetY = 10; // 2 padding + 8 text container inset static constexpr float kEditorPlaceholderPadX = 5; static constexpr float kEditorPlaceholderPadY = 8; static constexpr float kEditorPlaceholderOpacity = 0.5f; static constexpr float kEditorMeasureInset = 10; // measuring Text padding h and v static constexpr float kEditorMaxHeight = 4000; // hard cap for the drag resize static constexpr float kEditorTapSlop = 4; static constexpr int kEditorMaxLines = 100000; // ---- SelectableTextPopover (INV-social 9) ---- static constexpr float kPopoverMaxWidth = 360; static constexpr float kPopoverMaxHeight = 400; static constexpr float kPopoverPadding = 20; static constexpr float kPopoverGap = 12; static constexpr float kPopoverIconGap = 16; static constexpr float kPopoverIconSize = 16; static constexpr float kPopoverMinTextWidth = 150; static constexpr std::size_t kPopoverMaxChars = 20000; // raw text shown in the popover static constexpr const char* kQuotePrefix = "> "; static constexpr const char* kQuoteSuffix = "\n\n"; static constexpr const char* kLabelFirstWord = "Select first word"; static constexpr const char* kLabelSelectAll = "Select all text"; static constexpr const char* kLabelCopy = "Copy to clipboard"; static constexpr const char* kLabelCloseSuggestions = "Close suggestions"; static constexpr const char* kLabelDelete = "Delete attachment"; static constexpr const char* kLabelQuote = "Insert as quote"; // ---- EmojiPicker (INV-social 20) ---- static constexpr float kEmojiCell = 44; static constexpr float kEmojiSpacing = 4; static constexpr float kEmojiPadding = 8; static constexpr float kEmojiFontSize = 30; static constexpr float kEmojiSectionGap = 12; static constexpr float kEmojiHeaderPadV = 4; static constexpr float kEmojiBarIcon = 16; static constexpr float kEmojiBarPadV = 10; static constexpr float kEmojiNoResultsTop = 40; static constexpr std::size_t kEmojiMaxSearchResults = 900; static constexpr std::size_t kEmojiMaxQueryChars = 64; static constexpr const char* kEmojiRecentTitle = "Recent"; static constexpr const char* kEmojiSearchPrompt = "Search Emoji"; static constexpr const char* kEmojiNoResults = "No emoji found"; static constexpr const char* kEmojiClose = "Close"; static constexpr const char* kEmojiScrollKey = "emoji-picker-scroll"; // ---- Attachment viewer (INV-social 17) ---- static constexpr float kPlayBadgeSize = 60; static constexpr float kVideoAspect = 16.0f / 9.0f; static constexpr float kZoomMin = 1; static constexpr float kZoomMax = 5; static constexpr float kZoomStep = 1.25f; static constexpr float kZoomWheelStep = 1.1f; static constexpr float kZoomButtonSize = 40; static constexpr int kViewerRasterPx = 2048; static constexpr int kInlineRasterPx = 800; static constexpr std::size_t kMaxAttachmentViews = 50; // hard cap per list static constexpr const char* kHostPrefix = "https://devplace.net"; static constexpr const char* kSaveTitle = "Image"; static constexpr const char* kDone = "Done"; static constexpr const char* kShareSave = "Save image..."; static constexpr const char* kShareCopy = "Copy link"; static constexpr const char* kCopied = "Link copied"; static constexpr const char* kSaved = "Image saved"; static constexpr const char* kSaveFailed = "Image could not be saved"; static constexpr const char* kA11yImage = "Image attachment. Tap to view fullscreen."; static constexpr const char* kA11yVideo = "Video attachment. Tap to play."; static constexpr std::size_t kMaxSaveBytes = 32u * 1024u * 1024u; // ---- AttachmentUploader (INV-social 18) ---- static constexpr float kUploaderRowSpacing = 10; static constexpr float kUploaderSmallIcon = 14; static constexpr std::size_t kMaxUploadFileBytes = 20u * 1024u * 1024u; // below NetLimits request cap static constexpr const char* kAddAttachment = "Add Attachment"; static constexpr const char* kPhotoLibrary = "Photo Library"; static constexpr const char* kFiles = "Files"; static constexpr const char* kFromUrl = "From URL"; static constexpr const char* kCancel = "Cancel"; static constexpr const char* kAddFromUrlTitle = "Add from URL"; static constexpr const char* kAddFromUrlMessage = "Enter the URL of the file to attach."; static constexpr const char* kUrlPlaceholder = "https://..."; static constexpr const char* kAdd = "Add"; static constexpr const char* kFallbackFilename = "file"; static constexpr const char* kFallbackMime = "application/octet-stream"; static constexpr const char* kFileRejected = "The file could not be read or is larger than 20 MB."; // ---- Mention suggestions (INV-social 19) ---- static constexpr unsigned kMentionDebounceMs = 300; static constexpr float kMentionMinHeight = 50; static constexpr float kMentionMaxHeight = 164; static constexpr float kMentionRadius = 14; static constexpr float kMentionRowPadH = 12; static constexpr float kMentionRowPadV = 8; static constexpr float kMentionRowSpacing = 10; static constexpr float kMentionBottomGap = 8; static constexpr float kMentionCloseInner = 7; static constexpr float kMentionCloseOuter = 4; static constexpr std::size_t kMentionMaxSuggestions = 50; static constexpr std::size_t kMentionMaxQueryChars = 64; // ---- CreatePost (INV-posts 4, 10) ---- static constexpr float kCreateSpacing = 14; static constexpr float kCreateCounterPadH = 11; static constexpr float kCreateFieldGap = 8; static constexpr float kPollSpacing = 10; static constexpr int kEditorInitialLines = 7; static constexpr std::size_t kMinPollOptions = 2; static constexpr std::size_t kMaxProjects = 200; static constexpr const char* kTitleCreate = "Create New Post"; static constexpr const char* kTitleEdit = "Edit Post"; static constexpr const char* kTopic = "Topic"; static constexpr const char* kTitlePlaceholder = "Title (optional)"; static constexpr const char* kMessagePlaceholder = "What's on your mind?"; static constexpr const char* kAddPoll = "Add Poll"; static constexpr const char* kRemovePoll = "Remove Poll"; static constexpr const char* kLinkToProject = "Link to Project"; static constexpr const char* kNone = "None"; static constexpr const char* kPollQuestion = "Poll question"; static constexpr const char* kPollOptionPrefix = "Option "; static constexpr const char* kAddOption = "Add option"; static constexpr const char* kClose = "Close"; static constexpr const char* kCreate = "Create"; static constexpr const char* kSave = "Save"; }; } // namespace dp::spec