@jjlmoya/utils-tabletop 1.5.0 → 1.6.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.
Files changed (46) hide show
  1. package/package.json +5 -3
  2. package/src/entries.ts +5 -1
  3. package/src/index.ts +2 -0
  4. package/src/tests/locale_completeness.test.ts +2 -1
  5. package/src/tests/tool_validation.test.ts +2 -1
  6. package/src/tool/investigation-board/bibliography.astro +16 -0
  7. package/src/tool/investigation-board/bibliography.ts +12 -0
  8. package/src/tool/investigation-board/boardContextMenu.ts +64 -0
  9. package/src/tool/investigation-board/client.ts +223 -0
  10. package/src/tool/investigation-board/component.astro +23 -0
  11. package/src/tool/investigation-board/components/BoardCanvas.astro +39 -0
  12. package/src/tool/investigation-board/components/CardDrawer.astro +73 -0
  13. package/src/tool/investigation-board/components/ConnectionModal.astro +49 -0
  14. package/src/tool/investigation-board/components/ContextMenu.astro +26 -0
  15. package/src/tool/investigation-board/components/ControlPanel.astro +57 -0
  16. package/src/tool/investigation-board/connectionModal.ts +60 -0
  17. package/src/tool/investigation-board/dom.ts +89 -0
  18. package/src/tool/investigation-board/drawer.ts +110 -0
  19. package/src/tool/investigation-board/entry.ts +59 -0
  20. package/src/tool/investigation-board/i18n/de.ts +126 -0
  21. package/src/tool/investigation-board/i18n/en.ts +127 -0
  22. package/src/tool/investigation-board/i18n/es.ts +126 -0
  23. package/src/tool/investigation-board/i18n/fr.ts +126 -0
  24. package/src/tool/investigation-board/i18n/id.ts +126 -0
  25. package/src/tool/investigation-board/i18n/it.ts +126 -0
  26. package/src/tool/investigation-board/i18n/ja.ts +126 -0
  27. package/src/tool/investigation-board/i18n/ko.ts +126 -0
  28. package/src/tool/investigation-board/i18n/nl.ts +126 -0
  29. package/src/tool/investigation-board/i18n/pl.ts +126 -0
  30. package/src/tool/investigation-board/i18n/pt.ts +126 -0
  31. package/src/tool/investigation-board/i18n/ru.ts +126 -0
  32. package/src/tool/investigation-board/i18n/sv.ts +126 -0
  33. package/src/tool/investigation-board/i18n/tr.ts +126 -0
  34. package/src/tool/investigation-board/i18n/zh.ts +126 -0
  35. package/src/tool/investigation-board/index.ts +11 -0
  36. package/src/tool/investigation-board/interactDrag.ts +58 -0
  37. package/src/tool/investigation-board/investigation-board.css +799 -0
  38. package/src/tool/investigation-board/layout.ts +16 -0
  39. package/src/tool/investigation-board/logic.test.ts +105 -0
  40. package/src/tool/investigation-board/logic.ts +106 -0
  41. package/src/tool/investigation-board/panzoom.ts +24 -0
  42. package/src/tool/investigation-board/renderer.ts +256 -0
  43. package/src/tool/investigation-board/seo.astro +16 -0
  44. package/src/tool/investigation-board/stateManager.ts +126 -0
  45. package/src/tool/investigation-board/types.ts +26 -0
  46. package/src/tools.ts +3 -0
