@askrjs/askr 0.0.28 → 0.0.29
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/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 +10 -3
- package/dist/foundations/index.js +9 -1
- package/dist/foundations/interactions/interaction-policy.js +93 -1
- package/dist/foundations/interactions/interaction-policy.js.map +1 -0
- package/dist/foundations/interactions/pressable.js +51 -1
- package/dist/foundations/interactions/pressable.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.js +11 -1
- package/dist/foundations/utilities/aria.js.map +1 -0
- 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/merge-props.js +49 -1
- package/dist/foundations/utilities/merge-props.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 +0 -23
- package/dist/foundations/core.d.ts.map +0 -1
- package/dist/foundations/core.js +0 -1
- package/dist/foundations/index.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts +0 -58
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js +0 -1
- package/dist/foundations/interactions/focusable.d.ts +0 -16
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js +0 -1
- package/dist/foundations/interactions/hoverable.d.ts +0 -19
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js +0 -1
- package/dist/foundations/interactions/index.d.ts +0 -5
- package/dist/foundations/interactions/index.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts +0 -96
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts +0 -54
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts +0 -117
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js +0 -1
- package/dist/foundations/state/controllable.d.ts +0 -53
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js +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/aria.d.ts +0 -13
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts +0 -34
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts +0 -17
- package/dist/foundations/utilities/event-types.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/foundations/utilities/merge-props.d.ts +0 -2
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts +0 -29
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js +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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","
|
|
1
|
+
{"version":3,"file":"layout.d.ts","names":[],"sources":["../../../src/foundations/structures/layout.tsx"],"mappings":";;AAwBA;;;;;;;;;;AAIA;;;;;;;;;;;;KAJY,eAAA,gBACV,KAAA,EAAO,CAAA;EAAM,QAAA;AAAA;AAAA,iBAGC,MAAA,YAAA,CAAmB,MAAA,EAAQ,eAAA,CAAgB,CAAA,KACjD,QAAA,YAAoB,KAAA,GAAQ,CAAA"}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/foundations/structures/layout.tsx
|
|
2
|
+
function layout(Layout) {
|
|
3
|
+
return (children, props) => {
|
|
4
|
+
return Layout({
|
|
5
|
+
...props,
|
|
6
|
+
children
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { layout };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","names":[],"sources":["../../../src/foundations/structures/layout.tsx"],"sourcesContent":["/**\n * Layout helper.\n *\n * A layout is just a normal component that wraps children.\n * Persistence and reuse are handled by the runtime via component identity.\n *\n * This helper exists purely for readability and convention.\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Return Type is Opaque (unknown)\n * Layout components return `unknown` to remain runtime-agnostic.\n * The runtime owns concrete JSX element types.\n *\n * 2. Children Positioning\n * Layout receives children as first argument (router-friendly).\n * Props come second. This matches route layout conventions where\n * children represent the nested route content.\n *\n * 3. Props Spreading\n * Props are spread into the layout component. This is intentional\n * and deterministic — no merging or composition.\n */\n\nexport type LayoutComponent<P = object> = (\n props: P & { children?: unknown }\n) => unknown;\n\nexport function layout<P = object>(Layout: LayoutComponent<P>) {\n return (children?: unknown, props?: P) => {\n const mergedProps = { ...props, children } as P & { children?: unknown };\n return Layout(mergedProps);\n };\n}\n"],"mappings":";AA4BA,SAAgB,OAAmB,QAA4B;AAC7D,SAAQ,UAAoB,UAAc;AAExC,SAAO,OAAO;GADQ,GAAG;GAAO;GAClB,CAAY"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/foundations/structures/portal.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Portal / Host primitive.
|
|
3
4
|
*
|
|
@@ -19,15 +20,21 @@
|
|
|
19
20
|
* owns the concrete type. This prevents foundations from assuming JSX.Element
|
|
20
21
|
* or DOM node types, maintaining runtime-agnostic portability.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
interface Portal<T = unknown> {
|
|
24
|
+
/** Mount point — rendered exactly once */
|
|
25
|
+
(): unknown;
|
|
26
|
+
/** Render content into the portal */
|
|
27
|
+
render(props: {
|
|
28
|
+
children?: T;
|
|
29
|
+
}): unknown;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
interface PortalProps {
|
|
32
|
+
children?: unknown;
|
|
33
|
+
}
|
|
34
|
+
declare function definePortal<T = unknown>(): Portal<T>;
|
|
35
|
+
declare function _resetDefaultPortal(): void;
|
|
36
|
+
declare const DefaultPortal: Portal<unknown>;
|
|
37
|
+
declare function Portal(props: PortalProps): null;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DefaultPortal, Portal, PortalProps, definePortal };
|
|
33
40
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","
|
|
1
|
+
{"version":3,"file":"portal.d.ts","names":[],"sources":["../../../src/foundations/structures/portal.tsx"],"mappings":";;AA8BA;;;;;;;;;;;AAQA;;;;;AAgCA;;;;UAxCiB,MAAA;EAwC4B;EAAA;EAAQ;EAnCnD,MAAA,CAAO,KAAA;IAAS,QAAA,GAAW,CAAA;EAAA;AAAA;AAAA,UAGZ,WAAA;EACf,QAAA;AAAA;AAAA,iBA+Bc,YAAA,aAAA,CAAA,GAA6B,MAAA,CAAO,CAAA;AAAA,iBA0DpC,mBAAA,CAAA;AAAA,cASH,aAAA,EAAe,MAAA;AAAA,iBAYZ,MAAA,CAAO,KAAA,EAAO,WAAA"}
|
|
@@ -1 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead } from "../../runtime/readable.js";
|
|
2
|
+
//#region src/foundations/structures/portal.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Portal / Host primitive.
|
|
5
|
+
*
|
|
6
|
+
* Foundations remain runtime-agnostic: a portal is an explicit read/write slot.
|
|
7
|
+
* Scheduling and attachment are owned by the runtime when `createPortalSlot`
|
|
8
|
+
* exists; otherwise this falls back to a local slot (deterministic, but does
|
|
9
|
+
* not schedule updates).
|
|
10
|
+
*
|
|
11
|
+
* POLICY DECISIONS (LOCKED):
|
|
12
|
+
*
|
|
13
|
+
* 1. Local Mutable State
|
|
14
|
+
* Foundations may use local mutable state ONLY to model deterministic slots,
|
|
15
|
+
* never to coordinate timing, effects, or ordering. The fallback mode uses
|
|
16
|
+
* closure-local `mounted` and `value` variables which are non-escaping and
|
|
17
|
+
* deterministic.
|
|
18
|
+
*
|
|
19
|
+
* 2. Return Type Philosophy
|
|
20
|
+
* Portal call signatures return `unknown` (intentionally opaque). The runtime
|
|
21
|
+
* owns the concrete type. This prevents foundations from assuming JSX.Element
|
|
22
|
+
* or DOM node types, maintaining runtime-agnostic portability.
|
|
23
|
+
*/
|
|
24
|
+
function createPortalSlot() {
|
|
25
|
+
let currentValue;
|
|
26
|
+
const source = (() => {
|
|
27
|
+
recordReadableRead(source);
|
|
28
|
+
return currentValue;
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
read() {
|
|
32
|
+
return source();
|
|
33
|
+
},
|
|
34
|
+
write(value) {
|
|
35
|
+
if (Object.is(currentValue, value)) return;
|
|
36
|
+
currentValue = value;
|
|
37
|
+
markReadableDerivedSubscribersDirty(source);
|
|
38
|
+
markReactivePropsDirtySource(source);
|
|
39
|
+
notifyReadableReaders(source);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function definePortal() {
|
|
44
|
+
if (typeof createPortalSlot === "function") {
|
|
45
|
+
const slot = createPortalSlot();
|
|
46
|
+
function PortalHost() {
|
|
47
|
+
return slot.read();
|
|
48
|
+
}
|
|
49
|
+
PortalHost.render = function PortalRender(props) {
|
|
50
|
+
slot.write(props.children);
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
return PortalHost;
|
|
54
|
+
}
|
|
55
|
+
let mounted = false;
|
|
56
|
+
let value;
|
|
57
|
+
function PortalHostFallback() {
|
|
58
|
+
mounted = true;
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
PortalHostFallback.render = function PortalRenderFallback(props) {
|
|
62
|
+
if (!mounted) return null;
|
|
63
|
+
value = props.children;
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
return PortalHostFallback;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Default Portal Singleton
|
|
70
|
+
*
|
|
71
|
+
* POLICY (LOCKED):
|
|
72
|
+
* There is exactly one default portal per runtime.
|
|
73
|
+
* Tests must reset it explicitly using _resetDefaultPortal().
|
|
74
|
+
* This ensures consistent portal behavior across the application
|
|
75
|
+
* while maintaining test isolation.
|
|
76
|
+
*/
|
|
77
|
+
let _defaultPortal;
|
|
78
|
+
function ensureDefaultPortal() {
|
|
79
|
+
if (!_defaultPortal) _defaultPortal = definePortal();
|
|
80
|
+
return _defaultPortal;
|
|
81
|
+
}
|
|
82
|
+
const DefaultPortal = (() => {
|
|
83
|
+
function Host() {
|
|
84
|
+
const v = ensureDefaultPortal()();
|
|
85
|
+
return v === void 0 ? null : v;
|
|
86
|
+
}
|
|
87
|
+
Host.render = function Render(props) {
|
|
88
|
+
ensureDefaultPortal().render(props);
|
|
89
|
+
return null;
|
|
90
|
+
};
|
|
91
|
+
return Host;
|
|
92
|
+
})();
|
|
93
|
+
function Portal(props) {
|
|
94
|
+
DefaultPortal.render(props);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* NOTE:
|
|
99
|
+
* createPortalSlot is a runtime primitive.
|
|
100
|
+
* It owns scheduling, consistency, and SSR behavior.
|
|
101
|
+
*/
|
|
102
|
+
//#endregion
|
|
103
|
+
export { DefaultPortal, Portal, definePortal };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.js","names":[],"sources":["../../../src/foundations/structures/portal.tsx"],"sourcesContent":["/**\n * Portal / Host primitive.\n *\n * Foundations remain runtime-agnostic: a portal is an explicit read/write slot.\n * Scheduling and attachment are owned by the runtime when `createPortalSlot`\n * exists; otherwise this falls back to a local slot (deterministic, but does\n * not schedule updates).\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Local Mutable State\n * Foundations may use local mutable state ONLY to model deterministic slots,\n * never to coordinate timing, effects, or ordering. The fallback mode uses\n * closure-local `mounted` and `value` variables which are non-escaping and\n * deterministic.\n *\n * 2. Return Type Philosophy\n * Portal call signatures return `unknown` (intentionally opaque). The runtime\n * owns the concrete type. This prevents foundations from assuming JSX.Element\n * or DOM node types, maintaining runtime-agnostic portability.\n */\n\nimport {\n markReactivePropsDirtySource,\n markReadableDerivedSubscribersDirty,\n notifyReadableReaders,\n recordReadableRead,\n type ReadableSource,\n} from '../../runtime/readable';\n\nexport interface Portal<T = unknown> {\n /** Mount point — rendered exactly once */\n (): unknown;\n\n /** Render content into the portal */\n render(props: { children?: T }): unknown;\n}\n\nexport interface PortalProps {\n children?: unknown;\n}\n\nfunction createPortalSlot<T>(): {\n read(): unknown;\n write(value: T | undefined): void;\n} {\n let currentValue: T | undefined;\n\n const source = (() => {\n recordReadableRead(source);\n return currentValue;\n }) as ReadableSource<T | undefined>;\n\n return {\n read() {\n return source();\n },\n write(value: T | undefined) {\n if (Object.is(currentValue, value)) {\n return;\n }\n\n currentValue = value;\n markReadableDerivedSubscribersDirty(source);\n markReactivePropsDirtySource(source);\n notifyReadableReaders(source);\n },\n };\n}\n\nexport function definePortal<T = unknown>(): Portal<T> {\n // Using `typeof createPortalSlot` is safe even if the identifier is not\n // defined at runtime (it returns 'undefined' rather than throwing).\n if (typeof createPortalSlot === 'function') {\n const slot = createPortalSlot<T>();\n\n function PortalHost() {\n return slot.read();\n }\n\n PortalHost.render = function PortalRender(props: { children?: T }) {\n slot.write(props.children);\n return null;\n };\n\n return PortalHost as Portal<T>;\n }\n\n // Deterministic local fallback (SSR/tests). No runtime scheduling.\n // Writes are accepted only after the host has rendered at least once.\n //\n // CRITICAL BEHAVIOR:\n // - Writes update local state but do NOT trigger re-renders\n // - The portal host will reflect changes only when the component tree\n // re-renders for other reasons (e.g., parent state change)\n // - This is safe for SSR and tests where rendering is synchronous\n // and externally controlled\n // - In runtime mode, createPortalSlot handles scheduling automatically\n let mounted = false;\n let value: T | undefined;\n\n function PortalHostFallback() {\n mounted = true;\n return value as unknown;\n }\n\n PortalHostFallback.render = function PortalRenderFallback(props: {\n children?: T;\n }) {\n if (!mounted) return null;\n value = props.children;\n return null;\n };\n\n return PortalHostFallback as Portal<T>;\n}\n\n/**\n * Default Portal Singleton\n *\n * POLICY (LOCKED):\n * There is exactly one default portal per runtime.\n * Tests must reset it explicitly using _resetDefaultPortal().\n * This ensures consistent portal behavior across the application\n * while maintaining test isolation.\n */\nlet _defaultPortal: Portal<unknown> | undefined;\n\nexport function _resetDefaultPortal(): void {\n _defaultPortal = undefined;\n}\n\nfunction ensureDefaultPortal(): Portal<unknown> {\n if (!_defaultPortal) _defaultPortal = definePortal<unknown>();\n return _defaultPortal;\n}\n\nexport const DefaultPortal: Portal<unknown> = (() => {\n function Host() {\n const v = ensureDefaultPortal()();\n return v === undefined ? null : v;\n }\n Host.render = function Render(props: { children?: unknown }) {\n ensureDefaultPortal().render(props);\n return null;\n };\n return Host as Portal<unknown>;\n})();\n\nexport function Portal(props: PortalProps): null {\n DefaultPortal.render(props);\n return null;\n}\n\n/**\n * NOTE:\n * createPortalSlot is a runtime primitive.\n * It owns scheduling, consistency, and SSR behavior.\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAS,mBAGP;CACA,IAAI;CAEJ,MAAM,gBAAgB;AACpB,qBAAmB,OAAO;AAC1B,SAAO;;AAGT,QAAO;EACL,OAAO;AACL,UAAO,QAAQ;;EAEjB,MAAM,OAAsB;AAC1B,OAAI,OAAO,GAAG,cAAc,MAAM,CAChC;AAGF,kBAAe;AACf,uCAAoC,OAAO;AAC3C,gCAA6B,OAAO;AACpC,yBAAsB,OAAO;;EAEhC;;AAGH,SAAgB,eAAuC;AAGrD,KAAI,OAAO,qBAAqB,YAAY;EAC1C,MAAM,OAAO,kBAAqB;EAElC,SAAS,aAAa;AACpB,UAAO,KAAK,MAAM;;AAGpB,aAAW,SAAS,SAAS,aAAa,OAAyB;AACjE,QAAK,MAAM,MAAM,SAAS;AAC1B,UAAO;;AAGT,SAAO;;CAaT,IAAI,UAAU;CACd,IAAI;CAEJ,SAAS,qBAAqB;AAC5B,YAAU;AACV,SAAO;;AAGT,oBAAmB,SAAS,SAAS,qBAAqB,OAEvD;AACD,MAAI,CAAC,QAAS,QAAO;AACrB,UAAQ,MAAM;AACd,SAAO;;AAGT,QAAO;;;;;;;;;;;AAYT,IAAI;AAMJ,SAAS,sBAAuC;AAC9C,KAAI,CAAC,eAAgB,kBAAiB,cAAuB;AAC7D,QAAO;;AAGT,MAAa,uBAAwC;CACnD,SAAS,OAAO;EACd,MAAM,IAAI,qBAAqB,EAAE;AACjC,SAAO,MAAM,SAAY,OAAO;;AAElC,MAAK,SAAS,SAAS,OAAO,OAA+B;AAC3D,uBAAqB,CAAC,OAAO,MAAM;AACnC,SAAO;;AAET,QAAO;IACL;AAEJ,SAAgB,OAAO,OAA0B;AAC/C,eAAc,OAAO,MAAM;AAC3B,QAAO"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { JSXElement } from "../../common/jsx.js";
|
|
2
|
+
//#region src/foundations/structures/presence.d.ts
|
|
3
|
+
interface PresenceProps {
|
|
4
|
+
present: boolean | (() => boolean);
|
|
5
|
+
children?: unknown;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* Presence
|
|
@@ -26,5 +27,10 @@ export interface PresenceProps {
|
|
|
26
27
|
* children are removed immediately. Animation must be layered above
|
|
27
28
|
* this primitive.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
declare function Presence({
|
|
31
|
+
present,
|
|
32
|
+
children
|
|
33
|
+
}: PresenceProps): JSXElement | null;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Presence, PresenceProps };
|
|
30
36
|
//# sourceMappingURL=presence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.d.ts","
|
|
1
|
+
{"version":3,"file":"presence.d.ts","names":[],"sources":["../../../src/foundations/structures/presence.ts"],"mappings":";;UAGiB,aAAA;EACf,OAAA;EACA,QAAA;AAAA;;;;;AA0BF;;;;;;;;;;;;;;;;;;;iBAAgB,QAAA,CAAA;EACd,OAAA;EACA;AAAA,GACC,aAAA,GAAgB,UAAA"}
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ELEMENT_TYPE, Fragment } from "../../common/jsx.js";
|
|
2
|
+
import "../../jsx/index.js";
|
|
3
|
+
//#region src/foundations/structures/presence.ts
|
|
4
|
+
/**
|
|
5
|
+
* Presence
|
|
6
|
+
*
|
|
7
|
+
* Structural policy primitive for conditional mount/unmount.
|
|
8
|
+
* - No timers
|
|
9
|
+
* - No animation coupling
|
|
10
|
+
* - No DOM side-effects
|
|
11
|
+
*
|
|
12
|
+
* POLICY DECISIONS (LOCKED):
|
|
13
|
+
*
|
|
14
|
+
* 1. Present as Function
|
|
15
|
+
* Accepts boolean OR function to support lazy evaluation patterns.
|
|
16
|
+
* Function is called once per render. Use boolean form for static values.
|
|
17
|
+
*
|
|
18
|
+
* 2. Children Type
|
|
19
|
+
* `children` is intentionally `unknown` to remain runtime-agnostic.
|
|
20
|
+
* The runtime owns child normalization and validation.
|
|
21
|
+
*
|
|
22
|
+
* 3. Immediate Mount/Unmount
|
|
23
|
+
* No exit animations or transitions. When `present` becomes false,
|
|
24
|
+
* children are removed immediately. Animation must be layered above
|
|
25
|
+
* this primitive.
|
|
26
|
+
*/
|
|
27
|
+
function Presence({ present, children }) {
|
|
28
|
+
if (!(typeof present === "function" ? present() : Boolean(present))) return null;
|
|
29
|
+
return {
|
|
30
|
+
$$typeof: ELEMENT_TYPE,
|
|
31
|
+
type: Fragment,
|
|
32
|
+
props: { children },
|
|
33
|
+
key: null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Presence };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=presence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.js","names":[],"sources":["../../../src/foundations/structures/presence.ts"],"sourcesContent":["import { ELEMENT_TYPE, Fragment } from '../../jsx';\nimport type { JSXElement } from '../../jsx';\n\nexport interface PresenceProps {\n present: boolean | (() => boolean);\n children?: unknown;\n}\n\n/**\n * Presence\n *\n * Structural policy primitive for conditional mount/unmount.\n * - No timers\n * - No animation coupling\n * - No DOM side-effects\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Present as Function\n * Accepts boolean OR function to support lazy evaluation patterns.\n * Function is called once per render. Use boolean form for static values.\n *\n * 2. Children Type\n * `children` is intentionally `unknown` to remain runtime-agnostic.\n * The runtime owns child normalization and validation.\n *\n * 3. Immediate Mount/Unmount\n * No exit animations or transitions. When `present` becomes false,\n * children are removed immediately. Animation must be layered above\n * this primitive.\n */\nexport function Presence({\n present,\n children,\n}: PresenceProps): JSXElement | null {\n const isPresent =\n typeof present === 'function' ? present() : Boolean(present);\n if (!isPresent) return null;\n\n const element: JSXElement = {\n $$typeof: ELEMENT_TYPE,\n type: Fragment,\n props: { children },\n key: null,\n };\n return element;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,SAAS,EACvB,SACA,YACmC;AAGnC,KAAI,EADF,OAAO,YAAY,aAAa,SAAS,GAAG,QAAQ,QAAQ,EAC9C,QAAO;AAQvB,QAAO;EALL,UAAU;EACV,MAAM;EACN,OAAO,EAAE,UAAU;EACnB,KAAK;EAEA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { JSXElement } from "../../common/jsx.js";
|
|
2
|
+
//#region src/foundations/structures/slot.d.ts
|
|
3
|
+
type SlotProps = {
|
|
4
|
+
asChild: true;
|
|
5
|
+
children: JSXElement;
|
|
6
|
+
[key: string]: unknown;
|
|
6
7
|
} | {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
asChild?: false;
|
|
9
|
+
children?: unknown;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Slot
|
|
@@ -27,5 +28,7 @@ export type SlotProps = {
|
|
|
27
28
|
* asChild=true requires exactly one JSXElement child (enforced by type).
|
|
28
29
|
* Runtime validates with isElement() check.
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
declare function Slot(props: SlotProps): JSXElement | null;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Slot, SlotProps };
|
|
31
34
|
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.d.ts","
|
|
1
|
+
{"version":3,"file":"slot.d.ts","names":[],"sources":["../../../src/foundations/structures/slot.tsx"],"mappings":";;KAGY,SAAA;EAEN,OAAA;EACA,QAAA,EAAU,UAAA;EAAA,CACT,GAAA;AAAA;EAGD,OAAA;EACA,QAAA;AAAA;;;;;;;;AAuBN;;;;;;;;;;;;;iBAAgB,IAAA,CAAK,KAAA,EAAO,SAAA,GAAY,UAAA"}
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ELEMENT_TYPE, Fragment } from "../../common/jsx.js";
|
|
2
|
+
import { cloneElement, isElement } from "../../jsx/utils.js";
|
|
3
|
+
import "../../jsx/index.js";
|
|
4
|
+
//#region src/foundations/structures/slot.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Slot
|
|
7
|
+
*
|
|
8
|
+
* Structural primitive for prop forwarding patterns.
|
|
9
|
+
*
|
|
10
|
+
* POLICY DECISIONS (LOCKED):
|
|
11
|
+
*
|
|
12
|
+
* 1. asChild Pattern
|
|
13
|
+
* When asChild=true, merges props into the single child element.
|
|
14
|
+
* Child must be a valid JSXElement; non-element children return null.
|
|
15
|
+
* **Slot props override child props** (injection pattern).
|
|
16
|
+
*
|
|
17
|
+
* 2. Fallback Behavior
|
|
18
|
+
* When asChild=false, returns a Fragment (structural no-op).
|
|
19
|
+
* No DOM element is introduced.
|
|
20
|
+
*
|
|
21
|
+
* 3. Type Safety
|
|
22
|
+
* asChild=true requires exactly one JSXElement child (enforced by type).
|
|
23
|
+
* Runtime validates with isElement() check.
|
|
24
|
+
*/
|
|
25
|
+
function Slot(props) {
|
|
26
|
+
if (props.asChild) {
|
|
27
|
+
const { children, asChild: _asChild, ...rest } = props;
|
|
28
|
+
if (isElement(children)) return cloneElement(children, rest);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
$$typeof: ELEMENT_TYPE,
|
|
33
|
+
type: Fragment,
|
|
34
|
+
props: { children: props.children },
|
|
35
|
+
key: null
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Slot };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","names":[],"sources":["../../../src/foundations/structures/slot.tsx"],"sourcesContent":["import { Fragment, cloneElement, isElement, ELEMENT_TYPE } from '../../jsx';\nimport type { JSXElement } from '../../jsx';\n\nexport type SlotProps =\n | {\n asChild: true;\n children: JSXElement;\n [key: string]: unknown;\n }\n | {\n asChild?: false;\n children?: unknown;\n };\n\n/**\n * Slot\n *\n * Structural primitive for prop forwarding patterns.\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. asChild Pattern\n * When asChild=true, merges props into the single child element.\n * Child must be a valid JSXElement; non-element children return null.\n * **Slot props override child props** (injection pattern).\n *\n * 2. Fallback Behavior\n * When asChild=false, returns a Fragment (structural no-op).\n * No DOM element is introduced.\n *\n * 3. Type Safety\n * asChild=true requires exactly one JSXElement child (enforced by type).\n * Runtime validates with isElement() check.\n */\nexport function Slot(props: SlotProps): JSXElement | null {\n if (props.asChild) {\n const { children, asChild: _asChild, ...rest } = props;\n\n if (isElement(children)) {\n return cloneElement(children, rest);\n }\n return null;\n }\n\n // Structural no-op: Slot does not introduce DOM\n // Return a vnode object for the fragment with the internal element marker.\n const element: JSXElement = {\n $$typeof: ELEMENT_TYPE,\n type: Fragment,\n props: { children: props.children },\n key: null,\n };\n return element;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAgB,KAAK,OAAqC;AACxD,KAAI,MAAM,SAAS;EACjB,MAAM,EAAE,UAAU,SAAS,UAAU,GAAG,SAAS;AAEjD,MAAI,UAAU,SAAS,CACrB,QAAO,aAAa,UAAU,KAAK;AAErC,SAAO;;AAWT,QAAO;EALL,UAAU;EACV,MAAM;EACN,OAAO,EAAE,UAAU,MAAM,UAAU;EACnC,KAAK;EAEA"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { definePortal, DefaultPortal } from './structures/portal';
|
|
9
|
-
export type { Portal } from './structures/portal';
|
|
10
|
-
export { createCollection } from './structures/collection';
|
|
11
|
-
export type { Collection, CollectionItem } from './structures/collection';
|
|
12
|
-
export { createLayer } from './structures/layer';
|
|
13
|
-
export type { Layer, LayerManager, LayerOptions } from './structures/layer';
|
|
14
|
-
//# sourceMappingURL=structures.d.ts.map
|
|
1
|
+
import { JSXElement } from "../common/jsx.js";
|
|
2
|
+
import { LayoutComponent, layout } from "./structures/layout.js";
|
|
3
|
+
import { Slot, SlotProps } from "./structures/slot.js";
|
|
4
|
+
import { Presence, PresenceProps } from "./structures/presence.js";
|
|
5
|
+
import { DefaultPortal, Portal, PortalProps, definePortal } from "./structures/portal.js";
|
|
6
|
+
import { Collection, CollectionItem, createCollection } from "./structures/collection.js";
|
|
7
|
+
import { Layer, LayerManager, LayerOptions, createLayer } from "./structures/layer.js";
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./structures/portal.js";
|
|
2
|
+
import "./structures/layout.js";
|
|
3
|
+
import "./structures/slot.js";
|
|
4
|
+
import "./structures/presence.js";
|
|
5
|
+
import "./structures/collection.js";
|
|
6
|
+
import "./structures/layer.js";
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/foundations/utilities/aria.ts
|
|
2
|
+
/**
|
|
3
|
+
* Tiny aria helpers
|
|
4
|
+
*/
|
|
5
|
+
function ariaDisabled(disabled) {
|
|
6
|
+
return disabled ? { "aria-disabled": "true" } : {};
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ariaDisabled };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=aria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aria.js","names":[],"sources":["../../../src/foundations/utilities/aria.ts"],"sourcesContent":["/**\n * Tiny aria helpers\n */\n\nexport function ariaDisabled(disabled?: boolean): { 'aria-disabled'?: 'true' } {\n return disabled ? { 'aria-disabled': 'true' } : {};\n}\n\nexport function ariaExpanded(expanded?: boolean): {\n 'aria-expanded'?: 'true' | 'false';\n} {\n return expanded === undefined\n ? {}\n : { 'aria-expanded': String(expanded) as 'true' | 'false' };\n}\n\nexport function ariaSelected(selected?: boolean): {\n 'aria-selected'?: 'true' | 'false';\n} {\n return selected === undefined\n ? {}\n : { 'aria-selected': String(selected) as 'true' | 'false' };\n}\n"],"mappings":";;;;AAIA,SAAgB,aAAa,UAAkD;AAC7E,QAAO,WAAW,EAAE,iBAAiB,QAAQ,GAAG,EAAE"}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/foundations/utilities/compose-handlers.ts
|
|
2
|
+
function isDefaultPrevented(value) {
|
|
3
|
+
return typeof value === "object" && value !== null && "defaultPrevented" in value && value.defaultPrevented === true;
|
|
4
|
+
}
|
|
5
|
+
function composeHandlers(first, second, options) {
|
|
6
|
+
if (!first && !second) return noop;
|
|
7
|
+
if (!first) return second;
|
|
8
|
+
if (!second) return first;
|
|
9
|
+
const checkDefaultPrevented = options?.checkDefaultPrevented !== false;
|
|
10
|
+
return function composed(...args) {
|
|
11
|
+
first(...args);
|
|
12
|
+
if (checkDefaultPrevented && isDefaultPrevented(args[0])) return;
|
|
13
|
+
second(...args);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function noop() {}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { composeHandlers };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=compose-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-handlers.js","names":[],"sources":["../../../src/foundations/utilities/compose-handlers.ts"],"sourcesContent":["/**\n * composeHandlers\n *\n * Compose two event handlers into one. The first handler runs, and unless it\n * calls `event.preventDefault()` (or sets `defaultPrevented`), the second\n * handler runs. This prevents accidental clobbering of child handlers when\n * injecting props.\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Execution Order\n * First handler runs before second (injected before base).\n * This allows injected handlers to prevent default behavior.\n *\n * 2. Default Prevention Check\n * By default, checks `defaultPrevented` on first argument.\n * Can be disabled via options.checkDefaultPrevented = false.\n *\n * 3. Undefined Handler Support\n * Undefined handlers are skipped (no-op). This simplifies usage\n * where handlers are optional.\n *\n * 4. Type Safety\n * Args are readonly to prevent mutation. Return type matches input.\n */\n\nexport interface ComposeHandlersOptions {\n /**\n * When true (default), do not run the second handler if the first prevented default.\n * When false, always run both handlers.\n */\n checkDefaultPrevented?: boolean;\n}\n\nfunction isDefaultPrevented(\n value: unknown\n): value is { defaultPrevented: true } {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'defaultPrevented' in value &&\n (value as { defaultPrevented?: boolean }).defaultPrevented === true\n );\n}\n\nexport function composeHandlers<A extends readonly unknown[]>(\n first?: (...args: A) => void,\n second?: (...args: A) => void,\n options?: ComposeHandlersOptions\n): (...args: A) => void {\n // Fast path: if neither handler exists, return stable no-op\n if (!first && !second) {\n return noop as (...args: A) => void;\n }\n\n // Fast path: if only one handler exists, return it directly\n if (!first) return second!;\n if (!second) return first;\n\n // Composition path: both handlers exist\n const checkDefaultPrevented = options?.checkDefaultPrevented !== false;\n\n return function composed(...args: A) {\n first(...args);\n\n if (checkDefaultPrevented && isDefaultPrevented(args[0])) {\n return;\n }\n\n second(...args);\n } as (...args: A) => void;\n}\n\n// Stable no-op for fast path\nfunction noop() {}\n"],"mappings":";AAkCA,SAAS,mBACP,OACqC;AACrC,QACE,OAAO,UAAU,YACjB,UAAU,QACV,sBAAsB,SACrB,MAAyC,qBAAqB;;AAInE,SAAgB,gBACd,OACA,QACA,SACsB;AAEtB,KAAI,CAAC,SAAS,CAAC,OACb,QAAO;AAIT,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,CAAC,OAAQ,QAAO;CAGpB,MAAM,wBAAwB,SAAS,0BAA0B;AAEjE,QAAO,SAAS,SAAS,GAAG,MAAS;AACnC,QAAM,GAAG,KAAK;AAEd,MAAI,yBAAyB,mBAAmB,KAAK,GAAG,CACtD;AAGF,SAAO,GAAG,KAAK;;;AAKnB,SAAS,OAAO"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/foundations/utilities/compose-ref.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Ref composition utilities
|
|
3
4
|
*
|
|
@@ -16,9 +17,11 @@
|
|
|
16
17
|
* composeRefs applies refs in array order (left to right).
|
|
17
18
|
* All refs are called even if one fails.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
type Ref<T> = ((value: T | null) => void) | {
|
|
21
|
+
current: T | null;
|
|
21
22
|
} | null | undefined;
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
declare function setRef<T>(ref: Ref<T>, value: T | null): void;
|
|
24
|
+
declare function composeRefs<T>(...refs: Array<Ref<T>>): (value: T | null) => void;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Ref };
|
|
24
27
|
//# sourceMappingURL=compose-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-ref.d.ts","
|
|
1
|
+
{"version":3,"file":"compose-ref.d.ts","names":[],"sources":["../../../src/foundations/utilities/compose-ref.ts"],"mappings":";;AAmBA;;;;;;;;;;;AAMA;;;;;;KANY,GAAA,QACN,KAAA,EAAO,CAAA;EACP,OAAA,EAAS,CAAA;AAAA;AAAA,iBAIC,MAAA,GAAA,CAAU,GAAA,EAAK,GAAA,CAAI,CAAA,GAAI,KAAA,EAAO,CAAA;AAAA,iBAY9B,WAAA,GAAA,CAAA,GACX,IAAA,EAAM,KAAA,CAAM,GAAA,CAAI,CAAA,MACjB,KAAA,EAAO,CAAA"}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/foundations/utilities/compose-ref.ts
|
|
2
|
+
function setRef(ref, value) {
|
|
3
|
+
if (!ref) return;
|
|
4
|
+
if (typeof ref === "function") {
|
|
5
|
+
ref(value);
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (Object.isExtensible(ref)) ref.current = value;
|
|
9
|
+
}
|
|
10
|
+
function composeRefs(...refs) {
|
|
11
|
+
return (value) => {
|
|
12
|
+
for (const ref of refs) setRef(ref, value);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { composeRefs };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=compose-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-ref.js","names":[],"sources":["../../../src/foundations/utilities/compose-ref.ts"],"sourcesContent":["/**\n * Ref composition utilities\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Ref Types Supported\n * - Callback refs: (value: T | null) => void\n * - Object refs: { current: T | null }\n * - null/undefined (no-op)\n *\n * 2. Write Failure Handling\n * setRef catches write failures (readonly refs) and ignores them.\n * This is intentional — refs may be readonly in some contexts.\n *\n * 3. Composition Order\n * composeRefs applies refs in array order (left to right).\n * All refs are called even if one fails.\n */\n\nexport type Ref<T> =\n | ((value: T | null) => void)\n | { current: T | null }\n | null\n | undefined;\n\nexport function setRef<T>(ref: Ref<T>, value: T | null): void {\n if (!ref) return;\n if (typeof ref === 'function') {\n ref(value);\n return;\n }\n // Fast path: use Object.isExtensible check instead of try/catch for better performance\n if (Object.isExtensible(ref)) {\n (ref as { current: T | null }).current = value;\n }\n}\n\nexport function composeRefs<T>(\n ...refs: Array<Ref<T>>\n): (value: T | null) => void {\n return (value: T | null) => {\n for (const ref of refs) setRef(ref, value);\n };\n}\n"],"mappings":";AAyBA,SAAgB,OAAU,KAAa,OAAuB;AAC5D,KAAI,CAAC,IAAK;AACV,KAAI,OAAO,QAAQ,YAAY;AAC7B,MAAI,MAAM;AACV;;AAGF,KAAI,OAAO,aAAa,IAAI,CACzB,KAA8B,UAAU;;AAI7C,SAAgB,YACd,GAAG,MACwB;AAC3B,SAAQ,UAAoB;AAC1B,OAAK,MAAM,OAAO,KAAM,QAAO,KAAK,MAAM"}
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
import{composeHandlers
|
|
1
|
+
import { composeHandlers } from "./compose-handlers.js";
|
|
2
|
+
//#region src/foundations/utilities/merge-props.ts
|
|
3
|
+
/**
|
|
4
|
+
* mergeProps
|
|
5
|
+
*
|
|
6
|
+
* Deterministic props merging.
|
|
7
|
+
* - For non-handlers: `base` overwrites `injected`.
|
|
8
|
+
* - For handlers present in both: handlers are composed with `injected` running
|
|
9
|
+
* first; it may call `preventDefault()` to suppress the `base` handler.
|
|
10
|
+
*
|
|
11
|
+
* POLICY DECISIONS (LOCKED):
|
|
12
|
+
*
|
|
13
|
+
* 1. Merge Strategy
|
|
14
|
+
* Base props overwrite injected props (base wins).
|
|
15
|
+
* Exception: Event handlers are composed, not overwritten.
|
|
16
|
+
*
|
|
17
|
+
* 2. Event Handler Detection
|
|
18
|
+
* Keys starting with "on" are treated as event handlers.
|
|
19
|
+
* This matches JSX conventions.
|
|
20
|
+
*
|
|
21
|
+
* 3. Handler Composition Order
|
|
22
|
+
* Injected handler runs first, base handler second.
|
|
23
|
+
* This allows injected handlers to prevent default.
|
|
24
|
+
*
|
|
25
|
+
* 4. Return Type
|
|
26
|
+
* Returns intersection type (TInjected & TBase) for type safety.
|
|
27
|
+
*/
|
|
28
|
+
function isEventHandlerKey(key) {
|
|
29
|
+
return key.startsWith("on");
|
|
30
|
+
}
|
|
31
|
+
function mergeProps(base, injected) {
|
|
32
|
+
const baseKeys = Object.keys(base);
|
|
33
|
+
if (baseKeys.length === 0) return injected;
|
|
34
|
+
const out = { ...injected };
|
|
35
|
+
for (const key of baseKeys) {
|
|
36
|
+
const baseValue = base[key];
|
|
37
|
+
const injectedValue = injected[key];
|
|
38
|
+
if (isEventHandlerKey(key) && typeof baseValue === "function" && typeof injectedValue === "function") {
|
|
39
|
+
out[key] = composeHandlers(injectedValue, baseValue);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
out[key] = baseValue;
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { mergeProps };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=merge-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-props.js","names":[],"sources":["../../../src/foundations/utilities/merge-props.ts"],"sourcesContent":["/**\n * mergeProps\n *\n * Deterministic props merging.\n * - For non-handlers: `base` overwrites `injected`.\n * - For handlers present in both: handlers are composed with `injected` running\n * first; it may call `preventDefault()` to suppress the `base` handler.\n *\n * POLICY DECISIONS (LOCKED):\n *\n * 1. Merge Strategy\n * Base props overwrite injected props (base wins).\n * Exception: Event handlers are composed, not overwritten.\n *\n * 2. Event Handler Detection\n * Keys starting with \"on\" are treated as event handlers.\n * This matches JSX conventions.\n *\n * 3. Handler Composition Order\n * Injected handler runs first, base handler second.\n * This allows injected handlers to prevent default.\n *\n * 4. Return Type\n * Returns intersection type (TInjected & TBase) for type safety.\n */\nimport { composeHandlers } from './compose-handlers';\n\ntype Fn = (...args: readonly unknown[]) => void;\n\nfunction isEventHandlerKey(key: string): boolean {\n return key.startsWith('on');\n}\n\nexport function mergeProps<TBase extends object, TInjected extends object>(\n base: TBase,\n injected: TInjected\n): TInjected & TBase {\n // Fast path: if base is empty, return injected as-is\n const baseKeys = Object.keys(base);\n if (baseKeys.length === 0) {\n return injected as TInjected & TBase;\n }\n\n const out = { ...(injected as object) } as TInjected & TBase;\n\n for (const key of baseKeys as Array<Extract<keyof TBase, string>>) {\n const baseValue = (base as Record<string, unknown>)[key];\n const injectedValue = (injected as Record<string, unknown>)[key];\n\n if (\n isEventHandlerKey(key) &&\n typeof baseValue === 'function' &&\n typeof injectedValue === 'function'\n ) {\n // Invariant: injected runs first; it may call preventDefault() to\n // suppress base behaviour.\n (out as Record<string, unknown>)[key] = composeHandlers(\n injectedValue as unknown as Fn,\n baseValue as unknown as Fn\n );\n continue;\n }\n\n (out as Record<string, unknown>)[key] = baseValue;\n }\n\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,kBAAkB,KAAsB;AAC/C,QAAO,IAAI,WAAW,KAAK;;AAG7B,SAAgB,WACd,MACA,UACmB;CAEnB,MAAM,WAAW,OAAO,KAAK,KAAK;AAClC,KAAI,SAAS,WAAW,EACtB,QAAO;CAGT,MAAM,MAAM,EAAE,GAAI,UAAqB;AAEvC,MAAK,MAAM,OAAO,UAAiD;EACjE,MAAM,YAAa,KAAiC;EACpD,MAAM,gBAAiB,SAAqC;AAE5D,MACE,kBAAkB,IAAI,IACtB,OAAO,cAAc,cACrB,OAAO,kBAAkB,YACzB;AAGC,OAAgC,OAAO,gBACtC,eACA,UACD;AACD;;AAGD,MAAgC,OAAO;;AAG1C,QAAO"}
|
package/dist/fx/fx.d.ts
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/fx/fx.d.ts
|
|
2
|
+
type CancelFn = () => void;
|
|
3
|
+
declare function debounceEvent(ms: number, handler: EventListener, options?: {
|
|
4
|
+
leading?: boolean;
|
|
5
|
+
trailing?: boolean;
|
|
5
6
|
}): EventListener & {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
cancel(): void;
|
|
8
|
+
flush(): void;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
declare function throttleEvent(ms: number, handler: EventListener, options?: {
|
|
11
|
+
leading?: boolean;
|
|
12
|
+
trailing?: boolean;
|
|
12
13
|
}): EventListener & {
|
|
13
|
-
|
|
14
|
+
cancel(): void;
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
declare function rafEvent(handler: EventListener): EventListener & {
|
|
17
|
+
cancel(): void;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
declare function scheduleTimeout(ms: number, fn: () => void): CancelFn;
|
|
20
|
+
declare function scheduleIdle(fn: () => void, options?: {
|
|
21
|
+
timeout?: number;
|
|
21
22
|
}): CancelFn;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
interface RetryOptions {
|
|
24
|
+
maxAttempts?: number;
|
|
25
|
+
delayMs?: number;
|
|
26
|
+
backoff?: (attemptIndex: number) => number;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
declare function scheduleRetry<T>(fn: () => Promise<T>, options?: RetryOptions): {
|
|
29
|
+
cancel(): void;
|
|
29
30
|
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { debounceEvent, rafEvent, scheduleIdle, scheduleRetry, scheduleTimeout, throttleEvent };
|
|
30
33
|
//# sourceMappingURL=fx.d.ts.map
|
package/dist/fx/fx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx.d.ts","
|
|
1
|
+
{"version":3,"file":"fx.d.ts","names":[],"sources":["../../src/fx/fx.ts"],"mappings":";KAKY,QAAA;AAAA,iBAwCI,aAAA,CACd,EAAA,UACA,OAAA,EAAS,aAAA,EACT,OAAA;EAAY,OAAA;EAAmB,QAAA;AAAA,IAC9B,aAAA;EAAkB,MAAA;EAAgB,KAAA;AAAA;AAAA,iBAsErB,aAAA,CACd,EAAA,UACA,OAAA,EAAS,aAAA,EACT,OAAA;EAAY,OAAA;EAAmB,QAAA;AAAA,IAC9B,aAAA;EAAkB,MAAA;AAAA;AAAA,iBA0DL,QAAA,CACd,OAAA,EAAS,aAAA,GACR,aAAA;EAAkB,MAAA;AAAA;AAAA,iBAuDL,eAAA,CAAgB,EAAA,UAAY,EAAA,eAAiB,QAAA;AAAA,iBAuB7C,YAAA,CACd,EAAA,cACA,OAAA;EAAY,OAAA;AAAA,IACX,QAAA;AAAA,UA0Cc,YAAA;EACf,WAAA;EACA,OAAA;EACA,OAAA,IAAW,YAAA;AAAA;AAAA,iBAGG,aAAA,GAAA,CACd,EAAA,QAAU,OAAA,CAAQ,CAAA,GAClB,OAAA,GAAU,YAAA;EACP,MAAA;AAAA"}
|