@nodegx/mcp 0.2.7 → 0.2.8

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.
@@ -15965,7 +15965,10 @@ var require_nodedefinition = __commonJS({
15965
15965
  node.registerOutput(name2, {
15966
15966
  getter: function() {
15967
15967
  return void 0;
15968
- }
15968
+ },
15969
+ onFirstConnectionAdded: output.onFirstConnectionAdded,
15970
+ onLastConnectionRemoved: output.onLastConnectionRemoved
15971
+ // a signal keeps its wire hooks (P121-TWO003)
15969
15972
  });
15970
15973
  } else {
15971
15974
  node.registerOutput(name2, output);
@@ -19928,6 +19931,7 @@ var require_simplejavascript = __commonJS({
19928
19931
  return names;
19929
19932
  }
19930
19933
  function publishHeldWrites(node) {
19934
+ sendHeldChanges(node);
19931
19935
  node._internal.heldWrites.forEach((prop) => {
19932
19936
  node.registerOutputIfNeeded("out-" + prop);
19933
19937
  node.flagOutputDirty("out-" + prop);
@@ -19971,7 +19975,7 @@ var require_simplejavascript = __commonJS({
19971
19975
  if (value2 !== this._internal.outputValues[prop]) {
19972
19976
  this.registerOutputIfNeeded("out-" + prop);
19973
19977
  this._internal.outputValues[prop] = value2;
19974
- this.flagOutputDirty("out-" + prop);
19978
+ holdChange(this, prop);
19975
19979
  this._internal.heldWrites.delete(prop);
19976
19980
  } else {
19977
19981
  this._internal.heldWrites.add(prop);
@@ -20150,7 +20154,7 @@ var require_simplejavascript = __commonJS({
20150
20154
  });
20151
20155
  },
20152
20156
  runScript: async function() {
20153
- const func = this._internal.func;
20157
+ const func = sendingChangesAfterTheSyncPart(this, this._internal.func);
20154
20158
  const tokens = this._internal.pendingRunOutcomes || [];
20155
20159
  this._internal.pendingRunOutcomes = void 0;
20156
20160
  if (func === void 0) {
@@ -20592,6 +20596,32 @@ var require_simplejavascript = __commonJS({
20592
20596
  });
20593
20597
  }
20594
20598
  };
20599
+ function holdChange(node, prop) {
20600
+ const internal2 = node._internal;
20601
+ if (!internal2.heldChanges) internal2.heldChanges = /* @__PURE__ */ new Set();
20602
+ internal2.heldChanges.add(prop);
20603
+ if (internal2.heldChangesQueued) return;
20604
+ internal2.heldChangesQueued = true;
20605
+ Promise.resolve().then(() => sendHeldChanges(node));
20606
+ }
20607
+ function sendHeldChanges(node) {
20608
+ const internal2 = node._internal;
20609
+ internal2.heldChangesQueued = false;
20610
+ const held = internal2.heldChanges;
20611
+ if (!held || held.size === 0 || node._deleted) return;
20612
+ internal2.heldChanges = /* @__PURE__ */ new Set();
20613
+ held.forEach((prop) => node.flagOutputDirty("out-" + prop));
20614
+ }
20615
+ function sendingChangesAfterTheSyncPart(node, func) {
20616
+ if (func === void 0) return void 0;
20617
+ return function(...args) {
20618
+ try {
20619
+ return func.apply(this, args);
20620
+ } finally {
20621
+ sendHeldChanges(node);
20622
+ }
20623
+ };
20624
+ }
20595
20625
  module2.exports = SimpleJavascriptNodeModule;
20596
20626
  }
20597
20627
  });
@@ -60269,6 +60299,133 @@ var init_tooltips = __esm({
60269
60299
  }
60270
60300
  });
60271
60301
 
60302
+ // ../noodl-viewer-react/src/keyboard-click.ts
60303
+ function holdsPressable(el) {
60304
+ return el.querySelector(PRESSABLE_INSIDE) !== null;
60305
+ }
60306
+ function clickIsWired(node) {
60307
+ if (!node.hasOutput("onClick")) return false;
60308
+ return reachesSomething(node.getOutput("onClick"), 0);
60309
+ }
60310
+ function reachesSomething(output, depth) {
60311
+ if (!output.hasConnections()) return false;
60312
+ if (!Array.isArray(output.connections)) return true;
60313
+ return output.connections.some((c) => !goesNowhere(c, depth));
60314
+ }
60315
+ function goesNowhere(connection, depth) {
60316
+ const target = connection.node;
60317
+ if (!target || target.name !== "Component Outputs" || typeof connection.inputPortName !== "string") return false;
60318
+ const owner = target.nodeScope?.componentOwner;
60319
+ if (!owner || depth > 16 || owner._internal?.creatorCallbacks) return false;
60320
+ if (typeof owner.hasOutput !== "function" || typeof owner.getOutput !== "function") return false;
60321
+ if (!owner.hasOutput(connection.inputPortName)) return true;
60322
+ return !reachesSomething(owner.getOutput(connection.inputPortName), depth + 1);
60323
+ }
60324
+ function isNativelyInteractive(el) {
60325
+ const tag = el.tagName;
60326
+ if (tag === "BUTTON" || tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA" || tag === "SUMMARY") return true;
60327
+ if ((tag === "A" || tag === "AREA") && el.hasAttribute("href")) return true;
60328
+ if ((tag === "VIDEO" || tag === "AUDIO") && el.hasAttribute("controls")) return true;
60329
+ return el.isContentEditable === true;
60330
+ }
60331
+ function isSpace(e) {
60332
+ return e.key === " " || e.key === "Spacebar";
60333
+ }
60334
+ function isOwnKey(el, e) {
60335
+ return e.target === el && !e.defaultPrevented && !e.altKey && !e.ctrlKey && !e.metaKey && !e.isComposing;
60336
+ }
60337
+ function mark(el) {
60338
+ let spaceArmed = false;
60339
+ const onKeyDown2 = (e) => {
60340
+ if (!isOwnKey(el, e)) return;
60341
+ if (e.key === "Enter") {
60342
+ e.preventDefault();
60343
+ if (!e.repeat) el.click();
60344
+ } else if (isSpace(e)) {
60345
+ e.preventDefault();
60346
+ if (!e.repeat) spaceArmed = true;
60347
+ }
60348
+ };
60349
+ const onKeyUp = (e) => {
60350
+ if (!isSpace(e)) return;
60351
+ const armed = spaceArmed;
60352
+ spaceArmed = false;
60353
+ if (armed && e.target === el && !e.defaultPrevented) el.click();
60354
+ };
60355
+ const m = { el, added: [], onKeyDown: onKeyDown2, onKeyUp, observer: null };
60356
+ if (isNativelyInteractive(el)) return m;
60357
+ refresh(m);
60358
+ if (typeof MutationObserver !== "undefined") {
60359
+ m.observer = new MutationObserver(() => refresh(m));
60360
+ m.observer.observe(el, {
60361
+ childList: true,
60362
+ subtree: true,
60363
+ attributes: true,
60364
+ attributeFilter: ["tabindex", "contenteditable", "href", "controls", "type"]
60365
+ });
60366
+ }
60367
+ return m;
60368
+ }
60369
+ function refresh(m) {
60370
+ const { el } = m;
60371
+ const want = !holdsPressable(el);
60372
+ if (want && !m.added.length) {
60373
+ if (!el.hasAttribute("tabindex")) {
60374
+ el.setAttribute("tabindex", "0");
60375
+ m.added.push("tabindex");
60376
+ }
60377
+ if (!el.hasAttribute("role")) {
60378
+ el.setAttribute("role", "button");
60379
+ m.added.push("role");
60380
+ }
60381
+ if (m.added.length) {
60382
+ el.setAttribute(KEYBOARD_CLICK_ATTRIBUTE, "");
60383
+ m.added.push(KEYBOARD_CLICK_ATTRIBUTE);
60384
+ el.addEventListener("keydown", m.onKeyDown);
60385
+ el.addEventListener("keyup", m.onKeyUp);
60386
+ }
60387
+ } else if (!want && m.added.length) {
60388
+ giveBack(m);
60389
+ }
60390
+ }
60391
+ function giveBack(m) {
60392
+ for (const name2 of m.added) m.el.removeAttribute(name2);
60393
+ m.added = [];
60394
+ m.el.removeEventListener("keydown", m.onKeyDown);
60395
+ m.el.removeEventListener("keyup", m.onKeyUp);
60396
+ }
60397
+ function unmark(m) {
60398
+ m.observer?.disconnect();
60399
+ giveBack(m);
60400
+ }
60401
+ function syncKeyboardClick(node) {
60402
+ const el = typeof node.getDOMElement === "function" ? node.getDOMElement() : null;
60403
+ const want = el && clickIsWired(node) ? el : null;
60404
+ const was = marked.get(node);
60405
+ if (was && was.el === want) return;
60406
+ if (was) {
60407
+ unmark(was);
60408
+ marked.delete(node);
60409
+ }
60410
+ if (want) marked.set(node, mark(want));
60411
+ }
60412
+ var KEYBOARD_CLICK_ATTRIBUTE, PRESSABLE_INSIDE, marked, KEYBOARD_CLICK_HOOKS;
60413
+ var init_keyboard_click = __esm({
60414
+ "../noodl-viewer-react/src/keyboard-click.ts"() {
60415
+ KEYBOARD_CLICK_ATTRIBUTE = "data-ndl-keyboard-click";
60416
+ 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"])';
60417
+ marked = /* @__PURE__ */ new WeakMap();
60418
+ KEYBOARD_CLICK_HOOKS = {
60419
+ onFirstConnectionAdded() {
60420
+ syncKeyboardClick(this);
60421
+ },
60422
+ onLastConnectionRemoved() {
60423
+ syncKeyboardClick(this);
60424
+ }
60425
+ };
60426
+ }
60427
+ });
60428
+
60272
60429
  // ../noodl-viewer-react/src/node-shared-port-definitions.ts
60273
60430
  function humanCorner(suffix) {
60274
60431
  return suffix.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
@@ -60536,6 +60693,7 @@ var init_node_shared_port_definitions = __esm({
60536
60693
  init_fontloader();
60537
60694
  init_media_source();
60538
60695
  init_tooltips();
60696
+ init_keyboard_click();
60539
60697
  SIZE_MODES = ["explicit", "contentWidth", "contentHeight", "contentSize"];
60540
60698
  node_shared_port_definitions_default = {
60541
60699
  addInputProps: addInputProps2,
@@ -61043,7 +61201,9 @@ var init_node_shared_port_definitions = __esm({
61043
61201
  description: "Fires when this element is clicked or tapped",
61044
61202
  group: "Events",
61045
61203
  type: "signal",
61046
- propPath: "pointer"
61204
+ propPath: "pointer",
61205
+ ...KEYBOARD_CLICK_HOOKS
61206
+ // P121-TWO003-GROUPKEYBOARD: wired, the element is a button to Tab and a screen reader
61047
61207
  },
61048
61208
  pointerDown: {
61049
61209
  displayName: "Pointer Down",
@@ -64772,6 +64932,7 @@ function createNodeFromReactComponent(def2) {
64772
64932
  }
64773
64933
  if (element) syncDataAttributesOnElement(this);
64774
64934
  if (element) elementChanged(this, element);
64935
+ syncKeyboardClick(this);
64775
64936
  },
64776
64937
  /**
64777
64938
  * NDA-012 (Visual) check A3 — run an imperative action on the inner React component,
@@ -65198,6 +65359,7 @@ var init_react_component_node = __esm({
65198
65359
  init_mergedeep();
65199
65360
  init_node_shared_port_definitions();
65200
65361
  init_node_transitions();
65362
+ init_keyboard_click();
65201
65363
  ICON_SOURCE_DIAGNOSTIC = "visual/icon-source-not-an-icon";
65202
65364
  DATA_ATTRIBUTE_NAME_PATTERN = "^data-[a-z0-9][a-z0-9._-]*$";
65203
65365
  DATA_ATTRIBUTE_NAME = new RegExp(DATA_ATTRIBUTE_NAME_PATTERN);
@@ -71968,6 +72130,38 @@ function _typeName(t) {
71968
72130
  if (typeof t === "object") return t.name;
71969
72131
  else return t;
71970
72132
  }
72133
+ function isInsideRow(node, row) {
72134
+ if (node === row) return true;
72135
+ let owner = (node.parentNodeScope || node.nodeScope)?.componentOwner;
72136
+ for (let depth = 0; owner && depth < 64; depth++) {
72137
+ if (owner === row) return true;
72138
+ const next = (owner.parentNodeScope || owner.nodeScope)?.componentOwner;
72139
+ if (next === owner) return false;
72140
+ owner = next;
72141
+ }
72142
+ return false;
72143
+ }
72144
+ function settleRow(context, row) {
72145
+ const self2 = row;
72146
+ for (let pass = 0; pass < 10; pass++) {
72147
+ const dirty = context._dirtyNodes;
72148
+ if (!Array.isArray(dirty)) return;
72149
+ const mine = [];
72150
+ for (let i2 = 0; i2 < dirty.length; i2++) {
72151
+ const node = dirty[i2];
72152
+ if (node && node._dirty && !node._deleted && mine.indexOf(node) === -1 && isInsideRow(node, self2))
72153
+ mine.push(node);
72154
+ }
72155
+ if (mine.length === 0) return;
72156
+ for (let i2 = 0; i2 < mine.length; i2++) {
72157
+ try {
72158
+ mine[i2].update();
72159
+ } catch (e) {
72160
+ console.error(e);
72161
+ }
72162
+ }
72163
+ }
72164
+ }
71971
72165
  var import_react16, import_runtime4, import_collection, import_model2, ITEMS_DIAGNOSTIC, defaultDynamicScript, ForEachDefinition, defaultMapCode, ForEachModule, foreach_default;
71972
72166
  var init_foreach = __esm({
71973
72167
  "../noodl-viewer-react/src/nodes/std-library/data/foreach.tsx"() {
@@ -72341,6 +72535,7 @@ var init_foreach = __esm({
72341
72535
  }
72342
72536
  }
72343
72537
  };
72538
+ settleRow(this.context, itemNode);
72344
72539
  const forEachActions = itemNode.nodeScope.getNodesWithType("For Each Actions");
72345
72540
  for (let j = 0; j < forEachActions.length; j++) {
72346
72541
  forEachActions[j].signalAdded();
@@ -81158,10 +81353,16 @@ function Text(props) {
81158
81353
  ...pointerProps(props),
81159
81354
  style: style2
81160
81355
  },
81161
- renderableText(props.text)
81356
+ style2.textOverflow === "ellipsis" ? (
81357
+ // P18-S112-FLEXELLIPSIS — the Text is `display: flex` (its default CSS, which Text Vertical Align's `alignItems`
81358
+ // needs), so its words were an anonymous flex item and `text-overflow` on the element drew no "…": Ellipsis
81359
+ // looked the same as Clip. The words go in a block of their own that may shrink to the box and draws the "…";
81360
+ // the element keeps its flex, so both alignments still place them.
81361
+ /* @__PURE__ */ import_react22.default.createElement("span", { style: { ...ELLIPSIS_LINE, overflow: style2.overflow } }, renderableText(props.text))
81362
+ ) : renderableText(props.text)
81162
81363
  );
81163
81364
  }
81164
- var import_react22;
81365
+ var import_react22, ELLIPSIS_LINE;
81165
81366
  var init_Text = __esm({
81166
81367
  "../noodl-viewer-react/src/components/visual/Text/Text.tsx"() {
81167
81368
  import_react22 = __toESM(require_react());
@@ -81169,6 +81370,7 @@ var init_Text = __esm({
81169
81370
  init_layout();
81170
81371
  init_pointerlisteners();
81171
81372
  init_noodl_root_ref();
81373
+ ELLIPSIS_LINE = { minWidth: 0, textOverflow: "ellipsis", whiteSpace: "nowrap" };
81172
81374
  }
81173
81375
  });
81174
81376
 
@@ -81542,7 +81744,6 @@ var init_Video = __esm({
81542
81744
  ...videoProps,
81543
81745
  playsInline: true,
81544
81746
  src,
81545
- ...pointerProps(this.props),
81546
81747
  ref: (video) => {
81547
81748
  this.video = video;
81548
81749
  this.props.innerRef(video);
@@ -81561,7 +81762,7 @@ var init_Video = __esm({
81561
81762
  this.canPlay = false;
81562
81763
  }
81563
81764
  setSourceObject(src) {
81564
- if (this.video.srcObject !== src) {
81765
+ if (this.video && this.video.srcObject !== src) {
81565
81766
  this.video.srcObject = src;
81566
81767
  this.canPlay = false;
81567
81768
  }
@@ -81667,6 +81868,7 @@ var init_Video = __esm({
81667
81868
  CachedVideo,
81668
81869
  {
81669
81870
  ...props.dom,
81871
+ ...pointerProps(this.props),
81670
81872
  className: withDefaultsClass(props.className, defaultsClass),
81671
81873
  style: style2,
81672
81874
  innerRef: (video) => {
@@ -88775,6 +88977,7 @@ var init_parentcomponentobject = __esm({
88775
88977
  */
88776
88978
  nodeScopeDidInitialize() {
88777
88979
  this.context.scheduleAfterUpdate(() => {
88980
+ if (this._deleted) return;
88778
88981
  this._internal.resolutionIsLoud = true;
88779
88982
  this.onComponentStateNodesChanged();
88780
88983
  });
@@ -93151,7 +93354,7 @@ var init_signinwith = __esm({
93151
93354
  const tokens = [this.beginOutcome()];
93152
93355
  if (state2.succeeded) {
93153
93356
  this._internal.notice = state2.notice;
93154
- this._internal.error = void 0;
93357
+ this._internal.error = "";
93155
93358
  this.flagOutputDirty("notice");
93156
93359
  this.flagOutputDirty("error");
93157
93360
  reportOutcomes(this, tokens, "done");
@@ -407,6 +407,7 @@
407
407
  "../noodl-viewer-react/src/easecurves.ts",
408
408
  "../noodl-viewer-react/src/fontloader.ts",
409
409
  "../noodl-viewer-react/src/guid.ts",
410
+ "../noodl-viewer-react/src/keyboard-click.ts",
410
411
  "../noodl-viewer-react/src/kit-node-boundary.ts",
411
412
  "../noodl-viewer-react/src/layout.ts",
412
413
  "../noodl-viewer-react/src/media-fragment.ts",
@@ -47268,7 +47268,7 @@
47268
47268
  "always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
47269
47269
  ],
47270
47270
  "visible": [
47271
- "always: shown or hidden at the next paint, its space kept; hidden, a Focus does not reach it"
47271
+ "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
47272
47272
  ]
47273
47273
  },
47274
47274
  "warnings": {
@@ -49453,7 +49453,7 @@
49453
49453
  "always: the page, or the scrolling Group holding it, scrolls until the box can be seen"
49454
49454
  ],
49455
49455
  "visible": [
49456
- "always: shown or hidden at the next paint, its space kept; hidden, a Focus does not reach it"
49456
+ "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
49457
49457
  ]
49458
49458
  },
49459
49459
  "warnings": {
@@ -52065,7 +52065,7 @@
52065
52065
  "always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
52066
52066
  ],
52067
52067
  "visible": [
52068
- "always: shown or hidden at the next paint, its space kept; hidden, a Focus does not reach it"
52068
+ "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
52069
52069
  ]
52070
52070
  },
52071
52071
  "warnings": {
@@ -54247,7 +54247,7 @@
54247
54247
  "always: the page, or the scrolling Group holding it, scrolls until the button can be seen"
54248
54248
  ],
54249
54249
  "visible": [
54250
- "always: shown or hidden at the next paint, its space kept; hidden, it takes no click and a Focus does not reach it"
54250
+ "always: shown or hidden at once, its space kept; hidden, it takes no click and a Focus does not reach it"
54251
54251
  ]
54252
54252
  },
54253
54253
  "warnings": {
@@ -56652,7 +56652,7 @@
56652
56652
  "always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
56653
56653
  ],
56654
56654
  "visible": [
56655
- "always: shown or hidden at the next paint, its space kept; hidden, a Focus does not reach it"
56655
+ "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
56656
56656
  ]
56657
56657
  },
56658
56658
  "warnings": {
@@ -59522,7 +59522,7 @@
59522
59522
  "always: the size it holds now, a bare number read in the unit it held; drawn at the next paint"
59523
59523
  ],
59524
59524
  "visible": [
59525
- "always: shown or hidden at the next paint, its space kept; hidden, a Focus does not reach it"
59525
+ "always: shown or hidden at once, its space kept; hidden, a Focus does not reach it"
59526
59526
  ],
59527
59527
  "opacity": [
59528
59528
  "always: how see-through it is; at exactly 0 it takes no pointer, and an act goes to what is behind it"
@@ -64364,7 +64364,7 @@
64364
64364
  },
64365
64365
  "isSignal": false,
64366
64366
  "default": false,
64367
- "description": "Whether a request with no valid session token is allowed to run this function at all"
64367
+ "description": "Whether a request with no valid session token is allowed to run this function at all. A run the app starts itself — a schedule, a row change, a run from Studio — is always allowed and sees nobody signed in; a webhook is a request like any other"
64368
64368
  },
64369
64369
  {
64370
64370
  "name": "params",