1 Commits

Author SHA1 Message Date
Eric Tuvesson
0668d0e928 fix(runtime): Base URL with Script node external file 2024-07-15 15:19:15 +02:00
15 changed files with 335 additions and 249 deletions

View File

@@ -1,15 +1,15 @@
name: Build fluxscape-editor name: Build noodl-editor
on: on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
# Allows you to run this workflow from another workflow # Allows you to run this workflow from another workflow
workflow_call: workflow_call:
# release: # release:
# types: [created] # types: [created]
jobs: jobs:
build_noodl_editor: build_noodl_editor:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -32,11 +32,11 @@ jobs:
platform: linux-x64 platform: linux-x64
steps: steps:
- if: ${{ matrix.platform == 'darwin-arm64' }} - if: ${{ matrix.platform == 'darwin-arm64' }}
name: Setup name: Setup
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.11' python-version: '3.11'
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -72,6 +72,6 @@ jobs:
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: fluxscape-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }} name: noodl-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
path: publish path: publish
retention-days: '12' retention-days: "12"

View File

@@ -1,4 +1,4 @@
name: Test fluxscape-editor name: Test noodl-editor
on: on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab

301
package-lock.json generated
View File

@@ -25220,9 +25220,9 @@
} }
}, },
"node_modules/electron": { "node_modules/electron": {
"version": "31.3.1", "version": "31.1.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-31.1.0.tgz",
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==", "integrity": "sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@electron/get": "^2.0.0", "@electron/get": "^2.0.0",
@@ -27211,10 +27211,6 @@
"react": "^15.0.2 || ^16.0.0 || ^17.0.0" "react": "^15.0.2 || ^16.0.0 || ^17.0.0"
} }
}, },
"node_modules/fluxscape-editor": {
"resolved": "packages/noodl-editor",
"link": true
},
"node_modules/focus-lock": { "node_modules/focus-lock": {
"version": "0.8.1", "version": "0.8.1",
"dev": true, "dev": true,
@@ -35455,6 +35451,10 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/noodl-editor": {
"resolved": "packages/noodl-editor",
"link": true
},
"node_modules/nopt": { "node_modules/nopt": {
"version": "1.0.10", "version": "1.0.10",
"license": "MIT", "license": "MIT",
@@ -48980,8 +48980,7 @@
"dev": true "dev": true
}, },
"packages/noodl-editor": { "packages/noodl-editor": {
"name": "fluxscape-editor", "version": "1.0.0",
"version": "1.1.0",
"dependencies": { "dependencies": {
"@electron/remote": "^2.1.2", "@electron/remote": "^2.1.2",
"@jaames/iro": "^5.5.2", "@jaames/iro": "^5.5.2",
@@ -49039,7 +49038,7 @@
"babel-loader": "^8.2.4", "babel-loader": "^8.2.4",
"concurrently": "^7.4.0", "concurrently": "^7.4.0",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"electron": "31.3.1", "electron": "^31.1.0",
"electron-builder": "^24.9.1", "electron-builder": "^24.9.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-loader": "^3.1.0", "html-loader": "^3.1.0",
@@ -74071,9 +74070,9 @@
} }
}, },
"electron": { "electron": {
"version": "31.3.1", "version": "31.1.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-31.1.0.tgz",
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==", "integrity": "sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==",
"requires": { "requires": {
"@electron/get": "^2.0.0", "@electron/get": "^2.0.0",
"@types/node": "^20.9.0", "@types/node": "^20.9.0",
@@ -75432,144 +75431,6 @@
"fbjs": "^3.0.1" "fbjs": "^3.0.1"
} }
}, },
"fluxscape-editor": {
"version": "file:packages/noodl-editor",
"requires": {
"@babel/core": "^7.19.1",
"@babel/preset-react": "^7.18.6",
"@electron/remote": "^2.1.2",
"@jaames/iro": "^5.5.2",
"@microsoft/fetch-event-source": "^2.0.1",
"@noodl/git": "file:../noodl-git",
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
"@noodl/platform": "file:../noodl-platform",
"@noodl/platform-electron": "file:../noodl-platform-electron",
"@svgr/webpack": "^6.4.0",
"@types/checksum": "^0.1.33",
"@types/jasmine": "^4.3.0",
"@types/jquery": "^3.5.14",
"@types/react": "^17.0.50",
"@types/react-dom": "^18.0.0",
"@types/remarkable": "^2.0.3",
"@types/rimraf": "^3.0.2",
"@types/split2": "^3.2.1",
"@types/string.prototype.matchall": "^4.0.1",
"@types/underscore": "^1.11.4",
"@types/webpack-env": "^1.18.0",
"about-window": "^1.15.2",
"algoliasearch": "^4.14.2",
"archiver": "^5.3.0",
"async": "^3.2.4",
"babel-loader": "^8.2.4",
"classnames": "^2.3.2",
"concurrently": "^7.4.0",
"css-loader": "^6.7.1",
"diff3": "0.0.4",
"dmg-license": "^1.0.11",
"electron": "31.3.1",
"electron-builder": "^24.9.1",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"express": "^4.17.3",
"file-loader": "^6.2.0",
"highlight.js": "^11.5.1",
"html-loader": "^3.1.0",
"isbinaryfile": "^5.0.0",
"md5": "^2.3.0",
"md5-file": "^5.0.0",
"mixpanel-browser": "^2.45.0",
"mkdirp": "0.5.1",
"mkdirp-sync": "0.0.2",
"monaco-editor": "^0.34.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"ncp": "^2.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.0",
"react-hot-toast": "^2.4.0",
"react-instantsearch-hooks-web": "^6.38.0",
"react-json-view": "^1.21.3",
"react-rnd": "^10.3.7",
"remarkable": "^2.0.1",
"rimraf": "^3.0.2",
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
"sass": "^1.55.0",
"sass-loader": "^12.6.0",
"string.prototype.matchall": "^4.0.7",
"stringify": "^5.2.0",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.1",
"ts-node": "^10.7.0",
"typescript": "^4.8.3",
"underscore": "^1.13.6",
"url-loader": "^4.1.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0",
"websocket-stream": "^5.5.2",
"ws": "^8.9.0"
},
"dependencies": {
"@webpack-cli/configtest": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
"dev": true,
"requires": {}
},
"@webpack-cli/info": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
"dev": true,
"requires": {
"envinfo": "^7.7.3"
}
},
"@webpack-cli/serve": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
"dev": true,
"requires": {}
},
"commander": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true
},
"rechoir": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
"dev": true,
"requires": {
"resolve": "^1.9.0"
}
},
"webpack-cli": {
"version": "4.10.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
"dev": true,
"requires": {
"@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.2.0",
"@webpack-cli/info": "^1.5.0",
"@webpack-cli/serve": "^1.7.0",
"colorette": "^2.0.14",
"commander": "^7.0.0",
"cross-spawn": "^7.0.3",
"fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2",
"interpret": "^2.2.0",
"rechoir": "^0.7.0",
"webpack-merge": "^5.7.3"
}
}
}
},
"focus-lock": { "focus-lock": {
"version": "0.8.1", "version": "0.8.1",
"dev": true, "dev": true,
@@ -81145,6 +81006,144 @@
"version": "2.0.10", "version": "2.0.10",
"dev": true "dev": true
}, },
"noodl-editor": {
"version": "file:packages/noodl-editor",
"requires": {
"@babel/core": "^7.19.1",
"@babel/preset-react": "^7.18.6",
"@electron/remote": "^2.1.2",
"@jaames/iro": "^5.5.2",
"@microsoft/fetch-event-source": "^2.0.1",
"@noodl/git": "file:../noodl-git",
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
"@noodl/platform": "file:../noodl-platform",
"@noodl/platform-electron": "file:../noodl-platform-electron",
"@svgr/webpack": "^6.4.0",
"@types/checksum": "^0.1.33",
"@types/jasmine": "^4.3.0",
"@types/jquery": "^3.5.14",
"@types/react": "^17.0.50",
"@types/react-dom": "^18.0.0",
"@types/remarkable": "^2.0.3",
"@types/rimraf": "^3.0.2",
"@types/split2": "^3.2.1",
"@types/string.prototype.matchall": "^4.0.1",
"@types/underscore": "^1.11.4",
"@types/webpack-env": "^1.18.0",
"about-window": "^1.15.2",
"algoliasearch": "^4.14.2",
"archiver": "^5.3.0",
"async": "^3.2.4",
"babel-loader": "^8.2.4",
"classnames": "^2.3.2",
"concurrently": "^7.4.0",
"css-loader": "^6.7.1",
"diff3": "0.0.4",
"dmg-license": "^1.0.11",
"electron": "^31.1.0",
"electron-builder": "^24.9.1",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"express": "^4.17.3",
"file-loader": "^6.2.0",
"highlight.js": "^11.5.1",
"html-loader": "^3.1.0",
"isbinaryfile": "^5.0.0",
"md5": "^2.3.0",
"md5-file": "^5.0.0",
"mixpanel-browser": "^2.45.0",
"mkdirp": "0.5.1",
"mkdirp-sync": "0.0.2",
"monaco-editor": "^0.34.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"ncp": "^2.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.0",
"react-hot-toast": "^2.4.0",
"react-instantsearch-hooks-web": "^6.38.0",
"react-json-view": "^1.21.3",
"react-rnd": "^10.3.7",
"remarkable": "^2.0.1",
"rimraf": "^3.0.2",
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
"sass": "^1.55.0",
"sass-loader": "^12.6.0",
"string.prototype.matchall": "^4.0.7",
"stringify": "^5.2.0",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.1",
"ts-node": "^10.7.0",
"typescript": "^4.8.3",
"underscore": "^1.13.6",
"url-loader": "^4.1.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0",
"websocket-stream": "^5.5.2",
"ws": "^8.9.0"
},
"dependencies": {
"@webpack-cli/configtest": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
"dev": true,
"requires": {}
},
"@webpack-cli/info": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
"dev": true,
"requires": {
"envinfo": "^7.7.3"
}
},
"@webpack-cli/serve": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
"dev": true,
"requires": {}
},
"commander": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true
},
"rechoir": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
"dev": true,
"requires": {
"resolve": "^1.9.0"
}
},
"webpack-cli": {
"version": "4.10.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
"dev": true,
"requires": {
"@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.2.0",
"@webpack-cli/info": "^1.5.0",
"@webpack-cli/serve": "^1.7.0",
"colorette": "^2.0.14",
"commander": "^7.0.0",
"cross-spawn": "^7.0.3",
"fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2",
"interpret": "^2.2.0",
"rechoir": "^0.7.0",
"webpack-merge": "^5.7.3"
}
}
}
},
"nopt": { "nopt": {
"version": "1.0.10", "version": "1.0.10",
"requires": { "requires": {

View File

@@ -12,7 +12,7 @@
"graph": "npx nx graph", "graph": "npx nx graph",
"ci:prepare:editor": "ts-node ./scripts/ci-editor-prepare.ts", "ci:prepare:editor": "ts-node ./scripts/ci-editor-prepare.ts",
"ci:build:viewer": "lerna exec --scope @noodl/noodl-viewer-react -- npm run build", "ci:build:viewer": "lerna exec --scope @noodl/noodl-viewer-react -- npm run build",
"ci:build:editor": "lerna exec --scope fluxscape-editor -- npm run ci:build", "ci:build:editor": "lerna exec --scope noodl-editor -- npm run ci:build",
"build:editor": "ts-node ./scripts/build-editor.ts", "build:editor": "ts-node ./scripts/build-editor.ts",
"build:editor:_viewer": "ts-node ./scripts/noodl-editor/build-viewer.ts", "build:editor:_viewer": "ts-node ./scripts/noodl-editor/build-viewer.ts",
"build:editor:_editor": "ts-node ./scripts/noodl-editor/build-editor.ts", "build:editor:_editor": "ts-node ./scripts/noodl-editor/build-editor.ts",
@@ -20,7 +20,7 @@
"build:cloud-runtime": "lerna run build --scope @noodl/cloud-runtime --stream && lerna run build:pack --scope @noodl/cloud-runtime --stream", "build:cloud-runtime": "lerna run build --scope @noodl/cloud-runtime --stream && lerna run build:pack --scope @noodl/cloud-runtime --stream",
"start:storybook": "lerna exec --scope @noodl/noodl-core-ui -- npm run start", "start:storybook": "lerna exec --scope @noodl/noodl-core-ui -- npm run start",
"start:viewer": "lerna run start --scope @noodl/noodl-viewer-react --stream", "start:viewer": "lerna run start --scope @noodl/noodl-viewer-react --stream",
"start:editor": "lerna run start --scope fluxscape-editor --stream", "start:editor": "lerna run start --scope noodl-editor --stream",
"dev": "ts-node ./scripts/start.ts", "dev": "ts-node ./scripts/start.ts",
"start": "ts-node ./scripts/start.ts -- --build-viewer", "start": "ts-node ./scripts/start.ts -- --build-viewer",
"test:editor": "ts-node ./scripts/test-editor.ts", "test:editor": "ts-node ./scripts/test-editor.ts",
@@ -47,4 +47,4 @@
"npm": ">=6.0.0", "npm": ">=6.0.0",
"node": ">=16.0.0 <=18" "node": ">=16.0.0 <=18"
} }
} }

