mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
feat(manacore/web): add tag junction tables and stores for all 23 modules
Every module now has a tag junction table in IndexedDB and a tag store with createTagLinkOps for consistent tag-entity linking. Tags are shared globally via globalTags; each module only manages its own junctions. New junction tables: eventTags, contactTags, conversationTags, deckTags, zitareListTags, songTags, presiDeckTags, invItemTags, skillTags, ccLocationTags, entryTags, documentTags, questionTags, mealTags, plantTags, moodTags, guideTags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
be20de23db
commit
d49a3d727d
17 changed files with 314 additions and 3 deletions
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Ucalendar Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const eventTagOps = createTagLinkOps({
|
||||
table: () => db.table('eventTags'),
|
||||
entityIdField: 'eventId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Ucards Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const deckTagOps = createTagLinkOps({
|
||||
table: () => db.table('deckTags'),
|
||||
entityIdField: 'deckId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Uchat Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const conversationTagOps = createTagLinkOps({
|
||||
table: () => db.table('conversationTags'),
|
||||
entityIdField: 'conversationId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Ucitycorners Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const locationTagOps = createTagLinkOps({
|
||||
table: () => db.table('ccLocationTags'),
|
||||
entityIdField: 'locationId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Ucontacts Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const contactTagOps = createTagLinkOps({
|
||||
table: () => db.table('contactTags'),
|
||||
entityIdField: 'contactId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Ucontext Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const documentTagOps = createTagLinkOps({
|
||||
table: () => db.table('documentTags'),
|
||||
entityIdField: 'documentId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Guides Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const guideTagOps = createTagLinkOps({
|
||||
table: () => db.table('guideTags'),
|
||||
entityIdField: 'guideId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Uinventar Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const itemTagOps = createTagLinkOps({
|
||||
table: () => db.table('invItemTags'),
|
||||
entityIdField: 'itemId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Umoodlit Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const moodTagOps = createTagLinkOps({
|
||||
table: () => db.table('moodTags'),
|
||||
entityIdField: 'moodId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Umukke Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const songTagOps = createTagLinkOps({
|
||||
table: () => db.table('songTags'),
|
||||
entityIdField: 'songId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Unutriphi Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const mealTagOps = createTagLinkOps({
|
||||
table: () => db.table('mealTags'),
|
||||
entityIdField: 'mealId',
|
||||
});
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
/**
|
||||
* Tag Store — Local-First via Shared Tag Store
|
||||
* Tags are stored in shared IndexedDB ('manacore-tags'), accessible across all apps.
|
||||
* Use context ('tags') for reads, tagMutations for writes.
|
||||
* Planta Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
|
|
@ -11,3 +13,8 @@ export {
|
|||
getTagColor,
|
||||
getTagsByGroup,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const plantTagOps = createTagLinkOps({
|
||||
table: () => db.table('plantTags'),
|
||||
entityIdField: 'plantId',
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Upresi Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const deckTagOps = createTagLinkOps({
|
||||
table: () => db.table('presiDeckTags'),
|
||||
entityIdField: 'deckId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Uquestions Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const questionTagOps = createTagLinkOps({
|
||||
table: () => db.table('questionTags'),
|
||||
entityIdField: 'questionId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Uskilltree Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const skillTagOps = createTagLinkOps({
|
||||
table: () => db.table('skillTags'),
|
||||
entityIdField: 'skillId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Utimes Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const entryTagOps = createTagLinkOps({
|
||||
table: () => db.table('entryTags'),
|
||||
entityIdField: 'entryId',
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Uzitare Tags — Uses shared global tags + module-specific junction table.
|
||||
*/
|
||||
|
||||
import { db } from '$lib/data/database';
|
||||
import { createTagLinkOps } from '@manacore/shared-stores';
|
||||
|
||||
export {
|
||||
tagMutations,
|
||||
useAllTags,
|
||||
getTagById,
|
||||
getTagsByIds,
|
||||
getTagColor,
|
||||
} from '@manacore/shared-stores';
|
||||
|
||||
export const listTagOps = createTagLinkOps({
|
||||
table: () => db.table('zitareListTags'),
|
||||
entityIdField: 'listId',
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue