editor-ts 0.0.1 → 0.0.12
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 +197 -318
- package/index.ts +70 -0
- package/package.json +36 -11
- package/src/core/ComponentManager.ts +697 -6
- package/src/core/ComponentPalette.ts +109 -0
- package/src/core/CustomComponentRegistry.ts +74 -0
- package/src/core/KeyboardShortcuts.ts +220 -0
- package/src/core/LayerManager.ts +378 -0
- package/src/core/Page.ts +24 -5
- package/src/core/StorageManager.ts +447 -0
- package/src/core/StyleManager.ts +38 -2
- package/src/core/VersionControl.ts +189 -0
- package/src/core/aiChat.ts +427 -0
- package/src/core/iframeCanvas.ts +672 -0
- package/src/core/init.ts +3081 -248
- package/src/server/bun_server.ts +155 -0
- package/src/server/cf_worker.ts +225 -0
- package/src/server/schema.ts +21 -0
- package/src/server/sync.ts +195 -0
- package/src/types/sqlocal.d.ts +6 -0
- package/src/types.ts +591 -18
- package/src/utils/toolbar.ts +15 -1
package/index.ts
CHANGED
|
@@ -26,11 +26,29 @@ export { ComponentManager } from './src/core/ComponentManager';
|
|
|
26
26
|
export { StyleManager } from './src/core/StyleManager';
|
|
27
27
|
export { AssetManager } from './src/core/AssetManager';
|
|
28
28
|
export { ToolbarManager } from './src/core/ToolbarManager';
|
|
29
|
+
export { LayerManager } from './src/core/LayerManager';
|
|
30
|
+
export { StorageManager, LocalStorageAdapter, RemoteStorageAdapter, SqlocalStorageAdapter, type SqlocalClient } from './src/core/StorageManager';
|
|
31
|
+
export { syncFrontendWithServer } from './src/server/sync';
|
|
29
32
|
export { init } from './src/core/init';
|
|
33
|
+
export { defaultComponentRegistry, mergeCustomComponentRegistry, createCustomComponentDefinition, defaultComponentFactories } from './src/core/CustomComponentRegistry';
|
|
34
|
+
export {
|
|
35
|
+
requestAiReplacements,
|
|
36
|
+
parseAiChatResponse,
|
|
37
|
+
applyAiReplacementsToPage,
|
|
38
|
+
buildAiChatSystemPrompt,
|
|
39
|
+
buildAiChatSnapshot,
|
|
40
|
+
chooseChatModel,
|
|
41
|
+
} from './src/core/aiChat';
|
|
42
|
+
export { VersionControl } from './src/core/VersionControl';
|
|
43
|
+
export { KeyboardShortcuts, createDefaultShortcuts } from './src/core/KeyboardShortcuts';
|
|
44
|
+
|
|
45
|
+
// Server schema exports (drizzle)
|
|
46
|
+
export { pages, pageFiles } from './src/server/schema';
|
|
30
47
|
|
|
31
48
|
// Type exports
|
|
32
49
|
export type {
|
|
33
50
|
PageData,
|
|
51
|
+
MultiPageData,
|
|
34
52
|
PageBody,
|
|
35
53
|
Component,
|
|
36
54
|
Asset,
|
|
@@ -48,8 +66,49 @@ export type {
|
|
|
48
66
|
InitConfig,
|
|
49
67
|
ToolbarInitConfig,
|
|
50
68
|
EditorTsEditor,
|
|
69
|
+
AiProviderConfig,
|
|
70
|
+
EditorTsAiModule,
|
|
71
|
+
ImageFileInfo,
|
|
72
|
+
StorageConfig,
|
|
73
|
+
LocalStorageConfig,
|
|
74
|
+
RemoteStorageConfig,
|
|
75
|
+
SqlocalStorageConfig,
|
|
76
|
+
ServerPageMeta,
|
|
77
|
+
ServerFile,
|
|
78
|
+
ServerSyncAdapter,
|
|
79
|
+
FrontendSyncStatus,
|
|
80
|
+
FrontendSyncOptions,
|
|
81
|
+
CustomComponentDefinition,
|
|
82
|
+
CustomComponentRegistry,
|
|
83
|
+
UiRender,
|
|
84
|
+
PagesRenderProps,
|
|
85
|
+
PagePayload,
|
|
86
|
+
EditorTsSyncMessage,
|
|
87
|
+
EditorTsSyncAck,
|
|
88
|
+
EditorTsSyncEnvelope,
|
|
51
89
|
} from './src/types';
|
|
52
90
|
|
|
91
|
+
|
|
92
|
+
export type { LayerManagerConfig } from './src/core/LayerManager';
|
|
93
|
+
export type { StorageAdapter } from './src/core/StorageManager';
|
|
94
|
+
|
|
95
|
+
// Server exports
|
|
96
|
+
export {
|
|
97
|
+
createPageMeta,
|
|
98
|
+
} from './src/server/sync';
|
|
99
|
+
export type { PageMeta, PageMetaStore } from './src/server/sync';
|
|
100
|
+
export { createBunPageMetaStore } from './src/server/bun_server';
|
|
101
|
+
export {
|
|
102
|
+
createCfPageMetaStore,
|
|
103
|
+
EditorTsPageMetaDurableObject,
|
|
104
|
+
EditorTsPageMetaIndexDurableObject,
|
|
105
|
+
type DurableObjectNamespace,
|
|
106
|
+
type DurableObjectState,
|
|
107
|
+
type DurableObjectStorage,
|
|
108
|
+
type DurableObjectId,
|
|
109
|
+
type DurableObjectStub,
|
|
110
|
+
} from './src/server/cf_worker';
|
|
111
|
+
|
|
53
112
|
// Utility exports
|
|
54
113
|
export {
|
|
55
114
|
deepClone,
|
|
@@ -69,6 +128,17 @@ export {
|
|
|
69
128
|
extractDomain,
|
|
70
129
|
} from './src/utils/helpers';
|
|
71
130
|
|
|
131
|
+
export {
|
|
132
|
+
createSyncAck,
|
|
133
|
+
createSyncMessage,
|
|
134
|
+
isSyncAck,
|
|
135
|
+
isSyncMessage,
|
|
136
|
+
parseSyncEnvelope,
|
|
137
|
+
} from './src/server/sync';
|
|
138
|
+
|
|
139
|
+
export { createBunSyncServer } from './src/server/bun_server';
|
|
140
|
+
export { createCfSyncWorker } from './src/server/cf_worker';
|
|
141
|
+
|
|
72
142
|
// Toolbar exports
|
|
73
143
|
export {
|
|
74
144
|
defaultToolbarActions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "editor-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "TypeScript library for editing HTML content with JSON representation",
|
|
5
5
|
"module": "index.ts",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -14,29 +14,54 @@
|
|
|
14
14
|
"typescript",
|
|
15
15
|
"web"
|
|
16
16
|
],
|
|
17
|
-
"author": "",
|
|
17
|
+
"author": "Jonathan Riche",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/JonathanRiche/editor-ts.git"
|
|
21
|
+
},
|
|
18
22
|
"license": "MIT",
|
|
19
23
|
"scripts": {
|
|
20
24
|
"dev": "bun run local-server.ts",
|
|
21
|
-
"server": "bun run server.ts",
|
|
25
|
+
"server": "bun run local-server.ts",
|
|
22
26
|
"build": "bun build index.ts --outdir=dist",
|
|
23
|
-
"example": "bun run
|
|
24
|
-
"test": "bun
|
|
25
|
-
"test:api": "bun
|
|
27
|
+
"example": "bun run local-server.ts",
|
|
28
|
+
"test": "bun test",
|
|
29
|
+
"test:api": "bun test"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|
|
32
|
+
"@opencode-ai/sdk": "^1.1.14",
|
|
28
33
|
"@types/bun": "latest",
|
|
34
|
+
"drizzle-orm": "^0.44.0",
|
|
35
|
+
"modern-monaco": "^0.3.6",
|
|
29
36
|
"playwright": "^1.57.0"
|
|
30
37
|
},
|
|
31
38
|
"peerDependencies": {
|
|
32
|
-
"typescript": "^5"
|
|
39
|
+
"typescript": "^5",
|
|
40
|
+
"modern-monaco": "^0.3.6",
|
|
41
|
+
"@opencode-ai/sdk": "^1.1.14",
|
|
42
|
+
"sqlocal": "^0.16.0",
|
|
43
|
+
"drizzle-orm": "^0.44.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"modern-monaco": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"@opencode-ai/sdk": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"sqlocal": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"typescript": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"drizzle-orm": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
33
61
|
},
|
|
34
62
|
"files": [
|
|
35
63
|
"src",
|
|
36
64
|
"index.ts",
|
|
37
65
|
"README.md"
|
|
38
|
-
]
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"modern-monaco": "^0.3.6"
|
|
41
|
-
}
|
|
66
|
+
]
|
|
42
67
|
}
|