@_unit/unit 1.0.7 → 1.0.8
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 +1201 -0
- package/package.json +1 -1
- package/public/_worker.js +294 -103
- package/public/_worker.js.map +4 -4
- package/public/app/html/index.html +74 -0
- package/public/build.json +1 -1
- package/public/index.js +297 -103
- package/public/index.js.map +4 -4
- package/src/API.ts +1 -0
- package/src/Class/Graph/index.ts +14 -1
- package/src/Class/Graph/interface.ts +7 -0
- package/src/Class/Graph/moveSubgraph.ts +25 -25
- package/src/client/component.ts +18 -7
- package/src/client/extractStyle.ts +161 -0
- package/src/client/isTextLike.ts +16 -0
- package/src/client/platform/web/api/document.ts +3 -0
- package/src/debug/graph/watchGraphInternal.ts +2 -0
- package/src/debug/graph/watchGraphSetUnitPinSetIdEvent.ts +39 -0
- package/src/docs/concept/README.md +8 -2
- package/src/interface.ts +1 -0
- package/src/script/build/client.ts +4 -2
- package/src/spec/Lazy.ts +10 -2
- package/src/spec/util.ts +4 -0
- package/src/system/_classes.ts +2 -2
- package/src/system/_ids.ts +1 -1
- package/src/system/_specs.ts +1 -1
- package/src/system/core/unit/MergeInput/spec.json +1 -1
- package/src/system/globalComponent.ts +29 -0
- package/src/system/platform/api/canvas/AddRect/index.ts +2 -6
- package/src/system/platform/api/canvas/ToBlob/index.ts +5 -1
- package/src/system/platform/api/media/MediaRecorder/index.ts +6 -0
- package/src/system/platform/api/media/RequestPictureInPicture/index.ts +10 -5
- package/src/system/platform/api/media/image/{BlobToBitmap → ImageToBitmap}/index.ts +10 -10
- package/src/system/platform/api/media/image/{BlobToBitmap → ImageToBitmap}/spec.json +9 -18
- package/src/system/platform/component/Iframe/Component.ts +2 -0
- package/src/system/platform/component/Inherit/Component.ts +0 -18
- package/src/system/platform/component/app/Editor/Component.ts +214 -77
- package/src/system/platform/component/app/GUI/Component.ts +19 -4
- package/src/system/platform/component/canvas/Canvas/index.ts +2 -2
- package/src/system/platform/component/media/Video/index.ts +15 -2
- package/src/system/platform/core/SetCurrentTime/spec.json +1 -1
- package/src/system/platform/core/SetScale/spec.json +1 -1
- package/src/system/platform/core/api/location/LocationQuery/spec.json +1 -1
- package/src/system/platform/core/asset/IconNames/spec.json +1 -1
- package/src/system/platform/core/canvas/DownloadBlob/spec.json +1 -1
- package/src/system/platform/core/component/Charcode/spec.json +1 -1
- package/src/system/platform/core/download/DownloadGraph/spec.json +1 -1
- package/src/system/platform/core/math/geometry/trigonometry/Hypotenuse/spec.json +1 -1
- package/src/system/platform/core/math/power/Pow2/spec.json +1 -1
- package/src/system/platform/core/string/RemoveNewLine/spec.json +1 -1
- package/src/test/system/core/MergeSort.ts +1 -1
- package/src/types/GraphSpec.ts +0 -1
- package/src/types/interface/B.ts +3 -1
- package/src/types/interface/G.ts +8 -0
- package/src/types/interface/async/$G.ts +3 -0
- package/src/types/interface/async/AsyncG.ts +10 -0
- package/public/metadata.mp4 +0 -0
|
@@ -175,7 +175,7 @@ export default class Canvas
|
|
|
175
175
|
try {
|
|
176
176
|
this._offscreen.width = data
|
|
177
177
|
} catch (err) {
|
|
178
|
-
console.log(err)
|
|
178
|
+
// console.log(err)
|
|
179
179
|
//
|
|
180
180
|
}
|
|
181
181
|
// this._component.setProp('width', data)
|
|
@@ -188,7 +188,7 @@ export default class Canvas
|
|
|
188
188
|
try {
|
|
189
189
|
this._offscreen.height = data
|
|
190
190
|
} catch (err) {
|
|
191
|
-
console.log(err)
|
|
191
|
+
// console.log(err)
|
|
192
192
|
//
|
|
193
193
|
}
|
|
194
194
|
// this._component.setProp('height', data)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ElementEE, Element_ } from '../../../../../Class/Element'
|
|
2
2
|
import { Unit } from '../../../../../Class/Unit'
|
|
3
|
-
import { APINotSupportedError } from '../../../../../exception/APINotImplementedError'
|
|
4
3
|
import { System } from '../../../../../system'
|
|
5
4
|
import { Callback } from '../../../../../types/Callback'
|
|
6
5
|
import { CS } from '../../../../../types/interface/CS'
|
|
@@ -52,7 +51,21 @@ export default class Video
|
|
|
52
51
|
async captureStream({ frameRate }: CSOpt): Promise<MediaStream> {
|
|
53
52
|
// TODO
|
|
54
53
|
// const stream = await this._element.captureStream({ frameRate })
|
|
55
|
-
throw new APINotSupportedError('Video Capture')
|
|
54
|
+
// throw new APINotSupportedError('Video Capture')
|
|
55
|
+
|
|
56
|
+
const localComponents = this.__system.getLocalComponents(this.__global_id)
|
|
57
|
+
|
|
58
|
+
const firstLocalComponent: any = localComponents[0]
|
|
59
|
+
|
|
60
|
+
if (firstLocalComponent) {
|
|
61
|
+
return firstLocalComponent.$element.captureStream({ frameRate })
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return new Promise((resolve) => {
|
|
65
|
+
this.__system.emitter.addListener(this.__global_id, (localComponent) => {
|
|
66
|
+
resolve(localComponent.$element.captureStream({ frameRate }))
|
|
67
|
+
})
|
|
68
|
+
})
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
async image(): Promise<any> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as assert from 'assert'
|
|
2
2
|
import { watchGraphAndLog, watchUnitAndLog } from '../../../debug'
|
|
3
|
+
import { fromBundle } from '../../../spec/fromBundle'
|
|
3
4
|
import _specs from '../../../system/_specs'
|
|
4
5
|
import { countEvent } from '../../util'
|
|
5
6
|
import { system } from '../../util/system'
|
|
6
|
-
import { fromBundle } from '../../../spec/fromBundle'
|
|
7
7
|
|
|
8
8
|
const bundle = require('./MergeSort.json')
|
|
9
9
|
const MergeSort = fromBundle(bundle, _specs)
|
package/src/types/GraphSpec.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { GraphComponentSpec, GraphDataSpec, GraphMetadataSpec } from '.'
|
|
|
2
2
|
import { GraphSpecBase } from './GraphSpecBase'
|
|
3
3
|
import { GraphSpecs } from './GraphSpecs'
|
|
4
4
|
import { GraphUnitsSpec } from './GraphUnitsSpec'
|
|
5
|
-
import { None } from './None'
|
|
6
5
|
|
|
7
6
|
export type GraphSpec = GraphSpecBase & {
|
|
8
7
|
version?: string
|
package/src/types/interface/B.ts
CHANGED
package/src/types/interface/G.ts
CHANGED
|
@@ -154,6 +154,13 @@ export interface G<I = any, O = any, U_ = any> {
|
|
|
154
154
|
setUnitSize(unitId: string, width: number, height: number): void
|
|
155
155
|
setSubComponentSize(unitId: string, width: number, height: number): void
|
|
156
156
|
setComponentSize(unitId: string, width: number, height: number): void
|
|
157
|
+
setUnitPinSetId(
|
|
158
|
+
unitId: string,
|
|
159
|
+
type: IO,
|
|
160
|
+
pinId: string,
|
|
161
|
+
newPinId: string,
|
|
162
|
+
...extra: any[]
|
|
163
|
+
): void
|
|
157
164
|
setUnitPinConstant(
|
|
158
165
|
unitId: string,
|
|
159
166
|
type: IO,
|
|
@@ -271,6 +278,7 @@ export type G_EE = {
|
|
|
271
278
|
set_unit_pin_constant: [string, IO, string, boolean, any, string[]]
|
|
272
279
|
set_unit_pin_ignored: [string, IO, string, boolean, string[]]
|
|
273
280
|
set_unit_pin_data: [string, IO, string, any, string[]]
|
|
281
|
+
set_unit_pin_set_id: [string, IO, string, string, string[]]
|
|
274
282
|
remove_unit_pin_data: [string, IO, string, string[]]
|
|
275
283
|
set_unit_pin_functional: [string, IO, string, boolean, string[]]
|
|
276
284
|
metadata: [{ path: string[]; data: any }, string[]]
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
GraphSetUnitPinConstant,
|
|
31
31
|
GraphSetUnitPinDataData,
|
|
32
32
|
GraphSetUnitPinIgnoredData,
|
|
33
|
+
GraphSetUnitPinSetId,
|
|
33
34
|
GraphTakeUnitErrData,
|
|
34
35
|
GraphUnplugPinData,
|
|
35
36
|
} from '../../../Class/Graph/interface'
|
|
@@ -79,6 +80,7 @@ export const G_METHOD_CALL_SET = [
|
|
|
79
80
|
'setUnitPinData',
|
|
80
81
|
'setUnitPinConstant',
|
|
81
82
|
'setUnitPinIgnored',
|
|
83
|
+
'setUnitPinSetId',
|
|
82
84
|
'setPinSetId',
|
|
83
85
|
'addMerge',
|
|
84
86
|
'removeMerge',
|
|
@@ -137,6 +139,7 @@ export interface $G_C {
|
|
|
137
139
|
$setPinSetFunctional(data: GraphSetPinSetFunctionalData): void
|
|
138
140
|
$addMerge(data: GraphAddMergeData): void
|
|
139
141
|
$removeMerge(data: GraphRemoveMergeData): void
|
|
142
|
+
$setUnitPinSetId(data: GraphSetUnitPinSetId): void
|
|
140
143
|
$setUnitPinConstant(data: GraphSetUnitPinConstant): void
|
|
141
144
|
$setUnitPinIgnored(data: GraphSetUnitPinIgnoredData): void
|
|
142
145
|
$addMerges(data: GraphAddMergesData): void
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
GraphSetUnitPinConstant,
|
|
31
31
|
GraphSetUnitPinDataData,
|
|
32
32
|
GraphSetUnitPinIgnoredData,
|
|
33
|
+
GraphSetUnitPinSetId,
|
|
33
34
|
GraphTakeUnitErrData,
|
|
34
35
|
GraphUnplugPinData,
|
|
35
36
|
} from '../../../Class/Graph/interface'
|
|
@@ -198,6 +199,15 @@ export const AsyncGCall = (graph: Graph): $G_C => {
|
|
|
198
199
|
graph.setUnitPinIgnored(unitId, type, pinId, ignored)
|
|
199
200
|
},
|
|
200
201
|
|
|
202
|
+
$setUnitPinSetId({
|
|
203
|
+
unitId,
|
|
204
|
+
type,
|
|
205
|
+
pinId,
|
|
206
|
+
nextPinId,
|
|
207
|
+
}: GraphSetUnitPinSetId): void {
|
|
208
|
+
graph.setUnitPinSetId(unitId, type, pinId, nextPinId)
|
|
209
|
+
},
|
|
210
|
+
|
|
201
211
|
$addMerge({ mergeId, mergeSpec: merge }: GraphAddMergeData) {
|
|
202
212
|
graph.addMerge(clone(merge), mergeId)
|
|
203
213
|
},
|
package/public/metadata.mp4
DELETED
|
Binary file
|