@nodegx/preview 0.2.7 → 0.2.9
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/dist/backend/cli.js +7091 -3568
- package/dist/browser/noodl-graph-target.js +95 -95
- package/dist/browser/noodl-preview-in-page.js +30 -27
- package/dist/external/deploy/noodl.deploy.js +1 -1
- package/dist/nodegx-deploy.cjs +1761 -956
- package/dist/nodegx-deploy.inputs.json +7 -0
- package/dist/noodl-preview.cjs +1825 -967
- package/dist/noodl-preview.inputs.json +6 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/nodegx-deploy.cjs
CHANGED
|
@@ -4936,7 +4936,7 @@ var require_lib3 = __commonJS({
|
|
|
4936
4936
|
return this.resolve([]);
|
|
4937
4937
|
}
|
|
4938
4938
|
var values2 = new Array(len);
|
|
4939
|
-
var
|
|
4939
|
+
var resolved3 = 0;
|
|
4940
4940
|
var i2 = -1;
|
|
4941
4941
|
var promise = new this(INTERNAL);
|
|
4942
4942
|
while (++i2 < len) {
|
|
@@ -4952,7 +4952,7 @@ var require_lib3 = __commonJS({
|
|
|
4952
4952
|
});
|
|
4953
4953
|
function resolveFromAll(outValue) {
|
|
4954
4954
|
values2[i3] = outValue;
|
|
4955
|
-
if (++
|
|
4955
|
+
if (++resolved3 === len && !called) {
|
|
4956
4956
|
called = true;
|
|
4957
4957
|
handlers.resolve(promise, values2);
|
|
4958
4958
|
}
|
|
@@ -6222,15 +6222,15 @@ var require_crc32 = __commonJS({
|
|
|
6222
6222
|
"use strict";
|
|
6223
6223
|
var utils = require_utils3();
|
|
6224
6224
|
function makeTable() {
|
|
6225
|
-
var c,
|
|
6225
|
+
var c, table2 = [];
|
|
6226
6226
|
for (var n = 0; n < 256; n++) {
|
|
6227
6227
|
c = n;
|
|
6228
6228
|
for (var k = 0; k < 8; k++) {
|
|
6229
6229
|
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
6230
6230
|
}
|
|
6231
|
-
|
|
6231
|
+
table2[n] = c;
|
|
6232
6232
|
}
|
|
6233
|
-
return
|
|
6233
|
+
return table2;
|
|
6234
6234
|
}
|
|
6235
6235
|
var crcTable = makeTable();
|
|
6236
6236
|
function crc32(crc, buf, len, pos) {
|
|
@@ -7228,15 +7228,15 @@ var require_crc322 = __commonJS({
|
|
|
7228
7228
|
"../../node_modules/pako/lib/zlib/crc32.js"(exports2, module2) {
|
|
7229
7229
|
"use strict";
|
|
7230
7230
|
function makeTable() {
|
|
7231
|
-
var c,
|
|
7231
|
+
var c, table2 = [];
|
|
7232
7232
|
for (var n = 0; n < 256; n++) {
|
|
7233
7233
|
c = n;
|
|
7234
7234
|
for (var k = 0; k < 8; k++) {
|
|
7235
7235
|
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
7236
7236
|
}
|
|
7237
|
-
|
|
7237
|
+
table2[n] = c;
|
|
7238
7238
|
}
|
|
7239
|
-
return
|
|
7239
|
+
return table2;
|
|
7240
7240
|
}
|
|
7241
7241
|
var crcTable = makeTable();
|
|
7242
7242
|
function crc32(crc, buf, len, pos) {
|
|
@@ -9030,7 +9030,7 @@ var require_inftrees = __commonJS({
|
|
|
9030
9030
|
64,
|
|
9031
9031
|
64
|
|
9032
9032
|
];
|
|
9033
|
-
module2.exports = function inflate_table(type, lens, lens_index, codes,
|
|
9033
|
+
module2.exports = function inflate_table(type, lens, lens_index, codes, table2, table_index, work, opts) {
|
|
9034
9034
|
var bits = opts.bits;
|
|
9035
9035
|
var len = 0;
|
|
9036
9036
|
var sym = 0;
|
|
@@ -9070,8 +9070,8 @@ var require_inftrees = __commonJS({
|
|
|
9070
9070
|
root2 = max2;
|
|
9071
9071
|
}
|
|
9072
9072
|
if (max2 === 0) {
|
|
9073
|
-
|
|
9074
|
-
|
|
9073
|
+
table2[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
9074
|
+
table2[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
9075
9075
|
opts.bits = 1;
|
|
9076
9076
|
return 0;
|
|
9077
9077
|
}
|
|
@@ -9146,7 +9146,7 @@ var require_inftrees = __commonJS({
|
|
|
9146
9146
|
min2 = fill;
|
|
9147
9147
|
do {
|
|
9148
9148
|
fill -= incr;
|
|
9149
|
-
|
|
9149
|
+
table2[next2 + (huff >> drop2) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
|
|
9150
9150
|
} while (fill !== 0);
|
|
9151
9151
|
incr = 1 << len - 1;
|
|
9152
9152
|
while (huff & incr) {
|
|
@@ -9185,11 +9185,11 @@ var require_inftrees = __commonJS({
|
|
|
9185
9185
|
return 1;
|
|
9186
9186
|
}
|
|
9187
9187
|
low = huff & mask;
|
|
9188
|
-
|
|
9188
|
+
table2[low] = root2 << 24 | curr << 16 | next2 - table_index | 0;
|
|
9189
9189
|
}
|
|
9190
9190
|
}
|
|
9191
9191
|
if (huff !== 0) {
|
|
9192
|
-
|
|
9192
|
+
table2[next2 + huff] = len - drop2 << 24 | 64 << 16 | 0;
|
|
9193
9193
|
}
|
|
9194
9194
|
opts.bits = root2;
|
|
9195
9195
|
return 0;
|
|
@@ -9236,7 +9236,7 @@ var require_inflate = __commonJS({
|
|
|
9236
9236
|
var STORED = 14;
|
|
9237
9237
|
var COPY_ = 15;
|
|
9238
9238
|
var COPY = 16;
|
|
9239
|
-
var
|
|
9239
|
+
var TABLE3 = 17;
|
|
9240
9240
|
var LENLENS = 18;
|
|
9241
9241
|
var CODELENS = 19;
|
|
9242
9242
|
var LEN_ = 20;
|
|
@@ -9824,7 +9824,7 @@ var require_inflate = __commonJS({
|
|
|
9824
9824
|
}
|
|
9825
9825
|
break;
|
|
9826
9826
|
case 2:
|
|
9827
|
-
state2.mode =
|
|
9827
|
+
state2.mode = TABLE3;
|
|
9828
9828
|
break;
|
|
9829
9829
|
case 3:
|
|
9830
9830
|
strm.msg = "invalid block type";
|
|
@@ -9882,7 +9882,7 @@ var require_inflate = __commonJS({
|
|
|
9882
9882
|
}
|
|
9883
9883
|
state2.mode = TYPE;
|
|
9884
9884
|
break;
|
|
9885
|
-
case
|
|
9885
|
+
case TABLE3:
|
|
9886
9886
|
while (bits < 14) {
|
|
9887
9887
|
if (have === 0) {
|
|
9888
9888
|
break inf_leave;
|
|
@@ -13786,7 +13786,7 @@ var require_common2 = __commonJS({
|
|
|
13786
13786
|
exports2.ownProp = ownProp;
|
|
13787
13787
|
exports2.makeAbs = makeAbs;
|
|
13788
13788
|
exports2.finish = finish3;
|
|
13789
|
-
exports2.mark =
|
|
13789
|
+
exports2.mark = mark2;
|
|
13790
13790
|
exports2.isIgnored = isIgnored;
|
|
13791
13791
|
exports2.childrenIgnored = childrenIgnored;
|
|
13792
13792
|
function ownProp(obj, field2) {
|
|
@@ -13922,7 +13922,7 @@ var require_common2 = __commonJS({
|
|
|
13922
13922
|
});
|
|
13923
13923
|
self2.found = all;
|
|
13924
13924
|
}
|
|
13925
|
-
function
|
|
13925
|
+
function mark2(self2, p) {
|
|
13926
13926
|
var abs = makeAbs(self2, p);
|
|
13927
13927
|
var c = self2.cache[abs];
|
|
13928
13928
|
var m = p;
|
|
@@ -18973,8 +18973,21 @@ var require_node2 = __commonJS({
|
|
|
18973
18973
|
const scope = this.nodeScope;
|
|
18974
18974
|
const runContext = scope && scope.runContext;
|
|
18975
18975
|
if (!runContext || !runContext.beginStep || !runContext.endStep) return;
|
|
18976
|
-
const
|
|
18977
|
-
|
|
18976
|
+
const recordValues = !!runContext.recordValues;
|
|
18977
|
+
const step = runContext.beginStep({
|
|
18978
|
+
nodeId: this.id,
|
|
18979
|
+
nodeType: this.name,
|
|
18980
|
+
...recordValues ? { inputs: snapshotInputValues(this) } : {}
|
|
18981
|
+
});
|
|
18982
|
+
if (step !== void 0 && step !== null) {
|
|
18983
|
+
runContext.endStep(step, {
|
|
18984
|
+
status: "failure",
|
|
18985
|
+
code,
|
|
18986
|
+
message,
|
|
18987
|
+
detail,
|
|
18988
|
+
...recordValues ? { outputs: snapshotOutputValues(this) } : {}
|
|
18989
|
+
});
|
|
18990
|
+
}
|
|
18978
18991
|
};
|
|
18979
18992
|
Node17.prototype.setDiagnostic = function(key, message) {
|
|
18980
18993
|
setDiagnostic(this, key, message);
|
|
@@ -18984,6 +18997,47 @@ var require_node2 = __commonJS({
|
|
|
18984
18997
|
return diagnosticsEnabled(this);
|
|
18985
18998
|
}
|
|
18986
18999
|
});
|
|
19000
|
+
function isSignalPortType(type) {
|
|
19001
|
+
if (type === "signal") return true;
|
|
19002
|
+
return !!type && typeof type === "object" && type.name === "signal";
|
|
19003
|
+
}
|
|
19004
|
+
function snapshotInputValues(node) {
|
|
19005
|
+
const out = {};
|
|
19006
|
+
const values2 = node._inputValues || {};
|
|
19007
|
+
const inputs = node._inputs || {};
|
|
19008
|
+
let declared2 = {};
|
|
19009
|
+
try {
|
|
19010
|
+
const register3 = node.context && node.context.nodeRegister;
|
|
19011
|
+
if (register3 && register3.hasNode(node.name)) declared2 = register3.getNodeMetadata(node.name).inputs || {};
|
|
19012
|
+
} catch (e) {
|
|
19013
|
+
}
|
|
19014
|
+
for (const name2 of Object.keys(values2)) {
|
|
19015
|
+
const value2 = values2[name2];
|
|
19016
|
+
if (value2 === void 0 || typeof value2 === "function") continue;
|
|
19017
|
+
const port5 = inputs[name2];
|
|
19018
|
+
if (port5 && isSignalPortType(port5.type)) continue;
|
|
19019
|
+
const meta = declared2[name2];
|
|
19020
|
+
if (meta && isSignalPortType(meta.type)) continue;
|
|
19021
|
+
out[name2] = value2;
|
|
19022
|
+
}
|
|
19023
|
+
return out;
|
|
19024
|
+
}
|
|
19025
|
+
function snapshotOutputValues(node) {
|
|
19026
|
+
const out = {};
|
|
19027
|
+
const list2 = node._outputList || [];
|
|
19028
|
+
for (const port5 of list2) {
|
|
19029
|
+
if (!port5 || isSignalPortType(port5.type)) continue;
|
|
19030
|
+
let value2;
|
|
19031
|
+
try {
|
|
19032
|
+
value2 = port5.value;
|
|
19033
|
+
} catch (e) {
|
|
19034
|
+
continue;
|
|
19035
|
+
}
|
|
19036
|
+
if (value2 === void 0 || typeof value2 === "function") continue;
|
|
19037
|
+
out[port5.name] = value2;
|
|
19038
|
+
}
|
|
19039
|
+
return out;
|
|
19040
|
+
}
|
|
18987
19041
|
Node17.prototype.beginOutcome = function(inputData) {
|
|
18988
19042
|
const token = { reported: void 0 };
|
|
18989
19043
|
const cause = currentTraceCause(this.context);
|
|
@@ -18991,7 +19045,13 @@ var require_node2 = __commonJS({
|
|
|
18991
19045
|
const scope = this.nodeScope;
|
|
18992
19046
|
const runContext = scope && scope.runContext;
|
|
18993
19047
|
if (runContext && runContext.beginStep) {
|
|
18994
|
-
token.step = runContext.beginStep({
|
|
19048
|
+
token.step = runContext.beginStep({
|
|
19049
|
+
nodeId: this.id,
|
|
19050
|
+
nodeType: this.name,
|
|
19051
|
+
inputData,
|
|
19052
|
+
// P123-STU-FNRUNVALUES — opt-in; absent, the step object is exactly what it always was.
|
|
19053
|
+
...runContext.recordValues ? { inputs: snapshotInputValues(this) } : {}
|
|
19054
|
+
});
|
|
18995
19055
|
}
|
|
18996
19056
|
return token;
|
|
18997
19057
|
};
|
|
@@ -19070,7 +19130,10 @@ var require_node2 = __commonJS({
|
|
|
19070
19130
|
message: options && options.message,
|
|
19071
19131
|
// The subject of the failure, for a record whose steps are all called `http`. See
|
|
19072
19132
|
// `RuntimeStepEnd.detail` — the node already composes this for the error bus.
|
|
19073
|
-
detail: options && options.detail
|
|
19133
|
+
detail: options && options.detail,
|
|
19134
|
+
// P123-STU-FNRUNVALUES — read now, after the signals: "the outcome is the last thing an
|
|
19135
|
+
// action does", so every value it produced is already on its ports.
|
|
19136
|
+
...runContext.recordValues ? { outputs: snapshotOutputValues(this) } : {}
|
|
19074
19137
|
});
|
|
19075
19138
|
}
|
|
19076
19139
|
}
|
|
@@ -19380,10 +19443,10 @@ var require_nodescope = __commonJS({
|
|
|
19380
19443
|
} else {
|
|
19381
19444
|
const parameters = nodeModel.parameters;
|
|
19382
19445
|
var inputNames = Object.keys(parameters);
|
|
19383
|
-
const
|
|
19446
|
+
const RUN_ON_CHANGE_PREFIX5 = "runOnChange-";
|
|
19384
19447
|
const metadata = this.context.nodeRegister.hasNode(node.name) ? this.context.nodeRegister.getNodeMetadata(node.name) : void 0;
|
|
19385
19448
|
const priorityOf = function(name2) {
|
|
19386
|
-
if (name2.indexOf(
|
|
19449
|
+
if (name2.indexOf(RUN_ON_CHANGE_PREFIX5) === 0) return Number.MAX_SAFE_INTEGER;
|
|
19387
19450
|
const input2 = metadata ? metadata.inputs[name2] : void 0;
|
|
19388
19451
|
return input2 ? input2.inputPriority : 0;
|
|
19389
19452
|
};
|
|
@@ -23328,7 +23391,10 @@ var require_nodedefinition = __commonJS({
|
|
|
23328
23391
|
node.registerOutput(name2, {
|
|
23329
23392
|
getter: function() {
|
|
23330
23393
|
return void 0;
|
|
23331
|
-
}
|
|
23394
|
+
},
|
|
23395
|
+
onFirstConnectionAdded: output.onFirstConnectionAdded,
|
|
23396
|
+
onLastConnectionRemoved: output.onLastConnectionRemoved
|
|
23397
|
+
// a signal keeps its wire hooks (P121-TWO003)
|
|
23332
23398
|
});
|
|
23333
23399
|
} else {
|
|
23334
23400
|
node.registerOutput(name2, output);
|
|
@@ -24601,9 +24667,704 @@ var require_runtasks = __commonJS({
|
|
|
24601
24667
|
}
|
|
24602
24668
|
});
|
|
24603
24669
|
|
|
24670
|
+
// ../noodl-runtime/src/utils.ts
|
|
24671
|
+
var utils_exports = {};
|
|
24672
|
+
__export(utils_exports, {
|
|
24673
|
+
getAbsoluteUrl: () => getAbsoluteUrl,
|
|
24674
|
+
logJavaScriptNodeError: () => logJavaScriptNodeError,
|
|
24675
|
+
thrownMessage: () => thrownMessage
|
|
24676
|
+
});
|
|
24677
|
+
function getAbsoluteUrl(_url) {
|
|
24678
|
+
const url = String(_url);
|
|
24679
|
+
if (!url || url[0] === "/" || url.includes("://") || url.startsWith("data:")) {
|
|
24680
|
+
return url;
|
|
24681
|
+
}
|
|
24682
|
+
return (Noodl.baseUrl || "/") + url;
|
|
24683
|
+
}
|
|
24684
|
+
function thrownMessage(error) {
|
|
24685
|
+
if (error && error.message) return String(error.message);
|
|
24686
|
+
try {
|
|
24687
|
+
return String(error);
|
|
24688
|
+
} catch {
|
|
24689
|
+
return typeof error;
|
|
24690
|
+
}
|
|
24691
|
+
}
|
|
24692
|
+
function logJavaScriptNodeError(error) {
|
|
24693
|
+
const prefix = "Error in JS node run code.";
|
|
24694
|
+
if (error === null || typeof error !== "object" && typeof error !== "function") {
|
|
24695
|
+
console.log(prefix, thrownMessage(error));
|
|
24696
|
+
return;
|
|
24697
|
+
}
|
|
24698
|
+
const proto = Object.getPrototypeOf(error);
|
|
24699
|
+
const kind = proto && proto.constructor && proto.constructor.name ? proto.constructor.name : "Error";
|
|
24700
|
+
console.log(prefix, kind + ": " + thrownMessage(error), error.stack);
|
|
24701
|
+
}
|
|
24702
|
+
var init_utils = __esm({
|
|
24703
|
+
"../noodl-runtime/src/utils.ts"() {
|
|
24704
|
+
}
|
|
24705
|
+
});
|
|
24706
|
+
|
|
24707
|
+
// ../noodl-runtime/src/componentwalk.ts
|
|
24708
|
+
var componentwalk_exports = {};
|
|
24709
|
+
__export(componentwalk_exports, {
|
|
24710
|
+
COMPONENT_OBJECT_TYPES: () => COMPONENT_OBJECT_TYPES,
|
|
24711
|
+
componentAncestorNames: () => componentAncestorNames,
|
|
24712
|
+
componentAncestors: () => componentAncestors,
|
|
24713
|
+
findAncestorWithComponentObject: () => findAncestorWithComponentObject,
|
|
24714
|
+
findAncestorWithName: () => findAncestorWithName,
|
|
24715
|
+
findAncestorWithNodeType: () => findAncestorWithNodeType,
|
|
24716
|
+
findAncestorWithProperty: () => findAncestorWithProperty,
|
|
24717
|
+
findComponentAncestor: () => findComponentAncestor,
|
|
24718
|
+
parentComponentOf: () => parentComponentOf,
|
|
24719
|
+
scopeChain: () => scopeChain,
|
|
24720
|
+
scopeChainNames: () => scopeChainNames
|
|
24721
|
+
});
|
|
24722
|
+
function parentComponentOf(component) {
|
|
24723
|
+
if (!component) return void 0;
|
|
24724
|
+
let parent;
|
|
24725
|
+
if (component.getRoots().length > 0) {
|
|
24726
|
+
const root2 = component.getRoots()[0];
|
|
24727
|
+
if (root2.getVisualParentNode) {
|
|
24728
|
+
const visualParent = root2.getVisualParentNode();
|
|
24729
|
+
if (visualParent) {
|
|
24730
|
+
parent = visualParent.nodeScope.componentOwner;
|
|
24731
|
+
}
|
|
24732
|
+
} else if (root2.parentNodeScope) {
|
|
24733
|
+
parent = component.parentNodeScope.componentOwner;
|
|
24734
|
+
}
|
|
24735
|
+
} else if (component.parentNodeScope) {
|
|
24736
|
+
parent = component.parentNodeScope.componentOwner;
|
|
24737
|
+
}
|
|
24738
|
+
if (parent && parent.nodeScope && parent.nodeScope.componentOwner !== component) {
|
|
24739
|
+
return parent;
|
|
24740
|
+
}
|
|
24741
|
+
return void 0;
|
|
24742
|
+
}
|
|
24743
|
+
function componentAncestors(component) {
|
|
24744
|
+
const ancestors = [];
|
|
24745
|
+
let current = component;
|
|
24746
|
+
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
24747
|
+
const parent = parentComponentOf(current);
|
|
24748
|
+
if (!parent) break;
|
|
24749
|
+
ancestors.push(parent);
|
|
24750
|
+
current = parent;
|
|
24751
|
+
}
|
|
24752
|
+
return ancestors;
|
|
24753
|
+
}
|
|
24754
|
+
function findComponentAncestor(component, predicate) {
|
|
24755
|
+
let current = component;
|
|
24756
|
+
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
24757
|
+
const parent = parentComponentOf(current);
|
|
24758
|
+
if (!parent) return void 0;
|
|
24759
|
+
if (predicate(parent)) return parent;
|
|
24760
|
+
current = parent;
|
|
24761
|
+
}
|
|
24762
|
+
return void 0;
|
|
24763
|
+
}
|
|
24764
|
+
function findAncestorWithNodeType(component, types) {
|
|
24765
|
+
return findComponentAncestor(
|
|
24766
|
+
component,
|
|
24767
|
+
(candidate) => types.some((type) => candidate.nodeScope.getNodesWithType(type).length > 0)
|
|
24768
|
+
);
|
|
24769
|
+
}
|
|
24770
|
+
function findAncestorWithComponentObject(component) {
|
|
24771
|
+
return findAncestorWithNodeType(component, COMPONENT_OBJECT_TYPES);
|
|
24772
|
+
}
|
|
24773
|
+
function findAncestorWithName(component, name2) {
|
|
24774
|
+
return findComponentAncestor(component, (candidate) => candidate.name === name2);
|
|
24775
|
+
}
|
|
24776
|
+
function scopeChain(component) {
|
|
24777
|
+
const chain2 = [];
|
|
24778
|
+
let current = component;
|
|
24779
|
+
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
24780
|
+
if (!current) break;
|
|
24781
|
+
chain2.push(current);
|
|
24782
|
+
if (!current.parentNodeScope) break;
|
|
24783
|
+
current = current.parentNodeScope.componentOwner;
|
|
24784
|
+
}
|
|
24785
|
+
return chain2;
|
|
24786
|
+
}
|
|
24787
|
+
function scopeChainNames(component) {
|
|
24788
|
+
return scopeChain(component).map((entry) => entry.name);
|
|
24789
|
+
}
|
|
24790
|
+
function findAncestorWithProperty(component, property2) {
|
|
24791
|
+
const chain2 = scopeChain(component);
|
|
24792
|
+
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
24793
|
+
if (chain2[i2][property2] !== void 0) return chain2[i2];
|
|
24794
|
+
}
|
|
24795
|
+
return void 0;
|
|
24796
|
+
}
|
|
24797
|
+
function componentAncestorNames(component) {
|
|
24798
|
+
return componentAncestors(component).map((ancestor) => ancestor.name);
|
|
24799
|
+
}
|
|
24800
|
+
var MAX_WALK_DEPTH, COMPONENT_OBJECT_TYPES;
|
|
24801
|
+
var init_componentwalk = __esm({
|
|
24802
|
+
"../noodl-runtime/src/componentwalk.ts"() {
|
|
24803
|
+
"use strict";
|
|
24804
|
+
MAX_WALK_DEPTH = 1e3;
|
|
24805
|
+
COMPONENT_OBJECT_TYPES = ["net.noodl.ComponentObject", "Component State"];
|
|
24806
|
+
}
|
|
24807
|
+
});
|
|
24808
|
+
|
|
24809
|
+
// ../noodl-runtime/src/resolvedtarget.ts
|
|
24810
|
+
function summariseTargets(labels) {
|
|
24811
|
+
const distinct = [];
|
|
24812
|
+
for (let i2 = 0; i2 < labels.length; i2++) {
|
|
24813
|
+
const label = labels[i2];
|
|
24814
|
+
if (label === void 0) continue;
|
|
24815
|
+
if (distinct.indexOf(label) === -1) distinct.push(label);
|
|
24816
|
+
}
|
|
24817
|
+
if (distinct.length === 0) return void 0;
|
|
24818
|
+
if (distinct.length === 1) return "\u2192 " + distinct[0];
|
|
24819
|
+
const listed = distinct.slice(0, MAX_NAMES_LISTED).join(", ");
|
|
24820
|
+
const rest2 = distinct.length - MAX_NAMES_LISTED;
|
|
24821
|
+
return "\u2192 " + distinct.length + " targets: " + listed + (rest2 > 0 ? ", +" + rest2 : "");
|
|
24822
|
+
}
|
|
24823
|
+
var MAX_NAMES_LISTED, ResolvedTargetReporter;
|
|
24824
|
+
var init_resolvedtarget = __esm({
|
|
24825
|
+
"../noodl-runtime/src/resolvedtarget.ts"() {
|
|
24826
|
+
"use strict";
|
|
24827
|
+
MAX_NAMES_LISTED = 3;
|
|
24828
|
+
ResolvedTargetReporter = class {
|
|
24829
|
+
constructor() {
|
|
24830
|
+
/** Weak, so a torn-down runtime's bookkeeping goes with it and needs no reset call. */
|
|
24831
|
+
this._byContext = /* @__PURE__ */ new WeakMap();
|
|
24832
|
+
}
|
|
24833
|
+
/**
|
|
24834
|
+
* Record what `node` bound to and push the summary to the editor.
|
|
24835
|
+
*
|
|
24836
|
+
* Safe to call every resolution; identical summaries are dropped rather than sent, so a
|
|
24837
|
+
* node that re-resolves each frame costs one string comparison.
|
|
24838
|
+
*/
|
|
24839
|
+
report(node, target) {
|
|
24840
|
+
const state2 = this._stateFor(node);
|
|
24841
|
+
if (!state2) return;
|
|
24842
|
+
let instances = state2.byGraphNode.get(node.id);
|
|
24843
|
+
if (!instances) {
|
|
24844
|
+
instances = /* @__PURE__ */ new Map();
|
|
24845
|
+
state2.byGraphNode.set(node.id, instances);
|
|
24846
|
+
}
|
|
24847
|
+
instances.set(node, target);
|
|
24848
|
+
this._flush(node, state2, instances);
|
|
24849
|
+
}
|
|
24850
|
+
/** Drop an instance. Call from `_onNodeDeleted`, or this map is a leak. */
|
|
24851
|
+
forget(node) {
|
|
24852
|
+
const state2 = this._stateFor(node);
|
|
24853
|
+
if (!state2) return;
|
|
24854
|
+
const instances = state2.byGraphNode.get(node.id);
|
|
24855
|
+
if (!instances) return;
|
|
24856
|
+
instances.delete(node);
|
|
24857
|
+
if (instances.size === 0) {
|
|
24858
|
+
state2.byGraphNode.delete(node.id);
|
|
24859
|
+
state2.lastSent.delete(node.id);
|
|
24860
|
+
return;
|
|
24861
|
+
}
|
|
24862
|
+
this._flush(node, state2, instances);
|
|
24863
|
+
}
|
|
24864
|
+
_stateFor(node) {
|
|
24865
|
+
const context = node.context;
|
|
24866
|
+
if (!context) return void 0;
|
|
24867
|
+
let state2 = this._byContext.get(context);
|
|
24868
|
+
if (!state2) {
|
|
24869
|
+
state2 = { byGraphNode: /* @__PURE__ */ new Map(), lastSent: /* @__PURE__ */ new Map() };
|
|
24870
|
+
this._byContext.set(context, state2);
|
|
24871
|
+
}
|
|
24872
|
+
return state2;
|
|
24873
|
+
}
|
|
24874
|
+
_flush(node, state2, instances) {
|
|
24875
|
+
const labels = [];
|
|
24876
|
+
instances.forEach((label) => labels.push(label));
|
|
24877
|
+
const summary = summariseTargets(labels);
|
|
24878
|
+
if (state2.lastSent.has(node.id) && state2.lastSent.get(node.id) === summary) return;
|
|
24879
|
+
state2.lastSent.set(node.id, summary);
|
|
24880
|
+
const editorConnection = node.context && node.context.editorConnection;
|
|
24881
|
+
if (!editorConnection || !editorConnection.isRunningLocally()) return;
|
|
24882
|
+
if (typeof editorConnection.sendNodeSubLabel !== "function") return;
|
|
24883
|
+
editorConnection.sendNodeSubLabel(node.id, summary);
|
|
24884
|
+
}
|
|
24885
|
+
};
|
|
24886
|
+
}
|
|
24887
|
+
});
|
|
24888
|
+
|
|
24889
|
+
// ../noodl-runtime/src/foreachitem.ts
|
|
24890
|
+
var foreachitem_exports = {};
|
|
24891
|
+
__export(foreachitem_exports, {
|
|
24892
|
+
forgetForEachItem: () => forgetForEachItem,
|
|
24893
|
+
resolveForEachItem: () => resolveForEachItem
|
|
24894
|
+
});
|
|
24895
|
+
function resolveForEachItem(node, options = {}) {
|
|
24896
|
+
const chain2 = scopeChain(node.nodeScope.componentOwner);
|
|
24897
|
+
const wanted = options.target;
|
|
24898
|
+
if (wanted) {
|
|
24899
|
+
const named3 = firstNamed(chain2, wanted);
|
|
24900
|
+
if (!named3) {
|
|
24901
|
+
return miss(
|
|
24902
|
+
node,
|
|
24903
|
+
"repeater-item/target-not-found",
|
|
24904
|
+
'No component named "' + wanted + '" contains this node',
|
|
24905
|
+
wanted,
|
|
24906
|
+
{ target: wanted, scope: scopeChainNames(node.nodeScope.componentOwner) }
|
|
24907
|
+
);
|
|
24908
|
+
}
|
|
24909
|
+
if (named3[FOR_EACH_MODEL] === void 0) {
|
|
24910
|
+
return miss(
|
|
24911
|
+
node,
|
|
24912
|
+
"repeater-item/target-has-no-item",
|
|
24913
|
+
'The component "' + wanted + '" has no current item \u2014 it is not used as a Repeater or Run Tasks template',
|
|
24914
|
+
wanted,
|
|
24915
|
+
{ target: wanted }
|
|
24916
|
+
);
|
|
24917
|
+
}
|
|
24918
|
+
return hit(node, named3);
|
|
24919
|
+
}
|
|
24920
|
+
const owner = firstWithItem(chain2);
|
|
24921
|
+
if (!owner) {
|
|
24922
|
+
return miss(
|
|
24923
|
+
node,
|
|
24924
|
+
"repeater-item/no-item-in-scope",
|
|
24925
|
+
'Id Source is set to "From repeater", but this node is not inside a Repeater or Run Tasks template',
|
|
24926
|
+
void 0,
|
|
24927
|
+
{ scope: scopeChainNames(node.nodeScope.componentOwner) }
|
|
24928
|
+
);
|
|
24929
|
+
}
|
|
24930
|
+
return hit(node, owner);
|
|
24931
|
+
}
|
|
24932
|
+
function forgetForEachItem(node) {
|
|
24933
|
+
resolvedTargets.forget(node);
|
|
24934
|
+
lastMissByNode.delete(node);
|
|
24935
|
+
}
|
|
24936
|
+
function firstNamed(chain2, name2) {
|
|
24937
|
+
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
24938
|
+
if (chain2[i2].name === name2) return chain2[i2];
|
|
24939
|
+
}
|
|
24940
|
+
return void 0;
|
|
24941
|
+
}
|
|
24942
|
+
function firstWithItem(chain2) {
|
|
24943
|
+
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
24944
|
+
if (chain2[i2][FOR_EACH_MODEL] !== void 0) return chain2[i2];
|
|
24945
|
+
}
|
|
24946
|
+
return void 0;
|
|
24947
|
+
}
|
|
24948
|
+
function hit(node, owner) {
|
|
24949
|
+
lastMissByNode.delete(node);
|
|
24950
|
+
resolvedTargets.report(node, owner.name);
|
|
24951
|
+
return owner[FOR_EACH_MODEL];
|
|
24952
|
+
}
|
|
24953
|
+
function miss(node, code, message, target, detail) {
|
|
24954
|
+
resolvedTargets.report(node, void 0);
|
|
24955
|
+
const seen = code + "|" + (target || "");
|
|
24956
|
+
if (lastMissByNode.get(node) !== seen) {
|
|
24957
|
+
lastMissByNode.set(node, seen);
|
|
24958
|
+
node.raiseRuntimeError(code, message, detail);
|
|
24959
|
+
}
|
|
24960
|
+
return void 0;
|
|
24961
|
+
}
|
|
24962
|
+
var FOR_EACH_MODEL, resolvedTargets, lastMissByNode;
|
|
24963
|
+
var init_foreachitem = __esm({
|
|
24964
|
+
"../noodl-runtime/src/foreachitem.ts"() {
|
|
24965
|
+
"use strict";
|
|
24966
|
+
init_componentwalk();
|
|
24967
|
+
init_resolvedtarget();
|
|
24968
|
+
FOR_EACH_MODEL = "_forEachModel";
|
|
24969
|
+
resolvedTargets = new ResolvedTargetReporter();
|
|
24970
|
+
lastMissByNode = /* @__PURE__ */ new WeakMap();
|
|
24971
|
+
}
|
|
24972
|
+
});
|
|
24973
|
+
|
|
24974
|
+
// ../noodl-runtime/src/javascriptnodeparser.js
|
|
24975
|
+
var require_javascriptnodeparser = __commonJS({
|
|
24976
|
+
"../noodl-runtime/src/javascriptnodeparser.js"(exports2, module2) {
|
|
24977
|
+
"use strict";
|
|
24978
|
+
var Model28 = require_model2();
|
|
24979
|
+
var { getAbsoluteUrl: getAbsoluteUrl2 } = (init_utils(), __toCommonJS(utils_exports));
|
|
24980
|
+
var { findAncestorWithComponentObject: findAncestorWithComponentObject2 } = (init_componentwalk(), __toCommonJS(componentwalk_exports));
|
|
24981
|
+
var { resolveForEachItem: resolveForEachItem2 } = (init_foreachitem(), __toCommonJS(foreachitem_exports));
|
|
24982
|
+
var userFunctionsCache = {};
|
|
24983
|
+
function JavascriptNodeParser4(code, options) {
|
|
24984
|
+
this.inputs = {};
|
|
24985
|
+
this.outputs = {};
|
|
24986
|
+
this.error = void 0;
|
|
24987
|
+
this.code = code;
|
|
24988
|
+
const node = options ? options.node : void 0;
|
|
24989
|
+
this._initializeAPIs();
|
|
24990
|
+
var userCode = userFunctionsCache[code];
|
|
24991
|
+
if (!userCode) {
|
|
24992
|
+
try {
|
|
24993
|
+
userCode = new Function(["define", "script", "Node", "Component"], JavascriptNodeParser4.getCodePrefix() + code);
|
|
24994
|
+
userFunctionsCache[code] = userCode;
|
|
24995
|
+
} catch (e) {
|
|
24996
|
+
this.error = e.message;
|
|
24997
|
+
console.error(e);
|
|
24998
|
+
}
|
|
24999
|
+
}
|
|
25000
|
+
if (userCode) {
|
|
25001
|
+
try {
|
|
25002
|
+
userCode(
|
|
25003
|
+
this.define.bind(this),
|
|
25004
|
+
this.script.bind(this),
|
|
25005
|
+
this.apis.Node,
|
|
25006
|
+
node ? JavascriptNodeParser4.getComponentScopeForNode(node) : {}
|
|
25007
|
+
);
|
|
25008
|
+
this._afterSourced();
|
|
25009
|
+
} catch (e) {
|
|
25010
|
+
this.error = e.message;
|
|
25011
|
+
console.error(e);
|
|
25012
|
+
}
|
|
25013
|
+
}
|
|
25014
|
+
}
|
|
25015
|
+
JavascriptNodeParser4.prototype.define = function(userObject) {
|
|
25016
|
+
this.inputs = userObject.inputs || {};
|
|
25017
|
+
this.outputs = userObject.outputs || {};
|
|
25018
|
+
this.setup = userObject.setup;
|
|
25019
|
+
this.change = userObject.run || userObject.change;
|
|
25020
|
+
this.destroy = userObject.destroy;
|
|
25021
|
+
this.definedObject = userObject;
|
|
25022
|
+
};
|
|
25023
|
+
function _scriptExtend(_this) {
|
|
25024
|
+
var _extended = {
|
|
25025
|
+
inputs: _this.inputs || {},
|
|
25026
|
+
outputs: _this.outputs || {},
|
|
25027
|
+
setup: function(inputs, outputs2) {
|
|
25028
|
+
this.inputs = inputs;
|
|
25029
|
+
this.outputs = outputs2;
|
|
25030
|
+
this.setOutputs = function(states) {
|
|
25031
|
+
for (var key3 in states) {
|
|
25032
|
+
this.outputs[key3] = states[key3];
|
|
25033
|
+
this.flagOutputDirty(key3);
|
|
25034
|
+
}
|
|
25035
|
+
};
|
|
25036
|
+
if (_this.methods) {
|
|
25037
|
+
for (var key2 in _this.methods) {
|
|
25038
|
+
this[key2] = _this.methods[key2];
|
|
25039
|
+
}
|
|
25040
|
+
}
|
|
25041
|
+
_this.setup && _this.setup.apply(this);
|
|
25042
|
+
},
|
|
25043
|
+
destroy: function(inputs, outputs2) {
|
|
25044
|
+
this.inputs = inputs;
|
|
25045
|
+
this.outputs = outputs2;
|
|
25046
|
+
_this.destroy && _this.destroy.apply(this);
|
|
25047
|
+
},
|
|
25048
|
+
change: function(inputs, outputs2) {
|
|
25049
|
+
this.inputs = inputs;
|
|
25050
|
+
this.outputs = outputs2;
|
|
25051
|
+
var old = this._oldInputs || {};
|
|
25052
|
+
if (_this.changed) {
|
|
25053
|
+
for (var key2 in inputs) {
|
|
25054
|
+
if (inputs[key2] !== old[key2]) {
|
|
25055
|
+
var changedFunction = _this.changed[key2];
|
|
25056
|
+
if (typeof changedFunction === "function") changedFunction.apply(this, [inputs[key2], old[key2]]);
|
|
25057
|
+
}
|
|
25058
|
+
}
|
|
25059
|
+
}
|
|
25060
|
+
this._oldInputs = Object.assign({}, inputs);
|
|
25061
|
+
}
|
|
25062
|
+
};
|
|
25063
|
+
if (_this.signals) {
|
|
25064
|
+
for (var key in _this.signals) {
|
|
25065
|
+
_extended[key] = _this.signals[key];
|
|
25066
|
+
_extended.inputs[key] = "signal";
|
|
25067
|
+
}
|
|
25068
|
+
}
|
|
25069
|
+
return _extended;
|
|
25070
|
+
}
|
|
25071
|
+
JavascriptNodeParser4.prototype.script = function(userObject) {
|
|
25072
|
+
var _userObjectExtended = _scriptExtend(userObject);
|
|
25073
|
+
this.inputs = _userObjectExtended.inputs || {};
|
|
25074
|
+
this.outputs = _userObjectExtended.outputs || {};
|
|
25075
|
+
this.setup = _userObjectExtended.setup;
|
|
25076
|
+
this.change = _userObjectExtended.run || _userObjectExtended.change;
|
|
25077
|
+
this.destroy = _userObjectExtended.destroy;
|
|
25078
|
+
this.definedObject = _userObjectExtended;
|
|
25079
|
+
};
|
|
25080
|
+
JavascriptNodeParser4.prototype._initializeAPIs = function() {
|
|
25081
|
+
this.apis = {
|
|
25082
|
+
Node: {
|
|
25083
|
+
Inputs: {},
|
|
25084
|
+
Outputs: {},
|
|
25085
|
+
Signals: {},
|
|
25086
|
+
Setters: {}
|
|
25087
|
+
}
|
|
25088
|
+
};
|
|
25089
|
+
};
|
|
25090
|
+
JavascriptNodeParser4.prototype._afterSourced = function() {
|
|
25091
|
+
if (this.definedObject !== void 0) return;
|
|
25092
|
+
var _Node = this.apis.Node;
|
|
25093
|
+
this.inputs = Object.assign({}, _Node.Inputs || {});
|
|
25094
|
+
this.outputs = Object.assign({}, _Node.Outputs || {});
|
|
25095
|
+
this.setup = function(inputs, outputs2) {
|
|
25096
|
+
const _this = this;
|
|
25097
|
+
_Node.setOutputs = function(_outputs) {
|
|
25098
|
+
for (var key2 in _outputs) {
|
|
25099
|
+
outputs2[key2] = _outputs[key2];
|
|
25100
|
+
_this.flagOutputDirty(key2);
|
|
25101
|
+
}
|
|
25102
|
+
};
|
|
25103
|
+
_Node.OnInit && _Node.OnInit.apply(this);
|
|
25104
|
+
};
|
|
25105
|
+
this.destroy = _Node.OnDestroy || this.destory;
|
|
25106
|
+
this.change = (inputs, outputs2, changedInputs) => {
|
|
25107
|
+
for (var key2 in changedInputs) {
|
|
25108
|
+
if (typeof _Node.Setters[key2] === "function") {
|
|
25109
|
+
_Node.Setters[key2](inputs[key2]);
|
|
25110
|
+
}
|
|
25111
|
+
}
|
|
25112
|
+
if (typeof _Node.OnInputsChanged === "function") {
|
|
25113
|
+
_Node.OnInputsChanged();
|
|
25114
|
+
}
|
|
25115
|
+
};
|
|
25116
|
+
this.definedObject = {
|
|
25117
|
+
inputs: this.inputs,
|
|
25118
|
+
outputs: this.outputs,
|
|
25119
|
+
setup: this.setup,
|
|
25120
|
+
destroy: this.destroy,
|
|
25121
|
+
change: this.change
|
|
25122
|
+
};
|
|
25123
|
+
if (_Node.Signals !== void 0) {
|
|
25124
|
+
for (var key in _Node.Signals) {
|
|
25125
|
+
if (typeof _Node.Signals[key] === "function") {
|
|
25126
|
+
this.inputs[key] = "signal";
|
|
25127
|
+
this.definedObject[key] = _Node.Signals[key];
|
|
25128
|
+
}
|
|
25129
|
+
}
|
|
25130
|
+
}
|
|
25131
|
+
};
|
|
25132
|
+
JavascriptNodeParser4.createFromCode = function(code, options) {
|
|
25133
|
+
return new JavascriptNodeParser4(code, options);
|
|
25134
|
+
};
|
|
25135
|
+
function failedParser(message) {
|
|
25136
|
+
var parser = Object.create(JavascriptNodeParser4.prototype);
|
|
25137
|
+
parser.inputs = {};
|
|
25138
|
+
parser.outputs = {};
|
|
25139
|
+
parser.error = message;
|
|
25140
|
+
parser.code = void 0;
|
|
25141
|
+
parser.apis = { Node: {} };
|
|
25142
|
+
return parser;
|
|
25143
|
+
}
|
|
25144
|
+
JavascriptNodeParser4.createFromURL = function(url, callback, options) {
|
|
25145
|
+
url = getAbsoluteUrl2(url);
|
|
25146
|
+
var settled = false;
|
|
25147
|
+
function settle(parser) {
|
|
25148
|
+
if (settled) return;
|
|
25149
|
+
settled = true;
|
|
25150
|
+
callback(parser);
|
|
25151
|
+
}
|
|
25152
|
+
var xhr = new window.XMLHttpRequest();
|
|
25153
|
+
xhr.open("GET", url, true);
|
|
25154
|
+
xhr.onreadystatechange = function() {
|
|
25155
|
+
if (this.readyState === 4 || this.readyState === XMLHttpRequest.DONE) {
|
|
25156
|
+
if (this.status !== 0 && (this.status < 200 || this.status >= 300)) {
|
|
25157
|
+
settle(failedParser('Could not load "' + url + '": the server answered ' + this.status));
|
|
25158
|
+
return;
|
|
25159
|
+
}
|
|
25160
|
+
if (this.status === 0) {
|
|
25161
|
+
settle(failedParser('Could not load "' + url + '": the request failed'));
|
|
25162
|
+
return;
|
|
25163
|
+
}
|
|
25164
|
+
settle(new JavascriptNodeParser4(this.response, options));
|
|
25165
|
+
}
|
|
25166
|
+
};
|
|
25167
|
+
xhr.onerror = function() {
|
|
25168
|
+
settle(failedParser('Could not load "' + url + '": the request failed'));
|
|
25169
|
+
};
|
|
25170
|
+
xhr.send();
|
|
25171
|
+
};
|
|
25172
|
+
JavascriptNodeParser4.parseAndAddPortsFromScript = function(script2, ports, options) {
|
|
25173
|
+
function _exists(port5) {
|
|
25174
|
+
if (typeof port5 === "string") return ports.find((p) => p.name === port5) !== void 0;
|
|
25175
|
+
else return ports.find((p) => p.name === port5.name && p.plug === port5.plug) !== void 0;
|
|
25176
|
+
}
|
|
25177
|
+
function _addPortsFromMatch(match, options2) {
|
|
25178
|
+
if (match === void 0 || match === null) return;
|
|
25179
|
+
const unique2 = {};
|
|
25180
|
+
for (const _s of match) {
|
|
25181
|
+
let name2 = _s[1];
|
|
25182
|
+
if (name2 === void 0) continue;
|
|
25183
|
+
unique2[name2] = true;
|
|
25184
|
+
}
|
|
25185
|
+
Object.keys(unique2).forEach((p) => {
|
|
25186
|
+
if (_exists({
|
|
25187
|
+
name: options2.prefix + p,
|
|
25188
|
+
plug: options2.plug
|
|
25189
|
+
}))
|
|
25190
|
+
return;
|
|
25191
|
+
ports.push({
|
|
25192
|
+
name: options2.prefix + p,
|
|
25193
|
+
displayName: p,
|
|
25194
|
+
plug: options2.plug,
|
|
25195
|
+
type: options2.type,
|
|
25196
|
+
group: options2.group
|
|
25197
|
+
});
|
|
25198
|
+
});
|
|
25199
|
+
}
|
|
25200
|
+
if (!options.skipInputs) {
|
|
25201
|
+
_addPortsFromMatch(script2.matchAll(/Inputs\.([A-Za-z0-9_]+)/g), {
|
|
25202
|
+
type: options.inputType || "*",
|
|
25203
|
+
plug: "input",
|
|
25204
|
+
group: options.inputGroup || "Inputs",
|
|
25205
|
+
prefix: options.inputPrefix || ""
|
|
25206
|
+
});
|
|
25207
|
+
_addPortsFromMatch(script2.matchAll(/Inputs\s*\[\s*(?:'|")(.*)(?:'|")\s*\]/g), {
|
|
25208
|
+
type: options.inputType || "*",
|
|
25209
|
+
plug: "inputs",
|
|
25210
|
+
group: options.inputGroup || "Inputs",
|
|
25211
|
+
prefix: options.inputPrefix || ""
|
|
25212
|
+
});
|
|
25213
|
+
}
|
|
25214
|
+
if (!options.skipOutputs) {
|
|
25215
|
+
if (!options.skipOutputSignals) {
|
|
25216
|
+
_addPortsFromMatch(script2.matchAll(/Outputs\.([A-Za-z0-9]+)\s*\(\s*\)/g), {
|
|
25217
|
+
type: "signal",
|
|
25218
|
+
plug: "output",
|
|
25219
|
+
group: "Outputs",
|
|
25220
|
+
prefix: options.outputPrefix || ""
|
|
25221
|
+
});
|
|
25222
|
+
_addPortsFromMatch(script2.matchAll(/Outputs\s*\[\s*(?:'|")(.*)(?:'|")\s*\]\(\s*\)/g), {
|
|
25223
|
+
type: "signal",
|
|
25224
|
+
plug: "output",
|
|
25225
|
+
group: "Outputs",
|
|
25226
|
+
prefix: options.outputPrefix || ""
|
|
25227
|
+
});
|
|
25228
|
+
}
|
|
25229
|
+
if (!options.skipRegularOutputs) {
|
|
25230
|
+
_addPortsFromMatch(script2.matchAll(/Outputs\.([A-Za-z0-9_]+)/g), {
|
|
25231
|
+
type: "*",
|
|
25232
|
+
plug: "output",
|
|
25233
|
+
group: "Outputs",
|
|
25234
|
+
prefix: options.outputPrefix || ""
|
|
25235
|
+
});
|
|
25236
|
+
_addPortsFromMatch(script2.matchAll(/Outputs\s*\[\s*\"([^\"]*)\"\s*\]/g), {
|
|
25237
|
+
type: "*",
|
|
25238
|
+
plug: "output",
|
|
25239
|
+
group: "Outputs",
|
|
25240
|
+
prefix: options.outputPrefix || ""
|
|
25241
|
+
});
|
|
25242
|
+
}
|
|
25243
|
+
}
|
|
25244
|
+
};
|
|
25245
|
+
JavascriptNodeParser4.prototype.getPorts = function() {
|
|
25246
|
+
var ports = [];
|
|
25247
|
+
var self2 = this;
|
|
25248
|
+
Object.keys(this.inputs).forEach(function(name2) {
|
|
25249
|
+
var inputPort2 = self2.inputs[name2];
|
|
25250
|
+
var port5 = {
|
|
25251
|
+
name: name2,
|
|
25252
|
+
plug: "input"
|
|
25253
|
+
};
|
|
25254
|
+
if (typeof inputPort2 === "string") {
|
|
25255
|
+
port5.type = {
|
|
25256
|
+
name: inputPort2
|
|
25257
|
+
};
|
|
25258
|
+
port5.group = "Inputs";
|
|
25259
|
+
} else {
|
|
25260
|
+
for (var p in inputPort2) {
|
|
25261
|
+
port5[p] = inputPort2[p];
|
|
25262
|
+
}
|
|
25263
|
+
}
|
|
25264
|
+
ports.push(port5);
|
|
25265
|
+
});
|
|
25266
|
+
Object.keys(this.outputs).forEach(function(name2) {
|
|
25267
|
+
ports.push({
|
|
25268
|
+
name: name2,
|
|
25269
|
+
type: {
|
|
25270
|
+
name: self2.outputs[name2]
|
|
25271
|
+
},
|
|
25272
|
+
plug: "output",
|
|
25273
|
+
group: "Outputs"
|
|
25274
|
+
});
|
|
25275
|
+
});
|
|
25276
|
+
JavascriptNodeParser4.parseAndAddPortsFromScript(this.code, ports, {});
|
|
25277
|
+
return ports;
|
|
25278
|
+
};
|
|
25279
|
+
var _componentScopes = {};
|
|
25280
|
+
function _findParentComponentStateModelId(node) {
|
|
25281
|
+
const parent = findAncestorWithComponentObject2(node.nodeScope.componentOwner);
|
|
25282
|
+
if (!parent) return;
|
|
25283
|
+
return "componentState" + parent.getInstanceId();
|
|
25284
|
+
}
|
|
25285
|
+
JavascriptNodeParser4.getComponentScopeForNode = function(node) {
|
|
25286
|
+
const componentId = node.nodeScope.componentOwner.getInstanceId();
|
|
25287
|
+
if (_componentScopes[componentId] === void 0) {
|
|
25288
|
+
_componentScopes[componentId] = {};
|
|
25289
|
+
const componentObject = (node.nodeScope.modelScope || Model28).get("componentState" + componentId);
|
|
25290
|
+
_componentScopes[componentId].Object = componentObject;
|
|
25291
|
+
}
|
|
25292
|
+
const parentComponentObjectId = _findParentComponentStateModelId(node);
|
|
25293
|
+
const parentComponentObject = parentComponentObjectId !== void 0 ? (node.nodeScope.modelScope || Model28).get(parentComponentObjectId) : void 0;
|
|
25294
|
+
_componentScopes[componentId].ParentObject = parentComponentObject;
|
|
25295
|
+
Object.defineProperty(_componentScopes[componentId], "RepeaterObject", {
|
|
25296
|
+
configurable: true,
|
|
25297
|
+
enumerable: true,
|
|
25298
|
+
get: function() {
|
|
25299
|
+
return resolveForEachItem2(node);
|
|
25300
|
+
}
|
|
25301
|
+
});
|
|
25302
|
+
return _componentScopes[componentId];
|
|
25303
|
+
};
|
|
25304
|
+
JavascriptNodeParser4.getCodePrefix = function() {
|
|
25305
|
+
return "const Script = (typeof Node !== 'undefined')?Node:undefined;\n";
|
|
25306
|
+
};
|
|
25307
|
+
JavascriptNodeParser4.createNoodlAPI = function() {
|
|
25308
|
+
return typeof window !== "undefined" && window.Noodl !== void 0 ? window.Noodl : {};
|
|
25309
|
+
};
|
|
25310
|
+
module2.exports = JavascriptNodeParser4;
|
|
25311
|
+
}
|
|
25312
|
+
});
|
|
25313
|
+
|
|
25314
|
+
// ../noodl-runtime/src/printedcode.ts
|
|
25315
|
+
function table() {
|
|
25316
|
+
return globalThis[TABLE];
|
|
25317
|
+
}
|
|
25318
|
+
function hasPrintedCode() {
|
|
25319
|
+
return table() !== void 0;
|
|
25320
|
+
}
|
|
25321
|
+
function sameParams(a, b) {
|
|
25322
|
+
return a.length === b.length && a.every((p, i2) => p === b[i2]);
|
|
25323
|
+
}
|
|
25324
|
+
function findPrintedCode(params, body, async) {
|
|
25325
|
+
const list2 = table()?.get(body);
|
|
25326
|
+
return list2 && list2.find((e) => e.async === async && sameParams(e.params, params));
|
|
25327
|
+
}
|
|
25328
|
+
function findPrintedBody(body, async) {
|
|
25329
|
+
const list2 = table()?.get(body);
|
|
25330
|
+
return list2 && list2.find((e) => e.async === async);
|
|
25331
|
+
}
|
|
25332
|
+
function compileCode(params, body, options) {
|
|
25333
|
+
const async = !!(options && options.async);
|
|
25334
|
+
const printed = findPrintedCode(params, body, async);
|
|
25335
|
+
if (printed) return printed.fn;
|
|
25336
|
+
if (table()?.refuseOthers) throw new Error(NOT_PRINTED_MESSAGE);
|
|
25337
|
+
const Ctor = async ? AsyncFunction : Function;
|
|
25338
|
+
return new Ctor(...params, body);
|
|
25339
|
+
}
|
|
25340
|
+
function functionNodeBody(script2) {
|
|
25341
|
+
const JavascriptNodeParser4 = require_javascriptnodeparser();
|
|
25342
|
+
return JavascriptNodeParser4.getCodePrefix() + script2;
|
|
25343
|
+
}
|
|
25344
|
+
function expressionNodeBody(expression) {
|
|
25345
|
+
return EXPRESSION_PREAMBLE + "return (" + expression + ");";
|
|
25346
|
+
}
|
|
25347
|
+
var NOT_PRINTED_MESSAGE, TABLE, AsyncFunction, FUNCTION_NODE_PARAMS, EXPRESSION_PREAMBLE, REST_REQUEST_PARAMS, REST_RESPONSE_PARAMS, MAP_COLLECTION_PARAMS;
|
|
25348
|
+
var init_printedcode = __esm({
|
|
25349
|
+
"../noodl-runtime/src/printedcode.ts"() {
|
|
25350
|
+
NOT_PRINTED_MESSAGE = "This code was not printed when the app was deployed, and code cannot be compiled here. Deploy the app again.";
|
|
25351
|
+
TABLE = Symbol.for("nodegx.printedCode");
|
|
25352
|
+
AsyncFunction = Object.getPrototypeOf(async function() {
|
|
25353
|
+
}).constructor;
|
|
25354
|
+
FUNCTION_NODE_PARAMS = ["Inputs", "Outputs", "Noodl", "Component", "Scripts"];
|
|
25355
|
+
EXPRESSION_PREAMBLE = [
|
|
25356
|
+
'var min = Math.min, max = Math.max, cos = Math.cos, sin = Math.sin, tan = Math.tan, sqrt = Math.sqrt, pi = Math.PI, round = Math.round, floor = Math.floor, ceil = Math.ceil, abs = Math.abs, random = Math.random, pow = Math.pow, log = Math.log, exp = Math.exp;try { var NoodlContext = (typeof Noodl !== "undefined") ? Noodl : (typeof global !== "undefined" && global.Noodl) || {}; var Variables = NoodlContext.Variables || {}; var Objects = NoodlContext.Objects || {}; var Arrays = NoodlContext.Arrays || {};} catch (e) { var Variables = {}, Objects = {}, Arrays = {};}'
|
|
25357
|
+
].join("");
|
|
25358
|
+
REST_REQUEST_PARAMS = ["Inputs", "Outputs", "Request"];
|
|
25359
|
+
REST_RESPONSE_PARAMS = ["Inputs", "Outputs", "Response"];
|
|
25360
|
+
MAP_COLLECTION_PARAMS = ["map", "object"];
|
|
25361
|
+
}
|
|
25362
|
+
});
|
|
25363
|
+
|
|
24604
25364
|
// ../noodl-runtime/src/nodes/std-library/data/restnode.ts
|
|
24605
25365
|
var require_restnode = __commonJS({
|
|
24606
25366
|
"../noodl-runtime/src/nodes/std-library/data/restnode.ts"(exports2, module2) {
|
|
25367
|
+
init_printedcode();
|
|
24607
25368
|
var defaultRequestScript = "//Add custom code to setup the request object before the request\n//is made.\n//\n//*Request.resource contains the resource path of the request.\n//*Request.method contains the method, GET, POST, PUT or DELETE.\n//*Request.headers is a map where you can add additional headers.\n//*Request.parameters is a map the parameters that will be appended\n// to the url.\n//*Request.content contains the content of the request as a javascript\n// object.\n//\n";
|
|
24608
25369
|
var defaultResponseScript = "// Add custom code to convert the response content to outputs\n//\n//*Response.status The status code of the response\n//*Response.content The content of the response as a javascript\n// object.\n//*Response.request The request object that resulted in the response.\n//\n//*Inputs and *Outputs contain the inputs and outputs of the node.\n";
|
|
24609
25370
|
var RestNode = {
|
|
@@ -24692,7 +25453,7 @@ var require_restnode = __commonJS({
|
|
|
24692
25453
|
group: "Scripts",
|
|
24693
25454
|
set: function(script2) {
|
|
24694
25455
|
try {
|
|
24695
|
-
this._internal.requestFunc =
|
|
25456
|
+
this._internal.requestFunc = compileCode(REST_REQUEST_PARAMS, script2);
|
|
24696
25457
|
} catch (e) {
|
|
24697
25458
|
console.log(e);
|
|
24698
25459
|
}
|
|
@@ -24709,7 +25470,7 @@ var require_restnode = __commonJS({
|
|
|
24709
25470
|
group: "Scripts",
|
|
24710
25471
|
set: function(script2) {
|
|
24711
25472
|
try {
|
|
24712
|
-
this._internal.responseFunc =
|
|
25473
|
+
this._internal.responseFunc = compileCode(REST_RESPONSE_PARAMS, script2);
|
|
24713
25474
|
} catch (e) {
|
|
24714
25475
|
console.log(e);
|
|
24715
25476
|
}
|
|
@@ -25699,656 +26460,13 @@ var require_lodash = __commonJS({
|
|
|
25699
26460
|
}
|
|
25700
26461
|
});
|
|
25701
26462
|
|
|
25702
|
-
// ../noodl-runtime/src/utils.ts
|
|
25703
|
-
var utils_exports = {};
|
|
25704
|
-
__export(utils_exports, {
|
|
25705
|
-
getAbsoluteUrl: () => getAbsoluteUrl,
|
|
25706
|
-
logJavaScriptNodeError: () => logJavaScriptNodeError,
|
|
25707
|
-
thrownMessage: () => thrownMessage
|
|
25708
|
-
});
|
|
25709
|
-
function getAbsoluteUrl(_url) {
|
|
25710
|
-
const url = String(_url);
|
|
25711
|
-
if (!url || url[0] === "/" || url.includes("://") || url.startsWith("data:")) {
|
|
25712
|
-
return url;
|
|
25713
|
-
}
|
|
25714
|
-
return (Noodl.baseUrl || "/") + url;
|
|
25715
|
-
}
|
|
25716
|
-
function thrownMessage(error) {
|
|
25717
|
-
if (error && error.message) return String(error.message);
|
|
25718
|
-
try {
|
|
25719
|
-
return String(error);
|
|
25720
|
-
} catch {
|
|
25721
|
-
return typeof error;
|
|
25722
|
-
}
|
|
25723
|
-
}
|
|
25724
|
-
function logJavaScriptNodeError(error) {
|
|
25725
|
-
const prefix = "Error in JS node run code.";
|
|
25726
|
-
if (error === null || typeof error !== "object" && typeof error !== "function") {
|
|
25727
|
-
console.log(prefix, thrownMessage(error));
|
|
25728
|
-
return;
|
|
25729
|
-
}
|
|
25730
|
-
const proto = Object.getPrototypeOf(error);
|
|
25731
|
-
const kind = proto && proto.constructor && proto.constructor.name ? proto.constructor.name : "Error";
|
|
25732
|
-
console.log(prefix, kind + ": " + thrownMessage(error), error.stack);
|
|
25733
|
-
}
|
|
25734
|
-
var init_utils = __esm({
|
|
25735
|
-
"../noodl-runtime/src/utils.ts"() {
|
|
25736
|
-
}
|
|
25737
|
-
});
|
|
25738
|
-
|
|
25739
|
-
// ../noodl-runtime/src/componentwalk.ts
|
|
25740
|
-
var componentwalk_exports = {};
|
|
25741
|
-
__export(componentwalk_exports, {
|
|
25742
|
-
COMPONENT_OBJECT_TYPES: () => COMPONENT_OBJECT_TYPES,
|
|
25743
|
-
componentAncestorNames: () => componentAncestorNames,
|
|
25744
|
-
componentAncestors: () => componentAncestors,
|
|
25745
|
-
findAncestorWithComponentObject: () => findAncestorWithComponentObject,
|
|
25746
|
-
findAncestorWithName: () => findAncestorWithName,
|
|
25747
|
-
findAncestorWithNodeType: () => findAncestorWithNodeType,
|
|
25748
|
-
findAncestorWithProperty: () => findAncestorWithProperty,
|
|
25749
|
-
findComponentAncestor: () => findComponentAncestor,
|
|
25750
|
-
parentComponentOf: () => parentComponentOf,
|
|
25751
|
-
scopeChain: () => scopeChain,
|
|
25752
|
-
scopeChainNames: () => scopeChainNames
|
|
25753
|
-
});
|
|
25754
|
-
function parentComponentOf(component) {
|
|
25755
|
-
if (!component) return void 0;
|
|
25756
|
-
let parent;
|
|
25757
|
-
if (component.getRoots().length > 0) {
|
|
25758
|
-
const root2 = component.getRoots()[0];
|
|
25759
|
-
if (root2.getVisualParentNode) {
|
|
25760
|
-
const visualParent = root2.getVisualParentNode();
|
|
25761
|
-
if (visualParent) {
|
|
25762
|
-
parent = visualParent.nodeScope.componentOwner;
|
|
25763
|
-
}
|
|
25764
|
-
} else if (root2.parentNodeScope) {
|
|
25765
|
-
parent = component.parentNodeScope.componentOwner;
|
|
25766
|
-
}
|
|
25767
|
-
} else if (component.parentNodeScope) {
|
|
25768
|
-
parent = component.parentNodeScope.componentOwner;
|
|
25769
|
-
}
|
|
25770
|
-
if (parent && parent.nodeScope && parent.nodeScope.componentOwner !== component) {
|
|
25771
|
-
return parent;
|
|
25772
|
-
}
|
|
25773
|
-
return void 0;
|
|
25774
|
-
}
|
|
25775
|
-
function componentAncestors(component) {
|
|
25776
|
-
const ancestors = [];
|
|
25777
|
-
let current = component;
|
|
25778
|
-
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
25779
|
-
const parent = parentComponentOf(current);
|
|
25780
|
-
if (!parent) break;
|
|
25781
|
-
ancestors.push(parent);
|
|
25782
|
-
current = parent;
|
|
25783
|
-
}
|
|
25784
|
-
return ancestors;
|
|
25785
|
-
}
|
|
25786
|
-
function findComponentAncestor(component, predicate) {
|
|
25787
|
-
let current = component;
|
|
25788
|
-
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
25789
|
-
const parent = parentComponentOf(current);
|
|
25790
|
-
if (!parent) return void 0;
|
|
25791
|
-
if (predicate(parent)) return parent;
|
|
25792
|
-
current = parent;
|
|
25793
|
-
}
|
|
25794
|
-
return void 0;
|
|
25795
|
-
}
|
|
25796
|
-
function findAncestorWithNodeType(component, types) {
|
|
25797
|
-
return findComponentAncestor(
|
|
25798
|
-
component,
|
|
25799
|
-
(candidate) => types.some((type) => candidate.nodeScope.getNodesWithType(type).length > 0)
|
|
25800
|
-
);
|
|
25801
|
-
}
|
|
25802
|
-
function findAncestorWithComponentObject(component) {
|
|
25803
|
-
return findAncestorWithNodeType(component, COMPONENT_OBJECT_TYPES);
|
|
25804
|
-
}
|
|
25805
|
-
function findAncestorWithName(component, name2) {
|
|
25806
|
-
return findComponentAncestor(component, (candidate) => candidate.name === name2);
|
|
25807
|
-
}
|
|
25808
|
-
function scopeChain(component) {
|
|
25809
|
-
const chain2 = [];
|
|
25810
|
-
let current = component;
|
|
25811
|
-
for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
|
|
25812
|
-
if (!current) break;
|
|
25813
|
-
chain2.push(current);
|
|
25814
|
-
if (!current.parentNodeScope) break;
|
|
25815
|
-
current = current.parentNodeScope.componentOwner;
|
|
25816
|
-
}
|
|
25817
|
-
return chain2;
|
|
25818
|
-
}
|
|
25819
|
-
function scopeChainNames(component) {
|
|
25820
|
-
return scopeChain(component).map((entry) => entry.name);
|
|
25821
|
-
}
|
|
25822
|
-
function findAncestorWithProperty(component, property2) {
|
|
25823
|
-
const chain2 = scopeChain(component);
|
|
25824
|
-
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
25825
|
-
if (chain2[i2][property2] !== void 0) return chain2[i2];
|
|
25826
|
-
}
|
|
25827
|
-
return void 0;
|
|
25828
|
-
}
|
|
25829
|
-
function componentAncestorNames(component) {
|
|
25830
|
-
return componentAncestors(component).map((ancestor) => ancestor.name);
|
|
25831
|
-
}
|
|
25832
|
-
var MAX_WALK_DEPTH, COMPONENT_OBJECT_TYPES;
|
|
25833
|
-
var init_componentwalk = __esm({
|
|
25834
|
-
"../noodl-runtime/src/componentwalk.ts"() {
|
|
25835
|
-
"use strict";
|
|
25836
|
-
MAX_WALK_DEPTH = 1e3;
|
|
25837
|
-
COMPONENT_OBJECT_TYPES = ["net.noodl.ComponentObject", "Component State"];
|
|
25838
|
-
}
|
|
25839
|
-
});
|
|
25840
|
-
|
|
25841
|
-
// ../noodl-runtime/src/resolvedtarget.ts
|
|
25842
|
-
function summariseTargets(labels) {
|
|
25843
|
-
const distinct = [];
|
|
25844
|
-
for (let i2 = 0; i2 < labels.length; i2++) {
|
|
25845
|
-
const label = labels[i2];
|
|
25846
|
-
if (label === void 0) continue;
|
|
25847
|
-
if (distinct.indexOf(label) === -1) distinct.push(label);
|
|
25848
|
-
}
|
|
25849
|
-
if (distinct.length === 0) return void 0;
|
|
25850
|
-
if (distinct.length === 1) return "\u2192 " + distinct[0];
|
|
25851
|
-
const listed = distinct.slice(0, MAX_NAMES_LISTED).join(", ");
|
|
25852
|
-
const rest2 = distinct.length - MAX_NAMES_LISTED;
|
|
25853
|
-
return "\u2192 " + distinct.length + " targets: " + listed + (rest2 > 0 ? ", +" + rest2 : "");
|
|
25854
|
-
}
|
|
25855
|
-
var MAX_NAMES_LISTED, ResolvedTargetReporter;
|
|
25856
|
-
var init_resolvedtarget = __esm({
|
|
25857
|
-
"../noodl-runtime/src/resolvedtarget.ts"() {
|
|
25858
|
-
"use strict";
|
|
25859
|
-
MAX_NAMES_LISTED = 3;
|
|
25860
|
-
ResolvedTargetReporter = class {
|
|
25861
|
-
constructor() {
|
|
25862
|
-
/** Weak, so a torn-down runtime's bookkeeping goes with it and needs no reset call. */
|
|
25863
|
-
this._byContext = /* @__PURE__ */ new WeakMap();
|
|
25864
|
-
}
|
|
25865
|
-
/**
|
|
25866
|
-
* Record what `node` bound to and push the summary to the editor.
|
|
25867
|
-
*
|
|
25868
|
-
* Safe to call every resolution; identical summaries are dropped rather than sent, so a
|
|
25869
|
-
* node that re-resolves each frame costs one string comparison.
|
|
25870
|
-
*/
|
|
25871
|
-
report(node, target) {
|
|
25872
|
-
const state2 = this._stateFor(node);
|
|
25873
|
-
if (!state2) return;
|
|
25874
|
-
let instances = state2.byGraphNode.get(node.id);
|
|
25875
|
-
if (!instances) {
|
|
25876
|
-
instances = /* @__PURE__ */ new Map();
|
|
25877
|
-
state2.byGraphNode.set(node.id, instances);
|
|
25878
|
-
}
|
|
25879
|
-
instances.set(node, target);
|
|
25880
|
-
this._flush(node, state2, instances);
|
|
25881
|
-
}
|
|
25882
|
-
/** Drop an instance. Call from `_onNodeDeleted`, or this map is a leak. */
|
|
25883
|
-
forget(node) {
|
|
25884
|
-
const state2 = this._stateFor(node);
|
|
25885
|
-
if (!state2) return;
|
|
25886
|
-
const instances = state2.byGraphNode.get(node.id);
|
|
25887
|
-
if (!instances) return;
|
|
25888
|
-
instances.delete(node);
|
|
25889
|
-
if (instances.size === 0) {
|
|
25890
|
-
state2.byGraphNode.delete(node.id);
|
|
25891
|
-
state2.lastSent.delete(node.id);
|
|
25892
|
-
return;
|
|
25893
|
-
}
|
|
25894
|
-
this._flush(node, state2, instances);
|
|
25895
|
-
}
|
|
25896
|
-
_stateFor(node) {
|
|
25897
|
-
const context = node.context;
|
|
25898
|
-
if (!context) return void 0;
|
|
25899
|
-
let state2 = this._byContext.get(context);
|
|
25900
|
-
if (!state2) {
|
|
25901
|
-
state2 = { byGraphNode: /* @__PURE__ */ new Map(), lastSent: /* @__PURE__ */ new Map() };
|
|
25902
|
-
this._byContext.set(context, state2);
|
|
25903
|
-
}
|
|
25904
|
-
return state2;
|
|
25905
|
-
}
|
|
25906
|
-
_flush(node, state2, instances) {
|
|
25907
|
-
const labels = [];
|
|
25908
|
-
instances.forEach((label) => labels.push(label));
|
|
25909
|
-
const summary = summariseTargets(labels);
|
|
25910
|
-
if (state2.lastSent.has(node.id) && state2.lastSent.get(node.id) === summary) return;
|
|
25911
|
-
state2.lastSent.set(node.id, summary);
|
|
25912
|
-
const editorConnection = node.context && node.context.editorConnection;
|
|
25913
|
-
if (!editorConnection || !editorConnection.isRunningLocally()) return;
|
|
25914
|
-
if (typeof editorConnection.sendNodeSubLabel !== "function") return;
|
|
25915
|
-
editorConnection.sendNodeSubLabel(node.id, summary);
|
|
25916
|
-
}
|
|
25917
|
-
};
|
|
25918
|
-
}
|
|
25919
|
-
});
|
|
25920
|
-
|
|
25921
|
-
// ../noodl-runtime/src/foreachitem.ts
|
|
25922
|
-
var foreachitem_exports = {};
|
|
25923
|
-
__export(foreachitem_exports, {
|
|
25924
|
-
forgetForEachItem: () => forgetForEachItem,
|
|
25925
|
-
resolveForEachItem: () => resolveForEachItem
|
|
25926
|
-
});
|
|
25927
|
-
function resolveForEachItem(node, options = {}) {
|
|
25928
|
-
const chain2 = scopeChain(node.nodeScope.componentOwner);
|
|
25929
|
-
const wanted = options.target;
|
|
25930
|
-
if (wanted) {
|
|
25931
|
-
const named2 = firstNamed(chain2, wanted);
|
|
25932
|
-
if (!named2) {
|
|
25933
|
-
return miss(
|
|
25934
|
-
node,
|
|
25935
|
-
"repeater-item/target-not-found",
|
|
25936
|
-
'No component named "' + wanted + '" contains this node',
|
|
25937
|
-
wanted,
|
|
25938
|
-
{ target: wanted, scope: scopeChainNames(node.nodeScope.componentOwner) }
|
|
25939
|
-
);
|
|
25940
|
-
}
|
|
25941
|
-
if (named2[FOR_EACH_MODEL] === void 0) {
|
|
25942
|
-
return miss(
|
|
25943
|
-
node,
|
|
25944
|
-
"repeater-item/target-has-no-item",
|
|
25945
|
-
'The component "' + wanted + '" has no current item \u2014 it is not used as a Repeater or Run Tasks template',
|
|
25946
|
-
wanted,
|
|
25947
|
-
{ target: wanted }
|
|
25948
|
-
);
|
|
25949
|
-
}
|
|
25950
|
-
return hit(node, named2);
|
|
25951
|
-
}
|
|
25952
|
-
const owner = firstWithItem(chain2);
|
|
25953
|
-
if (!owner) {
|
|
25954
|
-
return miss(
|
|
25955
|
-
node,
|
|
25956
|
-
"repeater-item/no-item-in-scope",
|
|
25957
|
-
'Id Source is set to "From repeater", but this node is not inside a Repeater or Run Tasks template',
|
|
25958
|
-
void 0,
|
|
25959
|
-
{ scope: scopeChainNames(node.nodeScope.componentOwner) }
|
|
25960
|
-
);
|
|
25961
|
-
}
|
|
25962
|
-
return hit(node, owner);
|
|
25963
|
-
}
|
|
25964
|
-
function forgetForEachItem(node) {
|
|
25965
|
-
resolvedTargets.forget(node);
|
|
25966
|
-
lastMissByNode.delete(node);
|
|
25967
|
-
}
|
|
25968
|
-
function firstNamed(chain2, name2) {
|
|
25969
|
-
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
25970
|
-
if (chain2[i2].name === name2) return chain2[i2];
|
|
25971
|
-
}
|
|
25972
|
-
return void 0;
|
|
25973
|
-
}
|
|
25974
|
-
function firstWithItem(chain2) {
|
|
25975
|
-
for (let i2 = 0; i2 < chain2.length; i2++) {
|
|
25976
|
-
if (chain2[i2][FOR_EACH_MODEL] !== void 0) return chain2[i2];
|
|
25977
|
-
}
|
|
25978
|
-
return void 0;
|
|
25979
|
-
}
|
|
25980
|
-
function hit(node, owner) {
|
|
25981
|
-
lastMissByNode.delete(node);
|
|
25982
|
-
resolvedTargets.report(node, owner.name);
|
|
25983
|
-
return owner[FOR_EACH_MODEL];
|
|
25984
|
-
}
|
|
25985
|
-
function miss(node, code, message, target, detail) {
|
|
25986
|
-
resolvedTargets.report(node, void 0);
|
|
25987
|
-
const seen = code + "|" + (target || "");
|
|
25988
|
-
if (lastMissByNode.get(node) !== seen) {
|
|
25989
|
-
lastMissByNode.set(node, seen);
|
|
25990
|
-
node.raiseRuntimeError(code, message, detail);
|
|
25991
|
-
}
|
|
25992
|
-
return void 0;
|
|
25993
|
-
}
|
|
25994
|
-
var FOR_EACH_MODEL, resolvedTargets, lastMissByNode;
|
|
25995
|
-
var init_foreachitem = __esm({
|
|
25996
|
-
"../noodl-runtime/src/foreachitem.ts"() {
|
|
25997
|
-
"use strict";
|
|
25998
|
-
init_componentwalk();
|
|
25999
|
-
init_resolvedtarget();
|
|
26000
|
-
FOR_EACH_MODEL = "_forEachModel";
|
|
26001
|
-
resolvedTargets = new ResolvedTargetReporter();
|
|
26002
|
-
lastMissByNode = /* @__PURE__ */ new WeakMap();
|
|
26003
|
-
}
|
|
26004
|
-
});
|
|
26005
|
-
|
|
26006
|
-
// ../noodl-runtime/src/javascriptnodeparser.js
|
|
26007
|
-
var require_javascriptnodeparser = __commonJS({
|
|
26008
|
-
"../noodl-runtime/src/javascriptnodeparser.js"(exports2, module2) {
|
|
26009
|
-
"use strict";
|
|
26010
|
-
var Model28 = require_model2();
|
|
26011
|
-
var { getAbsoluteUrl: getAbsoluteUrl2 } = (init_utils(), __toCommonJS(utils_exports));
|
|
26012
|
-
var { findAncestorWithComponentObject: findAncestorWithComponentObject2 } = (init_componentwalk(), __toCommonJS(componentwalk_exports));
|
|
26013
|
-
var { resolveForEachItem: resolveForEachItem2 } = (init_foreachitem(), __toCommonJS(foreachitem_exports));
|
|
26014
|
-
var userFunctionsCache = {};
|
|
26015
|
-
function JavascriptNodeParser4(code, options) {
|
|
26016
|
-
this.inputs = {};
|
|
26017
|
-
this.outputs = {};
|
|
26018
|
-
this.error = void 0;
|
|
26019
|
-
this.code = code;
|
|
26020
|
-
const node = options ? options.node : void 0;
|
|
26021
|
-
this._initializeAPIs();
|
|
26022
|
-
var userCode = userFunctionsCache[code];
|
|
26023
|
-
if (!userCode) {
|
|
26024
|
-
try {
|
|
26025
|
-
userCode = new Function(["define", "script", "Node", "Component"], JavascriptNodeParser4.getCodePrefix() + code);
|
|
26026
|
-
userFunctionsCache[code] = userCode;
|
|
26027
|
-
} catch (e) {
|
|
26028
|
-
this.error = e.message;
|
|
26029
|
-
console.error(e);
|
|
26030
|
-
}
|
|
26031
|
-
}
|
|
26032
|
-
if (userCode) {
|
|
26033
|
-
try {
|
|
26034
|
-
userCode(
|
|
26035
|
-
this.define.bind(this),
|
|
26036
|
-
this.script.bind(this),
|
|
26037
|
-
this.apis.Node,
|
|
26038
|
-
node ? JavascriptNodeParser4.getComponentScopeForNode(node) : {}
|
|
26039
|
-
);
|
|
26040
|
-
this._afterSourced();
|
|
26041
|
-
} catch (e) {
|
|
26042
|
-
this.error = e.message;
|
|
26043
|
-
console.error(e);
|
|
26044
|
-
}
|
|
26045
|
-
}
|
|
26046
|
-
}
|
|
26047
|
-
JavascriptNodeParser4.prototype.define = function(userObject) {
|
|
26048
|
-
this.inputs = userObject.inputs || {};
|
|
26049
|
-
this.outputs = userObject.outputs || {};
|
|
26050
|
-
this.setup = userObject.setup;
|
|
26051
|
-
this.change = userObject.run || userObject.change;
|
|
26052
|
-
this.destroy = userObject.destroy;
|
|
26053
|
-
this.definedObject = userObject;
|
|
26054
|
-
};
|
|
26055
|
-
function _scriptExtend(_this) {
|
|
26056
|
-
var _extended = {
|
|
26057
|
-
inputs: _this.inputs || {},
|
|
26058
|
-
outputs: _this.outputs || {},
|
|
26059
|
-
setup: function(inputs, outputs2) {
|
|
26060
|
-
this.inputs = inputs;
|
|
26061
|
-
this.outputs = outputs2;
|
|
26062
|
-
this.setOutputs = function(states) {
|
|
26063
|
-
for (var key3 in states) {
|
|
26064
|
-
this.outputs[key3] = states[key3];
|
|
26065
|
-
this.flagOutputDirty(key3);
|
|
26066
|
-
}
|
|
26067
|
-
};
|
|
26068
|
-
if (_this.methods) {
|
|
26069
|
-
for (var key2 in _this.methods) {
|
|
26070
|
-
this[key2] = _this.methods[key2];
|
|
26071
|
-
}
|
|
26072
|
-
}
|
|
26073
|
-
_this.setup && _this.setup.apply(this);
|
|
26074
|
-
},
|
|
26075
|
-
destroy: function(inputs, outputs2) {
|
|
26076
|
-
this.inputs = inputs;
|
|
26077
|
-
this.outputs = outputs2;
|
|
26078
|
-
_this.destroy && _this.destroy.apply(this);
|
|
26079
|
-
},
|
|
26080
|
-
change: function(inputs, outputs2) {
|
|
26081
|
-
this.inputs = inputs;
|
|
26082
|
-
this.outputs = outputs2;
|
|
26083
|
-
var old = this._oldInputs || {};
|
|
26084
|
-
if (_this.changed) {
|
|
26085
|
-
for (var key2 in inputs) {
|
|
26086
|
-
if (inputs[key2] !== old[key2]) {
|
|
26087
|
-
var changedFunction = _this.changed[key2];
|
|
26088
|
-
if (typeof changedFunction === "function") changedFunction.apply(this, [inputs[key2], old[key2]]);
|
|
26089
|
-
}
|
|
26090
|
-
}
|
|
26091
|
-
}
|
|
26092
|
-
this._oldInputs = Object.assign({}, inputs);
|
|
26093
|
-
}
|
|
26094
|
-
};
|
|
26095
|
-
if (_this.signals) {
|
|
26096
|
-
for (var key in _this.signals) {
|
|
26097
|
-
_extended[key] = _this.signals[key];
|
|
26098
|
-
_extended.inputs[key] = "signal";
|
|
26099
|
-
}
|
|
26100
|
-
}
|
|
26101
|
-
return _extended;
|
|
26102
|
-
}
|
|
26103
|
-
JavascriptNodeParser4.prototype.script = function(userObject) {
|
|
26104
|
-
var _userObjectExtended = _scriptExtend(userObject);
|
|
26105
|
-
this.inputs = _userObjectExtended.inputs || {};
|
|
26106
|
-
this.outputs = _userObjectExtended.outputs || {};
|
|
26107
|
-
this.setup = _userObjectExtended.setup;
|
|
26108
|
-
this.change = _userObjectExtended.run || _userObjectExtended.change;
|
|
26109
|
-
this.destroy = _userObjectExtended.destroy;
|
|
26110
|
-
this.definedObject = _userObjectExtended;
|
|
26111
|
-
};
|
|
26112
|
-
JavascriptNodeParser4.prototype._initializeAPIs = function() {
|
|
26113
|
-
this.apis = {
|
|
26114
|
-
Node: {
|
|
26115
|
-
Inputs: {},
|
|
26116
|
-
Outputs: {},
|
|
26117
|
-
Signals: {},
|
|
26118
|
-
Setters: {}
|
|
26119
|
-
}
|
|
26120
|
-
};
|
|
26121
|
-
};
|
|
26122
|
-
JavascriptNodeParser4.prototype._afterSourced = function() {
|
|
26123
|
-
if (this.definedObject !== void 0) return;
|
|
26124
|
-
var _Node = this.apis.Node;
|
|
26125
|
-
this.inputs = Object.assign({}, _Node.Inputs || {});
|
|
26126
|
-
this.outputs = Object.assign({}, _Node.Outputs || {});
|
|
26127
|
-
this.setup = function(inputs, outputs2) {
|
|
26128
|
-
const _this = this;
|
|
26129
|
-
_Node.setOutputs = function(_outputs) {
|
|
26130
|
-
for (var key2 in _outputs) {
|
|
26131
|
-
outputs2[key2] = _outputs[key2];
|
|
26132
|
-
_this.flagOutputDirty(key2);
|
|
26133
|
-
}
|
|
26134
|
-
};
|
|
26135
|
-
_Node.OnInit && _Node.OnInit.apply(this);
|
|
26136
|
-
};
|
|
26137
|
-
this.destroy = _Node.OnDestroy || this.destory;
|
|
26138
|
-
this.change = (inputs, outputs2, changedInputs) => {
|
|
26139
|
-
for (var key2 in changedInputs) {
|
|
26140
|
-
if (typeof _Node.Setters[key2] === "function") {
|
|
26141
|
-
_Node.Setters[key2](inputs[key2]);
|
|
26142
|
-
}
|
|
26143
|
-
}
|
|
26144
|
-
if (typeof _Node.OnInputsChanged === "function") {
|
|
26145
|
-
_Node.OnInputsChanged();
|
|
26146
|
-
}
|
|
26147
|
-
};
|
|
26148
|
-
this.definedObject = {
|
|
26149
|
-
inputs: this.inputs,
|
|
26150
|
-
outputs: this.outputs,
|
|
26151
|
-
setup: this.setup,
|
|
26152
|
-
destroy: this.destroy,
|
|
26153
|
-
change: this.change
|
|
26154
|
-
};
|
|
26155
|
-
if (_Node.Signals !== void 0) {
|
|
26156
|
-
for (var key in _Node.Signals) {
|
|
26157
|
-
if (typeof _Node.Signals[key] === "function") {
|
|
26158
|
-
this.inputs[key] = "signal";
|
|
26159
|
-
this.definedObject[key] = _Node.Signals[key];
|
|
26160
|
-
}
|
|
26161
|
-
}
|
|
26162
|
-
}
|
|
26163
|
-
};
|
|
26164
|
-
JavascriptNodeParser4.createFromCode = function(code, options) {
|
|
26165
|
-
return new JavascriptNodeParser4(code, options);
|
|
26166
|
-
};
|
|
26167
|
-
function failedParser(message) {
|
|
26168
|
-
var parser = Object.create(JavascriptNodeParser4.prototype);
|
|
26169
|
-
parser.inputs = {};
|
|
26170
|
-
parser.outputs = {};
|
|
26171
|
-
parser.error = message;
|
|
26172
|
-
parser.code = void 0;
|
|
26173
|
-
parser.apis = { Node: {} };
|
|
26174
|
-
return parser;
|
|
26175
|
-
}
|
|
26176
|
-
JavascriptNodeParser4.createFromURL = function(url, callback, options) {
|
|
26177
|
-
url = getAbsoluteUrl2(url);
|
|
26178
|
-
var settled = false;
|
|
26179
|
-
function settle(parser) {
|
|
26180
|
-
if (settled) return;
|
|
26181
|
-
settled = true;
|
|
26182
|
-
callback(parser);
|
|
26183
|
-
}
|
|
26184
|
-
var xhr = new window.XMLHttpRequest();
|
|
26185
|
-
xhr.open("GET", url, true);
|
|
26186
|
-
xhr.onreadystatechange = function() {
|
|
26187
|
-
if (this.readyState === 4 || this.readyState === XMLHttpRequest.DONE) {
|
|
26188
|
-
if (this.status !== 0 && (this.status < 200 || this.status >= 300)) {
|
|
26189
|
-
settle(failedParser('Could not load "' + url + '": the server answered ' + this.status));
|
|
26190
|
-
return;
|
|
26191
|
-
}
|
|
26192
|
-
if (this.status === 0) {
|
|
26193
|
-
settle(failedParser('Could not load "' + url + '": the request failed'));
|
|
26194
|
-
return;
|
|
26195
|
-
}
|
|
26196
|
-
settle(new JavascriptNodeParser4(this.response, options));
|
|
26197
|
-
}
|
|
26198
|
-
};
|
|
26199
|
-
xhr.onerror = function() {
|
|
26200
|
-
settle(failedParser('Could not load "' + url + '": the request failed'));
|
|
26201
|
-
};
|
|
26202
|
-
xhr.send();
|
|
26203
|
-
};
|
|
26204
|
-
JavascriptNodeParser4.parseAndAddPortsFromScript = function(script2, ports, options) {
|
|
26205
|
-
function _exists(port5) {
|
|
26206
|
-
if (typeof port5 === "string") return ports.find((p) => p.name === port5) !== void 0;
|
|
26207
|
-
else return ports.find((p) => p.name === port5.name && p.plug === port5.plug) !== void 0;
|
|
26208
|
-
}
|
|
26209
|
-
function _addPortsFromMatch(match, options2) {
|
|
26210
|
-
if (match === void 0 || match === null) return;
|
|
26211
|
-
const unique2 = {};
|
|
26212
|
-
for (const _s of match) {
|
|
26213
|
-
let name2 = _s[1];
|
|
26214
|
-
if (name2 === void 0) continue;
|
|
26215
|
-
unique2[name2] = true;
|
|
26216
|
-
}
|
|
26217
|
-
Object.keys(unique2).forEach((p) => {
|
|
26218
|
-
if (_exists({
|
|
26219
|
-
name: options2.prefix + p,
|
|
26220
|
-
plug: options2.plug
|
|
26221
|
-
}))
|
|
26222
|
-
return;
|
|
26223
|
-
ports.push({
|
|
26224
|
-
name: options2.prefix + p,
|
|
26225
|
-
displayName: p,
|
|
26226
|
-
plug: options2.plug,
|
|
26227
|
-
type: options2.type,
|
|
26228
|
-
group: options2.group
|
|
26229
|
-
});
|
|
26230
|
-
});
|
|
26231
|
-
}
|
|
26232
|
-
if (!options.skipInputs) {
|
|
26233
|
-
_addPortsFromMatch(script2.matchAll(/Inputs\.([A-Za-z0-9_]+)/g), {
|
|
26234
|
-
type: options.inputType || "*",
|
|
26235
|
-
plug: "input",
|
|
26236
|
-
group: options.inputGroup || "Inputs",
|
|
26237
|
-
prefix: options.inputPrefix || ""
|
|
26238
|
-
});
|
|
26239
|
-
_addPortsFromMatch(script2.matchAll(/Inputs\s*\[\s*(?:'|")(.*)(?:'|")\s*\]/g), {
|
|
26240
|
-
type: options.inputType || "*",
|
|
26241
|
-
plug: "inputs",
|
|
26242
|
-
group: options.inputGroup || "Inputs",
|
|
26243
|
-
prefix: options.inputPrefix || ""
|
|
26244
|
-
});
|
|
26245
|
-
}
|
|
26246
|
-
if (!options.skipOutputs) {
|
|
26247
|
-
if (!options.skipOutputSignals) {
|
|
26248
|
-
_addPortsFromMatch(script2.matchAll(/Outputs\.([A-Za-z0-9]+)\s*\(\s*\)/g), {
|
|
26249
|
-
type: "signal",
|
|
26250
|
-
plug: "output",
|
|
26251
|
-
group: "Outputs",
|
|
26252
|
-
prefix: options.outputPrefix || ""
|
|
26253
|
-
});
|
|
26254
|
-
_addPortsFromMatch(script2.matchAll(/Outputs\s*\[\s*(?:'|")(.*)(?:'|")\s*\]\(\s*\)/g), {
|
|
26255
|
-
type: "signal",
|
|
26256
|
-
plug: "output",
|
|
26257
|
-
group: "Outputs",
|
|
26258
|
-
prefix: options.outputPrefix || ""
|
|
26259
|
-
});
|
|
26260
|
-
}
|
|
26261
|
-
if (!options.skipRegularOutputs) {
|
|
26262
|
-
_addPortsFromMatch(script2.matchAll(/Outputs\.([A-Za-z0-9_]+)/g), {
|
|
26263
|
-
type: "*",
|
|
26264
|
-
plug: "output",
|
|
26265
|
-
group: "Outputs",
|
|
26266
|
-
prefix: options.outputPrefix || ""
|
|
26267
|
-
});
|
|
26268
|
-
_addPortsFromMatch(script2.matchAll(/Outputs\s*\[\s*\"([^\"]*)\"\s*\]/g), {
|
|
26269
|
-
type: "*",
|
|
26270
|
-
plug: "output",
|
|
26271
|
-
group: "Outputs",
|
|
26272
|
-
prefix: options.outputPrefix || ""
|
|
26273
|
-
});
|
|
26274
|
-
}
|
|
26275
|
-
}
|
|
26276
|
-
};
|
|
26277
|
-
JavascriptNodeParser4.prototype.getPorts = function() {
|
|
26278
|
-
var ports = [];
|
|
26279
|
-
var self2 = this;
|
|
26280
|
-
Object.keys(this.inputs).forEach(function(name2) {
|
|
26281
|
-
var inputPort2 = self2.inputs[name2];
|
|
26282
|
-
var port5 = {
|
|
26283
|
-
name: name2,
|
|
26284
|
-
plug: "input"
|
|
26285
|
-
};
|
|
26286
|
-
if (typeof inputPort2 === "string") {
|
|
26287
|
-
port5.type = {
|
|
26288
|
-
name: inputPort2
|
|
26289
|
-
};
|
|
26290
|
-
port5.group = "Inputs";
|
|
26291
|
-
} else {
|
|
26292
|
-
for (var p in inputPort2) {
|
|
26293
|
-
port5[p] = inputPort2[p];
|
|
26294
|
-
}
|
|
26295
|
-
}
|
|
26296
|
-
ports.push(port5);
|
|
26297
|
-
});
|
|
26298
|
-
Object.keys(this.outputs).forEach(function(name2) {
|
|
26299
|
-
ports.push({
|
|
26300
|
-
name: name2,
|
|
26301
|
-
type: {
|
|
26302
|
-
name: self2.outputs[name2]
|
|
26303
|
-
},
|
|
26304
|
-
plug: "output",
|
|
26305
|
-
group: "Outputs"
|
|
26306
|
-
});
|
|
26307
|
-
});
|
|
26308
|
-
JavascriptNodeParser4.parseAndAddPortsFromScript(this.code, ports, {});
|
|
26309
|
-
return ports;
|
|
26310
|
-
};
|
|
26311
|
-
var _componentScopes = {};
|
|
26312
|
-
function _findParentComponentStateModelId(node) {
|
|
26313
|
-
const parent = findAncestorWithComponentObject2(node.nodeScope.componentOwner);
|
|
26314
|
-
if (!parent) return;
|
|
26315
|
-
return "componentState" + parent.getInstanceId();
|
|
26316
|
-
}
|
|
26317
|
-
JavascriptNodeParser4.getComponentScopeForNode = function(node) {
|
|
26318
|
-
const componentId = node.nodeScope.componentOwner.getInstanceId();
|
|
26319
|
-
if (_componentScopes[componentId] === void 0) {
|
|
26320
|
-
_componentScopes[componentId] = {};
|
|
26321
|
-
const componentObject = (node.nodeScope.modelScope || Model28).get("componentState" + componentId);
|
|
26322
|
-
_componentScopes[componentId].Object = componentObject;
|
|
26323
|
-
}
|
|
26324
|
-
const parentComponentObjectId = _findParentComponentStateModelId(node);
|
|
26325
|
-
const parentComponentObject = parentComponentObjectId !== void 0 ? (node.nodeScope.modelScope || Model28).get(parentComponentObjectId) : void 0;
|
|
26326
|
-
_componentScopes[componentId].ParentObject = parentComponentObject;
|
|
26327
|
-
Object.defineProperty(_componentScopes[componentId], "RepeaterObject", {
|
|
26328
|
-
configurable: true,
|
|
26329
|
-
enumerable: true,
|
|
26330
|
-
get: function() {
|
|
26331
|
-
return resolveForEachItem2(node);
|
|
26332
|
-
}
|
|
26333
|
-
});
|
|
26334
|
-
return _componentScopes[componentId];
|
|
26335
|
-
};
|
|
26336
|
-
JavascriptNodeParser4.getCodePrefix = function() {
|
|
26337
|
-
return "const Script = (typeof Node !== 'undefined')?Node:undefined;\n";
|
|
26338
|
-
};
|
|
26339
|
-
JavascriptNodeParser4.createNoodlAPI = function() {
|
|
26340
|
-
return typeof window !== "undefined" && window.Noodl !== void 0 ? window.Noodl : {};
|
|
26341
|
-
};
|
|
26342
|
-
module2.exports = JavascriptNodeParser4;
|
|
26343
|
-
}
|
|
26344
|
-
});
|
|
26345
|
-
|
|
26346
26463
|
// ../noodl-runtime/src/nodes/std-library/expression.ts
|
|
26347
26464
|
var require_expression = __commonJS({
|
|
26348
26465
|
"../noodl-runtime/src/nodes/std-library/expression.ts"(exports2, module2) {
|
|
26349
26466
|
"use strict";
|
|
26350
26467
|
init_expression_ports();
|
|
26351
26468
|
init_logic_search_tags();
|
|
26469
|
+
init_printedcode();
|
|
26352
26470
|
init_outcome();
|
|
26353
26471
|
init_run_on_value_change();
|
|
26354
26472
|
var Node17 = require_node2();
|
|
@@ -26577,11 +26695,27 @@ var require_expression = __commonJS({
|
|
|
26577
26695
|
const args = Object.keys(this._internal.scope);
|
|
26578
26696
|
this._internal.compiledWith = args.slice();
|
|
26579
26697
|
args.push("Noodl");
|
|
26698
|
+
const printed = findPrintedBody(expression, false);
|
|
26699
|
+
if (printed) {
|
|
26700
|
+
this._internal.compiledWith = printed.params.slice(0, -1);
|
|
26701
|
+
this._internal.compileError = void 0;
|
|
26702
|
+
return printed.fn;
|
|
26703
|
+
}
|
|
26704
|
+
if (hasPrintedCode()) {
|
|
26705
|
+
try {
|
|
26706
|
+
const fn = compileCode(args, expression);
|
|
26707
|
+
this._internal.compileError = void 0;
|
|
26708
|
+
return fn;
|
|
26709
|
+
} catch (e) {
|
|
26710
|
+
this._internal.compileError = e.message;
|
|
26711
|
+
return void 0;
|
|
26712
|
+
}
|
|
26713
|
+
}
|
|
26580
26714
|
const key = expression + args.join(" ");
|
|
26581
26715
|
if (compiledFunctionsCache2.hasOwnProperty(key) === false) {
|
|
26582
|
-
args.
|
|
26716
|
+
const params = args.slice();
|
|
26583
26717
|
try {
|
|
26584
|
-
compiledFunctionsCache2[key] =
|
|
26718
|
+
compiledFunctionsCache2[key] = compileCode(params, expression);
|
|
26585
26719
|
this._internal.compileError = void 0;
|
|
26586
26720
|
} catch (e) {
|
|
26587
26721
|
this._internal.compileError = e.message;
|
|
@@ -26613,7 +26747,7 @@ var require_expression = __commonJS({
|
|
|
26613
26747
|
description: "JavaScript expression whose value becomes Result. Every name it reads becomes an input port, except JavaScript's own (String, Number, JSON, Date, parseInt, Math and the rest), the Math shortcuts (round, min, pi\u2026) and keywords such as typeof; a port can never be called one of those, nor run, expression or evaluateAtLoad, which are this node's own inputs",
|
|
26614
26748
|
set: function(value2) {
|
|
26615
26749
|
const internal2 = this._internal;
|
|
26616
|
-
internal2.currentExpression =
|
|
26750
|
+
internal2.currentExpression = expressionNodeBody(value2);
|
|
26617
26751
|
internal2.compiledFunction = void 0;
|
|
26618
26752
|
const newInputs = expressionPorts(value2);
|
|
26619
26753
|
internal2.referencedPorts = newInputs;
|
|
@@ -26812,17 +26946,7 @@ var require_expression = __commonJS({
|
|
|
26812
26946
|
}
|
|
26813
26947
|
}
|
|
26814
26948
|
};
|
|
26815
|
-
var functionPreamble = [
|
|
26816
|
-
'var min = Math.min, max = Math.max, cos = Math.cos, sin = Math.sin, tan = Math.tan, sqrt = Math.sqrt, pi = Math.PI, round = Math.round, floor = Math.floor, ceil = Math.ceil, abs = Math.abs, random = Math.random, pow = Math.pow, log = Math.log, exp = Math.exp;try { var NoodlContext = (typeof Noodl !== "undefined") ? Noodl : (typeof global !== "undefined" && global.Noodl) || {}; var Variables = NoodlContext.Variables || {}; var Objects = NoodlContext.Objects || {}; var Arrays = NoodlContext.Arrays || {};} catch (e) { var Variables = {}, Objects = {}, Arrays = {};}'
|
|
26817
|
-
].join("");
|
|
26818
26949
|
var NOT_EVALUATED2 = {};
|
|
26819
|
-
function construct(constructor, args) {
|
|
26820
|
-
function F() {
|
|
26821
|
-
return constructor.apply(this, args);
|
|
26822
|
-
}
|
|
26823
|
-
F.prototype = constructor.prototype;
|
|
26824
|
-
return new F();
|
|
26825
|
-
}
|
|
26826
26950
|
var compiledFunctionsCache2 = {};
|
|
26827
26951
|
function reservedNameMessage2(names2) {
|
|
26828
26952
|
const list2 = names2.length > 1 ? names2.slice(0, -1).join(", ") + " and " + names2[names2.length - 1] : names2.join("");
|
|
@@ -26926,10 +27050,10 @@ function rawPositionFromStack(stack) {
|
|
|
26926
27050
|
function stackLineOffset() {
|
|
26927
27051
|
if (cachedOffset !== void 0) return cachedOffset;
|
|
26928
27052
|
try {
|
|
26929
|
-
const
|
|
27053
|
+
const AsyncFunction2 = Object.getPrototypeOf(async function() {
|
|
26930
27054
|
}).constructor;
|
|
26931
27055
|
let captured;
|
|
26932
|
-
const probe = new
|
|
27056
|
+
const probe = new AsyncFunction2(
|
|
26933
27057
|
"Inputs",
|
|
26934
27058
|
"Outputs",
|
|
26935
27059
|
"Noodl",
|
|
@@ -26984,12 +27108,12 @@ function undeclaredPortNameMessage(name2, side, isSignal = false) {
|
|
|
26984
27108
|
function noOutputWrittenMessage(ports) {
|
|
26985
27109
|
if (ports.length === 0) return "";
|
|
26986
27110
|
const first2 = ports[0];
|
|
26987
|
-
const
|
|
27111
|
+
const named3 = ports.map((p) => '"' + p.label + '"').join(", ");
|
|
26988
27112
|
const which = ports.length === 1 ? "it" : '"' + first2.label + '"';
|
|
26989
27113
|
if (first2.isSignal) {
|
|
26990
|
-
return "The script ran but produced no output: " +
|
|
27114
|
+
return "The script ran but produced no output: " + named3 + " never fired. Fire " + which + " in the script with " + portUsage("Outputs", first2.label, true) + ".";
|
|
26991
27115
|
}
|
|
26992
|
-
return "The script ran but produced no output: " +
|
|
27116
|
+
return "The script ran but produced no output: " + named3 + " stayed empty. Write " + which + " in the script with " + portUsage("Outputs", first2.label, false) + " \u2014 assigning to a plain variable of the same name does not reach the port.";
|
|
26993
27117
|
}
|
|
26994
27118
|
function proplistLabels(model2, parameter) {
|
|
26995
27119
|
const rows = model2 && model2.parameters && model2.parameters[parameter];
|
|
@@ -27193,6 +27317,7 @@ var require_simplejavascript = __commonJS({
|
|
|
27193
27317
|
init_scriptfiles();
|
|
27194
27318
|
init_function_ports();
|
|
27195
27319
|
init_tracecause();
|
|
27320
|
+
init_printedcode();
|
|
27196
27321
|
var Node17 = require_node2();
|
|
27197
27322
|
var JavascriptNodeParser4 = require_javascriptnodeparser();
|
|
27198
27323
|
var { logJavaScriptNodeError: logJavaScriptNodeError2, thrownMessage: thrownMessage3 } = (init_utils(), __toCommonJS(utils_exports));
|
|
@@ -27291,6 +27416,7 @@ var require_simplejavascript = __commonJS({
|
|
|
27291
27416
|
return names2;
|
|
27292
27417
|
}
|
|
27293
27418
|
function publishHeldWrites(node) {
|
|
27419
|
+
sendHeldChanges(node);
|
|
27294
27420
|
node._internal.heldWrites.forEach((prop) => {
|
|
27295
27421
|
node.registerOutputIfNeeded("out-" + prop);
|
|
27296
27422
|
node.flagOutputDirty("out-" + prop);
|
|
@@ -27334,7 +27460,7 @@ var require_simplejavascript = __commonJS({
|
|
|
27334
27460
|
if (value2 !== this._internal.outputValues[prop]) {
|
|
27335
27461
|
this.registerOutputIfNeeded("out-" + prop);
|
|
27336
27462
|
this._internal.outputValues[prop] = value2;
|
|
27337
|
-
this
|
|
27463
|
+
holdChange(this, prop);
|
|
27338
27464
|
this._internal.heldWrites.delete(prop);
|
|
27339
27465
|
} else {
|
|
27340
27466
|
this._internal.heldWrites.add(prop);
|
|
@@ -27513,7 +27639,7 @@ var require_simplejavascript = __commonJS({
|
|
|
27513
27639
|
});
|
|
27514
27640
|
},
|
|
27515
27641
|
runScript: async function() {
|
|
27516
|
-
const func = this._internal.func;
|
|
27642
|
+
const func = sendingChangesAfterTheSyncPart(this, this._internal.func);
|
|
27517
27643
|
const tokens = this._internal.pendingRunOutcomes || [];
|
|
27518
27644
|
this._internal.pendingRunOutcomes = void 0;
|
|
27519
27645
|
if (func === void 0) {
|
|
@@ -27718,16 +27844,7 @@ var require_simplejavascript = __commonJS({
|
|
|
27718
27844
|
parseScript: function(script2) {
|
|
27719
27845
|
let func;
|
|
27720
27846
|
try {
|
|
27721
|
-
|
|
27722
|
-
}).constructor;
|
|
27723
|
-
func = new AsyncFunction(
|
|
27724
|
-
"Inputs",
|
|
27725
|
-
"Outputs",
|
|
27726
|
-
"Noodl",
|
|
27727
|
-
"Component",
|
|
27728
|
-
"Scripts",
|
|
27729
|
-
JavascriptNodeParser4.getCodePrefix() + script2
|
|
27730
|
-
);
|
|
27847
|
+
func = compileCode(FUNCTION_NODE_PARAMS, functionNodeBody(script2), { async: true });
|
|
27731
27848
|
this._internal.parseError = void 0;
|
|
27732
27849
|
this._internal.lastReportedError = void 0;
|
|
27733
27850
|
} catch (e) {
|
|
@@ -27795,9 +27912,9 @@ var require_simplejavascript = __commonJS({
|
|
|
27795
27912
|
return;
|
|
27796
27913
|
}
|
|
27797
27914
|
try {
|
|
27798
|
-
const
|
|
27915
|
+
const AsyncFunction2 = Object.getPrototypeOf(async function() {
|
|
27799
27916
|
}).constructor;
|
|
27800
|
-
new
|
|
27917
|
+
new AsyncFunction2("Inputs", "Outputs", "Noodl", "Component", script2);
|
|
27801
27918
|
context.editorConnection.clearWarning(node.component.name, node.id, "js-function-parse-waring");
|
|
27802
27919
|
} catch (e) {
|
|
27803
27920
|
context.editorConnection.sendWarning(node.component.name, node.id, "js-function-parse-waring", {
|
|
@@ -27955,6 +28072,32 @@ var require_simplejavascript = __commonJS({
|
|
|
27955
28072
|
});
|
|
27956
28073
|
}
|
|
27957
28074
|
};
|
|
28075
|
+
function holdChange(node, prop) {
|
|
28076
|
+
const internal2 = node._internal;
|
|
28077
|
+
if (!internal2.heldChanges) internal2.heldChanges = /* @__PURE__ */ new Set();
|
|
28078
|
+
internal2.heldChanges.add(prop);
|
|
28079
|
+
if (internal2.heldChangesQueued) return;
|
|
28080
|
+
internal2.heldChangesQueued = true;
|
|
28081
|
+
Promise.resolve().then(() => sendHeldChanges(node));
|
|
28082
|
+
}
|
|
28083
|
+
function sendHeldChanges(node) {
|
|
28084
|
+
const internal2 = node._internal;
|
|
28085
|
+
internal2.heldChangesQueued = false;
|
|
28086
|
+
const held = internal2.heldChanges;
|
|
28087
|
+
if (!held || held.size === 0 || node._deleted) return;
|
|
28088
|
+
internal2.heldChanges = /* @__PURE__ */ new Set();
|
|
28089
|
+
held.forEach((prop) => node.flagOutputDirty("out-" + prop));
|
|
28090
|
+
}
|
|
28091
|
+
function sendingChangesAfterTheSyncPart(node, func) {
|
|
28092
|
+
if (func === void 0) return void 0;
|
|
28093
|
+
return function(...args) {
|
|
28094
|
+
try {
|
|
28095
|
+
return func.apply(this, args);
|
|
28096
|
+
} finally {
|
|
28097
|
+
sendHeldChanges(node);
|
|
28098
|
+
}
|
|
28099
|
+
};
|
|
28100
|
+
}
|
|
27958
28101
|
module2.exports = SimpleJavascriptNodeModule;
|
|
27959
28102
|
}
|
|
27960
28103
|
});
|
|
@@ -28274,6 +28417,7 @@ var require_logic_builder = __commonJS({
|
|
|
28274
28417
|
init_logic_builder_io2();
|
|
28275
28418
|
init_logic_builder_probe();
|
|
28276
28419
|
init_logic_search_tags();
|
|
28420
|
+
init_printedcode();
|
|
28277
28421
|
init_outcome();
|
|
28278
28422
|
var EdgeTriggeredInput7 = require_edgetriggeredinput();
|
|
28279
28423
|
var LogicBuilderNode = {
|
|
@@ -28628,47 +28772,49 @@ var require_logic_builder = __commonJS({
|
|
|
28628
28772
|
return null;
|
|
28629
28773
|
}
|
|
28630
28774
|
try {
|
|
28631
|
-
const fn =
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
28635
|
-
|
|
28636
|
-
|
|
28637
|
-
|
|
28638
|
-
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28642
|
-
|
|
28643
|
-
|
|
28644
|
-
|
|
28645
|
-
|
|
28646
|
-
|
|
28647
|
-
|
|
28648
|
-
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
|
|
28660
|
-
|
|
28661
|
-
|
|
28662
|
-
|
|
28663
|
-
|
|
28664
|
-
|
|
28665
|
-
|
|
28666
|
-
|
|
28667
|
-
|
|
28668
|
-
|
|
28669
|
-
|
|
28670
|
-
|
|
28671
|
-
|
|
28775
|
+
const fn = compileCode(
|
|
28776
|
+
[
|
|
28777
|
+
"Inputs",
|
|
28778
|
+
"Outputs",
|
|
28779
|
+
"Noodl",
|
|
28780
|
+
"Variables",
|
|
28781
|
+
"Objects",
|
|
28782
|
+
"Arrays",
|
|
28783
|
+
"sendSignalOnOutput",
|
|
28784
|
+
"__triggerSignal__",
|
|
28785
|
+
/**
|
|
28786
|
+
* LGC-003 §1 — the ninth and tenth parameters, and the reason there is only ever one
|
|
28787
|
+
* generated string.
|
|
28788
|
+
*
|
|
28789
|
+
* The editor emits `__p("<blockId>", …)` around every value block and `__s("<blockId>")`
|
|
28790
|
+
* before every statement, always — there is no debug build and no release build, so
|
|
28791
|
+
* there is no class of defect that appears only when nobody is watching. What changes
|
|
28792
|
+
* is which functions land here: the shared identity pair, or a recorder.
|
|
28793
|
+
*
|
|
28794
|
+
* ⚠️ **Declared unconditionally, including for code generated before this existed.**
|
|
28795
|
+
* A `generatedCode` string saved by an older editor mentions neither name, and an
|
|
28796
|
+
* unused parameter costs nothing — whereas making the list conditional on the code
|
|
28797
|
+
* would put a `code.indexOf('__p')` on the compile path and give the runtime two
|
|
28798
|
+
* shapes of compiled function to reason about.
|
|
28799
|
+
*/
|
|
28800
|
+
"__p",
|
|
28801
|
+
"__s",
|
|
28802
|
+
/**
|
|
28803
|
+
* The eleventh parameter, and the only one that shadows a global rather than adding a
|
|
28804
|
+
* name (FIX-004 redaction ruling b).
|
|
28805
|
+
*
|
|
28806
|
+
* ⚠️ **Order is the contract.** This list and the argument list in `_executeLogic` are
|
|
28807
|
+
* positional, so a parameter added here and not there — or added in a different place —
|
|
28808
|
+
* silently shifts every argument after it. `__triggerSignal__` was already once built
|
|
28809
|
+
* and then not passed, which read as `undefined` inside every block program ever run.
|
|
28810
|
+
* A spec asserts this node's parameter names in order for that reason.
|
|
28811
|
+
*
|
|
28812
|
+
* Declared unconditionally, exactly as `__p`/`__s` are: code generated before this
|
|
28813
|
+
* existed says `console.log`, which is the whole point, and code that never mentions
|
|
28814
|
+
* `console` pays one unused parameter.
|
|
28815
|
+
*/
|
|
28816
|
+
"console"
|
|
28817
|
+
],
|
|
28672
28818
|
code
|
|
28673
28819
|
);
|
|
28674
28820
|
return fn;
|
|
@@ -30118,9 +30264,9 @@ var init_SseConnectionPool = __esm({
|
|
|
30118
30264
|
// ../noodl-runtime/src/api/backends/realtime/SseTransport.ts
|
|
30119
30265
|
function entryIsAbout(entry, collection) {
|
|
30120
30266
|
if (!entry || typeof entry !== "object") return true;
|
|
30121
|
-
const
|
|
30122
|
-
if (typeof
|
|
30123
|
-
return
|
|
30267
|
+
const named3 = entry.collection;
|
|
30268
|
+
if (typeof named3 !== "string") return true;
|
|
30269
|
+
return named3 === collection;
|
|
30124
30270
|
}
|
|
30125
30271
|
var NODEGX_SSE, POCKETBASE_SSE, SseTransport;
|
|
30126
30272
|
var init_SseTransport = __esm({
|
|
@@ -30779,6 +30925,19 @@ function recordFieldPorts(ctx, options) {
|
|
|
30779
30925
|
}
|
|
30780
30926
|
return ports;
|
|
30781
30927
|
}
|
|
30928
|
+
function recordBuiltInDatePorts(ctx, existingPorts, options = {}) {
|
|
30929
|
+
if (!ctx.selectedCollection || !isParseWireContext(ctx)) return [];
|
|
30930
|
+
const have = new Set(existingPorts.map((port5) => port5.name));
|
|
30931
|
+
const ports = [];
|
|
30932
|
+
for (const field2 of RECORD_BUILT_IN_DATES) {
|
|
30933
|
+
if (have.has(`prop-${field2}`)) continue;
|
|
30934
|
+
ports.push({ name: `prop-${field2}`, displayName: field2, type: { name: "date" }, plug: "output", group: "Properties" });
|
|
30935
|
+
if (options.includeChangedSignals && !have.has(`changed-${field2}`)) {
|
|
30936
|
+
ports.push({ name: `changed-${field2}`, displayName: `${field2} Changed`, type: "signal", plug: "output", group: "Events" });
|
|
30937
|
+
}
|
|
30938
|
+
}
|
|
30939
|
+
return ports;
|
|
30940
|
+
}
|
|
30782
30941
|
function recordPortType(field2) {
|
|
30783
30942
|
if (field2.nativeType && Object.prototype.hasOwnProperty.call(PARSE_PORT_TYPES, field2.nativeType)) {
|
|
30784
30943
|
return { name: PARSE_PORT_TYPES[field2.nativeType] };
|
|
@@ -30889,7 +31048,7 @@ function parseTypeNameFor(field2) {
|
|
|
30889
31048
|
function recordFilterBackendType(ctx, fallback) {
|
|
30890
31049
|
return ctx.backendType || fallback;
|
|
30891
31050
|
}
|
|
30892
|
-
var PARSE_PORT_TYPES, PARSE_SYSTEM_CLASSES;
|
|
31051
|
+
var PARSE_PORT_TYPES, PARSE_SYSTEM_CLASSES, RECORD_BUILT_IN_DATES;
|
|
30893
31052
|
var init_record_ports = __esm({
|
|
30894
31053
|
"../noodl-runtime/src/nodes/std-library/data/record-ports.ts"() {
|
|
30895
31054
|
init_resolveBackend_pure();
|
|
@@ -30904,6 +31063,7 @@ var init_record_ports = __esm({
|
|
|
30904
31063
|
{ label: "User", value: "_User" },
|
|
30905
31064
|
{ label: "Role", value: "_Role" }
|
|
30906
31065
|
]);
|
|
31066
|
+
RECORD_BUILT_IN_DATES = Object.freeze(["createdAt", "updatedAt"]);
|
|
30907
31067
|
}
|
|
30908
31068
|
});
|
|
30909
31069
|
|
|
@@ -31203,8 +31363,8 @@ function relationsFromDirectus(rows) {
|
|
|
31203
31363
|
function relationsFromPostgrestSpec(spec) {
|
|
31204
31364
|
const definitions = spec?.definitions ?? {};
|
|
31205
31365
|
const result2 = [];
|
|
31206
|
-
const analyse = (
|
|
31207
|
-
const properties2 = definitions[
|
|
31366
|
+
const analyse = (table2) => {
|
|
31367
|
+
const properties2 = definitions[table2]?.properties ?? {};
|
|
31208
31368
|
const foreignKeys = [];
|
|
31209
31369
|
let primaryKeyCount = 0;
|
|
31210
31370
|
for (const [column, definition4] of Object.entries(properties2)) {
|
|
@@ -31216,8 +31376,8 @@ function relationsFromPostgrestSpec(spec) {
|
|
|
31216
31376
|
}
|
|
31217
31377
|
return { foreignKeys, primaryKeyCount };
|
|
31218
31378
|
};
|
|
31219
|
-
for (const
|
|
31220
|
-
const { foreignKeys, primaryKeyCount } = analyse(
|
|
31379
|
+
for (const table2 of Object.keys(definitions)) {
|
|
31380
|
+
const { foreignKeys, primaryKeyCount } = analyse(table2);
|
|
31221
31381
|
const isJunction = foreignKeys.length === 2 && primaryKeyCount === 2 && foreignKeys.every((fk) => fk.primaryKey);
|
|
31222
31382
|
if (isJunction) {
|
|
31223
31383
|
const [left, right] = foreignKeys;
|
|
@@ -31234,7 +31394,7 @@ function relationsFromPostgrestSpec(spec) {
|
|
|
31234
31394
|
cardinality: "many",
|
|
31235
31395
|
write: {
|
|
31236
31396
|
kind: "junction",
|
|
31237
|
-
collection:
|
|
31397
|
+
collection: table2,
|
|
31238
31398
|
sourceField: near.column,
|
|
31239
31399
|
targetField: far.column,
|
|
31240
31400
|
// The pair *is* the primary key, so a duplicate is a `23505` and
|
|
@@ -31248,7 +31408,7 @@ function relationsFromPostgrestSpec(spec) {
|
|
|
31248
31408
|
}
|
|
31249
31409
|
for (const fk of foreignKeys) {
|
|
31250
31410
|
result2.push({
|
|
31251
|
-
collection:
|
|
31411
|
+
collection: table2,
|
|
31252
31412
|
field: fk.column,
|
|
31253
31413
|
target: fk.target,
|
|
31254
31414
|
cardinality: "one",
|
|
@@ -31256,8 +31416,8 @@ function relationsFromPostgrestSpec(spec) {
|
|
|
31256
31416
|
});
|
|
31257
31417
|
result2.push({
|
|
31258
31418
|
collection: fk.target,
|
|
31259
|
-
field:
|
|
31260
|
-
target:
|
|
31419
|
+
field: table2,
|
|
31420
|
+
target: table2,
|
|
31261
31421
|
cardinality: "many",
|
|
31262
31422
|
write: { kind: "foreignKey", field: fk.column, on: "target" }
|
|
31263
31423
|
});
|
|
@@ -31530,11 +31690,11 @@ var init_filter = __esm({
|
|
|
31530
31690
|
|
|
31531
31691
|
// ../nodegx-backend-contract/src/descriptors/helpers.ts
|
|
31532
31692
|
function filterTable(fallback, overrides) {
|
|
31533
|
-
const
|
|
31693
|
+
const table2 = {};
|
|
31534
31694
|
for (const operator of FILTER_OPERATORS) {
|
|
31535
|
-
|
|
31695
|
+
table2[operator] = overrides[operator] ?? fallback;
|
|
31536
31696
|
}
|
|
31537
|
-
return Object.freeze(
|
|
31697
|
+
return Object.freeze(table2);
|
|
31538
31698
|
}
|
|
31539
31699
|
var supported, unsupported, degraded, conditional;
|
|
31540
31700
|
var init_helpers = __esm({
|
|
@@ -33030,12 +33190,12 @@ var init_operational = __esm({
|
|
|
33030
33190
|
});
|
|
33031
33191
|
|
|
33032
33192
|
// ../nodegx-backend-contract/src/targetGoes.ts
|
|
33033
|
-
function whenTargetGoesProblems(
|
|
33193
|
+
function whenTargetGoesProblems(table2, columns) {
|
|
33034
33194
|
const out = [];
|
|
33035
33195
|
for (const col of columns) {
|
|
33036
33196
|
const rule = col.whenTargetGoes;
|
|
33037
33197
|
if (rule === void 0) continue;
|
|
33038
|
-
const at = `"${
|
|
33198
|
+
const at = `"${table2}.${col.name}"`;
|
|
33039
33199
|
if (typeof rule !== "string" || !WHEN_TARGET_GOES.includes(rule)) {
|
|
33040
33200
|
out.push(`${at} says "${String(rule)}" for when what it points at goes; it must be one of ${WHEN_TARGET_GOES.join(", ")}.`);
|
|
33041
33201
|
} else if (col.type !== "Pointer") {
|
|
@@ -33050,12 +33210,12 @@ function whenTargetGoesProblems(table, columns) {
|
|
|
33050
33210
|
}
|
|
33051
33211
|
function rulesByTarget(schema) {
|
|
33052
33212
|
const out = /* @__PURE__ */ new Map();
|
|
33053
|
-
for (const
|
|
33054
|
-
for (const col of schema.getTableSchema(
|
|
33213
|
+
for (const table2 of schema.listTables()) {
|
|
33214
|
+
for (const col of schema.getTableSchema(table2)?.columns || []) {
|
|
33055
33215
|
const rule = col.whenTargetGoes;
|
|
33056
33216
|
if (col.type !== "Pointer" || !col.targetClass || !rule || !WHEN_TARGET_GOES.includes(rule)) continue;
|
|
33057
33217
|
const list2 = out.get(col.targetClass) || [];
|
|
33058
|
-
list2.push({ collection:
|
|
33218
|
+
list2.push({ collection: table2, field: col.name, rule });
|
|
33059
33219
|
out.set(col.targetClass, list2);
|
|
33060
33220
|
}
|
|
33061
33221
|
}
|
|
@@ -33063,18 +33223,18 @@ function rulesByTarget(schema) {
|
|
|
33063
33223
|
}
|
|
33064
33224
|
function relations(schema) {
|
|
33065
33225
|
const out = [];
|
|
33066
|
-
for (const
|
|
33067
|
-
for (const col of schema.getTableSchema(
|
|
33226
|
+
for (const table2 of schema.listTables())
|
|
33227
|
+
for (const col of schema.getTableSchema(table2)?.columns || []) if (col.type === "Relation") out.push([table2, col.name, col.targetClass || ""]);
|
|
33068
33228
|
return out;
|
|
33069
33229
|
}
|
|
33070
33230
|
function pairsOf(rels, schema, collection, objectId) {
|
|
33071
33231
|
const out = [];
|
|
33072
|
-
for (const [
|
|
33073
|
-
if (
|
|
33074
|
-
const ids = schema.getRelatedIds(
|
|
33075
|
-
for (const relatedId of Array.isArray(ids) ? ids : []) out.push({ collection:
|
|
33232
|
+
for (const [table2, field2, target] of rels) {
|
|
33233
|
+
if (table2 === collection) {
|
|
33234
|
+
const ids = schema.getRelatedIds(table2, objectId, field2);
|
|
33235
|
+
for (const relatedId of Array.isArray(ids) ? ids : []) out.push({ collection: table2, objectId, field: field2, relatedId: String(relatedId) });
|
|
33076
33236
|
}
|
|
33077
|
-
if (target === collection) for (const owner of schema.getRelationOwners(
|
|
33237
|
+
if (target === collection) for (const owner of schema.getRelationOwners(table2, field2, objectId)) out.push({ collection: table2, objectId: owner, field: field2, relatedId: objectId });
|
|
33078
33238
|
}
|
|
33079
33239
|
return out;
|
|
33080
33240
|
}
|
|
@@ -33089,7 +33249,7 @@ async function linkedIds(ctx, collection, field2, id) {
|
|
|
33089
33249
|
async function planDelete(ctx, collection, objectId) {
|
|
33090
33250
|
const rules2 = rulesByTarget(ctx.schema);
|
|
33091
33251
|
const rels = relations(ctx.schema);
|
|
33092
|
-
if (!rules2.has(collection) && !rels.some(([
|
|
33252
|
+
if (!rules2.has(collection) && !rels.some(([table2, , target]) => table2 === collection || target === collection)) return null;
|
|
33093
33253
|
if (await ctx.count(collection, { objectId }) === 0) return null;
|
|
33094
33254
|
const key = (c, id) => `${c}\0${id}`;
|
|
33095
33255
|
const gone = [{ collection, objectId }];
|
|
@@ -33210,9 +33370,9 @@ function idOf(v) {
|
|
|
33210
33370
|
if (typeof v === "string" && v) return v;
|
|
33211
33371
|
return void 0;
|
|
33212
33372
|
}
|
|
33213
|
-
function targetOf(ctx,
|
|
33214
|
-
const col = ctx.schema.getTableSchema(
|
|
33215
|
-
if (!col?.targetClass) throw new Error(`${
|
|
33373
|
+
function targetOf(ctx, table2, field2) {
|
|
33374
|
+
const col = ctx.schema.getTableSchema(table2)?.columns?.find((c) => c.name === field2);
|
|
33375
|
+
if (!col?.targetClass) throw new Error(`${table2}.${field2} is not a link the schema knows the target of`);
|
|
33216
33376
|
return col.targetClass;
|
|
33217
33377
|
}
|
|
33218
33378
|
async function dryRunMigration(ctx, plan) {
|
|
@@ -33907,7 +34067,8 @@ var init_ParseWireAdapter = __esm({
|
|
|
33907
34067
|
runId !== void 0 ? { "X-NodeGX-Run": runId } : {},
|
|
33908
34068
|
options.headers || {}
|
|
33909
34069
|
);
|
|
33910
|
-
fetch
|
|
34070
|
+
const send = typeof _noodl_cloudservices !== "undefined" && _noodl_cloudservices.fetch ? _noodl_cloudservices.fetch : fetch;
|
|
34071
|
+
send(endpoint + path10, {
|
|
33911
34072
|
method: options.method || "GET",
|
|
33912
34073
|
headers,
|
|
33913
34074
|
body: JSON.stringify(options.content)
|
|
@@ -33962,8 +34123,9 @@ var init_ParseWireAdapter = __esm({
|
|
|
33962
34123
|
// P99 HLT-023: pass the server's words on, as `fetch` and the rest do. Dropped here, a
|
|
33963
34124
|
// refusal that names its cause (the per-run ceiling, a 429 with its class) reached the
|
|
33964
34125
|
// function as "Failed to query."
|
|
33965
|
-
|
|
33966
|
-
|
|
34126
|
+
// P115-HST006-STALEROWS: and the status, so a reader can tell a refusal (403) from a blip.
|
|
34127
|
+
error: function(res, status) {
|
|
34128
|
+
options.error(res && res.error, status);
|
|
33967
34129
|
}
|
|
33968
34130
|
});
|
|
33969
34131
|
}
|
|
@@ -35242,8 +35404,8 @@ function savedItemToNeutral(item, resolve5, options) {
|
|
|
35242
35404
|
if (isSavedGroup(item)) return savedFilterToNeutral(item, resolve5, options);
|
|
35243
35405
|
const condition = item;
|
|
35244
35406
|
const isConnected = condition.valueSource === "connected" && !!condition.valuePortName;
|
|
35245
|
-
const
|
|
35246
|
-
const value2 = isConnected ?
|
|
35407
|
+
const resolved3 = isConnected && resolve5 ? resolve5(condition.valuePortName) : void 0;
|
|
35408
|
+
const value2 = isConnected ? resolved3 !== void 0 || options.dropUnresolvedConnected ? resolved3 : condition.value : condition.value;
|
|
35247
35409
|
if (condition.kind === "relation") {
|
|
35248
35410
|
if (value2 === void 0 || value2 === null || value2 === "") return null;
|
|
35249
35411
|
return {
|
|
@@ -37579,7 +37741,8 @@ var init_RestDataAdapter = __esm({
|
|
|
37579
37741
|
const total = options.count ? readTotalCount(profile, body, headers, rows.length) : void 0;
|
|
37580
37742
|
options.success(records, total);
|
|
37581
37743
|
},
|
|
37582
|
-
fail: (message) => options.error(message)
|
|
37744
|
+
fail: (message, status) => options.error(message, status)
|
|
37745
|
+
// P115-HST006-STALEROWS: a refusal is told apart
|
|
37583
37746
|
}
|
|
37584
37747
|
);
|
|
37585
37748
|
}
|
|
@@ -39128,8 +39291,19 @@ var require_cloudstore = __commonJS({
|
|
|
39128
39291
|
}
|
|
39129
39292
|
return obj;
|
|
39130
39293
|
}
|
|
39294
|
+
function _schemaOf(collectionName2) {
|
|
39295
|
+
const collection = collectionName2 !== void 0 ? CloudStore7._collections[collectionName2] : void 0;
|
|
39296
|
+
if (!collection) return void 0;
|
|
39297
|
+
if (collection.schema) return collection.schema;
|
|
39298
|
+
if (!Array.isArray(collection.columns)) return void 0;
|
|
39299
|
+
const properties2 = {};
|
|
39300
|
+
for (const column of collection.columns) {
|
|
39301
|
+
if (column && column.name) properties2[column.name] = { type: column.type, targetClass: column.targetClass };
|
|
39302
|
+
}
|
|
39303
|
+
return { properties: properties2 };
|
|
39304
|
+
}
|
|
39131
39305
|
function _serializeObject(data, collectionName2, modelScope) {
|
|
39132
|
-
|
|
39306
|
+
var schema = _schemaOf(collectionName2);
|
|
39133
39307
|
for (var key in data) {
|
|
39134
39308
|
var _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : void 0;
|
|
39135
39309
|
if (data[key] === void 0 || data[key] === null) {
|
|
@@ -39214,14 +39388,14 @@ var require_cloudstore = __commonJS({
|
|
|
39214
39388
|
function _fromJSON(item, collectionName2, modelScope) {
|
|
39215
39389
|
const m = (modelScope || Model28).get(item.objectId);
|
|
39216
39390
|
m._class = collectionName2;
|
|
39217
|
-
|
|
39218
|
-
var schema = CloudStore7._collections[collectionName2].schema;
|
|
39391
|
+
var schema = _schemaOf(collectionName2);
|
|
39219
39392
|
for (var key in item) {
|
|
39220
39393
|
if (key === "objectId" || key === "ACL") continue;
|
|
39221
39394
|
var _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : void 0;
|
|
39222
39395
|
if (_type === void 0 && item[key] && item[key].__type === "Pointer" && item[key].objectId !== void 0) {
|
|
39223
39396
|
_type = "Pointer";
|
|
39224
39397
|
}
|
|
39398
|
+
if (_type === void 0 && (key === "createdAt" || key === "updatedAt")) _type = "Date";
|
|
39225
39399
|
const value2 = _deserializeJSON(item[key], _type, modelScope);
|
|
39226
39400
|
if (Array.isArray(value2) && sameList2(m.get(key), value2)) continue;
|
|
39227
39401
|
m.set(key, value2);
|
|
@@ -39438,8 +39612,19 @@ function convertVisualFilter(query2, options) {
|
|
|
39438
39612
|
});
|
|
39439
39613
|
return Object.keys(where2).length === 0 ? void 0 : where2;
|
|
39440
39614
|
}
|
|
39615
|
+
function instantOf(operand) {
|
|
39616
|
+
let at;
|
|
39617
|
+
if (operand instanceof Date) at = operand.getTime();
|
|
39618
|
+
else if (operand && operand.__type === "Date" && typeof operand.iso === "string") at = Date.parse(operand.iso);
|
|
39619
|
+
else if (typeof operand === "string") at = Date.parse(operand);
|
|
39620
|
+
return at === void 0 || Number.isNaN(at) ? void 0 : at;
|
|
39621
|
+
}
|
|
39441
39622
|
function matchesOperator(value2, op, condition) {
|
|
39442
39623
|
const operand = condition[op];
|
|
39624
|
+
if (value2 instanceof Date && Object.prototype.hasOwnProperty.call(DATE_COMPARISONS, op)) {
|
|
39625
|
+
const at = instantOf(operand);
|
|
39626
|
+
if (at !== void 0) return DATE_COMPARISONS[op](value2.getTime(), at);
|
|
39627
|
+
}
|
|
39443
39628
|
switch (op) {
|
|
39444
39629
|
case "$eq":
|
|
39445
39630
|
return operand && operand.__type === "Pointer" ? value2 === operand.objectId : value2 == operand;
|
|
@@ -39518,8 +39703,8 @@ function convertVisualSorting(sorting) {
|
|
|
39518
39703
|
}
|
|
39519
39704
|
function convertFilterOp(filter2, options) {
|
|
39520
39705
|
try {
|
|
39521
|
-
const
|
|
39522
|
-
return toParseWhere(
|
|
39706
|
+
const resolved3 = resolveRelatedClasses(filter2, options.modelScope);
|
|
39707
|
+
return toParseWhere(resolved3, {
|
|
39523
39708
|
backend: backendType(),
|
|
39524
39709
|
schema: schemaFor(options.collectionName)
|
|
39525
39710
|
});
|
|
@@ -39531,13 +39716,21 @@ function convertFilterOp(filter2, options) {
|
|
|
39531
39716
|
throw e;
|
|
39532
39717
|
}
|
|
39533
39718
|
}
|
|
39534
|
-
var CloudStore, ModelImport2, Model5;
|
|
39719
|
+
var CloudStore, ModelImport2, Model5, DATE_COMPARISONS;
|
|
39535
39720
|
var init_queryutils = __esm({
|
|
39536
39721
|
"../noodl-runtime/src/api/queryutils.ts"() {
|
|
39537
39722
|
init_translators2();
|
|
39538
39723
|
CloudStore = require_cloudstore();
|
|
39539
39724
|
ModelImport2 = require_model2();
|
|
39540
39725
|
Model5 = ModelImport2;
|
|
39726
|
+
DATE_COMPARISONS = {
|
|
39727
|
+
$eq: (a, b) => a === b,
|
|
39728
|
+
$ne: (a, b) => a !== b,
|
|
39729
|
+
$lt: (a, b) => a < b,
|
|
39730
|
+
$lte: (a, b) => a <= b,
|
|
39731
|
+
$gt: (a, b) => a > b,
|
|
39732
|
+
$gte: (a, b) => a >= b
|
|
39733
|
+
};
|
|
39541
39734
|
}
|
|
39542
39735
|
});
|
|
39543
39736
|
|
|
@@ -40118,8 +40311,9 @@ var require_dbcollectionnode2 = __commonJS({
|
|
|
40118
40311
|
this.setCollection(_c);
|
|
40119
40312
|
this.sendSignalOnOutput("fetched");
|
|
40120
40313
|
},
|
|
40121
|
-
error: (err) => {
|
|
40122
|
-
|
|
40314
|
+
error: (err, status) => {
|
|
40315
|
+
const refused = status === 401 || status === 403;
|
|
40316
|
+
if (refused || this._internal.collection === void 0) this.setCollection(_c);
|
|
40123
40317
|
this.setError(err || "Failed to fetch.");
|
|
40124
40318
|
}
|
|
40125
40319
|
});
|
|
@@ -40943,7 +41137,9 @@ var require_dbmodelnode2 = __commonJS({
|
|
|
40943
41137
|
includeChangedSignals: true
|
|
40944
41138
|
}) : [];
|
|
40945
41139
|
ports.push(...fieldPorts);
|
|
40946
|
-
|
|
41140
|
+
const datePorts = recordBuiltInDatePorts(ctx, fieldPorts, { includeChangedSignals: true });
|
|
41141
|
+
ports.push(...datePorts);
|
|
41142
|
+
ports.push(...recordWiredFieldPorts(node, [...fieldPorts, ...datePorts], { plug: "output" }));
|
|
40947
41143
|
sendSchemaPorts(editorConnection, node.id, ports, { staticPorts: staticPortNames(ModelNodeDefinition3) });
|
|
40948
41144
|
}
|
|
40949
41145
|
var DbModelNodeModule = {
|
|
@@ -45139,6 +45335,7 @@ var require_mapcollectionnode = __commonJS({
|
|
|
45139
45335
|
"../noodl-runtime/src/nodes/std-library/data/mapcollectionnode.ts"(exports2, module2) {
|
|
45140
45336
|
"use strict";
|
|
45141
45337
|
init_outcome();
|
|
45338
|
+
init_printedcode();
|
|
45142
45339
|
init_itemsinput();
|
|
45143
45340
|
var Node17 = require_node2();
|
|
45144
45341
|
var Collection5 = require_collection();
|
|
@@ -45257,7 +45454,7 @@ var require_mapcollectionnode = __commonJS({
|
|
|
45257
45454
|
compileMapScript: function(code) {
|
|
45258
45455
|
this._internal.mapCode = code;
|
|
45259
45456
|
try {
|
|
45260
|
-
this._internal.mapFunc =
|
|
45457
|
+
this._internal.mapFunc = compileCode(MAP_COLLECTION_PARAMS, code);
|
|
45261
45458
|
} catch (e) {
|
|
45262
45459
|
this._internal.mapFunc = void 0;
|
|
45263
45460
|
this._internal.mapCompileError = e.message || String(e);
|
|
@@ -47744,12 +47941,12 @@ var require_datetostring = __commonJS({
|
|
|
47744
47941
|
if (rendered2.indexOf(needle) === -1) return;
|
|
47745
47942
|
rendered2 = rendered2.split(needle).join(render2());
|
|
47746
47943
|
};
|
|
47747
|
-
const
|
|
47944
|
+
const named3 = (options) => new Intl.DateTimeFormat(locale, zone ? { ...options, timeZone: zone } : options).format(t);
|
|
47748
47945
|
const hours12 = (fields.hours + 11) % 12 + 1;
|
|
47749
47946
|
const meridiem = fields.hours < 12 ? "am" : "pm";
|
|
47750
|
-
substitute("dayName", () =>
|
|
47751
|
-
substitute("dayShort", () =>
|
|
47752
|
-
substitute("monthName", () =>
|
|
47947
|
+
substitute("dayName", () => named3({ weekday: "long" }));
|
|
47948
|
+
substitute("dayShort", () => named3({ weekday: "short" }));
|
|
47949
|
+
substitute("monthName", () => named3({ month: "long" }));
|
|
47753
47950
|
substitute("hours12", () => ("0" + hours12).slice(-2));
|
|
47754
47951
|
substitute("h12", () => String(hours12));
|
|
47755
47952
|
substitute("ampm", () => meridiem);
|
|
@@ -50437,9 +50634,9 @@ var init_EntityDecoder = __esm({
|
|
|
50437
50634
|
replacement = ncrResult;
|
|
50438
50635
|
tier = LIMIT_TIER_BASE;
|
|
50439
50636
|
} else {
|
|
50440
|
-
const
|
|
50441
|
-
replacement =
|
|
50442
|
-
tier =
|
|
50637
|
+
const resolved3 = this._resolveName(token);
|
|
50638
|
+
replacement = resolved3?.value;
|
|
50639
|
+
tier = resolved3?.tier;
|
|
50443
50640
|
}
|
|
50444
50641
|
if (replacement === void 0) {
|
|
50445
50642
|
i2++;
|
|
@@ -51117,7 +51314,7 @@ var init_DocTypeReader = __esm({
|
|
|
51117
51314
|
});
|
|
51118
51315
|
|
|
51119
51316
|
// ../../node_modules/anynum/digitTable.js
|
|
51120
|
-
var SCRIPT_ZEROS, NOT_DIGIT, HIGH_MAP, LOW_MAX, LOW_MIN, TABLE_OFFSET, TABLE_SIZE,
|
|
51317
|
+
var SCRIPT_ZEROS, NOT_DIGIT, HIGH_MAP, LOW_MAX, LOW_MIN, TABLE_OFFSET, TABLE_SIZE, TABLE2;
|
|
51121
51318
|
var init_digitTable = __esm({
|
|
51122
51319
|
"../../node_modules/anynum/digitTable.js"() {
|
|
51123
51320
|
SCRIPT_ZEROS = [
|
|
@@ -51257,12 +51454,12 @@ var init_digitTable = __esm({
|
|
|
51257
51454
|
LOW_MIN = 1632;
|
|
51258
51455
|
TABLE_OFFSET = LOW_MIN;
|
|
51259
51456
|
TABLE_SIZE = LOW_MAX - LOW_MIN + 1;
|
|
51260
|
-
|
|
51457
|
+
TABLE2 = new Uint8Array(TABLE_SIZE).fill(NOT_DIGIT);
|
|
51261
51458
|
for (const zero of SCRIPT_ZEROS) {
|
|
51262
51459
|
for (let d = 0; d < 10; d++) {
|
|
51263
51460
|
const cp = zero + d;
|
|
51264
51461
|
if (cp <= LOW_MAX) {
|
|
51265
|
-
|
|
51462
|
+
TABLE2[cp - TABLE_OFFSET] = d;
|
|
51266
51463
|
} else {
|
|
51267
51464
|
HIGH_MAP.set(cp, d);
|
|
51268
51465
|
}
|
|
@@ -51300,7 +51497,7 @@ function anynum(str4) {
|
|
|
51300
51497
|
}
|
|
51301
51498
|
continue;
|
|
51302
51499
|
}
|
|
51303
|
-
if (
|
|
51500
|
+
if (TABLE2[cc - TABLE_OFFSET] !== NOT_DIGIT || MINUS_SET.has(cc)) {
|
|
51304
51501
|
firstHit = i2;
|
|
51305
51502
|
break;
|
|
51306
51503
|
}
|
|
@@ -51338,7 +51535,7 @@ function anynum(str4) {
|
|
|
51338
51535
|
chars.push("-");
|
|
51339
51536
|
continue;
|
|
51340
51537
|
}
|
|
51341
|
-
const d =
|
|
51538
|
+
const d = TABLE2[cc - TABLE_OFFSET];
|
|
51342
51539
|
chars.push(d !== NOT_DIGIT ? String.fromCharCode(d + 48) : str4[i2]);
|
|
51343
51540
|
}
|
|
51344
51541
|
return chars.join("");
|
|
@@ -54286,9 +54483,9 @@ function firstOf(...values2) {
|
|
|
54286
54483
|
function toISODate(value2) {
|
|
54287
54484
|
const raw = text(value2).trim().replace(/\s*\([^)]*\)$/, "");
|
|
54288
54485
|
if (!raw) return null;
|
|
54289
|
-
const
|
|
54290
|
-
if (
|
|
54291
|
-
const zoned = !!
|
|
54486
|
+
const named3 = /\s([A-Z]{1,5})$/.exec(raw);
|
|
54487
|
+
if (named3 && ZONE_NAMES_READ.indexOf(named3[1]) === -1) return null;
|
|
54488
|
+
const zoned = !!named3 || /(?:Z|[+-]\d{2}:?\d{2})$/.test(raw);
|
|
54292
54489
|
const asUTC = zoned || /^\d{4}-\d{2}-\d{2}$/.test(raw) ? raw : /^\d{4}-\d{2}-\d{2}T/.test(raw) ? raw + "Z" : raw + " GMT";
|
|
54293
54490
|
const ms = Date.parse(asUTC);
|
|
54294
54491
|
return isNaN(ms) ? null : new Date(ms).toISOString();
|
|
@@ -57347,9 +57544,9 @@ function captureGroups(m) {
|
|
|
57347
57544
|
}
|
|
57348
57545
|
function namedCaptureGroups(m) {
|
|
57349
57546
|
const out = {};
|
|
57350
|
-
const
|
|
57351
|
-
if (
|
|
57352
|
-
for (const key in
|
|
57547
|
+
const named3 = m.groups;
|
|
57548
|
+
if (named3) {
|
|
57549
|
+
for (const key in named3) out[key] = named3[key] === void 0 ? "" : named3[key];
|
|
57353
57550
|
}
|
|
57354
57551
|
return out;
|
|
57355
57552
|
}
|
|
@@ -60947,6 +61144,7 @@ var require_globalstoresubscribenode = __commonJS({
|
|
|
60947
61144
|
description: "The watched value: one key gives that key, several give an object of just those keys, none gives the whole store",
|
|
60948
61145
|
group: "Data",
|
|
60949
61146
|
getter: function() {
|
|
61147
|
+
if (!this._internal.unsubscribe) return void 0;
|
|
60950
61148
|
return this.projectValue(globalStoreManager.getState(this._internal.storeName));
|
|
60951
61149
|
}
|
|
60952
61150
|
},
|
|
@@ -68282,8 +68480,8 @@ function sourceName(el) {
|
|
|
68282
68480
|
return label.length > 60 ? label.slice(0, 57) + "\u2026" : label || "item";
|
|
68283
68481
|
}
|
|
68284
68482
|
function zoneName(zone, el) {
|
|
68285
|
-
const
|
|
68286
|
-
if (
|
|
68483
|
+
const named3 = String(zone._internal.dropZoneName || "").trim();
|
|
68484
|
+
if (named3) return named3;
|
|
68287
68485
|
const label = el && el.getAttribute("aria-label");
|
|
68288
68486
|
if (label) return label;
|
|
68289
68487
|
const all = orderedZones(zone);
|
|
@@ -69189,6 +69387,133 @@ var init_tooltips = __esm({
|
|
|
69189
69387
|
}
|
|
69190
69388
|
});
|
|
69191
69389
|
|
|
69390
|
+
// ../noodl-viewer-react/src/keyboard-click.ts
|
|
69391
|
+
function holdsPressable(el) {
|
|
69392
|
+
return el.querySelector(PRESSABLE_INSIDE) !== null;
|
|
69393
|
+
}
|
|
69394
|
+
function clickIsWired(node) {
|
|
69395
|
+
if (!node.hasOutput("onClick")) return false;
|
|
69396
|
+
return reachesSomething(node.getOutput("onClick"), 0);
|
|
69397
|
+
}
|
|
69398
|
+
function reachesSomething(output, depth) {
|
|
69399
|
+
if (!output.hasConnections()) return false;
|
|
69400
|
+
if (!Array.isArray(output.connections)) return true;
|
|
69401
|
+
return output.connections.some((c) => !goesNowhere(c, depth));
|
|
69402
|
+
}
|
|
69403
|
+
function goesNowhere(connection, depth) {
|
|
69404
|
+
const target = connection.node;
|
|
69405
|
+
if (!target || target.name !== "Component Outputs" || typeof connection.inputPortName !== "string") return false;
|
|
69406
|
+
const owner = target.nodeScope?.componentOwner;
|
|
69407
|
+
if (!owner || depth > 16 || owner._internal?.creatorCallbacks) return false;
|
|
69408
|
+
if (typeof owner.hasOutput !== "function" || typeof owner.getOutput !== "function") return false;
|
|
69409
|
+
if (!owner.hasOutput(connection.inputPortName)) return true;
|
|
69410
|
+
return !reachesSomething(owner.getOutput(connection.inputPortName), depth + 1);
|
|
69411
|
+
}
|
|
69412
|
+
function isNativelyInteractive(el) {
|
|
69413
|
+
const tag = el.tagName;
|
|
69414
|
+
if (tag === "BUTTON" || tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA" || tag === "SUMMARY") return true;
|
|
69415
|
+
if ((tag === "A" || tag === "AREA") && el.hasAttribute("href")) return true;
|
|
69416
|
+
if ((tag === "VIDEO" || tag === "AUDIO") && el.hasAttribute("controls")) return true;
|
|
69417
|
+
return el.isContentEditable === true;
|
|
69418
|
+
}
|
|
69419
|
+
function isSpace(e) {
|
|
69420
|
+
return e.key === " " || e.key === "Spacebar";
|
|
69421
|
+
}
|
|
69422
|
+
function isOwnKey(el, e) {
|
|
69423
|
+
return e.target === el && !e.defaultPrevented && !e.altKey && !e.ctrlKey && !e.metaKey && !e.isComposing;
|
|
69424
|
+
}
|
|
69425
|
+
function mark(el) {
|
|
69426
|
+
let spaceArmed = false;
|
|
69427
|
+
const onKeyDown2 = (e) => {
|
|
69428
|
+
if (!isOwnKey(el, e)) return;
|
|
69429
|
+
if (e.key === "Enter") {
|
|
69430
|
+
e.preventDefault();
|
|
69431
|
+
if (!e.repeat) el.click();
|
|
69432
|
+
} else if (isSpace(e)) {
|
|
69433
|
+
e.preventDefault();
|
|
69434
|
+
if (!e.repeat) spaceArmed = true;
|
|
69435
|
+
}
|
|
69436
|
+
};
|
|
69437
|
+
const onKeyUp = (e) => {
|
|
69438
|
+
if (!isSpace(e)) return;
|
|
69439
|
+
const armed6 = spaceArmed;
|
|
69440
|
+
spaceArmed = false;
|
|
69441
|
+
if (armed6 && e.target === el && !e.defaultPrevented) el.click();
|
|
69442
|
+
};
|
|
69443
|
+
const m = { el, added: [], onKeyDown: onKeyDown2, onKeyUp, observer: null };
|
|
69444
|
+
if (isNativelyInteractive(el)) return m;
|
|
69445
|
+
refresh(m);
|
|
69446
|
+
if (typeof MutationObserver !== "undefined") {
|
|
69447
|
+
m.observer = new MutationObserver(() => refresh(m));
|
|
69448
|
+
m.observer.observe(el, {
|
|
69449
|
+
childList: true,
|
|
69450
|
+
subtree: true,
|
|
69451
|
+
attributes: true,
|
|
69452
|
+
attributeFilter: ["tabindex", "contenteditable", "href", "controls", "type"]
|
|
69453
|
+
});
|
|
69454
|
+
}
|
|
69455
|
+
return m;
|
|
69456
|
+
}
|
|
69457
|
+
function refresh(m) {
|
|
69458
|
+
const { el } = m;
|
|
69459
|
+
const want = !holdsPressable(el);
|
|
69460
|
+
if (want && !m.added.length) {
|
|
69461
|
+
if (!el.hasAttribute("tabindex")) {
|
|
69462
|
+
el.setAttribute("tabindex", "0");
|
|
69463
|
+
m.added.push("tabindex");
|
|
69464
|
+
}
|
|
69465
|
+
if (!el.hasAttribute("role")) {
|
|
69466
|
+
el.setAttribute("role", "button");
|
|
69467
|
+
m.added.push("role");
|
|
69468
|
+
}
|
|
69469
|
+
if (m.added.length) {
|
|
69470
|
+
el.setAttribute(KEYBOARD_CLICK_ATTRIBUTE, "");
|
|
69471
|
+
m.added.push(KEYBOARD_CLICK_ATTRIBUTE);
|
|
69472
|
+
el.addEventListener("keydown", m.onKeyDown);
|
|
69473
|
+
el.addEventListener("keyup", m.onKeyUp);
|
|
69474
|
+
}
|
|
69475
|
+
} else if (!want && m.added.length) {
|
|
69476
|
+
giveBack(m);
|
|
69477
|
+
}
|
|
69478
|
+
}
|
|
69479
|
+
function giveBack(m) {
|
|
69480
|
+
for (const name2 of m.added) m.el.removeAttribute(name2);
|
|
69481
|
+
m.added = [];
|
|
69482
|
+
m.el.removeEventListener("keydown", m.onKeyDown);
|
|
69483
|
+
m.el.removeEventListener("keyup", m.onKeyUp);
|
|
69484
|
+
}
|
|
69485
|
+
function unmark(m) {
|
|
69486
|
+
m.observer?.disconnect();
|
|
69487
|
+
giveBack(m);
|
|
69488
|
+
}
|
|
69489
|
+
function syncKeyboardClick(node) {
|
|
69490
|
+
const el = typeof node.getDOMElement === "function" ? node.getDOMElement() : null;
|
|
69491
|
+
const want = el && clickIsWired(node) ? el : null;
|
|
69492
|
+
const was = marked.get(node);
|
|
69493
|
+
if (was && was.el === want) return;
|
|
69494
|
+
if (was) {
|
|
69495
|
+
unmark(was);
|
|
69496
|
+
marked.delete(node);
|
|
69497
|
+
}
|
|
69498
|
+
if (want) marked.set(node, mark(want));
|
|
69499
|
+
}
|
|
69500
|
+
var KEYBOARD_CLICK_ATTRIBUTE, PRESSABLE_INSIDE, marked, KEYBOARD_CLICK_HOOKS;
|
|
69501
|
+
var init_keyboard_click = __esm({
|
|
69502
|
+
"../noodl-viewer-react/src/keyboard-click.ts"() {
|
|
69503
|
+
KEYBOARD_CLICK_ATTRIBUTE = "data-ndl-keyboard-click";
|
|
69504
|
+
PRESSABLE_INSIDE = 'button, input:not([type="hidden"]), select, textarea, summary, a[href], area[href], video[controls], audio[controls], [contenteditable=""], [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
69505
|
+
marked = /* @__PURE__ */ new WeakMap();
|
|
69506
|
+
KEYBOARD_CLICK_HOOKS = {
|
|
69507
|
+
onFirstConnectionAdded() {
|
|
69508
|
+
syncKeyboardClick(this);
|
|
69509
|
+
},
|
|
69510
|
+
onLastConnectionRemoved() {
|
|
69511
|
+
syncKeyboardClick(this);
|
|
69512
|
+
}
|
|
69513
|
+
};
|
|
69514
|
+
}
|
|
69515
|
+
});
|
|
69516
|
+
|
|
69192
69517
|
// ../noodl-viewer-react/src/node-shared-port-definitions.ts
|
|
69193
69518
|
function humanCorner(suffix) {
|
|
69194
69519
|
return suffix.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -69456,6 +69781,7 @@ var init_node_shared_port_definitions = __esm({
|
|
|
69456
69781
|
init_fontloader();
|
|
69457
69782
|
init_media_source();
|
|
69458
69783
|
init_tooltips();
|
|
69784
|
+
init_keyboard_click();
|
|
69459
69785
|
SIZE_MODES = ["explicit", "contentWidth", "contentHeight", "contentSize"];
|
|
69460
69786
|
node_shared_port_definitions_default = {
|
|
69461
69787
|
addInputProps: addInputProps2,
|
|
@@ -69963,7 +70289,9 @@ var init_node_shared_port_definitions = __esm({
|
|
|
69963
70289
|
description: "Fires when this element is clicked or tapped",
|
|
69964
70290
|
group: "Events",
|
|
69965
70291
|
type: "signal",
|
|
69966
|
-
propPath: "pointer"
|
|
70292
|
+
propPath: "pointer",
|
|
70293
|
+
...KEYBOARD_CLICK_HOOKS
|
|
70294
|
+
// P121-TWO003-GROUPKEYBOARD: wired, the element is a button to Tab and a screen reader
|
|
69967
70295
|
},
|
|
69968
70296
|
pointerDown: {
|
|
69969
70297
|
displayName: "Pointer Down",
|
|
@@ -72561,8 +72889,8 @@ function readColor(value2, depth = 0) {
|
|
|
72561
72889
|
const asVar = VAR_FN.exec(text3);
|
|
72562
72890
|
if (asVar) {
|
|
72563
72891
|
if (depth >= 8) return null;
|
|
72564
|
-
const
|
|
72565
|
-
if (
|
|
72892
|
+
const resolved3 = cssVariableValue(asVar[1]);
|
|
72893
|
+
if (resolved3) return readColor(resolved3, depth + 1);
|
|
72566
72894
|
if (asVar[2] !== void 0) return readColor(asVar[2], depth + 1);
|
|
72567
72895
|
return null;
|
|
72568
72896
|
}
|
|
@@ -73684,6 +74012,7 @@ function createNodeFromReactComponent(def2) {
|
|
|
73684
74012
|
}
|
|
73685
74013
|
if (element) syncDataAttributesOnElement(this);
|
|
73686
74014
|
if (element) elementChanged(this, element);
|
|
74015
|
+
syncKeyboardClick(this);
|
|
73687
74016
|
},
|
|
73688
74017
|
/**
|
|
73689
74018
|
* NDA-012 (Visual) check A3 — run an imperative action on the inner React component,
|
|
@@ -74110,6 +74439,7 @@ var init_react_component_node = __esm({
|
|
|
74110
74439
|
init_mergedeep();
|
|
74111
74440
|
init_node_shared_port_definitions();
|
|
74112
74441
|
init_node_transitions();
|
|
74442
|
+
init_keyboard_click();
|
|
74113
74443
|
ICON_SOURCE_DIAGNOSTIC = "visual/icon-source-not-an-icon";
|
|
74114
74444
|
DATA_ATTRIBUTE_NAME_PATTERN = "^data-[a-z0-9][a-z0-9._-]*$";
|
|
74115
74445
|
DATA_ATTRIBUTE_NAME = new RegExp(DATA_ATTRIBUTE_NAME_PATTERN);
|
|
@@ -76690,7 +77020,14 @@ var init_TextInput = __esm({
|
|
|
76690
77020
|
ref: props.useLabel ? void 0 : noodlRootRef(this.props.noodlNode),
|
|
76691
77021
|
...props.useLabel ? void 0 : dataAttributeProps(props.dom),
|
|
76692
77022
|
style: props.useLabel ? { ...clearedRootStyles(style2), ...inputWrapperStyle } : inputWrapperStyle,
|
|
76693
|
-
"noodl-style-tag": "inputWrapper"
|
|
77023
|
+
"noodl-style-tag": "inputWrapper",
|
|
77024
|
+
onMouseDown: (e) => {
|
|
77025
|
+
const field2 = this.ref.current;
|
|
77026
|
+
if (!field2 || !props.enabled || e.button !== 0 || field2.contains(e.target)) return;
|
|
77027
|
+
e.preventDefault();
|
|
77028
|
+
window.addEventListener("click", preventGlobalFocusChange, true);
|
|
77029
|
+
this.focus();
|
|
77030
|
+
}
|
|
76694
77031
|
},
|
|
76695
77032
|
props.useIcon && props.iconPlacement === "left" ? _renderIcon() : null,
|
|
76696
77033
|
inputContent,
|
|
@@ -80880,6 +81217,38 @@ function _typeName(t) {
|
|
|
80880
81217
|
if (typeof t === "object") return t.name;
|
|
80881
81218
|
else return t;
|
|
80882
81219
|
}
|
|
81220
|
+
function isInsideRow(node, row) {
|
|
81221
|
+
if (node === row) return true;
|
|
81222
|
+
let owner = (node.parentNodeScope || node.nodeScope)?.componentOwner;
|
|
81223
|
+
for (let depth = 0; owner && depth < 64; depth++) {
|
|
81224
|
+
if (owner === row) return true;
|
|
81225
|
+
const next2 = (owner.parentNodeScope || owner.nodeScope)?.componentOwner;
|
|
81226
|
+
if (next2 === owner) return false;
|
|
81227
|
+
owner = next2;
|
|
81228
|
+
}
|
|
81229
|
+
return false;
|
|
81230
|
+
}
|
|
81231
|
+
function settleRow(context, row) {
|
|
81232
|
+
const self2 = row;
|
|
81233
|
+
for (let pass = 0; pass < 10; pass++) {
|
|
81234
|
+
const dirty = context._dirtyNodes;
|
|
81235
|
+
if (!Array.isArray(dirty)) return;
|
|
81236
|
+
const mine = [];
|
|
81237
|
+
for (let i2 = 0; i2 < dirty.length; i2++) {
|
|
81238
|
+
const node = dirty[i2];
|
|
81239
|
+
if (node && node._dirty && !node._deleted && mine.indexOf(node) === -1 && isInsideRow(node, self2))
|
|
81240
|
+
mine.push(node);
|
|
81241
|
+
}
|
|
81242
|
+
if (mine.length === 0) return;
|
|
81243
|
+
for (let i2 = 0; i2 < mine.length; i2++) {
|
|
81244
|
+
try {
|
|
81245
|
+
mine[i2].update();
|
|
81246
|
+
} catch (e) {
|
|
81247
|
+
console.error(e);
|
|
81248
|
+
}
|
|
81249
|
+
}
|
|
81250
|
+
}
|
|
81251
|
+
}
|
|
80883
81252
|
var import_react16, import_runtime4, import_collection, import_model5, ITEMS_DIAGNOSTIC, defaultDynamicScript, ForEachDefinition, defaultMapCode, ForEachModule, foreach_default;
|
|
80884
81253
|
var init_foreach = __esm({
|
|
80885
81254
|
"../noodl-viewer-react/src/nodes/std-library/data/foreach.tsx"() {
|
|
@@ -81253,6 +81622,7 @@ var init_foreach = __esm({
|
|
|
81253
81622
|
}
|
|
81254
81623
|
}
|
|
81255
81624
|
};
|
|
81625
|
+
settleRow(this.context, itemNode);
|
|
81256
81626
|
const forEachActions = itemNode.nodeScope.getNodesWithType("For Each Actions");
|
|
81257
81627
|
for (let j = 0; j < forEachActions.length; j++) {
|
|
81258
81628
|
forEachActions[j].signalAdded();
|
|
@@ -81856,18 +82226,18 @@ function Columns(props) {
|
|
|
81856
82226
|
return () => observer.disconnect();
|
|
81857
82227
|
}, [masonry, children.length, containerWidth]);
|
|
81858
82228
|
const columnLayout = readColumnLayoutString(props.layoutString);
|
|
81859
|
-
const
|
|
81860
|
-
const breakpoint =
|
|
82229
|
+
const resolved3 = columnLayout === null ? null : resolveColumnLayout(columnLayout, props, containerWidth, children.length);
|
|
82230
|
+
const breakpoint = resolved3?.breakpoint ?? "Default";
|
|
81861
82231
|
(0, import_react17.useEffect)(() => {
|
|
81862
82232
|
props.onBreakpointChanged?.(breakpoint);
|
|
81863
82233
|
if (breakpoint === "Medium") props.onAtMedium?.();
|
|
81864
82234
|
else if (breakpoint === "Small") props.onAtSmall?.();
|
|
81865
82235
|
}, [breakpoint]);
|
|
81866
82236
|
if (!props.children) return null;
|
|
81867
|
-
if (
|
|
82237
|
+
if (resolved3 === null) {
|
|
81868
82238
|
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, props.children);
|
|
81869
82239
|
}
|
|
81870
|
-
const { layout, columnAmount, fractionSize } =
|
|
82240
|
+
const { layout, columnAmount, fractionSize } = resolved3;
|
|
81871
82241
|
columnAmountRef.current = columnAmount;
|
|
81872
82242
|
const columnLefts = masonry ? computeColumnOffsets(layout, fractionSize) : null;
|
|
81873
82243
|
const packed = masonry && masonryOffsets !== null && masonryOffsets.tops.length === children.length;
|
|
@@ -90070,10 +90440,16 @@ function Text(props) {
|
|
|
90070
90440
|
...pointerProps(props),
|
|
90071
90441
|
style: style2
|
|
90072
90442
|
},
|
|
90073
|
-
|
|
90443
|
+
style2.textOverflow === "ellipsis" ? (
|
|
90444
|
+
// P18-S112-FLEXELLIPSIS — the Text is `display: flex` (its default CSS, which Text Vertical Align's `alignItems`
|
|
90445
|
+
// needs), so its words were an anonymous flex item and `text-overflow` on the element drew no "…": Ellipsis
|
|
90446
|
+
// looked the same as Clip. The words go in a block of their own that may shrink to the box and draws the "…";
|
|
90447
|
+
// the element keeps its flex, so both alignments still place them.
|
|
90448
|
+
/* @__PURE__ */ import_react22.default.createElement("span", { style: { ...ELLIPSIS_LINE, overflow: style2.overflow } }, renderableText(props.text))
|
|
90449
|
+
) : renderableText(props.text)
|
|
90074
90450
|
);
|
|
90075
90451
|
}
|
|
90076
|
-
var import_react22;
|
|
90452
|
+
var import_react22, ELLIPSIS_LINE;
|
|
90077
90453
|
var init_Text = __esm({
|
|
90078
90454
|
"../noodl-viewer-react/src/components/visual/Text/Text.tsx"() {
|
|
90079
90455
|
import_react22 = __toESM(require_react());
|
|
@@ -90081,6 +90457,7 @@ var init_Text = __esm({
|
|
|
90081
90457
|
init_layout();
|
|
90082
90458
|
init_pointerlisteners();
|
|
90083
90459
|
init_noodl_root_ref();
|
|
90460
|
+
ELLIPSIS_LINE = { minWidth: 0, textOverflow: "ellipsis", whiteSpace: "nowrap" };
|
|
90084
90461
|
}
|
|
90085
90462
|
});
|
|
90086
90463
|
|
|
@@ -90454,7 +90831,6 @@ var init_Video = __esm({
|
|
|
90454
90831
|
...videoProps,
|
|
90455
90832
|
playsInline: true,
|
|
90456
90833
|
src,
|
|
90457
|
-
...pointerProps(this.props),
|
|
90458
90834
|
ref: (video) => {
|
|
90459
90835
|
this.video = video;
|
|
90460
90836
|
this.props.innerRef(video);
|
|
@@ -90473,7 +90849,7 @@ var init_Video = __esm({
|
|
|
90473
90849
|
this.canPlay = false;
|
|
90474
90850
|
}
|
|
90475
90851
|
setSourceObject(src) {
|
|
90476
|
-
if (this.video.srcObject !== src) {
|
|
90852
|
+
if (this.video && this.video.srcObject !== src) {
|
|
90477
90853
|
this.video.srcObject = src;
|
|
90478
90854
|
this.canPlay = false;
|
|
90479
90855
|
}
|
|
@@ -90579,6 +90955,7 @@ var init_Video = __esm({
|
|
|
90579
90955
|
CachedVideo,
|
|
90580
90956
|
{
|
|
90581
90957
|
...props.dom,
|
|
90958
|
+
...pointerProps(this.props),
|
|
90582
90959
|
className: withDefaultsClass(props.className, defaultsClass),
|
|
90583
90960
|
style: style2,
|
|
90584
90961
|
innerRef: (video) => {
|
|
@@ -97687,6 +98064,7 @@ var init_parentcomponentobject = __esm({
|
|
|
97687
98064
|
*/
|
|
97688
98065
|
nodeScopeDidInitialize() {
|
|
97689
98066
|
this.context.scheduleAfterUpdate(() => {
|
|
98067
|
+
if (this._deleted) return;
|
|
97690
98068
|
this._internal.resolutionIsLoud = true;
|
|
97691
98069
|
this.onComponentStateNodesChanged();
|
|
97692
98070
|
});
|
|
@@ -97812,8 +98190,8 @@ var init_parentcomponentobject = __esm({
|
|
|
97812
98190
|
const self2 = this.nodeScope.componentOwner;
|
|
97813
98191
|
const wanted = this._internal.targetComponent;
|
|
97814
98192
|
if (wanted) {
|
|
97815
|
-
const
|
|
97816
|
-
if (!
|
|
98193
|
+
const named3 = findAncestorWithName(self2, wanted);
|
|
98194
|
+
if (!named3) {
|
|
97817
98195
|
this._internal.parentComponentName = void 0;
|
|
97818
98196
|
resolvedTargets2.report(this, void 0);
|
|
97819
98197
|
this.reportMiss("parent-component-object/target-not-found", 'No ancestor component named "' + wanted + '"', {
|
|
@@ -97822,7 +98200,7 @@ var init_parentcomponentobject = __esm({
|
|
|
97822
98200
|
});
|
|
97823
98201
|
return;
|
|
97824
98202
|
}
|
|
97825
|
-
if (!COMPONENT_OBJECT_TYPES.some((type) =>
|
|
98203
|
+
if (!COMPONENT_OBJECT_TYPES.some((type) => named3.nodeScope.getNodesWithType(type).length > 0)) {
|
|
97826
98204
|
this._internal.parentComponentName = void 0;
|
|
97827
98205
|
resolvedTargets2.report(this, void 0);
|
|
97828
98206
|
this.reportMiss(
|
|
@@ -97832,11 +98210,11 @@ var init_parentcomponentobject = __esm({
|
|
|
97832
98210
|
);
|
|
97833
98211
|
return;
|
|
97834
98212
|
}
|
|
97835
|
-
this._internal.parentComponentName =
|
|
98213
|
+
this._internal.parentComponentName = named3.name;
|
|
97836
98214
|
this._internal.lastMissCode = void 0;
|
|
97837
98215
|
this._internal.lastError = void 0;
|
|
97838
|
-
resolvedTargets2.report(this,
|
|
97839
|
-
return "componentState" +
|
|
98216
|
+
resolvedTargets2.report(this, named3.name);
|
|
98217
|
+
return "componentState" + named3.getInstanceId();
|
|
97840
98218
|
}
|
|
97841
98219
|
const parent = findAncestorWithComponentObject(self2);
|
|
97842
98220
|
if (!parent) {
|
|
@@ -98015,22 +98393,22 @@ var init_setparentcomponentobjectproperties = __esm({
|
|
|
98015
98393
|
const self2 = this.nodeScope.componentOwner;
|
|
98016
98394
|
const wanted = this._internal.targetComponent;
|
|
98017
98395
|
if (wanted) {
|
|
98018
|
-
const
|
|
98019
|
-
if (!
|
|
98396
|
+
const named3 = findAncestorWithName(self2, wanted);
|
|
98397
|
+
if (!named3) {
|
|
98020
98398
|
return {
|
|
98021
98399
|
missCode: "set-parent-component-object-properties/target-not-found",
|
|
98022
98400
|
missMessage: 'No ancestor component named "' + wanted + '"',
|
|
98023
98401
|
missDetail: { target: wanted, ancestors: componentAncestorNames(self2) }
|
|
98024
98402
|
};
|
|
98025
98403
|
}
|
|
98026
|
-
if (!COMPONENT_OBJECT_TYPES.some((type) =>
|
|
98404
|
+
if (!COMPONENT_OBJECT_TYPES.some((type) => named3.nodeScope.getNodesWithType(type).length > 0)) {
|
|
98027
98405
|
return {
|
|
98028
98406
|
missCode: "set-parent-component-object-properties/target-has-no-object",
|
|
98029
98407
|
missMessage: 'The component "' + wanted + '" has no Component Object node',
|
|
98030
98408
|
missDetail: { target: wanted }
|
|
98031
98409
|
};
|
|
98032
98410
|
}
|
|
98033
|
-
return { id: "componentState" +
|
|
98411
|
+
return { id: "componentState" + named3.getInstanceId(), name: named3.name };
|
|
98034
98412
|
}
|
|
98035
98413
|
const parent = findAncestorWithComponentObject(self2);
|
|
98036
98414
|
if (!parent) {
|
|
@@ -100335,15 +100713,15 @@ var init_closepopup = __esm({
|
|
|
100335
100713
|
const candidates = popups.map((component) => component.name);
|
|
100336
100714
|
const wanted = this._internal.targetComponent;
|
|
100337
100715
|
if (wanted) {
|
|
100338
|
-
const
|
|
100339
|
-
if (!
|
|
100716
|
+
const named3 = popups.find((component) => component.name === wanted);
|
|
100717
|
+
if (!named3) {
|
|
100340
100718
|
return {
|
|
100341
100719
|
candidates,
|
|
100342
100720
|
missCode: "close-popup/target-not-found",
|
|
100343
100721
|
missMessage: 'This node is not inside a popup named "' + wanted + '"' + (candidates.length ? " \u2014 it is inside: " + candidates.join(", ") : "")
|
|
100344
100722
|
};
|
|
100345
100723
|
}
|
|
100346
|
-
return { popup:
|
|
100724
|
+
return { popup: named3, close: named3._popupCloseHandler, candidates };
|
|
100347
100725
|
}
|
|
100348
100726
|
if (this._internal.closeCallback) {
|
|
100349
100727
|
return { popup: popups[0], close: this._internal.closeCallback, candidates };
|
|
@@ -100755,7 +101133,9 @@ var init_userservice = __esm({
|
|
|
100755
101133
|
this.adapter = new ParseAuthAdapter({
|
|
100756
101134
|
// The module-scope serialiser, exactly as before — `_User` properties have
|
|
100757
101135
|
// always been serialised against the process-wide Model store.
|
|
100758
|
-
|
|
101136
|
+
// P115-HST006-VIEWERTS2554: the third argument (the model scope) is named, undefined, as JavaScript already
|
|
101137
|
+
// passed it: the runtime's generated types declare all three, and the production viewer build type-checks.
|
|
101138
|
+
serializeObject: (data, collectionName2) => import_cloudstore2.default._serializeObject(data, collectionName2, void 0)
|
|
100759
101139
|
});
|
|
100760
101140
|
this._bridge(this.adapter);
|
|
100761
101141
|
if (this._consumeAuthReturn()) return;
|
|
@@ -100808,12 +101188,12 @@ var init_userservice = __esm({
|
|
|
100808
101188
|
*/
|
|
100809
101189
|
_handle(backendId) {
|
|
100810
101190
|
if (backendId && backendId !== ACTIVE_BACKEND) {
|
|
100811
|
-
const
|
|
100812
|
-
return
|
|
101191
|
+
const named3 = resolveBackendFromRuntime(backendId);
|
|
101192
|
+
return named3 ? named3.handle : void 0;
|
|
100813
101193
|
}
|
|
100814
101194
|
if (!this.endpoint) {
|
|
100815
|
-
const
|
|
100816
|
-
if (
|
|
101195
|
+
const resolved3 = resolveBackendFromRuntime(ACTIVE_BACKEND);
|
|
101196
|
+
if (resolved3) return resolved3.handle;
|
|
100817
101197
|
}
|
|
100818
101198
|
return {
|
|
100819
101199
|
id: "_active_",
|
|
@@ -102063,7 +102443,7 @@ var init_signinwith = __esm({
|
|
|
102063
102443
|
const tokens = [this.beginOutcome()];
|
|
102064
102444
|
if (state2.succeeded) {
|
|
102065
102445
|
this._internal.notice = state2.notice;
|
|
102066
|
-
this._internal.error =
|
|
102446
|
+
this._internal.error = "";
|
|
102067
102447
|
this.flagOutputDirty("notice");
|
|
102068
102448
|
this.flagOutputDirty("error");
|
|
102069
102449
|
reportOutcomes(this, tokens, "done");
|
|
@@ -111396,9 +111776,9 @@ var require_fast_uri = __commonJS({
|
|
|
111396
111776
|
}
|
|
111397
111777
|
function resolve5(baseURI, relativeURI, options) {
|
|
111398
111778
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
111399
|
-
const
|
|
111779
|
+
const resolved3 = resolveComponent(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
111400
111780
|
schemelessOptions.skipEscape = true;
|
|
111401
|
-
return serialize(
|
|
111781
|
+
return serialize(resolved3, schemelessOptions);
|
|
111402
111782
|
}
|
|
111403
111783
|
function resolveComponent(base, relative2, options, skipNormalization) {
|
|
111404
111784
|
const target = {};
|
|
@@ -164973,7 +165353,7 @@ var node_catalog_default = {
|
|
|
164973
165353
|
"always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
|
|
164974
165354
|
],
|
|
164975
165355
|
visible: [
|
|
164976
|
-
"always: shown or hidden at
|
|
165356
|
+
"always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
|
|
164977
165357
|
]
|
|
164978
165358
|
},
|
|
164979
165359
|
warnings: {
|
|
@@ -167158,7 +167538,7 @@ var node_catalog_default = {
|
|
|
167158
167538
|
"always: the page, or the scrolling Group holding it, scrolls until the box can be seen"
|
|
167159
167539
|
],
|
|
167160
167540
|
visible: [
|
|
167161
|
-
"always: shown or hidden at
|
|
167541
|
+
"always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
|
|
167162
167542
|
]
|
|
167163
167543
|
},
|
|
167164
167544
|
warnings: {
|
|
@@ -169770,7 +170150,7 @@ var node_catalog_default = {
|
|
|
169770
170150
|
"always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
|
|
169771
170151
|
],
|
|
169772
170152
|
visible: [
|
|
169773
|
-
"always: shown or hidden at
|
|
170153
|
+
"always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
|
|
169774
170154
|
]
|
|
169775
170155
|
},
|
|
169776
170156
|
warnings: {
|
|
@@ -171952,7 +172332,7 @@ var node_catalog_default = {
|
|
|
171952
172332
|
"always: the page, or the scrolling Group holding it, scrolls until the button can be seen"
|
|
171953
172333
|
],
|
|
171954
172334
|
visible: [
|
|
171955
|
-
"always: shown or hidden at
|
|
172335
|
+
"always: shown or hidden at once, its space kept; hidden, it takes no click and a Focus does not reach it"
|
|
171956
172336
|
]
|
|
171957
172337
|
},
|
|
171958
172338
|
warnings: {
|
|
@@ -174357,7 +174737,7 @@ var node_catalog_default = {
|
|
|
174357
174737
|
"always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
|
|
174358
174738
|
],
|
|
174359
174739
|
visible: [
|
|
174360
|
-
"always: shown or hidden at
|
|
174740
|
+
"always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
|
|
174361
174741
|
]
|
|
174362
174742
|
},
|
|
174363
174743
|
warnings: {
|
|
@@ -177227,7 +177607,7 @@ var node_catalog_default = {
|
|
|
177227
177607
|
"always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
|
|
177228
177608
|
],
|
|
177229
177609
|
visible: [
|
|
177230
|
-
"always: shown or hidden at
|
|
177610
|
+
"always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
|
|
177231
177611
|
],
|
|
177232
177612
|
opacity: [
|
|
177233
177613
|
"always: how see-through it is; at exactly 0 it takes no pointer, and an act goes to what is behind it"
|
|
@@ -182069,7 +182449,7 @@ var node_catalog_default = {
|
|
|
182069
182449
|
},
|
|
182070
182450
|
isSignal: false,
|
|
182071
182451
|
default: false,
|
|
182072
|
-
description: "Whether a request with no valid session token is allowed to run this function at all"
|
|
182452
|
+
description: "Whether a request with no valid session token is allowed to run this function at all. A run the app starts itself \u2014 a schedule, a row change, a run from Studio \u2014 is always allowed and sees nobody signed in; a webhook is a request like any other"
|
|
182073
182453
|
},
|
|
182074
182454
|
{
|
|
182075
182455
|
name: "params",
|
|
@@ -184924,11 +185304,11 @@ var TokenResolver = class _TokenResolver {
|
|
|
184924
185304
|
}
|
|
184925
185305
|
const token = this.tokens.get(tokenName);
|
|
184926
185306
|
if (!token) return void 0;
|
|
184927
|
-
const
|
|
184928
|
-
if (
|
|
184929
|
-
this.cache.set(tokenName,
|
|
185307
|
+
const resolved3 = this._resolveValue(token.value, depth);
|
|
185308
|
+
if (resolved3 !== void 0) {
|
|
185309
|
+
this.cache.set(tokenName, resolved3);
|
|
184930
185310
|
}
|
|
184931
|
-
return
|
|
185311
|
+
return resolved3;
|
|
184932
185312
|
}
|
|
184933
185313
|
/**
|
|
184934
185314
|
* P102 CMP-001 §3 — resolve every `var()` **inside** a value, so a preview can paint it.
|
|
@@ -185603,6 +185983,13 @@ var CommentsModel = class extends import_model15.default {
|
|
|
185603
185983
|
|
|
185604
185984
|
// ../noodl-editor/src/editor/src/models/warningsmodel.ts
|
|
185605
185985
|
var import_model16 = __toESM(require_model());
|
|
185986
|
+
function sameWarning(a, b) {
|
|
185987
|
+
try {
|
|
185988
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
185989
|
+
} catch {
|
|
185990
|
+
return false;
|
|
185991
|
+
}
|
|
185992
|
+
}
|
|
185606
185993
|
var WarningsModel = class _WarningsModel extends import_model16.default {
|
|
185607
185994
|
constructor() {
|
|
185608
185995
|
super();
|
|
@@ -185615,13 +186002,23 @@ var WarningsModel = class _WarningsModel extends import_model16.default {
|
|
|
185615
186002
|
static {
|
|
185616
186003
|
this.instance = new _WarningsModel();
|
|
185617
186004
|
}
|
|
186005
|
+
/**
|
|
186006
|
+
* P132-HIDDENPANELCHURN: a set that changes nothing says nothing. `readNameList` clears its warning on every read,
|
|
186007
|
+
* and the Components panel reads page info (so names) on every `warningsChanged`: when a clear of a warning that was
|
|
186008
|
+
* not there still announced a change, the two fed each other once per `setTimeout(1)`, ~480 times a second, for as
|
|
186009
|
+
* long as a project was open (the panel, the top bar and every mounted dialog re-rendering each time).
|
|
186010
|
+
* The same object set again still announces: its owner may have changed it in place.
|
|
186011
|
+
*/
|
|
185618
186012
|
setWarning(ref, warning) {
|
|
185619
186013
|
var w = this.getWarningsForRef(ref, warning !== void 0);
|
|
185620
186014
|
if (!warning) {
|
|
185621
|
-
if (w
|
|
186015
|
+
if (!w || w[ref.key] === void 0) return;
|
|
186016
|
+
delete w[ref.key];
|
|
185622
186017
|
} else {
|
|
185623
186018
|
warning.level = warning.level || "warning";
|
|
186019
|
+
const had = w[ref.key];
|
|
185624
186020
|
w[ref.key] = { ref, warning };
|
|
186021
|
+
if (had && had.warning !== warning && sameWarning(had.warning, warning)) return;
|
|
185625
186022
|
}
|
|
185626
186023
|
this.scheduleNotifyChanged();
|
|
185627
186024
|
}
|
|
@@ -187095,8 +187492,8 @@ function renderMarkdown(md) {
|
|
|
187095
187492
|
continue;
|
|
187096
187493
|
}
|
|
187097
187494
|
if (lines.every((l) => /^\s*>\s?/.test(l))) {
|
|
187098
|
-
const
|
|
187099
|
-
html.push(`<blockquote>${renderMarkdown(
|
|
187495
|
+
const quoted2 = lines.map((l) => l.replace(/^\s*>\s?/, "")).join("\n");
|
|
187496
|
+
html.push(`<blockquote>${renderMarkdown(quoted2)}</blockquote>`);
|
|
187100
187497
|
continue;
|
|
187101
187498
|
}
|
|
187102
187499
|
if (lines.every((l) => /^\s*[-*]\s+/.test(l))) {
|
|
@@ -191683,11 +192080,11 @@ var ParameterValueResolver = class {
|
|
|
191683
192080
|
* ```
|
|
191684
192081
|
*/
|
|
191685
192082
|
static toString(paramValue) {
|
|
191686
|
-
const
|
|
191687
|
-
if (typeof
|
|
192083
|
+
const resolved3 = this.resolve(paramValue, "display" /* Display */);
|
|
192084
|
+
if (typeof resolved3 === "object" && resolved3 !== null) {
|
|
191688
192085
|
return "";
|
|
191689
192086
|
}
|
|
191690
|
-
return String(
|
|
192087
|
+
return String(resolved3 ?? "");
|
|
191691
192088
|
}
|
|
191692
192089
|
/**
|
|
191693
192090
|
* Safely converts any parameter value to a number for display.
|
|
@@ -191706,15 +192103,15 @@ var ParameterValueResolver = class {
|
|
|
191706
192103
|
* ```
|
|
191707
192104
|
*/
|
|
191708
192105
|
static toNumber(paramValue) {
|
|
191709
|
-
const
|
|
191710
|
-
if (typeof
|
|
192106
|
+
const resolved3 = this.resolve(paramValue, "display" /* Display */);
|
|
192107
|
+
if (typeof resolved3 === "object" && resolved3 !== null) {
|
|
191711
192108
|
return void 0;
|
|
191712
192109
|
}
|
|
191713
192110
|
const rawValue = isExpressionParameter(paramValue) ? paramValue.fallback : paramValue;
|
|
191714
192111
|
if (rawValue === null || rawValue === void 0) {
|
|
191715
192112
|
return void 0;
|
|
191716
192113
|
}
|
|
191717
|
-
const num = Number(
|
|
192114
|
+
const num = Number(resolved3);
|
|
191718
192115
|
return isNaN(num) ? void 0 : num;
|
|
191719
192116
|
}
|
|
191720
192117
|
/**
|
|
@@ -191734,11 +192131,11 @@ var ParameterValueResolver = class {
|
|
|
191734
192131
|
* ```
|
|
191735
192132
|
*/
|
|
191736
192133
|
static toBoolean(paramValue) {
|
|
191737
|
-
const
|
|
191738
|
-
if (typeof
|
|
192134
|
+
const resolved3 = this.resolve(paramValue, "display" /* Display */);
|
|
192135
|
+
if (typeof resolved3 === "object" && resolved3 !== null) {
|
|
191739
192136
|
return false;
|
|
191740
192137
|
}
|
|
191741
|
-
return Boolean(
|
|
192138
|
+
return Boolean(resolved3);
|
|
191742
192139
|
}
|
|
191743
192140
|
/**
|
|
191744
192141
|
* Checks if a parameter value is an expression parameter.
|
|
@@ -191784,7 +192181,7 @@ var NodeGraphNode = class _NodeGraphNode extends import_model22.default {
|
|
|
191784
192181
|
}
|
|
191785
192182
|
/** Get the label of the node */
|
|
191786
192183
|
get label() {
|
|
191787
|
-
if (!this._label) return this.type.labelForNode(this);
|
|
192184
|
+
if (!this._label) return this.derivedTitle ?? this.type.labelForNode(this);
|
|
191788
192185
|
return this._label;
|
|
191789
192186
|
}
|
|
191790
192187
|
/** Set the label of the node */
|
|
@@ -191792,6 +192189,12 @@ var NodeGraphNode = class _NodeGraphNode extends import_model22.default {
|
|
|
191792
192189
|
this._label = value2;
|
|
191793
192190
|
this.notifyListeners("labelChanged");
|
|
191794
192191
|
}
|
|
192192
|
+
/** Set the derived title. `undefined` clears it. */
|
|
192193
|
+
setDerivedTitle(title) {
|
|
192194
|
+
if (this.derivedTitle === title) return;
|
|
192195
|
+
this.derivedTitle = title;
|
|
192196
|
+
this.notifyListeners("derivedTitleChanged");
|
|
192197
|
+
}
|
|
191795
192198
|
/** Set the runtime sub-label. `undefined` clears it. */
|
|
191796
192199
|
setRuntimeSubLabel(subLabel) {
|
|
191797
192200
|
if (this.runtimeSubLabel === subLabel) return;
|
|
@@ -195296,8 +195699,8 @@ function readDeployedRoots(outDir) {
|
|
|
195296
195699
|
};
|
|
195297
195700
|
add(data.components);
|
|
195298
195701
|
const bundleDir = path4.join(outDir, "noodl_bundles");
|
|
195299
|
-
const
|
|
195300
|
-
for (const id of
|
|
195702
|
+
const named3 = Object.keys(data.componentIndex ?? {}).filter((id) => id !== "root");
|
|
195703
|
+
for (const id of named3) {
|
|
195301
195704
|
const file = path4.join(bundleDir, `${id}.json`);
|
|
195302
195705
|
if (fs3.existsSync(file)) {
|
|
195303
195706
|
add(JSON.parse(fs3.readFileSync(file, "utf8")));
|
|
@@ -195309,7 +195712,7 @@ function readDeployedRoots(outDir) {
|
|
|
195309
195712
|
}
|
|
195310
195713
|
}
|
|
195311
195714
|
if (fs3.existsSync(bundleDir)) {
|
|
195312
|
-
const live = new Set(
|
|
195715
|
+
const live = new Set(named3.map((id) => `${id}.json`));
|
|
195313
195716
|
reading.staleBundles = fs3.readdirSync(bundleDir).filter((file) => file.endsWith(".json") && !live.has(file)).sort();
|
|
195314
195717
|
}
|
|
195315
195718
|
return reading;
|
|
@@ -195406,9 +195809,9 @@ function walk2(value2, path10, seen) {
|
|
|
195406
195809
|
const c = walk2(item, `${path10}[${i2}]`, seen);
|
|
195407
195810
|
return c === void 0 ? null : c;
|
|
195408
195811
|
});
|
|
195409
|
-
const
|
|
195410
|
-
if (typeof
|
|
195411
|
-
const id =
|
|
195812
|
+
const named3 = obj;
|
|
195813
|
+
if (typeof named3.getId === "function") {
|
|
195814
|
+
const id = named3.getId();
|
|
195412
195815
|
if (typeof id === "string") return { $array: id, items };
|
|
195413
195816
|
}
|
|
195414
195817
|
return items;
|
|
@@ -198219,12 +198622,12 @@ function formatDate(t, formatString, timeZone, localeTag) {
|
|
|
198219
198622
|
if (rendered2.indexOf(needle) === -1) return;
|
|
198220
198623
|
rendered2 = rendered2.split(needle).join(render2());
|
|
198221
198624
|
};
|
|
198222
|
-
const
|
|
198625
|
+
const named3 = (options) => new Intl.DateTimeFormat(locale, zone ? { ...options, timeZone: zone } : options).format(date);
|
|
198223
198626
|
const hours12 = (fields.hours + 11) % 12 + 1;
|
|
198224
198627
|
const meridiem = fields.hours < 12 ? "am" : "pm";
|
|
198225
|
-
substitute("dayName", () =>
|
|
198226
|
-
substitute("dayShort", () =>
|
|
198227
|
-
substitute("monthName", () =>
|
|
198628
|
+
substitute("dayName", () => named3({ weekday: "long" }));
|
|
198629
|
+
substitute("dayShort", () => named3({ weekday: "short" }));
|
|
198630
|
+
substitute("monthName", () => named3({ month: "long" }));
|
|
198228
198631
|
substitute("hours12", () => ("0" + hours12).slice(-2));
|
|
198229
198632
|
substitute("h12", () => String(hours12));
|
|
198230
198633
|
substitute("ampm", () => meridiem);
|
|
@@ -199194,7 +199597,10 @@ var invocations = [
|
|
|
199194
199597
|
{ headers: { "X-Parse-Session-Token": "t1", origin: "null", host: "h" } },
|
|
199195
199598
|
{ headers: { "x-parse-session-token": "t1" }, body: '{"a":null}', at: 100 },
|
|
199196
199599
|
{ headers: { host: "internal:8577", "x-forwarded-host": "public.example.com", "x-forwarded-proto": "https, http" }, body: '{"total":"7"}' },
|
|
199197
|
-
{ headers: { origin: ["https://app.example.com/", "https://b.example"], "x-forwarded-proto": "jAvascript", host: "h" }, body: "{}" }
|
|
199600
|
+
{ headers: { origin: ["https://app.example.com/", "https://b.example"], "x-forwarded-proto": "jAvascript", host: "h" }, body: "{}" },
|
|
199601
|
+
{ headers: {}, body: '{"total":3}', startedByApp: true },
|
|
199602
|
+
{ headers: { "x-parse-session-token": "t1" }, body: "{}", startedByApp: true },
|
|
199603
|
+
{ headers: { startedbyapp: "true" }, body: '{"startedByApp":true}' }
|
|
199198
199604
|
];
|
|
199199
199605
|
var CLOUD = { appId: "app", masterKey: "mk", endpoint: "https://be.example" };
|
|
199200
199606
|
var HOSTS3 = [{}];
|
|
@@ -199205,7 +199611,7 @@ for (const invocation of invocations) {
|
|
|
199205
199611
|
HOSTS3.push({ invocation: invocations[0], cloudServices: { ...CLOUD, runId: "run-1" } });
|
|
199206
199612
|
var CloudRequest = defineNode({
|
|
199207
199613
|
type: "noodl.cloud.request",
|
|
199208
|
-
version:
|
|
199614
|
+
version: 4,
|
|
199209
199615
|
changes: [
|
|
199210
199616
|
{
|
|
199211
199617
|
version: 2,
|
|
@@ -199218,6 +199624,12 @@ var CloudRequest = defineNode({
|
|
|
199218
199624
|
says: "User Id is text (it carries the id of the person the session token resolved to). It was declared a flag, so a wire into a Number read the id as NaN and the canvas offered it to a signal input",
|
|
199219
199625
|
row: "P107-S97-USERIDBOOLEAN (the Beta sweep s6)",
|
|
199220
199626
|
migration: { none: "No saved wire stops connecting: measured 106 wires from User Id in 13,839 project files, 70 into script inputs (any type), 35 into text ports, 1 into a record field, none into a signal" }
|
|
199627
|
+
},
|
|
199628
|
+
{
|
|
199629
|
+
version: 4,
|
|
199630
|
+
says: "A run the app starts itself \u2014 a schedule, a row change, a run from Studio \u2014 is not refused when Allow Unauthenticated is off: it runs with nobody signed in. It was refused, so a weekly job could only run a function opened to everyone. A webhook and a direct call are refused as before",
|
|
199631
|
+
row: "P127-BKO006-SCHEDULEAUTH (Richard ruled 2026-10-27: a run the app starts itself counts as the app)",
|
|
199632
|
+
migration: { none: "Nothing a project stores changes: only a run the backend marks as started by the app gets a different answer, and it gets the one its author had to open the function to everyone to get" }
|
|
199221
199633
|
}
|
|
199222
199634
|
],
|
|
199223
199635
|
source: "packages/noodl-viewer-cloud/src/nodes/cloud/request.ts; packages/noodl-viewer-cloud/src/nodes/cloud/requestContract.ts; packages/noodl-viewer-cloud/src/nodes/cloud/requestOrigin.ts; packages/noodl-viewer-cloud/src/services/userservice.js",
|
|
@@ -199244,7 +199656,7 @@ var CloudRequest = defineNode({
|
|
|
199244
199656
|
state: { contract: {}, authenticated: void 0, authUserId: void 0, origin: void 0, requestParameters: {}, waiting: void 0 },
|
|
199245
199657
|
inputs: {
|
|
199246
199658
|
// :154-163 — held raw, read when the request comes and again when its lookup fails
|
|
199247
|
-
allowNoAuth: { type: "boolean", default: false, coerce: "none", displayName: "Allow Unauthenticated", group: "General", description: "Whether a request with no valid session token is allowed to run this function at all", examples: [true, false, "false", 1] },
|
|
199659
|
+
allowNoAuth: { type: "boolean", default: false, coerce: "none", displayName: "Allow Unauthenticated", group: "General", description: "Whether a request with no valid session token is allowed to run this function at all. A run the app starts itself \u2014 a schedule, a row change, a run from Studio \u2014 is always allowed and sees nobody signed in; a webhook is a request like any other", examples: [true, false, "false", 1] },
|
|
199248
199660
|
// :164-172 — held raw
|
|
199249
199661
|
params: { type: "stringlist", coerce: "none", editOnly: true, group: "Parameters", description: "Names to pull out of the request body, each becoming an output \u2014 and a Type, Required and Default row to declare what it is", examples: ["total", "total,a", "a,0", "0,1", ""] }
|
|
199250
199662
|
},
|
|
@@ -199291,7 +199703,7 @@ var CloudRequest = defineNode({
|
|
|
199291
199703
|
}
|
|
199292
199704
|
const waiting = { params, headers: req.headers };
|
|
199293
199705
|
if (!token) {
|
|
199294
|
-
if (!i2.allowNoAuth) return { send: [], answers: [{ op: "refuse", reason: UNAUTHENTICATED }] };
|
|
199706
|
+
if (!i2.allowNoAuth && req.startedByApp !== true) return { send: [], answers: [{ op: "refuse", reason: UNAUTHENTICATED }] };
|
|
199295
199707
|
return proceed(s, params, req.headers, i2, w, { set: {}, send: [] });
|
|
199296
199708
|
}
|
|
199297
199709
|
const cloud = w.hostCloud();
|
|
@@ -199770,6 +200182,7 @@ function selectedClass(params, context) {
|
|
|
199770
200182
|
function shownFields(klass, skipRelations) {
|
|
199771
200183
|
return Object.entries(klass?.fields ?? {}).filter(([field2, decl]) => field2 !== "ACL" && !(skipRelations && decl.relation !== void 0));
|
|
199772
200184
|
}
|
|
200185
|
+
var RECORD_BUILT_IN_DATES2 = Object.freeze(["createdAt", "updatedAt"]);
|
|
199773
200186
|
function onParseWire(context) {
|
|
199774
200187
|
const type = context.schema?.backendType;
|
|
199775
200188
|
return type === void 0 || type === "parse" || type === "nodegx";
|
|
@@ -202310,9 +202723,9 @@ var ZONE_NAMES_READ2 = ["UT", "UTC", "GMT", "Z", "EST", "EDT", "CST", "CDT", "MS
|
|
|
202310
202723
|
function toISODate2(value2) {
|
|
202311
202724
|
const raw = text2(value2).trim().replace(/\s*\([^)]*\)$/, "");
|
|
202312
202725
|
if (!raw) return null;
|
|
202313
|
-
const
|
|
202314
|
-
if (
|
|
202315
|
-
const zoned = !!
|
|
202726
|
+
const named3 = /\s([A-Z]{1,5})$/.exec(raw);
|
|
202727
|
+
if (named3 && ZONE_NAMES_READ2.indexOf(named3[1]) === -1) return null;
|
|
202728
|
+
const zoned = !!named3 || /(?:Z|[+-]\d{2}:?\d{2})$/.test(raw);
|
|
202316
202729
|
const asUTC = zoned || /^\d{4}-\d{2}-\d{2}$/.test(raw) ? raw : /^\d{4}-\d{2}-\d{2}T/.test(raw) ? raw + "Z" : raw + " GMT";
|
|
202317
202730
|
const ms = Date.parse(asUTC);
|
|
202318
202731
|
return isNaN(ms) ? null : new Date(ms).toISOString();
|
|
@@ -203105,6 +203518,18 @@ function growChange(version) {
|
|
|
203105
203518
|
};
|
|
203106
203519
|
}
|
|
203107
203520
|
|
|
203521
|
+
// ../nodegx-node-spec/src/nodes/visible-at-once.ts
|
|
203522
|
+
function visibleAtOnceChange(version) {
|
|
203523
|
+
return {
|
|
203524
|
+
version,
|
|
203525
|
+
says: "No app does anything differently. Visible shows or hides the control at once: a Focus sent in the same moment as Visible going on reaches it (Focused fires), and one sent as Visible goes off does nothing. The version before said Visible waited for the next paint, so it lost the first Focus and kept the second; the runtime never did either",
|
|
203526
|
+
row: "BETA-S7-DROPDOWNFOCUSDIVERGE",
|
|
203527
|
+
migration: {
|
|
203528
|
+
none: "The runtime did not change; only the spec stopped saying Visible waits for the next paint. No stored project changes"
|
|
203529
|
+
}
|
|
203530
|
+
};
|
|
203531
|
+
}
|
|
203532
|
+
|
|
203108
203533
|
// ../nodegx-node-spec/src/nodes/button.ts
|
|
203109
203534
|
var NONE = { send: [] };
|
|
203110
203535
|
var Button3 = defineNode({
|
|
@@ -203113,8 +203538,9 @@ var Button3 = defineNode({
|
|
|
203113
203538
|
// v3 (P109 ISL-031, P107-D30 ruled "Reset and announce"): a control leaving the page (Mounted off) takes Focused, Hover and Pressed with it — each goes false, sent if it was true, with Blurred and Hover End for the ones that were on
|
|
203114
203539
|
// v4 (NSP-019 R35): a Focus that finds the node off the page shows as its warning until a Focus reaches it, and an Icon Source that is not an icon shows as one until an icon or nothing arrives (`diagnostics`)
|
|
203115
203540
|
// v5 (NSP-019 R38): a wired Width in a row, or a wired Height in a column, that is a percent shows as its warning (wired-grow.ts)
|
|
203116
|
-
|
|
203117
|
-
|
|
203541
|
+
// v7 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
203542
|
+
version: 7,
|
|
203543
|
+
changes: [focusAndIconSourceChange(4), growChange(5), repeatWhileSavingChange(6, "click"), visibleAtOnceChange(7)],
|
|
203118
203544
|
diagnostics: { ...focusDiagnostics(controlFocusNotMounted("button")), ...iconSourceDiagnostics(), ...wiredGrowDiagnostic },
|
|
203119
203545
|
source: "packages/noodl-viewer-react/src/nodes/controls/button.ts",
|
|
203120
203546
|
needs: ["person"],
|
|
@@ -203300,8 +203726,9 @@ var Button3 = defineNode({
|
|
|
203300
203726
|
// NSP-019 R38 — node.ts :446-458, react-component-node.ts :706-753 (wired-grow.ts)
|
|
203301
203727
|
width: sizeReducer("width"),
|
|
203302
203728
|
height: sizeReducer("height"),
|
|
203303
|
-
// node-shared-port-definitions.ts :
|
|
203304
|
-
|
|
203729
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
203730
|
+
// (visible-at-once.ts)
|
|
203731
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] })
|
|
203305
203732
|
},
|
|
203306
203733
|
{
|
|
203307
203734
|
// placed on the page with its params set — the first paint (react-component-node.ts :1740-1743 reads `wantsToBeMounted`):
|
|
@@ -203382,8 +203809,9 @@ var Checkbox2 = defineNode({
|
|
|
203382
203809
|
// v3 (P109 ISL-031, P107-C64 ruled "Ignore touches, keep hover"): a finger on a disabled control reports nothing — no Pressed, no Pointer Down or Up — as Enabled promises; the pointer's hover still reports
|
|
203383
203810
|
// v4 (P109 ISL-031, P107-D30 ruled "Reset and announce"): a control leaving the page (Mounted off) takes Focused, Hover and Pressed with it — each goes false, sent if it was true, with Blurred and Hover End for the ones that were on
|
|
203384
203811
|
// v5 (NSP-019 R35): a Focus that finds the node off the page shows as its warning until a Focus reaches it, and an Icon Source that is not an icon shows as one until an icon or nothing arrives (`diagnostics`)
|
|
203385
|
-
|
|
203386
|
-
|
|
203812
|
+
// v6 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
203813
|
+
version: 6,
|
|
203814
|
+
changes: [focusAndIconSourceChange(5), visibleAtOnceChange(6)],
|
|
203387
203815
|
diagnostics: { ...focusDiagnostics(controlFocusNotMounted("checkbox")), ...iconSourceDiagnostics() },
|
|
203388
203816
|
source: "packages/noodl-viewer-react/src/nodes/controls/checkbox.ts",
|
|
203389
203817
|
needs: ["person"],
|
|
@@ -203567,8 +203995,9 @@ var Checkbox2 = defineNode({
|
|
|
203567
203995
|
return { says: "it holds the keyboard: it is taken off it, and the Focused state goes false", set: { focused: false, elementFocused: false }, send: ["focusState"], emit: ["onBlur"], outcome: "done" };
|
|
203568
203996
|
},
|
|
203569
203997
|
scrollIntoView: () => ({ says: "always: the page, or the scrolling Group holding it, scrolls until the box can be seen", send: [] }),
|
|
203570
|
-
// node-shared-port-definitions.ts :
|
|
203571
|
-
|
|
203998
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
203999
|
+
// (visible-at-once.ts)
|
|
204000
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] })
|
|
203572
204001
|
},
|
|
203573
204002
|
{
|
|
203574
204003
|
world: { place: (s) => painted2(s) },
|
|
@@ -203693,8 +204122,9 @@ var TextInput3 = defineNode({
|
|
|
203693
204122
|
// v6 (P109 ISL-031, P107-D30 ruled "Reset and announce"): a control leaving the page (Mounted off) takes Focused, Hover and Pressed with it — each goes false, sent if it was true, with Blurred and Hover End for the ones that were on
|
|
203694
204123
|
// v7 (NSP-019 R35): a Focus that finds the node off the page shows as its warning until a Focus reaches it, and an Icon Source that is not an icon shows as one until an icon or nothing arrives (`diagnostics`)
|
|
203695
204124
|
// v8 (NSP-019 R38): a wired Width in a row, or a wired Height in a column, that is a percent shows as its warning (wired-grow.ts)
|
|
203696
|
-
|
|
203697
|
-
|
|
204125
|
+
// v10 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
204126
|
+
version: 10,
|
|
204127
|
+
changes: [focusAndIconSourceChange(7), growChange(8), repeatWhileSavingChange(9, "Enter"), visibleAtOnceChange(10)],
|
|
203698
204128
|
diagnostics: { ...focusDiagnostics(FIELD_FOCUS_NOT_MOUNTED), ...iconSourceDiagnostics(), ...wiredGrowDiagnostic },
|
|
203699
204129
|
source: "packages/noodl-viewer-react/src/nodes/controls/text-input.ts",
|
|
203700
204130
|
needs: ["person"],
|
|
@@ -204015,9 +204445,10 @@ var TextInput3 = defineNode({
|
|
|
204015
204445
|
// NSP-019 R38 — node.ts :446-458, react-component-node.ts :706-753 (wired-grow.ts)
|
|
204016
204446
|
width: sizeReducer("width"),
|
|
204017
204447
|
height: sizeReducer("height"),
|
|
204018
|
-
// node-shared-port-definitions.ts :
|
|
204019
|
-
// Opacity the
|
|
204020
|
-
|
|
204448
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
204449
|
+
// (visible-at-once.ts); Opacity (:320-328) follows at the next paint (TextInput.tsx :118-120 compares the Opacity the style
|
|
204450
|
+
// holds with the number 0)
|
|
204451
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] }),
|
|
204021
204452
|
opacity: (_s, v) => ({ says: "always: how see-through it is; at exactly 0 it takes no pointer, and an act goes to what is behind it", set: { opacityZero: v === 0 }, send: [] })
|
|
204022
204453
|
},
|
|
204023
204454
|
{
|
|
@@ -204330,7 +204761,8 @@ var Dropdown = defineNode({
|
|
|
204330
204761
|
// v10 (NSP-019 R38): a wired Width in a row, or a wired Height in a column, that is a percent shows as its warning (wired-grow.ts)
|
|
204331
204762
|
// v11 (P121-TWO005-DROPDOWNSTALE): Items that do not offer the placed node's seed ("Option 1") clear it to '' and send Value
|
|
204332
204763
|
// v12 (BETA-S7-DROPDOWNFIRSTPICK): with the value in no option, the element keeps its hidden empty option selected, so every option is a pick
|
|
204333
|
-
|
|
204764
|
+
// v13 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
204765
|
+
version: 13,
|
|
204334
204766
|
// NSP-010 — v7 is the spec correcting itself, not the runtime changing
|
|
204335
204767
|
changes: [
|
|
204336
204768
|
{
|
|
@@ -204366,7 +204798,8 @@ var Dropdown = defineNode({
|
|
|
204366
204798
|
migration: {
|
|
204367
204799
|
none: "A pick that did nothing now does what the person asked; nothing an app could rely on, and no stored project changes"
|
|
204368
204800
|
}
|
|
204369
|
-
}
|
|
204801
|
+
},
|
|
204802
|
+
visibleAtOnceChange(13)
|
|
204370
204803
|
],
|
|
204371
204804
|
diagnostics: { ...focusDiagnostics(controlFocusNotMounted("dropdown")), ...iconSourceDiagnostics(), ...wiredGrowDiagnostic },
|
|
204372
204805
|
source: "packages/noodl-viewer-react/src/nodes/controls/options.ts",
|
|
@@ -204648,8 +205081,9 @@ var Dropdown = defineNode({
|
|
|
204648
205081
|
// NSP-019 R38 — node.ts :446-458, react-component-node.ts :706-753 (wired-grow.ts)
|
|
204649
205082
|
width: sizeReducer("width"),
|
|
204650
205083
|
height: sizeReducer("height"),
|
|
204651
|
-
// node-shared-port-definitions.ts :
|
|
204652
|
-
|
|
205084
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
205085
|
+
// (visible-at-once.ts)
|
|
205086
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] })
|
|
204653
205087
|
},
|
|
204654
205088
|
{
|
|
204655
205089
|
// react-component-node.ts :785-830 `DATA_ATTRIBUTES_RULE` — one string input per name the Data Attributes list names, written
|
|
@@ -204818,7 +205252,8 @@ var Slider2 = defineNode({
|
|
|
204818
205252
|
// v7 (NSP-019 R39, ruled "Yes, warn"): a Max below Min warns, as the Counter's Min above Max does; and a Value that is not a
|
|
204819
205253
|
// number, which the runtime always reported on the error bus, is declared with it (the editor records the `slider/` keys)
|
|
204820
205254
|
// v8 (NSP-019 R38): a wired Width in a row that is a percent shows as its warning (wired-grow.ts)
|
|
204821
|
-
|
|
205255
|
+
// v9 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
205256
|
+
version: 9,
|
|
204822
205257
|
changes: [
|
|
204823
205258
|
focusChange(6),
|
|
204824
205259
|
{
|
|
@@ -204827,7 +205262,8 @@ var Slider2 = defineNode({
|
|
|
204827
205262
|
row: "NSP-019 R39 (P107 s104)",
|
|
204828
205263
|
migration: { none: "Only the editor is told. Nothing a wire carries changes, and nothing a person does moves differently" }
|
|
204829
205264
|
},
|
|
204830
|
-
growChange(8)
|
|
205265
|
+
growChange(8),
|
|
205266
|
+
visibleAtOnceChange(9)
|
|
204831
205267
|
],
|
|
204832
205268
|
diagnostics: {
|
|
204833
205269
|
...focusDiagnostics(controlFocusNotMounted("slider")),
|
|
@@ -205061,8 +205497,9 @@ var Slider2 = defineNode({
|
|
|
205061
205497
|
scrollIntoView: () => ({ says: "always: the page, or the scrolling Group holding it, scrolls until the slider can be seen", send: [] }),
|
|
205062
205498
|
// NSP-019 R38 — node.ts :446-458, react-component-node.ts :706-753 (wired-grow.ts)
|
|
205063
205499
|
width: sizeReducer("width", false),
|
|
205064
|
-
// node-shared-port-definitions.ts :
|
|
205065
|
-
|
|
205500
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
205501
|
+
// (visible-at-once.ts)
|
|
205502
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] })
|
|
205066
205503
|
},
|
|
205067
205504
|
{
|
|
205068
205505
|
// placed on the page with its params set — the first render: Did Mount, and the mount's effect (Slider.tsx :88-90)
|
|
@@ -205720,8 +206157,8 @@ function busy(s) {
|
|
|
205720
206157
|
return s.phase !== "idle" || s.carry >= 0;
|
|
205721
206158
|
}
|
|
205722
206159
|
function cardIndex(value2) {
|
|
205723
|
-
const
|
|
205724
|
-
return CARDS.findIndex((c) => JSON.stringify(c) ===
|
|
206160
|
+
const named3 = JSON.stringify(value2);
|
|
206161
|
+
return CARDS.findIndex((c) => JSON.stringify(c) === named3);
|
|
205725
206162
|
}
|
|
205726
206163
|
function track2(s, over) {
|
|
205727
206164
|
const here = over && zoneFor(s);
|
|
@@ -206450,12 +206887,12 @@ function busy2(s) {
|
|
|
206450
206887
|
return s.phase !== "idle" || s.carry >= 0;
|
|
206451
206888
|
}
|
|
206452
206889
|
function cardIndex2(value2) {
|
|
206453
|
-
const
|
|
206454
|
-
return CARDS2.findIndex((c) => JSON.stringify(c) ===
|
|
206890
|
+
const named3 = JSON.stringify(value2);
|
|
206891
|
+
return CARDS2.findIndex((c) => JSON.stringify(c) === named3);
|
|
206455
206892
|
}
|
|
206456
206893
|
function childIndexOf(value2) {
|
|
206457
|
-
const
|
|
206458
|
-
return CHILDREN.findIndex((c) => JSON.stringify(c) ===
|
|
206894
|
+
const named3 = JSON.stringify(value2);
|
|
206895
|
+
return CHILDREN.findIndex((c) => JSON.stringify(c) === named3);
|
|
206459
206896
|
}
|
|
206460
206897
|
function track3(s, over) {
|
|
206461
206898
|
const here = over && zoneFor2(s);
|
|
@@ -206977,8 +207414,8 @@ function busy3(s) {
|
|
|
206977
207414
|
return s.phase !== "idle" || s.carry >= 0;
|
|
206978
207415
|
}
|
|
206979
207416
|
function cardIndex3(value2) {
|
|
206980
|
-
const
|
|
206981
|
-
return CARDS3.findIndex((c) => JSON.stringify(c) ===
|
|
207417
|
+
const named3 = JSON.stringify(value2);
|
|
207418
|
+
return CARDS3.findIndex((c) => JSON.stringify(c) === named3);
|
|
206982
207419
|
}
|
|
206983
207420
|
function track4(s, over) {
|
|
206984
207421
|
const here = over && zoneFor3(s);
|
|
@@ -207559,8 +207996,8 @@ function busy4(s) {
|
|
|
207559
207996
|
return s.phase !== "idle" || s.carry >= 0;
|
|
207560
207997
|
}
|
|
207561
207998
|
function cardIndex4(value2) {
|
|
207562
|
-
const
|
|
207563
|
-
return CARDS4.findIndex((c) => JSON.stringify(c) ===
|
|
207999
|
+
const named3 = JSON.stringify(value2);
|
|
208000
|
+
return CARDS4.findIndex((c) => JSON.stringify(c) === named3);
|
|
207564
208001
|
}
|
|
207565
208002
|
function track5(s, over) {
|
|
207566
208003
|
const here = over && zoneFor4(s);
|
|
@@ -208042,7 +208479,7 @@ var Video2 = defineNode({
|
|
|
208042
208479
|
autoplay: (_s, v) => ({ says: "always: drawn at the next paint, and read as a load completes \u2014 on, a video that may play (Muted, or a person has acted on the page) and that Pause or Reset has not stopped since the load began starts by itself: On Can Play, then On Play", set: { autoplay: v }, send: [] }),
|
|
208043
208480
|
loop: (_s, v) => ({ says: "always: drawn at the next paint, and read as the video reaches its end \u2014 on, it goes back to the start and plays on; off, it pauses there (On Pause)", set: { loop: v }, send: [] }),
|
|
208044
208481
|
// :35-47 — on the component, or waiting for it with the actions (`sourceObject`: only a `<video>` takes one, and only nothing is
|
|
208045
|
-
// seen to change it;
|
|
208482
|
+
// seen to change it; C99 on the runtime)
|
|
208046
208483
|
srcObject: (s, v) => {
|
|
208047
208484
|
if (!s.onPage) return said("off the page: waits for the element behind the actions already waiting, in order, and is written at the paint that puts the video there (at most 16 wait, and the oldest is pushed out)", toPatch2(waitFor(s, { srcObject: v })));
|
|
208048
208485
|
if (s.kind !== "video" || v !== void 0) return { says: "null (what it already has), a value that is not a stream, or anything on an embedded player: nothing changes \u2014 a live stream itself plays in place of Source, and no scenario holds one", set: {}, send: [], emit: [] };
|
|
@@ -208421,8 +208858,8 @@ function busy5(s) {
|
|
|
208421
208858
|
return s.phase !== "idle" || s.carry >= 0;
|
|
208422
208859
|
}
|
|
208423
208860
|
function cardIndex5(value2) {
|
|
208424
|
-
const
|
|
208425
|
-
return CARDS5.findIndex((c) => JSON.stringify(c) ===
|
|
208861
|
+
const named3 = JSON.stringify(value2);
|
|
208862
|
+
return CARDS5.findIndex((c) => JSON.stringify(c) === named3);
|
|
208426
208863
|
}
|
|
208427
208864
|
function track6(s, over) {
|
|
208428
208865
|
const here = over && zoneFor5(s);
|
|
@@ -210416,7 +210853,7 @@ function start(w, op) {
|
|
|
210416
210853
|
if (b === MISSING) w.st.hops = HOPS_ADD_MISSING;
|
|
210417
210854
|
else if (b === null) w.st.hops = 2;
|
|
210418
210855
|
else w.st.building = { kind: "add", row: b, index: op.index, at: childIndexFor(w.st.rows, op.index) };
|
|
210419
|
-
} else
|
|
210856
|
+
} else refresh2(w);
|
|
210420
210857
|
}
|
|
210421
210858
|
function compileMapping(code, rethrow = false) {
|
|
210422
210859
|
if (!code) return void 0;
|
|
@@ -210599,7 +211036,7 @@ function report2(w, heard3) {
|
|
|
210599
211036
|
w.pulses.push(`itemOutputSignal-${signal2}`);
|
|
210600
211037
|
}
|
|
210601
211038
|
}
|
|
210602
|
-
function
|
|
211039
|
+
function refresh2(w) {
|
|
210603
211040
|
const st = w.st;
|
|
210604
211041
|
st.refreshScheduled = false;
|
|
210605
211042
|
const tokens = st.tokens;
|
|
@@ -211615,8 +212052,9 @@ var RadioButton3 = defineNode({
|
|
|
211615
212052
|
// v3 (P109 ISL-031, P107-C64 ruled "Ignore touches, keep hover"): a finger on a disabled control reports nothing — no Pressed, no Pointer Down or Up — as Enabled promises; the pointer's hover still reports
|
|
211616
212053
|
// v4 (P109 ISL-031, P107-D30 ruled "Reset and announce"): a control leaving the page (Mounted off) takes Focused, Hover and Pressed with it — each goes false, sent if it was true, with Blurred and Hover End for the ones that were on
|
|
211617
212054
|
// v5 (NSP-019 R35): a Focus that finds the node off the page shows as its warning until a Focus reaches it, and an Icon Source that is not an icon shows as one until an icon or nothing arrives (`diagnostics`)
|
|
211618
|
-
|
|
211619
|
-
|
|
212055
|
+
// v6 (BETA-S7-DROPDOWNFOCUSDIVERGE, the spec correcting itself): Visible reaches the element at once, so a Focus in the same frame meets it (visible-at-once.ts)
|
|
212056
|
+
version: 6,
|
|
212057
|
+
changes: [focusAndIconSourceChange(5), visibleAtOnceChange(6)],
|
|
211620
212058
|
diagnostics: { ...focusDiagnostics(controlFocusNotMounted("radio button")), ...iconSourceDiagnostics() },
|
|
211621
212059
|
source: "packages/noodl-viewer-react/src/nodes/controls/radiobutton.ts",
|
|
211622
212060
|
needs: ["person", "group"],
|
|
@@ -211808,8 +212246,9 @@ var RadioButton3 = defineNode({
|
|
|
211808
212246
|
return { says: "it holds the keyboard: it is taken off it, and the Focused state goes false", set: { focused: false, elementFocused: false }, send: ["focusState"], emit: ["onBlur"], outcome: "done" };
|
|
211809
212247
|
},
|
|
211810
212248
|
scrollIntoView: () => ({ says: "always: the page, or the scrolling Group holding it, scrolls until the button can be seen", send: [] }),
|
|
211811
|
-
// node-shared-port-definitions.ts :
|
|
211812
|
-
|
|
212249
|
+
// node-shared-port-definitions.ts :374-388 — written onto the element at once, so a Focus in the same frame meets it
|
|
212250
|
+
// (visible-at-once.ts)
|
|
212251
|
+
visible: (_s, v) => ({ says: "always: shown or hidden at once, its space kept; hidden, it takes no click and a Focus does not reach it", set: { visible: !!v, pageVisible: !!v }, send: [] })
|
|
211813
212252
|
},
|
|
211814
212253
|
{
|
|
211815
212254
|
world: {
|
|
@@ -213858,10 +214297,18 @@ var RecordNode = defineNode({
|
|
|
213858
214297
|
// then `prop-` alone for every name a wire or a parameter declares and the schema does not (recordWiredFieldPorts :260-345)
|
|
213859
214298
|
outputs: (params, context) => {
|
|
213860
214299
|
const out = {};
|
|
213861
|
-
|
|
214300
|
+
const klass = selectedClass(params, context);
|
|
214301
|
+
for (const [field2, decl] of shownFields(klass, true)) {
|
|
213862
214302
|
out["prop-" + field2] = { ...propertyOutput(field2), ...recordFieldPort(decl) };
|
|
213863
214303
|
out["changed-" + field2] = changedSignal(field2);
|
|
213864
214304
|
}
|
|
214305
|
+
if (klass && onParseWire(context)) {
|
|
214306
|
+
for (const field2 of RECORD_BUILT_IN_DATES2)
|
|
214307
|
+
if (!("prop-" + field2 in out)) {
|
|
214308
|
+
out["prop-" + field2] = propertyOutput(field2, "date");
|
|
214309
|
+
if (!("changed-" + field2 in out)) out["changed-" + field2] = changedSignal(field2);
|
|
214310
|
+
}
|
|
214311
|
+
}
|
|
213865
214312
|
for (const field2 of recordWiredFieldNames2(params, context)) if (!("prop-" + field2 in out)) out["prop-" + field2] = propertyOutput(field2);
|
|
213866
214313
|
return out;
|
|
213867
214314
|
},
|
|
@@ -215374,7 +215821,7 @@ function applyReturn(s, r) {
|
|
|
215374
215821
|
if (r.inProgress) return { set: { signingIn: true }, send: ["signingIn"] };
|
|
215375
215822
|
if (s.returned) return { send: [] };
|
|
215376
215823
|
if (r.succeeded) {
|
|
215377
|
-
return { set: { signingIn: false, notice: r.notice, error:
|
|
215824
|
+
return { set: { signingIn: false, notice: r.notice, error: "", returned: true }, send: ["signingIn", "notice", "error"], opens: [{ outcome: "done" }] };
|
|
215378
215825
|
}
|
|
215379
215826
|
return { set: { signingIn: false, error: r.error || SIGN_IN_NOT_COMPLETED, returned: true }, send: ["signingIn", "error"], opens: [{ outcome: "failure", error: SIGN_IN_WITH_ERROR_CODE2 }] };
|
|
215380
215827
|
}
|
|
@@ -215384,7 +215831,19 @@ var SignInWith = defineNode({
|
|
|
215384
215831
|
// v1 played the launcher only; no v1 trace moves (no v1 world carried a return)
|
|
215385
215832
|
// v3 (P109 ISL-030, row C50 ruled "Fire it once"): a return's final state is reported once per page load; v2 reported a
|
|
215386
215833
|
// provider's error twice — at mount and at the announcement a tick later.
|
|
215387
|
-
|
|
215834
|
+
// v4 (Beta sweep s19, row P109-S24-SIGNINWITHERRORKEPT ruled "Blank text, like magic link"): a succeeded return clears Error
|
|
215835
|
+
// to blank text and sends it, as Request Magic Link's Done does (D25); v3 cleared it to `undefined`, never sent.
|
|
215836
|
+
version: 4,
|
|
215837
|
+
changes: [
|
|
215838
|
+
{
|
|
215839
|
+
version: 4,
|
|
215840
|
+
says: "A sign-in that comes back succeeded clears Error to blank text and sends it, so a label wired to Error lets go of the last failure (before, the clear was nothing, which never reaches a wire)",
|
|
215841
|
+
row: "P109-S24-SIGNINWITHERRORKEPT",
|
|
215842
|
+
migration: {
|
|
215843
|
+
none: "A page load gets one sign-in back and the node is new on it, so its Error never held an earlier failure: no project can see the before"
|
|
215844
|
+
}
|
|
215845
|
+
}
|
|
215846
|
+
],
|
|
215388
215847
|
source: "packages/noodl-viewer-react/src/nodes/std-library/user/signinwith.ts; userservice.ts; RestAuthAdapter.ts; ParseAuthAdapter.ts",
|
|
215389
215848
|
needs: ["backend", "registry", "clock"],
|
|
215390
215849
|
worldPool: { backends: [...pool("signInWithProvider", null), ...RETURNS] },
|
|
@@ -217050,9 +217509,9 @@ function captureGroups2(m) {
|
|
|
217050
217509
|
}
|
|
217051
217510
|
function namedCaptureGroups2(m) {
|
|
217052
217511
|
const out = {};
|
|
217053
|
-
const
|
|
217054
|
-
if (
|
|
217055
|
-
for (const key in
|
|
217512
|
+
const named3 = m.groups;
|
|
217513
|
+
if (named3) {
|
|
217514
|
+
for (const key in named3) out[key] = named3[key] === void 0 ? "" : named3[key];
|
|
217056
217515
|
}
|
|
217057
217516
|
return out;
|
|
217058
217517
|
}
|
|
@@ -221323,9 +221782,9 @@ var OUTPUT_TYPES = ["*", ...INPUT_TYPES, "signal"];
|
|
|
221323
221782
|
var labelsOf = (list2) => Array.isArray(list2) ? list2.map((r) => r && r.label).filter((l) => typeof l === "string" && l.length > 0) : [];
|
|
221324
221783
|
function parse(text3) {
|
|
221325
221784
|
try {
|
|
221326
|
-
const
|
|
221785
|
+
const AsyncFunction2 = Object.getPrototypeOf(async function() {
|
|
221327
221786
|
}).constructor;
|
|
221328
|
-
new
|
|
221787
|
+
new AsyncFunction2(...PARAMETERS, CODE_PREFIX + text3);
|
|
221329
221788
|
return void 0;
|
|
221330
221789
|
} catch (e) {
|
|
221331
221790
|
return e && e.message ? String(e.message) : String(e);
|
|
@@ -221349,9 +221808,9 @@ function outputNames(params, script2) {
|
|
|
221349
221808
|
if (params["outtype-" + label] === "signal") signals.push(label);
|
|
221350
221809
|
else values2.push(label);
|
|
221351
221810
|
}
|
|
221352
|
-
const
|
|
221353
|
-
for (const n of
|
|
221354
|
-
for (const n of
|
|
221811
|
+
const named3 = functionScriptPortNames2(script2);
|
|
221812
|
+
for (const n of named3.signals) if (!signals.includes(n) && !values2.includes(n)) signals.push(n);
|
|
221813
|
+
for (const n of named3.outputs) if (!signals.includes(n) && !values2.includes(n)) values2.push(n);
|
|
221355
221814
|
return { signals, values: values2 };
|
|
221356
221815
|
}
|
|
221357
221816
|
function runCode(s, signals) {
|
|
@@ -231392,7 +231851,7 @@ var cloud_node_library_default = {
|
|
|
231392
231851
|
plug: "input",
|
|
231393
231852
|
group: "General",
|
|
231394
231853
|
displayName: "Allow Unauthenticated",
|
|
231395
|
-
description: "Whether a request with no valid session token is allowed to run this function at all",
|
|
231854
|
+
description: "Whether a request with no valid session token is allowed to run this function at all. A run the app starts itself \u2014 a schedule, a row change, a run from Studio \u2014 is always allowed and sees nobody signed in; a webhook is a request like any other",
|
|
231396
231855
|
default: false
|
|
231397
231856
|
},
|
|
231398
231857
|
{
|
|
@@ -234581,9 +235040,9 @@ function conditionIsUnsatisfied(condition, params) {
|
|
|
234581
235040
|
return result2 === false;
|
|
234582
235041
|
}
|
|
234583
235042
|
function resolveAgainstDefaults(params, defaults) {
|
|
234584
|
-
const
|
|
234585
|
-
for (const [name2, value2] of Object.entries(params)) if (value2 !== void 0)
|
|
234586
|
-
return
|
|
235043
|
+
const resolved3 = { ...defaults };
|
|
235044
|
+
for (const [name2, value2] of Object.entries(params)) if (value2 !== void 0) resolved3[name2] = value2;
|
|
235045
|
+
return resolved3;
|
|
234587
235046
|
}
|
|
234588
235047
|
function conditionForInput(groups, portName) {
|
|
234589
235048
|
if (!groups) return void 0;
|
|
@@ -234622,6 +235081,7 @@ var NUMBER_WITH_UNIT = /^\s*(-?\d+(?:\.\d+)?)\s*(px|%|vw|vh|em|rem|deg|s|ms)\s*$
|
|
|
234622
235081
|
function isPlainObject3(value2) {
|
|
234623
235082
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
234624
235083
|
}
|
|
235084
|
+
var TOKEN_IN_VALUE = /var\(--[A-Za-z0-9_-]+\)/;
|
|
234625
235085
|
function isTokenReference2(value2) {
|
|
234626
235086
|
return typeof value2 === "string" && value2.startsWith("var(");
|
|
234627
235087
|
}
|
|
@@ -234693,10 +235153,11 @@ function unitsFormat(type) {
|
|
|
234693
235153
|
suggestion: JSON.stringify({ value: Number(parsed2[1]), unit: parsed2[2] })
|
|
234694
235154
|
};
|
|
234695
235155
|
}
|
|
235156
|
+
const token = typeof value2 === "string" ? TOKEN_IN_VALUE.exec(value2)?.[0] : void 0;
|
|
234696
235157
|
return {
|
|
234697
235158
|
severity: "error",
|
|
234698
|
-
message: `expects a number
|
|
234699
|
-
suggestion: JSON.stringify({ value: 16, unit: unit2 })
|
|
235159
|
+
message: `expects a number, a { "value", "unit" } object or a var(--token) reference. Got ${describeValue3(value2)}.` + (token ? ` This port takes a token alone, not inside an expression: use ${token}, or add a token that holds the size you want.` : ""),
|
|
235160
|
+
suggestion: JSON.stringify(token ?? { value: 16, unit: unit2 })
|
|
234700
235161
|
};
|
|
234701
235162
|
}
|
|
234702
235163
|
};
|
|
@@ -235166,13 +235627,13 @@ function checkParameterValues(nodes, catalog, options) {
|
|
|
235166
235627
|
});
|
|
235167
235628
|
}
|
|
235168
235629
|
if (dynamicSkips.length > 0) {
|
|
235169
|
-
const
|
|
235630
|
+
const named3 = dynamicSkips.map((n) => `"${n}"`).join(", ");
|
|
235170
235631
|
const rawNote = catalog.dynamicPortNote(node.type) ?? "this node determines ports at runtime";
|
|
235171
235632
|
const note = /[.!?]$/.test(rawNote.trim()) ? rawNote.trim() : `${rawNote.trim()}.`;
|
|
235172
235633
|
diagnostics.push({
|
|
235173
235634
|
code: "dynamic-port-skipped" /* DynamicPortSkipped */,
|
|
235174
235635
|
severity: "info",
|
|
235175
|
-
message: `${dynamicSkips.length === 1 ? "Parameter" : "Parameters"} ${
|
|
235636
|
+
message: `${dynamicSkips.length === 1 ? "Parameter" : "Parameters"} ${named3} on ${node.type} ${dynamicSkips.length === 1 ? "names" : "name"} no port the catalog can see, and ${dynamicSkips.length === 1 ? "it was" : "they were"} not checked: ` + note + " So this node is unverified by that check rather than verified as correct.",
|
|
235176
235637
|
location: {
|
|
235177
235638
|
component,
|
|
235178
235639
|
nodeId: node.id,
|
|
@@ -235334,8 +235795,8 @@ function parentAxis(parent, catalog) {
|
|
|
235334
235795
|
const declared2 = PARENT_MAIN_AXIS[parent.type];
|
|
235335
235796
|
if (declared2 === void 0) return void 0;
|
|
235336
235797
|
if (declared2 !== "fromFlexDirection") return declared2;
|
|
235337
|
-
const
|
|
235338
|
-
const flexDirection =
|
|
235798
|
+
const resolved3 = resolveAgainstDefaults(parent.parameters ?? {}, catalog.inputDefaults(parent.type));
|
|
235799
|
+
const flexDirection = resolved3["flexDirection"];
|
|
235339
235800
|
if (flexDirection === "row") return "row";
|
|
235340
235801
|
if (flexDirection === "column" || flexDirection === void 0) return "column";
|
|
235341
235802
|
return void 0;
|
|
@@ -235538,7 +235999,11 @@ var AUTHORED_BLOCKING_WARNINGS = /* @__PURE__ */ new Set([
|
|
|
235538
235999
|
// Bug P121-TWO003-SCRIPTCOMPILE — the runtime's own compile fails, so every Run fails. No benign
|
|
235539
236000
|
// reading for a graph an agent just wrote; the write said nothing before, and the first person
|
|
235540
236001
|
// to run the function got "That could not be done."
|
|
235541
|
-
"function-script-not-compiled" /* FunctionScriptNotCompiled
|
|
236002
|
+
"function-script-not-compiled" /* FunctionScriptNotCompiled */,
|
|
236003
|
+
// Bug P127-BKO006-RUNONCHANGEGUESS — a `runOnChange-` name a Function does not have is never read
|
|
236004
|
+
// (2,805 right and 5 wrong over 2,718 Functions, all five agent-written); the message names the
|
|
236005
|
+
// right one.
|
|
236006
|
+
"function-run-on-change-unknown" /* FunctionRunOnChangeUnknown */
|
|
235542
236007
|
]);
|
|
235543
236008
|
|
|
235544
236009
|
// ../noodl-editor/src/editor/src/validation/diagnosticExamples.ts
|
|
@@ -235678,6 +236143,12 @@ var DIAGNOSTIC_EXAMPLES = [
|
|
|
235678
236143
|
code: "function-guards-an-open-collection" /* FunctionGuardsAnOpenCollection */,
|
|
235679
236144
|
examples: ["cloud-members-can-edit-my-records"],
|
|
235680
236145
|
why: `the records only a function creates, with the collection's create rule "nobody": the function runs as the system`
|
|
236146
|
+
},
|
|
236147
|
+
// P112-OWN018-FANOUT (ruled 2026-10-27 "Teach it and warn") — the warning carries the chained shape.
|
|
236148
|
+
{
|
|
236149
|
+
code: "condition-reads-a-siblings-change" /* ConditionReadsASiblingsChange */,
|
|
236150
|
+
examples: ["score-then-move-on"],
|
|
236151
|
+
why: "the press evaluating the gate that reads, and that gate's Done evaluating the gate that moves on, so the score is decided first"
|
|
235681
236152
|
}
|
|
235682
236153
|
];
|
|
235683
236154
|
|
|
@@ -236968,9 +237439,9 @@ var dialogWithoutName = {
|
|
|
236968
237439
|
if (typeof accessibleName === "string" && accessibleName.trim() !== "") continue;
|
|
236969
237440
|
const target = node.parameters?.target;
|
|
236970
237441
|
if (typeof target !== "string" || target.trim() === "") continue;
|
|
236971
|
-
const
|
|
236972
|
-
if (
|
|
236973
|
-
if (subtreeHasHeading(
|
|
237442
|
+
const resolved3 = byName.has(target) ? target : void 0;
|
|
237443
|
+
if (resolved3 === void 0) continue;
|
|
237444
|
+
if (subtreeHasHeading(resolved3, byName, /* @__PURE__ */ new Set())) continue;
|
|
236974
237445
|
diagnostics.push({
|
|
236975
237446
|
code: "dialog-without-name" /* DialogWithoutName */,
|
|
236976
237447
|
severity: "warning",
|
|
@@ -237152,9 +237623,9 @@ var CODE_PREFIX3 = "const Script = (typeof Node !== 'undefined')?Node:undefined;
|
|
|
237152
237623
|
var PARAMS2 = ["Inputs", "Outputs", "Noodl", "Component", "Scripts"];
|
|
237153
237624
|
function functionScriptCompileError(script2) {
|
|
237154
237625
|
try {
|
|
237155
|
-
const
|
|
237626
|
+
const AsyncFunction2 = Object.getPrototypeOf(async function() {
|
|
237156
237627
|
}).constructor;
|
|
237157
|
-
new
|
|
237628
|
+
new AsyncFunction2(...PARAMS2, CODE_PREFIX3 + script2);
|
|
237158
237629
|
return void 0;
|
|
237159
237630
|
} catch (e) {
|
|
237160
237631
|
const message = e instanceof Error ? e.message : String(e);
|
|
@@ -237264,6 +237735,156 @@ var functionNeverReruns = {
|
|
|
237264
237735
|
}
|
|
237265
237736
|
};
|
|
237266
237737
|
|
|
237738
|
+
// ../noodl-editor/src/editor/src/validation/rules/functionRunOnChangeUnknown.ts
|
|
237739
|
+
var RUN_ON_CHANGE_PREFIX4 = "runOnChange-";
|
|
237740
|
+
var FUNCTION_INPUT_PREFIX = "in-";
|
|
237741
|
+
var functionRunOnChangeUnknown = {
|
|
237742
|
+
code: "function-run-on-change-unknown" /* FunctionRunOnChangeUnknown */,
|
|
237743
|
+
description: "A Function has a Run On Value Change setting under a name it does not have (its boxes are runOnChange-in-<input>).",
|
|
237744
|
+
defaultEnabled: true,
|
|
237745
|
+
run(ctx) {
|
|
237746
|
+
const out = [];
|
|
237747
|
+
for (const { component } of ctx.components) {
|
|
237748
|
+
for (const node of component.nodes) {
|
|
237749
|
+
if (node.type !== FUNCTION_NODE_TYPE || !node.parameters) continue;
|
|
237750
|
+
const guessed = Object.keys(node.parameters).filter(
|
|
237751
|
+
(key) => key.startsWith(RUN_ON_CHANGE_PREFIX4) && !key.startsWith(RUN_ON_CHANGE_PREFIX4 + FUNCTION_INPUT_PREFIX)
|
|
237752
|
+
);
|
|
237753
|
+
if (guessed.length === 0) continue;
|
|
237754
|
+
const inputs = scriptPortsForNode(node).filter((p) => p.plug === "input" && p.name.startsWith(FUNCTION_INPUT_PREFIX)).map((p) => p.name.slice(FUNCTION_INPUT_PREFIX.length));
|
|
237755
|
+
const name2 = node.label ? `"${node.label}"` : "This Function";
|
|
237756
|
+
for (const key of guessed) {
|
|
237757
|
+
const wanted = key.slice(RUN_ON_CHANGE_PREFIX4.length);
|
|
237758
|
+
const input2 = inputs.includes(wanted) ? wanted : nearest(wanted, inputs);
|
|
237759
|
+
const right = input2 !== void 0 ? `${RUN_ON_CHANGE_PREFIX4}${FUNCTION_INPUT_PREFIX}${input2}` : void 0;
|
|
237760
|
+
out.push({
|
|
237761
|
+
code: "function-run-on-change-unknown" /* FunctionRunOnChangeUnknown */,
|
|
237762
|
+
severity: "warning",
|
|
237763
|
+
message: `${name2} has no setting "${key}", so nothing reads it` + (input2 === wanted ? ` and a new "${wanted}" still runs it. ` : ". ") + `A Function's Run On Value Change box for an input is "runOnChange-in-<input>"` + (right ? input2 === wanted ? `: write "${right}".` : `; its script reads no "${wanted}" (the nearest input is "${input2}": "${right}").` : `, and its script reads no inputs.`),
|
|
237764
|
+
location: {
|
|
237765
|
+
component: component.name,
|
|
237766
|
+
nodeId: node.id,
|
|
237767
|
+
nodeType: node.type,
|
|
237768
|
+
nodeLabel: node.label,
|
|
237769
|
+
port: key,
|
|
237770
|
+
plug: "input"
|
|
237771
|
+
},
|
|
237772
|
+
...right ? { suggestion: `${right}: ${JSON.stringify(node.parameters[key])}` } : {}
|
|
237773
|
+
});
|
|
237774
|
+
}
|
|
237775
|
+
}
|
|
237776
|
+
}
|
|
237777
|
+
return out;
|
|
237778
|
+
}
|
|
237779
|
+
};
|
|
237780
|
+
|
|
237781
|
+
// ../noodl-editor/src/editor/src/validation/rules/conditionReadsASiblingsChange.ts
|
|
237782
|
+
var CONDITION = "Condition";
|
|
237783
|
+
var conditionReadsASiblingsChange = {
|
|
237784
|
+
code: "condition-reads-a-siblings-change" /* ConditionReadsASiblingsChange */,
|
|
237785
|
+
description: "Two Conditions evaluated by one signal, where one's On True or On False changes what the other reads.",
|
|
237786
|
+
defaultEnabled: true,
|
|
237787
|
+
run(ctx) {
|
|
237788
|
+
const out = [];
|
|
237789
|
+
const { catalog } = ctx;
|
|
237790
|
+
for (const { component, nodeById } of ctx.components) {
|
|
237791
|
+
let exclusiveStates = function(a, b) {
|
|
237792
|
+
const stateOf = (gate) => {
|
|
237793
|
+
const c = (incoming.get(gate) ?? []).find((w) => w.toProperty === "condition");
|
|
237794
|
+
return c && nodeById.get(c.fromId)?.type === "States" && c.fromProperty.startsWith("at-") ? c : void 0;
|
|
237795
|
+
};
|
|
237796
|
+
const sa = stateOf(a);
|
|
237797
|
+
const sb = stateOf(b);
|
|
237798
|
+
return !!sa && !!sb && sa.fromId === sb.fromId && sa.fromProperty !== sb.fromProperty;
|
|
237799
|
+
}, feedingValues = function(gate) {
|
|
237800
|
+
const seen = /* @__PURE__ */ new Set();
|
|
237801
|
+
const stack = (incoming.get(gate) ?? []).filter((c) => c.toProperty === "condition").map((c) => c.fromId);
|
|
237802
|
+
while (stack.length > 0) {
|
|
237803
|
+
const id = stack.pop();
|
|
237804
|
+
if (id === gate || seen.has(id)) continue;
|
|
237805
|
+
seen.add(id);
|
|
237806
|
+
if (!passesThrough(id)) continue;
|
|
237807
|
+
const type = nodeById.get(id)?.type;
|
|
237808
|
+
for (const c of incoming.get(id) ?? []) {
|
|
237809
|
+
if (type && catalog.getPort(type, "input", c.toProperty)?.isSignal) continue;
|
|
237810
|
+
stack.push(c.fromId);
|
|
237811
|
+
}
|
|
237812
|
+
}
|
|
237813
|
+
return seen;
|
|
237814
|
+
}, reaches5 = function(gate, targets) {
|
|
237815
|
+
if (targets.size === 0) return false;
|
|
237816
|
+
const seen = /* @__PURE__ */ new Set([gate]);
|
|
237817
|
+
const stack = (outgoing.get(gate) ?? []).map((c) => c.toId);
|
|
237818
|
+
while (stack.length > 0) {
|
|
237819
|
+
const id = stack.pop();
|
|
237820
|
+
if (targets.has(id)) return true;
|
|
237821
|
+
if (seen.has(id)) continue;
|
|
237822
|
+
seen.add(id);
|
|
237823
|
+
if (!passesThrough(id)) continue;
|
|
237824
|
+
for (const c of outgoing.get(id) ?? []) stack.push(c.toId);
|
|
237825
|
+
}
|
|
237826
|
+
return false;
|
|
237827
|
+
};
|
|
237828
|
+
const outgoing = /* @__PURE__ */ new Map();
|
|
237829
|
+
const incoming = /* @__PURE__ */ new Map();
|
|
237830
|
+
for (const c of component.connections) {
|
|
237831
|
+
(outgoing.get(c.fromId) ?? outgoing.set(c.fromId, []).get(c.fromId)).push(c);
|
|
237832
|
+
(incoming.get(c.toId) ?? incoming.set(c.toId, []).get(c.toId)).push(c);
|
|
237833
|
+
}
|
|
237834
|
+
const isCondition = (id) => nodeById.get(id)?.type === CONDITION;
|
|
237835
|
+
const passesThrough = (id) => {
|
|
237836
|
+
const type = nodeById.get(id)?.type;
|
|
237837
|
+
const known = type ? catalog.getNode(type) : void 0;
|
|
237838
|
+
return !!known && !known.isVisual;
|
|
237839
|
+
};
|
|
237840
|
+
const gatesBySource = /* @__PURE__ */ new Map();
|
|
237841
|
+
for (const c of component.connections) {
|
|
237842
|
+
if (c.toProperty !== "eval" || !isCondition(c.toId)) continue;
|
|
237843
|
+
const key = `${c.fromId}\0${c.fromProperty}`;
|
|
237844
|
+
const gates = gatesBySource.get(key) ?? [];
|
|
237845
|
+
if (!gates.includes(c.toId)) gates.push(c.toId);
|
|
237846
|
+
gatesBySource.set(key, gates);
|
|
237847
|
+
}
|
|
237848
|
+
const reported3 = /* @__PURE__ */ new Set();
|
|
237849
|
+
for (const [key, gates] of gatesBySource) {
|
|
237850
|
+
if (gates.length < 2) continue;
|
|
237851
|
+
const sourceId = key.split("\0")[0];
|
|
237852
|
+
for (const reader of gates) {
|
|
237853
|
+
if (reported3.has(reader)) continue;
|
|
237854
|
+
const feeds = feedingValues(reader);
|
|
237855
|
+
for (const writer of gates) {
|
|
237856
|
+
if (writer === reader) continue;
|
|
237857
|
+
if (exclusiveStates(reader, writer)) continue;
|
|
237858
|
+
if (!reaches5(writer, feeds)) continue;
|
|
237859
|
+
reported3.add(reader);
|
|
237860
|
+
const r = nodeById.get(reader);
|
|
237861
|
+
const w = nodeById.get(writer);
|
|
237862
|
+
const rName = r.label ? `"${r.label}"` : "This Condition";
|
|
237863
|
+
const wName = w.label ? `"${w.label}"` : "another Condition";
|
|
237864
|
+
const sName = nodeById.get(sourceId)?.label ? `"${nodeById.get(sourceId).label}"` : "the same signal";
|
|
237865
|
+
out.push({
|
|
237866
|
+
code: "condition-reads-a-siblings-change" /* ConditionReadsASiblingsChange */,
|
|
237867
|
+
severity: "warning",
|
|
237868
|
+
message: `${rName} and ${wName} are both evaluated by ${sName}, and what ${wName} does changes what ${rName} reads. ${rName} reads its Condition after that change, whichever order the two are wired in. If it should decide on the value from before, chain them: ${rName}'s Done into ${wName}'s Evaluate, instead of both from ${sName}.`,
|
|
237869
|
+
location: {
|
|
237870
|
+
component: component.name,
|
|
237871
|
+
nodeId: r.id,
|
|
237872
|
+
nodeType: r.type,
|
|
237873
|
+
nodeLabel: r.label,
|
|
237874
|
+
port: "eval",
|
|
237875
|
+
plug: "input"
|
|
237876
|
+
},
|
|
237877
|
+
suggestion: `${r.id}.done \u2192 ${w.id}.eval`
|
|
237878
|
+
});
|
|
237879
|
+
break;
|
|
237880
|
+
}
|
|
237881
|
+
}
|
|
237882
|
+
}
|
|
237883
|
+
}
|
|
237884
|
+
return out;
|
|
237885
|
+
}
|
|
237886
|
+
};
|
|
237887
|
+
|
|
237267
237888
|
// ../noodl-editor/src/editor/src/validation/rules/layoutFillTraps.ts
|
|
237268
237889
|
var GROUP = "Group";
|
|
237269
237890
|
var CONTENT_WIDTH = /* @__PURE__ */ new Set(["contentSize", "contentWidth"]);
|
|
@@ -237371,6 +237992,181 @@ var rowOfWordsFillsItsColumn = {
|
|
|
237371
237992
|
}
|
|
237372
237993
|
};
|
|
237373
237994
|
|
|
237995
|
+
// ../noodl-editor/src/editor/src/validation/rules/bandWithoutShell.ts
|
|
237996
|
+
var GROUP2 = "Group";
|
|
237997
|
+
var resolved2 = (node, catalog) => resolveAgainstDefaults(node.parameters ?? {}, catalog.inputDefaults(node.type));
|
|
237998
|
+
var named2 = (nodes) => nodes.slice(0, 4).map((n) => n.label ? `"${n.label}"` : n.type).join(", ") + (nodes.length > 4 ? ", \u2026" : "");
|
|
237999
|
+
var isSet2 = (value2) => value2 !== void 0 && value2 !== null && value2 !== "" && value2 !== 0;
|
|
238000
|
+
function isFullWidth(value2) {
|
|
238001
|
+
if (widthIsPercentage(value2) !== true) return false;
|
|
238002
|
+
const n = typeof value2 === "object" && value2 !== null ? value2.value : parseFloat(String(value2));
|
|
238003
|
+
return Number(n) >= 100;
|
|
238004
|
+
}
|
|
238005
|
+
function spans(params) {
|
|
238006
|
+
return isFullWidth(params["width"]) && !isSet2(params["maxWidth"]) && !isSet2(params["paddingLeft"]) && !isSet2(params["paddingRight"]);
|
|
238007
|
+
}
|
|
238008
|
+
var isCard = (params) => isSet2(params["borderRadius"]) || painted15(params["borderStyle"]);
|
|
238009
|
+
var SECTION_ELEMENTS = /* @__PURE__ */ new Set(["section", "header", "footer"]);
|
|
238010
|
+
var painted15 = (value2) => isSet2(value2) && value2 !== "transparent" && value2 !== "none";
|
|
238011
|
+
function isBand(node, catalog) {
|
|
238012
|
+
if (node.type !== GROUP2) return false;
|
|
238013
|
+
const params = resolved2(node, catalog);
|
|
238014
|
+
if (!spans(params)) return false;
|
|
238015
|
+
if ((params["flexDirection"] ?? "column") !== "column") return false;
|
|
238016
|
+
if (params["alignItems"] !== "center") return false;
|
|
238017
|
+
if (params["position"] === "absolute" || params["position"] === "fixed") return false;
|
|
238018
|
+
if (isCard(params)) return false;
|
|
238019
|
+
return isSet2(params["paddingTop"]) || isSet2(params["paddingBottom"]) || painted15(params["backgroundColor"]) || painted15(params["backgroundGradient"]) || painted15(params["backgroundImage"]) || SECTION_ELEMENTS.has(String(params["as"] ?? ""));
|
|
238020
|
+
}
|
|
238021
|
+
var bandWithoutShell = {
|
|
238022
|
+
code: "band-without-shell" /* BandWithoutShell */,
|
|
238023
|
+
description: "A full-width band holds its content directly instead of inside one shell, so the content runs to the window edge.",
|
|
238024
|
+
defaultEnabled: true,
|
|
238025
|
+
run(ctx) {
|
|
238026
|
+
const out = [];
|
|
238027
|
+
for (const { component, nodeById } of ctx.components) {
|
|
238028
|
+
const inFlowChildren2 = (parent) => (parent.children ?? []).map((id) => nodeById.get(id)).filter((n) => {
|
|
238029
|
+
if (!n) return false;
|
|
238030
|
+
if (isComponentRef(n.type)) return true;
|
|
238031
|
+
if (!ctx.catalog.getNode(n.type)?.isVisual) return false;
|
|
238032
|
+
const p = resolved2(n, ctx.catalog);
|
|
238033
|
+
return p["position"] !== "absolute" && p["position"] !== "fixed";
|
|
238034
|
+
});
|
|
238035
|
+
const guarded = (n, depth = 0) => {
|
|
238036
|
+
if (isComponentRef(n.type)) return true;
|
|
238037
|
+
if (n.type !== GROUP2) return false;
|
|
238038
|
+
const p = resolved2(n, ctx.catalog);
|
|
238039
|
+
if (isSet2(p["maxWidth"]) || isSet2(p["paddingLeft"]) || isSet2(p["paddingRight"])) return true;
|
|
238040
|
+
const kids = inFlowChildren2(n);
|
|
238041
|
+
return depth < 4 && kids.length > 0 && kids.every((k) => guarded(k, depth + 1));
|
|
238042
|
+
};
|
|
238043
|
+
for (const band of component.nodes) {
|
|
238044
|
+
if (!isBand(band, ctx.catalog)) continue;
|
|
238045
|
+
let placed = true;
|
|
238046
|
+
for (let up = band.parent ? nodeById.get(band.parent) : void 0; up; up = up.parent ? nodeById.get(up.parent) : void 0) {
|
|
238047
|
+
if (up.type === "Page") break;
|
|
238048
|
+
const p = up.type === GROUP2 ? resolved2(up, ctx.catalog) : void 0;
|
|
238049
|
+
if (!p || !spans(p) || isCard(p)) {
|
|
238050
|
+
placed = false;
|
|
238051
|
+
break;
|
|
238052
|
+
}
|
|
238053
|
+
}
|
|
238054
|
+
if (!placed) continue;
|
|
238055
|
+
const inside = inFlowChildren2(band);
|
|
238056
|
+
if (inside.length === 0) continue;
|
|
238057
|
+
if (inside.some((n) => isBand(n, ctx.catalog))) continue;
|
|
238058
|
+
const bare2 = inside.filter((n) => !guarded(n));
|
|
238059
|
+
if (bare2.length === 0) continue;
|
|
238060
|
+
const what = bare2.length === inside.length && inside.length > 1 ? `it holds ${inside.length} things directly (${named2(inside)}) instead of one shell` : `${named2(bare2)} ${bare2.length === 1 ? "sits" : "sit"} in it outside a shell`;
|
|
238061
|
+
out.push({
|
|
238062
|
+
code: "band-without-shell" /* BandWithoutShell */,
|
|
238063
|
+
severity: "warning",
|
|
238064
|
+
message: `This is a full-width band (a section of the page), but ${what}, so its words and pictures run to the edge of the window on a desktop. Put everything it holds inside ONE Group with the style vocabulary's "shell" look (maxWidth 1200px, paddingLeft and paddingRight var(--space-6), sizeMode contentHeight), and make that Group the band's only child.`,
|
|
238065
|
+
location: {
|
|
238066
|
+
component: component.name,
|
|
238067
|
+
nodeId: band.id,
|
|
238068
|
+
nodeType: band.type,
|
|
238069
|
+
...band.label ? { nodeLabel: band.label } : {}
|
|
238070
|
+
},
|
|
238071
|
+
suggestion: 'one child Group with the "shell" look'
|
|
238072
|
+
});
|
|
238073
|
+
}
|
|
238074
|
+
}
|
|
238075
|
+
return out;
|
|
238076
|
+
}
|
|
238077
|
+
};
|
|
238078
|
+
|
|
238079
|
+
// ../noodl-editor/src/editor/src/validation/rules/clickAreaHoldsAControl.ts
|
|
238080
|
+
var CONTROL_TYPES = /* @__PURE__ */ new Map([
|
|
238081
|
+
["net.noodl.controls.button", "Button"],
|
|
238082
|
+
["net.noodl.controls.textinput", "Text Input"],
|
|
238083
|
+
["net.noodl.controls.checkbox", "Checkbox"],
|
|
238084
|
+
["net.noodl.controls.radiobutton", "Radio Button"],
|
|
238085
|
+
["net.noodl.controls.options", "Dropdown"],
|
|
238086
|
+
["net.noodl.controls.range", "Slider"]
|
|
238087
|
+
]);
|
|
238088
|
+
var CLICK = "onClick";
|
|
238089
|
+
var COMPONENT_OUTPUTS2 = "Component Outputs";
|
|
238090
|
+
var clickWired = (component, node) => component.connections.some((c) => c.fromId === node.id && c.fromProperty === CLICK);
|
|
238091
|
+
function reaches4(component, nodeById, node, port5, used) {
|
|
238092
|
+
return component.connections.some((c) => {
|
|
238093
|
+
if (c.fromId !== node.id || c.fromProperty !== port5) return false;
|
|
238094
|
+
if (nodeById.get(c.toId)?.type !== COMPONENT_OUTPUTS2) return true;
|
|
238095
|
+
return used === "all" || used.has(c.toProperty);
|
|
238096
|
+
});
|
|
238097
|
+
}
|
|
238098
|
+
var quoted = (node) => node.label ? ` ("${node.label}")` : "";
|
|
238099
|
+
var clickAreaHoldsAControl = {
|
|
238100
|
+
code: "click-area-holds-a-control" /* ClickAreaHoldsAControl */,
|
|
238101
|
+
description: "An element whose Click is wired holds a control, so the keyboard reaches the control and not the element.",
|
|
238102
|
+
defaultEnabled: true,
|
|
238103
|
+
run(ctx) {
|
|
238104
|
+
const out = [];
|
|
238105
|
+
const byPath = new Map(ctx.components.map((c) => [refToPath(c.component.name), c]));
|
|
238106
|
+
const memo = /* @__PURE__ */ new Map();
|
|
238107
|
+
const componentHolds = (ref, used) => {
|
|
238108
|
+
const path10 = refToPath(ref);
|
|
238109
|
+
const key = `${path10}|${[...used].sort().join(",")}`;
|
|
238110
|
+
if (memo.has(key)) return memo.get(key) ?? null;
|
|
238111
|
+
memo.set(key, null);
|
|
238112
|
+
const entry = byPath.get(path10);
|
|
238113
|
+
let found = null;
|
|
238114
|
+
if (entry) {
|
|
238115
|
+
for (const node of entry.component.nodes) {
|
|
238116
|
+
found = held(node, entry.component, entry.nodeById, used);
|
|
238117
|
+
if (found) break;
|
|
238118
|
+
}
|
|
238119
|
+
}
|
|
238120
|
+
memo.set(key, found);
|
|
238121
|
+
return found;
|
|
238122
|
+
};
|
|
238123
|
+
function held(node, component, nodeById, used) {
|
|
238124
|
+
const control = CONTROL_TYPES.get(node.type);
|
|
238125
|
+
if (control) return `a ${control}${quoted(node)}`;
|
|
238126
|
+
if (reaches4(component, nodeById, node, CLICK, used)) {
|
|
238127
|
+
return `${node.label ? `"${node.label}"` : "an element"}, which answers a click of its own`;
|
|
238128
|
+
}
|
|
238129
|
+
if (isComponentRef(node.type)) {
|
|
238130
|
+
const ports = new Set(component.connections.filter((c) => c.fromId === node.id).map((c) => c.fromProperty));
|
|
238131
|
+
const usedHere = new Set([...ports].filter((port5) => reaches4(component, nodeById, node, port5, used)));
|
|
238132
|
+
const inside = componentHolds(node.type, usedHere);
|
|
238133
|
+
if (inside) return `the component ${node.label ? `"${node.label}"` : `"${refToPath(node.type)}"`}, which holds ${inside}`;
|
|
238134
|
+
}
|
|
238135
|
+
return null;
|
|
238136
|
+
}
|
|
238137
|
+
for (const { component, nodeById } of ctx.components) {
|
|
238138
|
+
for (const area of component.nodes) {
|
|
238139
|
+
if (CONTROL_TYPES.has(area.type) || !clickWired(component, area)) continue;
|
|
238140
|
+
if (!ctx.catalog.getNode(area.type)?.isVisual) continue;
|
|
238141
|
+
let inner = null;
|
|
238142
|
+
const stack = [...area.children ?? []];
|
|
238143
|
+
while (stack.length && !inner) {
|
|
238144
|
+
const node = nodeById.get(stack.shift());
|
|
238145
|
+
if (!node) continue;
|
|
238146
|
+
inner = held(node, component, nodeById, "all");
|
|
238147
|
+
stack.push(...node.children ?? []);
|
|
238148
|
+
}
|
|
238149
|
+
if (!inner) continue;
|
|
238150
|
+
const name2 = area.label ? `"${area.label}"` : `This ${ctx.catalog.getNode(area.type)?.displayName ?? area.type}`;
|
|
238151
|
+
out.push({
|
|
238152
|
+
code: "click-area-holds-a-control" /* ClickAreaHoldsAControl */,
|
|
238153
|
+
severity: "info",
|
|
238154
|
+
message: `${name2} answers a click. It holds ${inner}. The Tab key stops on what it holds instead. A person using a keyboard or a screen reader cannot press ${area.label ? name2 : "it"} itself. If its click does something nothing inside it does, give that its own Button.`,
|
|
238155
|
+
location: {
|
|
238156
|
+
component: component.name,
|
|
238157
|
+
nodeId: area.id,
|
|
238158
|
+
nodeType: area.type,
|
|
238159
|
+
...area.label ? { nodeLabel: area.label } : {},
|
|
238160
|
+
port: CLICK,
|
|
238161
|
+
plug: "output"
|
|
238162
|
+
}
|
|
238163
|
+
});
|
|
238164
|
+
}
|
|
238165
|
+
}
|
|
238166
|
+
return out;
|
|
238167
|
+
}
|
|
238168
|
+
};
|
|
238169
|
+
|
|
237374
238170
|
// ../noodl-editor/src/editor/src/validation/rules/index.ts
|
|
237375
238171
|
var ALL_RULES = [
|
|
237376
238172
|
duplicateNodeId,
|
|
@@ -237427,6 +238223,10 @@ var ALL_RULES = [
|
|
|
237427
238223
|
// arrangement ones.
|
|
237428
238224
|
functionScriptNotCompiled,
|
|
237429
238225
|
functionNeverReruns,
|
|
238226
|
+
functionRunOnChangeUnknown,
|
|
238227
|
+
// P112-OWN018-FANOUT (ruled 2026-10-27 "Teach it and warn") — beside the Function rules: what a graph's signals do in
|
|
238228
|
+
// what order, read from the wires. Two gates off one signal, one changing what the other reads.
|
|
238229
|
+
conditionReadsASiblingsChange,
|
|
237430
238230
|
repeatedSiblingSubtree,
|
|
237431
238231
|
// DEF-025 — beside `repeatedSiblingSubtree` because both read the visual
|
|
237432
238232
|
// tree's arrangement rather than wires: that one asks whether siblings
|
|
@@ -237440,10 +238240,15 @@ var ALL_RULES = [
|
|
|
237440
238240
|
// against the shipped corpus before they were written — this one is 0 hits
|
|
237441
238241
|
// on all ten templates.
|
|
237442
238242
|
dialogWithoutName,
|
|
238243
|
+
// P121-TWO003-NESTEDBUTTON (ruled 2026-10-27) — beside the two above: what a keyboard and a screen reader reach, read
|
|
238244
|
+
// from the arrangement. An info, live, so the Problems panel and an agent's write both say it.
|
|
238245
|
+
clickAreaHoldsAControl,
|
|
237443
238246
|
// P112-OWN020-PILLWRAP / FILLGROW (ruled 2026-10-26: warn and teach) — a node with no size setting fills its parent,
|
|
237444
238247
|
// read from the arrangement like the two above, and live so a person sees it while editing.
|
|
237445
238248
|
contentRowSplitsItsChildren,
|
|
237446
238249
|
rowOfWordsFillsItsColumn,
|
|
238250
|
+
// P112 OWN-028 AC3 — beside the two above: a band's content outside a shell, read from the arrangement, live.
|
|
238251
|
+
bandWithoutShell,
|
|
237447
238252
|
oversizedPage,
|
|
237448
238253
|
// LEG-002 — last, and deliberately: it is the only rule in the set that
|
|
237449
238254
|
// reports a matter of legibility rather than of correctness, and a reader
|
|
@@ -237543,11 +238348,11 @@ function readProjectForDeploy(dir, format) {
|
|
|
237543
238348
|
const { legacy, warnings } = readLegacyProject(dir, format);
|
|
237544
238349
|
const report3 = validateLegacyProject(legacy);
|
|
237545
238350
|
if (report3.summary.errors > 0) {
|
|
237546
|
-
const
|
|
238351
|
+
const named3 = report3.diagnostics.filter((diagnostic) => diagnostic.severity === "error").slice(0, 5).map((d) => ` ${d.component}${d.nodeId ? ` \u203A ${d.nodeId}` : ""}: ${d.message}`);
|
|
237547
238352
|
throw new Error(
|
|
237548
238353
|
`${dir} has ${report3.summary.errors} validation error(s) and was not deployed:
|
|
237549
|
-
` +
|
|
237550
|
-
\u2026 and ${report3.summary.errors -
|
|
238354
|
+
` + named3.join("\n") + (report3.summary.errors > named3.length ? `
|
|
238355
|
+
\u2026 and ${report3.summary.errors - named3.length} more` : "")
|
|
237551
238356
|
);
|
|
237552
238357
|
}
|
|
237553
238358
|
const built = buildProjectModel(legacy, dir);
|