Skip to content

Commit d76ed49

Browse files
committed
Merge branch 'ci/pr-conflicts-tagger' into chore/all-my-stuffs
# Conflicts: # components.d.ts # src/tools/index.ts
2 parents 0b1b98f + f07687b commit d76ed49

File tree

6 files changed

+69
-0
lines changed

6 files changed

+69
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Pull Requests Merge Conflicts Tagger"
2+
on:
3+
# So that PRs touching the same files as the push are updated
4+
push:
5+
# So that the `dirtyLabel` is removed if conflicts are resolve
6+
# We recommend `pull_request_target` so that github secrets are available.
7+
# In `pull_request` we wouldn't be able to change labels of fork PRs
8+
pull_request_target:
9+
types: [synchronize]
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: check if prs are dirty
16+
uses: eps1lon/actions-label-merge-conflict@v3
17+
with:
18+
dirtyLabel: "PR: needs rebase"
19+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
20+
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
21+
# commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly."

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"release": "node ./scripts/release.mjs"
3737
},
3838
"dependencies": {
39+
"@github/paste-markdown": "^1.5.3",
3940
"@it-tools/bip39": "^0.0.4",
4041
"@it-tools/oggen": "^1.3.0",
4142
"@regexper/render": "^1.0.0",

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { tool as jsonToXml } from './json-to-xml';
1212
import { tool as regexTester } from './regex-tester';
1313
import { tool as regexMemo } from './regex-memo';
1414
import { tool as markdownToHtml } from './markdown-to-html';
15+
import { tool as pasteAsMarkdown } from './paste-as-markdown';
1516
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1617
import { tool as numeronymGenerator } from './numeronym-generator';
1718
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -184,6 +185,7 @@ export const toolsByCategory: ToolCategory[] = [
184185
textDiff,
185186
numeronymGenerator,
186187
asciiTextDrawer,
188+
pasteAsMarkdown,
187189
],
188190
},
189191
{

src/tools/paste-as-markdown/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Markdown } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Paste as Markdown',
6+
path: '/paste-as-markdown',
7+
description: 'Paste cells/tables and links from clipboard content as Markdown',
8+
keywords: ['paste', 'cell', 'table', 'links', 'md', 'markdown'],
9+
component: () => import('./paste-as-markdown.vue'),
10+
icon: Markdown,
11+
createdAt: new Date('2024-07-14'),
12+
});
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<script setup lang="ts">
2+
import { subscribe } from '@github/paste-markdown';
3+
import CInputText from '@/ui/c-input-text/c-input-text.vue';
4+
5+
const inputElement = ref<typeof CInputText>();
6+
const markdown = ref('');
7+
8+
// Subscribe the behavior to the textarea.
9+
onMounted(() => {
10+
subscribe(inputElement.value?.textareaRef as never);
11+
});
12+
</script>
13+
14+
<template>
15+
<c-card title="Paste in Markdown" class="paste-zone">
16+
<n-ul>
17+
<n-li>Paste spreadsheet cells and HTML tables as a Markdown tables.</n-li>
18+
<n-li>Paste URLs on selected text as Markdown links.</n-li>
19+
<n-li>Paste text containing links as text containing Markdown links.</n-li>
20+
<n-li>Paste image URLs as Markdown image links.</n-li>
21+
</n-ul>
22+
<CInputText
23+
ref="inputElement"
24+
v-model:value="markdown"
25+
multiline
26+
placeholder="Paste your content here..."
27+
rows="10"
28+
w-full
29+
/>
30+
</c-card>
31+
</template>

src/ui/c-input-text/c-input-text.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ onMounted(() => {
137137
138138
defineExpose({
139139
inputWrapperRef,
140+
textareaRef,
141+
inputRef,
140142
focus,
141143
blur,
142144
});

0 commit comments

Comments
 (0)