@jay-framework/editor-protocol 0.6.7 → 0.6.9
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 +4 -7
- package/dist/index.cjs +0 -72
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/editor-protocol",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
-
".":
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.cjs"
|
|
12
|
-
}
|
|
9
|
+
".": "./dist/index.js"
|
|
13
10
|
},
|
|
14
11
|
"files": [
|
|
15
12
|
"dist",
|
|
@@ -27,8 +24,8 @@
|
|
|
27
24
|
"test:watch": ":"
|
|
28
25
|
},
|
|
29
26
|
"devDependencies": {
|
|
30
|
-
"@jay-framework/dev-environment": "^0.6.
|
|
31
|
-
"@jay-framework/jay-cli": "^0.6.
|
|
27
|
+
"@jay-framework/dev-environment": "^0.6.9",
|
|
28
|
+
"@jay-framework/jay-cli": "^0.6.9",
|
|
32
29
|
"@types/node": "^22.15.21",
|
|
33
30
|
"rimraf": "^5.0.5",
|
|
34
31
|
"tsup": "^8.0.1",
|
package/dist/index.cjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function createPublishMessage(pages) {
|
|
4
|
-
return {
|
|
5
|
-
type: "publish",
|
|
6
|
-
pages
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function createSaveImageMessage(imageId, imageData) {
|
|
10
|
-
return {
|
|
11
|
-
type: "saveImage",
|
|
12
|
-
imageId,
|
|
13
|
-
imageData
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function createHasImageMessage(imageId) {
|
|
17
|
-
return {
|
|
18
|
-
type: "hasImage",
|
|
19
|
-
imageId
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function createPublishResponse(status) {
|
|
23
|
-
return {
|
|
24
|
-
type: "publish",
|
|
25
|
-
success: status.every((s) => s.success),
|
|
26
|
-
status
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function createSaveImageResponse(success, imageUrl, error) {
|
|
30
|
-
return {
|
|
31
|
-
type: "saveImage",
|
|
32
|
-
success,
|
|
33
|
-
imageUrl,
|
|
34
|
-
error
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function createHasImageResponse(exists, imageUrl) {
|
|
38
|
-
return {
|
|
39
|
-
type: "hasImage",
|
|
40
|
-
success: true,
|
|
41
|
-
exists,
|
|
42
|
-
imageUrl
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
let messageIdCounter = 0;
|
|
46
|
-
function generateMessageId() {
|
|
47
|
-
const timestamp = Date.now();
|
|
48
|
-
const counter = ++messageIdCounter;
|
|
49
|
-
return `${timestamp}-${counter}`;
|
|
50
|
-
}
|
|
51
|
-
function createProtocolMessage(payload) {
|
|
52
|
-
return {
|
|
53
|
-
id: generateMessageId(),
|
|
54
|
-
timestamp: Date.now(),
|
|
55
|
-
payload
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function createProtocolResponse(id, payload) {
|
|
59
|
-
return {
|
|
60
|
-
id,
|
|
61
|
-
timestamp: Date.now(),
|
|
62
|
-
payload
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.createHasImageMessage = createHasImageMessage;
|
|
66
|
-
exports.createHasImageResponse = createHasImageResponse;
|
|
67
|
-
exports.createProtocolMessage = createProtocolMessage;
|
|
68
|
-
exports.createProtocolResponse = createProtocolResponse;
|
|
69
|
-
exports.createPublishMessage = createPublishMessage;
|
|
70
|
-
exports.createPublishResponse = createPublishResponse;
|
|
71
|
-
exports.createSaveImageMessage = createSaveImageMessage;
|
|
72
|
-
exports.createSaveImageResponse = createSaveImageResponse;
|