@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.
Files changed (56) hide show
  1. package/.node-version +1 -0
  2. package/.nvmrc +1 -0
  3. package/README.md +33 -0
  4. package/e2e/calculation.test.ts +247 -0
  5. package/e2e/e2eSuite.ts +8 -0
  6. package/e2e/env.ts +86 -0
  7. package/e2e/kitchen-sink.test.ts +85 -0
  8. package/e2e/runner.ts +10 -0
  9. package/e2e/withBrowser.ts +5 -0
  10. package/front/components.d.ts +25 -0
  11. package/front/locales/en.js +27 -0
  12. package/front/locales/en.json +5 -0
  13. package/front/src/App.vue +38 -12
  14. package/front/src/NavBar.vue +31 -0
  15. package/front/src/components/Edge.vue +1 -1
  16. package/front/src/components/EdgeEndHandle.vue +1 -1
  17. package/front/src/components/Flow.vue +5 -4
  18. package/front/src/components/Node.vue +1 -1
  19. package/front/src/components/NodeHandle.vue +1 -1
  20. package/front/src/components/NodePort.vue +1 -2
  21. package/front/src/components/index.js +10 -10
  22. package/front/src/config.js +90 -0
  23. package/front/src/demo/DemoEdge.vue +38 -0
  24. package/front/src/demo/DemoNodeCard.vue +86 -0
  25. package/front/src/demo/DemoPort.vue +34 -0
  26. package/front/src/demo/EnrichNode.vue +37 -0
  27. package/front/src/demo/FlowKitchenSink.vue +165 -0
  28. package/front/src/demo/OutputNode.vue +45 -0
  29. package/front/src/demo/SourceNode.vue +49 -0
  30. package/front/src/demo/calculation/AddNode.vue +35 -0
  31. package/front/src/demo/calculation/ConstantNode.vue +61 -0
  32. package/front/src/demo/calculation/FlowCalculationDemo.vue +300 -0
  33. package/front/src/demo/calculation/MultiplyNode.vue +35 -0
  34. package/front/src/demo/calculation/PowerNode.vue +62 -0
  35. package/front/src/demo/flowTestId.js +3 -0
  36. package/front/src/demo/runDemoGraph.js +76 -0
  37. package/front/src/demo/seedGraph.js +38 -0
  38. package/front/src/entry-client.js +2 -2
  39. package/front/src/entry-server.js +2 -1
  40. package/front/src/router.js +20 -12
  41. package/package.json +44 -37
  42. package/server/app.config.js +61 -0
  43. package/server/calculation/calculation.js +20 -0
  44. package/server/calculation/config.js +15 -0
  45. package/server/calculation/definition.js +11 -0
  46. package/server/calculation/index.js +12 -0
  47. package/server/calculation/ops.js +69 -0
  48. package/server/calculation/run.js +69 -0
  49. package/server/calculation/runGraph.js +85 -0
  50. package/server/calculation/tests/run.test.js +73 -0
  51. package/server/calculation/triggers.js +95 -0
  52. package/server/calculation/wire.js +30 -0
  53. package/server/init.js +1 -6
  54. package/server/services.list.js +11 -0
  55. package/server/start.js +39 -0
  56. 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
@@ -1,8 +1,3 @@
1
- const App = require('@live-change/framework')
2
- const app = App.app()
3
-
4
- module.exports = async function(services) {
5
-
6
-
1
+ export default async function init(services) {
7
2
 
8
3
  }
@@ -0,0 +1,11 @@
1
+ import session from '@live-change/session-service'
2
+ import flow from '@live-change/flow-service'
3
+ import calculation from './calculation/index.js'
4
+ import init from './init.js'
5
+
6
+ export {
7
+ session,
8
+ flow,
9
+ calculation,
10
+ init
11
+ }
@@ -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
- }