mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-30 21:45:01 +02:00
Reuse one metadata interface (#10444)
* Reuse one metadata interface Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix imports Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -16,19 +16,7 @@ import { markdownToMarkup } from '@hcengineering/text-markdown'
|
||||
import { Extension } from '@tiptap/core'
|
||||
import { Fragment, Node } from '@tiptap/pm/model'
|
||||
import { Plugin } from '@tiptap/pm/state'
|
||||
|
||||
// TableMetadata type - matches the definition in @hcengineering/view-resources
|
||||
// Defined here to avoid circular dependency (view-resources depends on text-editor-resources)
|
||||
interface TableMetadata {
|
||||
version: string
|
||||
cardClass: string
|
||||
viewletId?: string
|
||||
config?: Array<string | Record<string, any>>
|
||||
query?: Record<string, any>
|
||||
documentIds: string[]
|
||||
timestamp: number
|
||||
workspace?: string
|
||||
}
|
||||
import type { TableMetadata } from '@hcengineering/view'
|
||||
|
||||
export const TableMetadataPasteExtension = Extension.create({
|
||||
name: 'tableMetadataPaste',
|
||||
|
||||
+1
-2
@@ -18,9 +18,8 @@
|
||||
import presentation, { Card } from '@hcengineering/presentation'
|
||||
import textEditor from '@hcengineering/text-editor'
|
||||
import { Component, Loading } from '@hcengineering/ui'
|
||||
import type { BuildModelKey, Viewlet } from '@hcengineering/view'
|
||||
import type { BuildModelKey, TableMetadata, Viewlet } from '@hcengineering/view'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import type { TableMetadata } from '../tableMetadata'
|
||||
|
||||
import TableSourceInfo from './TableSourceInfo.svelte'
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
import presentation, { Card } from '@hcengineering/presentation'
|
||||
import textEditor from '@hcengineering/text-editor'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import type { TableMetadata } from '../tableMetadata'
|
||||
import type { TableMetadata } from '@hcengineering/view'
|
||||
|
||||
import MarkupDiffViewer from '../../../MarkupDiffViewer.svelte'
|
||||
import TableSourceInfo from './TableSourceInfo.svelte'
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
import textEditor from '@hcengineering/text-editor'
|
||||
import { Button } from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import type { TableMetadata } from '../tableMetadata'
|
||||
import type { TableMetadata } from '@hcengineering/view'
|
||||
|
||||
import MarkupDiffViewer from '../../../MarkupDiffViewer.svelte'
|
||||
import TableSourceInfo from './TableSourceInfo.svelte'
|
||||
|
||||
+1
-2
@@ -17,9 +17,8 @@
|
||||
import core from '@hcengineering/core'
|
||||
import { IconWithEmoji, getClient } from '@hcengineering/presentation'
|
||||
import ui, { Icon, Label } from '@hcengineering/ui'
|
||||
import view from '@hcengineering/view'
|
||||
import view, { type TableMetadata } from '@hcengineering/view'
|
||||
import textEditor from '@hcengineering/text-editor'
|
||||
import type { TableMetadata } from '../tableMetadata'
|
||||
|
||||
export let metadata: TableMetadata
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import { type Node } from '@tiptap/pm/model'
|
||||
import { TableMap } from '@tiptap/pm/tables'
|
||||
import type { Client } from '@hcengineering/core'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import type { TableMetadata } from '@hcengineering/view'
|
||||
import { buildMarkdownTableFromDocs } from '../refreshTable'
|
||||
import type { TableMetadata } from '../tableMetadata'
|
||||
|
||||
/**
|
||||
* Extract markdown string from a ProseMirror table node
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
|
||||
import type { Client, Doc } from '@hcengineering/core'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import view, { type BuildMarkdownTableMetadata } from '@hcengineering/view'
|
||||
import type { TableMetadata } from './tableMetadata'
|
||||
import view, { type BuildMarkdownTableMetadata, type TableMetadata } from '@hcengineering/view'
|
||||
|
||||
/**
|
||||
* Build markdown table string from documents and metadata
|
||||
|
||||
@@ -13,16 +13,7 @@
|
||||
//
|
||||
|
||||
import type { Node } from '@tiptap/pm/model'
|
||||
import type { BuildMarkdownTableMetadata } from '@hcengineering/view'
|
||||
|
||||
// Extended TableMetadata for text editor storage (includes additional fields for persistence)
|
||||
export interface TableMetadata extends BuildMarkdownTableMetadata {
|
||||
version: string
|
||||
documentIds: string[]
|
||||
timestamp: number
|
||||
workspace?: string
|
||||
originalUrl?: string // Original URL of the page/view where the table was created
|
||||
}
|
||||
import type { TableMetadata } from '@hcengineering/view'
|
||||
|
||||
/**
|
||||
* Extract table metadata from a ProseMirror table node
|
||||
|
||||
Reference in New Issue
Block a user