@_unit/unit 1.0.16 → 1.0.18

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.
Files changed (54) hide show
  1. package/build/web.js +1 -1
  2. package/lib/API.d.ts +0 -6
  3. package/lib/Primitive.js +0 -1
  4. package/lib/Primitive.js.map +1 -1
  5. package/lib/Registry.js.map +1 -1
  6. package/lib/WebTemplate.d.ts +0 -1
  7. package/lib/boot/index.js.map +1 -1
  8. package/lib/client/component.d.ts +1 -2
  9. package/lib/client/component.js +0 -8
  10. package/lib/client/component.js.map +1 -1
  11. package/lib/client/platform/node/boot.d.ts +1 -1
  12. package/lib/client/platform/node/boot.js +3 -3
  13. package/lib/client/platform/node/boot.js.map +1 -1
  14. package/lib/client/platform/node/index.js +1 -1
  15. package/lib/client/platform/node/index.js.map +1 -1
  16. package/lib/client/platform/web/render.d.ts +1 -1
  17. package/lib/client/platform/web/render.js +2 -2
  18. package/lib/client/platform/web/render.js.map +1 -1
  19. package/lib/examples/helloworld.d.ts +1 -0
  20. package/lib/examples/helloworld.js +19 -0
  21. package/lib/examples/helloworld.js.map +1 -0
  22. package/lib/examples/system.d.ts +1 -0
  23. package/lib/examples/system.js +14 -0
  24. package/lib/examples/system.js.map +1 -0
  25. package/lib/system/platform/component/app/Editor/Component.js +0 -1
  26. package/lib/system/platform/component/app/Editor/Component.js.map +1 -1
  27. package/lib/system/platform/component/value/TextArea/Component.js +0 -9
  28. package/lib/system/platform/component/value/TextArea/Component.js.map +1 -1
  29. package/lib/system/platform/method/component/AttachText/index.js +1 -0
  30. package/lib/system/platform/method/component/AttachText/index.js.map +1 -1
  31. package/lib/test/client/system/platform/component/app/Graph.js +2 -2
  32. package/lib/test/client/system/platform/component/app/Graph.js.map +1 -1
  33. package/lib/test/system/core/PriorityMerge.js +8 -8
  34. package/lib/test/system/core/PriorityMerge.js.map +1 -1
  35. package/lib/test/system/f/meta/Bundle.js +19 -7
  36. package/lib/test/system/f/meta/Bundle.js.map +1 -1
  37. package/lib/test/system/f/meta/index.d.ts +1 -0
  38. package/lib/test/system/f/meta/index.js +1 -1
  39. package/lib/test/system/f/meta/index.js.map +1 -1
  40. package/lib/test/util/system.js +1 -1
  41. package/lib/test/util/system.js.map +1 -1
  42. package/package.json +3 -3
  43. package/public/_worker.js +5 -31177
  44. package/public/build.json +1 -1
  45. package/public/index.js +1163 -89947
  46. package/public/index.js.map +3 -3
  47. package/src/client/extension/src/background.js +1 -15
  48. package/src/client/extension/src/content.js +1 -53
  49. package/src/client/extension/src/options.js +1 -21
  50. package/src/client/extension/src/popup.js +1 -8
  51. package/src/client/platform/web/render.ts +4 -4
  52. package/src/examples/helloworld.ts +5 -3
  53. package/src/examples/system.ts +1 -0
  54. 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 webRender(
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 = render(system, $graph)
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
- render(system, $graph)
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
- units: {
7
- helloworld: {
8
- id: 'a9cbed12-9a53-11eb-8c2e-f3146b36128d',
6
+ spec: {
7
+ units: {
8
+ helloworld: {
9
+ id: 'a9cbed12-9a53-11eb-8c2e-f3146b36128d',
10
+ },
9
11
  },
10
12
  },
11
13
  }
@@ -1,3 +1,4 @@
1
+
1
2
  import { boot } from '../client/platform/node/boot'
2
3
  import { fromBundle } from '../spec/fromBundle'
3
4
  import _specs from '../system/_specs'
@@ -1,8 +1,8 @@
1
1
  // import { Graph } from '../../../../../../Class/Graph'
2
- // import { nodeBoot } from '../../../../../../client/platform/node/boot'
2
+ // import { boot } from '../../../../../../client/platform/node/boot'
3
3
  // import { Async } from '../../../../../../types/interface/async/Async'
4
4
 
5
- // export const system = nodeBoot()
5
+ // export const system = boot()
6
6
 
7
7
  // const graph = new Graph({}, {}, system)
8
8