@templatical/core 0.0.5 → 0.1.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.
- package/LICENSE +56 -0
- package/README.md +64 -0
- package/dist/cloud/index.js +1 -0
- package/dist/cloud/index.js.map +1 -1
- package/package.json +41 -29
- package/dist/cloud/index.cjs +0 -2774
- package/dist/cloud/index.cjs.map +0 -1
- package/dist/cloud/index.d.cts +0 -480
- package/dist/editor-K644r-hl.d.cts +0 -39
- package/dist/index.cjs +0 -548
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -85
package/dist/index.d.cts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { U as UseEditorReturn } from './editor-K644r-hl.cjs';
|
|
2
|
-
export { E as EditorState, a as UseEditorOptions, u as useEditor } from './editor-K644r-hl.cjs';
|
|
3
|
-
import { TemplateContent, Block, BlockDefaults, BlockType, CustomBlockDefinition, CustomBlock } from '@templatical/types';
|
|
4
|
-
import { Ref, ComputedRef } from '@vue/reactivity';
|
|
5
|
-
|
|
6
|
-
interface UseHistoryOptions {
|
|
7
|
-
content: Ref<TemplateContent>;
|
|
8
|
-
setContent: (content: TemplateContent, markDirty?: boolean) => void;
|
|
9
|
-
isRemoteOperation?: () => boolean;
|
|
10
|
-
maxSize?: number;
|
|
11
|
-
}
|
|
12
|
-
interface UseHistoryReturn {
|
|
13
|
-
canUndo: ComputedRef<boolean>;
|
|
14
|
-
canRedo: ComputedRef<boolean>;
|
|
15
|
-
isNavigating: Ref<boolean>;
|
|
16
|
-
undo: () => void;
|
|
17
|
-
redo: () => void;
|
|
18
|
-
record: () => void;
|
|
19
|
-
recordDebounced: (blockId: string) => void;
|
|
20
|
-
clear: () => void;
|
|
21
|
-
destroy: () => void;
|
|
22
|
-
}
|
|
23
|
-
declare function useHistory(options: UseHistoryOptions): UseHistoryReturn;
|
|
24
|
-
|
|
25
|
-
interface UseBlockActionsOptions {
|
|
26
|
-
addBlock: (block: Block, targetSectionId?: string, columnIndex?: number) => void;
|
|
27
|
-
removeBlock: (blockId: string) => void;
|
|
28
|
-
updateBlock: (blockId: string, updates: Partial<Block>) => void;
|
|
29
|
-
selectBlock: (blockId: string | null) => void;
|
|
30
|
-
blockDefaults?: BlockDefaults;
|
|
31
|
-
}
|
|
32
|
-
interface UseBlockActionsReturn {
|
|
33
|
-
createAndAddBlock: (type: BlockType, targetSectionId?: string, columnIndex?: number) => Block;
|
|
34
|
-
duplicateBlock: (block: Block, targetSectionId?: string, columnIndex?: number) => Block;
|
|
35
|
-
deleteBlock: (blockId: string) => void;
|
|
36
|
-
updateBlockProperty: <K extends keyof Block>(blockId: string, key: K, value: Block[K]) => void;
|
|
37
|
-
}
|
|
38
|
-
declare function useBlockActions(options: UseBlockActionsOptions): UseBlockActionsReturn;
|
|
39
|
-
|
|
40
|
-
interface UseAutoSaveOptions {
|
|
41
|
-
content: Ref<TemplateContent>;
|
|
42
|
-
isDirty: () => boolean;
|
|
43
|
-
onChange: (content: TemplateContent) => void;
|
|
44
|
-
debounce?: number;
|
|
45
|
-
enabled?: boolean | (() => boolean);
|
|
46
|
-
}
|
|
47
|
-
interface UseAutoSaveReturn {
|
|
48
|
-
flush: () => void;
|
|
49
|
-
cancel: () => void;
|
|
50
|
-
pause: () => void;
|
|
51
|
-
resume: () => void;
|
|
52
|
-
destroy: () => void;
|
|
53
|
-
}
|
|
54
|
-
declare function useAutoSave(options: UseAutoSaveOptions): UseAutoSaveReturn;
|
|
55
|
-
|
|
56
|
-
interface UseConditionPreviewReturn {
|
|
57
|
-
isHidden: (blockId: string) => boolean;
|
|
58
|
-
toggleBlock: (blockId: string) => void;
|
|
59
|
-
reset: () => void;
|
|
60
|
-
hasHiddenBlocks: ComputedRef<boolean>;
|
|
61
|
-
}
|
|
62
|
-
declare function useConditionPreview(editor: UseEditorReturn): UseConditionPreviewReturn;
|
|
63
|
-
|
|
64
|
-
declare function useDataSourceFetch(options: {
|
|
65
|
-
definition: ComputedRef<CustomBlockDefinition | undefined>;
|
|
66
|
-
block: ComputedRef<CustomBlock>;
|
|
67
|
-
onUpdate: (fieldValues: Record<string, unknown>, fetched: boolean) => void;
|
|
68
|
-
}): {
|
|
69
|
-
isFetching: Ref<boolean>;
|
|
70
|
-
fetchError: Ref<boolean>;
|
|
71
|
-
fetch: () => Promise<void>;
|
|
72
|
-
hasDataSource: ComputedRef<boolean>;
|
|
73
|
-
needsFetch: ComputedRef<boolean>;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Wraps editor mutation methods to record history snapshots before each
|
|
78
|
-
* operation. Mutates the editor object in place.
|
|
79
|
-
*
|
|
80
|
-
* Must be applied **after** any collaboration broadcast wrapping so the
|
|
81
|
-
* call chain is: history.record() → broadcast → original mutation.
|
|
82
|
-
*/
|
|
83
|
-
declare function useHistoryInterceptor(editor: UseEditorReturn, history: UseHistoryReturn): void;
|
|
84
|
-
|
|
85
|
-
export { type UseAutoSaveOptions, type UseAutoSaveReturn, type UseBlockActionsOptions, type UseBlockActionsReturn, type UseConditionPreviewReturn, UseEditorReturn, type UseHistoryOptions, type UseHistoryReturn, useAutoSave, useBlockActions, useConditionPreview, useDataSourceFetch, useHistory, useHistoryInterceptor };
|