@mybricks/to-code-taro 1.1.7 → 1.2.1

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 (88) hide show
  1. package/dist/cjs/generate/generateTaroProjectJson.js +47 -2
  2. package/dist/cjs/handleCom.js +1 -1
  3. package/dist/cjs/handleModule.js +6 -8
  4. package/dist/cjs/handleSlot.d.ts +1 -0
  5. package/dist/cjs/handleSlot.js +6 -3
  6. package/dist/cjs/index.js +1 -0
  7. package/dist/cjs/processors/processModule.js +1 -0
  8. package/dist/cjs/processors/processSceneLogic.js +5 -1
  9. package/dist/cjs/taro-template.json +6 -6008
  10. package/dist/cjs/toCodeTaro.js +89 -0
  11. package/dist/cjs/utils/logic/handleProcess.js +26 -18
  12. package/dist/cjs/utils/templates/component.js +1 -1
  13. package/dist/cjs/utils/templates/index.d.ts +2 -0
  14. package/dist/cjs/utils/templates/index.js +7 -2
  15. package/dist/cjs/utils/templates/renderManager.js +2 -2
  16. package/dist/cjs/utils/templates/scene.d.ts +1 -1
  17. package/dist/cjs/utils/templates/scene.js +4 -2
  18. package/dist/esm/generate/generateTaroProjectJson.js +43 -2
  19. package/dist/esm/handleCom.js +1 -1
  20. package/dist/esm/handleModule.js +5 -7
  21. package/dist/esm/handleSlot.d.ts +1 -0
  22. package/dist/esm/handleSlot.js +10 -7
  23. package/dist/esm/index.js +2 -1
  24. package/dist/esm/processors/processModule.js +1 -0
  25. package/dist/esm/processors/processSceneLogic.js +4 -2
  26. package/dist/esm/taro-template.json +6 -6008
  27. package/dist/esm/toCodeTaro.js +112 -0
  28. package/dist/esm/utils/logic/handleProcess.js +39 -18
  29. package/dist/esm/utils/templates/component.js +2 -2
  30. package/dist/esm/utils/templates/index.d.ts +2 -0
  31. package/dist/esm/utils/templates/index.js +5 -0
  32. package/dist/esm/utils/templates/renderManager.js +3 -3
  33. package/dist/esm/utils/templates/scene.d.ts +1 -1
  34. package/dist/esm/utils/templates/scene.js +4 -1
  35. package/package.json +2 -9
  36. package/README.md +0 -58
  37. package/dist/cjs/core/mybricks/MyBricksDescriptor.js +0 -213
  38. package/dist/cjs/core/mybricks/Subject.js +0 -119
  39. package/dist/cjs/core/mybricks/constant.js +0 -70
  40. package/dist/cjs/core/mybricks/context.js +0 -33
  41. package/dist/cjs/core/mybricks/createEnv.js +0 -39
  42. package/dist/cjs/core/mybricks/createJSHandle.js +0 -191
  43. package/dist/cjs/core/mybricks/createModuleEventsHandle.js +0 -49
  44. package/dist/cjs/core/mybricks/createReactiveInputHandler.js +0 -63
  45. package/dist/cjs/core/mybricks/event.js +0 -70
  46. package/dist/cjs/core/mybricks/index.js +0 -871
  47. package/dist/cjs/core/mybricks/log.js +0 -37
  48. package/dist/cjs/core/mybricks/utils.js +0 -69
  49. package/dist/cjs/core/mybricks/variables.js +0 -217
  50. package/dist/cjs/core/utils/ComContext.js +0 -51
  51. package/dist/cjs/core/utils/PopupRenderer.js +0 -63
  52. package/dist/cjs/core/utils/comRefResolver.js +0 -112
  53. package/dist/cjs/core/utils/event.js +0 -53
  54. package/dist/cjs/core/utils/hooks.js +0 -238
  55. package/dist/cjs/core/utils/index.js +0 -77
  56. package/dist/cjs/core/utils/pageRouter.js +0 -104
  57. package/dist/cjs/core/utils/pool.js +0 -63
  58. package/dist/cjs/core/utils/popupRouter.js +0 -98
  59. package/dist/cjs/core/utils/slots.js +0 -183
  60. package/dist/cjs/core/utils/tabbar.js +0 -56
  61. package/dist/cjs/core/utils/useContext.js +0 -112
  62. package/dist/cjs/core/utils/with.js +0 -109
  63. package/dist/esm/core/mybricks/MyBricksDescriptor.js +0 -232
  64. package/dist/esm/core/mybricks/Subject.js +0 -149
  65. package/dist/esm/core/mybricks/constant.js +0 -18
  66. package/dist/esm/core/mybricks/context.js +0 -5
  67. package/dist/esm/core/mybricks/createEnv.js +0 -9
  68. package/dist/esm/core/mybricks/createJSHandle.js +0 -189
  69. package/dist/esm/core/mybricks/createModuleEventsHandle.js +0 -26
  70. package/dist/esm/core/mybricks/createReactiveInputHandler.js +0 -40
  71. package/dist/esm/core/mybricks/event.js +0 -44
  72. package/dist/esm/core/mybricks/index.js +0 -952
  73. package/dist/esm/core/mybricks/log.js +0 -8
  74. package/dist/esm/core/mybricks/utils.js +0 -41
  75. package/dist/esm/core/mybricks/variables.js +0 -190
  76. package/dist/esm/core/utils/ComContext.js +0 -16
  77. package/dist/esm/core/utils/PopupRenderer.js +0 -27
  78. package/dist/esm/core/utils/comRefResolver.js +0 -134
  79. package/dist/esm/core/utils/event.js +0 -32
  80. package/dist/esm/core/utils/hooks.js +0 -287
  81. package/dist/esm/core/utils/index.js +0 -12
  82. package/dist/esm/core/utils/pageRouter.js +0 -112
  83. package/dist/esm/core/utils/pool.js +0 -52
  84. package/dist/esm/core/utils/popupRouter.js +0 -117
  85. package/dist/esm/core/utils/slots.js +0 -194
  86. package/dist/esm/core/utils/tabbar.js +0 -47
  87. package/dist/esm/core/utils/useContext.js +0 -100
  88. package/dist/esm/core/utils/with.js +0 -115