View File

@@ -1,10 +1,10 @@
{ {
"name": "fluxscape-editor", "name": "noodl-editor",
"productName": "Fluxscape", "productName": "Fluxscape",
"description": "Node-Based App Builder for Scalability & Rapid Development, a fork of Noodl", "description": "Node-Based App Builder for Scalability & Rapid Development, a fork of Noodl",
"author": "Fluxscape <contact@fluxscape.io>", "author": "Fluxscape <contact@fluxscape.io>",
"homepage": "https://fluxscape.io", "homepage": "https://fluxscape.io",
"version": "1.1.0", "version": "1.0.0",
"main": "src/main/main.js", "main": "src/main/main.js",
"scripts": { "scripts": {
"build": "npx ts-node -P ./tsconfig.build.json ./scripts/build.ts", "build": "npx ts-node -P ./tsconfig.build.json ./scripts/build.ts",
@@ -114,7 +114,7 @@
"babel-loader": "^8.2.4", "babel-loader": "^8.2.4",
"concurrently": "^7.4.0", "concurrently": "^7.4.0",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"electron": "31.3.1", "electron": "^31.1.0",
"electron-builder": "^24.9.1", "electron-builder": "^24.9.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-loader": "^3.1.0", "html-loader": "^3.1.0",
@@ -141,4 +141,4 @@
"optionalDependencies": { "optionalDependencies": {
"dmg-license": "^1.0.11" "dmg-license": "^1.0.11"
} }
} }

View File

@@ -1,21 +1,20 @@
//this just assumes the base url is '/' always //this just assumes the base url is '/' always
function getAbsoluteUrl(_url) { function getAbsoluteUrl(_url) {
//convert to string in case the _url is a Cloud File (which is an object with a custom toString()) //convert to string in case the _url is a Cloud File (which is an object with a custom toString())
const url = String(_url); const url = String(_url);
//only add a the base url if this is a local URL (e.g. not a https url or base64 string) //only add a the base url if this is a local URL (e.g. not a https url or base64 string)
if (!url || url[0] === "/" || url.includes("://") || url.startsWith('data:')) { if (!url || url[0] === '/' || url.includes('://') || url.startsWith('data:')) {
return url; return url;
} }
return (Noodl.baseUrl || '/') + url; return (Noodl.Env['BaseUrl'] || '/') + url;
} }
/** /**
* Log an error thrown by the JavaScript nodes. * Log an error thrown by the JavaScript nodes.
* *
* @param {any} error * @param {any} error
*/ */
function logJavaScriptNodeError(error) { function logJavaScriptNodeError(error) {
if (typeof error === 'string') { if (typeof error === 'string') {

View File

@@ -132,7 +132,6 @@ export function Columns(props: ColumnsProps) {
className={['columns-container', props.className].join(' ')} className={['columns-container', props.className].join(' ')}
ref={containerRef} ref={containerRef}
style={{ style={{
visibility: containerWidth === null ? "hidden" : "visible",
marginTop: parseFloat(props.marginY) * -1, marginTop: parseFloat(props.marginY) * -1,
marginLeft: parseFloat(props.marginX) * -1, marginLeft: parseFloat(props.marginX) * -1,
display: 'flex', display: 'flex',

View File

@@ -43,10 +43,6 @@ const OpenFilePicker = {
input.accept = this._internal.acceptedFileTypes; input.accept = this._internal.acceptedFileTypes;
if (this._internal.capture) {
input.capture = this._internal.capture;
}
input.onchange = onChange; input.onchange = onChange;
input.click(); input.click();
} }
@@ -58,14 +54,6 @@ const OpenFilePicker = {
set(value) { set(value) {
this._internal.acceptedFileTypes = value; this._internal.acceptedFileTypes = value;
} }
},
capture: {
group: 'General',
type: 'string',
displayName: 'Capture',
set(value) {
this._internal.capture = value;
}
} }
}, },
outputs: { outputs: {

View File

@@ -4,7 +4,7 @@ const Switch = {
name: 'Switch', name: 'Switch',
docs: 'https://docs.noodl.net/nodes/logic/switch', docs: 'https://docs.noodl.net/nodes/logic/switch',
category: 'Logic', category: 'Logic',
initialize() { initialize: function () {
this._internal.state = false; this._internal.state = false;
this._internal.initialized = false; this._internal.initialized = false;
}, },
@@ -15,7 +15,7 @@ const Switch = {
on: { on: {
displayName: 'On', displayName: 'On',
group: 'Change State', group: 'Change State',
valueChangedToTrue() { valueChangedToTrue: function () {
if (this._internal.state === true) { if (this._internal.state === true) {
return; return;
} }
@@ -27,7 +27,7 @@ const Switch = {
off: { off: {
displayName: 'Off', displayName: 'Off',
group: 'Change State', group: 'Change State',
valueChangedToTrue() { valueChangedToTrue: function () {
if (this._internal.state === false) { if (this._internal.state === false) {
return; return;
} }
@@ -39,7 +39,7 @@ const Switch = {
flip: { flip: {
displayName: 'Flip', displayName: 'Flip',
group: 'Change State', group: 'Change State',
valueChangedToTrue() { valueChangedToTrue: function () {
this._internal.state = !this._internal.state; this._internal.state = !this._internal.state;
this.flagOutputDirty('state'); this.flagOutputDirty('state');
this.emitSignals(); this.emitSignals();
@@ -50,7 +50,7 @@ const Switch = {
displayName: 'State', displayName: 'State',
group: 'General', group: 'General',
default: false, default: false,
set(value) { set: function (value) {
this._internal.state = !!value; this._internal.state = !!value;
this.flagOutputDirty('state'); this.flagOutputDirty('state');
this.emitSignals(); this.emitSignals();
@@ -61,15 +61,10 @@ const Switch = {
state: { state: {
type: 'boolean', type: 'boolean',
displayName: 'Current State', displayName: 'Current State',
getter() { getter: function () {
return this._internal.state; return this._internal.state;
} }
}, },
switched: {
displayName: 'Switched',
type: 'signal',
group: 'Signals'
},
switchedToOn: { switchedToOn: {
displayName: 'Switched To On', displayName: 'Switched To On',
type: 'signal', type: 'signal',
@@ -82,13 +77,12 @@ const Switch = {
} }
}, },
prototypeExtensions: { prototypeExtensions: {
emitSignals() { emitSignals: function () {
if (this._internal.state === true) { if (this._internal.state === true) {
this.sendSignalOnOutput('switchedToOn'); this.sendSignalOnOutput('switchedToOn');
} else { } else {
this.sendSignalOnOutput('switchedToOff'); this.sendSignalOnOutput('switchedToOff');
} }
this.sendSignalOnOutput('switched');
} }
} }
}; };

View File

@@ -1,13 +1,18 @@
'use strict'; 'use strict';
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
const UserService = require('./userservice'); const UserService = require('./userservice');
const LoginNodeDefinition = { var LoginNodeDefinition = {
name: 'net.noodl.user.LogIn', name: 'net.noodl.user.LogIn',
docs: 'https://docs.noodl.net/nodes/data/user/log-in', docs: 'https://docs.noodl.net/nodes/data/user/log-in',
displayNodeName: 'Log In', displayNodeName: 'Log In',
category: 'Cloud Services', category: 'Cloud Services',
color: 'data', color: 'data',
initialize: function () {
var internal = this._internal;
},
getInspectInfo() {},
outputs: { outputs: {
success: { success: {
type: 'signal', type: 'signal',
@@ -23,7 +28,7 @@ const LoginNodeDefinition = {
type: 'string', type: 'string',
displayName: 'Error', displayName: 'Error',
group: 'Error', group: 'Error',
getter() { getter: function () {
return this._internal.error; return this._internal.error;
} }
} }
@@ -32,7 +37,7 @@ const LoginNodeDefinition = {
login: { login: {
displayName: 'Do', displayName: 'Do',
group: 'Actions', group: 'Actions',
valueChangedToTrue() { valueChangedToTrue: function () {
this.scheduleLogIn(); this.scheduleLogIn();
} }
}, },
@@ -40,7 +45,7 @@ const LoginNodeDefinition = {
displayName: 'Username', displayName: 'Username',
type: 'string', type: 'string',
group: 'General', group: 'General',
set(value) { set: function (value) {
this._internal.username = value; this._internal.username = value;
} }
}, },
@@ -48,13 +53,13 @@ const LoginNodeDefinition = {
displayName: 'Password', displayName: 'Password',
type: 'string', type: 'string',
group: 'General', group: 'General',
set(value) { set: function (value) {
this._internal.password = value; this._internal.password = value;
} }
} }
}, },
methods: { methods: {
setError(err) { setError: function (err) {
this._internal.error = err; this._internal.error = err;
this.flagOutputDirty('error'); this.flagOutputDirty('error');
this.sendSignalOnOutput('failure'); this.sendSignalOnOutput('failure');
@@ -71,7 +76,9 @@ const LoginNodeDefinition = {
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning'); this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
} }
}, },
scheduleLogIn() { scheduleLogIn: function () {
const internal = this._internal;
if (this.logInScheduled === true) return; if (this.logInScheduled === true) return;
this.logInScheduled = true; this.logInScheduled = true;
@@ -93,7 +100,89 @@ const LoginNodeDefinition = {
} }
}; };
/*function updatePorts(nodeId, parameters, editorConnection, dbCollections) {
var ports = [];
ports.push({
name: 'collectionName',
displayName: "Class",
group: "General",
type: { name: 'enum', enums: (dbCollections !== undefined) ? dbCollections.map((c) => { return { value: c.name, label: c.name } }) : [], allowEditOnly: true },
plug: 'input'
})
if (parameters.collectionName && dbCollections) {
// Fetch ports from collection keys
var c = dbCollections.find((c) => c.name === parameters.collectionName);
if (c && c.schema && c.schema.properties) {
var props = c.schema.properties;
for (var key in props) {
var p = props[key];
if (ports.find((_p) => _p.name === key)) continue;
if(p.type === 'Relation') {
}
else { // Other schema type ports
const _typeMap = {
"String":"string",
"Boolean":"boolean",
"Number":"number",
"Date":"date"
}
ports.push({
type: {
name: _typeMap[p.type]?_typeMap[p.type]:'*',
},
plug: 'output',
group: 'Properties',
name: 'prop-' + key,
displayName: key,
})
ports.push({
type: 'signal',
plug: 'output',
group: 'Changed Events',
displayName: key+ ' Changed',
name: 'changed-' + key,
})
}
}
}
}
editorConnection.sendDynamicPorts(nodeId, ports);
}*/
module.exports = { module.exports = {
node: LoginNodeDefinition, node: LoginNodeDefinition,
setup(_context, _graphModel) {} setup: function (context, graphModel) {
/* if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
return;
}
function _managePortsForNode(node) {
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
node.on("parameterUpdated", function (event) {
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
});
graphModel.on('metadataChanged.dbCollections', function (data) {
updatePorts(node.id, node.parameters, context.editorConnection, data);
})
}
graphModel.on("editorImportComplete", ()=> {
graphModel.on("nodeAdded.DbModel2", function (node) {
_managePortsForNode(node)
})
for(const node of graphModel.getNodesWithType('DbModel2')) {
_managePortsForNode(node)
}
})*/
}
}; };

View File

@@ -1,13 +1,18 @@
'use strict'; 'use strict';
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
const UserService = require('./userservice'); const UserService = require('./userservice');
const LogOutNodeDefinition = { var LogOutNodeDefinition = {
name: 'net.noodl.user.LogOut', name: 'net.noodl.user.LogOut',
docs: 'https://docs.noodl.net/nodes/data/user/log-out', docs: 'https://docs.noodl.net/nodes/data/user/log-out',
displayNodeName: 'Log Out', displayNodeName: 'Log Out',
category: 'Cloud Services', category: 'Cloud Services',
color: 'data', color: 'data',
initialize: function () {
var internal = this._internal;
},
getInspectInfo() {},
outputs: { outputs: {
success: { success: {
type: 'signal', type: 'signal',
@@ -23,7 +28,7 @@ const LogOutNodeDefinition = {
type: 'string', type: 'string',
displayName: 'Error', displayName: 'Error',
group: 'Error', group: 'Error',
getter() { getter: function () {
return this._internal.error; return this._internal.error;
} }
} }
@@ -32,13 +37,13 @@ const LogOutNodeDefinition = {
login: { login: {
displayName: 'Do', displayName: 'Do',
group: 'Actions', group: 'Actions',
valueChangedToTrue() { valueChangedToTrue: function () {
this.scheduleLogOut(); this.scheduleLogOut();
} }
} }
}, },
methods: { methods: {
setError(err) { setError: function (err) {
this._internal.error = err; this._internal.error = err;
this.flagOutputDirty('error'); this.flagOutputDirty('error');
this.sendSignalOnOutput('failure'); this.sendSignalOnOutput('failure');
@@ -55,7 +60,9 @@ const LogOutNodeDefinition = {
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning'); this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
} }
}, },
scheduleLogOut() { scheduleLogOut: function () {
const internal = this._internal;
if (this.logOutScheduled === true) return; if (this.logOutScheduled === true) return;
this.logOutScheduled = true; this.logOutScheduled = true;
@@ -77,5 +84,5 @@ const LogOutNodeDefinition = {
module.exports = { module.exports = {
node: LogOutNodeDefinition, node: LogOutNodeDefinition,
setup(_context, _graphModel) {} setup: function (context, graphModel) {}
}; };

View File

@@ -1,17 +1,20 @@
'use strict'; 'use strict';
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
const UserService = require('./userservice'); const UserService = require('./userservice');
const SignUpNodeDefinition = { var SignUpNodeDefinition = {
name: 'net.noodl.user.SignUp', name: 'net.noodl.user.SignUp',
docs: 'https://docs.noodl.net/nodes/data/user/sign-up', docs: 'https://docs.noodl.net/nodes/data/user/sign-up',
displayNodeName: 'Sign Up', displayNodeName: 'Sign Up',
category: 'Cloud Services', category: 'Cloud Services',
color: 'data', color: 'data',
initialize() { initialize: function () {
const internal = this._internal; var internal = this._internal;
internal.userProperties = {}; internal.userProperties = {};
}, },
getInspectInfo() {},
outputs: { outputs: {
success: { success: {
type: 'signal', type: 'signal',
@@ -27,7 +30,7 @@ const SignUpNodeDefinition = {
type: 'string', type: 'string',
displayName: 'Error', displayName: 'Error',
group: 'Error', group: 'Error',
getter() { getter: function () {
return this._internal.error; return this._internal.error;
} }
} }
@@ -36,7 +39,7 @@ const SignUpNodeDefinition = {
signup: { signup: {
displayName: 'Do', displayName: 'Do',
group: 'Actions', group: 'Actions',
valueChangedToTrue() { valueChangedToTrue: function () {
this.scheduleSignUp(); this.scheduleSignUp();
} }
}, },
@@ -44,7 +47,7 @@ const SignUpNodeDefinition = {
displayName: 'Username', displayName: 'Username',
type: 'string', type: 'string',
group: 'General', group: 'General',
set(value) { set: function (value) {
this._internal.username = value; this._internal.username = value;
} }
}, },
@@ -52,7 +55,7 @@ const SignUpNodeDefinition = {
displayName: 'Password', displayName: 'Password',
type: 'string', type: 'string',
group: 'General', group: 'General',
set(value) { set: function (value) {
this._internal.password = value; this._internal.password = value;
} }
}, },
@@ -60,13 +63,13 @@ const SignUpNodeDefinition = {
displayName: 'Email', displayName: 'Email',
type: 'string', type: 'string',
group: 'General', group: 'General',
set(value) { set: function (value) {
this._internal.email = value; this._internal.email = value;
} }
} }
}, },
methods: { methods: {
setError(err) { setError: function (err) {
this._internal.error = err; this._internal.error = err;
this.flagOutputDirty('error'); this.flagOutputDirty('error');
this.sendSignalOnOutput('failure'); this.sendSignalOnOutput('failure');
@@ -83,7 +86,7 @@ const SignUpNodeDefinition = {
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning'); this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
} }
}, },
scheduleSignUp() { scheduleSignUp: function () {
const internal = this._internal; const internal = this._internal;
if (this.signUpScheduled === true) return; if (this.signUpScheduled === true) return;
@@ -106,24 +109,23 @@ const SignUpNodeDefinition = {
}); });
}); });
}, },
setUserProperty(name, value) { setUserProperty: function (name, value) {
this._internal.userProperties[name] = value; this._internal.userProperties[name] = value;
}, },
registerInputIfNeeded(name) { registerInputIfNeeded: function (name) {
if (this.hasInput(name)) { if (this.hasInput(name)) {
return; return;
} }
if (name.startsWith('prop-')) { if (name.startsWith('prop-'))
return this.registerInput(name, { return this.registerInput(name, {
set: this.setUserProperty.bind(this, name.substring('prop-'.length)) set: this.setUserProperty.bind(this, name.substring('prop-'.length))
}); });
}
} }
} }
}; };
function updatePorts(nodeId, _parameters, editorConnection, systemCollections) { function updatePorts(nodeId, parameters, editorConnection, systemCollections) {
var ports = []; var ports = [];
if (systemCollections) { if (systemCollections) {
@@ -167,7 +169,7 @@ function updatePorts(nodeId, _parameters, editorConnection, systemCollections) {
module.exports = { module.exports = {
node: SignUpNodeDefinition, node: SignUpNodeDefinition,
setup(context, graphModel) { setup: function (context, graphModel) {
if (!context.editorConnection || !context.editorConnection.isRunningLocally()) { if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
return; return;
} }
@@ -175,7 +177,7 @@ module.exports = {
function _managePortsForNode(node) { function _managePortsForNode(node) {
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections')); updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
node.on('parameterUpdated', function (_event) { node.on('parameterUpdated', function (event) {
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections')); updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
}); });

View File

@@ -72,18 +72,18 @@ import { getCurrentPlatform } from '../helper';
// NOTE: Getting error "Cannot set properties of null (setting 'dev')" here, // NOTE: Getting error "Cannot set properties of null (setting 'dev')" here,
// It basically means that some package is not relative to this path. // It basically means that some package is not relative to this path.
console.log("--- Run 'npm install' ..."); console.log("--- Run 'npm install' ...");
if (platform === 'darwin') { if (platform === "darwin") {
execSync(`npm install electron-notarize`, { execSync(`npm install electron-notarize`, {
stdio: 'inherit', stdio: 'inherit',
env: process.env env: process.env
}); })
} }
execSync(`npm install --arch=${arch} --scope fluxscape-editor`, { execSync(`npm install --arch=${arch} --scope noodl-editor`, {
stdio: 'inherit', stdio: 'inherit',
env: process.env env: process.env
}); })
console.log("--- 'npm install' done!"); console.log("--- 'npm install' done!");
// NOTE: npm install --arch= does this too // NOTE: npm install --arch= does this too
@@ -99,13 +99,13 @@ import { getCurrentPlatform } from '../helper';
// Build: Replace "dugite" // Build: Replace "dugite"
// Build: Replace "desktop-trampoline" // Build: Replace "desktop-trampoline"
console.log("--- Run 'npm run build' ..."); console.log("--- Run 'npm run build' ...");
execSync('npx lerna exec --scope fluxscape-editor -- npm run build', { execSync('npx lerna exec --scope noodl-editor -- npm run build', {
stdio: 'inherit', stdio: 'inherit',
env: { env: {
...process.env, ...process.env,
TARGET_PLATFORM, TARGET_PLATFORM,
DISABLE_SIGNING, DISABLE_SIGNING,
CSC_NAME CSC_NAME,
} }
}); });
console.log("--- 'npm run build' done!"); console.log("--- 'npm run build' done!");

View File

@@ -74,7 +74,7 @@ const cloudRuntimeProcess = attachStdio(
} }
); );
const editorProcess = attachStdio(exec('npx lerna exec --scope fluxscape-editor -- npm run start', processOptions), { const editorProcess = attachStdio(exec('npx lerna exec --scope noodl-editor -- npm run start', processOptions), {
prefix: 'Editor', prefix: 'Editor',
color: ConsoleColor.FgCyan color: ConsoleColor.FgCyan
}); });

View File

@@ -1,27 +1,36 @@
import { execSync } from 'child_process'; import path from "path";
import path from 'path'; import { execSync } from "child_process";
const CWD = path.join(__dirname, '..'); const CWD = path.join(__dirname, "..");
const LOCAL_GIT_DIRECTORY = path.join(__dirname, '..', 'node_modules', 'dugite', 'git'); const LOCAL_GIT_DIRECTORY = path.join(
__dirname,
"..",
"node_modules",
"dugite",
"git"
);
const LOCAL_GIT_TRAMPOLINE_DIRECTORY = path.join( const LOCAL_GIT_TRAMPOLINE_DIRECTORY = path.join(
__dirname, __dirname,
'..', "..",
'node_modules', "node_modules",
'desktop-trampoline/build/Release/desktop-trampoline' "desktop-trampoline/build/Release/desktop-trampoline"
); );
console.log('---'); console.log("---");
console.log(`> CWD: `, CWD); console.log(`> CWD: `, CWD);
console.log(`> LOCAL_GIT_DIRECTORY: `, LOCAL_GIT_DIRECTORY); console.log(`> LOCAL_GIT_DIRECTORY: `, LOCAL_GIT_DIRECTORY);
console.log(`> LOCAL_GIT_TRAMPOLINE_DIRECTORY: `, LOCAL_GIT_TRAMPOLINE_DIRECTORY); console.log(
console.log('---'); `> LOCAL_GIT_TRAMPOLINE_DIRECTORY: `,
LOCAL_GIT_TRAMPOLINE_DIRECTORY
);
console.log("---");
execSync('npx lerna exec --scope fluxscape-editor -- npm run test', { execSync("npx lerna exec --scope noodl-editor -- npm run test", {
cwd: CWD, cwd: CWD,
stdio: 'inherit', stdio: "inherit",
env: { env: {
...process.env, ...process.env,
LOCAL_GIT_DIRECTORY, LOCAL_GIT_DIRECTORY,
LOCAL_GIT_TRAMPOLINE_DIRECTORY LOCAL_GIT_TRAMPOLINE_DIRECTORY,
} },
}); });