@live-change/flow-frontend 0.9.226 → 0.9.228
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/.node-version +1 -0
- package/.nvmrc +1 -0
- package/README.md +33 -0
- package/e2e/calculation.test.ts +247 -0
- package/e2e/e2eSuite.ts +8 -0
- package/e2e/env.ts +86 -0
- package/e2e/kitchen-sink.test.ts +85 -0
- package/e2e/runner.ts +10 -0
- package/e2e/withBrowser.ts +5 -0
- package/front/components.d.ts +25 -0
- package/front/locales/en.js +27 -0
- package/front/locales/en.json +5 -0
- package/front/src/App.vue +38 -12
- package/front/src/NavBar.vue +31 -0
- package/front/src/components/Edge.vue +1 -1
- package/front/src/components/EdgeEndHandle.vue +1 -1
- package/front/src/components/Flow.vue +5 -4
- package/front/src/components/Node.vue +1 -1
- package/front/src/components/NodeHandle.vue +1 -1
- package/front/src/components/NodePort.vue +1 -2
- package/front/src/components/index.js +10 -10
- package/front/src/config.js +90 -0
- package/front/src/demo/DemoEdge.vue +38 -0
- package/front/src/demo/DemoNodeCard.vue +86 -0
- package/front/src/demo/DemoPort.vue +34 -0
- package/front/src/demo/EnrichNode.vue +37 -0
- package/front/src/demo/FlowKitchenSink.vue +165 -0
- package/front/src/demo/OutputNode.vue +45 -0
- package/front/src/demo/SourceNode.vue +49 -0
- package/front/src/demo/calculation/AddNode.vue +35 -0
- package/front/src/demo/calculation/ConstantNode.vue +61 -0
- package/front/src/demo/calculation/FlowCalculationDemo.vue +300 -0
- package/front/src/demo/calculation/MultiplyNode.vue +35 -0
- package/front/src/demo/calculation/PowerNode.vue +62 -0
- package/front/src/demo/flowTestId.js +3 -0
- package/front/src/demo/runDemoGraph.js +76 -0
- package/front/src/demo/seedGraph.js +38 -0
- package/front/src/entry-client.js +2 -2
- package/front/src/entry-server.js +2 -1
- package/front/src/router.js +20 -12
- package/package.json +44 -37
- package/server/app.config.js +61 -0
- package/server/calculation/calculation.js +20 -0
- package/server/calculation/config.js +15 -0
- package/server/calculation/definition.js +11 -0
- package/server/calculation/index.js +12 -0
- package/server/calculation/ops.js +69 -0
- package/server/calculation/run.js +69 -0
- package/server/calculation/runGraph.js +85 -0
- package/server/calculation/tests/run.test.js +73 -0
- package/server/calculation/triggers.js +95 -0
- package/server/calculation/wire.js +30 -0
- package/server/init.js +1 -6
- package/server/services.list.js +11 -0
- package/server/start.js +39 -0
- package/server/services.config.js +0 -26
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
3
|
+
|
|
4
|
+
import definition from './definition.js'
|
|
5
|
+
import config from './config.js'
|
|
6
|
+
import { OP_TYPES } from './ops.js'
|
|
7
|
+
|
|
8
|
+
export const Wire = definition.model({
|
|
9
|
+
name: 'Wire',
|
|
10
|
+
itemOfAny: {
|
|
11
|
+
to: ['source', 'destination'],
|
|
12
|
+
sourceTypes: OP_TYPES,
|
|
13
|
+
destinationTypes: OP_TYPES,
|
|
14
|
+
readAccess: config.readAccess,
|
|
15
|
+
writeAccess: config.writeAccess,
|
|
16
|
+
createAccess: config.writeAccess,
|
|
17
|
+
updateAccess: config.writeAccess,
|
|
18
|
+
deleteAccess: config.writeAccess
|
|
19
|
+
},
|
|
20
|
+
properties: {
|
|
21
|
+
sourcePort: {
|
|
22
|
+
type: String,
|
|
23
|
+
validation: ['nonEmpty']
|
|
24
|
+
},
|
|
25
|
+
destinationPort: {
|
|
26
|
+
type: String,
|
|
27
|
+
validation: ['nonEmpty']
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
})
|
package/server/init.js
CHANGED
package/server/start.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import appConfig from './app.config.js'
|
|
2
|
+
|
|
3
|
+
import * as services from './services.list.js'
|
|
4
|
+
for (const serviceConfig of appConfig.services) {
|
|
5
|
+
serviceConfig.module = services[serviceConfig.name]
|
|
6
|
+
}
|
|
7
|
+
appConfig.init = services.init
|
|
8
|
+
|
|
9
|
+
import { fileURLToPath } from 'url'
|
|
10
|
+
import { dirname, join } from 'path'
|
|
11
|
+
import { accessSync, readFileSync } from 'fs'
|
|
12
|
+
|
|
13
|
+
const packageJsonPath = dirname(fileURLToPath(import.meta.url))
|
|
14
|
+
.split('/').map((part, i, arr) =>
|
|
15
|
+
join(arr.slice(0, arr.length - i).join('/'), 'package.json')
|
|
16
|
+
).find(p => { try { accessSync(p); return true } catch (e) { return false } })
|
|
17
|
+
const packageJson = packageJsonPath ? JSON.parse(readFileSync(packageJsonPath, 'utf-8')) : {}
|
|
18
|
+
|
|
19
|
+
const name = packageJson.name ?? 'flow-frontend'
|
|
20
|
+
const brandName = process.env.BRAND_NAME || 'Flow editor'
|
|
21
|
+
const homepage = process.env.BASE_HREF ?? packageJson.homepage
|
|
22
|
+
const brandDomain = process.env.BRAND_DOMAIN ||
|
|
23
|
+
(homepage && homepage.match(/https:\/\/([^/]+)/)?.[1]) || 'example.com'
|
|
24
|
+
const baseHref = process.env.BASE_HREF || homepage || 'http://localhost:8001'
|
|
25
|
+
const version = process.env.VERSION || packageJson.version
|
|
26
|
+
|
|
27
|
+
appConfig.clientConfig = {
|
|
28
|
+
version,
|
|
29
|
+
name,
|
|
30
|
+
brandName,
|
|
31
|
+
brandDomain,
|
|
32
|
+
homepage,
|
|
33
|
+
baseHref,
|
|
34
|
+
...appConfig.clientConfig
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
import { starter } from '@live-change/cli'
|
|
38
|
+
|
|
39
|
+
starter(appConfig, {}, { version })
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
services: [
|
|
3
|
-
{
|
|
4
|
-
name: 'session',
|
|
5
|
-
path: '@live-change/session-service',
|
|
6
|
-
createSessionOnUpdate: true
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'upload',
|
|
10
|
-
path: '@live-change/upload-service'
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: "image",
|
|
14
|
-
path: '@live-change/image-service'
|
|
15
|
-
},
|
|
16
|
-
/* {
|
|
17
|
-
name: 'prosemirror',
|
|
18
|
-
path: '@live-change/prosemirror-service',
|
|
19
|
-
documentTypes: {
|
|
20
|
-
rich: require('./rich.documentType.js'),
|
|
21
|
-
page: require('./page.documentType.js')
|
|
22
|
-
},
|
|
23
|
-
testLatency: 1000
|
|
24
|
-
}*/
|
|
25
|
-
]
|
|
26
|
-
}
|