@askrjs/askr 0.0.28 → 0.0.30
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/README.md +44 -172
- package/dist/_virtual/_rolldown/runtime.js +7 -0
- package/dist/bench/components/benchmark-row.d.ts +20 -0
- package/dist/bench/components/benchmark-row.d.ts.map +1 -0
- package/dist/bench/components/benchmark-row.js +42 -0
- package/dist/bench/components/benchmark-row.js.map +1 -0
- package/dist/bench/components/benchmark-table.js +25 -0
- package/dist/bench/components/benchmark-table.js.map +1 -0
- package/dist/benchmark.d.ts +22 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +64 -1
- package/dist/benchmark.js.map +1 -0
- package/dist/bin/askr-ssg.d.ts +22 -26
- package/dist/bin/askr-ssg.d.ts.map +1 -1
- package/dist/bin/askr-ssg.js +149 -2
- package/dist/bin/askr-ssg.js.map +1 -0
- package/dist/boot/index.d.ts +64 -42
- package/dist/boot/index.d.ts.map +1 -1
- package/dist/boot/index.js +416 -2
- package/dist/boot/index.js.map +1 -0
- package/dist/common/component.d.ts +14 -13
- package/dist/common/component.d.ts.map +1 -1
- package/dist/common/control.d.ts +13 -0
- package/dist/common/control.d.ts.map +1 -0
- package/dist/common/control.js +14 -0
- package/dist/common/control.js.map +1 -0
- package/dist/common/env.js +47 -0
- package/dist/common/env.js.map +1 -0
- package/dist/common/jsx.d.ts +17 -15
- package/dist/common/jsx.d.ts.map +1 -1
- package/dist/common/jsx.js +8 -1
- package/dist/common/jsx.js.map +1 -0
- package/dist/common/props.d.ts +14 -11
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/router.d.ts +190 -32
- package/dist/common/router.d.ts.map +1 -1
- package/dist/common/ssr-errors.d.ts +6 -3
- package/dist/common/ssr-errors.d.ts.map +1 -1
- package/dist/common/ssr-errors.js +16 -1
- package/dist/common/ssr-errors.js.map +1 -0
- package/dist/common/ssr.d.ts +12 -9
- package/dist/common/ssr.d.ts.map +1 -1
- package/dist/common/vnode.d.ts +17 -15
- package/dist/common/vnode.d.ts.map +1 -1
- package/dist/common/vnode.js +10 -1
- package/dist/common/vnode.js.map +1 -0
- package/dist/components/link.d.ts +37 -25
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +64 -1
- package/dist/components/link.js.map +1 -0
- package/dist/control/case.d.ts +17 -0
- package/dist/control/case.d.ts.map +1 -0
- package/dist/control/case.js +69 -0
- package/dist/control/case.js.map +1 -0
- package/dist/control/for.d.ts +23 -0
- package/dist/control/for.d.ts.map +1 -0
- package/dist/control/for.js +62 -0
- package/dist/control/for.js.map +1 -0
- package/dist/control/index.d.ts +4 -0
- package/dist/control/index.js +4 -0
- package/dist/control/shared.js +20 -0
- package/dist/control/shared.js.map +1 -0
- package/dist/control/show.d.ts +14 -0
- package/dist/control/show.d.ts.map +1 -0
- package/dist/control/show.js +33 -0
- package/dist/control/show.js.map +1 -0
- package/dist/dev/invariant.js +29 -2
- package/dist/dev/invariant.js.map +1 -0
- package/dist/dev/logger.js +37 -1
- package/dist/dev/logger.js.map +1 -0
- package/dist/foundations/core.d.ts +15 -23
- package/dist/foundations/core.js +13 -1
- package/dist/foundations/icon/icon.d.ts +53 -0
- package/dist/foundations/icon/icon.d.ts.map +1 -0
- package/dist/foundations/icon/icon.js +88 -0
- package/dist/foundations/icon/icon.js.map +1 -0
- package/dist/foundations/icon/icon.types.d.ts +21 -0
- package/dist/foundations/icon/icon.types.d.ts.map +1 -0
- package/dist/foundations/index.d.ts +23 -3
- package/dist/foundations/index.js +22 -1
- package/dist/foundations/interactions/dismissable.d.ts +25 -17
- package/dist/foundations/interactions/dismissable.d.ts.map +1 -1
- package/dist/foundations/interactions/dismissable.js +26 -1
- package/dist/foundations/interactions/dismissable.js.map +1 -0
- package/dist/foundations/interactions/focusable.d.ts +13 -7
- package/dist/foundations/interactions/focusable.d.ts.map +1 -1
- package/dist/foundations/interactions/focusable.js +18 -1
- package/dist/foundations/interactions/focusable.js.map +1 -0
- package/dist/foundations/interactions/hoverable.d.ts +17 -10
- package/dist/foundations/interactions/hoverable.d.ts.map +1 -1
- package/dist/foundations/interactions/hoverable.js +15 -1
- package/dist/foundations/interactions/hoverable.js.map +1 -0
- package/dist/foundations/interactions/interaction-policy.d.ts +32 -78
- package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -1
- package/dist/foundations/interactions/interaction-policy.js +122 -1
- package/dist/foundations/interactions/interaction-policy.js.map +1 -0
- package/dist/foundations/interactions/pressable.d.ts +25 -18
- package/dist/foundations/interactions/pressable.d.ts.map +1 -1
- package/dist/foundations/interactions/pressable.js +51 -1
- package/dist/foundations/interactions/pressable.js.map +1 -0
- package/dist/foundations/interactions/roving-focus.d.ts +49 -114
- package/dist/foundations/interactions/roving-focus.d.ts.map +1 -1
- package/dist/foundations/interactions/roving-focus.js +71 -1
- package/dist/foundations/interactions/roving-focus.js.map +1 -0
- package/dist/foundations/state/controllable.d.ts +22 -41
- package/dist/foundations/state/controllable.d.ts.map +1 -1
- package/dist/foundations/state/controllable.js +81 -1
- package/dist/foundations/state/controllable.js.map +1 -0
- package/dist/foundations/structures/collection.d.ts +25 -40
- package/dist/foundations/structures/collection.d.ts.map +1 -1
- package/dist/foundations/structures/collection.js +51 -1
- package/dist/foundations/structures/collection.js.map +1 -0
- package/dist/foundations/structures/layer.d.ts +47 -68
- package/dist/foundations/structures/layer.d.ts.map +1 -1
- package/dist/foundations/structures/layer.js +81 -1
- package/dist/foundations/structures/layer.js.map +1 -0
- package/dist/foundations/structures/layout.d.ts +6 -3
- package/dist/foundations/structures/layout.d.ts.map +1 -1
- package/dist/foundations/structures/layout.js +13 -1
- package/dist/foundations/structures/layout.js.map +1 -0
- package/dist/foundations/structures/portal.d.ts +17 -10
- package/dist/foundations/structures/portal.d.ts.map +1 -1
- package/dist/foundations/structures/portal.js +105 -1
- package/dist/foundations/structures/portal.js.map +1 -0
- package/dist/foundations/structures/presence.d.ts +11 -5
- package/dist/foundations/structures/presence.d.ts.map +1 -1
- package/dist/foundations/structures/presence.js +39 -1
- package/dist/foundations/structures/presence.js.map +1 -0
- package/dist/foundations/structures/slot.d.ts +11 -8
- package/dist/foundations/structures/slot.d.ts.map +1 -1
- package/dist/foundations/structures/slot.js +41 -1
- package/dist/foundations/structures/slot.js.map +1 -0
- package/dist/foundations/structures.d.ts +7 -14
- package/dist/foundations/structures.js +6 -1
- package/dist/foundations/utilities/aria.d.ts +9 -6
- package/dist/foundations/utilities/aria.d.ts.map +1 -1
- package/dist/foundations/utilities/aria.js +17 -1
- package/dist/foundations/utilities/aria.js.map +1 -0
- package/dist/foundations/utilities/compose-handlers.d.ts +10 -7
- package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -1
- package/dist/foundations/utilities/compose-handlers.js +20 -1
- package/dist/foundations/utilities/compose-handlers.js.map +1 -0
- package/dist/foundations/utilities/compose-ref.d.ts +7 -4
- package/dist/foundations/utilities/compose-ref.d.ts.map +1 -1
- package/dist/foundations/utilities/compose-ref.js +18 -1
- package/dist/foundations/utilities/compose-ref.js.map +1 -0
- package/dist/foundations/utilities/event-types.d.ts +14 -11
- package/dist/foundations/utilities/event-types.d.ts.map +1 -1
- package/dist/foundations/utilities/merge-props.d.ts +4 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +1 -1
- package/dist/foundations/utilities/merge-props.js +49 -1
- package/dist/foundations/utilities/merge-props.js.map +1 -0
- package/dist/foundations/utilities/use-id.d.ts +9 -6
- package/dist/foundations/utilities/use-id.d.ts.map +1 -1
- package/dist/foundations/utilities/use-id.js +29 -1
- package/dist/foundations/utilities/use-id.js.map +1 -0
- package/dist/fx/fx.d.ts +24 -21
- package/dist/fx/fx.d.ts.map +1 -1
- package/dist/fx/fx.js +212 -1
- package/dist/fx/fx.js.map +1 -0
- package/dist/fx/index.d.ts +4 -7
- package/dist/fx/index.js +4 -1
- package/dist/fx/noop.js +9 -1
- package/dist/fx/noop.js.map +1 -0
- package/dist/fx/timing.d.ts +24 -21
- package/dist/fx/timing.d.ts.map +1 -1
- package/dist/fx/timing.js +236 -1
- package/dist/fx/timing.js.map +1 -0
- package/dist/index.d.ts +21 -23
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -0
- package/dist/jsx/index.d.ts +1 -4
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/types.d.ts +18 -25
- package/dist/jsx/types.d.ts.map +1 -1
- package/dist/jsx/types.js +1 -1
- package/dist/jsx/utils.d.ts +4 -3
- package/dist/jsx/utils.d.ts.map +1 -1
- package/dist/jsx/utils.js +19 -1
- package/dist/jsx/utils.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +32 -1
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +12 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +45 -1
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-runtime2.d.ts +2 -0
- package/dist/jsx-runtime2.js +3 -0
- package/dist/renderer/children.js +293 -0
- package/dist/renderer/children.js.map +1 -0
- package/dist/renderer/cleanup.js +150 -1
- package/dist/renderer/cleanup.js.map +1 -0
- package/dist/renderer/dom.js +2439 -1
- package/dist/renderer/dom.js.map +1 -0
- package/dist/renderer/env.js +1 -0
- package/dist/renderer/evaluate.js +450 -1
- package/dist/renderer/evaluate.js.map +1 -0
- package/dist/renderer/fastpath.js +145 -1
- package/dist/renderer/fastpath.js.map +1 -0
- package/dist/renderer/index.js +24 -1
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/keyed.js +119 -1
- package/dist/renderer/keyed.js.map +1 -0
- package/dist/renderer/reconcile.js +359 -1
- package/dist/renderer/reconcile.js.map +1 -0
- package/dist/renderer/types.js +1 -1
- package/dist/renderer/utils.js +220 -1
- package/dist/renderer/utils.js.map +1 -0
- package/dist/resources/index.d.ts +3 -9
- package/dist/resources/index.js +3 -1
- package/dist/router/index.d.ts +6 -10
- package/dist/router/index.js +5 -1
- package/dist/router/match.js +83 -1
- package/dist/router/match.js.map +1 -0
- package/dist/router/navigate.d.ts +20 -8
- package/dist/router/navigate.d.ts.map +1 -1
- package/dist/router/navigate.js +288 -1
- package/dist/router/navigate.js.map +1 -0
- package/dist/router/policy.d.ts +22 -0
- package/dist/router/policy.d.ts.map +1 -0
- package/dist/router/policy.js +116 -0
- package/dist/router/policy.js.map +1 -0
- package/dist/router/route-context.js +79 -0
- package/dist/router/route-context.js.map +1 -0
- package/dist/router/route.d.ts +101 -34
- package/dist/router/route.d.ts.map +1 -1
- package/dist/router/route.js +599 -1
- package/dist/router/route.js.map +1 -0
- package/dist/runtime/child-scope.d.ts +21 -0
- package/dist/runtime/child-scope.d.ts.map +1 -0
- package/dist/runtime/child-scope.js +77 -0
- package/dist/runtime/child-scope.js.map +1 -0
- package/dist/runtime/component.d.ts +67 -56
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/component.js +462 -1
- package/dist/runtime/component.js.map +1 -0
- package/dist/runtime/context.d.ts +28 -42
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js +205 -1
- package/dist/runtime/context.js.map +1 -0
- package/dist/runtime/control.d.ts +43 -0
- package/dist/runtime/control.d.ts.map +1 -0
- package/dist/runtime/control.js +125 -0
- package/dist/runtime/control.js.map +1 -0
- package/dist/runtime/derive.d.ts +12 -9
- package/dist/runtime/derive.d.ts.map +1 -1
- package/dist/runtime/derive.js +134 -1
- package/dist/runtime/derive.js.map +1 -0
- package/dist/runtime/dev-namespace.js +57 -1
- package/dist/runtime/dev-namespace.js.map +1 -0
- package/dist/runtime/effect.d.ts +32 -0
- package/dist/runtime/effect.d.ts.map +1 -0
- package/dist/runtime/effect.js +146 -0
- package/dist/runtime/effect.js.map +1 -0
- package/dist/runtime/events.js +162 -1
- package/dist/runtime/events.js.map +1 -0
- package/dist/runtime/execution-model.js +15 -1
- package/dist/runtime/execution-model.js.map +1 -0
- package/dist/runtime/fastlane.js +204 -1
- package/dist/runtime/fastlane.js.map +1 -0
- package/dist/runtime/for-bench.d.ts +41 -0
- package/dist/runtime/for-bench.d.ts.map +1 -0
- package/dist/runtime/for-bench.js +173 -0
- package/dist/runtime/for-bench.js.map +1 -0
- package/dist/runtime/for.d.ts +62 -49
- package/dist/runtime/for.d.ts.map +1 -1
- package/dist/runtime/for.js +668 -1
- package/dist/runtime/for.js.map +1 -0
- package/dist/runtime/operations.d.ts +18 -15
- package/dist/runtime/operations.d.ts.map +1 -1
- package/dist/runtime/operations.js +209 -1
- package/dist/runtime/operations.js.map +1 -0
- package/dist/runtime/perf-metrics.js +64 -1
- package/dist/runtime/perf-metrics.js.map +1 -0
- package/dist/runtime/readable.d.ts +24 -18
- package/dist/runtime/readable.d.ts.map +1 -1
- package/dist/runtime/readable.js +118 -1
- package/dist/runtime/readable.js.map +1 -0
- package/dist/runtime/resource-cell.js +102 -1
- package/dist/runtime/resource-cell.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +51 -50
- package/dist/runtime/scheduler.d.ts.map +1 -1
- package/dist/runtime/scheduler.js +328 -1
- package/dist/runtime/scheduler.js.map +1 -0
- package/dist/runtime/selector.d.ts +7 -5
- package/dist/runtime/selector.d.ts.map +1 -1
- package/dist/runtime/selector.js +188 -1
- package/dist/runtime/selector.js.map +1 -0
- package/dist/runtime/ssr-bridge.js +24 -1
- package/dist/runtime/ssr-bridge.js.map +1 -0
- package/dist/runtime/state.d.ts +11 -19
- package/dist/runtime/state.d.ts.map +1 -1
- package/dist/runtime/state.js +99 -1
- package/dist/runtime/state.js.map +1 -0
- package/dist/ssg/batch-render.d.ts +10 -10
- package/dist/ssg/batch-render.d.ts.map +1 -1
- package/dist/ssg/batch-render.js +84 -1
- package/dist/ssg/batch-render.js.map +1 -0
- package/dist/ssg/create-static-gen.d.ts +28 -29
- package/dist/ssg/create-static-gen.d.ts.map +1 -1
- package/dist/ssg/create-static-gen.js +282 -1
- package/dist/ssg/create-static-gen.js.map +1 -0
- package/dist/ssg/generate-metadata.d.ts +12 -15
- package/dist/ssg/generate-metadata.d.ts.map +1 -1
- package/dist/ssg/generate-metadata.js +94 -1
- package/dist/ssg/generate-metadata.js.map +1 -0
- package/dist/ssg/incremental-manifest.js +56 -1
- package/dist/ssg/incremental-manifest.js.map +1 -0
- package/dist/ssg/index.d.ts +8 -28
- package/dist/ssg/index.js +7 -1
- package/dist/ssg/resolve-ssg-data.d.ts +10 -13
- package/dist/ssg/resolve-ssg-data.d.ts.map +1 -1
- package/dist/ssg/resolve-ssg-data.js +46 -1
- package/dist/ssg/resolve-ssg-data.js.map +1 -0
- package/dist/ssg/route-utils.d.ts +14 -10
- package/dist/ssg/route-utils.d.ts.map +1 -1
- package/dist/ssg/route-utils.js +24 -1
- package/dist/ssg/route-utils.js.map +1 -0
- package/dist/ssg/types.d.ts +157 -144
- package/dist/ssg/types.d.ts.map +1 -1
- package/dist/ssg/write-static-files.d.ts +8 -14
- package/dist/ssg/write-static-files.d.ts.map +1 -1
- package/dist/ssg/write-static-files.js +73 -1
- package/dist/ssg/write-static-files.js.map +1 -0
- package/dist/ssr/attrs.js +93 -1
- package/dist/ssr/attrs.js.map +1 -0
- package/dist/ssr/context.d.ts +31 -35
- package/dist/ssr/context.d.ts.map +1 -1
- package/dist/ssr/context.js +63 -1
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/errors.d.ts +6 -4
- package/dist/ssr/errors.d.ts.map +1 -1
- package/dist/ssr/errors.js +4 -1
- package/dist/ssr/errors.js.map +1 -0
- package/dist/ssr/escape.js +153 -1
- package/dist/ssr/escape.js.map +1 -0
- package/dist/ssr/index.d.ts +74 -72
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +543 -1
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/render-keys.d.ts +27 -29
- package/dist/ssr/render-keys.d.ts.map +1 -1
- package/dist/ssr/render-keys.js +39 -1
- package/dist/ssr/render-keys.js.map +1 -0
- package/dist/ssr/sink.js +86 -1
- package/dist/ssr/sink.js.map +1 -0
- package/dist/ssr/stream-render.js +76 -1
- package/dist/ssr/stream-render.js.map +1 -0
- package/dist/ssr/types.d.ts +14 -13
- package/dist/ssr/types.d.ts.map +1 -1
- package/package.json +49 -69
- package/dist/_virtual/___vite-browser-external.js +0 -1
- package/dist/_virtual/__vite-browser-external.js +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -1
- package/dist/_virtual/_fs.js +0 -1
- package/dist/_virtual/_path.js +0 -1
- package/dist/_virtual/main.js +0 -1
- package/dist/_virtual/preload-helper.js +0 -1
- package/dist/bench/benchmark-entry.d.ts +0 -14
- package/dist/bench/benchmark-entry.d.ts.map +0 -1
- package/dist/common/errors.d.ts +0 -53
- package/dist/common/errors.d.ts.map +0 -1
- package/dist/common/index.d.ts +0 -14
- package/dist/common/index.d.ts.map +0 -1
- package/dist/dev/invariant.d.ts +0 -83
- package/dist/dev/invariant.d.ts.map +0 -1
- package/dist/dev/logger.d.ts +0 -13
- package/dist/dev/logger.d.ts.map +0 -1
- package/dist/dev/vite-plugin-askr.d.ts +0 -25
- package/dist/dev/vite-plugin-askr.d.ts.map +0 -1
- package/dist/dev/warnings.d.ts +0 -5
- package/dist/dev/warnings.d.ts.map +0 -1
- package/dist/for/for.d.ts +0 -16
- package/dist/for/for.d.ts.map +0 -1
- package/dist/for/for.js +0 -1
- package/dist/for/index.d.ts +0 -2
- package/dist/for/index.d.ts.map +0 -1
- package/dist/for/index.js +0 -1
- package/dist/foundations/core.d.ts.map +0 -1
- package/dist/foundations/index.d.ts.map +0 -1
- package/dist/foundations/interactions/index.d.ts +0 -5
- package/dist/foundations/interactions/index.d.ts.map +0 -1
- package/dist/foundations/state/index.d.ts +0 -2
- package/dist/foundations/state/index.d.ts.map +0 -1
- package/dist/foundations/structures/index.d.ts +0 -5
- package/dist/foundations/structures/index.d.ts.map +0 -1
- package/dist/foundations/structures.d.ts.map +0 -1
- package/dist/foundations/utilities/index.d.ts +0 -7
- package/dist/foundations/utilities/index.d.ts.map +0 -1
- package/dist/fx/index.d.ts.map +0 -1
- package/dist/fx/noop.d.ts +0 -12
- package/dist/fx/noop.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsx/index.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -4
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -10
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/node_modules/esbuild/lib/main.js +0 -65
- package/dist/renderer/cleanup.d.ts +0 -28
- package/dist/renderer/cleanup.d.ts.map +0 -1
- package/dist/renderer/dom.d.ts +0 -64
- package/dist/renderer/dom.d.ts.map +0 -1
- package/dist/renderer/evaluate.d.ts +0 -4
- package/dist/renderer/evaluate.d.ts.map +0 -1
- package/dist/renderer/fastpath.d.ts +0 -7
- package/dist/renderer/fastpath.d.ts.map +0 -1
- package/dist/renderer/index.d.ts +0 -6
- package/dist/renderer/index.d.ts.map +0 -1
- package/dist/renderer/keyed.d.ts +0 -23
- package/dist/renderer/keyed.d.ts.map +0 -1
- package/dist/renderer/reconcile.d.ts +0 -88
- package/dist/renderer/reconcile.d.ts.map +0 -1
- package/dist/renderer/types.d.ts +0 -3
- package/dist/renderer/types.d.ts.map +0 -1
- package/dist/renderer/utils.d.ts +0 -63
- package/dist/renderer/utils.d.ts.map +0 -1
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/match.d.ts +0 -22
- package/dist/router/match.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.d.ts +0 -31
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/events.d.ts +0 -53
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/execution-model.d.ts +0 -4
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/fastlane.d.ts +0 -27
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/hydration.d.ts +0 -25
- package/dist/runtime/hydration.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.d.ts +0 -25
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/resource-cell.d.ts +0 -35
- package/dist/runtime/resource-cell.d.ts.map +0 -1
- package/dist/runtime/snapshot.d.ts +0 -25
- package/dist/runtime/snapshot.d.ts.map +0 -1
- package/dist/runtime/ssr-bridge.d.ts +0 -10
- package/dist/runtime/ssr-bridge.d.ts.map +0 -1
- package/dist/ssg/discover-resources.d.ts +0 -15
- package/dist/ssg/discover-resources.d.ts.map +0 -1
- package/dist/ssg/incremental-manifest.d.ts +0 -23
- package/dist/ssg/incremental-manifest.d.ts.map +0 -1
- package/dist/ssg/index.d.ts.map +0 -1
- package/dist/ssr/attrs.d.ts +0 -26
- package/dist/ssr/attrs.d.ts.map +0 -1
- package/dist/ssr/create-ssr.d.ts +0 -19
- package/dist/ssr/create-ssr.d.ts.map +0 -1
- package/dist/ssr/escape.d.ts +0 -38
- package/dist/ssr/escape.d.ts.map +0 -1
- package/dist/ssr/sink.d.ts +0 -23
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/stream-render.d.ts +0 -7
- package/dist/ssr/stream-render.d.ts.map +0 -1
- package/dist/vite/index.js +0 -4
package/dist/fx/timing.js
CHANGED
|
@@ -1 +1,236 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/fx/timing.ts
|
|
2
|
+
/**
|
|
3
|
+
* Debounce — delay execution, coalesce rapid calls
|
|
4
|
+
*
|
|
5
|
+
* Useful for: text input, resize, autosave
|
|
6
|
+
*
|
|
7
|
+
* @param fn Function to debounce
|
|
8
|
+
* @param ms Delay in milliseconds
|
|
9
|
+
* @param options trailing (default true), leading
|
|
10
|
+
* @returns Debounced function with cancel() method
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const save = debounce((text) => api.save(text), 500);
|
|
15
|
+
* input.addEventListener('input', (e) => save(e.target.value));
|
|
16
|
+
* save.cancel(); // stop any pending execution
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function debounce(fn, ms, options) {
|
|
20
|
+
let timeoutId = null;
|
|
21
|
+
const { leading = false, trailing = true } = options || {};
|
|
22
|
+
let lastArgs = null;
|
|
23
|
+
let lastThis = null;
|
|
24
|
+
let lastCallTime = 0;
|
|
25
|
+
const debounced = function(...args) {
|
|
26
|
+
const callTime = Date.now();
|
|
27
|
+
lastArgs = args;
|
|
28
|
+
lastThis = this;
|
|
29
|
+
if (timeoutId !== null) clearTimeout(timeoutId);
|
|
30
|
+
if (leading && callTime - lastCallTime >= ms) {
|
|
31
|
+
fn.apply(this, args);
|
|
32
|
+
lastCallTime = callTime;
|
|
33
|
+
}
|
|
34
|
+
if (trailing) timeoutId = setTimeout(() => {
|
|
35
|
+
fn.apply(lastThis, lastArgs);
|
|
36
|
+
timeoutId = null;
|
|
37
|
+
lastCallTime = Date.now();
|
|
38
|
+
}, ms);
|
|
39
|
+
};
|
|
40
|
+
debounced.cancel = () => {
|
|
41
|
+
if (timeoutId !== null) {
|
|
42
|
+
clearTimeout(timeoutId);
|
|
43
|
+
timeoutId = null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return debounced;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Throttle — rate-limit execution, keep first/last
|
|
50
|
+
*
|
|
51
|
+
* Useful for: scroll, mouse move, high-frequency events
|
|
52
|
+
*
|
|
53
|
+
* @param fn Function to throttle
|
|
54
|
+
* @param ms Minimum interval between calls in milliseconds
|
|
55
|
+
* @param options leading (default true), trailing (default true)
|
|
56
|
+
* @returns Throttled function with cancel() method
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const handleScroll = throttle(updateUI, 100);
|
|
61
|
+
* window.addEventListener('scroll', handleScroll);
|
|
62
|
+
* handleScroll.cancel();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
function throttle(fn, ms, options) {
|
|
66
|
+
let lastCallTime = 0;
|
|
67
|
+
let timeoutId = null;
|
|
68
|
+
const { leading = true, trailing = true } = options || {};
|
|
69
|
+
let lastArgs = null;
|
|
70
|
+
let lastThis = null;
|
|
71
|
+
const throttled = function(...args) {
|
|
72
|
+
const callTime = Date.now();
|
|
73
|
+
lastArgs = args;
|
|
74
|
+
lastThis = this;
|
|
75
|
+
if (leading && callTime - lastCallTime >= ms) {
|
|
76
|
+
fn.apply(this, args);
|
|
77
|
+
lastCallTime = callTime;
|
|
78
|
+
if (timeoutId !== null) {
|
|
79
|
+
clearTimeout(timeoutId);
|
|
80
|
+
timeoutId = null;
|
|
81
|
+
}
|
|
82
|
+
} else if (!leading && lastCallTime === 0) lastCallTime = callTime;
|
|
83
|
+
if (trailing && timeoutId === null) timeoutId = setTimeout(() => {
|
|
84
|
+
fn.apply(lastThis, lastArgs);
|
|
85
|
+
lastCallTime = Date.now();
|
|
86
|
+
timeoutId = null;
|
|
87
|
+
}, ms - (callTime - lastCallTime));
|
|
88
|
+
};
|
|
89
|
+
throttled.cancel = () => {
|
|
90
|
+
if (timeoutId !== null) {
|
|
91
|
+
clearTimeout(timeoutId);
|
|
92
|
+
timeoutId = null;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return throttled;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Once — guard against double execution
|
|
99
|
+
*
|
|
100
|
+
* Useful for: init logic, event safety
|
|
101
|
+
*
|
|
102
|
+
* @param fn Function to call at most once
|
|
103
|
+
* @returns Function that executes fn only on first call
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const init = once(setup);
|
|
108
|
+
* init(); // runs
|
|
109
|
+
* init(); // does nothing
|
|
110
|
+
* init(); // does nothing
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
function once(fn) {
|
|
114
|
+
let called = false;
|
|
115
|
+
let result;
|
|
116
|
+
return ((...args) => {
|
|
117
|
+
if (!called) {
|
|
118
|
+
called = true;
|
|
119
|
+
result = fn(...args);
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Defer — schedule on microtask queue
|
|
126
|
+
*
|
|
127
|
+
* Useful for: run-after-current-stack logic
|
|
128
|
+
* More reliable than setTimeout(..., 0)
|
|
129
|
+
*
|
|
130
|
+
* @param fn Function to defer
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* defer(() => update()); // runs after current stack, before next macrotask
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
function defer(fn) {
|
|
138
|
+
Promise.resolve().then(fn);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* RAF — coalesce multiple updates into single frame
|
|
142
|
+
*
|
|
143
|
+
* Useful for: animation, layout work, render updates
|
|
144
|
+
*
|
|
145
|
+
* @param fn Function to schedule on next animation frame
|
|
146
|
+
* @returns Function that schedules fn on requestAnimationFrame
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const update = raf(render);
|
|
151
|
+
* update(); // schedules on next frame
|
|
152
|
+
* update(); // same frame, no duplicate
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
function raf(fn) {
|
|
156
|
+
let frameId = null;
|
|
157
|
+
let lastArgs = null;
|
|
158
|
+
let lastThis = null;
|
|
159
|
+
return function(...args) {
|
|
160
|
+
lastArgs = args;
|
|
161
|
+
lastThis = this;
|
|
162
|
+
if (frameId === null) frameId = requestAnimationFrame(() => {
|
|
163
|
+
fn.apply(lastThis, lastArgs);
|
|
164
|
+
frameId = null;
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Idle — schedule low-priority work
|
|
170
|
+
*
|
|
171
|
+
* Useful for: background prep, non-urgent updates
|
|
172
|
+
* Falls back to setTimeout if requestIdleCallback unavailable
|
|
173
|
+
*
|
|
174
|
+
* @param fn Function to call when idle
|
|
175
|
+
* @param options timeout for fallback
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* idle(() => prefetchData());
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
function idle(fn, options) {
|
|
183
|
+
if (typeof requestIdleCallback !== "undefined") requestIdleCallback(fn, options ? { timeout: options.timeout } : void 0);
|
|
184
|
+
else Promise.resolve().then(() => {
|
|
185
|
+
setTimeout(fn, 0);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Timeout — Promise-based delay
|
|
190
|
+
*
|
|
191
|
+
* Useful for: readable async code, waiting between retries
|
|
192
|
+
*
|
|
193
|
+
* @param ms Milliseconds to wait
|
|
194
|
+
* @returns Promise that resolves after delay
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* await timeout(300);
|
|
199
|
+
* console.log('300ms later');
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function timeout(ms) {
|
|
203
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Retry — attempt function with backoff
|
|
207
|
+
*
|
|
208
|
+
* Useful for: network calls, transient failures
|
|
209
|
+
*
|
|
210
|
+
* @param fn Async function to retry
|
|
211
|
+
* @param options maxAttempts, delayMs, backoff function
|
|
212
|
+
* @returns Promise with final result or error
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts
|
|
216
|
+
* const data = await retry(() => fetch(url), {
|
|
217
|
+
* maxAttempts: 3,
|
|
218
|
+
* delayMs: 100,
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
async function retry(fn, options) {
|
|
223
|
+
const { maxAttempts = 3, delayMs = 100, backoff = (i) => delayMs * Math.pow(2, i) } = options || {};
|
|
224
|
+
let lastError = null;
|
|
225
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) try {
|
|
226
|
+
return await fn();
|
|
227
|
+
} catch (error) {
|
|
228
|
+
lastError = error;
|
|
229
|
+
if (attempt < maxAttempts - 1) await timeout(backoff(attempt));
|
|
230
|
+
}
|
|
231
|
+
throw lastError || /* @__PURE__ */ new Error("Retry failed");
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { debounce, defer, idle, once, raf, retry, throttle, timeout };
|
|
235
|
+
|
|
236
|
+
//# sourceMappingURL=timing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.js","names":[],"sources":["../../src/fx/timing.ts"],"sourcesContent":["/**\n * Timing utilities — pure helpers for common async patterns\n * No framework coupling. No lifecycle awareness.\n */\n\nexport interface DebounceOptions {\n leading?: boolean;\n trailing?: boolean;\n}\n\nexport interface ThrottleOptions {\n leading?: boolean;\n trailing?: boolean;\n}\n\nexport interface RetryOptions {\n maxAttempts?: number;\n delayMs?: number;\n backoff?: (attemptIndex: number) => number;\n}\n\n/**\n * Debounce — delay execution, coalesce rapid calls\n *\n * Useful for: text input, resize, autosave\n *\n * @param fn Function to debounce\n * @param ms Delay in milliseconds\n * @param options trailing (default true), leading\n * @returns Debounced function with cancel() method\n *\n * @example\n * ```ts\n * const save = debounce((text) => api.save(text), 500);\n * input.addEventListener('input', (e) => save(e.target.value));\n * save.cancel(); // stop any pending execution\n * ```\n */\nexport function debounce<T extends (...args: unknown[]) => unknown>(\n fn: T,\n ms: number,\n options?: DebounceOptions\n): T & { cancel(): void } {\n let timeoutId: NodeJS.Timeout | null = null;\n const { leading = false, trailing = true } = options || {};\n let lastArgs: unknown[] | null = null;\n let lastThis: unknown = null;\n let lastCallTime = 0;\n\n const debounced = function (this: unknown, ...args: unknown[]) {\n const callTime = Date.now();\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (leading && callTime - lastCallTime >= ms) {\n fn.apply(this, args);\n lastCallTime = callTime;\n }\n\n if (trailing) {\n timeoutId = setTimeout(() => {\n fn.apply(lastThis, lastArgs!);\n timeoutId = null;\n lastCallTime = Date.now();\n }, ms);\n }\n };\n\n debounced.cancel = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n return debounced as T & { cancel(): void };\n}\n\n/**\n * Throttle — rate-limit execution, keep first/last\n *\n * Useful for: scroll, mouse move, high-frequency events\n *\n * @param fn Function to throttle\n * @param ms Minimum interval between calls in milliseconds\n * @param options leading (default true), trailing (default true)\n * @returns Throttled function with cancel() method\n *\n * @example\n * ```ts\n * const handleScroll = throttle(updateUI, 100);\n * window.addEventListener('scroll', handleScroll);\n * handleScroll.cancel();\n * ```\n */\nexport function throttle<T extends (...args: unknown[]) => unknown>(\n fn: T,\n ms: number,\n options?: ThrottleOptions\n): T & { cancel(): void } {\n let lastCallTime = 0;\n let timeoutId: NodeJS.Timeout | null = null;\n const { leading = true, trailing = true } = options || {};\n let lastArgs: unknown[] | null = null;\n let lastThis: unknown = null;\n\n const throttled = function (this: unknown, ...args: unknown[]) {\n const callTime = Date.now();\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n\n if (leading && callTime - lastCallTime >= ms) {\n fn.apply(this, args);\n lastCallTime = callTime;\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n } else if (!leading && lastCallTime === 0) {\n lastCallTime = callTime;\n }\n\n if (trailing && timeoutId === null) {\n timeoutId = setTimeout(\n () => {\n fn.apply(lastThis, lastArgs!);\n lastCallTime = Date.now();\n timeoutId = null;\n },\n ms - (callTime - lastCallTime)\n );\n }\n };\n\n throttled.cancel = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n return throttled as T & { cancel(): void };\n}\n\n/**\n * Once — guard against double execution\n *\n * Useful for: init logic, event safety\n *\n * @param fn Function to call at most once\n * @returns Function that executes fn only on first call\n *\n * @example\n * ```ts\n * const init = once(setup);\n * init(); // runs\n * init(); // does nothing\n * init(); // does nothing\n * ```\n */\nexport function once<T extends (...args: unknown[]) => unknown>(fn: T): T {\n let called = false;\n let result: unknown;\n\n return ((...args: unknown[]) => {\n if (!called) {\n called = true;\n result = fn(...args);\n }\n return result;\n }) as T;\n}\n\n/**\n * Defer — schedule on microtask queue\n *\n * Useful for: run-after-current-stack logic\n * More reliable than setTimeout(..., 0)\n *\n * @param fn Function to defer\n *\n * @example\n * ```ts\n * defer(() => update()); // runs after current stack, before next macrotask\n * ```\n */\nexport function defer(fn: () => void): void {\n Promise.resolve().then(fn);\n}\n\n/**\n * RAF — coalesce multiple updates into single frame\n *\n * Useful for: animation, layout work, render updates\n *\n * @param fn Function to schedule on next animation frame\n * @returns Function that schedules fn on requestAnimationFrame\n *\n * @example\n * ```ts\n * const update = raf(render);\n * update(); // schedules on next frame\n * update(); // same frame, no duplicate\n * ```\n */\nexport function raf<T extends (...args: unknown[]) => unknown>(fn: T): T {\n let frameId: number | null = null;\n let lastArgs: unknown[] | null = null;\n let lastThis: unknown = null;\n\n return function (this: unknown, ...args: unknown[]) {\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n\n if (frameId === null) {\n frameId = requestAnimationFrame(() => {\n fn.apply(lastThis, lastArgs!);\n frameId = null;\n });\n }\n } as T;\n}\n\n/**\n * Idle — schedule low-priority work\n *\n * Useful for: background prep, non-urgent updates\n * Falls back to setTimeout if requestIdleCallback unavailable\n *\n * @param fn Function to call when idle\n * @param options timeout for fallback\n *\n * @example\n * ```ts\n * idle(() => prefetchData());\n * ```\n */\nexport function idle(fn: () => void, options?: { timeout?: number }): void {\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(fn, options ? { timeout: options.timeout } : undefined);\n } else {\n // Fallback: defer to microtask, then use setTimeout\n Promise.resolve().then(() => {\n setTimeout(fn, 0);\n });\n }\n}\n\n/**\n * Timeout — Promise-based delay\n *\n * Useful for: readable async code, waiting between retries\n *\n * @param ms Milliseconds to wait\n * @returns Promise that resolves after delay\n *\n * @example\n * ```ts\n * await timeout(300);\n * console.log('300ms later');\n * ```\n */\nexport function timeout(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Retry — attempt function with backoff\n *\n * Useful for: network calls, transient failures\n *\n * @param fn Async function to retry\n * @param options maxAttempts, delayMs, backoff function\n * @returns Promise with final result or error\n *\n * @example\n * ```ts\n * const data = await retry(() => fetch(url), {\n * maxAttempts: 3,\n * delayMs: 100,\n * });\n * ```\n */\nexport async function retry<T>(\n fn: () => Promise<T>,\n options?: RetryOptions\n): Promise<T> {\n const {\n maxAttempts = 3,\n delayMs = 100,\n backoff = (i: number) => delayMs * Math.pow(2, i),\n } = options || {};\n\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n try {\n return await fn();\n } catch (error) {\n lastError = error as Error;\n if (attempt < maxAttempts - 1) {\n const delay = backoff(attempt);\n await timeout(delay);\n }\n }\n }\n\n throw lastError || new Error('Retry failed');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,SAAgB,SACd,IACA,IACA,SACwB;CACxB,IAAI,YAAmC;CACvC,MAAM,EAAE,UAAU,OAAO,WAAW,SAAS,WAAW,EAAE;CAC1D,IAAI,WAA6B;CACjC,IAAI,WAAoB;CACxB,IAAI,eAAe;CAEnB,MAAM,YAAY,SAAyB,GAAG,MAAiB;EAC7D,MAAM,WAAW,KAAK,KAAK;AAC3B,aAAW;AAEX,aAAW;AAEX,MAAI,cAAc,KAChB,cAAa,UAAU;AAGzB,MAAI,WAAW,WAAW,gBAAgB,IAAI;AAC5C,MAAG,MAAM,MAAM,KAAK;AACpB,kBAAe;;AAGjB,MAAI,SACF,aAAY,iBAAiB;AAC3B,MAAG,MAAM,UAAU,SAAU;AAC7B,eAAY;AACZ,kBAAe,KAAK,KAAK;KACxB,GAAG;;AAIV,WAAU,eAAe;AACvB,MAAI,cAAc,MAAM;AACtB,gBAAa,UAAU;AACvB,eAAY;;;AAIhB,QAAO;;;;;;;;;;;;;;;;;;;AAoBT,SAAgB,SACd,IACA,IACA,SACwB;CACxB,IAAI,eAAe;CACnB,IAAI,YAAmC;CACvC,MAAM,EAAE,UAAU,MAAM,WAAW,SAAS,WAAW,EAAE;CACzD,IAAI,WAA6B;CACjC,IAAI,WAAoB;CAExB,MAAM,YAAY,SAAyB,GAAG,MAAiB;EAC7D,MAAM,WAAW,KAAK,KAAK;AAC3B,aAAW;AAEX,aAAW;AAEX,MAAI,WAAW,WAAW,gBAAgB,IAAI;AAC5C,MAAG,MAAM,MAAM,KAAK;AACpB,kBAAe;AACf,OAAI,cAAc,MAAM;AACtB,iBAAa,UAAU;AACvB,gBAAY;;aAEL,CAAC,WAAW,iBAAiB,EACtC,gBAAe;AAGjB,MAAI,YAAY,cAAc,KAC5B,aAAY,iBACJ;AACJ,MAAG,MAAM,UAAU,SAAU;AAC7B,kBAAe,KAAK,KAAK;AACzB,eAAY;KAEd,MAAM,WAAW,cAClB;;AAIL,WAAU,eAAe;AACvB,MAAI,cAAc,MAAM;AACtB,gBAAa,UAAU;AACvB,eAAY;;;AAIhB,QAAO;;;;;;;;;;;;;;;;;;AAmBT,SAAgB,KAAgD,IAAU;CACxE,IAAI,SAAS;CACb,IAAI;AAEJ,UAAS,GAAG,SAAoB;AAC9B,MAAI,CAAC,QAAQ;AACX,YAAS;AACT,YAAS,GAAG,GAAG,KAAK;;AAEtB,SAAO;;;;;;;;;;;;;;;;AAiBX,SAAgB,MAAM,IAAsB;AAC1C,SAAQ,SAAS,CAAC,KAAK,GAAG;;;;;;;;;;;;;;;;;AAkB5B,SAAgB,IAA+C,IAAU;CACvE,IAAI,UAAyB;CAC7B,IAAI,WAA6B;CACjC,IAAI,WAAoB;AAExB,QAAO,SAAyB,GAAG,MAAiB;AAClD,aAAW;AAEX,aAAW;AAEX,MAAI,YAAY,KACd,WAAU,4BAA4B;AACpC,MAAG,MAAM,UAAU,SAAU;AAC7B,aAAU;IACV;;;;;;;;;;;;;;;;;AAmBR,SAAgB,KAAK,IAAgB,SAAsC;AACzE,KAAI,OAAO,wBAAwB,YACjC,qBAAoB,IAAI,UAAU,EAAE,SAAS,QAAQ,SAAS,GAAG,OAAU;KAG3E,SAAQ,SAAS,CAAC,WAAW;AAC3B,aAAW,IAAI,EAAE;GACjB;;;;;;;;;;;;;;;;AAkBN,SAAgB,QAAQ,IAA2B;AACjD,QAAO,IAAI,SAAS,YAAY,WAAW,SAAS,GAAG,CAAC;;;;;;;;;;;;;;;;;;;AAoB1D,eAAsB,MACpB,IACA,SACY;CACZ,MAAM,EACJ,cAAc,GACd,UAAU,KACV,WAAW,MAAc,UAAU,KAAK,IAAI,GAAG,EAAE,KAC/C,WAAW,EAAE;CAEjB,IAAI,YAA0B;AAE9B,MAAK,IAAI,UAAU,GAAG,UAAU,aAAa,UAC3C,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,cAAY;AACZ,MAAI,UAAU,cAAc,EAE1B,OAAM,QADQ,QAAQ,QACR,CAAM;;AAK1B,OAAM,6BAAa,IAAI,MAAM,eAAe"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export type
|
|
22
|
-
export { isEventDelegationEnabled, disableEventDelegation, enableEventDelegation, setGlobalDelegationContainer, } from './runtime/events';
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { Props } from "./common/props.js";
|
|
2
|
+
import { Fragment } from "./common/jsx.js";
|
|
3
|
+
import { State, state } from "./runtime/state.js";
|
|
4
|
+
import { Context, defineContext, readContext } from "./runtime/context.js";
|
|
5
|
+
import { getSignal } from "./runtime/component.js";
|
|
6
|
+
import { For, ForProps } from "./control/for.js";
|
|
7
|
+
import { AccessDecision, AccessDenyDecision, AccessRedirectDecision, GroupHelperOptions, RegisterRoutesOptions, RouteAuthMode, RouteAuthOptions, RouteAuthResolver, RouteAuthState, RouteComponent, RouteContext, RouteDefinition, RouteManifest, RouteMatch, RouteMode, RouteOptions, RoutePolicy, RouteRecord, RouteRenderResult, RouteRequestOptions, RouteRequestResult, RouteSnapshot } from "./common/router.js";
|
|
8
|
+
import { HistoryScrollBehavior, NavigateOptions, NavigationScrollBehavior, ScrollRestorationOptions, navigate } from "./router/navigate.js";
|
|
9
|
+
import { HydrateSPAConfig, IslandConfig, IslandsConfig, SPAConfig, cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA } from "./boot/index.js";
|
|
10
|
+
import { Show, ShowProps } from "./control/show.js";
|
|
11
|
+
import { Case, CaseProps, Match, MatchProps } from "./control/case.js";
|
|
12
|
+
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
13
|
+
import { Slot, SlotProps } from "./foundations/structures/slot.js";
|
|
14
|
+
import { DefaultPortal, Portal, PortalProps, definePortal } from "./foundations/structures/portal.js";
|
|
15
|
+
import { Derived, derive } from "./runtime/derive.js";
|
|
16
|
+
import { Selector, selector } from "./runtime/selector.js";
|
|
17
|
+
import { ResourceResult, resource } from "./runtime/operations.js";
|
|
18
|
+
import { currentRoute, fallback, group, lazy, registerRoutes, resolveRouteRequest, route } from "./router/route.js";
|
|
19
|
+
import { allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized } from "./router/policy.js";
|
|
20
|
+
import { Link, LinkProps } from "./components/link.js";
|
|
21
|
+
export { type AccessDecision, type AccessDenyDecision, type AccessRedirectDecision, Case, type CaseProps, type Context, DefaultPortal, type Derived, For, type ForProps, Fragment, type GroupHelperOptions, type HistoryScrollBehavior, type HydrateSPAConfig, type IslandConfig, type IslandsConfig, Link, type LinkProps, Match, type MatchProps, type NavigateOptions, type NavigationScrollBehavior, Portal, type PortalProps, type Props, type RegisterRoutesOptions, type ResourceResult, type RouteAuthMode, type RouteAuthOptions, type RouteAuthResolver, type RouteAuthState, type RouteComponent, type RouteContext, type RouteDefinition, type RouteManifest, type RouteMatch, type RouteMode, type RouteOptions, type RoutePolicy, type RouteRecord, type RouteRenderResult, type RouteRequestOptions, type RouteRequestResult, type RouteSnapshot, type SPAConfig, type ScrollRestorationOptions, type Selector, Show, type ShowProps, Slot, type SlotProps, type State, allow, cleanupApp, createIsland, createIslands, createSPA, currentRoute, defineContext, definePortal, deny, derive, fallback, forbidden, getSignal, group, hasApp, hydrateSPA, jsx, jsxs, lazy, navigate, notFound, readContext, redirect, registerRoutes, requireAuth, requirePermission, requireRole, resolveRouteRequest, resource, route, selector, state, unauthorized };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment } from "./common/jsx.js";
|
|
2
|
+
import { defineContext, readContext } from "./runtime/context.js";
|
|
3
|
+
import { getSignal } from "./runtime/component.js";
|
|
4
|
+
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
5
|
+
import { installRendererBridge } from "./renderer/index.js";
|
|
6
|
+
import { state } from "./runtime/state.js";
|
|
7
|
+
import { derive } from "./runtime/derive.js";
|
|
8
|
+
import { selector } from "./runtime/selector.js";
|
|
9
|
+
import { resource } from "./runtime/operations.js";
|
|
10
|
+
import { allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized } from "./router/policy.js";
|
|
11
|
+
import { currentRoute, fallback, group, lazy, registerRoutes, resolveRouteRequest, route } from "./router/route.js";
|
|
12
|
+
import { DefaultPortal, Portal, definePortal } from "./foundations/structures/portal.js";
|
|
13
|
+
import { navigate } from "./router/navigate.js";
|
|
14
|
+
import { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA } from "./boot/index.js";
|
|
15
|
+
import "./jsx-runtime2.js";
|
|
16
|
+
import { Link } from "./components/link.js";
|
|
17
|
+
import "./router/index.js";
|
|
18
|
+
import { For } from "./control/for.js";
|
|
19
|
+
import { Show } from "./control/show.js";
|
|
20
|
+
import { Case, Match } from "./control/case.js";
|
|
21
|
+
import "./control/index.js";
|
|
22
|
+
import { Slot } from "./foundations/structures/slot.js";
|
|
23
|
+
import "./foundations/structures.js";
|
|
24
|
+
//#region src/index.ts
|
|
25
|
+
/**
|
|
26
|
+
* Askr: Actor-backed deterministic UI framework
|
|
27
|
+
*
|
|
28
|
+
* Public API surface — only users should import from here
|
|
29
|
+
*/
|
|
30
|
+
installRendererBridge();
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Case, DefaultPortal, For, Fragment, Link, Match, Portal, Show, Slot, allow, cleanupApp, createIsland, createIslands, createSPA, currentRoute, defineContext, definePortal, deny, derive, fallback, forbidden, getSignal, group, hasApp, hydrateSPA, jsx, jsxs, lazy, navigate, notFound, readContext, redirect, registerRoutes, requireAuth, requirePermission, requireRole, resolveRouteRequest, resource, route, selector, state, unauthorized };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Askr: Actor-backed deterministic UI framework\n *\n * Public API surface — only users should import from here\n */\n\nimport { installRendererBridge } from './renderer';\n\ninstallRendererBridge();\n\n// Runtime primitives\nexport { state } from './runtime/state';\nexport type { State } from './runtime/state';\nexport { derive } from './runtime/derive';\nexport type { Derived } from './runtime/derive';\nexport { getSignal } from './runtime/component';\nexport { selector } from './runtime/selector';\nexport type { Selector } from './runtime/selector';\n\n// Context\nexport { defineContext, readContext } from './runtime/context';\nexport type { Context } from './runtime/context';\n\n// Resources\nexport { resource } from './runtime/operations';\nexport type { ResourceResult } from './runtime/operations';\n\n// App bootstrap\nexport {\n createIsland,\n createIslands,\n createSPA,\n hydrateSPA,\n cleanupApp,\n hasApp,\n} from './boot';\nexport type {\n IslandConfig,\n IslandsConfig,\n SPAConfig,\n HydrateSPAConfig,\n} from './boot';\n\n// Routing\nexport {\n registerRoutes,\n route,\n currentRoute,\n group,\n fallback,\n lazy,\n allow,\n redirect,\n deny,\n unauthorized,\n forbidden,\n notFound,\n requireAuth,\n requireRole,\n requirePermission,\n resolveRouteRequest,\n type RouteSnapshot,\n type RouteMatch,\n type RouteComponent,\n type RouteMode,\n type RouteAuthMode,\n type RouteContext,\n type RoutePolicy,\n type RouteOptions,\n type RouteRecord,\n type RouteManifest,\n type AccessDecision,\n type AccessDenyDecision,\n type AccessRedirectDecision,\n type GroupHelperOptions,\n type RegisterRoutesOptions,\n type RouteDefinition,\n type RouteAuthOptions,\n type RouteAuthResolver,\n type RouteAuthState,\n type RouteRenderResult,\n type RouteRequestOptions,\n type RouteRequestResult,\n} from './router';\nexport { navigate } from './router/navigate';\nexport type {\n NavigateOptions,\n NavigationScrollBehavior,\n HistoryScrollBehavior,\n ScrollRestorationOptions,\n} from './router/navigate';\n\n// Components\nexport { Link } from './components/link';\nexport type { LinkProps } from './components/link';\nexport { Case, For, Match, Show } from './control';\nexport type { CaseProps, ForProps, MatchProps, ShowProps } from './control';\nexport {\n Slot,\n definePortal,\n DefaultPortal,\n Portal,\n} from './foundations/structures';\nexport type { SlotProps, PortalProps } from './foundations/structures';\n\n// Re-export JSX runtime for tsconfig jsxImportSource\nexport { jsx, jsxs, Fragment } from './jsx-runtime';\n\n// Public types\nexport type { Props } from './common/props';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,uBAAuB"}
|
package/dist/jsx/index.d.ts
CHANGED
package/dist/jsx/index.js
CHANGED
package/dist/jsx/types.d.ts
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* - jsx-runtime
|
|
6
|
-
* - jsx-dev-runtime
|
|
7
|
-
* - Slot / cloneElement
|
|
8
|
-
* - the reconciler
|
|
9
|
-
*/
|
|
10
|
-
import type { Props } from '../common/props';
|
|
11
|
-
import type { JSXElement } from '../common/jsx';
|
|
12
|
-
export { ELEMENT_TYPE, Fragment } from '../common/jsx';
|
|
13
|
-
export type { JSXElement } from '../common/jsx';
|
|
1
|
+
import { Props } from "../common/props.js";
|
|
2
|
+
import { Fragment, JSXElement } from "../common/jsx.js";
|
|
3
|
+
|
|
4
|
+
//#region src/jsx/types.d.ts
|
|
14
5
|
declare global {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
interface IntrinsicElements {
|
|
20
|
-
[elem: string]: Props;
|
|
21
|
-
}
|
|
22
|
-
interface ElementAttributesProperty {
|
|
23
|
-
props: Props;
|
|
24
|
-
}
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface Element extends JSXElement {
|
|
8
|
+
readonly __askrJsxElementBrand?: never;
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
interface IntrinsicElements {
|
|
11
|
+
[elem: string]: Props;
|
|
12
|
+
}
|
|
13
|
+
interface ElementAttributesProperty {
|
|
14
|
+
props: Props;
|
|
15
|
+
}
|
|
16
|
+
interface ElementChildrenAttribute {
|
|
17
|
+
children: unknown;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} //# sourceMappingURL=types.d.ts.map
|
|
28
21
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/jsx/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/jsx/types.ts"],"mappings":";;;;QAgBQ,MAAA;EAAA,UAEI,GAAA;IAAA,UAEE,OAAA,SAAgB,UAAA;MAAA,SACf,qBAAA;IAAA;IAAA,UAGD,iBAAA;MAAA,CACP,IAAA,WAAe,KAAA;IAAA;IAAA,UAGR,yBAAA;MACR,KAAA,EAAO,KAAA;IAAA;IAAA,UAGC,wBAAA;MACR,QAAA;IAAA;EAAA;AAAA"}
|
package/dist/jsx/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../common/jsx.js";
|
package/dist/jsx/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { JSXElement } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { JSXElement } from "../common/jsx.js";
|
|
2
|
+
//#region src/jsx/utils.d.ts
|
|
3
|
+
declare function isElement(value: unknown): value is JSXElement;
|
|
4
|
+
declare function cloneElement(element: JSXElement, props: Record<string, unknown>): JSXElement;
|
|
4
5
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/jsx/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/jsx/utils.ts"],"mappings":";;iBAEgB,SAAA,CAAU,KAAA,YAAiB,KAAA,IAAS,UAAA;AAAA,iBAQpC,YAAA,CACd,OAAA,EAAS,UAAA,EACT,KAAA,EAAO,MAAA,oBACN,UAAA"}
|
package/dist/jsx/utils.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ELEMENT_TYPE } from "../common/jsx.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
//#region src/jsx/utils.ts
|
|
4
|
+
function isElement(value) {
|
|
5
|
+
return typeof value === "object" && value !== null && value.$$typeof === ELEMENT_TYPE;
|
|
6
|
+
}
|
|
7
|
+
function cloneElement(element, props) {
|
|
8
|
+
return {
|
|
9
|
+
...element,
|
|
10
|
+
props: {
|
|
11
|
+
...element.props,
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { cloneElement, isElement };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/jsx/utils.ts"],"sourcesContent":["import { ELEMENT_TYPE, JSXElement } from './types';\n\nexport function isElement(value: unknown): value is JSXElement {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as JSXElement).$$typeof === ELEMENT_TYPE\n );\n}\n\nexport function cloneElement(\n element: JSXElement,\n props: Record<string, unknown>\n): JSXElement {\n return {\n ...element,\n props: { ...element.props, ...props },\n };\n}\n"],"mappings":";;;AAEA,SAAgB,UAAU,OAAqC;AAC7D,QACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAqB,aAAa;;AAIvC,SAAgB,aACd,SACA,OACY;AACZ,QAAO;EACL,GAAG;EACH,OAAO;GAAE,GAAG,QAAQ;GAAO,GAAG;GAAO;EACtC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment, JSXElement } from "./common/jsx.js";
|
|
2
|
+
import { EagerControlPrimitive } from "./common/control.js";
|
|
3
|
+
//#region src/jsx/jsx-dev-runtime.d.ts
|
|
4
|
+
declare function jsxDEV(type: EagerControlPrimitive, props: Record<string, unknown> | null, key?: string | number, isStaticChildren?: boolean): unknown;
|
|
5
|
+
declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number, isStaticChildren?: boolean): JSXElement;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Fragment, jsxDEV };
|
|
8
|
+
//# sourceMappingURL=jsx-dev-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","names":[],"sources":["../src/jsx/jsx-dev-runtime.ts"],"mappings":";;;iBAsCgB,MAAA,CACd,IAAA,EAAM,qBAAA,EACN,KAAA,EAAO,MAAA,0BACP,GAAA,oBACA,gBAAA;AAAA,iBAEc,MAAA,CACd,IAAA,WACA,KAAA,EAAO,MAAA,0BACP,GAAA,oBACA,gBAAA,aACC,UAAA"}
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isEagerControlPrimitive } from "./common/control.js";
|
|
2
|
+
import { ELEMENT_TYPE, Fragment, STATIC_CHILDREN } from "./common/jsx.js";
|
|
3
|
+
import { markReadableUsage } from "./runtime/readable.js";
|
|
4
|
+
import "./jsx/types.js";
|
|
5
|
+
//#region src/jsx/jsx-dev-runtime.ts
|
|
6
|
+
function annotatePropsUsage(props) {
|
|
7
|
+
const normalizedProps = props ?? {};
|
|
8
|
+
for (const value of Object.values(normalizedProps)) markReadableUsage(value);
|
|
9
|
+
return normalizedProps;
|
|
10
|
+
}
|
|
11
|
+
function markStaticChildren(props) {
|
|
12
|
+
if (Array.isArray(props.children)) Object.defineProperty(props.children, STATIC_CHILDREN, {
|
|
13
|
+
value: true,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
return props;
|
|
17
|
+
}
|
|
18
|
+
function jsxDEV(type, props, key, isStaticChildren = false) {
|
|
19
|
+
const normalizedProps = annotatePropsUsage(props);
|
|
20
|
+
const preparedProps = isStaticChildren ? markStaticChildren(normalizedProps) : normalizedProps;
|
|
21
|
+
if (isEagerControlPrimitive(type)) return type(preparedProps);
|
|
22
|
+
return {
|
|
23
|
+
$$typeof: ELEMENT_TYPE,
|
|
24
|
+
type,
|
|
25
|
+
props: preparedProps,
|
|
26
|
+
key: key ?? null
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Fragment, jsxDEV };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","names":[],"sources":["../src/jsx/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * JSX dev runtime factory\n * Same element shape as production runtime, with room for dev warnings.\n */\nimport type { Props } from '../common/props';\nimport {\n isEagerControlPrimitive,\n type EagerControlPrimitive,\n} from '../common/control';\nimport {\n ELEMENT_TYPE,\n Fragment,\n STATIC_CHILDREN,\n type JSXElement,\n} from './types';\nimport { markReadableUsage } from '../runtime/readable';\n\nfunction annotatePropsUsage(props: Record<string, unknown> | null): Props {\n const normalizedProps = (props ?? {}) as Props;\n\n for (const value of Object.values(normalizedProps)) {\n markReadableUsage(value);\n }\n\n return normalizedProps;\n}\n\nfunction markStaticChildren(props: Props): Props {\n if (Array.isArray(props.children)) {\n Object.defineProperty(props.children, STATIC_CHILDREN, {\n value: true,\n configurable: true,\n });\n }\n\n return props;\n}\n\nexport function jsxDEV(\n type: EagerControlPrimitive,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren?: boolean\n): unknown;\nexport function jsxDEV(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren?: boolean\n): JSXElement;\nexport function jsxDEV(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren = false\n): JSXElement | unknown {\n const normalizedProps = annotatePropsUsage(props);\n const preparedProps = isStaticChildren\n ? markStaticChildren(normalizedProps)\n : normalizedProps;\n\n if (isEagerControlPrimitive(type)) {\n return type(preparedProps);\n }\n\n return {\n $$typeof: ELEMENT_TYPE,\n type: type as string | ((props: Props) => unknown) | symbol,\n props: preparedProps,\n key: key ?? null,\n };\n}\n\n// Re-export Fragment for JSX\nexport { Fragment };\n"],"mappings":";;;;;AAiBA,SAAS,mBAAmB,OAA8C;CACxE,MAAM,kBAAmB,SAAS,EAAE;AAEpC,MAAK,MAAM,SAAS,OAAO,OAAO,gBAAgB,CAChD,mBAAkB,MAAM;AAG1B,QAAO;;AAGT,SAAS,mBAAmB,OAAqB;AAC/C,KAAI,MAAM,QAAQ,MAAM,SAAS,CAC/B,QAAO,eAAe,MAAM,UAAU,iBAAiB;EACrD,OAAO;EACP,cAAc;EACf,CAAC;AAGJ,QAAO;;AAeT,SAAgB,OACd,MACA,OACA,KACA,mBAAmB,OACG;CACtB,MAAM,kBAAkB,mBAAmB,MAAM;CACjD,MAAM,gBAAgB,mBAClB,mBAAmB,gBAAgB,GACnC;AAEJ,KAAI,wBAAwB,KAAK,CAC/B,QAAO,KAAK,cAAc;AAG5B,QAAO;EACL,UAAU;EACJ;EACN,OAAO;EACP,KAAK,OAAO;EACb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fragment, JSXElement } from "./common/jsx.js";
|
|
2
|
+
import { EagerControlPrimitive } from "./common/control.js";
|
|
3
|
+
//#region src/jsx/jsx-runtime.d.ts
|
|
4
|
+
declare function jsxDEV(type: EagerControlPrimitive, props: Record<string, unknown> | null, key?: string | number, isStaticChildren?: boolean): unknown;
|
|
5
|
+
declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number, isStaticChildren?: boolean): JSXElement;
|
|
6
|
+
declare function jsx(type: EagerControlPrimitive, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
7
|
+
declare function jsx(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
|
|
8
|
+
declare function jsxs(type: EagerControlPrimitive, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
9
|
+
declare function jsxs(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Fragment, jsx, jsxDEV, jsxs };
|
|
12
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","names":[],"sources":["../src/jsx/jsx-runtime.ts"],"mappings":";;;iBAuCgB,MAAA,CACd,IAAA,EAAM,qBAAA,EACN,KAAA,EAAO,MAAA,0BACP,GAAA,oBACA,gBAAA;AAAA,iBAEc,MAAA,CACd,IAAA,WACA,KAAA,EAAO,MAAA,0BACP,GAAA,oBACA,gBAAA,aACC,UAAA;AAAA,iBAyBa,GAAA,CACd,IAAA,EAAM,qBAAA,EACN,KAAA,EAAO,MAAA,0BACP,GAAA;AAAA,iBAEc,GAAA,CACd,IAAA,WACA,KAAA,EAAO,MAAA,0BACP,GAAA,qBACC,UAAA;AAAA,iBASa,IAAA,CACd,IAAA,EAAM,qBAAA,EACN,KAAA,EAAO,MAAA,0BACP,GAAA;AAAA,iBAEc,IAAA,CACd,IAAA,WACA,KAAA,EAAO,MAAA,0BACP,GAAA,qBACC,UAAA"}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isEagerControlPrimitive } from "./common/control.js";
|
|
2
|
+
import { ELEMENT_TYPE, Fragment, STATIC_CHILDREN } from "./common/jsx.js";
|
|
3
|
+
import { markReadableUsage } from "./runtime/readable.js";
|
|
4
|
+
import "./jsx/types.js";
|
|
5
|
+
//#region src/jsx/jsx-runtime.ts
|
|
6
|
+
function annotatePropsUsage(props) {
|
|
7
|
+
const normalizedProps = props ?? {};
|
|
8
|
+
for (const value of Object.values(normalizedProps)) markReadableUsage(value);
|
|
9
|
+
return normalizedProps;
|
|
10
|
+
}
|
|
11
|
+
function markStaticChildren(props) {
|
|
12
|
+
if (Array.isArray(props.children)) Object.defineProperty(props.children, STATIC_CHILDREN, {
|
|
13
|
+
value: true,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
return props;
|
|
17
|
+
}
|
|
18
|
+
function jsxDEV(type, props, key, isStaticChildren = false) {
|
|
19
|
+
const normalizedProps = annotatePropsUsage(props);
|
|
20
|
+
const preparedProps = isStaticChildren ? markStaticChildren(normalizedProps) : normalizedProps;
|
|
21
|
+
if (isEagerControlPrimitive(type)) return type(preparedProps);
|
|
22
|
+
return {
|
|
23
|
+
$$typeof: ELEMENT_TYPE,
|
|
24
|
+
type,
|
|
25
|
+
props: preparedProps,
|
|
26
|
+
key: key ?? null
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function jsx(type, props, key) {
|
|
30
|
+
return jsxDEV(type, props, key);
|
|
31
|
+
}
|
|
32
|
+
function jsxs(type, props, key) {
|
|
33
|
+
const normalizedProps = markStaticChildren(annotatePropsUsage(props));
|
|
34
|
+
if (isEagerControlPrimitive(type)) return type(normalizedProps);
|
|
35
|
+
return {
|
|
36
|
+
$$typeof: ELEMENT_TYPE,
|
|
37
|
+
type,
|
|
38
|
+
props: normalizedProps,
|
|
39
|
+
key: key ?? null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Fragment, jsx, jsxDEV, jsxs };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","names":[],"sources":["../src/jsx/jsx-runtime.ts"],"sourcesContent":["/**\n * JSX runtime factory\n * Same element shape as production runtime.\n */\n\nimport type { Props } from '../common/props';\nimport {\n isEagerControlPrimitive,\n type EagerControlPrimitive,\n} from '../common/control';\nimport {\n ELEMENT_TYPE,\n Fragment,\n STATIC_CHILDREN,\n type JSXElement,\n} from './types';\nimport { markReadableUsage } from '../runtime/readable';\n\nfunction annotatePropsUsage(props: Record<string, unknown> | null): Props {\n const normalizedProps = (props ?? {}) as Props;\n\n for (const value of Object.values(normalizedProps)) {\n markReadableUsage(value);\n }\n\n return normalizedProps;\n}\n\nfunction markStaticChildren(props: Props): Props {\n if (Array.isArray(props.children)) {\n Object.defineProperty(props.children, STATIC_CHILDREN, {\n value: true,\n configurable: true,\n });\n }\n\n return props;\n}\n\nexport function jsxDEV(\n type: EagerControlPrimitive,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren?: boolean\n): unknown;\nexport function jsxDEV(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren?: boolean\n): JSXElement;\nexport function jsxDEV(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number,\n isStaticChildren = false\n): JSXElement | unknown {\n const normalizedProps = annotatePropsUsage(props);\n const preparedProps = isStaticChildren\n ? markStaticChildren(normalizedProps)\n : normalizedProps;\n\n if (isEagerControlPrimitive(type)) {\n return type(preparedProps);\n }\n\n return {\n $$typeof: ELEMENT_TYPE,\n type: type as string | ((props: Props) => unknown) | symbol,\n props: preparedProps,\n key: key ?? null,\n };\n}\n\n// Production-style helpers: alias to the DEV factory for now\nexport function jsx(\n type: EagerControlPrimitive,\n props: Record<string, unknown> | null,\n key?: string | number\n): unknown;\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number\n): JSXElement;\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number\n) {\n return jsxDEV(type, props, key);\n}\n\nexport function jsxs(\n type: EagerControlPrimitive,\n props: Record<string, unknown> | null,\n key?: string | number\n): unknown;\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number\n): JSXElement;\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: string | number\n) {\n const normalizedProps = markStaticChildren(annotatePropsUsage(props));\n\n if (isEagerControlPrimitive(type)) {\n return type(normalizedProps);\n }\n\n return {\n $$typeof: ELEMENT_TYPE,\n type: type as string | ((props: Props) => unknown) | symbol,\n props: normalizedProps,\n key: key ?? null,\n } as JSXElement;\n}\n\n// Re-export Fragment for JSX.\nexport { Fragment };\n"],"mappings":";;;;;AAkBA,SAAS,mBAAmB,OAA8C;CACxE,MAAM,kBAAmB,SAAS,EAAE;AAEpC,MAAK,MAAM,SAAS,OAAO,OAAO,gBAAgB,CAChD,mBAAkB,MAAM;AAG1B,QAAO;;AAGT,SAAS,mBAAmB,OAAqB;AAC/C,KAAI,MAAM,QAAQ,MAAM,SAAS,CAC/B,QAAO,eAAe,MAAM,UAAU,iBAAiB;EACrD,OAAO;EACP,cAAc;EACf,CAAC;AAGJ,QAAO;;AAeT,SAAgB,OACd,MACA,OACA,KACA,mBAAmB,OACG;CACtB,MAAM,kBAAkB,mBAAmB,MAAM;CACjD,MAAM,gBAAgB,mBAClB,mBAAmB,gBAAgB,GACnC;AAEJ,KAAI,wBAAwB,KAAK,CAC/B,QAAO,KAAK,cAAc;AAG5B,QAAO;EACL,UAAU;EACJ;EACN,OAAO;EACP,KAAK,OAAO;EACb;;AAcH,SAAgB,IACd,MACA,OACA,KACA;AACA,QAAO,OAAO,MAAM,OAAO,IAAI;;AAajC,SAAgB,KACd,MACA,OACA,KACA;CACA,MAAM,kBAAkB,mBAAmB,mBAAmB,MAAM,CAAC;AAErE,KAAI,wBAAwB,KAAK,CAC/B,QAAO,KAAK,gBAAgB;AAG9B,QAAO;EACL,UAAU;EACJ;EACN,OAAO;EACP,KAAK,OAAO;EACb"}
|