@fugood/bricks-project 2.23.0-beta.48 → 2.23.0-beta.49

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/compile/util.ts CHANGED
@@ -3,6 +3,7 @@ import { makeId } from '../utils/id'
3
3
  type ScriptConfig = {
4
4
  inputs: Record<string, string>
5
5
  enable_async: boolean
6
+ trigger_mode?: 'auto' | 'manual'
6
7
  disabled_triggers: Record<string, boolean>
7
8
  output: string | null
8
9
  outputs: Record<string, string[]>
@@ -13,6 +14,8 @@ type ScriptConfig = {
13
14
  const errorMsg = 'Not allow duplicate set property id between inputs / outputs / output / error.'
14
15
 
15
16
  export const validateConfig = (config: ScriptConfig) => {
17
+ // Skip input/output overlap validation in manual mode (allows same data node in both)
18
+ if (config.trigger_mode === 'manual') return
16
19
  if (config.error && config.inputs[config.error]) {
17
20
  throw new Error(`${errorMsg}. key: error`)
18
21
  }
@@ -87,7 +90,8 @@ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMod
87
90
  {
88
91
  id: key,
89
92
  port: 'value',
90
- disable_trigger_command: config.disabled_triggers?.[key] ? true : undefined,
93
+ disable_trigger_command:
94
+ config.trigger_mode === 'manual' || config.disabled_triggers?.[key] || undefined,
91
95
  },
92
96
  ],
93
97
  },
@@ -152,6 +156,8 @@ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMod
152
156
  points: {},
153
157
  }
154
158
  pbList.forEach((pb, pbIndex) => {
159
+ // Check if this data node already exists (it might be used as both input and output)
160
+ const existingNode = acc.map[pb] || inputs.map[pb]
155
161
  acc.map[pb] = {
156
162
  type: 'data-node',
157
163
  properties: {},
@@ -164,7 +170,8 @@ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMod
164
170
  ],
165
171
  },
166
172
  out: {
167
- value: null,
173
+ // Preserve existing out.value if node is also used as input
174
+ value: existingNode?.out?.value ?? null,
168
175
  },
169
176
  }
170
177
  acc.editorInfo[pb] = {
@@ -292,7 +299,8 @@ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMod
292
299
  ],
293
300
  },
294
301
  out: {
295
- value: null,
302
+ // Preserve existing out.value if node is also used as input
303
+ value: inputs.map[config.error]?.out?.value ?? null,
296
304
  },
297
305
  },
298
306
  }),
@@ -309,7 +317,8 @@ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMod
309
317
  ],
310
318
  },
311
319
  out: {
312
- value: null,
320
+ // Preserve existing out.value if node is also used as input
321
+ value: inputs.map[config.output]?.out?.value ?? null,
313
322
  },
314
323
  },
315
324
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.23.0-beta.48",
3
+ "version": "2.23.0-beta.49",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "bun scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "5c53356168c2861496d5a329ae1cb175c40ba5ed"
17
+ "gitHead": "d879268aee7397545296e9c1ca1f369af32dfee5"
18
18
  }
@@ -107,8 +107,8 @@ Default property:
107
107
  }
108
108
  */
109
109
  property?: BrickBasicProperty & {
110
- /* Camera type (Ignore it if you are using external camera) */
111
- type?: 'back' | 'front' | DataLink
110
+ /* Camera type */
111
+ type?: 'back' | 'front' | 'external' | DataLink
112
112
  /* Enable or disable camera */
113
113
  isActive?: boolean | DataLink
114
114
  /* Camera zoom */
@@ -91,7 +91,7 @@ interface BrickMapsDef {
91
91
  /*
92
92
  Default property:
93
93
  {
94
- "provider": "apple",
94
+ "provider": "google",
95
95
  "apiKey": "",
96
96
  "initialLatitude": 25.033,
97
97
  "initialLongitude": 121.5654,