@@ -1,119 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/Subject.js
20
- var Subject_exports = {};
21
- __export(Subject_exports, {
22
- Subject: () => Subject
23
- });
24
- module.exports = __toCommonJS(Subject_exports);
25
- var import_log = require("./log");
26
- var import_constant = require("./constant");
27
- var Subject = class {
28
- _values = [];
29
- _observers = /* @__PURE__ */ new Set();
30
- _log = void 0;
31
- _empty = true;
32
- constructor(params = {}) {
33
- this._log = params.log;
34
- this._subjectNextCache = {};
35
- return new Proxy(this, {
36
- get(target, prop) {
37
- if (prop in target) {
38
- return target[prop];
39
- }
40
- if (!target._subjectNextCache[prop]) {
41
- const subjectNext = new SubjectNext(prop);
42
- target[import_constant.SUBJECT_SUBSCRIBE]((value, extra) => {
43
- subjectNext[import_constant.SUBJECT_NEXT](value, extra);
44
- });
45
- target._subjectNextCache[prop] = subjectNext;
46
- }
47
- return target._subjectNextCache[prop];
48
- }
49
- });
50
- }
51
- get [import_constant.SUBJECT_VALUE]() {
52
- return this._values[0];
53
- }
54
- get [import_constant.SUBJECT_EMPTY]() {
55
- return this._empty;
56
- }
57
- [import_constant.SUBJECT_SETVALUE](value) {
58
- this._values[0] = value;
59
- this._empty = false;
60
- }
61
- [import_constant.SUBJECT_NEXT](value, extra) {
62
- (0, import_log.log)(this._log, JSON.stringify(value));
63
- this._values[0] = value;
64
- this._empty = false;
65
- this._observers.forEach((observer) => observer(value, extra));
66
- }
67
- [import_constant.SUBJECT_SUBSCRIBE](observer) {
68
- if (this._values.length) {
69
- observer(this._values[0]);
70
- }
71
- this._observers.add(observer);
72
- }
73
- [import_constant.SUBJECT_UNSUBSCRIBE](observer) {
74
- this._observers.delete(observer);
75
- }
76
- };
77
- function getValueNextByPath(params) {
78
- const { value, path } = params;
79
- let current = value;
80
- for (const key of path) {
81
- if (current === null || current === void 0) {
82
- return void 0;
83
- }
84
- current = current[key];
85
- }
86
- return current;
87
- }
88
- var SubjectNext = class extends Subject {
89
- _path = [];
90
- constructor(path) {
91
- super();
92
- this._path.push(path);
93
- return new Proxy(this, {
94
- get(target, prop) {
95
- if (prop in target) {
96
- return target[prop];
97
- }
98
- target._path.push(prop);
99
- return target;
100
- }
101
- });
102
- }
103
- [import_constant.SUBJECT_NEXT](value, extra) {
104
- this._values[0] = value;
105
- this._empty = false;
106
- const nextValue = getValueNextByPath({ value, path: this._path });
107
- this._observers.forEach((observer) => observer(nextValue, extra));
108
- }
109
- [import_constant.SUBJECT_SUBSCRIBE](observer) {
110
- if (this._values.length) {
111
- observer(getValueNextByPath({ value: this._values[0], path: this._path }));
112
- }
113
- this._observers.add(observer);
114
- }
115
- };
116
- // Annotate the CommonJS export names for ESM import in node:
117
- 0 && (module.exports = {
118
- Subject
119
- });
@@ -1,70 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/constant.js
20
- var constant_exports = {};
21
- __export(constant_exports, {
22
- BASECONTROLLER_MARK: () => BASECONTROLLER_MARK,
23
- CONTROLLER_CONTEXT: () => CONTROLLER_CONTEXT,
24
- EXCUTE_TYPE_KEY: () => EXCUTE_TYPE_KEY,
25
- EXCUTE_TYPE_VALUE: () => EXCUTE_TYPE_VALUE,
26
- EXE_TITLE_MAP: () => EXE_TITLE_MAP,
27
- MYBRICKS_DESCRIPTOR: () => MYBRICKS_DESCRIPTOR,
28
- SUBJECT_EMPTY: () => SUBJECT_EMPTY,
29
- SUBJECT_NEXT: () => SUBJECT_NEXT,
30
- SUBJECT_SETVALUE: () => SUBJECT_SETVALUE,
31
- SUBJECT_SUBSCRIBE: () => SUBJECT_SUBSCRIBE,
32
- SUBJECT_UNSUBSCRIBE: () => SUBJECT_UNSUBSCRIBE,
33
- SUBJECT_VALUE: () => SUBJECT_VALUE,
34
- VARS_MARK: () => VARS_MARK
35
- });
36
- module.exports = __toCommonJS(constant_exports);
37
- var SUBJECT_NEXT = Symbol("SUBJECT_NEXT");
38
- var SUBJECT_VALUE = Symbol("SUBJECT_VALUE");
39
- var SUBJECT_SUBSCRIBE = Symbol("SUBJECT_SUBSCRIBE");
40
- var SUBJECT_UNSUBSCRIBE = Symbol("SUBJECT_UNSUBSCRIBE");
41
- var SUBJECT_EMPTY = Symbol("SUBJECT_EMPTY");
42
- var SUBJECT_SETVALUE = Symbol("SUBJECT_SETVALUE");
43
- var VARS_MARK = Symbol("VARS_MARK");
44
- var BASECONTROLLER_MARK = Symbol("BASECONTROLLER_MARK");
45
- var MYBRICKS_DESCRIPTOR = Symbol("MYBRICKS_DESCRIPTOR");
46
- var EXE_TITLE_MAP = {
47
- output: "输出",
48
- input: "输入"
49
- };
50
- var CONTROLLER_CONTEXT = Symbol("CONTROLLER_CONTEXT");
51
- var EXCUTE_TYPE_KEY = Symbol("EXCUTE_TYPE_KEY");
52
- var EXCUTE_TYPE_VALUE = {
53
- DATACHANGED: Symbol("DATACHANGED")
54
- };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- BASECONTROLLER_MARK,
58
- CONTROLLER_CONTEXT,
59
- EXCUTE_TYPE_KEY,
60
- EXCUTE_TYPE_VALUE,
61
- EXE_TITLE_MAP,
62
- MYBRICKS_DESCRIPTOR,
63
- SUBJECT_EMPTY,
64
- SUBJECT_NEXT,
65
- SUBJECT_SETVALUE,
66
- SUBJECT_SUBSCRIBE,
67
- SUBJECT_UNSUBSCRIBE,
68
- SUBJECT_VALUE,
69
- VARS_MARK
70
- });
@@ -1,33 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/context.js
20
- var context_exports = {};
21
- __export(context_exports, {
22
- context: () => context
23
- });
24
- module.exports = __toCommonJS(context_exports);
25
- var context = {
26
- /** [TODO] 记录API调用过程中变量的监听,调用回调后销毁 */
27
- apiRun: null,
28
- apiRunVariablesSubject: {}
29
- };
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- context
33
- });
@@ -1,39 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/createEnv.js
20
- var createEnv_exports = {};
21
- __export(createEnv_exports, {
22
- _createEnv: () => _createEnv,
23
- createEnv: () => createEnv
24
- });
25
- module.exports = __toCommonJS(createEnv_exports);
26
- var import_constant = require("./constant");
27
- var createEnv = (params) => {
28
- var _a;
29
- return (_a = params.controller[import_constant.CONTROLLER_CONTEXT].appContext) == null ? void 0 : _a.env;
30
- };
31
- var _createEnv = (params) => {
32
- var _a;
33
- return (_a = params.controller[import_constant.CONTROLLER_CONTEXT].appContext) == null ? void 0 : _a._env;
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- _createEnv,
38
- createEnv
39
- });
@@ -1,191 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/createJSHandle.js
20
- var createJSHandle_exports = {};
21
- __export(createJSHandle_exports, {
22
- createJSHandle: () => createJSHandle,
23
- validateJsMultipleInputs: () => validateJsMultipleInputs
24
- });
25
- module.exports = __toCommonJS(createJSHandle_exports);
26
- var import_constant = require("./constant");
27
- var import_Subject = require("./Subject");
28
- var import_log = require("./log");
29
- var import_createReactiveInputHandler = require("./createReactiveInputHandler");
30
- var validateJsMultipleInputs = (input) => {
31
- return input.match(/\./);
32
- };
33
- var handleCache = /* @__PURE__ */ new Map();
34
- var getFromCache = (handleKey) => {
35
- if (!handleKey || !handleCache.has(handleKey))
36
- return null;
37
- const cached = handleCache.get(handleKey);
38
- if (cached._rels) {
39
- Object.values(cached._rels).forEach((subject) => {
40
- var _a, _b;
41
- (_b = (_a = subject._observers) == null ? void 0 : _a.clear) == null ? void 0 : _b.call(_a);
42
- subject._values = [];
43
- subject._empty = true;
44
- });
45
- }
46
- return cached;
47
- };
48
- var setToCache = (handleKey, exe, rels, needsCache) => {
49
- exe._rels = rels;
50
- if (handleKey && needsCache) {
51
- handleCache.set(handleKey, exe);
52
- }
53
- };
54
- var createJSHandle = (fn, options, handleKey) => {
55
- const { props, appContext } = options;
56
- const cached = getFromCache(handleKey);
57
- if (cached)
58
- return cached;
59
- const needsCache = fn.__useCache === true;
60
- let controller;
61
- const inputs = new Proxy({}, {
62
- getOwnPropertyDescriptor() {
63
- return {
64
- enumerable: true,
65
- configurable: true
66
- };
67
- },
68
- ownKeys() {
69
- return props.inputs;
70
- },
71
- get() {
72
- return (input) => {
73
- controller = input;
74
- };
75
- }
76
- });
77
- const rels = {};
78
- const outputs = new Proxy({}, {
79
- getOwnPropertyDescriptor() {
80
- return {
81
- enumerable: true,
82
- configurable: true
83
- };
84
- },
85
- ownKeys() {
86
- return props.outputs;
87
- },
88
- get(_, key) {
89
- return (value) => {
90
- (rels[key] || (rels[key] = new import_Subject.Subject({ log: `${import_constant.EXE_TITLE_MAP["output"]} ${props.title} | ${key}` })))[import_constant.SUBJECT_NEXT](value);
91
- };
92
- }
93
- });
94
- fn({
95
- data: props.data,
96
- inputs,
97
- outputs,
98
- logger: import_log.logger,
99
- env: appContext == null ? void 0 : appContext.env,
100
- appContext
101
- });
102
- const isJsMultipleInputs = props.inputs[0] ? validateJsMultipleInputs(props.inputs[0]) : false;
103
- const exeOutputsCache = {};
104
- const exeOutputs = new Proxy(
105
- {},
106
- {
107
- get(_, key) {
108
- if (!exeOutputsCache[key]) {
109
- const subject = rels[key] || (rels[key] = new import_Subject.Subject({ log: `${import_constant.EXE_TITLE_MAP["output"]} ${props.title} | ${key}` }));
110
- exeOutputsCache[key] = subject;
111
- }
112
- return exeOutputsCache[key];
113
- }
114
- }
115
- );
116
- const subscribedSubjects = /* @__PURE__ */ new Set();
117
- const exe = (...args) => {
118
- if (args.length) {
119
- if (isJsMultipleInputs) {
120
- const length = args.length;
121
- let valueAry = {};
122
- args.forEach((value, index) => {
123
- if (value == null ? void 0 : value[import_constant.SUBJECT_SUBSCRIBE]) {
124
- if (subscribedSubjects.has(value)) {
125
- return;
126
- }
127
- subscribedSubjects.add(value);
128
- value[import_constant.SUBJECT_SUBSCRIBE]((value2) => {
129
- (0, import_log.log)(`${import_constant.EXE_TITLE_MAP["input"]} ${props.title} | ${props.inputs[index]}`, JSON.stringify(value2));
130
- valueAry[props.inputs[index]] = value2;
131
- if (Object.keys(valueAry).length === length) {
132
- (0, import_createReactiveInputHandler.createReactiveInputHandler)({
133
- input: controller,
134
- value: valueAry,
135
- rels,
136
- title: props.title
137
- });
138
- valueAry = {};
139
- }
140
- });
141
- } else {
142
- (0, import_log.log)(`${import_constant.EXE_TITLE_MAP["input"]} ${props.title} | ${props.inputs[index]}`, JSON.stringify(value));
143
- valueAry[props.inputs[index]] = value;
144
- if (Object.keys(valueAry).length === length) {
145
- (0, import_createReactiveInputHandler.createReactiveInputHandler)({
146
- input: controller,
147
- value: valueAry,
148
- rels,
149
- title: props.title
150
- });
151
- valueAry = {};
152
- }
153
- }
154
- });
155
- } else {
156
- const value = args[0];
157
- if (value == null ? void 0 : value[import_constant.SUBJECT_SUBSCRIBE]) {
158
- if (subscribedSubjects.has(value)) {
159
- return exeOutputs;
160
- }
161
- subscribedSubjects.add(value);
162
- value[import_constant.SUBJECT_SUBSCRIBE]((value2) => {
163
- (0, import_log.log)(`${import_constant.EXE_TITLE_MAP["input"]} ${props.title} | ${props.inputs[0]}`, JSON.stringify(value2));
164
- (0, import_createReactiveInputHandler.createReactiveInputHandler)({
165
- input: controller,
166
- value: value2,
167
- rels,
168
- title: props.title
169
- });
170
- });
171
- } else {
172
- (0, import_log.log)(`${import_constant.EXE_TITLE_MAP["input"]} ${props.title} | ${props.inputs[0]}`, JSON.stringify(value));
173
- (0, import_createReactiveInputHandler.createReactiveInputHandler)({
174
- input: controller,
175
- value,
176
- rels,
177
- title: props.title
178
- });
179
- }
180
- }
181
- }
182
- return exeOutputs;
183
- };
184
- setToCache(handleKey, exe, rels, needsCache);
185
- return exe;
186
- };
187
- // Annotate the CommonJS export names for ESM import in node:
188
- 0 && (module.exports = {
189
- createJSHandle,
190
- validateJsMultipleInputs
191
- });
@@ -1,49 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/createModuleEventsHandle.js
20
- var createModuleEventsHandle_exports = {};
21
- __export(createModuleEventsHandle_exports, {
22
- createModuleEventsHandle: () => createModuleEventsHandle
23
- });
24
- module.exports = __toCommonJS(createModuleEventsHandle_exports);
25
- var import_constant = require("./constant");
26
- var createModuleEventsHandle = ({ that, appContext }) => {
27
- const { uid, events } = that;
28
- return new Proxy(events, {
29
- get(_, key) {
30
- var _a, _b;
31
- const event = uid ? ((_b = (_a = appContext == null ? void 0 : appContext.comEvent) == null ? void 0 : _a[uid]) == null ? void 0 : _b[key]) || events[key] : events[key];
32
- if (event) {
33
- return (value) => {
34
- if (value == null ? void 0 : value[import_constant.SUBJECT_SUBSCRIBE]) {
35
- value[import_constant.SUBJECT_SUBSCRIBE]((value2) => {
36
- event(value2);
37
- });
38
- } else {
39
- event(value);
40
- }
41
- };
42
- }
43
- }
44
- });
45
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- createModuleEventsHandle
49
- });
@@ -1,63 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/createReactiveInputHandler.js
20
- var createReactiveInputHandler_exports = {};
21
- __export(createReactiveInputHandler_exports, {
22
- createReactiveInputHandler: () => createReactiveInputHandler
23
- });
24
- module.exports = __toCommonJS(createReactiveInputHandler_exports);
25
- var import_constant = require("./constant");
26
- var import_Subject = require("./Subject");
27
- var createReactiveInputHandler = (params) => {
28
- const { input, value, rels, title } = params;
29
- if (value == null ? void 0 : value[import_constant.SUBJECT_SUBSCRIBE]) {
30
- value[import_constant.SUBJECT_SUBSCRIBE]((value2) => {
31
- input(value2, new Proxy({}, {
32
- get(_, key) {
33
- return (value3) => {
34
- (rels[key] || (rels[key] = new import_Subject.Subject({ log: `${import_constant.EXE_TITLE_MAP["output"]} ${title} | ${key}` })))[import_constant.SUBJECT_NEXT](value3);
35
- };
36
- }
37
- }));
38
- });
39
- } else {
40
- input(value, new Proxy(
41
- {},
42
- {
43
- get(_, key) {
44
- return (value2) => {
45
- (rels[key] || (rels[key] = new import_Subject.Subject({ log: `${import_constant.EXE_TITLE_MAP["output"]} ${title} | ${key}` })))[import_constant.SUBJECT_NEXT](value2);
46
- };
47
- }
48
- }
49
- ));
50
- }
51
- return new Proxy(
52
- {},
53
- {
54
- get(_, key) {
55
- return rels[key] || (rels[key] = new import_Subject.Subject({ log: `${import_constant.EXE_TITLE_MAP["output"]} ${title} | ${key}` }));
56
- }
57
- }
58
- );
59
- };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- createReactiveInputHandler
63
- });
@@ -1,70 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/core/mybricks/event.js
20
- var event_exports = {};
21
- __export(event_exports, {
22
- createEvent: () => createEvent,
23
- transformEvents: () => transformEvents
24
- });
25
- module.exports = __toCommonJS(event_exports);
26
- var import_Subject = require("./Subject");
27
- var import_constant = require("./constant");
28
- var transformEvents = (bus) => {
29
- return (newEvents) => {
30
- Object.entries(newEvents).forEach(([key, newEvent]) => {
31
- bus[key] = createEvent(newEvent);
32
- });
33
- };
34
- };
35
- var createEvent = (event) => {
36
- return (value) => {
37
- const outputs = {};
38
- const callBack = new Proxy({}, {
39
- get(_, key) {
40
- return (value2) => {
41
- const output = outputs[key] || (outputs[key] = new import_Subject.Subject());
42
- if (value2 == null ? void 0 : value2[import_constant.SUBJECT_SUBSCRIBE]) {
43
- value2[import_constant.SUBJECT_SUBSCRIBE]((value3) => {
44
- output[import_constant.SUBJECT_NEXT](value3);
45
- });
46
- } else {
47
- output[import_constant.SUBJECT_NEXT](value2);
48
- }
49
- };
50
- }
51
- });
52
- if (value == null ? void 0 : value[import_constant.SUBJECT_SUBSCRIBE]) {
53
- value[import_constant.SUBJECT_SUBSCRIBE]((value2) => {
54
- event(value2, callBack);
55
- });
56
- } else {
57
- event(value, callBack);
58
- }
59
- return new Proxy({}, {
60
- get(_, key) {
61
- return outputs[key] || (outputs[key] = new import_Subject.Subject());
62
- }
63
- });
64
- };
65
- };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- createEvent,
69
- transformEvents
70
- });