tutuca 0.11.2 → 0.12.0
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/tutuca-cli.js +130 -104
- package/dist/tutuca-dev.ext.js +121 -90
- package/dist/tutuca-dev.js +121 -90
- package/dist/tutuca-dev.min.js +3 -3
- package/dist/tutuca-extra.ext.js +116 -59
- package/dist/tutuca-extra.js +116 -59
- package/dist/tutuca-extra.min.js +2 -2
- package/dist/tutuca-storybook.js +3 -3
- package/dist/tutuca.ext.js +116 -59
- package/dist/tutuca.js +116 -59
- package/dist/tutuca.min.js +2 -2
- package/package.json +1 -1
- package/skill/margaui/SKILL.md +105 -0
- package/skill/margaui/components/accordion.md +127 -0
- package/skill/margaui/components/alert.md +174 -0
- package/skill/margaui/components/aura.md +97 -0
- package/skill/margaui/components/avatar.md +220 -0
- package/skill/margaui/components/badge.md +193 -0
- package/skill/margaui/components/breadcrumbs.md +103 -0
- package/skill/margaui/components/button.md +322 -0
- package/skill/margaui/components/calendar.md +67 -0
- package/skill/margaui/components/card.md +373 -0
- package/skill/margaui/components/carousel.md +387 -0
- package/skill/margaui/components/chat.md +171 -0
- package/skill/margaui/components/checkbox.md +101 -0
- package/skill/margaui/components/collapse.md +172 -0
- package/skill/margaui/components/countdown.md +165 -0
- package/skill/margaui/components/diff.md +53 -0
- package/skill/margaui/components/divider.md +107 -0
- package/skill/margaui/components/dock.md +173 -0
- package/skill/margaui/components/drawer.md +184 -0
- package/skill/margaui/components/dropdown.md +388 -0
- package/skill/margaui/components/fab.md +346 -0
- package/skill/margaui/components/fieldset.md +88 -0
- package/skill/margaui/components/file-input.md +84 -0
- package/skill/margaui/components/filter.md +52 -0
- package/skill/margaui/components/footer.md +583 -0
- package/skill/margaui/components/hero.md +135 -0
- package/skill/margaui/components/hover-3d.md +129 -0
- package/skill/margaui/components/hover-gallery.md +49 -0
- package/skill/margaui/components/indicator.md +265 -0
- package/skill/margaui/components/input.md +389 -0
- package/skill/margaui/components/join.md +100 -0
- package/skill/margaui/components/kbd.md +127 -0
- package/skill/margaui/components/label.md +102 -0
- package/skill/margaui/components/link.md +96 -0
- package/skill/margaui/components/list.md +182 -0
- package/skill/margaui/components/loading.md +105 -0
- package/skill/margaui/components/mask.md +168 -0
- package/skill/margaui/components/megamenu.md +131 -0
- package/skill/margaui/components/menu.md +887 -0
- package/skill/margaui/components/mockup-browser.md +39 -0
- package/skill/margaui/components/mockup-code.md +81 -0
- package/skill/margaui/components/mockup-phone.md +39 -0
- package/skill/margaui/components/mockup-window.md +33 -0
- package/skill/margaui/components/modal.md +196 -0
- package/skill/margaui/components/navbar.md +282 -0
- package/skill/margaui/components/otp.md +171 -0
- package/skill/margaui/components/pagination.md +122 -0
- package/skill/margaui/components/progress.md +135 -0
- package/skill/margaui/components/radial-progress.md +67 -0
- package/skill/margaui/components/radio.md +133 -0
- package/skill/margaui/components/range.md +134 -0
- package/skill/margaui/components/rating.md +170 -0
- package/skill/margaui/components/select.md +225 -0
- package/skill/margaui/components/skeleton.md +64 -0
- package/skill/margaui/components/stack.md +142 -0
- package/skill/margaui/components/stat.md +254 -0
- package/skill/margaui/components/status.md +73 -0
- package/skill/margaui/components/steps.md +138 -0
- package/skill/margaui/components/swap.md +152 -0
- package/skill/margaui/components/tab.md +248 -0
- package/skill/margaui/components/table.md +1018 -0
- package/skill/margaui/components/text-rotate.md +91 -0
- package/skill/margaui/components/textarea.md +85 -0
- package/skill/margaui/components/theme-controller.md +266 -0
- package/skill/margaui/components/timeline.md +1356 -0
- package/skill/margaui/components/toast.md +165 -0
- package/skill/margaui/components/toggle.md +135 -0
- package/skill/margaui/components/tooltip.md +181 -0
- package/skill/margaui/components/validator.md +163 -0
- package/skill/tutuca/SKILL.md +56 -0
- package/skill/tutuca/advanced.md +212 -0
- package/skill/tutuca/cli.md +239 -0
- package/skill/tutuca/component-design.md +168 -0
- package/skill/tutuca/core.md +918 -0
- package/skill/tutuca/iteration.md +207 -0
- package/skill/tutuca/macros.md +86 -0
- package/skill/tutuca/margaui.md +175 -0
- package/skill/tutuca/messages-and-intents.md +399 -0
- package/skill/tutuca/patterns/README.md +48 -0
- package/skill/tutuca/patterns/add-a-story.md +26 -0
- package/skill/tutuca/patterns/bind-text-and-attributes.md +30 -0
- package/skill/tutuca/patterns/conditional-attribute-value.md +29 -0
- package/skill/tutuca/patterns/coordinate-components.md +54 -0
- package/skill/tutuca/patterns/edit-through-a-dynamic-target.md +27 -0
- package/skill/tutuca/patterns/enrich-each-item.md +25 -0
- package/skill/tutuca/patterns/file-input.md +39 -0
- package/skill/tutuca/patterns/filter-a-list.md +25 -0
- package/skill/tutuca/patterns/filter-and-paginate.md +60 -0
- package/skill/tutuca/patterns/handle-events.md +44 -0
- package/skill/tutuca/patterns/iterate-a-list.md +18 -0
- package/skill/tutuca/patterns/paginate-a-list.md +29 -0
- package/skill/tutuca/patterns/render-a-child-component.md +21 -0
- package/skill/tutuca/patterns/reuse-markup-with-macros.md +36 -0
- package/skill/tutuca/patterns/share-state-across-the-tree.md +38 -0
- package/skill/tutuca/patterns/show-or-hide-content.md +23 -0
- package/skill/tutuca/patterns/switch-between-views.md +30 -0
- package/skill/tutuca/patterns/tabbed-interface.md +43 -0
- package/skill/tutuca/semantics.md +195 -0
- package/skill/tutuca/storybook.md +270 -0
- package/skill/tutuca/styles.md +48 -0
- package/skill/tutuca/testing.md +345 -0
- package/skill/tutuca-source/SKILL.md +33 -0
- package/skill/tutuca-source/tutuca.ext.js +4301 -0
package/dist/tutuca-dev.js
CHANGED
|
@@ -5469,6 +5469,9 @@ var PathBuilder = class {
|
|
|
5469
5469
|
}
|
|
5470
5470
|
};
|
|
5471
5471
|
|
|
5472
|
+
// src/util/env.js
|
|
5473
|
+
var isMac = (globalThis.navigator?.userAgent ?? "").toLowerCase().includes("mac");
|
|
5474
|
+
|
|
5472
5475
|
// src/value.js
|
|
5473
5476
|
var VALID_VAL_ID_RE = /^[a-zA-Z][a-zA-Z0-9_]*\??$/;
|
|
5474
5477
|
var isValidValId = (name) => VALID_VAL_ID_RE.test(name);
|
|
@@ -5487,6 +5490,7 @@ var K_NAME = 32;
|
|
|
5487
5490
|
var K_TYPE = 64;
|
|
5488
5491
|
var K_SEQ = 256;
|
|
5489
5492
|
var K_METHOD = 1024;
|
|
5493
|
+
var K_EVENT = 2048;
|
|
5490
5494
|
var G_BOOL = K_FIELD | K_METHOD | K_BIND | K_DYN | K_CONST;
|
|
5491
5495
|
var G_TEXT = G_BOOL | K_STRTPL;
|
|
5492
5496
|
var G_COMPONENT = K_FIELD | K_SEQ | K_DYN;
|
|
@@ -5494,6 +5498,7 @@ var G_SEQUENCE = K_FIELD | K_DYN;
|
|
|
5494
5498
|
var G_PROVIDE = K_FIELD | K_SEQ;
|
|
5495
5499
|
var G_FIELD = K_FIELD | K_METHOD | K_CONST | K_SEQ;
|
|
5496
5500
|
var G_VALUE = K_FIELD | K_METHOD | K_BIND | K_DYN | K_NAME | K_TYPE | K_CONST;
|
|
5501
|
+
var G_HANDLER_ARG = G_VALUE & ~K_NAME | K_EVENT;
|
|
5497
5502
|
var G_ALL = G_VALUE | K_STRTPL | K_SEQ;
|
|
5498
5503
|
function sizeOf(v) {
|
|
5499
5504
|
if (v == null) return null;
|
|
@@ -5503,6 +5508,10 @@ function sizeOf(v) {
|
|
|
5503
5508
|
if (typeof l === "number") return l;
|
|
5504
5509
|
return isPlainObject(v) ? Object.keys(v).length : null;
|
|
5505
5510
|
}
|
|
5511
|
+
var toNullIfNaN = (v) => Number.isNaN(v) ? null : v;
|
|
5512
|
+
function getValue(e) {
|
|
5513
|
+
return e.target.type === "checkbox" ? e.target.checked : (e instanceof CustomEvent ? e.detail : e.target.value) ?? null;
|
|
5514
|
+
}
|
|
5506
5515
|
var predTruthy = (v) => {
|
|
5507
5516
|
const n = sizeOf(v);
|
|
5508
5517
|
return n === null ? !!v : n > 0;
|
|
@@ -5553,6 +5562,10 @@ function parseToken(s, px) {
|
|
|
5553
5562
|
const num = VALID_FLOAT_RE.test(s) ? parseFloat(s) : null;
|
|
5554
5563
|
if (Number.isFinite(num)) return new ConstVal(num);
|
|
5555
5564
|
if (s === "true" || s === "false") return new ConstVal(s === "true");
|
|
5565
|
+
if (c0 === 101) {
|
|
5566
|
+
const m = /^e(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.exec(s);
|
|
5567
|
+
if (m !== null) return new EventMemberVal(s.split(".").slice(1));
|
|
5568
|
+
}
|
|
5556
5569
|
if (c0 >= 97 && c0 <= 122) return mkVal(s, NameVal);
|
|
5557
5570
|
if (c0 >= 65 && c0 <= 90) return mkVal(s, TypeVal);
|
|
5558
5571
|
return null;
|
|
@@ -5628,7 +5641,7 @@ function _parseHandler(s, px, namespace, allowArgs, report, allowMethod) {
|
|
|
5628
5641
|
const args = new Array(tokens.length - 1);
|
|
5629
5642
|
for (let i = 1; i < tokens.length; i++) {
|
|
5630
5643
|
const val = parseToken(tokens[i], px);
|
|
5631
|
-
if (val !== null && kindOf(val) &
|
|
5644
|
+
if (val !== null && kindOf(val) & G_HANDLER_ARG) args[i - 1] = val;
|
|
5632
5645
|
else {
|
|
5633
5646
|
if (report) px.onParseIssue("bad-value", { role: "handler-arg", value: tokens[i] });
|
|
5634
5647
|
args[i - 1] = NULL_CONST_VAL;
|
|
@@ -5671,6 +5684,7 @@ function kindOf(val) {
|
|
|
5671
5684
|
if (val instanceof DynVal) return K_DYN;
|
|
5672
5685
|
if (val instanceof TypeVal) return K_TYPE;
|
|
5673
5686
|
if (val instanceof NameVal) return K_NAME;
|
|
5687
|
+
if (val instanceof EventMemberVal) return K_EVENT;
|
|
5674
5688
|
return 0;
|
|
5675
5689
|
}
|
|
5676
5690
|
var BaseVal = class {
|
|
@@ -5795,11 +5809,14 @@ var HandlerNameVal = class extends NameVal {
|
|
|
5795
5809
|
this.namespace = namespace;
|
|
5796
5810
|
}
|
|
5797
5811
|
eval(stack) {
|
|
5798
|
-
return stack.getHandlerFor(this.name, this.namespace) ?? mk404Handler(this.namespace, this.name);
|
|
5812
|
+
return stack.getHandlerFor(this.name, this.namespace) ?? mk404Handler(stack, this.namespace, this.name);
|
|
5799
5813
|
}
|
|
5800
5814
|
};
|
|
5801
|
-
var mk404Handler = (type3, name) => function(...args) {
|
|
5802
|
-
|
|
5815
|
+
var mk404Handler = (stack, type3, name) => function(...args) {
|
|
5816
|
+
const transactor = stack?.ctx?.transactor;
|
|
5817
|
+
if (transactor)
|
|
5818
|
+
transactor.refuse("NO_HANDLER", { namespace: type3, name, argCount: args.length });
|
|
5819
|
+
else console.warn("handler not found", { type: type3, name });
|
|
5803
5820
|
return this;
|
|
5804
5821
|
};
|
|
5805
5822
|
var TypeVal = class extends NameVal {
|
|
@@ -5807,6 +5824,53 @@ var TypeVal = class extends NameVal {
|
|
|
5807
5824
|
return stack.lookupType(this.name);
|
|
5808
5825
|
}
|
|
5809
5826
|
};
|
|
5827
|
+
var keyIs = (k) => (e) => e.key === k;
|
|
5828
|
+
var macCtrl = (e) => isMac && e.metaKey || e.ctrlKey;
|
|
5829
|
+
var nullSafe = (fn) => (e, stack) => {
|
|
5830
|
+
const info = stack.lookupDragInfo();
|
|
5831
|
+
return info == null ? null : fn(info);
|
|
5832
|
+
};
|
|
5833
|
+
var EVENT_CONVENIENCES = {
|
|
5834
|
+
value: (e) => getValue(e),
|
|
5835
|
+
valueAsInt: (e) => toNullIfNaN(parseInt(getValue(e), 10)),
|
|
5836
|
+
valueAsFloat: (e) => toNullIfNaN(parseFloat(getValue(e))),
|
|
5837
|
+
isAlt: (e) => e.altKey,
|
|
5838
|
+
isShift: (e) => e.shiftKey,
|
|
5839
|
+
isCtrl: macCtrl,
|
|
5840
|
+
isCmd: macCtrl,
|
|
5841
|
+
isUpKey: keyIs("ArrowUp"),
|
|
5842
|
+
isDownKey: keyIs("ArrowDown"),
|
|
5843
|
+
isSend: keyIs("Enter"),
|
|
5844
|
+
isCancel: keyIs("Escape"),
|
|
5845
|
+
isTabKey: keyIs("Tab"),
|
|
5846
|
+
dragInfo: (_e, stack) => stack.lookupDragInfo(),
|
|
5847
|
+
dragType: nullSafe((info) => info.type),
|
|
5848
|
+
dragValue: nullSafe((info) => info.val),
|
|
5849
|
+
dragKey: nullSafe((info) => info.lookupBind("key"))
|
|
5850
|
+
};
|
|
5851
|
+
var EventMemberVal = class extends BaseVal {
|
|
5852
|
+
constructor(members) {
|
|
5853
|
+
super();
|
|
5854
|
+
this.members = members;
|
|
5855
|
+
}
|
|
5856
|
+
eval(stack) {
|
|
5857
|
+
const e = stack.lookupEvent();
|
|
5858
|
+
if (e == null) return null;
|
|
5859
|
+
if (this.members.length === 1) {
|
|
5860
|
+
const convenience = EVENT_CONVENIENCES[this.members[0]];
|
|
5861
|
+
if (convenience !== void 0) return convenience(e, stack);
|
|
5862
|
+
}
|
|
5863
|
+
let v = e;
|
|
5864
|
+
for (const member of this.members) {
|
|
5865
|
+
if (v == null) return null;
|
|
5866
|
+
v = v[member];
|
|
5867
|
+
}
|
|
5868
|
+
return v ?? null;
|
|
5869
|
+
}
|
|
5870
|
+
toString() {
|
|
5871
|
+
return `e.${this.members.join(".")}`;
|
|
5872
|
+
}
|
|
5873
|
+
};
|
|
5810
5874
|
var RenderVal = class extends BaseVal {
|
|
5811
5875
|
render(stack, _rx) {
|
|
5812
5876
|
return this.eval(stack);
|
|
@@ -6738,9 +6802,6 @@ var unkIter = () => {
|
|
|
6738
6802
|
};
|
|
6739
6803
|
var SEQ_INFO = /* @__PURE__ */ Symbol.for("tutuca.seqInfo");
|
|
6740
6804
|
|
|
6741
|
-
// src/util/env.js
|
|
6742
|
-
var isMac = (globalThis.navigator?.userAgent ?? "").toLowerCase().includes("mac");
|
|
6743
|
-
|
|
6744
6805
|
// src/anode.js
|
|
6745
6806
|
function resolveDynProducer(comp, name) {
|
|
6746
6807
|
let producerComp, producerProvide;
|
|
@@ -10038,7 +10099,6 @@ var LOOKUP_BAD_SHAPE = "LOOKUP_BAD_SHAPE";
|
|
|
10038
10099
|
var LOOKUP_TARGET_MALFORMED = "LOOKUP_TARGET_MALFORMED";
|
|
10039
10100
|
var RENDER_IT_OUTSIDE_OF_LOOP = "RENDER_IT_OUTSIDE_OF_LOOP";
|
|
10040
10101
|
var UNKNOWN_EVENT_MODIFIER = "UNKNOWN_EVENT_MODIFIER";
|
|
10041
|
-
var UNKNOWN_HANDLER_ARG_NAME = "UNKNOWN_HANDLER_ARG_NAME";
|
|
10042
10102
|
var RECEIVE_HANDLER_NOT_IMPLEMENTED = "RECEIVE_HANDLER_NOT_IMPLEMENTED";
|
|
10043
10103
|
var EVENT_HANDLER_METHOD_NOT_ALLOWED = "EVENT_HANDLER_METHOD_NOT_ALLOWED";
|
|
10044
10104
|
var HANDLER_NAME_COLLISION = "HANDLER_NAME_COLLISION";
|
|
@@ -10392,29 +10452,6 @@ function checkEventModifiers(lx, view) {
|
|
|
10392
10452
|
}
|
|
10393
10453
|
}
|
|
10394
10454
|
}
|
|
10395
|
-
var KNOWN_HANDLER_NAMES = /* @__PURE__ */ new Set([
|
|
10396
|
-
"value",
|
|
10397
|
-
"valueAsInt",
|
|
10398
|
-
"valueAsFloat",
|
|
10399
|
-
"target",
|
|
10400
|
-
"event",
|
|
10401
|
-
"isAlt",
|
|
10402
|
-
"isShift",
|
|
10403
|
-
"isCtrl",
|
|
10404
|
-
"isCmd",
|
|
10405
|
-
"key",
|
|
10406
|
-
"keyCode",
|
|
10407
|
-
"isUpKey",
|
|
10408
|
-
"isDownKey",
|
|
10409
|
-
"isSend",
|
|
10410
|
-
"isCancel",
|
|
10411
|
-
"isTabKey",
|
|
10412
|
-
"ctx",
|
|
10413
|
-
"dragInfo"
|
|
10414
|
-
]);
|
|
10415
|
-
function isKnownHandlerName(name) {
|
|
10416
|
-
return KNOWN_HANDLER_NAMES.has(name);
|
|
10417
|
-
}
|
|
10418
10455
|
function checkKnownHandlerNames(lx, view, Comp, referencedAlters, referencedDynamics) {
|
|
10419
10456
|
const env = mkAttrValEnv(Comp, referencedAlters, referencedDynamics);
|
|
10420
10457
|
for (const event of view.ctx.events) {
|
|
@@ -10524,10 +10561,11 @@ var ATTR_VAL_CHECKERS = {
|
|
|
10524
10561
|
errCtx
|
|
10525
10562
|
);
|
|
10526
10563
|
},
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10564
|
+
// NameVals on a macro call-site attribute are macro-param bindings, not
|
|
10565
|
+
// handler args — their role is determined inside the macro body after
|
|
10566
|
+
// ^-substitution, where re-parsing handles validation. No checker: a NameVal
|
|
10567
|
+
// can no longer reach a handler-arg slot (sigil-less words fail to parse),
|
|
10568
|
+
// and macro-attr pass-throughs are skipped via skipNameVal.
|
|
10531
10569
|
StrTplVal({ lx, val, errCtx, recurse, isRoot }) {
|
|
10532
10570
|
const vs = val.vals;
|
|
10533
10571
|
const literal = val.toLiteralSource();
|
|
@@ -11424,8 +11462,19 @@ var Stack = class _Stack {
|
|
|
11424
11462
|
const fn = this.it[name];
|
|
11425
11463
|
return fn instanceof Function ? fn.call(this.it) : null;
|
|
11426
11464
|
}
|
|
11427
|
-
|
|
11428
|
-
|
|
11465
|
+
// Bare implicit event names are gone: a sigil-less word cannot reach a
|
|
11466
|
+
// handler-arg slot anymore, so this only ever serves stale NameVals parsed
|
|
11467
|
+
// before the removal (e.g. macro-attr pass-throughs). Always null.
|
|
11468
|
+
lookupName(_name) {
|
|
11469
|
+
return null;
|
|
11470
|
+
}
|
|
11471
|
+
// The dispatched DOM event / drag info, read only by EventMemberVal's
|
|
11472
|
+
// `e.<member>` handler args. Null outside a live event transaction.
|
|
11473
|
+
lookupEvent() {
|
|
11474
|
+
return this.ctx?.event ?? null;
|
|
11475
|
+
}
|
|
11476
|
+
lookupDragInfo() {
|
|
11477
|
+
return this.ctx?.dragInfo ?? null;
|
|
11429
11478
|
}
|
|
11430
11479
|
getHandlerFor(name, key) {
|
|
11431
11480
|
return this.comps.getHandlerFor(this.it, name, key);
|
|
@@ -11467,6 +11516,8 @@ var Transactor = class {
|
|
|
11467
11516
|
this.onTransactionPushed = () => {
|
|
11468
11517
|
};
|
|
11469
11518
|
this._observers = [];
|
|
11519
|
+
this.refusals = [];
|
|
11520
|
+
this._refusalObservers = [];
|
|
11470
11521
|
this._inflight = /* @__PURE__ */ new Set();
|
|
11471
11522
|
}
|
|
11472
11523
|
pushTransaction(t) {
|
|
@@ -11490,6 +11541,29 @@ var Transactor = class {
|
|
|
11490
11541
|
_emit(record) {
|
|
11491
11542
|
for (const cb of this._observers) cb(record);
|
|
11492
11543
|
}
|
|
11544
|
+
// Record a refusal: a dispatch the runtime could not carry out. Kinds are
|
|
11545
|
+
// open strings; today the runtime raises NO_HANDLER (a receive name with no
|
|
11546
|
+
// implementation, including the auto-generated fallback firing at dispatch
|
|
11547
|
+
// time) and FORWARD_NO_NAME (ctx.forward() from a handler whose view wrote
|
|
11548
|
+
// no name). Records carry { kind, info, timestamp } and are observational —
|
|
11549
|
+
// the dispatch itself has already failed gracefully.
|
|
11550
|
+
refuse(kind, info = {}) {
|
|
11551
|
+
const record = { kind, info, timestamp: Date.now() };
|
|
11552
|
+
this.refusals.push(record);
|
|
11553
|
+
if (this.refusals.length > REFUSAL_RING_CAP) this.refusals.shift();
|
|
11554
|
+
console.warn(`tutuca refusal [${kind}]`, info);
|
|
11555
|
+
for (const cb of this._refusalObservers) cb(record);
|
|
11556
|
+
return record;
|
|
11557
|
+
}
|
|
11558
|
+
// Subscribe to refusal records as they happen. Returns an unsubscribe fn,
|
|
11559
|
+
// like observe().
|
|
11560
|
+
observeRefusals(cb) {
|
|
11561
|
+
this._refusalObservers.push(cb);
|
|
11562
|
+
return () => {
|
|
11563
|
+
const i = this._refusalObservers.indexOf(cb);
|
|
11564
|
+
if (i !== -1) this._refusalObservers.splice(i, 1);
|
|
11565
|
+
};
|
|
11566
|
+
}
|
|
11493
11567
|
// Build and dispatch the observer record for a settled transaction. The
|
|
11494
11568
|
// resolved handler (`_resolvedHandler`/`_matched`) and per-leaf before/after
|
|
11495
11569
|
// (`_before`/`_after`) were captured while the handler ran (see callHandler /
|
|
@@ -11655,14 +11729,7 @@ var Transaction = class {
|
|
|
11655
11729
|
this._completion?.markSelfSettled({ value: newLeaf, old: curLeaf });
|
|
11656
11730
|
return curLeaf !== newLeaf ? txnPath.setValue(curRoot, newLeaf) : curRoot;
|
|
11657
11731
|
}
|
|
11658
|
-
lookupName(_name) {
|
|
11659
|
-
return null;
|
|
11660
|
-
}
|
|
11661
11732
|
};
|
|
11662
|
-
var toNullIfNaN = (v) => Number.isNaN(v) ? null : v;
|
|
11663
|
-
function getValue(e) {
|
|
11664
|
-
return e.target.type === "checkbox" ? e.target.checked : (e instanceof CustomEvent ? e.detail : e.target.value) ?? null;
|
|
11665
|
-
}
|
|
11666
11733
|
var InputEvent = class extends Transaction {
|
|
11667
11734
|
constructor(path, e, handler, transactor, dragInfo) {
|
|
11668
11735
|
super(path, transactor);
|
|
@@ -11700,8 +11767,10 @@ var InputEvent = class extends Transaction {
|
|
|
11700
11767
|
const { args = this._handlerArgs ?? [], ...rest } = f;
|
|
11701
11768
|
const hv = this.handler?.handlerCall?.handlerVal ?? this.handler?.handlerVal;
|
|
11702
11769
|
const name = hv?.name;
|
|
11703
|
-
if (name === void 0)
|
|
11704
|
-
|
|
11770
|
+
if (name === void 0) {
|
|
11771
|
+
this.transactor.refuse("FORWARD_NO_NAME", {});
|
|
11772
|
+
return;
|
|
11773
|
+
}
|
|
11705
11774
|
this.transactor.pushIntent(this.dispatchPath, name, args, rest, this);
|
|
11706
11775
|
}
|
|
11707
11776
|
buildRootStack(root, comps) {
|
|
@@ -11715,47 +11784,11 @@ var InputEvent = class extends Transaction {
|
|
|
11715
11784
|
args.push(new EventContext(path, this.transactor, this));
|
|
11716
11785
|
return [handler, args];
|
|
11717
11786
|
}
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
case "valueAsInt":
|
|
11724
|
-
return toNullIfNaN(parseInt(getValue(e), 10));
|
|
11725
|
-
case "valueAsFloat":
|
|
11726
|
-
return toNullIfNaN(parseFloat(getValue(e)));
|
|
11727
|
-
case "target":
|
|
11728
|
-
return e.target;
|
|
11729
|
-
case "event":
|
|
11730
|
-
return e;
|
|
11731
|
-
case "isAlt":
|
|
11732
|
-
return e.altKey;
|
|
11733
|
-
case "isShift":
|
|
11734
|
-
return e.shiftKey;
|
|
11735
|
-
case "isCtrl":
|
|
11736
|
-
/* falls through */
|
|
11737
|
-
case "isCmd":
|
|
11738
|
-
return isMac && e.metaKey || e.ctrlKey;
|
|
11739
|
-
case "key":
|
|
11740
|
-
return e.key;
|
|
11741
|
-
case "keyCode":
|
|
11742
|
-
return e.keyCode;
|
|
11743
|
-
case "isUpKey":
|
|
11744
|
-
return e.key === "ArrowUp";
|
|
11745
|
-
case "isDownKey":
|
|
11746
|
-
return e.key === "ArrowDown";
|
|
11747
|
-
case "isSend":
|
|
11748
|
-
return e.key === "Enter";
|
|
11749
|
-
case "isCancel":
|
|
11750
|
-
return e.key === "Escape";
|
|
11751
|
-
case "isTabKey":
|
|
11752
|
-
return e.key === "Tab";
|
|
11753
|
-
case "ctx":
|
|
11754
|
-
return new EventContext(this.dispatchPath, this.transactor, this);
|
|
11755
|
-
case "dragInfo":
|
|
11756
|
-
return this.dragInfo;
|
|
11757
|
-
}
|
|
11758
|
-
return null;
|
|
11787
|
+
// The dispatched DOM event, read only through `e.<member>` handler args
|
|
11788
|
+
// (src/value.js EventMemberVal via Stack.lookupEvent). There is no bare
|
|
11789
|
+
// implicit-name vocabulary anymore: every arg carries a sigil.
|
|
11790
|
+
get event() {
|
|
11791
|
+
return this.e;
|
|
11759
11792
|
}
|
|
11760
11793
|
};
|
|
11761
11794
|
var NameArgsTransaction = class extends Transaction {
|
|
@@ -11846,6 +11879,7 @@ var IntentEvent = class extends NameArgsTransaction {
|
|
|
11846
11879
|
}
|
|
11847
11880
|
};
|
|
11848
11881
|
var PASS = /* @__PURE__ */ Symbol.for("tutuca.intent.pass");
|
|
11882
|
+
var REFUSAL_RING_CAP = 200;
|
|
11849
11883
|
var DEFAULT_ROUTE = ["dyn", "lex"];
|
|
11850
11884
|
var INTENT_DEPTH = 64;
|
|
11851
11885
|
var IntentWalk = class {
|
|
@@ -12636,8 +12670,6 @@ function lintIdToMessage(id, info) {
|
|
|
12636
12670
|
const written = `@on.${info.name}+${mods.join("+")}`;
|
|
12637
12671
|
return `Unknown modifier '+${info.modifier}' in '${written}'`;
|
|
12638
12672
|
}
|
|
12639
|
-
case "UNKNOWN_HANDLER_ARG_NAME":
|
|
12640
|
-
return `Unknown handler argument '${info.name}'${fmtOriginSuffix(info)}`;
|
|
12641
12673
|
case "HANDLER_NAME_COLLISION":
|
|
12642
12674
|
return `${info.problem} — ${info.fix}`;
|
|
12643
12675
|
case "RECEIVE_HANDLER_NOT_IMPLEMENTED":
|
|
@@ -13329,7 +13361,6 @@ export {
|
|
|
13329
13361
|
UNKNOWN_COMPONENT_SPEC_KEY,
|
|
13330
13362
|
UNKNOWN_DIRECTIVE,
|
|
13331
13363
|
UNKNOWN_EVENT_MODIFIER,
|
|
13332
|
-
UNKNOWN_HANDLER_ARG_NAME,
|
|
13333
13364
|
UNKNOWN_MACRO_ARG,
|
|
13334
13365
|
UNKNOWN_X_ATTR,
|
|
13335
13366
|
UNKNOWN_X_OP,
|