Merge pull request #4 from The-Low-Code-Foundation/gpt-4o-project

Merging gpt-4o-project plus recent commits from Fluxscape
This commit is contained in:
Richard Osborne
2024-09-24 21:31:23 +01:00
committed by GitHub
37 changed files with 493 additions and 664 deletions

View File

@@ -11,7 +11,7 @@ on:
# types: [created]
jobs:
build_code_crusher:
build_opennoodl:
runs-on: ${{ matrix.os }}
strategy:
@@ -72,6 +72,6 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: code-crusher-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
name: opennoodl-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
path: publish
retention-days: "12"

View File

@@ -3,7 +3,7 @@
"name": "@thelowcodefoundation/repo",
"description": "Low-code for when experience matter",
"author": "The Low Code Foundation <contact@thelowcodefoundation.com>",
"homepage": "https://code-crusher.com",
"homepage": "https://learn-noodl.com",
"version": "1.0.0",
"workspaces": [
"packages/*"

View File

@@ -4,172 +4,61 @@
<metadata>
Created by potrace 1.10, written by Peter Selinger 2001-2011
</metadata>
<g transform="translate(0,512) scale(0.05859375,-0.05859375)"
fill="#ffffff" stroke="none">
<path d="M4248 8712 l-78 -3 0 -35 c0 -19 -5 -45 -12 -57 -6 -12 -15 -38 -19
-57 -4 -19 -13 -55 -19 -80 -23 -94 -33 -136 -40 -180 -15 -89 -32 -166 -46
-210 -8 -25 -14 -61 -14 -81 0 -19 -7 -44 -15 -55 -8 -10 -15 -39 -15 -64 0
-25 -7 -54 -15 -64 -8 -11 -15 -34 -15 -51 0 -50 -39 -85 -93 -85 -24 0 -52
-7 -63 -15 -10 -8 -37 -15 -59 -15 -22 0 -51 -7 -65 -15 -14 -8 -39 -14 -56
-15 -16 0 -39 -7 -50 -15 -10 -8 -33 -15 -50 -15 -16 0 -39 -7 -50 -15 -10 -8
-33 -15 -49 -15 -17 0 -36 -5 -42 -11 -6 -6 -26 -14 -44 -19 -47 -11 -99 -30
-132 -46 -16 -8 -37 -14 -47 -14 -11 0 -34 -6 -52 -14 -18 -8 -65 -19 -103
-25 -119 -17 -160 7 -347 204 -169 178 -450 455 -462 455 -5 0 -24 -11 -42
-25 -18 -14 -37 -25 -43 -25 -6 0 -11 -4 -11 -10 0 -5 -20 -21 -45 -36 -25
-14 -45 -30 -45 -35 0 -5 -6 -9 -13 -9 -7 0 -35 -20 -64 -45 -28 -25 -56 -45
-62 -45 -6 0 -11 -4 -11 -8 0 -4 -24 -26 -52 -47 -29 -22 -75 -60 -102 -86
-40 -38 -46 -49 -38 -65 13 -25 65 -143 76 -174 3 -8 10 -22 15 -30 26 -45 41
-80 41 -93 0 -8 7 -20 15 -27 8 -7 15 -23 15 -35 0 -12 7 -28 15 -35 8 -7 15
-18 15 -26 0 -7 14 -36 30 -64 17 -28 30 -57 30 -64 0 -6 7 -21 15 -32 8 -10
15 -26 15 -35 0 -9 7 -22 15 -29 8 -7 15 -19 15 -26 0 -8 13 -43 30 -77 16
-35 30 -76 30 -90 0 -23 -79 -147 -135 -209 -8 -10 -15 -21 -15 -24 0 -3 -20
-32 -45 -64 -25 -32 -45 -62 -45 -67 0 -5 -12 -22 -27 -39 -31 -34 -50 -61
-60 -84 -3 -8 -19 -31 -35 -51 -15 -20 -28 -42 -28 -47 0 -6 -6 -15 -12 -19
-7 -4 -22 -24 -32 -43 -11 -19 -31 -51 -46 -70 -15 -19 -30 -42 -33 -50 -17
-38 -45 -75 -67 -91 -24 -17 -35 -17 -205 -3 -99 8 -220 20 -270 26 -49 6
-139 14 -200 18 -60 4 -130 12 -155 18 -25 6 -73 11 -107 12 l-62 0 -36 -77
c-20 -43 -43 -90 -51 -105 -8 -14 -14 -33 -14 -41 0 -8 -7 -20 -15 -27 -8 -7
-15 -22 -15 -34 0 -11 -7 -30 -15 -40 -8 -11 -15 -29 -15 -41 0 -12 -7 -30
-15 -41 -8 -10 -15 -27 -15 -37 0 -10 -6 -30 -14 -45 -7 -15 -17 -46 -21 -69
-6 -39 -4 -44 17 -53 29 -14 49 -25 123 -76 34 -22 67 -43 75 -47 8 -4 29 -16
45 -27 17 -11 37 -23 45 -27 8 -3 29 -17 45 -29 17 -12 41 -28 55 -33 14 -6
39 -20 55 -31 17 -11 39 -24 50 -30 11 -6 29 -16 40 -23 11 -7 46 -28 79 -47
32 -19 70 -43 85 -52 14 -10 36 -22 47 -27 54 -24 53 -15 54 -551 0 -489 0
-497 -21 -524 -11 -14 -29 -26 -39 -26 -9 0 -23 -7 -30 -15 -7 -8 -18 -15 -26
-15 -7 0 -19 -6 -26 -13 -7 -7 -34 -23 -60 -36 -27 -12 -50 -27 -54 -32 -3 -5
-11 -9 -19 -9 -8 0 -31 -12 -52 -26 -21 -14 -47 -30 -58 -35 -11 -5 -27 -13
-35 -18 -8 -5 -22 -12 -30 -15 -8 -4 -28 -15 -45 -26 -16 -10 -52 -31 -80 -45
-62 -32 -75 -39 -100 -53 -11 -7 -30 -16 -42 -21 -11 -6 -24 -15 -28 -20 -3
-6 -14 -11 -24 -11 -10 0 -24 -7 -31 -15 -7 -8 -22 -15 -34 -15 -11 -1 -33
-11 -48 -23 -25 -21 -26 -25 -17 -76 4 -30 13 -59 19 -65 5 -5 10 -26 10 -46
0 -20 7 -45 15 -56 8 -10 15 -32 15 -47 0 -16 6 -41 13 -55 8 -15 21 -42 30
-60 9 -19 17 -44 17 -57 0 -12 7 -28 15 -35 8 -7 15 -26 15 -43 0 -34 22 -99
56 -162 l21 -40 462 4 462 4 67 -70 c97 -102 111 -120 258 -335 18 -27 48 -67
66 -90 19 -24 46 -61 61 -83 14 -22 40 -53 57 -69 26 -24 33 -26 43 -14 21 25
101 85 123 92 18 5 22 2 28 -25 12 -59 6 -167 -10 -206 -9 -21 -22 -51 -29
-68 -7 -16 -20 -52 -29 -80 -10 -27 -30 -77 -46 -110 -16 -33 -42 -90 -59
-127 -81 -178 -93 -205 -105 -233 -7 -16 -20 -46 -28 -65 -15 -35 -15 -36 16
-70 17 -19 51 -52 76 -72 25 -20 63 -53 85 -72 22 -20 48 -38 58 -42 9 -3 17
-11 17 -18 0 -6 15 -20 32 -31 38 -21 89 -62 138 -109 41 -40 131 -96 153 -96
14 0 184 122 263 189 17 14 41 33 54 41 13 8 37 27 54 41 49 40 174 119 189
119 7 0 22 7 33 15 14 11 50 14 143 15 144 0 257 -18 438 -70 39 -11 80 -20
91 -20 12 0 23 -4 26 -9 3 -5 23 -12 43 -16 43 -7 114 -38 157 -68 25 -17 51
-64 85 -152 9 -22 24 -78 46 -165 52 -208 64 -247 116 -357 39 -82 67 -106
165 -139 194 -66 540 -58 669 16 48 28 59 40 85 95 17 35 30 67 30 71 0 3 7
20 15 37 8 18 19 50 24 72 38 154 60 231 88 310 14 39 27 80 30 93 14 58 166
166 263 187 19 4 40 10 45 14 6 4 44 17 85 30 41 13 86 27 100 31 14 5 45 12
70 16 25 3 53 11 63 16 23 12 294 12 310 0 7 -5 24 -12 40 -16 15 -4 54 -23
87 -44 33 -20 99 -61 147 -91 48 -30 90 -58 93 -61 12 -16 239 -160 253 -160
17 0 75 28 82 41 4 5 13 9 20 9 8 0 60 27 116 60 55 33 102 60 104 60 4 0 90
57 110 72 172 134 265 227 265 268 0 29 -36 179 -60 250 -29 85 -67 177 -111
266 -21 45 -39 85 -39 89 0 4 -8 23 -17 42 -10 23 -13 40 -7 48 8 12 137 210
269 415 23 36 59 94 81 130 21 36 51 83 66 104 16 21 28 44 28 51 0 6 10 21
23 33 22 21 23 21 157 6 74 -9 178 -19 230 -24 120 -10 571 -12 586 -2 29 20
97 155 157 312 64 166 80 222 112 372 l15 73 -25 23 c-15 12 -33 22 -42 22
-19 0 -235 90 -294 123 -24 13 -74 41 -111 60 -37 20 -86 48 -108 62 -22 14
-42 25 -45 25 -4 0 -137 76 -175 100 -8 5 -44 23 -79 40 l-63 31 6 42 c3 23
10 166 16 317 16 428 33 630 54 630 6 0 38 -29 70 -65 32 -36 61 -65 64 -65 4
0 22 22 40 48 50 74 259 272 286 272 13 0 253 189 312 246 74 71 85 95 78 166
-8 74 -66 247 -129 384 -15 33 -34 75 -42 94 -26 61 -30 65 -52 68 -28 4 -144
-24 -197 -48 -35 -16 -73 -19 -275 -23 -129 -2 -266 -9 -305 -16 -39 -6 -137
-10 -220 -9 l-149 3 -22 40 c-12 22 -27 50 -33 63 -5 12 -14 22 -19 22 -5 0
-11 8 -15 18 -3 9 -15 31 -26 47 -11 17 -23 37 -27 45 -10 19 -70 112 -134
208 -27 40 -49 75 -49 78 0 4 -13 23 -28 43 -16 20 -32 43 -35 51 -4 8 -16 29
-27 45 -10 17 -34 60 -53 97 -31 62 -33 71 -25 120 18 108 20 118 34 129 8 6
14 24 14 39 0 15 7 33 15 40 8 7 15 19 15 27 0 8 6 27 13 41 8 15 22 45 32 67
9 22 21 47 26 55 5 8 12 22 15 30 3 8 13 33 21 55 8 22 19 47 24 55 5 8 12 22
15 30 3 8 10 22 15 30 5 8 12 22 15 30 3 8 12 28 20 43 7 16 14 37 14 47 0 10
4 21 9 25 6 3 21 30 35 60 14 29 31 57 36 60 6 3 10 10 10 16 0 22 -111 99
-144 99 -7 0 -19 7 -26 15 -7 8 -20 15 -30 15 -10 0 -23 7 -30 15 -7 8 -19 15
-26 15 -8 0 -33 12 -57 27 -64 42 -80 51 -104 62 -13 6 -23 15 -23 21 0 5 -5
10 -11 10 -6 0 -36 20 -68 44 l-57 44 -24 -20 c-88 -71 -261 -237 -379 -362
-19 -20 -38 -36 -42 -36 -5 0 -9 -5 -9 -10 0 -13 -79 -91 -154 -152 l-58 -48
-85 0 c-80 0 -138 12 -218 45 -32 13 -95 31 -158 44 -21 5 -44 14 -50 20 -6 6
-23 11 -39 11 -15 0 -42 6 -60 14 -53 22 -101 37 -138 45 -19 4 -45 13 -57 19
-12 7 -37 12 -56 12 -19 0 -40 7 -47 15 -7 8 -25 15 -39 15 -15 0 -36 7 -47
15 -10 8 -30 15 -44 15 -14 0 -31 4 -38 8 -15 10 -41 98 -51 172 -4 30 -12 65
-19 77 -7 12 -12 35 -12 51 0 16 -7 49 -15 72 -8 23 -15 58 -15 77 0 18 -7 50
-15 70 -8 19 -15 58 -15 85 0 27 -7 65 -15 85 -8 19 -15 59 -15 87 0 28 -7 69
-15 91 -8 22 -14 56 -15 76 l0 36 -167 7 c-155 6 -209 6 -425 -2z m834 -1412
c37 -6 85 -10 106 -10 23 0 45 -6 52 -15 8 -10 30 -15 64 -15 29 0 57 -5 63
-11 6 -6 30 -15 54 -20 24 -6 65 -21 92 -35 27 -13 57 -24 67 -24 9 0 23 -7
30 -15 7 -8 25 -15 41 -15 16 0 29 -4 29 -8 0 -9 81 -52 99 -52 6 0 11 -3 11
-8 0 -4 24 -18 53 -32 28 -13 70 -37 91 -52 21 -15 45 -28 53 -28 7 0 13 -5
13 -10 0 -6 10 -15 23 -20 23 -10 58 -31 67 -40 18 -18 72 -50 84 -50 8 0 16
-3 18 -7 5 -12 124 -94 158 -110 23 -10 203 -148 219 -166 7 -10 18 -17 23
-17 13 0 146 -129 161 -156 7 -12 21 -37 31 -55 13 -22 21 -60 24 -110 4 -69
2 -78 -19 -101 -13 -14 -38 -43 -55 -64 -17 -22 -44 -46 -60 -54 -16 -8 -57
-34 -91 -57 -34 -23 -106 -63 -160 -88 -104 -49 -113 -53 -208 -105 -94 -51
-121 -68 -255 -155 -69 -45 -151 -97 -184 -115 -95 -52 -147 -84 -221 -135
-147 -101 -185 -125 -286 -178 -167 -86 -324 -191 -449 -300 -77 -67 -106 -77
-222 -77 -92 1 -107 3 -143 25 -22 14 -52 25 -68 25 -15 0 -35 9 -45 21 -34
41 -245 202 -314 239 -40 21 -166 109 -208 145 -14 11 -45 31 -70 43 -25 12
-76 45 -115 72 -38 28 -79 55 -90 60 -11 6 -33 19 -50 29 -16 11 -61 36 -99
56 -106 55 -197 119 -346 243 -74 62 -157 128 -185 146 -104 69 -320 179 -372
191 -18 3 -35 11 -38 16 -4 5 -18 9 -33 9 -44 0 -202 52 -202 67 0 7 -4 13
-10 13 -16 0 -12 56 5 70 8 7 15 20 15 30 0 16 55 129 69 140 11 9 51 69 51
77 1 4 11 20 23 34 12 14 49 59 82 100 87 108 236 255 284 279 22 12 41 26 41
31 0 5 8 9 19 9 10 0 24 6 30 14 7 8 23 17 36 20 14 4 25 11 25 16 0 6 5 10
11 10 18 0 109 44 109 52 0 5 7 8 15 8 17 0 93 38 101 51 3 5 14 9 24 9 10 0
25 7 34 15 8 8 21 15 30 15 8 0 32 11 52 25 20 14 54 30 75 35 22 6 39 15 39
20 0 6 24 10 53 10 29 0 61 6 72 14 27 18 382 31 857 31 201 0 369 2 372 5 8
8 273 0 348 -10z m-3247 -1890 c10 -11 24 -20 31 -20 8 0 31 -23 51 -51 26
-34 56 -59 96 -80 66 -34 77 -35 119 -13 21 11 33 13 41 5 11 -11 9 -21 -32
-175 -17 -66 -21 -107 -20 -245 0 -91 4 -200 9 -241 44 -359 80 -462 207 -600
40 -43 106 -103 146 -133 74 -55 193 -117 226 -117 10 0 38 -7 62 -16 34 -13
86 -16 234 -17 197 -1 191 -2 365 50 70 22 158 66 240 122 149 102 278 187
316 208 21 11 60 33 87 46 45 24 156 63 292 103 33 10 67 24 76 31 8 7 22 13
30 13 8 0 21 6 27 12 7 7 43 16 80 21 37 4 85 10 108 13 70 10 156 -27 249
-106 74 -63 165 -124 270 -180 44 -24 91 -49 104 -56 45 -24 130 -104 161
-153 32 -49 53 -62 155 -91 17 -4 44 -13 60 -19 17 -5 57 -17 90 -25 33 -8 79
-20 103 -26 66 -17 186 -32 305 -37 98 -4 111 -3 130 15 22 19 107 69 182 107
54 26 133 85 171 126 34 37 104 153 104 172 0 7 6 21 13 32 8 11 16 29 20 40
3 11 15 45 27 75 31 82 77 220 90 270 51 197 53 214 57 424 4 194 6 211 26
240 26 38 219 236 230 236 4 0 25 -11 47 -25 l40 -25 0 -463 c0 -392 -2 -466
-15 -483 -8 -10 -14 -32 -15 -49 0 -30 -21 -101 -47 -162 -7 -17 -13 -46 -13
-65 0 -19 -7 -43 -15 -54 -8 -10 -15 -41 -15 -69 0 -28 -7 -59 -15 -69 -8 -11
-15 -27 -15 -37 0 -9 -7 -30 -15 -45 -8 -16 -15 -36 -15 -45 0 -9 -7 -22 -15
-29 -8 -7 -15 -22 -15 -34 0 -11 -7 -30 -15 -40 -8 -11 -15 -30 -15 -42 0 -13
-4 -25 -9 -28 -5 -3 -12 -22 -16 -42 -3 -20 -13 -43 -21 -51 -8 -8 -14 -29
-14 -46 0 -18 -7 -41 -15 -51 -8 -11 -15 -31 -15 -45 0 -14 -7 -35 -15 -45 -8
-11 -15 -26 -15 -34 0 -7 -7 -20 -15 -28 -8 -9 -15 -26 -15 -39 0 -12 -7 -25
-15 -29 -8 -3 -15 -17 -15 -31 0 -14 -4 -25 -9 -25 -5 0 -13 -10 -17 -22 -3
-13 -19 -42 -35 -66 -16 -24 -29 -47 -29 -53 0 -5 -5 -15 -10 -22 -40 -47 -80
-108 -80 -121 0 -9 -4 -16 -9 -16 -5 0 -23 -23 -40 -50 -17 -28 -40 -58 -51
-67 -11 -10 -20 -21 -20 -26 0 -40 -328 -373 -463 -470 -23 -17 -55 -43 -71
-59 -17 -15 -36 -28 -43 -28 -8 0 -16 -7 -19 -15 -4 -8 -11 -15 -18 -15 -6 0
-26 -14 -44 -30 -18 -17 -40 -30 -48 -30 -8 0 -17 -7 -20 -15 -4 -8 -11 -15
-16 -15 -6 0 -27 -13 -47 -28 -20 -15 -60 -39 -88 -52 -29 -14 -53 -28 -53
-32 0 -5 -9 -8 -19 -8 -11 0 -26 -7 -35 -15 -8 -8 -21 -15 -28 -15 -8 0 -23
-7 -34 -15 -10 -8 -35 -15 -54 -15 -20 0 -44 -6 -55 -14 -11 -7 -58 -16 -105
-19 -47 -3 -86 -10 -88 -16 -2 -6 -27 -11 -55 -11 -29 0 -77 -7 -107 -15 -63
-17 -116 -19 -125 -5 -4 6 -15 6 -32 -1 -40 -15 -428 -9 -483 7 -25 8 -61 14
-82 14 -20 0 -38 4 -40 10 -1 5 -32 12 -68 16 -36 3 -72 12 -81 20 -12 11 -73
14 -296 14 -231 1 -284 4 -294 16 -6 8 -19 14 -29 14 -10 0 -23 7 -30 15 -7 8
-21 15 -31 15 -11 0 -19 4 -19 9 0 5 -10 13 -22 17 -13 4 -25 10 -28 13 -3 4
-23 18 -45 31 -22 13 -42 27 -45 30 -5 7 -31 21 -117 65 -29 14 -55 30 -58 36
-4 5 -15 9 -25 9 -10 0 -20 3 -22 8 -1 4 -25 22 -53 41 -27 19 -55 39 -60 45
-24 26 -134 116 -142 116 -5 0 -23 13 -41 30 -18 16 -35 30 -38 30 -6 0 -49
37 -123 106 -86 79 -136 122 -191 164 -25 19 -59 48 -76 65 -17 16 -48 44 -68
62 -20 17 -36 36 -36 42 0 5 -6 14 -13 18 -13 9 -107 147 -107 158 0 4 -13 24
-30 45 -16 21 -30 42 -30 48 0 5 -7 15 -15 22 -8 7 -15 18 -15 26 0 7 -13 32
-29 56 -15 24 -45 75 -66 113 -20 39 -41 74 -46 79 -5 6 -9 18 -9 28 0 10 -7
21 -15 24 -8 4 -15 17 -15 30 0 14 -7 27 -15 30 -8 4 -15 16 -15 29 0 12 -6
28 -14 34 -8 7 -18 26 -21 42 -4 16 -11 29 -16 29 -5 0 -9 9 -9 19 0 11 -7 26
-15 35 -8 8 -15 27 -15 42 0 15 -6 35 -13 43 -7 9 -21 43 -31 76 -10 33 -24
73 -32 88 -8 16 -14 57 -14 92 0 44 -5 68 -15 79 -14 13 -16 70 -16 441 1 368
3 429 16 449 13 19 15 50 13 161 -2 120 -1 138 15 150 9 6 17 15 17 18 0 11
66 71 96 89 39 22 58 22 79 -2z m1122 -364 c49 -24 95 -47 103 -50 8 -3 31
-16 50 -27 19 -12 55 -32 80 -46 25 -13 61 -34 80 -45 19 -11 71 -39 115 -61
44 -23 96 -51 116 -63 19 -12 79 -45 132 -73 53 -28 126 -69 162 -91 36 -22
69 -40 73 -40 5 0 18 -10 30 -23 l22 -23 -31 -32 c-39 -40 -90 -62 -194 -86
-98 -22 -187 -44 -240 -61 -102 -33 -234 -68 -313 -84 -73 -15 -227 -14 -287
3 -169 45 -290 193 -330 405 -17 90 -17 97 0 165 26 105 52 155 116 218 65 63
78 68 166 63 50 -3 81 -14 150 -49z m3498 18 c83 -63 114 -220 80 -399 -9 -44
-20 -84 -25 -89 -6 -6 -10 -18 -10 -29 0 -44 -102 -197 -167 -249 -67 -54
-117 -69 -243 -75 -132 -6 -234 14 -375 73 -62 25 -112 44 -165 60 -30 9 -71
21 -90 27 -19 6 -51 14 -70 17 -48 10 -180 47 -216 60 l-29 11 25 20 c14 10
61 40 105 67 104 62 101 60 202 113 225 118 375 196 453 236 47 25 92 49 100
54 30 18 154 71 265 112 65 24 121 21 160 -9z"/>
<g transform="scale(0.16, -0.16) translate(0, -3200)" fill="#ffffff" stroke="none">
<path d="M1345 3084 c-122 -18 -294 -61 -305 -76 -3 -4 -39 -21 -79 -38 -140
-57 -290 -156 -436 -286 -173 -155 -350 -399 -422 -583 -114 -292 -133 -639
-51 -961 21 -86 90 -254 139 -344 444 -805 1454 -1042 2175 -511 316 233 531
574 606 962 34 176 32 438 -4 614 -43 205 -134 416 -247 565 -71 95 -338 356
-421 411 -264 175 -467 241 -765 248 -88 2 -173 1 -190 -1z m304 -207 c108
-67 238 -259 320 -472 17 -43 29 -80 28 -82 -2 -1 -39 -9 -82 -18 -43 -8 -86
-17 -96 -20 -14 -5 -20 2 -29 36 -25 93 -99 169 -189 196 -151 44 -312 -39
-358 -184 -14 -44 -20 -52 -37 -48 -12 2 -54 10 -94 16 -41 7 -76 18 -78 24
-14 35 121 310 209 427 124 165 268 209 406 125z m-539 -52 c0 -3 -23 -40 -52
-82 -55 -82 -124 -224 -153 -313 -23 -73 -21 -70 -58 -58 -55 18 -234 105
-241 116 -8 14 58 79 158 153 94 71 179 122 266 160 67 29 80 33 80 24z m913
-40 c109 -54 243 -148 335 -235 l66 -62 -59 -31 c-73 -37 -194 -87 -209 -87
-6 0 -24 35 -40 78 -40 108 -110 247 -154 307 -70 93 -68 94 61 30z m-1458
-449 c43 -25 112 -57 154 -72 42 -15 87 -31 100 -36 17 -6 21 -13 16 -26 -14
-35 -53 -200 -65 -274 l-12 -76 -52 5 c-85 9 -158 -18 -221 -81 -34 -34 -58
-68 -66 -95 -15 -50 -24 -53 -139 -49 l-85 3 3 55 c5 90 66 310 116 412 37 77
160 278 170 278 1 0 38 -20 81 -44z m1020 10 c54 -35 74 -128 39 -181 -36 -55
-120 -72 -179 -35 -37 23 -57 63 -57 115 0 97 114 155 197 101z m992 -42 c61
-85 148 -266 176 -364 31 -107 61 -275 53 -295 -4 -12 -24 -15 -95 -15 l-90 0
-31 64 c-51 107 -130 158 -249 162 l-75 3 -18 108 c-16 93 -37 190 -53 243 -4
12 16 22 78 43 45 16 118 48 162 71 44 24 85 42 90 41 6 -1 29 -28 52 -61z
m-1479 -149 c46 -8 96 -15 111 -15 21 0 31 -10 53 -50 30 -53 95 -108 140
-117 39 -8 50 -25 46 -74 -3 -40 -5 -43 -45 -56 -63 -21 -138 -93 -161 -156
l-20 -52 -122 0 -122 0 -12 37 c-7 20 -27 56 -44 79 -20 26 -30 50 -27 63 51
235 78 353 82 359 3 5 12 6 20 3 9 -4 54 -13 101 -21z m965 -32 c14 -51 46
-209 60 -298 4 -23 -2 -38 -29 -68 -18 -22 -39 -58 -47 -81 l-14 -41 -111 -3
-112 -3 -24 55 c-29 66 -92 129 -152 152 l-44 17 0 53 0 53 53 24 c58 27 119
84 137 128 9 21 19 29 39 29 14 1 67 9 116 19 50 10 95 19 101 20 6 0 19 -25
27 -56z m-1313 -438 c75 -39 92 -148 32 -207 -79 -80 -222 -21 -222 92 0 93
107 158 190 115z m821 0 c65 -34 91 -135 48 -189 -61 -78 -165 -73 -220 10
-37 56 -13 134 53 174 40 24 79 25 119 5z m842 -24 c87 -86 27 -221 -98 -221
-42 0 -52 4 -81 35 -57 61 -55 132 4 188 33 31 55 37 107 31 26 -3 50 -15 68
-33z m-1992 -216 c60 -115 150 -169 271 -164 l62 3 18 -120 c10 -65 29 -163
42 -217 21 -89 22 -99 7 -104 -61 -21 -208 -88 -257 -117 -32 -20 -62 -36 -66
-36 -12 0 -115 163 -161 255 -51 104 -80 185 -108 303 -22 91 -40 232 -32 245
2 4 48 6 101 5 l97 -3 26 -50z m808 24 c6 -17 27 -53 47 -80 28 -38 52 -57
105 -82 l69 -32 0 -51 0 -51 -65 -32 c-72 -36 -128 -98 -145 -161 -10 -36 -11
-37 -82 -49 -40 -7 -96 -19 -125 -26 -47 -12 -53 -11 -57 4 -13 45 -58 266
-70 344 l-13 87 33 48 c19 26 34 50 34 54 0 4 4 18 10 32 9 26 10 26 129 26
l119 0 11 -31z m811 -1 c7 -18 28 -54 47 -81 18 -26 33 -59 33 -75 0 -43 -28
-218 -51 -319 -22 -101 -23 -101 -89 -84 -19 5 -67 15 -106 21 l-72 11 -16 44
c-30 77 -69 121 -141 155 -70 33 -71 36 -59 112 5 28 12 38 31 43 63 15 128
77 172 163 l21 42 109 0 109 0 12 -32z m770 -5 c0 -121 -66 -377 -136 -530
-26 -58 -110 -203 -139 -241 -1 -1 -49 22 -106 52 -57 30 -134 67 -171 81 -38
15 -68 30 -68 34 0 3 7 29 16 56 15 52 54 290 54 338 0 27 1 27 63 27 35 0 84
7 110 16 64 22 135 87 163 151 l24 53 95 0 95 0 0 -37z m-1246 -467 c50 -21
76 -60 76 -116 0 -138 -185 -180 -244 -55 -31 65 -10 124 59 166 36 23 64 24
109 5z m-314 -247 c32 -61 99 -123 155 -142 147 -50 292 4 371 139 14 24 29
44 32 44 4 0 46 -7 95 -17 55 -10 87 -21 87 -29 0 -48 -105 -278 -171 -375
-88 -130 -170 -186 -286 -196 -128 -10 -228 50 -323 195 -68 103 -180 338
-180 378 0 7 32 18 78 27 119 22 119 22 142 -24z m-341 -121 c34 -86 103 -226
150 -307 30 -51 31 -52 9 -46 -42 13 -206 96 -270 137 -72 46 -198 147 -198
158 0 12 268 145 276 137 1 -1 16 -37 33 -79z m1469 -30 c17 -11 32 -25 32
-32 0 -18 -175 -156 -261 -206 -71 -42 -209 -103 -216 -96 -2 2 13 27 33 57
48 72 99 173 141 284 19 49 37 93 39 97 5 7 177 -70 232 -104z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 682 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -11,7 +11,7 @@ module.exports = async function (params) {
return;
}
const appId = 'com.code-crusher.app';
const appId = 'com.opennoodl.app';
const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {

View File

@@ -4,7 +4,7 @@
"description": "Full stack low code React app builder",
"author": "The Low Code Foundation",
"homepage": "https://thelowcodefoundation.com",
"version": "1.0.1",
"version": "1.1.0",
"main": "src/main/main.js",
"scripts": {
"build": "npx ts-node -P ./tsconfig.build.json ./scripts/build.ts",
@@ -15,30 +15,30 @@
"test:ci": "webpack-cli --config=webpackconfigs/webpack.test-ci.js && electron test.js"
},
"build": {
"appId": "com.code-crusher.app",
"appId": "com.opennoodl.app",
"afterSign": "./build/macos-notarize.js",
"mac": {
"hardenedRuntime": true,
"entitlements": "build/entitlements.mac.plist",
"extendInfo": {
"LSMultipleInstancesProhibited": true,
"NSMicrophoneUsageDescription": "Allow Code-Crusher apps that you create and run to access the microphone?",
"NSCameraUsageDescription": "Allow Code-Crusher apps that you create and run to access the camera?"
"NSMicrophoneUsageDescription": "Allow OpenNoodl apps that you create and run to access the microphone?",
"NSCameraUsageDescription": "Allow OpenNoodl apps that you create and run to access the camera?"
}
},
"win": {
"target": "nsis"
},
"nsis": {
"guid": "com.code-crusher.app"
"guid": "com.opennoodl.app"
},
"linux": {
"target": "deb"
},
"protocols": {
"name": "code-crusher",
"name": "opennoodl",
"schemes": [
"code-crusher"
"opennoodl"
]
},
"npmRebuild": false,

View File

@@ -39,7 +39,7 @@ export abstract class ReActAgent<TParams = unknown> {
...history
],
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0
},
onStream: (_, text) => {

View File

@@ -38,7 +38,7 @@ export namespace AiAssistantApi {
version: '0.0.0',
models: [
{
name: 'gpt-4',
name: 'gpt-4o-mini',
displayName: 'gpt-4 (8k context)',
promptTokenCost: 0.03,
completionTokenCost: 0.06

View File

@@ -13,14 +13,14 @@ export type AiCopilotTextProviders = {
max_tokens?: number;
}
export type ModelName = 'gpt-3.5-turbo' | 'gpt-4';
export type ModelName = 'gpt-3.5-turbo' | 'gpt-4o-mini';
export type AiCopilotChatProviders = {
model: 'gpt-3.5-turbo',
temperature?: number;
max_tokens?: number;
} | {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature?: number;
max_tokens?: number;
}

View File

@@ -49,7 +49,7 @@ export const template: AiNodeTemplate = {
const fullCodeText = await chatStream({
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},

View File

@@ -71,7 +71,7 @@ export const template: AiNodeTemplate = {
const fullText = await chatStreamXml({
messages,
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
// model: 'gpt-3.5-turbo',
// The next context doesnt work with GPT-3.5
temperature: 0.5,

View File

@@ -41,7 +41,7 @@ export async function execute(
const fullCodeText = await chatStream({
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},
@@ -112,7 +112,7 @@ export async function execute(
{ role: 'user', content: codeText }
],
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},

View File

@@ -23,7 +23,7 @@ export const template: AiNodeTemplate = {
console.log('using version: ', version);
try {
if ((version === 'enterprise' && OpenAiStore.getModel() === 'gpt-4') || version === 'full-beta') {
if ((version === 'enterprise' && OpenAiStore.getModel() === 'gpt-4o-mini') || version === 'full-beta') {
await GPT4.execute(context);
} else {
await GPT3.execute(context);

View File

@@ -56,7 +56,7 @@ A["FUNCTION"]`;
provider: {
// NOTE: Tried with GPT 3.5 here before.
// Then this question doesnt work: "Can you make a function that starts recording from the microphone when it gets a start signal and stops recording when it gets a stop signal"
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0
}
});
@@ -100,7 +100,7 @@ A["FUNCTION"]`;
const fullText = await chatStream({
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},
@@ -156,7 +156,7 @@ A["FUNCTION"]`;
const fullCodeText = await chatStream({
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},
@@ -251,7 +251,7 @@ A["FUNCTION"]`;
}
],
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
temperature: 0.0,
max_tokens: 2048
},

View File

@@ -20,7 +20,7 @@ const AI_ASSISTANT_MODEL_KEY = 'aiAssistant.model';
export type AiVersion = 'disabled' | 'full-beta' | 'enterprise';
export type AiModel = 'gpt-3' | 'gpt-4';
export type AiModel = 'gpt-3' | 'gpt-4o-mini';
export const OpenAiStore = {
isEnabled(): boolean {

View File

@@ -2,5 +2,5 @@ const remote = require('@electron/remote');
export default function getDocsEndpoint() {
const localDocs = remote.getGlobal('useLocalDocs');
return localDocs ? 'http://localhost:3000' : 'https://the-low-code-foundation.github.io/code-crusher-docs';
return localDocs ? 'http://localhost:3000' : 'https://the-low-code-foundation.github.io/opennoodl-docs';
}

View File

@@ -79,7 +79,7 @@ export default function Clippy() {
const version = OpenAiStore.getVersion();
if (version === 'enterprise') {
setHasApiKey(true);
setHasGPT4(OpenAiStore.getModel() === 'gpt-4');
setHasGPT4(OpenAiStore.getModel() === 'gpt-4o-mini');
} else if (version === 'full-beta') {
setHasApiKey(OpenAiStore.getIsAiApiKeyVerified());
} else {
@@ -94,10 +94,10 @@ export default function Clippy() {
async function doIt() {
const version = OpenAiStore.getVersion();
if (version === 'enterprise') {
setHasGPT4(OpenAiStore.getModel() === 'gpt-4');
setHasGPT4(OpenAiStore.getModel() === 'gpt-4o-mini');
} else {
const models = await verifyOpenAiApiKey(OpenAiStore.getApiKey());
setHasGPT4(!!models['gpt-4']);
setHasGPT4(!!models['gpt-4o-mini']);
}
}

View File

@@ -44,7 +44,7 @@ export async function handleSuggestionCommand(prompt: string, statusCallback: (s
{ role: 'user', content: p }
];
const response = await makeChatRequest('gpt-4', messages);
const response = await makeChatRequest('gpt-4o-mini', messages);
console.log(response);
return JSON.parse(response.content);

View File

@@ -137,7 +137,7 @@ export async function handleUICommand(
await ctx.chatStreamXml({
messages: messages,
provider: {
model: 'gpt-4',
model: 'gpt-4o-mini',
// The next context doesnt work with GPT-3.5
temperature: 0.1
},

View File

@@ -70,8 +70,8 @@ export async function makeChatRequest(model: string, messages: unknown[]) {
console.error(json.error);
return null;
} else {
const promptTokenCost = model === 'gpt-4' ? 0.03 : 0.002;
const completionTokenCost = model === 'gpt-4' ? 0.06 : 0.002;
const promptTokenCost = model === 'gpt-4o-mini' ? 0.03 : 0.002;
const completionTokenCost = model === 'gpt-4o-mini' ? 0.06 : 0.002;
let cost =
(json.usage.completion_tokens * completionTokenCost) / 1000 + (json.usage.prompt_tokens * promptTokenCost) / 1000;

View File

@@ -29,7 +29,7 @@ export function OpenAiSection() {
async function onVerifyApiKey() {
const models = await verifyOpenAiApiKey(apiKey);
if (models) {
const haveGpt4 = !!models['gpt-4'];
const haveGpt4 = !!models['gpt-4o-mini'];
if (haveGpt4) {
OpenAiStore.setIsAiApiKeyVerified(true);
ToastLayer.showSuccess('OpenAI API Key is valid with GPT-4!');
@@ -78,7 +78,7 @@ export function OpenAiSection() {
properties={{
options: [
{ label: 'gpt-3', value: 'gpt-3' },
{ label: 'gpt-4', value: 'gpt-4' }
{ label: 'gpt-4', value: 'gpt-4o-mini' }
]
}}
onChange={(value: AiModel) => {
@@ -121,7 +121,7 @@ export function OpenAiSection() {
properties={{
options: [
{ label: 'gpt-3', value: 'gpt-3' },
{ label: 'gpt-4', value: 'gpt-4' }
{ label: 'gpt-4', value: 'gpt-4o-mini' }
]
}}
onChange={(value: AiModel) => {

View File

@@ -36,16 +36,15 @@ function convertVisualFilter(query, options) {
const _res = {};
var cond;
var value = query.input !== undefined ? inputs[query.input] : query.value;
if (query.operator === 'exist') {
_res[query.property] = { $exists: true };
return _res;
_res[query.property] = { $exists: true };
return _res;
} else if (query.operator === 'not exist') {
_res[query.property] = { $exists: false };
return _res;
}
else if (query.operator === 'not exist') {
_res[query.property] = { $exists: false };
return _res;
}
if (value === undefined) return;
if (CloudStore._collections[options.collectionName])
@@ -80,7 +79,6 @@ function convertVisualFilter(query, options) {
cond = { $regex: value, $options: 'i' };
}
_res[query.property] = cond;
return _res;
@@ -163,10 +161,22 @@ function _value(v) {
return v;
}
/**
*
* @param {Record<string, unknown>} filter
* @param {{
* collectionName?: string;
* modelScope?: unknown;
* error: (error: string) => void;
* }} options
* @returns
*/
function convertFilterOp(filter, options) {
const keys = Object.keys(filter);
if (keys.length === 0) return {};
if (keys.length !== 1) return options.error('Filter must only have one key found ' + keys.join(','));
if (keys.length !== 1) {
return options.error('Filter must only have one key found ' + keys.join(','));
}
const res = {};
const key = keys[0];
@@ -179,18 +189,27 @@ function convertFilterOp(filter, options) {
} else if (filter['idContainedIn'] !== undefined) {
res['objectId'] = { $in: filter['idContainedIn'] };
} else if (filter['relatedTo'] !== undefined) {
var modelId = filter['relatedTo']['id'];
if (modelId === undefined) return options.error('Must provide id in relatedTo filter');
const modelId = filter['relatedTo']['id'];
if (modelId === undefined) {
return options.error('Must provide id in relatedTo filter');
}
var relationKey = filter['relatedTo']['key'];
if (relationKey === undefined) return options.error('Must provide key in relatedTo filter');
const relationKey = filter['relatedTo']['key'];
if (relationKey === undefined) {
return options.error('Must provide key in relatedTo filter');
}
const className = filter['relatedTo']['className'] || (options.modelScope || Model).get(modelId)?._class;
if (typeof className === 'undefined') {
// Either the pointer is loaded as an object or we allow passing in the className.
return options.error('Must preload the Pointer or include className');
}
var m = (options.modelScope || Model).get(modelId);
res['$relatedTo'] = {
object: {
__type: 'Pointer',
objectId: modelId,
className: m._class
className
},
key: relationKey
};
@@ -208,13 +227,14 @@ function convertFilterOp(filter, options) {
else if (opAndValue['containedIn'] !== undefined) res[key] = { $in: opAndValue['containedIn'] };
else if (opAndValue['notContainedIn'] !== undefined) res[key] = { $nin: opAndValue['notContainedIn'] };
else if (opAndValue['pointsTo'] !== undefined) {
var m = (options.modelScope || Model).get(opAndValue['pointsTo']);
if (CloudStore._collections[options.collectionName])
var schema = CloudStore._collections[options.collectionName].schema;
let schema = null;
if (CloudStore._collections[options.collectionName]) {
schema = CloudStore._collections[options.collectionName].schema;
}
var targetClass =
const targetClass =
schema && schema.properties && schema.properties[key] ? schema.properties[key].targetClass : undefined;
var type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
const type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
if (type === 'Relation') {
res[key] = {
@@ -223,13 +243,13 @@ function convertFilterOp(filter, options) {
className: targetClass
};
} else {
if (Array.isArray(opAndValue['pointsTo']))
if (Array.isArray(opAndValue['pointsTo'])) {
res[key] = {
$in: opAndValue['pointsTo'].map((v) => {
return { __type: 'Pointer', objectId: v, className: targetClass };
})
};
else
} else {
res[key] = {
$eq: {
__type: 'Pointer',
@@ -237,6 +257,7 @@ function convertFilterOp(filter, options) {
className: targetClass
}
};
}
}
} else if (opAndValue['matchesRegex'] !== undefined) {
res[key] = {
@@ -257,43 +278,42 @@ function convertFilterOp(filter, options) {
}
}
};
// Geo points
// Geo points
} else if (opAndValue['nearSphere'] !== undefined) {
var _v = opAndValue['nearSphere'];
res[key] = {
$nearSphere: {
__type: "GeoPoint",
__type: 'GeoPoint',
latitude: _v.latitude,
longitude: _v.longitude,
longitude: _v.longitude
},
$maxDistanceInMiles:_v.$maxDistanceInMiles,
$maxDistanceInKilometers:_v.maxDistanceInKilometers,
$maxDistanceInRadians:_v.maxDistanceInRadians
$maxDistanceInMiles: _v.$maxDistanceInMiles,
$maxDistanceInKilometers: _v.maxDistanceInKilometers,
$maxDistanceInRadians: _v.maxDistanceInRadians
};
} else if (opAndValue['withinBox'] !== undefined) {
var _v = opAndValue['withinBox'];
res[key] = {
$within:{
$box: _v.map(gp => ({
__type:"GeoPoint",
latitude:gp.latitude,
longitude:gp.longitude
$within: {
$box: _v.map((gp) => ({
__type: 'GeoPoint',
latitude: gp.latitude,
longitude: gp.longitude
}))
}
};
} else if (opAndValue['withinPolygon'] !== undefined) {
var _v = opAndValue['withinPolygon'];
res[key] = {
$geoWithin:{
$polygon: _v.map(gp => ({
__type:"GeoPoint",
latitude:gp.latitude,
longitude:gp.longitude
$geoWithin: {
$polygon: _v.map((gp) => ({
__type: 'GeoPoint',
latitude: gp.latitude,
longitude: gp.longitude
}))
}
};
}
} else {
options.error('Unrecognized filter keys ' + keys.join(','));
}

View File

@@ -28,6 +28,7 @@ var DbCollectionNode = {
_this.scheduleAfterInputsHaveUpdated(function () {
_this.flagOutputDirty('count');
_this.flagOutputDirty('firstItemId');
_this.flagOutputDirty('isEmpty');
collectionChangedScheduled = false;
});
};
@@ -66,6 +67,7 @@ var DbCollectionNode = {
_this.flagOutputDirty('count');
_this.flagOutputDirty('firstItemId');
_this.flagOutputDirty('isEmpty');
}
if (args.type === 'create') {
@@ -91,6 +93,7 @@ var DbCollectionNode = {
_this.flagOutputDirty('count');
_this.flagOutputDirty('firstItemId');
_this.flagOutputDirty('isEmpty');
} else if (matchesQuery && !_this._internal.collection.contains(m)) {
// It's not part of the result collection but now matches they query, add it and resort
_addModelAtCorrectIndex(m);
@@ -106,6 +109,7 @@ var DbCollectionNode = {
_this.flagOutputDirty('count');
_this.flagOutputDirty('firstItemId');
_this.flagOutputDirty('isEmpty');
}
}
};
@@ -153,6 +157,17 @@ var DbCollectionNode = {
}
}
},
isEmpty: {
type: 'boolean',
displayName: 'Is Empty',
group: 'General',
getter: function () {
if (this._internal.collection) {
return this._internal.collection.size() === 0;
}
return true;
}
},
count: {
type: 'number',
displayName: 'Count',
@@ -189,6 +204,7 @@ var DbCollectionNode = {
setCollection: function (collection) {
this.bindCollection(collection);
this.flagOutputDirty('firstItemId');
this.flagOutputDirty('isEmpty');
this.flagOutputDirty('items');
this.flagOutputDirty('count');
},
@@ -257,7 +273,7 @@ var DbCollectionNode = {
limit: limit,
skip: skip,
count: count,
success: (results,count) => {
success: (results, count) => {
if (results !== undefined) {
_c.set(
results.map((i) => {
@@ -267,10 +283,9 @@ var DbCollectionNode = {
})
);
}
if(count !== undefined) {
if (count !== undefined) {
this._internal.storageSettings.storageTotalCount = count;
if(this.hasOutput('storageTotalCount'))
this.flagOutputDirty('storageTotalCount');
if (this.hasOutput('storageTotalCount')) this.flagOutputDirty('storageTotalCount');
}
this.setCollection(_c);
this.sendSignalOnOutput('fetched');
@@ -383,7 +398,7 @@ var DbCollectionNode = {
if (!storageSettings['storageEnableLimit']) return;
else return storageSettings['storageSkip'] || 0;
},
getStorageFetchTotalCount: function() {
getStorageFetchTotalCount: function () {
const storageSettings = this._internal.storageSettings;
return !!storageSettings['storageEnableCount'];

View File

@@ -31,8 +31,6 @@ const DateToStringNode = {
this._internal.currentInput = _value;
this._format();
this.flagOutputDirty('currentValue');
this.sendSignalOnOutput('inputChanged');
}
}
},
@@ -49,30 +47,45 @@ const DateToStringNode = {
type: 'signal',
displayName: 'Date Changed',
group: 'Signals'
},
onError: {
type: 'signal',
displayName: 'Invalid Date',
group: 'Signals'
}
},
methods: {
_format() {
const t = this._internal.currentInput;
const format = this._internal.formatString;
const date = ('0' + t.getDate()).slice(-2);
const month = ('0' + (t.getMonth() + 1)).slice(-2);
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
const year = t.getFullYear();
const yearShort = year.toString().substring(2);
const hours = ('0' + t.getHours()).slice(-2);
const minutes = ('0' + t.getMinutes()).slice(-2);
const seconds = ('0' + t.getSeconds()).slice(-2);
try {
const t = this._internal.currentInput;
const format = this._internal.formatString;
const date = ('0' + t.getDate()).slice(-2);
const month = ('0' + (t.getMonth() + 1)).slice(-2);
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
const year = t.getFullYear();
const yearShort = year.toString().substring(2);
const hours = ('0' + t.getHours()).slice(-2);
const minutes = ('0' + t.getMinutes()).slice(-2);
const seconds = ('0' + t.getSeconds()).slice(-2);
this._internal.dateString = format
.replace(/\{date\}/g, date)
.replace(/\{month\}/g, month)
.replace(/\{monthShort\}/g, monthShort)
.replace(/\{year\}/g, year)
.replace(/\{yearShort\}/g, yearShort)
.replace(/\{hours\}/g, hours)
.replace(/\{minutes\}/g, minutes)
.replace(/\{seconds\}/g, seconds);
this._internal.dateString = format
.replace(/\{date\}/g, date)
.replace(/\{month\}/g, month)
.replace(/\{monthShort\}/g, monthShort)
.replace(/\{year\}/g, year)
.replace(/\{yearShort\}/g, yearShort)
.replace(/\{hours\}/g, hours)
.replace(/\{minutes\}/g, minutes)
.replace(/\{seconds\}/g, seconds);
} catch (error) {
// Set the output to be blank, makes it easier to handle.
this._internal.dateString = '';
this.flagOutputDirty('onError');
}
// Flag that the value have changed
this.flagOutputDirty('currentValue');
this.sendSignalOnOutput('inputChanged');
}
}
};

View File

@@ -192,8 +192,7 @@ function setup(context, graphModel) {
enums: pages.map((p) => ({
label: p.label,
value: p.id
})),
allowEditOnly: true
}))
},
group: 'General',
displayName: 'Target Page',

View File

@@ -1,3 +1,5 @@
import React from 'react';
import ASyncQueue from '../../async-queue';
import { createNodeFromReactComponent } from '../../react-component-node';
@@ -75,10 +77,13 @@ const PageStack = {
const info = [{ type: 'text', value: 'Active Components:' }];
return info.concat(
this._internal.stack.map((p, i) => ({
type: 'text',
value: '- ' + this._internal.pages.find((pi) => pi.id === p.pageId).label
}))
this._internal.stack.map((p) => {
const pageInfo = this._findPage(p.pageId);
return {
type: 'text',
value: '- ' + pageInfo.label
};
})
);
},
defaultCss: {
@@ -170,6 +175,7 @@ const PageStack = {
topPageName: {
type: 'string',
displayName: 'Top Component Name',
group: 'General',
get() {
return this._internal.topPageName;
}
@@ -177,6 +183,7 @@ const PageStack = {
stackDepth: {
type: 'number',
displayName: 'Stack Depth',
group: 'General',
get() {
return this._internal.stackDepth;
}
@@ -189,12 +196,31 @@ const PageStack = {
_deregisterPageStack() {
NavigationHandler.instance.deregisterPageStack(this._internal.name, this);
},
_pageNameForId(id) {
if (this._internal.pages === undefined) return;
const page = this._internal.pages.find((p) => p.id === id);
if (page === undefined) return;
/**
* @param {String} pageIdOrLabel
*/
_findPage(pageIdOrLabel) {
if (this._internal.pageInfo[pageIdOrLabel]) {
const pageInfo = this._internal.pageInfo[pageIdOrLabel];
const pageRef = this._internal.pages.find((x) => x.id === pageIdOrLabel);
return {
component: String(pageInfo.component),
label: String(pageRef.label),
id: String(pageIdOrLabel)
};
}
return page.label;
const pageRef = this._internal.pages.find((x) => x.label === pageIdOrLabel);
if (pageRef) {
const pageInfo = this._internal.pageInfo[pageRef.id];
return {
component: String(pageInfo.component),
label: String(pageRef.label),
id: String(pageRef.id)
};
}
return undefined;
},
setPageOutputs(outputs) {
for (const prop in outputs) {
@@ -230,8 +256,9 @@ const PageStack = {
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
var startPageId,
params = {};
let startPageId;
let params = {};
var pageFromUrl = this.matchPageFromUrl();
if (pageFromUrl !== undefined) {
// We have an url matching a page, use that page as start page
@@ -239,13 +266,16 @@ const PageStack = {
params = Object.assign({}, pageFromUrl.query, pageFromUrl.params);
} else {
var startPageId = this._internal.startPageId;
startPageId = this._internal.startPageId;
if (startPageId === undefined) startPageId = this._internal.pages[0].id;
}
var pageInfo = this._internal.pageInfo[startPageId];
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
// Find the page by either ID or by Label
const pageInfo = this._findPage(startPageId);
if (pageInfo === undefined || pageInfo.component === undefined) {
// No page was found
return;
}
var content = await this.nodeScope.createNode(pageInfo.component, guid());
@@ -269,7 +299,7 @@ const PageStack = {
];
this.setPageOutputs({
topPageName: this._pageNameForId(startPageId),
topPageName: pageInfo.label,
stackDepth: this._internal.stack.length
});
},
@@ -458,13 +488,22 @@ const PageStack = {
this._internal.asyncQueue.enqueue(this.replaceAsync.bind(this, args));
},
async replaceAsync(args) {
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
return;
}
if (this._internal.isTransitioning) return;
if (this._internal.isTransitioning) {
return;
}
var pageId = args.target || this._internal.pages[0].id;
var pageInfo = this._internal.pageInfo[pageId];
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
const pageId = args.target || this._internal.pages[0].id;
// Find the page by either ID or by Label
const pageInfo = this._findPage(pageId);
if (pageInfo === undefined || pageInfo.component === undefined) {
// No page was found
return;
}
// Remove all current pages in the stack
var children = this.getChildren();
@@ -498,7 +537,7 @@ const PageStack = {
];
this.setPageOutputs({
topPageName: this._pageNameForId(pageId),
topPageName: pageInfo.label,
stackDepth: this._internal.stack.length
});
@@ -510,13 +549,22 @@ const PageStack = {
this._internal.asyncQueue.enqueue(this.navigateAsync.bind(this, args));
},
async navigateAsync(args) {
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
return;
}
if (this._internal.isTransitioning) return;
if (this._internal.isTransitioning) {
return;
}
var pageId = args.target || this._internal.pages[0].id;
var pageInfo = this._internal.pageInfo[pageId];
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
const pageId = args.target || this._internal.pages[0].id;
// Find the page by either ID or by Label
const pageInfo = this._findPage(pageId);
if (pageInfo === undefined || pageInfo.component === undefined) {
// No page was found
return;
}
// Create the container group
const group = this.createPageContainer();
@@ -530,7 +578,7 @@ const PageStack = {
group.addChild(content);
// Connect navigate back nodes
var navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
const navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
if (navigateBackNodes && navigateBackNodes.length > 0) {
for (var j = 0; j < navigateBackNodes.length; j++) {
navigateBackNodes[j]._setBackCallback(this.back.bind(this));
@@ -538,8 +586,8 @@ const PageStack = {
}
// Push the new top
var top = this._internal.stack[this._internal.stack.length - 1];
var newTop = {
const top = this._internal.stack[this._internal.stack.length - 1];
const newTop = {
from: top.page,
page: group,
pageInfo: pageInfo,
@@ -551,7 +599,7 @@ const PageStack = {
};
this._internal.stack.push(newTop);
this.setPageOutputs({
topPageName: this._pageNameForId(args.target),
topPageName: pageInfo.label,
stackDepth: this._internal.stack.length
});
this._updateUrlWithTopPage();
@@ -584,8 +632,11 @@ const PageStack = {
this.addChild(top.from, 0);
top.backCallback && top.backCallback(args.backAction, args.results);
// Find the page by either ID or by Label
const pageInfo = this._findPage(this._internal.stack[this._internal.stack.length - 2].pageId);
this.setPageOutputs({
topPageName: this._pageNameForId(this._internal.stack[this._internal.stack.length - 2].pageId),
topPageName: pageInfo.label,
stackDepth: this._internal.stack.length - 1
});

View File

@@ -2,8 +2,7 @@
const { Node } = require('@noodl/runtime');
var Model = require('@noodl/runtime/src/model'),
Collection = require('@noodl/runtime/src/collection');
const Collection = require('@noodl/runtime/src/collection');
var CollectionNode = {
name: 'Collection2',
@@ -27,6 +26,7 @@ var CollectionNode = {
_this.scheduleAfterInputsHaveUpdated(function () {
_this.sendSignalOnOutput('changed');
_this.flagOutputDirty('firstItemId');
_this.flagOutputDirty('count');
collectionChangedScheduled = false;
});
@@ -117,6 +117,17 @@ var CollectionNode = {
return this._internal.collection;
}
},
firstItemId: {
type: 'string',
displayName: 'First Item Id',
group: 'General',
getter: function () {
if (this._internal.collection) {
var firstItem = this._internal.collection.get(0);
if (firstItem !== undefined) return firstItem.getId();
}
}
},
count: {
type: 'number',
displayName: 'Count',
@@ -150,6 +161,7 @@ var CollectionNode = {
collection.on('change', this._internal.collectionChangedCallback);
this.flagOutputDirty('items');
this.flagOutputDirty('firstItemId');
this.flagOutputDirty('count');
},
setSourceCollection: function (collection) {

View File

@@ -482,7 +482,12 @@ declare namespace Noodl {
const Records: RecordsApi;
interface CurrentUserObject {
UserId: string;
id: string;
email: string;
emailVerified: boolean;
username: string;
Properties: unknown;
/**
* Log out the current user and terminate the session.