sigmx 0.1.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/LICENSE +21 -0
- package/README.md +173 -0
- package/dist/auto.d.ts +1 -0
- package/dist/auto.js +7 -0
- package/dist/auto.js.map +7 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +7 -0
- package/dist/core/csp.d.ts +7 -0
- package/dist/core/csp.js +20 -0
- package/dist/core/csp.js.map +7 -0
- package/dist/core/engine.d.ts +10 -0
- package/dist/core/engine.js +200 -0
- package/dist/core/engine.js.map +7 -0
- package/dist/core/expr.d.ts +12 -0
- package/dist/core/expr.js +94 -0
- package/dist/core/expr.js.map +7 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.js +46 -0
- package/dist/core/index.js.map +7 -0
- package/dist/core/signals.d.ts +42 -0
- package/dist/core/signals.js +195 -0
- package/dist/core/signals.js.map +7 -0
- package/dist/core/store.d.ts +32 -0
- package/dist/core/store.js +185 -0
- package/dist/core/store.js.map +7 -0
- package/dist/core/types.d.ts +101 -0
- package/dist/core/types.js +1 -0
- package/dist/core/types.js.map +7 -0
- package/dist/kernel/compile.d.ts +16 -0
- package/dist/kernel/compile.js +96 -0
- package/dist/kernel/compile.js.map +7 -0
- package/dist/kernel/contracts.d.ts +121 -0
- package/dist/kernel/contracts.js +1 -0
- package/dist/kernel/contracts.js.map +7 -0
- package/dist/kernel/index.d.ts +20 -0
- package/dist/kernel/index.js +54 -0
- package/dist/kernel/index.js.map +7 -0
- package/dist/kernel/precompile.d.ts +25 -0
- package/dist/kernel/precompile.js +111 -0
- package/dist/kernel/precompile.js.map +7 -0
- package/dist/kernel/precompiled.d.ts +11 -0
- package/dist/kernel/precompiled.js +13 -0
- package/dist/kernel/precompiled.js.map +7 -0
- package/dist/kernel/reactive.d.ts +42 -0
- package/dist/kernel/reactive.js +201 -0
- package/dist/kernel/reactive.js.map +7 -0
- package/dist/kernel/runtime.d.ts +11 -0
- package/dist/kernel/runtime.js +210 -0
- package/dist/kernel/runtime.js.map +7 -0
- package/dist/kernel/scan.d.ts +42 -0
- package/dist/kernel/scan.js +68 -0
- package/dist/kernel/scan.js.map +7 -0
- package/dist/kernel/state.d.ts +32 -0
- package/dist/kernel/state.js +186 -0
- package/dist/kernel/state.js.map +7 -0
- package/dist/kernel/strict-csp.d.ts +7 -0
- package/dist/kernel/strict-csp.js +20 -0
- package/dist/kernel/strict-csp.js.map +7 -0
- package/dist/lib/casing.d.ts +7 -0
- package/dist/lib/casing.js +16 -0
- package/dist/lib/casing.js.map +7 -0
- package/dist/lib/objects.d.ts +9 -0
- package/dist/lib/objects.js +26 -0
- package/dist/lib/objects.js.map +7 -0
- package/dist/lib/schedule.d.ts +14 -0
- package/dist/lib/schedule.js +51 -0
- package/dist/lib/schedule.js.map +7 -0
- package/dist/lib/sse.d.ts +10 -0
- package/dist/lib/sse.js +55 -0
- package/dist/lib/sse.js.map +7 -0
- package/dist/plugins/actions/clipboard.d.ts +2 -0
- package/dist/plugins/actions/clipboard.js +11 -0
- package/dist/plugins/actions/clipboard.js.map +7 -0
- package/dist/plugins/actions/fit.d.ts +2 -0
- package/dist/plugins/actions/fit.js +14 -0
- package/dist/plugins/actions/fit.js.map +7 -0
- package/dist/plugins/actions/intl.d.ts +2 -0
- package/dist/plugins/actions/intl.js +21 -0
- package/dist/plugins/actions/intl.js.map +7 -0
- package/dist/plugins/actions/peek.d.ts +2 -0
- package/dist/plugins/actions/peek.js +6 -0
- package/dist/plugins/actions/peek.js.map +7 -0
- package/dist/plugins/actions/setAll.d.ts +2 -0
- package/dist/plugins/actions/setAll.js +11 -0
- package/dist/plugins/actions/setAll.js.map +7 -0
- package/dist/plugins/actions/toggleAll.d.ts +2 -0
- package/dist/plugins/actions/toggleAll.js +11 -0
- package/dist/plugins/actions/toggleAll.js.map +7 -0
- package/dist/plugins/attributes/attr.d.ts +2 -0
- package/dist/plugins/attributes/attr.js +20 -0
- package/dist/plugins/attributes/attr.js.map +7 -0
- package/dist/plugins/attributes/bind.d.ts +6 -0
- package/dist/plugins/attributes/bind.js +81 -0
- package/dist/plugins/attributes/bind.js.map +7 -0
- package/dist/plugins/attributes/class.d.ts +2 -0
- package/dist/plugins/attributes/class.js +22 -0
- package/dist/plugins/attributes/class.js.map +7 -0
- package/dist/plugins/attributes/computed.d.ts +2 -0
- package/dist/plugins/attributes/computed.js +20 -0
- package/dist/plugins/attributes/computed.js.map +7 -0
- package/dist/plugins/attributes/customValidity.d.ts +2 -0
- package/dist/plugins/attributes/customValidity.js +14 -0
- package/dist/plugins/attributes/customValidity.js.map +7 -0
- package/dist/plugins/attributes/effect.d.ts +2 -0
- package/dist/plugins/attributes/effect.js +12 -0
- package/dist/plugins/attributes/effect.js.map +7 -0
- package/dist/plugins/attributes/indicator.d.ts +2 -0
- package/dist/plugins/attributes/indicator.js +20 -0
- package/dist/plugins/attributes/indicator.js.map +7 -0
- package/dist/plugins/attributes/init.d.ts +2 -0
- package/dist/plugins/attributes/init.js +14 -0
- package/dist/plugins/attributes/init.js.map +7 -0
- package/dist/plugins/attributes/jsonSignals.d.ts +2 -0
- package/dist/plugins/attributes/jsonSignals.js +15 -0
- package/dist/plugins/attributes/jsonSignals.js.map +7 -0
- package/dist/plugins/attributes/matchMedia.d.ts +2 -0
- package/dist/plugins/attributes/matchMedia.js +19 -0
- package/dist/plugins/attributes/matchMedia.js.map +7 -0
- package/dist/plugins/attributes/on.d.ts +5 -0
- package/dist/plugins/attributes/on.js +28 -0
- package/dist/plugins/attributes/on.js.map +7 -0
- package/dist/plugins/attributes/onIntersect.d.ts +2 -0
- package/dist/plugins/attributes/onIntersect.js +28 -0
- package/dist/plugins/attributes/onIntersect.js.map +7 -0
- package/dist/plugins/attributes/onInterval.d.ts +2 -0
- package/dist/plugins/attributes/onInterval.js +18 -0
- package/dist/plugins/attributes/onInterval.js.map +7 -0
- package/dist/plugins/attributes/onRaf.d.ts +1 -0
- package/dist/plugins/attributes/onRaf.js +19 -0
- package/dist/plugins/attributes/onRaf.js.map +7 -0
- package/dist/plugins/attributes/onResize.d.ts +1 -0
- package/dist/plugins/attributes/onResize.js +17 -0
- package/dist/plugins/attributes/onResize.js.map +7 -0
- package/dist/plugins/attributes/onSignalPatch.d.ts +5 -0
- package/dist/plugins/attributes/onSignalPatch.js +35 -0
- package/dist/plugins/attributes/onSignalPatch.js.map +7 -0
- package/dist/plugins/attributes/persist.d.ts +6 -0
- package/dist/plugins/attributes/persist.js +16 -0
- package/dist/plugins/attributes/persist.js.map +7 -0
- package/dist/plugins/attributes/queryString.d.ts +5 -0
- package/dist/plugins/attributes/queryString.js +54 -0
- package/dist/plugins/attributes/queryString.js.map +7 -0
- package/dist/plugins/attributes/ref.d.ts +2 -0
- package/dist/plugins/attributes/ref.js +13 -0
- package/dist/plugins/attributes/ref.js.map +7 -0
- package/dist/plugins/attributes/replaceUrl.d.ts +1 -0
- package/dist/plugins/attributes/replaceUrl.js +11 -0
- package/dist/plugins/attributes/replaceUrl.js.map +7 -0
- package/dist/plugins/attributes/scrollIntoView.d.ts +2 -0
- package/dist/plugins/attributes/scrollIntoView.js +19 -0
- package/dist/plugins/attributes/scrollIntoView.js.map +7 -0
- package/dist/plugins/attributes/show.d.ts +2 -0
- package/dist/plugins/attributes/show.js +19 -0
- package/dist/plugins/attributes/show.js.map +7 -0
- package/dist/plugins/attributes/signals.d.ts +2 -0
- package/dist/plugins/attributes/signals.js +13 -0
- package/dist/plugins/attributes/signals.js.map +7 -0
- package/dist/plugins/attributes/style.d.ts +2 -0
- package/dist/plugins/attributes/style.js +25 -0
- package/dist/plugins/attributes/style.js.map +7 -0
- package/dist/plugins/attributes/text.d.ts +1 -0
- package/dist/plugins/attributes/text.js +13 -0
- package/dist/plugins/attributes/text.js.map +7 -0
- package/dist/plugins/attributes/viewTransition.d.ts +1 -0
- package/dist/plugins/attributes/viewTransition.js +11 -0
- package/dist/plugins/attributes/viewTransition.js.map +7 -0
- package/dist/plugins/directives/attribute-sync.d.ts +2 -0
- package/dist/plugins/directives/attribute-sync.js +20 -0
- package/dist/plugins/directives/attribute-sync.js.map +7 -0
- package/dist/plugins/directives/boost.d.ts +6 -0
- package/dist/plugins/directives/boost.js +35 -0
- package/dist/plugins/directives/boost.js.map +7 -0
- package/dist/plugins/directives/busy-flag.d.ts +2 -0
- package/dist/plugins/directives/busy-flag.js +21 -0
- package/dist/plugins/directives/busy-flag.js.map +7 -0
- package/dist/plugins/directives/class-toggle.d.ts +2 -0
- package/dist/plugins/directives/class-toggle.js +22 -0
- package/dist/plugins/directives/class-toggle.js.map +7 -0
- package/dist/plugins/directives/cloak.d.ts +5 -0
- package/dist/plugins/directives/cloak.js +11 -0
- package/dist/plugins/directives/cloak.js.map +7 -0
- package/dist/plugins/directives/collapse.d.ts +5 -0
- package/dist/plugins/directives/collapse.js +42 -0
- package/dist/plugins/directives/collapse.js.map +7 -0
- package/dist/plugins/directives/declare.d.ts +2 -0
- package/dist/plugins/directives/declare.js +13 -0
- package/dist/plugins/directives/declare.js.map +7 -0
- package/dist/plugins/directives/derive.d.ts +2 -0
- package/dist/plugins/directives/derive.js +20 -0
- package/dist/plugins/directives/derive.js.map +7 -0
- package/dist/plugins/directives/element-ref.d.ts +2 -0
- package/dist/plugins/directives/element-ref.js +13 -0
- package/dist/plugins/directives/element-ref.js.map +7 -0
- package/dist/plugins/directives/event-listener.d.ts +5 -0
- package/dist/plugins/directives/event-listener.js +28 -0
- package/dist/plugins/directives/event-listener.js.map +7 -0
- package/dist/plugins/directives/frame-loop.d.ts +1 -0
- package/dist/plugins/directives/frame-loop.js +19 -0
- package/dist/plugins/directives/frame-loop.js.map +7 -0
- package/dist/plugins/directives/html.d.ts +2 -0
- package/dist/plugins/directives/html.js +13 -0
- package/dist/plugins/directives/html.js.map +7 -0
- package/dist/plugins/directives/inline-style.d.ts +2 -0
- package/dist/plugins/directives/inline-style.js +25 -0
- package/dist/plugins/directives/inline-style.js.map +7 -0
- package/dist/plugins/directives/mask.d.ts +7 -0
- package/dist/plugins/directives/mask.js +47 -0
- package/dist/plugins/directives/mask.js.map +7 -0
- package/dist/plugins/directives/media-query.d.ts +2 -0
- package/dist/plugins/directives/media-query.js +19 -0
- package/dist/plugins/directives/media-query.js.map +7 -0
- package/dist/plugins/directives/on-mount.d.ts +2 -0
- package/dist/plugins/directives/on-mount.js +14 -0
- package/dist/plugins/directives/on-mount.js.map +7 -0
- package/dist/plugins/directives/patch-listener.d.ts +5 -0
- package/dist/plugins/directives/patch-listener.js +35 -0
- package/dist/plugins/directives/patch-listener.js.map +7 -0
- package/dist/plugins/directives/remove-me.d.ts +2 -0
- package/dist/plugins/directives/remove-me.js +13 -0
- package/dist/plugins/directives/remove-me.js.map +7 -0
- package/dist/plugins/directives/scroll-to.d.ts +2 -0
- package/dist/plugins/directives/scroll-to.js +19 -0
- package/dist/plugins/directives/scroll-to.js.map +7 -0
- package/dist/plugins/directives/size-watch.d.ts +1 -0
- package/dist/plugins/directives/size-watch.js +17 -0
- package/dist/plugins/directives/size-watch.js.map +7 -0
- package/dist/plugins/directives/state-dump.d.ts +2 -0
- package/dist/plugins/directives/state-dump.js +15 -0
- package/dist/plugins/directives/state-dump.js.map +7 -0
- package/dist/plugins/directives/storage-sync.d.ts +6 -0
- package/dist/plugins/directives/storage-sync.js +16 -0
- package/dist/plugins/directives/storage-sync.js.map +7 -0
- package/dist/plugins/directives/teleport.d.ts +5 -0
- package/dist/plugins/directives/teleport.js +19 -0
- package/dist/plugins/directives/teleport.js.map +7 -0
- package/dist/plugins/directives/text-content.d.ts +1 -0
- package/dist/plugins/directives/text-content.js +13 -0
- package/dist/plugins/directives/text-content.js.map +7 -0
- package/dist/plugins/directives/timer.d.ts +2 -0
- package/dist/plugins/directives/timer.js +18 -0
- package/dist/plugins/directives/timer.js.map +7 -0
- package/dist/plugins/directives/transition-name.d.ts +1 -0
- package/dist/plugins/directives/transition-name.js +11 -0
- package/dist/plugins/directives/transition-name.js.map +7 -0
- package/dist/plugins/directives/transition.d.ts +5 -0
- package/dist/plugins/directives/transition.js +40 -0
- package/dist/plugins/directives/transition.js.map +7 -0
- package/dist/plugins/directives/trap.d.ts +5 -0
- package/dist/plugins/directives/trap.js +48 -0
- package/dist/plugins/directives/trap.js.map +7 -0
- package/dist/plugins/directives/tween.d.ts +6 -0
- package/dist/plugins/directives/tween.js +58 -0
- package/dist/plugins/directives/tween.js.map +7 -0
- package/dist/plugins/directives/two-way-bind.d.ts +6 -0
- package/dist/plugins/directives/two-way-bind.js +82 -0
- package/dist/plugins/directives/two-way-bind.js.map +7 -0
- package/dist/plugins/directives/url-params.d.ts +13 -0
- package/dist/plugins/directives/url-params.js +76 -0
- package/dist/plugins/directives/url-params.js.map +7 -0
- package/dist/plugins/directives/url-replace.d.ts +1 -0
- package/dist/plugins/directives/url-replace.js +11 -0
- package/dist/plugins/directives/url-replace.js.map +7 -0
- package/dist/plugins/directives/validity.d.ts +2 -0
- package/dist/plugins/directives/validity.js +14 -0
- package/dist/plugins/directives/validity.js.map +7 -0
- package/dist/plugins/directives/viewport.d.ts +2 -0
- package/dist/plugins/directives/viewport.js +28 -0
- package/dist/plugins/directives/viewport.js.map +7 -0
- package/dist/plugins/directives/visibility.d.ts +2 -0
- package/dist/plugins/directives/visibility.js +19 -0
- package/dist/plugins/directives/visibility.js.map +7 -0
- package/dist/plugins/directives/watch.d.ts +2 -0
- package/dist/plugins/directives/watch.js +12 -0
- package/dist/plugins/directives/watch.js.map +7 -0
- package/dist/plugins/functions/bulk-set.d.ts +2 -0
- package/dist/plugins/functions/bulk-set.js +11 -0
- package/dist/plugins/functions/bulk-set.js.map +7 -0
- package/dist/plugins/functions/bulk-toggle.d.ts +2 -0
- package/dist/plugins/functions/bulk-toggle.js +11 -0
- package/dist/plugins/functions/bulk-toggle.js.map +7 -0
- package/dist/plugins/functions/confirm.d.ts +2 -0
- package/dist/plugins/functions/confirm.js +6 -0
- package/dist/plugins/functions/confirm.js.map +7 -0
- package/dist/plugins/functions/copy-text.d.ts +2 -0
- package/dist/plugins/functions/copy-text.js +11 -0
- package/dist/plugins/functions/copy-text.js.map +7 -0
- package/dist/plugins/functions/dispatch.d.ts +2 -0
- package/dist/plugins/functions/dispatch.js +9 -0
- package/dist/plugins/functions/dispatch.js.map +7 -0
- package/dist/plugins/functions/locale-format.d.ts +2 -0
- package/dist/plugins/functions/locale-format.js +21 -0
- package/dist/plugins/functions/locale-format.js.map +7 -0
- package/dist/plugins/functions/range-map.d.ts +2 -0
- package/dist/plugins/functions/range-map.js +14 -0
- package/dist/plugins/functions/range-map.js.map +7 -0
- package/dist/plugins/functions/request.d.ts +30 -0
- package/dist/plugins/functions/request.js +152 -0
- package/dist/plugins/functions/request.js.map +7 -0
- package/dist/plugins/functions/untracked-read.d.ts +2 -0
- package/dist/plugins/functions/untracked-read.js +6 -0
- package/dist/plugins/functions/untracked-read.js.map +7 -0
- package/dist/plugins/functions/websocket.d.ts +11 -0
- package/dist/plugins/functions/websocket.js +35 -0
- package/dist/plugins/functions/websocket.js.map +7 -0
- package/dist/plugins/index.d.ts +52 -0
- package/dist/plugins/index.js +108 -0
- package/dist/plugins/index.js.map +7 -0
- package/dist/plugins/server-events/apply-elements.d.ts +2 -0
- package/dist/plugins/server-events/apply-elements.js +62 -0
- package/dist/plugins/server-events/apply-elements.js.map +7 -0
- package/dist/plugins/server-events/apply-state.d.ts +2 -0
- package/dist/plugins/server-events/apply-state.js +18 -0
- package/dist/plugins/server-events/apply-state.js.map +7 -0
- package/dist/plugins/server-events/morph.d.ts +12 -0
- package/dist/plugins/server-events/morph.js +124 -0
- package/dist/plugins/server-events/morph.js.map +7 -0
- package/dist/presets/all.d.ts +3 -0
- package/dist/presets/all.js +112 -0
- package/dist/presets/all.js.map +7 -0
- package/dist/presets/essentials.d.ts +3 -0
- package/dist/presets/essentials.js +18 -0
- package/dist/presets/essentials.js.map +7 -0
- package/dist/presets/minimal.d.ts +3 -0
- package/dist/presets/minimal.js +9 -0
- package/dist/presets/minimal.js.map +7 -0
- package/dist/sigmx.auto.js +5 -0
- package/dist/sigmx.standalone.js +1 -0
- package/dist/standalone.d.ts +1 -0
- package/dist/standalone.js +8 -0
- package/dist/standalone.js.map +7 -0
- package/dist/utils/object.d.ts +9 -0
- package/dist/utils/object.js +26 -0
- package/dist/utils/object.js.map +7 -0
- package/dist/utils/text.d.ts +7 -0
- package/dist/utils/text.js +15 -0
- package/dist/utils/text.js.map +7 -0
- package/dist/utils/timing.d.ts +14 -0
- package/dist/utils/timing.js +58 -0
- package/dist/utils/timing.js.map +7 -0
- package/dist/vite.d.ts +42 -0
- package/dist/vite.js +79 -0
- package/dist/vite.js.map +7 -0
- package/package.json +111 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { attribute, toMs, withViewTransition } from "../../core/index.js";
|
|
2
|
+
const onInterval = attribute({
|
|
3
|
+
name: "on-interval",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
returns: false,
|
|
7
|
+
mount({ mods, evaluate }) {
|
|
8
|
+
const d = mods.get("duration");
|
|
9
|
+
const run = withViewTransition(() => evaluate(), mods);
|
|
10
|
+
if (d?.includes("leading")) run();
|
|
11
|
+
const id = setInterval(run, toMs(d, 1e3));
|
|
12
|
+
return () => clearInterval(id);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
onInterval
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=onInterval.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/onInterval.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, toMs, withViewTransition } from '../../core/index.js'\n\n/** `on-interval__duration.5s.leading=\"expr\"`. Default one second. */\nexport const onInterval = attribute({\n name: 'on-interval',\n key: 'forbidden',\n value: 'required',\n returns: false,\n mount({ mods, evaluate }) {\n const d = mods.get('duration')\n const run = withViewTransition(() => evaluate(), mods)\n if (d?.includes('leading')) run()\n const id = setInterval(run, toMs(d, 1000))\n return () => clearInterval(id)\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,MAAM,0BAA0B;AAG7C,MAAM,aAAa,UAAU;AAAA,EAClC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM,EAAE,MAAM,SAAS,GAAG;AACxB,UAAM,IAAI,KAAK,IAAI,UAAU;AAC7B,UAAM,MAAM,mBAAmB,MAAM,SAAS,GAAG,IAAI;AACrD,QAAI,GAAG,SAAS,SAAS,EAAG,KAAI;AAChC,UAAM,KAAK,YAAY,KAAK,KAAK,GAAG,GAAI,CAAC;AACzC,WAAO,MAAM,cAAc,EAAE;AAAA,EAC/B;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const onRaf: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { attribute, withTiming } from "../../core/index.js";
|
|
2
|
+
const onRaf = attribute({
|
|
3
|
+
name: "on-raf",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
returns: false,
|
|
7
|
+
mount({ mods, evaluate }) {
|
|
8
|
+
const run = withTiming(() => evaluate(), mods);
|
|
9
|
+
let id = requestAnimationFrame(function tick() {
|
|
10
|
+
run();
|
|
11
|
+
id = requestAnimationFrame(tick);
|
|
12
|
+
});
|
|
13
|
+
return () => cancelAnimationFrame(id);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
onRaf
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=onRaf.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/onRaf.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, withTiming } from '../../core/index.js'\n\nexport const onRaf = attribute({\n name: 'on-raf',\n key: 'forbidden',\n value: 'required',\n returns: false,\n mount({ mods, evaluate }) {\n const run = withTiming(() => evaluate(), mods)\n let id = requestAnimationFrame(function tick() {\n run()\n id = requestAnimationFrame(tick)\n })\n return () => cancelAnimationFrame(id)\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,kBAAkB;AAE/B,MAAM,QAAQ,UAAU;AAAA,EAC7B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM,EAAE,MAAM,SAAS,GAAG;AACxB,UAAM,MAAM,WAAW,MAAM,SAAS,GAAG,IAAI;AAC7C,QAAI,KAAK,sBAAsB,SAAS,OAAO;AAC7C,UAAI;AACJ,WAAK,sBAAsB,IAAI;AAAA,IACjC,CAAC;AACD,WAAO,MAAM,qBAAqB,EAAE;AAAA,EACtC;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const onResize: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { attribute, withTiming } from "../../core/index.js";
|
|
2
|
+
const onResize = attribute({
|
|
3
|
+
name: "on-resize",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
returns: false,
|
|
7
|
+
mount({ el, mods, evaluate }) {
|
|
8
|
+
const run = withTiming(() => evaluate(), mods);
|
|
9
|
+
const ro = new ResizeObserver(() => run());
|
|
10
|
+
ro.observe(el);
|
|
11
|
+
return () => ro.disconnect();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
onResize
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=onResize.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/onResize.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, withTiming } from '../../core/index.js'\n\nexport const onResize = attribute({\n name: 'on-resize',\n key: 'forbidden',\n value: 'required',\n returns: false,\n mount({ el, mods, evaluate }) {\n const run = withTiming(() => evaluate(), mods)\n const ro = new ResizeObserver(() => run())\n ro.observe(el)\n return () => ro.disconnect()\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,kBAAkB;AAE/B,MAAM,WAAW,UAAU;AAAA,EAChC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM,EAAE,IAAI,MAAM,SAAS,GAAG;AAC5B,UAAM,MAAM,WAAW,MAAM,SAAS,GAAG,IAAI;AAC7C,UAAM,KAAK,IAAI,eAAe,MAAM,IAAI,CAAC;AACzC,OAAG,QAAQ,EAAE;AACb,WAAO,MAAM,GAAG,WAAW;AAAA,EAC7B;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { attribute, withTiming } from "../../core/index.js";
|
|
2
|
+
const touches = (patch, path) => {
|
|
3
|
+
let cur = patch;
|
|
4
|
+
for (const k of path.split(".")) {
|
|
5
|
+
if (cur == null || typeof cur !== "object" || !(k in cur)) return false;
|
|
6
|
+
cur = cur[k];
|
|
7
|
+
}
|
|
8
|
+
return true;
|
|
9
|
+
};
|
|
10
|
+
const onSignalPatch = attribute({
|
|
11
|
+
name: "on-signal-patch",
|
|
12
|
+
value: "required",
|
|
13
|
+
returns: false,
|
|
14
|
+
args: ["patch"],
|
|
15
|
+
mount({ key, cased, mods, evaluate, listen }) {
|
|
16
|
+
const path = key ? cased() : "";
|
|
17
|
+
let running = false;
|
|
18
|
+
const run = withTiming((patch) => {
|
|
19
|
+
if (running) return;
|
|
20
|
+
running = true;
|
|
21
|
+
try {
|
|
22
|
+
evaluate(void 0, patch);
|
|
23
|
+
} finally {
|
|
24
|
+
running = false;
|
|
25
|
+
}
|
|
26
|
+
}, mods);
|
|
27
|
+
listen(document, "sigmx-signal-patch", (e) => {
|
|
28
|
+
if (!path || touches(e.detail, path)) run(e.detail);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
onSignalPatch
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=onSignalPatch.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/onSignalPatch.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, withTiming } from '../../core/index.js'\n\nconst touches = (patch: Record<string, any>, path: string): boolean => {\n let cur: any = patch\n for (const k of path.split('.')) {\n if (cur == null || typeof cur !== 'object' || !(k in cur)) return false\n cur = cur[k]\n }\n return true\n}\n\n/**\n * Runs after signals change, with the patch as `patch`. A key narrows it to one path:\n * `on-signal-patch:user.name=\"...\"`.\n */\nexport const onSignalPatch = attribute({\n name: 'on-signal-patch',\n value: 'required',\n returns: false,\n args: ['patch'],\n mount({ key, cased, mods, evaluate, listen }) {\n const path = key ? cased() : ''\n let running = false\n const run = withTiming((patch: Record<string, any>) => {\n if (running) return\n running = true\n try {\n evaluate(undefined, patch)\n } finally {\n running = false\n }\n }, mods)\n listen(document, 'sigmx-signal-patch', (e: CustomEvent) => {\n if (!path || touches(e.detail, path)) run(e.detail)\n })\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,kBAAkB;AAEtC,MAAM,UAAU,CAAC,OAA4B,SAA0B;AACrE,MAAI,MAAW;AACf,aAAW,KAAK,KAAK,MAAM,GAAG,GAAG;AAC/B,QAAI,OAAO,QAAQ,OAAO,QAAQ,YAAY,EAAE,KAAK,KAAM,QAAO;AAClE,UAAM,IAAI,CAAC;AAAA,EACb;AACA,SAAO;AACT;AAMO,MAAM,gBAAgB,UAAU;AAAA,EACrC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM,CAAC,OAAO;AAAA,EACd,MAAM,EAAE,KAAK,OAAO,MAAM,UAAU,OAAO,GAAG;AAC5C,UAAM,OAAO,MAAM,MAAM,IAAI;AAC7B,QAAI,UAAU;AACd,UAAM,MAAM,WAAW,CAAC,UAA+B;AACrD,UAAI,QAAS;AACb,gBAAU;AACV,UAAI;AACF,iBAAS,QAAW,KAAK;AAAA,MAC3B,UAAE;AACA,kBAAU;AAAA,MACZ;AAAA,IACF,GAAG,IAAI;AACP,WAAO,UAAU,sBAAsB,CAAC,MAAmB;AACzD,UAAI,CAAC,QAAQ,QAAQ,EAAE,QAAQ,IAAI,EAAG,KAAI,EAAE,MAAM;AAAA,IACpD,CAAC;AAAA,EACH;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Saves matching signals to localStorage (`__session` for sessionStorage) and restores them on
|
|
3
|
+
* mount. `persist:key` sets the storage key; the value is an optional `{ include, exclude }` filter.
|
|
4
|
+
* Declare defaults with `signals:x__ifmissing` so restored values are not overwritten.
|
|
5
|
+
*/
|
|
6
|
+
export declare const persist: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const persist = attribute({
|
|
3
|
+
name: "persist",
|
|
4
|
+
mount({ key, value, mods, evaluate, store, effect }) {
|
|
5
|
+
const storage = mods.has("session") ? sessionStorage : localStorage;
|
|
6
|
+
const name = key || "sigmx";
|
|
7
|
+
const filter = value ? evaluate() : void 0;
|
|
8
|
+
const saved = storage.getItem(name);
|
|
9
|
+
if (saved) store.merge(JSON.parse(saved));
|
|
10
|
+
effect(() => storage.setItem(name, JSON.stringify(store.snapshot(filter, { computed: false }))));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
persist
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=persist.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/persist.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\n/**\n * Saves matching signals to localStorage (`__session` for sessionStorage) and restores them on\n * mount. `persist:key` sets the storage key; the value is an optional `{ include, exclude }` filter.\n * Declare defaults with `signals:x__ifmissing` so restored values are not overwritten.\n */\nexport const persist = attribute({\n name: 'persist',\n mount({ key, value, mods, evaluate, store, effect }) {\n const storage = mods.has('session') ? sessionStorage : localStorage\n const name = key || 'sigmx'\n const filter = value ? evaluate() : undefined\n const saved = storage.getItem(name)\n if (saved) store.merge(JSON.parse(saved))\n effect(() => storage.setItem(name, JSON.stringify(store.snapshot(filter, { computed: false }))))\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAOnB,MAAM,UAAU,UAAU;AAAA,EAC/B,MAAM;AAAA,EACN,MAAM,EAAE,KAAK,OAAO,MAAM,UAAU,OAAO,OAAO,GAAG;AACnD,UAAM,UAAU,KAAK,IAAI,SAAS,IAAI,iBAAiB;AACvD,UAAM,OAAO,OAAO;AACpB,UAAM,SAAS,QAAQ,SAAS,IAAI;AACpC,UAAM,QAAQ,QAAQ,QAAQ,IAAI;AAClC,QAAI,MAAO,OAAM,MAAM,KAAK,MAAM,KAAK,CAAC;AACxC,WAAO,MAAM,QAAQ,QAAQ,MAAM,KAAK,UAAU,MAAM,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC,CAAC,CAAC,CAAC;AAAA,EACjG;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two-way sync between matching signals and the URL query string. `__history` pushes an entry per
|
|
3
|
+
* change and restores on back/forward; `__filter` drops empty values from the URL.
|
|
4
|
+
*/
|
|
5
|
+
export declare const queryString: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { attribute, expand } from "../../core/index.js";
|
|
2
|
+
const parse = (s) => {
|
|
3
|
+
try {
|
|
4
|
+
return JSON.parse(s);
|
|
5
|
+
} catch {
|
|
6
|
+
return s;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const queryString = attribute({
|
|
10
|
+
name: "query-string",
|
|
11
|
+
key: "forbidden",
|
|
12
|
+
mount({ value, mods, evaluate, store, listen, effect }) {
|
|
13
|
+
const filter = value ? evaluate() : void 0;
|
|
14
|
+
const history = mods.has("history");
|
|
15
|
+
const fromUrl = () => {
|
|
16
|
+
const patch = {};
|
|
17
|
+
for (const [k, v] of new URLSearchParams(location.search)) expand(patch, k, parse(v));
|
|
18
|
+
store.merge(store.snapshot(filter, { computed: false }) && patch);
|
|
19
|
+
};
|
|
20
|
+
let syncing = false;
|
|
21
|
+
fromUrl();
|
|
22
|
+
effect(() => {
|
|
23
|
+
const snap = store.snapshot(filter, { computed: false });
|
|
24
|
+
if (syncing) return;
|
|
25
|
+
const q = new URLSearchParams(location.search);
|
|
26
|
+
const walk = (obj, prefix) => {
|
|
27
|
+
for (const k in obj) {
|
|
28
|
+
const p = prefix ? `${prefix}.${k}` : k;
|
|
29
|
+
const v = obj[k];
|
|
30
|
+
if (v && typeof v === "object" && !Array.isArray(v)) walk(v, p);
|
|
31
|
+
else if (mods.has("filter") && (v === "" || v == null)) q.delete(p);
|
|
32
|
+
else q.set(p, typeof v === "string" ? v : JSON.stringify(v));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
walk(snap, "");
|
|
36
|
+
const url = `${location.pathname}${q.size ? `?${q}` : ""}${location.hash}`;
|
|
37
|
+
if (url === location.pathname + location.search + location.hash) return;
|
|
38
|
+
history ? window.history.pushState(null, "", url) : window.history.replaceState(null, "", url);
|
|
39
|
+
});
|
|
40
|
+
if (history)
|
|
41
|
+
listen(window, "popstate", () => {
|
|
42
|
+
syncing = true;
|
|
43
|
+
try {
|
|
44
|
+
fromUrl();
|
|
45
|
+
} finally {
|
|
46
|
+
syncing = false;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
queryString
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=queryString.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/queryString.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, expand } from '../../core/index.js'\n\nconst parse = (s: string): unknown => {\n try {\n return JSON.parse(s)\n } catch {\n return s\n }\n}\n\n/**\n * Two-way sync between matching signals and the URL query string. `__history` pushes an entry per\n * change and restores on back/forward; `__filter` drops empty values from the URL.\n */\nexport const queryString = attribute({\n name: 'query-string',\n key: 'forbidden',\n mount({ value, mods, evaluate, store, listen, effect }) {\n const filter = value ? evaluate() : undefined\n const history = mods.has('history')\n const fromUrl = () => {\n const patch = {}\n for (const [k, v] of new URLSearchParams(location.search)) expand(patch, k, parse(v))\n store.merge(store.snapshot(filter, { computed: false }) && patch)\n }\n let syncing = false\n fromUrl()\n effect(() => {\n const snap = store.snapshot(filter, { computed: false })\n if (syncing) return\n const q = new URLSearchParams(location.search)\n const walk = (obj: Record<string, any>, prefix: string) => {\n for (const k in obj) {\n const p = prefix ? `${prefix}.${k}` : k\n const v = obj[k]\n if (v && typeof v === 'object' && !Array.isArray(v)) walk(v, p)\n else if (mods.has('filter') && (v === '' || v == null)) q.delete(p)\n else q.set(p, typeof v === 'string' ? v : JSON.stringify(v))\n }\n }\n walk(snap, '')\n const url = `${location.pathname}${q.size ? `?${q}` : ''}${location.hash}`\n if (url === location.pathname + location.search + location.hash) return\n history ? window.history.pushState(null, '', url) : window.history.replaceState(null, '', url)\n })\n if (history)\n listen(window, 'popstate', () => {\n syncing = true\n try {\n fromUrl()\n } finally {\n syncing = false\n }\n })\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,cAAc;AAElC,MAAM,QAAQ,CAAC,MAAuB;AACpC,MAAI;AACF,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMO,MAAM,cAAc,UAAU;AAAA,EACnC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM,EAAE,OAAO,MAAM,UAAU,OAAO,QAAQ,OAAO,GAAG;AACtD,UAAM,SAAS,QAAQ,SAAS,IAAI;AACpC,UAAM,UAAU,KAAK,IAAI,SAAS;AAClC,UAAM,UAAU,MAAM;AACpB,YAAM,QAAQ,CAAC;AACf,iBAAW,CAAC,GAAG,CAAC,KAAK,IAAI,gBAAgB,SAAS,MAAM,EAAG,QAAO,OAAO,GAAG,MAAM,CAAC,CAAC;AACpF,YAAM,MAAM,MAAM,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK;AAAA,IAClE;AACA,QAAI,UAAU;AACd,YAAQ;AACR,WAAO,MAAM;AACX,YAAM,OAAO,MAAM,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC;AACvD,UAAI,QAAS;AACb,YAAM,IAAI,IAAI,gBAAgB,SAAS,MAAM;AAC7C,YAAM,OAAO,CAAC,KAA0B,WAAmB;AACzD,mBAAW,KAAK,KAAK;AACnB,gBAAM,IAAI,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK;AACtC,gBAAM,IAAI,IAAI,CAAC;AACf,cAAI,KAAK,OAAO,MAAM,YAAY,CAAC,MAAM,QAAQ,CAAC,EAAG,MAAK,GAAG,CAAC;AAAA,mBACrD,KAAK,IAAI,QAAQ,MAAM,MAAM,MAAM,KAAK,MAAO,GAAE,OAAO,CAAC;AAAA,cAC7D,GAAE,IAAI,GAAG,OAAO,MAAM,WAAW,IAAI,KAAK,UAAU,CAAC,CAAC;AAAA,QAC7D;AAAA,MACF;AACA,WAAK,MAAM,EAAE;AACb,YAAM,MAAM,GAAG,SAAS,QAAQ,GAAG,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,SAAS,IAAI;AACxE,UAAI,QAAQ,SAAS,WAAW,SAAS,SAAS,SAAS,KAAM;AACjE,gBAAU,OAAO,QAAQ,UAAU,MAAM,IAAI,GAAG,IAAI,OAAO,QAAQ,aAAa,MAAM,IAAI,GAAG;AAAA,IAC/F,CAAC;AACD,QAAI;AACF,aAAO,QAAQ,YAAY,MAAM;AAC/B,kBAAU;AACV,YAAI;AACF,kBAAQ;AAAA,QACV,UAAE;AACA,oBAAU;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,EACL;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const ref = attribute({
|
|
3
|
+
name: "ref",
|
|
4
|
+
mount({ el, key, value, cased, store }) {
|
|
5
|
+
const path = key ? cased() : value.trim();
|
|
6
|
+
store.set(path, el);
|
|
7
|
+
return () => store.remove(path);
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
ref
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=ref.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/ref.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\n/** Stores the element in a signal: `ref:dialog` or `ref=\"dialog\"`. */\nexport const ref = attribute({\n name: 'ref',\n mount({ el, key, value, cased, store }) {\n const path = key ? cased() : value.trim()\n store.set(path, el)\n return () => store.remove(path)\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAGnB,MAAM,MAAM,UAAU;AAAA,EAC3B,MAAM;AAAA,EACN,MAAM,EAAE,IAAI,KAAK,OAAO,OAAO,MAAM,GAAG;AACtC,UAAM,OAAO,MAAM,MAAM,IAAI,MAAM,KAAK;AACxC,UAAM,IAAI,MAAM,EAAE;AAClB,WAAO,MAAM,MAAM,OAAO,IAAI;AAAA,EAChC;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const replaceUrl: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const replaceUrl = attribute({
|
|
3
|
+
name: "replace-url",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
mount: ({ evaluate, effect }) => effect(() => history.replaceState(history.state, "", new URL(String(evaluate()), location.href)))
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
replaceUrl
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=replaceUrl.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/replaceUrl.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\nexport const replaceUrl = attribute({\n name: 'replace-url',\n key: 'forbidden',\n value: 'required',\n mount: ({ evaluate, effect }) =>\n effect(() => history.replaceState(history.state, '', new URL(String(evaluate()), location.href))),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,aAAa,UAAU;AAAA,EAClC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO,CAAC,EAAE,UAAU,OAAO,MACzB,OAAO,MAAM,QAAQ,aAAa,QAAQ,OAAO,IAAI,IAAI,IAAI,OAAO,SAAS,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;AACpG,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const pick = (mods, names, fallback) => names.find((n) => mods.has(n)) ?? fallback;
|
|
3
|
+
const scrollIntoView = attribute({
|
|
4
|
+
name: "scroll-into-view",
|
|
5
|
+
key: "forbidden",
|
|
6
|
+
value: "forbidden",
|
|
7
|
+
mount({ el, mods }) {
|
|
8
|
+
el.scrollIntoView({
|
|
9
|
+
behavior: pick(mods, ["smooth", "instant", "auto"], "smooth"),
|
|
10
|
+
block: pick(mods, ["vstart", "vcenter", "vend", "vnearest"], "vcenter").slice(1),
|
|
11
|
+
inline: pick(mods, ["hstart", "hcenter", "hend", "hnearest"], "hcenter").slice(1)
|
|
12
|
+
});
|
|
13
|
+
if (mods.has("focus")) el.focus?.();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
scrollIntoView
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=scrollIntoView.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/scrollIntoView.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\nconst pick = (mods: Map<string, string[]>, names: string[], fallback: string) =>\n names.find((n) => mods.has(n)) ?? fallback\n\n/** Scrolls the element into view on mount. Modifiers: smooth/instant/auto, vstart..vnearest, hstart..hnearest, focus. */\nexport const scrollIntoView = attribute({\n name: 'scroll-into-view',\n key: 'forbidden',\n value: 'forbidden',\n mount({ el, mods }) {\n el.scrollIntoView({\n behavior: pick(mods, ['smooth', 'instant', 'auto'], 'smooth') as ScrollBehavior,\n block: pick(mods, ['vstart', 'vcenter', 'vend', 'vnearest'], 'vcenter').slice(1) as ScrollLogicalPosition,\n inline: pick(mods, ['hstart', 'hcenter', 'hend', 'hnearest'], 'hcenter').slice(1) as ScrollLogicalPosition,\n })\n if (mods.has('focus')) (el as HTMLElement).focus?.()\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAE1B,MAAM,OAAO,CAAC,MAA6B,OAAiB,aAC1D,MAAM,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,KAAK;AAG7B,MAAM,iBAAiB,UAAU;AAAA,EACtC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM,EAAE,IAAI,KAAK,GAAG;AAClB,OAAG,eAAe;AAAA,MAChB,UAAU,KAAK,MAAM,CAAC,UAAU,WAAW,MAAM,GAAG,QAAQ;AAAA,MAC5D,OAAO,KAAK,MAAM,CAAC,UAAU,WAAW,QAAQ,UAAU,GAAG,SAAS,EAAE,MAAM,CAAC;AAAA,MAC/E,QAAQ,KAAK,MAAM,CAAC,UAAU,WAAW,QAAQ,UAAU,GAAG,SAAS,EAAE,MAAM,CAAC;AAAA,IAClF,CAAC;AACD,QAAI,KAAK,IAAI,OAAO,EAAG,CAAC,GAAmB,QAAQ;AAAA,EACrD;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const show = attribute({
|
|
3
|
+
name: "show",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
mount({ el, evaluate, effect }) {
|
|
7
|
+
const initial = el.style.display === "none" ? "" : el.style.display;
|
|
8
|
+
effect(() => {
|
|
9
|
+
el.style.display = evaluate() ? initial : "none";
|
|
10
|
+
});
|
|
11
|
+
return () => {
|
|
12
|
+
el.style.display = initial;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
show
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=show.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/show.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\n/** Toggles `display: none`, restoring whatever inline display the element had. */\nexport const show = attribute({\n name: 'show',\n key: 'forbidden',\n value: 'required',\n mount({ el, evaluate, effect }) {\n const initial = el.style.display === 'none' ? '' : el.style.display\n effect(() => {\n el.style.display = evaluate() ? initial : 'none'\n })\n return () => {\n el.style.display = initial\n }\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAGnB,MAAM,OAAO,UAAU;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM,EAAE,IAAI,UAAU,OAAO,GAAG;AAC9B,UAAM,UAAU,GAAG,MAAM,YAAY,SAAS,KAAK,GAAG,MAAM;AAC5D,WAAO,MAAM;AACX,SAAG,MAAM,UAAU,SAAS,IAAI,UAAU;AAAA,IAC5C,CAAC;AACD,WAAO,MAAM;AACX,SAAG,MAAM,UAAU;AAAA,IACrB;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { attribute, expand } from "../../core/index.js";
|
|
2
|
+
const signals = attribute({
|
|
3
|
+
name: "signals",
|
|
4
|
+
value: "required",
|
|
5
|
+
mount({ key, cased, evaluate, store, mods }) {
|
|
6
|
+
const v = evaluate();
|
|
7
|
+
store.merge(key ? expand({}, cased(), v) : v, { ifMissing: mods.has("ifmissing") });
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
signals
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=signals.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/signals.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, expand } from '../../core/index.js'\n\n/** `signals:name=\"expr\"` or `signals=\"{ ... }\"`. `__ifmissing` keeps existing values. */\nexport const signals = attribute({\n name: 'signals',\n value: 'required',\n mount({ key, cased, evaluate, store, mods }) {\n const v = evaluate()\n store.merge(key ? expand({}, cased(), v) : v, { ifMissing: mods.has('ifmissing') })\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,cAAc;AAG3B,MAAM,UAAU,UAAU;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM,EAAE,KAAK,OAAO,UAAU,OAAO,KAAK,GAAG;AAC3C,UAAM,IAAI,SAAS;AACnB,UAAM,MAAM,MAAM,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,WAAW,KAAK,IAAI,WAAW,EAAE,CAAC;AAAA,EACpF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { attribute, kebab } from "../../core/index.js";
|
|
2
|
+
const style = attribute({
|
|
3
|
+
name: "style",
|
|
4
|
+
value: "required",
|
|
5
|
+
mount({ el, key, cased, evaluate, effect }) {
|
|
6
|
+
const original = /* @__PURE__ */ new Map();
|
|
7
|
+
const put = (prop, v) => {
|
|
8
|
+
if (!original.has(prop)) original.set(prop, el.style.getPropertyValue(prop));
|
|
9
|
+
if (v || v === 0) el.style.setProperty(prop, String(v));
|
|
10
|
+
else el.style.setProperty(prop, original.get(prop));
|
|
11
|
+
};
|
|
12
|
+
effect(() => {
|
|
13
|
+
const map = key ? { [cased("kebab")]: evaluate() } : evaluate();
|
|
14
|
+
for (const prop of original.keys()) if (!(prop in map)) put(prop, "");
|
|
15
|
+
for (const prop in map) put(kebab(prop), map[prop]);
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
for (const [prop, v] of original) el.style.setProperty(prop, v);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
style
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/style.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, kebab } from '../../core/index.js'\n\n/** `style:color=\"expr\"` or `style=\"{ color: expr }\"`. Falsy values (except 0) restore the original. */\nexport const style = attribute({\n name: 'style',\n value: 'required',\n mount({ el, key, cased, evaluate, effect }) {\n const original = new Map<string, string>()\n const put = (prop: string, v: unknown) => {\n if (!original.has(prop)) original.set(prop, el.style.getPropertyValue(prop))\n if (v || v === 0) el.style.setProperty(prop, String(v))\n else el.style.setProperty(prop, original.get(prop)!)\n }\n effect(() => {\n const map: Record<string, unknown> = key ? { [cased('kebab')]: evaluate() } : evaluate()\n for (const prop of original.keys()) if (!(prop in map)) put(prop, '')\n for (const prop in map) put(kebab(prop), map[prop])\n })\n return () => {\n for (const [prop, v] of original) el.style.setProperty(prop, v)\n }\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,aAAa;AAG1B,MAAM,QAAQ,UAAU;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM,EAAE,IAAI,KAAK,OAAO,UAAU,OAAO,GAAG;AAC1C,UAAM,WAAW,oBAAI,IAAoB;AACzC,UAAM,MAAM,CAAC,MAAc,MAAe;AACxC,UAAI,CAAC,SAAS,IAAI,IAAI,EAAG,UAAS,IAAI,MAAM,GAAG,MAAM,iBAAiB,IAAI,CAAC;AAC3E,UAAI,KAAK,MAAM,EAAG,IAAG,MAAM,YAAY,MAAM,OAAO,CAAC,CAAC;AAAA,UACjD,IAAG,MAAM,YAAY,MAAM,SAAS,IAAI,IAAI,CAAE;AAAA,IACrD;AACA,WAAO,MAAM;AACX,YAAM,MAA+B,MAAM,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,EAAE,IAAI,SAAS;AACvF,iBAAW,QAAQ,SAAS,KAAK,EAAG,KAAI,EAAE,QAAQ,KAAM,KAAI,MAAM,EAAE;AACpE,iBAAW,QAAQ,IAAK,KAAI,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC;AAAA,IACpD,CAAC;AACD,WAAO,MAAM;AACX,iBAAW,CAAC,MAAM,CAAC,KAAK,SAAU,IAAG,MAAM,YAAY,MAAM,CAAC;AAAA,IAChE;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const text: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const text = attribute({
|
|
3
|
+
name: "text",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
mount: ({ el, evaluate, effect }) => effect(() => {
|
|
7
|
+
el.textContent = String(evaluate() ?? "");
|
|
8
|
+
})
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
text
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/text.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\nexport const text = attribute({\n name: 'text',\n key: 'forbidden',\n value: 'required',\n mount: ({ el, evaluate, effect }) =>\n effect(() => {\n el.textContent = String(evaluate() ?? '')\n }),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,OAAO,UAAU;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO,CAAC,EAAE,IAAI,UAAU,OAAO,MAC7B,OAAO,MAAM;AACX,OAAG,cAAc,OAAO,SAAS,KAAK,EAAE;AAAA,EAC1C,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const viewTransition: import("../../core/types.js").AttributePlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { attribute } from "../../core/index.js";
|
|
2
|
+
const viewTransition = attribute({
|
|
3
|
+
name: "view-transition",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "required",
|
|
6
|
+
mount: ({ el, evaluate, effect }) => effect(() => el.style.setProperty("view-transition-name", String(evaluate())))
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
viewTransition
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=viewTransition.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/attributes/viewTransition.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../core/index.js'\n\nexport const viewTransition = attribute({\n name: 'view-transition',\n key: 'forbidden',\n value: 'required',\n mount: ({ el, evaluate, effect }) => effect(() => el.style.setProperty('view-transition-name', String(evaluate()))),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,iBAAiB,UAAU;AAAA,EACtC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO,CAAC,EAAE,IAAI,UAAU,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM,YAAY,wBAAwB,OAAO,SAAS,CAAC,CAAC,CAAC;AACpH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { attribute } from "../../kernel/index.js";
|
|
2
|
+
const put = (el, name, v) => {
|
|
3
|
+
if (v === false || v == null) el.removeAttribute(name);
|
|
4
|
+
else el.setAttribute(name, v === true ? "" : typeof v === "object" ? JSON.stringify(v) : String(v));
|
|
5
|
+
};
|
|
6
|
+
const attr = attribute({
|
|
7
|
+
name: "attr",
|
|
8
|
+
value: "required",
|
|
9
|
+
mount({ el, key, cased, evaluate, effect }) {
|
|
10
|
+
effect(() => {
|
|
11
|
+
if (key) return put(el, cased("kebab"), evaluate());
|
|
12
|
+
const map = evaluate();
|
|
13
|
+
for (const k in map) put(el, k, map[k]);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
attr
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=attribute-sync.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/directives/attribute-sync.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute } from '../../kernel/index.js'\n\nconst put = (el: Element, name: string, v: unknown) => {\n if (v === false || v == null) el.removeAttribute(name)\n else el.setAttribute(name, v === true ? '' : typeof v === 'object' ? JSON.stringify(v) : String(v))\n}\n\n/** `attr:title=\"expr\"` or `attr=\"{ title: expr }\"`. true \u2192 present, false/null \u2192 removed. */\nexport const attr = attribute({\n name: 'attr',\n value: 'required',\n mount({ el, key, cased, evaluate, effect }) {\n effect(() => {\n if (key) return put(el, cased('kebab'), evaluate())\n const map = evaluate()\n for (const k in map) put(el, k, map[k])\n })\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAE1B,MAAM,MAAM,CAAC,IAAa,MAAc,MAAe;AACrD,MAAI,MAAM,SAAS,KAAK,KAAM,IAAG,gBAAgB,IAAI;AAAA,MAChD,IAAG,aAAa,MAAM,MAAM,OAAO,KAAK,OAAO,MAAM,WAAW,KAAK,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC;AACpG;AAGO,MAAM,OAAO,UAAU;AAAA,EAC5B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM,EAAE,IAAI,KAAK,OAAO,UAAU,OAAO,GAAG;AAC1C,WAAO,MAAM;AACX,UAAI,IAAK,QAAO,IAAI,IAAI,MAAM,OAAO,GAAG,SAAS,CAAC;AAClD,YAAM,MAAM,SAAS;AACrB,iBAAW,KAAK,IAAK,KAAI,IAAI,GAAG,IAAI,CAAC,CAAC;AAAA,IACxC,CAAC;AAAA,EACH;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns same-origin links and forms inside the element into requests whose full-document response
|
|
3
|
+
* is morphed into the current page, with history entries: `boost` on a container (or `body`).
|
|
4
|
+
* Needs `httpGet`, `httpPost` and `applyElements`. `__replace` replaces the history entry instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const boost: import("../../kernel/contracts.js").AttributePlugin;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { attribute } from "../../kernel/index.js";
|
|
2
|
+
const boost = attribute({
|
|
3
|
+
name: "boost",
|
|
4
|
+
key: "forbidden",
|
|
5
|
+
value: "forbidden",
|
|
6
|
+
mount({ el, mods, store, runtime, listen, error, cleanup }) {
|
|
7
|
+
const ctx = { el, store, runtime, error, cleanup };
|
|
8
|
+
const go = (url, method = "get", evt, form) => {
|
|
9
|
+
const o = form ? { contentType: "form", selector: void 0, openWhenHidden: true } : { openWhenHidden: true };
|
|
10
|
+
const p = runtime.call(method, { ...ctx, el: form ?? el, evt }, [url, o]);
|
|
11
|
+
history[mods.has("replace") ? "replaceState" : "pushState"](null, "", url);
|
|
12
|
+
Promise.resolve(p).then(() => scrollTo(0, 0));
|
|
13
|
+
};
|
|
14
|
+
listen(el, "click", (e) => {
|
|
15
|
+
const a = e.target.closest("a[href]");
|
|
16
|
+
if (!a || e.defaultPrevented || e.button || e.metaKey || e.ctrlKey || e.shiftKey || a.target || a.hasAttribute("download")) return;
|
|
17
|
+
if (a.origin !== location.origin || a.hash && a.pathname === location.pathname) return;
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
go(a.href, "get", e);
|
|
20
|
+
});
|
|
21
|
+
listen(el, "submit", (e) => {
|
|
22
|
+
const form = e.target;
|
|
23
|
+
if (e.defaultPrevented || form.target) return;
|
|
24
|
+
const url = new URL(form.action || location.href);
|
|
25
|
+
if (url.origin !== location.origin) return;
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
go(url.href, form.method.toLowerCase() === "post" ? "post" : "get", e, form);
|
|
28
|
+
});
|
|
29
|
+
listen(window, "popstate", () => runtime.call("get", ctx, [location.href, { openWhenHidden: true }]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
boost
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=boost.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/directives/boost.ts"],
|
|
4
|
+
"sourcesContent": ["import { attribute, type ActionCtx } from '../../kernel/index.js'\n\n/**\n * Turns same-origin links and forms inside the element into requests whose full-document response\n * is morphed into the current page, with history entries: `boost` on a container (or `body`).\n * Needs `httpGet`, `httpPost` and `applyElements`. `__replace` replaces the history entry instead.\n */\nexport const boost = attribute({\n name: 'boost',\n key: 'forbidden',\n value: 'forbidden',\n mount({ el, mods, store, runtime, listen, error, cleanup }) {\n const ctx: ActionCtx = { el, store, runtime, error, cleanup }\n const go = (url: string, method = 'get', evt?: Event, form?: HTMLFormElement) => {\n const o = form ? { contentType: 'form', selector: undefined, openWhenHidden: true } : { openWhenHidden: true }\n const p = runtime.call(method, { ...ctx, el: form ?? el, evt }, [url, o])\n history[mods.has('replace') ? 'replaceState' : 'pushState'](null, '', url)\n Promise.resolve(p).then(() => scrollTo(0, 0))\n }\n listen(el, 'click', (e: MouseEvent) => {\n const a = (e.target as Element).closest('a[href]') as HTMLAnchorElement | null\n if (!a || e.defaultPrevented || e.button || e.metaKey || e.ctrlKey || e.shiftKey || a.target || a.hasAttribute('download')) return\n if (a.origin !== location.origin || a.hash && a.pathname === location.pathname) return\n e.preventDefault()\n go(a.href, 'get', e)\n })\n listen(el, 'submit', (e: SubmitEvent) => {\n const form = e.target as HTMLFormElement\n if (e.defaultPrevented || form.target) return\n const url = new URL(form.action || location.href)\n if (url.origin !== location.origin) return\n e.preventDefault()\n go(url.href, form.method.toLowerCase() === 'post' ? 'post' : 'get', e, form)\n })\n listen(window, 'popstate', () => runtime.call('get', ctx, [location.href, { openWhenHidden: true }]))\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiC;AAOnC,MAAM,QAAQ,UAAU;AAAA,EAC7B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM,EAAE,IAAI,MAAM,OAAO,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAC1D,UAAM,MAAiB,EAAE,IAAI,OAAO,SAAS,OAAO,QAAQ;AAC5D,UAAM,KAAK,CAAC,KAAa,SAAS,OAAO,KAAa,SAA2B;AAC/E,YAAM,IAAI,OAAO,EAAE,aAAa,QAAQ,UAAU,QAAW,gBAAgB,KAAK,IAAI,EAAE,gBAAgB,KAAK;AAC7G,YAAM,IAAI,QAAQ,KAAK,QAAQ,EAAE,GAAG,KAAK,IAAI,QAAQ,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;AACxE,cAAQ,KAAK,IAAI,SAAS,IAAI,iBAAiB,WAAW,EAAE,MAAM,IAAI,GAAG;AACzE,cAAQ,QAAQ,CAAC,EAAE,KAAK,MAAM,SAAS,GAAG,CAAC,CAAC;AAAA,IAC9C;AACA,WAAO,IAAI,SAAS,CAAC,MAAkB;AACrC,YAAM,IAAK,EAAE,OAAmB,QAAQ,SAAS;AACjD,UAAI,CAAC,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,UAAU,EAAG;AAC5H,UAAI,EAAE,WAAW,SAAS,UAAU,EAAE,QAAQ,EAAE,aAAa,SAAS,SAAU;AAChF,QAAE,eAAe;AACjB,SAAG,EAAE,MAAM,OAAO,CAAC;AAAA,IACrB,CAAC;AACD,WAAO,IAAI,UAAU,CAAC,MAAmB;AACvC,YAAM,OAAO,EAAE;AACf,UAAI,EAAE,oBAAoB,KAAK,OAAQ;AACvC,YAAM,MAAM,IAAI,IAAI,KAAK,UAAU,SAAS,IAAI;AAChD,UAAI,IAAI,WAAW,SAAS,OAAQ;AACpC,QAAE,eAAe;AACjB,SAAG,IAAI,MAAM,KAAK,OAAO,YAAY,MAAM,SAAS,SAAS,OAAO,GAAG,IAAI;AAAA,IAC7E,CAAC;AACD,WAAO,QAAQ,YAAY,MAAM,QAAQ,KAAK,OAAO,KAAK,CAAC,SAAS,MAAM,EAAE,gBAAgB,KAAK,CAAC,CAAC,CAAC;AAAA,EACtG;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|