@bernierllc/content-editor-ui 0.4.2 → 0.4.4
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/README.md +31 -13
- package/dist/content-editor.d.ts +12 -0
- package/dist/content-editor.d.ts.map +1 -0
- package/dist/content-editor.js +523 -0
- package/dist/content-editor.js.map +1 -0
- package/dist/editor-components.d.ts +72 -0
- package/dist/editor-components.d.ts.map +1 -0
- package/dist/editor-components.js +138 -0
- package/dist/editor-components.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +336 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EditorContentType } from './types.js';
|
|
3
|
+
interface ContentTypeDisplay {
|
|
4
|
+
icon: string | undefined;
|
|
5
|
+
description: string | undefined;
|
|
6
|
+
category: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Read display fields from either shape. `ContentTypeDefinition` keeps icon/description
|
|
10
|
+
* at the top level; the deprecated 0.4.x shape kept them under `metadata`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getContentTypeDisplay(contentType: EditorContentType): ContentTypeDisplay;
|
|
13
|
+
/**
|
|
14
|
+
* Content type selector component
|
|
15
|
+
*/
|
|
16
|
+
export interface ContentTypeSelectorProps<T extends EditorContentType = EditorContentType> {
|
|
17
|
+
/** Available content types */
|
|
18
|
+
contentTypes: T[];
|
|
19
|
+
/** Selected content type */
|
|
20
|
+
selectedType?: T;
|
|
21
|
+
/** Content type change callback */
|
|
22
|
+
onChange: (contentType: T) => void;
|
|
23
|
+
/** Whether selector is disabled */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Custom placeholder */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Whether to show descriptions */
|
|
28
|
+
showDescriptions?: boolean;
|
|
29
|
+
/** Whether to show icons */
|
|
30
|
+
showIcons?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const ContentTypeSelector: <T extends EditorContentType>({ contentTypes, selectedType, onChange, disabled, placeholder, showDescriptions, showIcons }: ContentTypeSelectorProps<T>) => React.ReactElement;
|
|
33
|
+
/**
|
|
34
|
+
* Media uploader component
|
|
35
|
+
*/
|
|
36
|
+
export interface MediaUploaderProps {
|
|
37
|
+
/** Accepted file types */
|
|
38
|
+
accept?: string[];
|
|
39
|
+
/** Maximum file size in bytes */
|
|
40
|
+
maxSize?: number;
|
|
41
|
+
/** Upload callback */
|
|
42
|
+
onUpload: (file: File) => Promise<string>;
|
|
43
|
+
/** Upload progress callback */
|
|
44
|
+
onProgress?: (progress: number) => void;
|
|
45
|
+
/** Upload error callback */
|
|
46
|
+
onError?: (error: Error) => void;
|
|
47
|
+
/** Whether uploader is disabled */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** Upload button text */
|
|
50
|
+
buttonText?: string;
|
|
51
|
+
/** Whether to show drag and drop area */
|
|
52
|
+
showDragDrop?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare const MediaUploader: React.FC<MediaUploaderProps>;
|
|
55
|
+
/**
|
|
56
|
+
* Content editor settings component
|
|
57
|
+
*/
|
|
58
|
+
export interface ContentEditorSettingsProps {
|
|
59
|
+
/** Current settings */
|
|
60
|
+
settings: Record<string, any>;
|
|
61
|
+
/** Settings change callback */
|
|
62
|
+
onChange: (settings: Record<string, any>) => void;
|
|
63
|
+
/** Whether settings panel is open */
|
|
64
|
+
isOpen: boolean;
|
|
65
|
+
/** Close callback */
|
|
66
|
+
onClose: () => void;
|
|
67
|
+
/** Whether settings are disabled */
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export declare const ContentEditorSettings: React.FC<ContentEditorSettingsProps>;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=editor-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-components.d.ts","sourceRoot":"","sources":["../src/editor-components.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAqB1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,iBAAiB,GAAG,kBAAkB,CAwBxF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IACvF,8BAA8B;IAC9B,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,mCAAmC;IACnC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,iBAAiB,EAAE,8FAQ9D,wBAAwB,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,YA6FtC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,+BAA+B;IAC/B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4BAA4B;IAC5B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4JtD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,+BAA+B;IAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAClD,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAkItE,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { XStack, YStack, Button, Text, Input, Label, Sheet, Select, Switch, Slider, Card, H4, Paragraph, Separator, ScrollView, Popover, Progress, useTheme } from 'tamagui';
|
|
11
|
+
let legacyContentTypeWarned = false;
|
|
12
|
+
/**
|
|
13
|
+
* Read display fields from either shape. `ContentTypeDefinition` keeps icon/description
|
|
14
|
+
* at the top level; the deprecated 0.4.x shape kept them under `metadata`.
|
|
15
|
+
*/
|
|
16
|
+
export function getContentTypeDisplay(contentType) {
|
|
17
|
+
const metadata = contentType.metadata;
|
|
18
|
+
const category = metadata?.['category'];
|
|
19
|
+
if ('baseType' in contentType) {
|
|
20
|
+
return {
|
|
21
|
+
icon: contentType.icon || undefined,
|
|
22
|
+
description: contentType.description || undefined,
|
|
23
|
+
category: category === undefined ? undefined : String(category)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (!legacyContentTypeWarned) {
|
|
27
|
+
legacyContentTypeWarned = true;
|
|
28
|
+
// eslint-disable-next-line no-console -- one-time deprecation signal required by the repo's deprecation policy
|
|
29
|
+
console.warn('@bernierllc/content-editor-ui: content types with icon/description under `metadata` are deprecated since 0.5.0 and stop working in 1.0.0; pass a ContentTypeDefinition from @bernierllc/content-type-registry.');
|
|
30
|
+
}
|
|
31
|
+
const icon = metadata?.['icon'];
|
|
32
|
+
const description = metadata?.['description'];
|
|
33
|
+
return {
|
|
34
|
+
icon: typeof icon === 'string' ? icon : undefined,
|
|
35
|
+
description: typeof description === 'string' ? description : undefined,
|
|
36
|
+
category: category === undefined ? undefined : String(category)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export const ContentTypeSelector = ({ contentTypes, selectedType, onChange, disabled = false, placeholder = 'Select content type...', showDescriptions = true, showIcons = true }) => {
|
|
40
|
+
const theme = useTheme();
|
|
41
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
42
|
+
const selectedIcon = selectedType ? getContentTypeDisplay(selectedType).icon : undefined;
|
|
43
|
+
const handleSelect = (contentType) => {
|
|
44
|
+
onChange(contentType);
|
|
45
|
+
setIsOpen(false);
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, placement: "bottom-start", children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(Button, { variant: "outlined", disabled: disabled, justifyContent: "space-between", minWidth: "200px", children: [_jsxs(XStack, { alignItems: "center", gap: "$2", children: [showIcons && selectedIcon && (_jsx(Text, { fontSize: "$3", children: selectedIcon })), _jsx(Text, { children: selectedType ? selectedType.name : placeholder })] }), _jsx(Text, { children: "\u25BC" })] }) }), _jsx(Popover.Content, { padding: "$3", backgroundColor: theme['background']?.val, borderColor: theme['borderColor']?.val, borderWidth: 1, borderRadius: "$4", shadowColor: "$shadowColor", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.1, shadowRadius: 8, elevation: 5, children: _jsx(ScrollView, { maxHeight: "300px", children: _jsx(YStack, { gap: "$2", children: contentTypes.map((contentType) => {
|
|
48
|
+
const display = getContentTypeDisplay(contentType);
|
|
49
|
+
return (_jsx(Card, { padding: "$3", backgroundColor: selectedType?.id === contentType.id ? theme['primary']?.val : 'transparent', borderColor: selectedType?.id === contentType.id ? theme['primary']?.val : theme['borderColor']?.val, borderWidth: 1, borderRadius: "$3", pressStyle: {
|
|
50
|
+
backgroundColor: theme['primary']?.val,
|
|
51
|
+
scale: 0.98
|
|
52
|
+
}, onPress: () => handleSelect(contentType), children: _jsxs(XStack, { alignItems: "center", gap: "$2", children: [showIcons && display.icon && (_jsx(Text, { fontSize: "$4", children: display.icon })), _jsxs(YStack, { flex: 1, children: [_jsx(H4, { fontSize: "$3", fontWeight: "bold", children: contentType.name }), showDescriptions && display.description && (_jsx(Paragraph, { fontSize: "$2", color: theme['gray']?.val, children: display.description })), display.category && (_jsx(Text, { fontSize: "$1", alignSelf: "flex-start", paddingHorizontal: "$2", borderRadius: "$2", backgroundColor: theme['secondary']?.val, children: display.category }))] })] }) }, contentType.id));
|
|
53
|
+
}) }) }) })] }));
|
|
54
|
+
};
|
|
55
|
+
export const MediaUploader = ({ accept = ['image/*', 'audio/*', 'video/*'], maxSize = 10 * 1024 * 1024, // 10MB
|
|
56
|
+
onUpload, onProgress, onError, disabled = false, buttonText = 'Upload Media', showDragDrop = true }) => {
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
const [isUploading, setIsUploading] = React.useState(false);
|
|
59
|
+
const [uploadProgress, setUploadProgress] = React.useState(0);
|
|
60
|
+
const [isDragOver, setIsDragOver] = React.useState(false);
|
|
61
|
+
const fileInputRef = React.useRef(null);
|
|
62
|
+
const handleFileSelect = async (files) => {
|
|
63
|
+
if (!files || files.length === 0)
|
|
64
|
+
return;
|
|
65
|
+
const file = files[0];
|
|
66
|
+
if (!file)
|
|
67
|
+
return;
|
|
68
|
+
// Validate file size
|
|
69
|
+
if (file.size > maxSize) {
|
|
70
|
+
onError?.(new Error(`File size exceeds ${maxSize / 1024 / 1024}MB limit`));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// Validate file type
|
|
74
|
+
const isValidType = accept.some(type => {
|
|
75
|
+
if (type.endsWith('/*')) {
|
|
76
|
+
return file.type.startsWith(type.slice(0, -1));
|
|
77
|
+
}
|
|
78
|
+
return file.type === type;
|
|
79
|
+
});
|
|
80
|
+
if (!isValidType) {
|
|
81
|
+
onError?.(new Error(`File type ${file.type} is not supported`));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
setIsUploading(true);
|
|
85
|
+
setUploadProgress(0);
|
|
86
|
+
try {
|
|
87
|
+
// Simulate progress updates
|
|
88
|
+
const progressInterval = setInterval(() => {
|
|
89
|
+
setUploadProgress(prev => {
|
|
90
|
+
const newProgress = Math.min(prev + 10, 90);
|
|
91
|
+
onProgress?.(newProgress);
|
|
92
|
+
return newProgress;
|
|
93
|
+
});
|
|
94
|
+
}, 100);
|
|
95
|
+
await onUpload(file);
|
|
96
|
+
clearInterval(progressInterval);
|
|
97
|
+
setUploadProgress(100);
|
|
98
|
+
onProgress?.(100);
|
|
99
|
+
// Reset after success
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
setIsUploading(false);
|
|
102
|
+
setUploadProgress(0);
|
|
103
|
+
}, 1000);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
setIsUploading(false);
|
|
107
|
+
setUploadProgress(0);
|
|
108
|
+
onError?.(error);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const handleDragOver = (e) => {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
setIsDragOver(true);
|
|
114
|
+
};
|
|
115
|
+
const handleDragLeave = (e) => {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
setIsDragOver(false);
|
|
118
|
+
};
|
|
119
|
+
const handleDrop = (e) => {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
setIsDragOver(false);
|
|
122
|
+
handleFileSelect(e.dataTransfer.files);
|
|
123
|
+
};
|
|
124
|
+
return (_jsxs(YStack, { gap: "$3", children: [showDragDrop && (
|
|
125
|
+
// Pointer-only enhancement: the "Select files" button below is the accessible path.
|
|
126
|
+
_jsx("div", { role: "presentation", onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: _jsx(Card, { padding: "$4", backgroundColor: isDragOver ? theme['primary']?.val : theme['background']?.val, borderColor: isDragOver ? theme['primary']?.val : theme['borderColor']?.val, borderWidth: 2, borderStyle: "dashed", borderRadius: "$4", alignItems: "center", justifyContent: "center", minHeight: "120px", opacity: disabled ? 0.5 : 1, children: _jsxs(YStack, { alignItems: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$6", children: "\uD83D\uDCC1" }), _jsx(Text, { fontSize: "$3", fontWeight: "bold", children: "Drop files here" }), _jsx(Text, { fontSize: "$2", color: theme['gray']?.val, textAlign: "center", children: "or click the button below to select files" }), _jsxs(Text, { fontSize: "$1", color: theme['gray']?.val, children: ["Max size: ", maxSize / 1024 / 1024, "MB"] })] }) }) })), _jsxs(XStack, { gap: "$2", alignItems: "center", children: [_jsx(Button, { disabled: disabled || isUploading, onPress: () => fileInputRef.current?.click(), backgroundColor: theme['primary']?.val, children: _jsx(Text, { color: "white", children: isUploading ? 'Uploading...' : buttonText }) }), isUploading && (_jsxs(YStack, { flex: 1, gap: "$1", children: [_jsx(Progress, { value: uploadProgress, max: 100, children: _jsx(Progress.Indicator, { animation: "bouncy" }) }), _jsxs(Text, { fontSize: "$1", color: theme['gray']?.val, children: [uploadProgress, "% uploaded"] })] }))] }), _jsx("input", { ref: fileInputRef, type: "file", "aria-label": "Upload media file", accept: accept.join(','), onChange: (e) => handleFileSelect(e.target.files), style: { display: 'none' }, disabled: disabled })] }));
|
|
127
|
+
};
|
|
128
|
+
export const ContentEditorSettings = ({ settings, onChange, isOpen, onClose, disabled = false }) => {
|
|
129
|
+
const theme = useTheme();
|
|
130
|
+
const handleSettingChange = (key, value) => {
|
|
131
|
+
onChange({
|
|
132
|
+
...settings,
|
|
133
|
+
[key]: value
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
return (_jsxs(Sheet, { open: isOpen, onOpenChange: onClose, snapPoints: [85], dismissOnSnapToBottom: true, children: [_jsx(Sheet.Overlay, {}), _jsx(Sheet.Handle, {}), _jsx(Sheet.Frame, { padding: "$4", children: _jsxs(YStack, { gap: "$4", children: [_jsx(H4, { children: "Editor Settings" }), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [_jsx(Label, { htmlFor: "showWordCount", children: "Show Word Count" }), _jsx(Switch, { id: "showWordCount", checked: settings['showWordCount'] ?? true, onCheckedChange: (checked) => handleSettingChange('showWordCount', checked), disabled: disabled })] }), _jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [_jsx(Label, { htmlFor: "showCharCount", children: "Show Character Count" }), _jsx(Switch, { id: "showCharCount", checked: settings['showCharCount'] ?? true, onCheckedChange: (checked) => handleSettingChange('showCharCount', checked), disabled: disabled })] }), _jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [_jsx(Label, { htmlFor: "showAutoSaveStatus", children: "Show Auto-save Status" }), _jsx(Switch, { id: "showAutoSaveStatus", checked: settings['showAutoSaveStatus'] ?? true, onCheckedChange: (checked) => handleSettingChange('showAutoSaveStatus', checked), disabled: disabled })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", children: [_jsx(Label, { htmlFor: "editorHeight", children: "Editor Height" }), _jsxs(Slider, { id: "editorHeight", value: [parseInt(settings['editorHeight']?.replace('px', '') || '400')], onValueChange: ([value]) => handleSettingChange('editorHeight', `${value}px`), min: 200, max: 800, step: 50, disabled: disabled, children: [_jsx(Slider.Track, { children: _jsx(Slider.TrackActive, {}) }), _jsx(Slider.Thumb, { index: 0 })] }), _jsx(Text, { fontSize: "$1", color: theme['gray']?.val, children: settings['editorHeight'] || '400px' })] }), _jsxs(YStack, { gap: "$2", children: [_jsx(Label, { htmlFor: "placeholder", children: "Placeholder Text" }), _jsx(Input, { id: "placeholder", value: settings['placeholder'] || 'Start writing...', onChangeText: (text) => handleSettingChange('placeholder', text), disabled: disabled, placeholder: "Enter placeholder text..." })] }), _jsxs(YStack, { gap: "$2", children: [_jsx(Label, { htmlFor: "theme", children: "Theme" }), _jsxs(Select, { value: settings['theme'] || 'light', onValueChange: (value) => handleSettingChange('theme', value), children: [_jsx(Select.Trigger, { id: "theme", disabled: disabled, children: _jsx(Select.Value, { placeholder: "Select theme..." }) }), _jsxs(Select.Content, { children: [_jsx(Select.Item, { index: 0, value: "light", children: _jsx(Select.ItemText, { children: "Light" }) }), _jsx(Select.Item, { index: 1, value: "dark", children: _jsx(Select.ItemText, { children: "Dark" }) }), _jsx(Select.Item, { index: 2, value: "auto", children: _jsx(Select.ItemText, { children: "Auto" }) })] })] })] })] }), _jsxs(XStack, { gap: "$2", justifyContent: "flex-end", children: [_jsx(Button, { variant: "outlined", onPress: onClose, children: "Cancel" }), _jsx(Button, { onPress: onClose, children: "Save Settings" })] })] }) })] }));
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=editor-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-components.js","sourceRoot":"","sources":["../src/editor-components.tsx"],"names":[],"mappings":";AAAA;;;;;;EAME;AAEF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,EACJ,EAAE,EACF,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACT,MAAM,SAAS,CAAC;AASjB,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAA8B;IAClE,MAAM,QAAQ,GAAG,WAAW,CAAC,QAA+C,CAAC;IAC7E,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,UAAU,IAAI,WAAW,EAAE,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,SAAS;YACnC,WAAW,EAAE,WAAW,CAAC,WAAW,IAAI,SAAS;YACjD,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;SAChE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,uBAAuB,GAAG,IAAI,CAAC;QAC/B,+GAA+G;QAC/G,OAAO,CAAC,IAAI,CACV,gNAAgN,CACjN,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,QA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,KAAK,EAAC,MAAM,YACjC,KAAC,MAAM,CAAC,QAAQ,uBAAuB,GAC3B,EACd,KAAC,MAAM,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM,YACjC,KAAC,MAAM,CAAC,QAAQ,uBAAuB,GAC3B,IACC,IACV,IACF,IACF,EAET,MAAC,MAAM,IAAC,GAAG,EAAC,IAAI,EAAC,cAAc,EAAC,UAAU,aACxC,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,uBAElC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,8BAEf,IACF,IACF,GACG,IACR,CACT,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ContentEditorUiErrorCode = 'CONTENT_EDITOR_UI_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
|
|
2
|
+
export interface ContentEditorUiErrorOptions {
|
|
3
|
+
cause?: Error;
|
|
4
|
+
code?: ContentEditorUiErrorCode;
|
|
5
|
+
context?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class ContentEditorUiError extends Error {
|
|
8
|
+
readonly code: ContentEditorUiErrorCode;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
10
|
+
constructor(message: string, options?: ContentEditorUiErrorOptions);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,wBAAwB,GAChC,yBAAyB,GACzB,eAAe,GACf,kBAAkB,CAAC;AAEvB,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,2BAA2B;CASnE"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
export class ContentEditorUiError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
context;
|
|
11
|
+
constructor(message, options) {
|
|
12
|
+
super(message, options?.cause ? { cause: options.cause } : undefined);
|
|
13
|
+
this.name = 'ContentEditorUiError';
|
|
14
|
+
this.code = options?.code ?? 'CONTENT_EDITOR_UI_ERROR';
|
|
15
|
+
if (options?.context !== undefined) {
|
|
16
|
+
this.context = options.context;
|
|
17
|
+
}
|
|
18
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAaF,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,IAAI,CAA2B;IAC/B,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,OAAqC;QAChE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,yBAAyB,CAAC;QACvD,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { ContentData, EditorContentType, LegacyContentType, ContentEditorUIConfig, ContentEditorProps, ToolbarItem, StatusItem, EditorToolbarConfig, EditorStatusBarConfig, EditorThemeConfig, EditorExtensionConfig, EditorEventData, EditorStatistics, EditorValidationResult, EditorAutoSaveConfig, EditorKeyboardShortcuts } from './types.js';
|
|
2
|
+
export { ContentEditor } from './content-editor.js';
|
|
3
|
+
export { ContentTypeSelector, MediaUploader, ContentEditorSettings, getContentTypeDisplay } from './editor-components.js';
|
|
4
|
+
export type { ContentTypeSelectorProps } from './editor-components.js';
|
|
5
|
+
export { ContentEditorUiError, type ContentEditorUiErrorCode, type ContentEditorUiErrorOptions } from './errors.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC1H,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
// Export main components
|
|
9
|
+
export { ContentEditor } from './content-editor.js';
|
|
10
|
+
export { ContentTypeSelector, MediaUploader, ContentEditorSettings, getContentTypeDisplay } from './editor-components.js';
|
|
11
|
+
export { ContentEditorUiError } from './errors.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAsBF,yBAAyB;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE1H,OAAO,EAAE,oBAAoB,EAAmE,MAAM,aAAa,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Editor, JSONContent } from '@tiptap/react';
|
|
3
|
+
import type { ContentTypeDefinition } from '@bernierllc/content-type-registry';
|
|
4
|
+
/**
|
|
5
|
+
* Content document edited by the editor
|
|
6
|
+
*/
|
|
7
|
+
export interface ContentData {
|
|
8
|
+
/** Content identifier */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Editor document (TipTap JSON) or raw HTML/text */
|
|
11
|
+
data: JSONContent | string;
|
|
12
|
+
/** Free-form content metadata */
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
/** Last modification time */
|
|
15
|
+
lastModified?: Date;
|
|
16
|
+
/** Content version */
|
|
17
|
+
version?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Content type shape accepted by 0.4.x, where display fields lived under `metadata`.
|
|
21
|
+
* @deprecated since 0.5.0; removed in 1.0.0; use `ContentTypeDefinition` from `@bernierllc/content-type-registry`.
|
|
22
|
+
*/
|
|
23
|
+
export interface LegacyContentType {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
metadata?: {
|
|
27
|
+
icon?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
category?: string;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Content type accepted by the editor and selector.
|
|
35
|
+
* `LegacyContentType` is accepted until 1.0.0 (see its deprecation note).
|
|
36
|
+
*/
|
|
37
|
+
export type EditorContentType = ContentTypeDefinition | LegacyContentType;
|
|
38
|
+
/**
|
|
39
|
+
* Content editor UI configuration
|
|
40
|
+
*/
|
|
41
|
+
export interface ContentEditorUIConfig {
|
|
42
|
+
/** Whether the editor is enabled */
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/** Editor theme */
|
|
45
|
+
theme: 'light' | 'dark' | 'auto';
|
|
46
|
+
/** Editor placeholder text */
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
/** Whether to show word count */
|
|
49
|
+
showWordCount: boolean;
|
|
50
|
+
/** Whether to show character count */
|
|
51
|
+
showCharCount: boolean;
|
|
52
|
+
/** Whether to show auto-save status */
|
|
53
|
+
showAutoSaveStatus: boolean;
|
|
54
|
+
/** Whether to show toolbar */
|
|
55
|
+
showToolbar: boolean;
|
|
56
|
+
/** Whether to show status bar */
|
|
57
|
+
showStatusBar: boolean;
|
|
58
|
+
/** Editor height */
|
|
59
|
+
height?: string | number;
|
|
60
|
+
/** Editor width */
|
|
61
|
+
width?: string | number;
|
|
62
|
+
/** Custom CSS classes */
|
|
63
|
+
className?: string;
|
|
64
|
+
/** Custom styles */
|
|
65
|
+
style?: React.CSSProperties;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Content editor props
|
|
69
|
+
*/
|
|
70
|
+
export interface ContentEditorProps {
|
|
71
|
+
/** Content data */
|
|
72
|
+
content: ContentData;
|
|
73
|
+
/** Content type (`LegacyContentType` is deprecated, see its note) */
|
|
74
|
+
contentType: EditorContentType;
|
|
75
|
+
/** Editor configuration */
|
|
76
|
+
config?: Partial<ContentEditorUIConfig>;
|
|
77
|
+
/** Auto-save callback */
|
|
78
|
+
onAutoSave?: (content: ContentData) => void;
|
|
79
|
+
/** Manual save callback */
|
|
80
|
+
onSave?: (content: ContentData, saveType: 'draft' | 'publish') => void;
|
|
81
|
+
/** Content change callback */
|
|
82
|
+
onChange?: (content: ContentData) => void;
|
|
83
|
+
/** Focus callback */
|
|
84
|
+
onFocus?: () => void;
|
|
85
|
+
/** Blur callback */
|
|
86
|
+
onBlur?: () => void;
|
|
87
|
+
/** Error callback */
|
|
88
|
+
onError?: (error: Error) => void;
|
|
89
|
+
/** Whether editor is read-only */
|
|
90
|
+
readOnly?: boolean;
|
|
91
|
+
/** Whether editor is disabled */
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
/** Custom toolbar items */
|
|
94
|
+
customToolbarItems?: ToolbarItem[];
|
|
95
|
+
/** Custom status bar items */
|
|
96
|
+
customStatusItems?: StatusItem[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Toolbar item configuration
|
|
100
|
+
*/
|
|
101
|
+
export interface ToolbarItem {
|
|
102
|
+
/** Item ID */
|
|
103
|
+
id: string;
|
|
104
|
+
/** Item type */
|
|
105
|
+
type: 'button' | 'dropdown' | 'separator' | 'custom';
|
|
106
|
+
/** Item label */
|
|
107
|
+
label?: string;
|
|
108
|
+
/** Item icon */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Item tooltip */
|
|
111
|
+
tooltip?: string;
|
|
112
|
+
/** Whether item is active */
|
|
113
|
+
isActive?: boolean;
|
|
114
|
+
/** Whether item is disabled */
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
/** Click handler */
|
|
117
|
+
onClick?: () => void;
|
|
118
|
+
/** Custom component */
|
|
119
|
+
component?: React.ComponentType<any>;
|
|
120
|
+
/** Item props */
|
|
121
|
+
props?: Record<string, any>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Status bar item configuration
|
|
125
|
+
*/
|
|
126
|
+
export interface StatusItem {
|
|
127
|
+
/** Item ID */
|
|
128
|
+
id: string;
|
|
129
|
+
/** Item type */
|
|
130
|
+
type: 'text' | 'progress' | 'custom';
|
|
131
|
+
/** Item label */
|
|
132
|
+
label?: string;
|
|
133
|
+
/** Item value */
|
|
134
|
+
value?: string | number;
|
|
135
|
+
/** Item color */
|
|
136
|
+
color?: string;
|
|
137
|
+
/** Custom component */
|
|
138
|
+
component?: React.ComponentType<any>;
|
|
139
|
+
/** Item props */
|
|
140
|
+
props?: Record<string, any>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Editor toolbar configuration
|
|
144
|
+
*/
|
|
145
|
+
export interface EditorToolbarConfig {
|
|
146
|
+
/** Whether toolbar is enabled */
|
|
147
|
+
enabled: boolean;
|
|
148
|
+
/** Toolbar position */
|
|
149
|
+
position: 'top' | 'bottom' | 'floating';
|
|
150
|
+
/** Toolbar items */
|
|
151
|
+
items: ToolbarItem[];
|
|
152
|
+
/** Whether to show formatting buttons */
|
|
153
|
+
showFormatting: boolean;
|
|
154
|
+
/** Whether to show heading buttons */
|
|
155
|
+
showHeadings: boolean;
|
|
156
|
+
/** Whether to show list buttons */
|
|
157
|
+
showLists: boolean;
|
|
158
|
+
/** Whether to show link button */
|
|
159
|
+
showLink: boolean;
|
|
160
|
+
/** Whether to show image button */
|
|
161
|
+
showImage: boolean;
|
|
162
|
+
/** Whether to show table buttons */
|
|
163
|
+
showTable: boolean;
|
|
164
|
+
/** Whether to show code block button */
|
|
165
|
+
showCodeBlock: boolean;
|
|
166
|
+
/** Whether to show text alignment */
|
|
167
|
+
showTextAlign: boolean;
|
|
168
|
+
/** Whether to show text color */
|
|
169
|
+
showTextColor: boolean;
|
|
170
|
+
/** Whether to show highlight */
|
|
171
|
+
showHighlight: boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Editor status bar configuration
|
|
175
|
+
*/
|
|
176
|
+
export interface EditorStatusBarConfig {
|
|
177
|
+
/** Whether status bar is enabled */
|
|
178
|
+
enabled: boolean;
|
|
179
|
+
/** Status bar position */
|
|
180
|
+
position: 'top' | 'bottom';
|
|
181
|
+
/** Status items */
|
|
182
|
+
items: StatusItem[];
|
|
183
|
+
/** Whether to show word count */
|
|
184
|
+
showWordCount: boolean;
|
|
185
|
+
/** Whether to show character count */
|
|
186
|
+
showCharCount: boolean;
|
|
187
|
+
/** Whether to show auto-save status */
|
|
188
|
+
showAutoSaveStatus: boolean;
|
|
189
|
+
/** Whether to show cursor position */
|
|
190
|
+
showCursorPosition: boolean;
|
|
191
|
+
/** Whether to show editor mode */
|
|
192
|
+
showEditorMode: boolean;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Editor theme configuration
|
|
196
|
+
*/
|
|
197
|
+
export interface EditorThemeConfig {
|
|
198
|
+
/** Theme name */
|
|
199
|
+
name: string;
|
|
200
|
+
/** Theme colors */
|
|
201
|
+
colors: {
|
|
202
|
+
background: string;
|
|
203
|
+
foreground: string;
|
|
204
|
+
border: string;
|
|
205
|
+
primary: string;
|
|
206
|
+
secondary: string;
|
|
207
|
+
accent: string;
|
|
208
|
+
muted: string;
|
|
209
|
+
destructive: string;
|
|
210
|
+
};
|
|
211
|
+
/** Theme fonts */
|
|
212
|
+
fonts: {
|
|
213
|
+
body: string;
|
|
214
|
+
heading: string;
|
|
215
|
+
mono: string;
|
|
216
|
+
};
|
|
217
|
+
/** Theme spacing */
|
|
218
|
+
spacing: {
|
|
219
|
+
xs: string;
|
|
220
|
+
sm: string;
|
|
221
|
+
md: string;
|
|
222
|
+
lg: string;
|
|
223
|
+
xl: string;
|
|
224
|
+
};
|
|
225
|
+
/** Theme border radius */
|
|
226
|
+
borderRadius: {
|
|
227
|
+
sm: string;
|
|
228
|
+
md: string;
|
|
229
|
+
lg: string;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Editor extension configuration
|
|
234
|
+
*/
|
|
235
|
+
export interface EditorExtensionConfig {
|
|
236
|
+
/** Extension ID */
|
|
237
|
+
id: string;
|
|
238
|
+
/** Extension name */
|
|
239
|
+
name: string;
|
|
240
|
+
/** Extension component */
|
|
241
|
+
component: React.ComponentType<any>;
|
|
242
|
+
/** Extension configuration */
|
|
243
|
+
config?: Record<string, any>;
|
|
244
|
+
/** Whether extension is enabled */
|
|
245
|
+
enabled: boolean;
|
|
246
|
+
/** Extension dependencies */
|
|
247
|
+
dependencies?: string[];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Editor event data
|
|
251
|
+
*/
|
|
252
|
+
export interface EditorEventData {
|
|
253
|
+
/** Event type */
|
|
254
|
+
type: 'content_changed' | 'selection_changed' | 'focus' | 'blur' | 'save' | 'error';
|
|
255
|
+
/** Event timestamp */
|
|
256
|
+
timestamp: Date;
|
|
257
|
+
/** Event data */
|
|
258
|
+
data: Record<string, any>;
|
|
259
|
+
/** Editor instance */
|
|
260
|
+
editor?: Editor;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Editor statistics
|
|
264
|
+
*/
|
|
265
|
+
export interface EditorStatistics {
|
|
266
|
+
/** Word count */
|
|
267
|
+
wordCount: number;
|
|
268
|
+
/** Character count */
|
|
269
|
+
charCount: number;
|
|
270
|
+
/** Character count without spaces */
|
|
271
|
+
charCountNoSpaces: number;
|
|
272
|
+
/** Paragraph count */
|
|
273
|
+
paragraphCount: number;
|
|
274
|
+
/** Heading count */
|
|
275
|
+
headingCount: number;
|
|
276
|
+
/** Link count */
|
|
277
|
+
linkCount: number;
|
|
278
|
+
/** Image count */
|
|
279
|
+
imageCount: number;
|
|
280
|
+
/** Table count */
|
|
281
|
+
tableCount: number;
|
|
282
|
+
/** Code block count */
|
|
283
|
+
codeBlockCount: number;
|
|
284
|
+
/** Reading time estimate (minutes) */
|
|
285
|
+
readingTime: number;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Editor validation result
|
|
289
|
+
*/
|
|
290
|
+
export interface EditorValidationResult {
|
|
291
|
+
/** Whether validation passed */
|
|
292
|
+
valid: boolean;
|
|
293
|
+
/** Validation errors */
|
|
294
|
+
errors: string[];
|
|
295
|
+
/** Validation warnings */
|
|
296
|
+
warnings: string[];
|
|
297
|
+
/** Validated content */
|
|
298
|
+
validatedContent?: ContentData;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Editor auto-save configuration
|
|
302
|
+
*/
|
|
303
|
+
export interface EditorAutoSaveConfig {
|
|
304
|
+
/** Whether auto-save is enabled */
|
|
305
|
+
enabled: boolean;
|
|
306
|
+
/** Auto-save delay in milliseconds */
|
|
307
|
+
delay: number;
|
|
308
|
+
/** Auto-save callback */
|
|
309
|
+
onAutoSave: (content: ContentData) => void;
|
|
310
|
+
/** Auto-save error callback */
|
|
311
|
+
onAutoSaveError?: (error: Error) => void;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Editor keyboard shortcuts configuration
|
|
315
|
+
*/
|
|
316
|
+
export interface EditorKeyboardShortcuts {
|
|
317
|
+
/** Save shortcut */
|
|
318
|
+
save?: string;
|
|
319
|
+
/** Save as draft shortcut */
|
|
320
|
+
saveDraft?: string;
|
|
321
|
+
/** Publish shortcut */
|
|
322
|
+
publish?: string;
|
|
323
|
+
/** Bold shortcut */
|
|
324
|
+
bold?: string;
|
|
325
|
+
/** Italic shortcut */
|
|
326
|
+
italic?: string;
|
|
327
|
+
/** Underline shortcut */
|
|
328
|
+
underline?: string;
|
|
329
|
+
/** Link shortcut */
|
|
330
|
+
link?: string;
|
|
331
|
+
/** Image shortcut */
|
|
332
|
+
image?: string;
|
|
333
|
+
/** Custom shortcuts */
|
|
334
|
+
custom?: Record<string, string>;
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=types.d.ts.map
|