diff --git a/apps/ui/src/app.css b/apps/ui/src/app.css index ed068a3..8520868 100644 --- a/apps/ui/src/app.css +++ b/apps/ui/src/app.css @@ -392,13 +392,13 @@ border-radius: 3px; } -.mrkdwn .s-emoji { +.mrkdwn .c-emoji { font-style: normal; position: relative; cursor: default; } -.mrkdwn .s-emoji-tip { +.mrkdwn .c-emoji__tooltip { visibility: hidden; opacity: 0; position: absolute; @@ -422,7 +422,7 @@ z-index: 10; } -.mrkdwn .s-emoji-tip::after { +.mrkdwn .c-emoji__tooltip::after { content: ''; position: absolute; top: 100%; @@ -432,17 +432,17 @@ border-top-color: #38393d; } -.mrkdwn .s-emoji-big { - font-size: 48px; +.mrkdwn .c-emoji__tooltip-big { + font-size: 64px; line-height: 1.2; } -.mrkdwn .s-emoji-code { +.mrkdwn .c-emoji__tooltip-code { font-size: 12px; color: #ababad; } -.mrkdwn .s-emoji:hover .s-emoji-tip { +.mrkdwn .c-emoji:hover .c-emoji__tooltip { visibility: visible; opacity: 1; } diff --git a/apps/ui/src/components/blockkit/BlockKitRenderer.svelte b/apps/ui/src/components/blockkit/BlockKitRenderer.svelte index 1b3887b..77d6696 100644 --- a/apps/ui/src/components/blockkit/BlockKitRenderer.svelte +++ b/apps/ui/src/components/blockkit/BlockKitRenderer.svelte @@ -68,46 +68,55 @@ } -
+
{#each blocks as block, index (getBlockId(block, index))} - {#if block.type === 'section'} - - {:else if block.type === 'input'} - - {:else if block.type === 'actions'} - - {:else if block.type === 'divider'} - - {:else if block.type === 'context'} - - {:else if block.type === 'image'} - - {:else if block.type === 'header'} - - {:else if block.type === 'rich_text'} - - {:else if block.type === 'table'} - - {:else if block.type === 'context_actions'} - - {:else} - - {@const unknownBlock = block as { type: string }} -
- Unknown block type: {unknownBlock.type} -
- {/if} +
+ {#if block.type === 'section'} + + {:else if block.type === 'input'} + + {:else if block.type === 'actions'} + + {:else if block.type === 'divider'} + + {:else if block.type === 'context'} + + {:else if block.type === 'image'} + + {:else if block.type === 'header'} + + {:else if block.type === 'rich_text'} + + {:else if block.type === 'table'} + + {:else if block.type === 'context_actions'} + + {:else} + + {@const unknownBlock = block as { type: string }} +
+ Unknown block type: {unknownBlock.type} +
+ {/if} +
{/each}
+ + diff --git a/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte b/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte index 4cb7380..c13d146 100644 --- a/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte @@ -29,74 +29,83 @@ let { block, onAction }: Props = $props() -
- {#each block.elements as element, i (i)} - {#if element.type === 'button'} -
- {:else if element.type === 'checkboxes'} - {@const cb = element as SlackCheckboxesElement} -
- - onAction?.( - cb.action_id, - JSON.stringify( - options.map((o) => ({ text: o.text, value: o.value })) - ) - )} - /> -
- {:else if element.type === 'datepicker'} - {@const dp = element as SlackDatePickerElement} - onAction?.(dp.action_id, val)} - /> - {:else if element.type === 'timepicker'} - {@const tp = element as SlackTimePickerElement} - onAction?.(tp.action_id, val)} - /> - {:else if element.type === 'datetimepicker'} - {@const dtp = element as SlackDateTimePickerElement} - onAction?.(dtp.action_id, val)} - /> - {/if} - {/each} + {/each} +
+ + diff --git a/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte b/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte index f3a3938..8d6ecec 100644 --- a/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte @@ -18,7 +18,7 @@ } -
+
{#each block.elements as element, i (i)} {#if element.type === 'feedback_buttons'} {@const fb = element as SlackFeedbackButtonsElement} @@ -58,6 +58,13 @@
diff --git a/apps/ui/src/components/blockkit/blocks/SectionBlock.svelte b/apps/ui/src/components/blockkit/blocks/SectionBlock.svelte index 5c8f2a6..fe85b33 100644 --- a/apps/ui/src/components/blockkit/blocks/SectionBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/SectionBlock.svelte @@ -98,11 +98,7 @@ {:else if block.accessory.type === 'users_select' || block.accessory.type === 'conversations_select' || block.accessory.type === 'channels_select' || block.accessory.type === 'external_select' || block.accessory.type === 'multi_users_select' || block.accessory.type === 'multi_conversations_select' || block.accessory.type === 'multi_channels_select' || block.accessory.type === 'multi_external_select'} {@const ws = block.accessory as SlackWorkspaceSelectElement}
- onAction?.(ws.action_id, value)} - /> +
{:else if block.accessory.type === 'image'} { + return resolveEmoji(name) ?? `:${name}:` + }) } /** diff --git a/apps/ui/src/components/blockkit/elements/Button.svelte b/apps/ui/src/components/blockkit/elements/Button.svelte index eb8745f..7bdefd1 100644 --- a/apps/ui/src/components/blockkit/elements/Button.svelte +++ b/apps/ui/src/components/blockkit/elements/Button.svelte @@ -36,12 +36,11 @@