@@ -0,0 +1,126 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { InvestigationBoardLocaleContent } from '../entry';
3
+
4
+ export const content: InvestigationBoardLocaleContent = {
5
+ slug: "konspirationsboard-skapare",
6
+ title: "Konspirationsboard Skapare",
7
+ description: "Skapa interaktiva konspirationsboards och utredningskartor. Koppla ihop karaktärer, ledtrådar, platser och spåra relationer med anpassade länkar.",
8
+ ui: {
9
+ "title": "Konspirationsboard Skapare",
10
+ "addCard": "Lägg till Kort",
11
+ "searchPlaceholder": "Sök kort efter namn eller ledtrådar",
12
+ "filterAll": "Alla Kategorier",
13
+ "filterCharacter": "Karaktärer",
14
+ "filterClue": "Ledtrådar",
15
+ "filterLocation": "Platser",
16
+ "filterItem": "Föremål",
17
+ "cardName": "Kortnamn",
18
+ "cardCategory": "Kategori",
19
+ "cardDescription": "Beskrivning",
20
+ "cardNotes": "Privata Anteckningar",
21
+ "cardTags": "Taggar separerade med komma",
22
+ "cardColor": "Markeringsfärg för Kort",
23
+ "save": "Spara Ändringar",
24
+ "delete": "Ta bort",
25
+ "cancel": "Avbryt",
26
+ "clearBoard": "Rensa Board",
27
+ "connectionsTitle": "Relationskarta",
28
+ "addConnection": "Lägg till Koppling",
29
+ "connectionLabel": "Relationsetikett",
30
+ "connectionColor": "Linjefärg",
31
+ "sourceCard": "Från Kort",
32
+ "targetCard": "Till Kort",
33
+ "close": "Stäng",
34
+ "character": "Karaktär",
35
+ "clue": "Ledtråd",
36
+ "location": "Plats",
37
+ "item": "Föremål",
38
+ "custom": "Anpassad",
39
+ "immersive": "Helskärm"
40
+ },
41
+ seo: [
42
+ { type: 'title', text: "Konspirationsboard Skapare för Tabletop och Detektiv RPG Spel", level: 2 },
43
+ { type: 'paragraph', html: "Skapa inlevelserika utredningskartor och konspirationsboards för dina rollspel. Dra och släpp ledtrådar, platser och karaktärer, och koppla ihop dem med anpassade trådar för att visualisera komplexa mysterier." },
44
+ {
45
+ type: 'stats',
46
+ items: [
47
+ { value: "Obegränsat", label: "Nodboard" },
48
+ { value: "4", label: "Kategorier" },
49
+ { value: "Dra och Släpp", label: "Gränssnitt" }
50
+ ],
51
+ columns: 3
52
+ },
53
+ { type: 'title', text: "Hur man bygger en utredningskarta", level: 2 },
54
+ { type: 'paragraph', html: "Lägg till anpassade kort för ledtrådar, karaktärer, föremål och platser. Dra dem på plats i rutnätet. Välj två kort för att länka dem med en färgad relationstråd. Dubbelklicka på noder eller trådar för detaljer." }
55
+ ],
56
+ faq: [
57
+ {
58
+ question: "Hur lägger jag till kopplingslinjer?",
59
+ answer: "Klicka på Lägg till Koppling i kontrollpanelen, välj start- och målkort, ange en textetikett samt färg, och spara."
60
+ },
61
+ {
62
+ question: "Kan jag dra kort på mobilen?",
63
+ answer: "Ja, tavlan stöder touch-händelser för att smidigt dra och flytta kort på smartphones och surfplattor."
64
+ }
65
+ ],
66
+ bibliography,
67
+ howTo: [
68
+ {
69
+ name: "Lägg till Utredningskort",
70
+ text: "Skapa kort som representerar NPC:er, ledtrådar, brottsplatser eller föremål."
71
+ },
72
+ {
73
+ name: "Koppla Relationer",
74
+ text: "Skapa kopplingslinjer mellan kort för att visa hur ledtrådar hänger ihop."
75
+ }
76
+ ],
77
+ schemas: [
78
+ {
79
+ '@context': 'https://schema.org',
80
+ '@type': 'SoftwareApplication',
81
+ 'name': "Konspirationsboard Skapare",
82
+ 'operatingSystem': 'All',
83
+ 'applicationCategory': 'UtilitiesApplication',
84
+ 'browserRequirements': 'Requires HTML5 SVG support. Requires JavaScript.'
85
+ },
86
+ {
87
+ '@context': 'https://schema.org',
88
+ '@type': 'FAQPage',
89
+ 'mainEntity': [
90
+ {
91
+ '@type': 'Question',
92
+ 'name': "Hur lägger jag till kopplingslinjer?",
93
+ 'acceptedAnswer': {
94
+ '@type': 'Answer',
95
+ 'text': "Klicka på Lägg till Koppling i kontrollpanelen, välj start- och målkort, ange en textetikett samt färg, och spara."
96
+ }
97
+ },
98
+ {
99
+ '@type': 'Question',
100
+ 'name': "Kan jag dra kort på mobilen?",
101
+ 'acceptedAnswer': {
102
+ '@type': 'Answer',
103
+ 'text': "Ja, tavlan stöder touch-händelser för att smidigt dra och flytta kort på smartphones och surfplattor."
104
+ }
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ '@context': 'https://schema.org',
110
+ '@type': 'HowTo',
111
+ 'name': "Hur man använder Konspirationsboard Skaparen",
112
+ 'step': [
113
+ {
114
+ '@type': 'HowToStep',
115
+ 'name': "Lägg till Utredningskort",
116
+ 'text': "Skapa kort som representerar NPC:er, ledtrådar, brottsplatser eller föremål."
117
+ },
118
+ {
119
+ '@type': 'HowToStep',
120
+ 'name': "Koppla Relationer",
121
+ 'text': "Skapa kopplingslinjer mellan kort för att visa hur ledtrådar hänger ihop."
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ };
@@ -0,0 +1,126 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { InvestigationBoardLocaleContent } from '../entry';
3
+
4
+ export const content: InvestigationBoardLocaleContent = {
5
+ slug: "komplo-tahtasi-yapici",
6
+ title: "Komplo Tahtası Yapıcı",
7
+ description: "Etkileşimli komplo tahtaları ve araştırma haritaları tasarlayın. Karakterleri, ipuçlarını, konumları ilişkilendirin ve özel bağlantılarla ilişkileri izleyin.",
8
+ ui: {
9
+ "title": "Komplo Tahtası Yapıcı",
10
+ "addCard": "Kart Ekle",
11
+ "searchPlaceholder": "Kartları isim veya ipucuna göre ara",
12
+ "filterAll": "Tüm Kategoriler",
13
+ "filterCharacter": "Karakterler",
14
+ "filterClue": "İpuçları",
15
+ "filterLocation": "Konumlar",
16
+ "filterItem": "Eşyalar",
17
+ "cardName": "Kart Adı",
18
+ "cardCategory": "Kategori",
19
+ "cardDescription": "Açıklama",
20
+ "cardNotes": "Özel Notlar",
21
+ "cardTags": "Virgülle ayrılmış etiketler",
22
+ "cardColor": "Kart Vurgu Rengi",
23
+ "save": "Değişiklikleri Kaydet",
24
+ "delete": "Sil",
25
+ "cancel": "İptal",
26
+ "clearBoard": "Tahtayı Temizle",
27
+ "connectionsTitle": "İlişki Haritası",
28
+ "addConnection": "Bağlantı Ekle",
29
+ "connectionLabel": "İlişki Etiketi",
30
+ "connectionColor": "Çizgi Rengi",
31
+ "sourceCard": "Başlangıç Kartı",
32
+ "targetCard": "Hedef Kart",
33
+ "close": "Kapat",
34
+ "character": "Karakter",
35
+ "clue": "İpucu",
36
+ "location": "Konum",
37
+ "item": "Eşya",
38
+ "custom": "Özel",
39
+ "immersive": "Tam Ekran"
40
+ },
41
+ seo: [
42
+ { type: 'title', text: "Masaüstü ve Dedektiflik RPG Oyunları için Komplo Tahtası Yapıcı", level: 2 },
43
+ { type: 'paragraph', html: "Masaüstü rol yapma oyunlarınız için sürükleyici araştırma haritaları ve komplo tahtaları oluşturun. İpuçlarını, konumları ve karakterleri sürükleyip bırakın, ardından karmaşık gizemleri görselleştirmek için bunları özel iplerle bağlayın." },
44
+ {
45
+ type: 'stats',
46
+ items: [
47
+ { value: "Sınırsız", label: "Düğüm Tahtası" },
48
+ { value: "4", label: "Kategorier" },
49
+ { value: "Sürükle ve Bırak", label: "Arayüz" }
50
+ ],
51
+ columns: 3
52
+ },
53
+ { type: 'title', text: "Araştırma Haritası Nasıl Oluşturulur", level: 2 },
54
+ { type: 'paragraph', html: "İpuçlarını, karakterleri, eşyaları ve konumları temsil eden özel kartlar ekleyin. Onları ızgara üzerindeki konumlara sürükleyin. İki kart seçerek onları renkli bir ilişki ipi ile bağlayın. Detayları görmek için düğümlere veya iplere çift tıklayın." }
55
+ ],
56
+ faq: [
57
+ {
58
+ question: "Bağlantı çizgilerini nasıl eklerim?",
59
+ answer: "Kontrol panelinde Bağlantı Ekle seçeneğine tıklayın, kaynak ve hedef kartları seçin, bir metin etiketi ve renk atayıp kaydedin."
60
+ },
61
+ {
62
+ question: "Kartları mobilde sürükleyebilir miyim?",
63
+ answer: "Evet, tahta akıllı telefonlarda ve tabletlerde kartları sorunsuz bir şekilde sürükleyip taşımak için dokunmatik hareketleri destekler."
64
+ }
65
+ ],
66
+ bibliography,
67
+ howTo: [
68
+ {
69
+ name: "Araştırma Kartları Ekle",
70
+ text: "NPC\\'leri, ipuçlarını, olay yerlerini veya eşyaları temsil eden kartlar oluşturun."
71
+ },
72
+ {
73
+ name: "İlişkileri Bağla",
74
+ text: "İpuçlarının birbiriyle ilişkisini göstermek için kartlar arasında bağlantı çizgileri oluşturun."
75
+ }
76
+ ],
77
+ schemas: [
78
+ {
79
+ '@context': 'https://schema.org',
80
+ '@type': 'SoftwareApplication',
81
+ 'name': "Komplo Tahtası Yapıcı",
82
+ 'operatingSystem': 'All',
83
+ 'applicationCategory': 'UtilitiesApplication',
84
+ 'browserRequirements': 'Requires HTML5 SVG support. Requires JavaScript.'
85
+ },
86
+ {
87
+ '@context': 'https://schema.org',
88
+ '@type': 'FAQPage',
89
+ 'mainEntity': [
90
+ {
91
+ '@type': 'Question',
92
+ 'name': "Bağlantı çizgilerini nasıl eklerim?",
93
+ 'acceptedAnswer': {
94
+ '@type': 'Answer',
95
+ 'text': "Kontrol panelinde Bağlantı Ekle seçeneğine tıklayın, kaynak ve hedef kartları seçin, bir metin etiketi ve renk atayıp kaydedin."
96
+ }
97
+ },
98
+ {
99
+ '@type': 'Question',
100
+ 'name': "Kartları mobilde sürükleyebilir miyim?",
101
+ 'acceptedAnswer': {
102
+ '@type': 'Answer',
103
+ 'text': "Evet, tahta akıllı telefonlarda ve tabletlerde kartları sorunsuz bir şekilde sürükleyip taşımak için dokunmatik hareketleri destekler."
104
+ }
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ '@context': 'https://schema.org',
110
+ '@type': 'HowTo',
111
+ 'name': "Komplo Tahtası Yapıcı Nasıl Kullanılır",
112
+ 'step': [
113
+ {
114
+ '@type': 'HowToStep',
115
+ 'name': "Araştırma Kartları Ekle",
116
+ 'text': "NPC\\'leri, ipuçlarını, olay yerlerini veya eşyaları temsil eden kartlar oluşturun."
117
+ },
118
+ {
119
+ '@type': 'HowToStep',
120
+ 'name': "İlişkileri Bağla",
121
+ 'text': "İpuçlarının birbiriyle ilişkisini göstermek için kartlar arasında bağlantı çizgileri oluşturun."
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ };
@@ -0,0 +1,126 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { InvestigationBoardLocaleContent } from '../entry';
3
+
4
+ export const content: InvestigationBoardLocaleContent = {
5
+ slug: "investigation-board",
6
+ title: "线索墙制作器",
7
+ description: "设计互动式线索墙 and 调查地图。连接角色、线索、地点,并用自定义线段追踪关系。",
8
+ ui: {
9
+ "title": "线索墙制作器",
10
+ "addCard": "添加卡片",
11
+ "searchPlaceholder": "按名称或线索搜索卡片",
12
+ "filterAll": "所有类别",
13
+ "filterCharacter": "角色",
14
+ "filterClue": "线索",
15
+ "filterLocation": "地点",
16
+ "filterItem": "物品",
17
+ "cardName": "卡片名称",
18
+ "cardCategory": "类别",
19
+ "cardDescription": "描述",
20
+ "cardNotes": "私人备注",
21
+ "cardTags": "用逗号分隔的标签",
22
+ "cardColor": "卡片高亮颜色",
23
+ "save": "保存修改",
24
+ "delete": "删除",
25
+ "cancel": "取消",
26
+ "clearBoard": "清空画板",
27
+ "connectionsTitle": "关系网地图",
28
+ "addConnection": "添加连接",
29
+ "connectionLabel": "关系标签",
30
+ "connectionColor": "线段颜色",
31
+ "sourceCard": "起始卡片",
32
+ "targetCard": "目标卡片",
33
+ "close": "关闭",
34
+ "character": "角色",
35
+ "clue": "线索",
36
+ "location": "地点",
37
+ "item": "物品",
38
+ "custom": "自定义",
39
+ "immersive": "全屏模式"
40
+ },
41
+ seo: [
42
+ { type: 'title', text: "跑团与侦探角色扮演游戏的线索墙制作器", level: 2 },
43
+ { type: 'paragraph', html: "为您的桌面角色扮演游戏创建沉浸式调查地图和线索墙。拖放线索、地点和角色,然后用自定义的线段将它们连接起来,使复杂的谜题可视化。" },
44
+ {
45
+ type: 'stats',
46
+ items: [
47
+ { value: "无限制", label: "节点画板" },
48
+ { value: "4", label: "类别数量" },
49
+ { value: "拖放操作", label: "交互界面" }
50
+ ],
51
+ columns: 3
52
+ },
53
+ { type: 'title', text: "如何构建调查地图", level: 2 },
54
+ { type: 'paragraph', html: "添加代表线索、角色、物品和地点的自定义卡片。将它们拖动到网格中的对应位置。选择两张卡片,用彩色关系线将它们链接起来。双击节点或连接线以查看详细信息。" }
55
+ ],
56
+ faq: [
57
+ {
58
+ question: "如何添加连接线?",
59
+ answer: "点击控制面板中的添加连接,选择起始和目标卡片,指定文本标签和颜色,然后保存。"
60
+ },
61
+ {
62
+ question: "我可以在手机上拖动卡片吗?",
63
+ answer: "可以,画板支持触摸事件,可以在智能手机和平板电脑上流畅地拖动和移动卡片。"
64
+ }
65
+ ],
66
+ bibliography,
67
+ howTo: [
68
+ {
69
+ name: "添加调查卡片",
70
+ text: "创建代表NPC、线索、案发现场或物品的卡片。"
71
+ },
72
+ {
73
+ name: "链接关系",
74
+ text: "在卡片之间创建连接线,以显示线索之间的关联。"
75
+ }
76
+ ],
77
+ schemas: [
78
+ {
79
+ '@context': 'https://schema.org',
80
+ '@type': 'SoftwareApplication',
81
+ 'name': "线索墙制作器",
82
+ 'operatingSystem': 'All',
83
+ 'applicationCategory': 'UtilitiesApplication',
84
+ 'browserRequirements': 'Requires HTML5 SVG support. Requires JavaScript.'
85
+ },
86
+ {
87
+ '@context': 'https://schema.org',
88
+ '@type': 'FAQPage',
89
+ 'mainEntity': [
90
+ {
91
+ '@type': 'Question',
92
+ 'name': "如何添加连接线?",
93
+ 'acceptedAnswer': {
94
+ '@type': 'Answer',
95
+ 'text': "点击控制面板中的添加连接,选择起始和目标卡片,指定文本标签和颜色,然后保存。"
96
+ }
97
+ },
98
+ {
99
+ '@type': 'Question',
100
+ 'name': "我可以在手机上拖动卡片吗?",
101
+ 'acceptedAnswer': {
102
+ '@type': 'Answer',
103
+ 'text': "可以,画板支持触摸事件,可以在智能手机和平板电脑上流畅地拖动和移动卡片。"
104
+ }
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ '@context': 'https://schema.org',
110
+ '@type': 'HowTo',
111
+ 'name': "线索墙制作器使用方法",
112
+ 'step': [
113
+ {
114
+ '@type': 'HowToStep',
115
+ 'name': "添加调查卡片",
116
+ 'text': "创建代表NPC、线索、案发现场或物品的卡片。"
117
+ },
118
+ {
119
+ '@type': 'HowToStep',
120
+ 'name': "链接关系",
121
+ 'text': "在卡片之间创建连接线,以显示线索之间的关联。"
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ };
@@ -0,0 +1,11 @@
1
+ import type { ToolDefinition } from '../../types';
2
+ import { investigationBoard } from './entry';
3
+
4
+ export * from './entry';
5
+
6
+ export const INVESTIGATION_BOARD_TOOL: ToolDefinition = {
7
+ entry: investigationBoard,
8
+ Component: () => import('./component.astro'),
9
+ SEOComponent: () => import('./seo.astro'),
10
+ BibliographyComponent: () => import('./bibliography.astro'),
11
+ };
@@ -0,0 +1,58 @@
1
+ import interact from 'interactjs';
2
+ import { state } from './dom';
3
+ import { getHighlightPath } from './logic';
4
+ import { drawConnections } from './renderer';
5
+ import { adjustBoardSize } from './layout';
6
+ import { saveState } from './stateManager';
7
+ import { cancelLongPress } from './boardContextMenu';
8
+
9
+ interface DragEvent {
10
+ target: HTMLElement;
11
+ dx: number;
12
+ dy: number;
13
+ }
14
+
15
+ function handleDragStart(event: DragEvent): void {
16
+ cancelLongPress();
17
+ event.target.classList.add('dragging');
18
+ }
19
+
20
+ function handleDragMove(event: DragEvent): void {
21
+ cancelLongPress();
22
+ const target = event.target;
23
+ const id = target.id.replace('node-', '');
24
+ const n = state.nodes.find((item) => item.id === id);
25
+ if (n) {
26
+ let newX = n.x + event.dx / state.zoomScale;
27
+ let newY = n.y + event.dy / state.zoomScale;
28
+ newX = Math.round(newX / 15) * 15;
29
+ newY = Math.round(newY / 15) * 15;
30
+ n.x = newX;
31
+ n.y = newY;
32
+ target.style.left = `${newX}px`;
33
+ target.style.top = `${newY}px`;
34
+ const highlight = state.highlightedNodeId
35
+ ? getHighlightPath(state.connections, state.highlightedNodeId)
36
+ : null;
37
+ drawConnections(highlight);
38
+ adjustBoardSize();
39
+ }
40
+ }
41
+
42
+ function handleDragEnd(event: DragEvent): void {
43
+ const target = event.target;
44
+ target.classList.remove('dragging');
45
+ saveState();
46
+ adjustBoardSize();
47
+ }
48
+
49
+ export function initializeDrag(): void {
50
+ interact('.board-node').draggable({
51
+ inertia: true,
52
+ listeners: {
53
+ start: (event: DragEvent) => handleDragStart(event),
54
+ move: (event: DragEvent) => handleDragMove(event),
55
+ end: (event: DragEvent) => handleDragEnd(event),
56
+ },
57
+ });
58
+ }