@notis_ai/cli 0.2.0-beta.144.1 → 0.2.0-beta.146.1
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.
package/package.json
CHANGED
|
@@ -51,7 +51,7 @@ function DocumentEditorFallback({ documentId, variant = 'full', className }: Not
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const isMarkdown = document.contentType
|
|
54
|
+
const isMarkdown = document.contentType === 'markdown' || !document.contentType;
|
|
55
55
|
return (
|
|
56
56
|
<div className={className}>
|
|
57
57
|
{variant === 'full' ? <h1 style={fallbackTitleStyle}>{document.title}</h1> : null}
|
|
@@ -62,6 +62,15 @@ function DocumentEditorFallback({ documentId, variant = 'full', className }: Not
|
|
|
62
62
|
<p style={fallbackNoticeStyle}>Read-only preview — editing is available inside the Notis portal.</p>
|
|
63
63
|
)}
|
|
64
64
|
</>
|
|
65
|
+
) : document.contentType === 'view' ? (
|
|
66
|
+
<div style={fallbackFrameStyle}>
|
|
67
|
+
{document.viewType === 'report'
|
|
68
|
+
? 'Interactive report'
|
|
69
|
+
: document.viewType === 'html'
|
|
70
|
+
? 'Interactive HTML document'
|
|
71
|
+
: 'View document'} — open it in Notis Documents for
|
|
72
|
+
the full native experience.
|
|
73
|
+
</div>
|
|
65
74
|
) : (
|
|
66
75
|
<div style={fallbackFrameStyle}>
|
|
67
76
|
{document.fileType ? `${document.fileType.toUpperCase()} document` : 'File document'} — open it in
|
|
@@ -76,8 +85,9 @@ function DocumentEditorFallback({ documentId, variant = 'full', className }: Not
|
|
|
76
85
|
* Embeds the document editor for a document anywhere in an app view. The host
|
|
77
86
|
* (portal) provides the implementation through `runtime.ui.DocumentEditor` and
|
|
78
87
|
* dispatches on the document's content type (markdown -> rich text editor,
|
|
79
|
-
* files -> matching viewer
|
|
80
|
-
* preview
|
|
88
|
+
* files -> matching viewer, views -> their trusted native Documents surface).
|
|
89
|
+
* Outside the portal this falls back to a read-only preview or an explicit
|
|
90
|
+
* open-in-Documents notice for native views.
|
|
81
91
|
*
|
|
82
92
|
* ```tsx
|
|
83
93
|
* <DocumentEditor documentId={entry.id} variant="body" className="min-h-[320px]" />
|
|
@@ -107,7 +107,7 @@ export function normalizePropertyValue(value: unknown): unknown {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function normalizeContentType(value: unknown): DocumentContentType | null {
|
|
110
|
-
return value === 'markdown' || value === 'file' ? value : null;
|
|
110
|
+
return value === 'markdown' || value === 'file' || value === 'view' ? value : null;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -140,6 +140,12 @@ export function normalizeDocumentRecord(value: unknown): DocumentRecord {
|
|
|
140
140
|
: null,
|
|
141
141
|
contentMarkdown: optionalString(record.contentMarkdown) ?? optionalString(record.content_markdown),
|
|
142
142
|
plainText: optionalString(record.plainText) ?? optionalString(record.plain_text),
|
|
143
|
+
viewType: optionalString(record.viewType) ?? optionalString(record.view_type),
|
|
144
|
+
viewState: asRecord(record.viewState) ?? asRecord(record.view_state),
|
|
145
|
+
viewRevision:
|
|
146
|
+
typeof (record.viewRevision ?? record.view_revision) === 'number'
|
|
147
|
+
? Number(record.viewRevision ?? record.view_revision)
|
|
148
|
+
: null,
|
|
143
149
|
createdAt:
|
|
144
150
|
optionalString(record.createdAt)
|
|
145
151
|
?? optionalString(record.created_at)
|
|
@@ -71,7 +71,7 @@ export interface DatabaseDescriptor {
|
|
|
71
71
|
* (pdf, xlsx, pptx, ...). Future content types (canvas, ...) extend this
|
|
72
72
|
* union without changing the component contracts.
|
|
73
73
|
*/
|
|
74
|
-
export type DocumentContentType = 'markdown' | 'file';
|
|
74
|
+
export type DocumentContentType = 'markdown' | 'file' | 'view';
|
|
75
75
|
|
|
76
76
|
export interface DocumentRecord {
|
|
77
77
|
id: string;
|
|
@@ -86,6 +86,9 @@ export interface DocumentRecord {
|
|
|
86
86
|
contentBlocknote?: Array<Record<string, unknown>> | null;
|
|
87
87
|
contentMarkdown?: string | null;
|
|
88
88
|
plainText?: string | null;
|
|
89
|
+
viewType?: string | null;
|
|
90
|
+
viewState?: Record<string, unknown> | null;
|
|
91
|
+
viewRevision?: number | null;
|
|
89
92
|
createdAt?: string | null;
|
|
90
93
|
lastEditedTime?: string | null;
|
|
91
94
|
}
|