@_unit/unit 1.0.16 → 1.0.17
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/build/web.js +1 -1
- package/lib/API.d.ts +0 -6
- package/lib/Primitive.js +0 -1
- package/lib/Primitive.js.map +1 -1
- package/lib/Registry.js.map +1 -1
- package/lib/WebTemplate.d.ts +0 -1
- package/lib/boot/index.js.map +1 -1
- package/lib/client/component.d.ts +1 -2
- package/lib/client/component.js +0 -8
- package/lib/client/component.js.map +1 -1
- package/lib/client/platform/node/boot.d.ts +1 -1
- package/lib/client/platform/node/boot.js +3 -3
- package/lib/client/platform/node/boot.js.map +1 -1
- package/lib/client/platform/node/index.js +1 -1
- package/lib/client/platform/node/index.js.map +1 -1
- package/lib/client/platform/web/render.d.ts +1 -1
- package/lib/client/platform/web/render.js +2 -2
- package/lib/client/platform/web/render.js.map +1 -1
- package/lib/examples/helloworld.d.ts +1 -0
- package/lib/examples/helloworld.js +19 -0
- package/lib/examples/helloworld.js.map +1 -0
- package/lib/examples/system.d.ts +1 -0
- package/lib/examples/system.js +14 -0
- package/lib/examples/system.js.map +1 -0
- package/lib/system/platform/component/app/Editor/Component.js +0 -1
- package/lib/system/platform/component/app/Editor/Component.js.map +1 -1
- package/lib/system/platform/component/value/TextArea/Component.js +0 -9
- package/lib/system/platform/component/value/TextArea/Component.js.map +1 -1
- package/lib/system/platform/method/component/AttachText/index.js +1 -0
- package/lib/system/platform/method/component/AttachText/index.js.map +1 -1
- package/lib/test/client/system/platform/component/app/Graph.js +2 -2
- package/lib/test/client/system/platform/component/app/Graph.js.map +1 -1
- package/lib/test/system/core/PriorityMerge.js +8 -8
- package/lib/test/system/core/PriorityMerge.js.map +1 -1
- package/lib/test/system/f/meta/Bundle.js +19 -7
- package/lib/test/system/f/meta/Bundle.js.map +1 -1
- package/lib/test/system/f/meta/index.d.ts +1 -0
- package/lib/test/system/f/meta/index.js +1 -1
- package/lib/test/system/f/meta/index.js.map +1 -1
- package/lib/test/util/system.js +1 -1
- package/lib/test/util/system.js.map +1 -1
- package/package.json +3 -3
- package/public/_worker.js +5 -31177
- package/public/build.json +1 -1
- package/public/index.js +1163 -89947
- package/public/index.js.map +3 -3
- package/src/client/extension/src/background.js +1 -15
- package/src/client/extension/src/content.js +1 -53
- package/src/client/extension/src/options.js +1 -21
- package/src/client/extension/src/popup.js +1 -8
- package/src/client/platform/web/render.ts +4 -4
- package/src/examples/helloworld.ts +5 -3
- package/src/test/client/system/platform/component/app/Graph.ts +2 -2
|
@@ -1,15 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// src/client/extension/src/background.ts
|
|
4
|
-
chrome.runtime.onConnect.addListener((port) => {
|
|
5
|
-
});
|
|
6
|
-
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
7
|
-
const { type, method, data } = message;
|
|
8
|
-
chrome[type][method](data, (result) => {
|
|
9
|
-
sendResponse(result);
|
|
10
|
-
});
|
|
11
|
-
return true;
|
|
12
|
-
});
|
|
13
|
-
var background_default = null;
|
|
14
|
-
})();
|
|
15
|
-
//# sourceMappingURL=background.js.map
|
|
1
|
+
"use strict";(()=>{chrome.runtime.onConnect.addListener(e=>{});chrome.runtime.onMessage.addListener((e,a,t)=>{let{type:r,method:n,data:o}=e;return chrome[r][n](o,d=>{t(d)}),!0});var s=null;})();
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// src/constant/STRING.ts
|
|
4
|
-
var CALL = "call";
|
|
5
|
-
|
|
6
|
-
// src/client/extension/index.ts
|
|
7
|
-
var SYSTEM_EXTENSION_ID = "___SYSTEM__EXTENSION___";
|
|
8
|
-
function getExtensionElement() {
|
|
9
|
-
return document.getElementById(SYSTEM_EXTENSION_ID);
|
|
10
|
-
}
|
|
11
|
-
function dispatchExtensionEvent(type, id, data) {
|
|
12
|
-
const element2 = getExtensionElement();
|
|
13
|
-
element2.dispatchEvent(
|
|
14
|
-
new CustomEvent("message", {
|
|
15
|
-
detail: { type, id, data }
|
|
16
|
-
})
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// src/client/extension/src/content.ts
|
|
21
|
-
var element = document.createElement("div");
|
|
22
|
-
element.style.display = "none";
|
|
23
|
-
element.id = SYSTEM_EXTENSION_ID;
|
|
24
|
-
document.body.appendChild(element);
|
|
25
|
-
element.addEventListener(
|
|
26
|
-
"message",
|
|
27
|
-
function(event) {
|
|
28
|
-
const { detail } = event;
|
|
29
|
-
const { type, id, data } = detail;
|
|
30
|
-
if (type === "send") {
|
|
31
|
-
const { type: _type, data: _data } = data;
|
|
32
|
-
switch (_type) {
|
|
33
|
-
case CALL:
|
|
34
|
-
chrome.runtime.sendMessage(_data, (data2) => {
|
|
35
|
-
if (chrome.runtime.lastError) {
|
|
36
|
-
const err = chrome.runtime.lastError.message.toLowerCase();
|
|
37
|
-
dispatchExtensionEvent("callback", id, { err });
|
|
38
|
-
} else {
|
|
39
|
-
dispatchExtensionEvent("callback", id, data2);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
break;
|
|
43
|
-
default:
|
|
44
|
-
dispatchExtensionEvent("callback", id, { err: "not supported" });
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
false
|
|
50
|
-
);
|
|
51
|
-
var content_default = null;
|
|
52
|
-
})();
|
|
53
|
-
//# sourceMappingURL=content.js.map
|
|
1
|
+
"use strict";(()=>{var c="call";var a="___SYSTEM__EXTENSION___";function m(){return document.getElementById(a)}function e(o,r,s){m().dispatchEvent(new CustomEvent("message",{detail:{type:o,id:r,data:s}}))}var n=document.createElement("div");n.style.display="none";n.id=a;document.body.appendChild(n);n.addEventListener("message",function(o){let{detail:r}=o,{type:s,id:t,data:l}=r;if(s==="send"){let{type:x,data:d}=l;switch(x){case c:chrome.runtime.sendMessage(d,p=>{if(chrome.runtime.lastError){let u=chrome.runtime.lastError.message.toLowerCase();e("callback",t,{err:u})}else e("callback",t,p)});break;default:e("callback",t,{err:"not supported"})}}},!1);var L=null;})();
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// src/client/extension/src/options.ts
|
|
4
|
-
var page = document.getElementById("buttonDiv");
|
|
5
|
-
var kButtonColors = ["#3aa757", "#e8453c", "#f9bb2d", "#4688f1"];
|
|
6
|
-
function constructOptions(kButtonColors2) {
|
|
7
|
-
for (let item of kButtonColors2) {
|
|
8
|
-
let button = document.createElement("button");
|
|
9
|
-
button.style.backgroundColor = item;
|
|
10
|
-
button.addEventListener("click", function() {
|
|
11
|
-
chrome.storage.sync.set({ color: item }, function() {
|
|
12
|
-
console.log("color is " + item);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
page.appendChild(button);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
constructOptions(kButtonColors);
|
|
19
|
-
var options_default = null;
|
|
20
|
-
})();
|
|
21
|
-
//# sourceMappingURL=options.js.map
|
|
1
|
+
"use strict";(()=>{var n=document.getElementById("buttonDiv"),c=["#3aa757","#e8453c","#f9bb2d","#4688f1"];function l(e){for(let t of e){let o=document.createElement("button");o.style.backgroundColor=t,o.addEventListener("click",function(){chrome.storage.sync.set({color:t},function(){console.log("color is "+t)})}),n.appendChild(o)}}l(c);var r=null;})();
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// src/client/extension/src/popup.ts
|
|
4
|
-
chrome.storage.sync.get("color", function(data) {
|
|
5
|
-
});
|
|
6
|
-
var popup_default = null;
|
|
7
|
-
})();
|
|
8
|
-
//# sourceMappingURL=popup.js.map
|
|
1
|
+
"use strict";(()=>{chrome.storage.sync.get("color",function(o){});var e=null;})();
|
|
@@ -9,11 +9,11 @@ import { Unlisten } from '../../../types/Unlisten'
|
|
|
9
9
|
import { AsyncGraph } from '../../../types/interface/async/AsyncGraph'
|
|
10
10
|
import { callAll } from '../../../util/call/callAll'
|
|
11
11
|
import { weakMerge } from '../../../weakMerge'
|
|
12
|
-
import { render } from '../../render'
|
|
12
|
+
import { render as _render } from '../../render'
|
|
13
13
|
import defaultWebBoot, { webBoot } from './boot'
|
|
14
14
|
import webInit from './init'
|
|
15
15
|
|
|
16
|
-
export default function
|
|
16
|
+
export default function render(
|
|
17
17
|
bundle: BundleSpec,
|
|
18
18
|
bootOpt?: BootOpt
|
|
19
19
|
): [Graph, System, Unlisten] {
|
|
@@ -35,7 +35,7 @@ export default function webRender(
|
|
|
35
35
|
const $graph = AsyncGraph(graph)
|
|
36
36
|
|
|
37
37
|
const webUnlisten = webInit(system, window, system.root)
|
|
38
|
-
const renderUnlisten =
|
|
38
|
+
const renderUnlisten = _render(system, $graph)
|
|
39
39
|
|
|
40
40
|
const unlisten = callAll([webUnlisten, renderUnlisten])
|
|
41
41
|
|
|
@@ -53,7 +53,7 @@ export function renderBundle(
|
|
|
53
53
|
const graph = start(system, bundle)
|
|
54
54
|
const $graph = AsyncGraph(graph)
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
_render(system, $graph)
|
|
57
57
|
|
|
58
58
|
return [system, graph]
|
|
59
59
|
}
|
|
@@ -3,9 +3,11 @@ import { renderBundle } from '@_unit/unit/lib/client/platform/web/render'
|
|
|
3
3
|
const root = document.getElementById('root')
|
|
4
4
|
|
|
5
5
|
const bundle = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
spec: {
|
|
7
|
+
units: {
|
|
8
|
+
helloworld: {
|
|
9
|
+
id: 'a9cbed12-9a53-11eb-8c2e-f3146b36128d',
|
|
10
|
+
},
|
|
9
11
|
},
|
|
10
12
|
},
|
|
11
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// import { Graph } from '../../../../../../Class/Graph'
|
|
2
|
-
// import {
|
|
2
|
+
// import { boot } from '../../../../../../client/platform/node/boot'
|
|
3
3
|
// import { Async } from '../../../../../../types/interface/async/Async'
|
|
4
4
|
|
|
5
|
-
// export const system =
|
|
5
|
+
// export const system = boot()
|
|
6
6
|
|
|
7
7
|
// const graph = new Graph({}, {}, system)
|
|
8
8
|
|