@bleedingdev/tanstack-redact 0.0.0-bootstrap → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/cloudflare/index.d.ts +6 -0
- package/dist/cloudflare/index.js +39 -0
- package/dist/cloudflare/index.js.map +7 -0
- package/dist/core/attributes.d.ts +4 -0
- package/dist/core/attributes.js +30 -0
- package/dist/core/attributes.js.map +7 -0
- package/dist/core/browser.d.ts +9 -0
- package/dist/core/browser.js +32 -0
- package/dist/core/browser.js.map +7 -0
- package/dist/core/class-props.d.ts +1 -0
- package/dist/core/class-props.js +15 -0
- package/dist/core/class-props.js.map +7 -0
- package/dist/core/devtools.d.ts +26 -0
- package/dist/core/devtools.js +70 -0
- package/dist/core/devtools.js.map +7 -0
- package/dist/core/functions.d.ts +6 -0
- package/dist/core/functions.js +14 -0
- package/dist/core/functions.js.map +7 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +7 -0
- package/dist/core/internal.d.ts +103 -0
- package/dist/core/internal.js +43 -0
- package/dist/core/internal.js.map +7 -0
- package/dist/core/resource-hints.d.ts +7 -0
- package/dist/core/resource-hints.js +20 -0
- package/dist/core/resource-hints.js.map +7 -0
- package/dist/core/types.d.ts +23 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +7 -0
- package/dist/core/unitless-style.d.ts +1 -0
- package/dist/core/unitless-style.js +5 -0
- package/dist/core/unitless-style.js.map +7 -0
- package/dist/dom/_all.d.ts +27 -0
- package/dist/dom/_all.js +51 -0
- package/dist/dom/_all.js.map +7 -0
- package/dist/dom/client.d.ts +9 -0
- package/dist/dom/client.js +13 -0
- package/dist/dom/client.js.map +7 -0
- package/dist/dom/commit.d.ts +27 -0
- package/dist/dom/commit.js +237 -0
- package/dist/dom/commit.js.map +7 -0
- package/dist/dom/devtools-effects.d.ts +8 -0
- package/dist/dom/devtools-effects.js +80 -0
- package/dist/dom/devtools-effects.js.map +7 -0
- package/dist/dom/devtools.d.ts +33 -0
- package/dist/dom/devtools.js +635 -0
- package/dist/dom/devtools.js.map +7 -0
- package/dist/dom/dispatcher.d.ts +4 -0
- package/dist/dom/dispatcher.js +437 -0
- package/dist/dom/dispatcher.js.map +7 -0
- package/dist/dom/document-metadata.d.ts +7 -0
- package/dist/dom/document-metadata.js +44 -0
- package/dist/dom/document-metadata.js.map +7 -0
- package/dist/dom/dom.d.ts +11 -0
- package/dist/dom/dom.js +165 -0
- package/dist/dom/dom.js.map +7 -0
- package/dist/dom/error-info.d.ts +2 -0
- package/dist/dom/error-info.js +19 -0
- package/dist/dom/error-info.js.map +7 -0
- package/dist/dom/event-replay.d.ts +13 -0
- package/dist/dom/event-replay.js +24 -0
- package/dist/dom/event-replay.js.map +7 -0
- package/dist/dom/features/activity/full.d.ts +1 -0
- package/dist/dom/features/activity/full.js +140 -0
- package/dist/dom/features/activity/full.js.map +7 -0
- package/dist/dom/features/activity/index.d.ts +1 -0
- package/dist/dom/features/activity/index.js +2 -0
- package/dist/dom/features/activity/index.js.map +7 -0
- package/dist/dom/features/activity/stub.d.ts +1 -0
- package/dist/dom/features/activity/stub.js +10 -0
- package/dist/dom/features/activity/stub.js.map +7 -0
- package/dist/dom/features/class/full.d.ts +1 -0
- package/dist/dom/features/class/full.js +208 -0
- package/dist/dom/features/class/full.js.map +7 -0
- package/dist/dom/features/class/index.d.ts +1 -0
- package/dist/dom/features/class/index.js +2 -0
- package/dist/dom/features/class/index.js.map +7 -0
- package/dist/dom/features/class/stub.d.ts +1 -0
- package/dist/dom/features/class/stub.js +46 -0
- package/dist/dom/features/class/stub.js.map +7 -0
- package/dist/dom/features/context/full.d.ts +4 -0
- package/dist/dom/features/context/full.js +103 -0
- package/dist/dom/features/context/full.js.map +7 -0
- package/dist/dom/features/context/index.d.ts +1 -0
- package/dist/dom/features/context/index.js +2 -0
- package/dist/dom/features/context/index.js.map +7 -0
- package/dist/dom/features/context/stub.d.ts +4 -0
- package/dist/dom/features/context/stub.js +21 -0
- package/dist/dom/features/context/stub.js.map +7 -0
- package/dist/dom/features/forward-ref/full.d.ts +1 -0
- package/dist/dom/features/forward-ref/full.js +9 -0
- package/dist/dom/features/forward-ref/full.js.map +7 -0
- package/dist/dom/features/forward-ref/index.d.ts +1 -0
- package/dist/dom/features/forward-ref/index.js +2 -0
- package/dist/dom/features/forward-ref/index.js.map +7 -0
- package/dist/dom/features/forward-ref/stub.d.ts +1 -0
- package/dist/dom/features/forward-ref/stub.js +9 -0
- package/dist/dom/features/forward-ref/stub.js.map +7 -0
- package/dist/dom/features/fragment-refs/index.d.ts +1 -0
- package/dist/dom/features/fragment-refs/index.js +9 -0
- package/dist/dom/features/fragment-refs/index.js.map +7 -0
- package/dist/dom/features/fragment-refs/stub.d.ts +5 -0
- package/dist/dom/features/fragment-refs/stub.js +17 -0
- package/dist/dom/features/fragment-refs/stub.js.map +7 -0
- package/dist/dom/features/hydration/full.d.ts +68 -0
- package/dist/dom/features/hydration/full.js +493 -0
- package/dist/dom/features/hydration/full.js.map +7 -0
- package/dist/dom/features/hydration/index.d.ts +1 -0
- package/dist/dom/features/hydration/index.js +2 -0
- package/dist/dom/features/hydration/index.js.map +7 -0
- package/dist/dom/features/hydration/stub.d.ts +36 -0
- package/dist/dom/features/hydration/stub.js +80 -0
- package/dist/dom/features/hydration/stub.js.map +7 -0
- package/dist/dom/features/index.d.ts +8 -0
- package/dist/dom/features/index.js +9 -0
- package/dist/dom/features/index.js.map +7 -0
- package/dist/dom/features/lazy/full.d.ts +1 -0
- package/dist/dom/features/lazy/full.js +23 -0
- package/dist/dom/features/lazy/full.js.map +7 -0
- package/dist/dom/features/lazy/index.d.ts +1 -0
- package/dist/dom/features/lazy/index.js +2 -0
- package/dist/dom/features/lazy/index.js.map +7 -0
- package/dist/dom/features/lazy/stub.d.ts +1 -0
- package/dist/dom/features/lazy/stub.js +19 -0
- package/dist/dom/features/lazy/stub.js.map +7 -0
- package/dist/dom/features/memo/full.d.ts +1 -0
- package/dist/dom/features/memo/full.js +34 -0
- package/dist/dom/features/memo/full.js.map +7 -0
- package/dist/dom/features/memo/index.d.ts +1 -0
- package/dist/dom/features/memo/index.js +2 -0
- package/dist/dom/features/memo/index.js.map +7 -0
- package/dist/dom/features/memo/stub.d.ts +1 -0
- package/dist/dom/features/memo/stub.js +9 -0
- package/dist/dom/features/memo/stub.js.map +7 -0
- package/dist/dom/features/portal/full.d.ts +1 -0
- package/dist/dom/features/portal/full.js +11 -0
- package/dist/dom/features/portal/full.js.map +7 -0
- package/dist/dom/features/portal/index.d.ts +1 -0
- package/dist/dom/features/portal/index.js +2 -0
- package/dist/dom/features/portal/index.js.map +7 -0
- package/dist/dom/features/portal/stub.d.ts +1 -0
- package/dist/dom/features/portal/stub.js +5 -0
- package/dist/dom/features/portal/stub.js.map +7 -0
- package/dist/dom/features/suspense/full.d.ts +1 -0
- package/dist/dom/features/suspense/full.js +389 -0
- package/dist/dom/features/suspense/full.js.map +7 -0
- package/dist/dom/features/suspense/index.d.ts +1 -0
- package/dist/dom/features/suspense/index.js +2 -0
- package/dist/dom/features/suspense/index.js.map +7 -0
- package/dist/dom/features/suspense/stub.d.ts +1 -0
- package/dist/dom/features/suspense/stub.js +4 -0
- package/dist/dom/features/suspense/stub.js.map +7 -0
- package/dist/dom/features/suspense-runtime/index.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/index.js +2 -0
- package/dist/dom/features/suspense-runtime/index.js.map +7 -0
- package/dist/dom/features/suspense-runtime/stub.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/stub.js +11 -0
- package/dist/dom/features/suspense-runtime/stub.js.map +7 -0
- package/dist/dom/features/view-transition/full.d.ts +7 -0
- package/dist/dom/features/view-transition/full.js +324 -0
- package/dist/dom/features/view-transition/full.js.map +7 -0
- package/dist/dom/features/view-transition/index.d.ts +1 -0
- package/dist/dom/features/view-transition/index.js +2 -0
- package/dist/dom/features/view-transition/index.js.map +7 -0
- package/dist/dom/features/view-transition/resources.d.ts +11 -0
- package/dist/dom/features/view-transition/resources.js +117 -0
- package/dist/dom/features/view-transition/resources.js.map +7 -0
- package/dist/dom/features/view-transition/stub.d.ts +7 -0
- package/dist/dom/features/view-transition/stub.js +21 -0
- package/dist/dom/features/view-transition/stub.js.map +7 -0
- package/dist/dom/features/view-transition/visual.d.ts +14 -0
- package/dist/dom/features/view-transition/visual.js +404 -0
- package/dist/dom/features/view-transition/visual.js.map +7 -0
- package/dist/dom/form-actions.d.ts +4 -0
- package/dist/dom/form-actions.js +74 -0
- package/dist/dom/form-actions.js.map +7 -0
- package/dist/dom/form-controls.d.ts +3 -0
- package/dist/dom/form-controls.js +91 -0
- package/dist/dom/form-controls.js.map +7 -0
- package/dist/dom/fragment-instance.d.ts +33 -0
- package/dist/dom/fragment-instance.js +449 -0
- package/dist/dom/fragment-instance.js.map +7 -0
- package/dist/dom/index.d.ts +61 -0
- package/dist/dom/index.js +71 -0
- package/dist/dom/index.js.map +7 -0
- package/dist/dom/portal.d.ts +2 -0
- package/dist/dom/portal.js +14 -0
- package/dist/dom/portal.js.map +7 -0
- package/dist/dom/react-ids.d.ts +6 -0
- package/dist/dom/react-ids.js +38 -0
- package/dist/dom/react-ids.js.map +7 -0
- package/dist/dom/reconcile.d.ts +86 -0
- package/dist/dom/reconcile.js +1305 -0
- package/dist/dom/reconcile.js.map +7 -0
- package/dist/dom/refresh.d.ts +12 -0
- package/dist/dom/refresh.js +174 -0
- package/dist/dom/refresh.js.map +7 -0
- package/dist/dom/resource-hints.d.ts +6 -0
- package/dist/dom/resource-hints.js +107 -0
- package/dist/dom/resource-hints.js.map +7 -0
- package/dist/dom/resource-store.d.ts +13 -0
- package/dist/dom/resource-store.js +47 -0
- package/dist/dom/resource-store.js.map +7 -0
- package/dist/dom/resources.d.ts +1 -0
- package/dist/dom/resources.js +46 -0
- package/dist/dom/resources.js.map +7 -0
- package/dist/dom/retained-effects.d.ts +6 -0
- package/dist/dom/retained-effects.js +67 -0
- package/dist/dom/retained-effects.js.map +7 -0
- package/dist/dom/root-internal.d.ts +11 -0
- package/dist/dom/root-internal.js +35 -0
- package/dist/dom/root-internal.js.map +7 -0
- package/dist/dom/root.d.ts +17 -0
- package/dist/dom/root.js +38 -0
- package/dist/dom/root.js.map +7 -0
- package/dist/dom/synthetic-event.d.ts +1 -0
- package/dist/dom/synthetic-event.js +35 -0
- package/dist/dom/synthetic-event.js.map +7 -0
- package/dist/dom/test-utils.d.ts +1 -0
- package/dist/dom/test-utils.js +5 -0
- package/dist/dom/test-utils.js.map +7 -0
- package/dist/dom/transitions.d.ts +9 -0
- package/dist/dom/transitions.js +147 -0
- package/dist/dom/transitions.js.map +7 -0
- package/dist/dom/tree.d.ts +5 -0
- package/dist/dom/tree.js +62 -0
- package/dist/dom/tree.js.map +7 -0
- package/dist/dom/walk.d.ts +2 -0
- package/dist/dom/walk.js +14 -0
- package/dist/dom/walk.js.map +7 -0
- package/dist/next/client.d.ts +9 -0
- package/dist/next/client.js +14 -0
- package/dist/next/client.js.map +7 -0
- package/dist/next/dev-cache-loader.cjs +13 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +97 -0
- package/dist/next/index.js.map +7 -0
- package/dist/next/loader.cjs +10 -0
- package/dist/next/react.d.ts +71 -0
- package/dist/next/react.js +9 -0
- package/dist/next/react.js.map +7 -0
- package/dist/react/act.d.ts +3 -0
- package/dist/react/act.js +124 -0
- package/dist/react/act.js.map +7 -0
- package/dist/react/action-scope.d.ts +17 -0
- package/dist/react/action-scope.js +60 -0
- package/dist/react/action-scope.js.map +7 -0
- package/dist/react/activity.d.ts +7 -0
- package/dist/react/activity.js +7 -0
- package/dist/react/activity.js.map +7 -0
- package/dist/react/children.d.ts +8 -0
- package/dist/react/children.js +76 -0
- package/dist/react/children.js.map +7 -0
- package/dist/react/class.d.ts +36 -0
- package/dist/react/class.js +39 -0
- package/dist/react/class.js.map +7 -0
- package/dist/react/compiler-runtime.d.ts +1 -0
- package/dist/react/compiler-runtime.js +9 -0
- package/dist/react/compiler-runtime.js.map +7 -0
- package/dist/react/context.d.ts +32 -0
- package/dist/react/context.js +25 -0
- package/dist/react/context.js.map +7 -0
- package/dist/react/element.d.ts +13 -0
- package/dist/react/element.js +70 -0
- package/dist/react/element.js.map +7 -0
- package/dist/react/form-state.d.ts +26 -0
- package/dist/react/form-state.js +30 -0
- package/dist/react/form-state.js.map +7 -0
- package/dist/react/hooks.d.ts +67 -0
- package/dist/react/hooks.js +165 -0
- package/dist/react/hooks.js.map +7 -0
- package/dist/react/index.d.ts +99 -0
- package/dist/react/index.js +143 -0
- package/dist/react/index.js.map +7 -0
- package/dist/react/jsx-runtime.d.ts +24 -0
- package/dist/react/jsx-runtime.js +37 -0
- package/dist/react/jsx-runtime.js.map +7 -0
- package/dist/react/memo.d.ts +20 -0
- package/dist/react/memo.js +27 -0
- package/dist/react/memo.js.map +7 -0
- package/dist/react/portal.d.ts +1 -0
- package/dist/react/portal.js +5 -0
- package/dist/react/portal.js.map +7 -0
- package/dist/react/shared-internals.d.ts +52 -0
- package/dist/react/shared-internals.js +22 -0
- package/dist/react/shared-internals.js.map +7 -0
- package/dist/react/suspense.d.ts +15 -0
- package/dist/react/suspense.js +15 -0
- package/dist/react/suspense.js.map +7 -0
- package/dist/react/thenable.d.ts +1 -0
- package/dist/react/thenable.js +25 -0
- package/dist/react/thenable.js.map +7 -0
- package/dist/react/view-transition.d.ts +32 -0
- package/dist/react/view-transition.js +12 -0
- package/dist/react/view-transition.js.map +7 -0
- package/dist/scheduler/index.d.ts +44 -0
- package/dist/scheduler/index.js +109 -0
- package/dist/scheduler/index.js.map +7 -0
- package/dist/server/bootstrap-script.d.ts +3 -0
- package/dist/server/bootstrap-script.js +17 -0
- package/dist/server/bootstrap-script.js.map +7 -0
- package/dist/server/dispatcher.d.ts +57 -0
- package/dist/server/dispatcher.js +157 -0
- package/dist/server/dispatcher.js.map +7 -0
- package/dist/server/escape.d.ts +6 -0
- package/dist/server/escape.js +75 -0
- package/dist/server/escape.js.map +7 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +25 -0
- package/dist/server/index.js.map +7 -0
- package/dist/server/insertion-context.d.ts +3 -0
- package/dist/server/insertion-context.js +32 -0
- package/dist/server/renderToString.d.ts +7 -0
- package/dist/server/renderToString.js +33 -0
- package/dist/server/renderToString.js.map +7 -0
- package/dist/server/resource-hints.d.ts +22 -0
- package/dist/server/resource-hints.js +168 -0
- package/dist/server/resource-hints.js.map +7 -0
- package/dist/server/stream-ids.d.ts +3 -0
- package/dist/server/stream-ids.js +8 -0
- package/dist/server/stream.d.ts +61 -0
- package/dist/server/stream.js +418 -0
- package/dist/server/stream.js.map +7 -0
- package/dist/server/walk.d.ts +58 -0
- package/dist/server/walk.js +378 -0
- package/dist/server/walk.js.map +7 -0
- package/dist/vinext/compatibility.d.ts +23 -0
- package/dist/vinext/compatibility.js +127 -0
- package/dist/vinext/compatibility.js.map +7 -0
- package/dist/vinext/flight-timing.d.ts +1 -0
- package/dist/vinext/flight-timing.js +46 -0
- package/dist/vinext/flight-timing.js.map +7 -0
- package/dist/vinext/index.d.ts +5 -0
- package/dist/vinext/index.js +50 -0
- package/dist/vinext/index.js.map +7 -0
- package/dist/vite/index.d.ts +102 -0
- package/dist/vite/index.js +291 -0
- package/dist/vite/index.js.map +7 -0
- package/dist/vite/react18.d.ts +4 -0
- package/dist/vite/react18.js +74 -0
- package/dist/vite/react18.js.map +7 -0
- package/package.json +113 -8
- package/src/cloudflare/index.ts +44 -0
- package/src/core/attributes.ts +20 -0
- package/src/core/browser.ts +34 -0
- package/src/core/class-props.ts +12 -0
- package/src/core/devtools.ts +69 -0
- package/src/core/functions.ts +11 -0
- package/src/core/index.ts +2 -0
- package/src/core/internal.ts +123 -0
- package/src/core/resource-hints.ts +39 -0
- package/src/core/types.ts +39 -0
- package/src/core/unitless-style.ts +1 -0
- package/src/dom/_all.ts +46 -0
- package/src/dom/client.ts +17 -0
- package/src/dom/commit.ts +223 -0
- package/src/dom/devtools-effects.ts +78 -0
- package/src/dom/devtools.ts +527 -0
- package/src/dom/dispatcher.ts +476 -0
- package/src/dom/document-metadata.ts +41 -0
- package/src/dom/dom.ts +181 -0
- package/src/dom/error-info.ts +20 -0
- package/src/dom/event-replay.ts +39 -0
- package/src/dom/features/activity/full.ts +150 -0
- package/src/dom/features/activity/index.ts +1 -0
- package/src/dom/features/activity/stub.ts +12 -0
- package/src/dom/features/class/full.ts +202 -0
- package/src/dom/features/class/index.ts +1 -0
- package/src/dom/features/class/stub.ts +58 -0
- package/src/dom/features/context/full.ts +107 -0
- package/src/dom/features/context/index.ts +1 -0
- package/src/dom/features/context/stub.ts +26 -0
- package/src/dom/features/forward-ref/full.ts +9 -0
- package/src/dom/features/forward-ref/index.ts +1 -0
- package/src/dom/features/forward-ref/stub.ts +15 -0
- package/src/dom/features/fragment-refs/index.ts +1 -0
- package/src/dom/features/fragment-refs/stub.ts +6 -0
- package/src/dom/features/hydration/full.ts +563 -0
- package/src/dom/features/hydration/index.ts +1 -0
- package/src/dom/features/hydration/stub.ts +86 -0
- package/src/dom/features/index.ts +12 -0
- package/src/dom/features/lazy/full.ts +27 -0
- package/src/dom/features/lazy/index.ts +1 -0
- package/src/dom/features/lazy/stub.ts +24 -0
- package/src/dom/features/memo/full.ts +39 -0
- package/src/dom/features/memo/index.ts +1 -0
- package/src/dom/features/memo/stub.ts +13 -0
- package/src/dom/features/portal/full.ts +14 -0
- package/src/dom/features/portal/index.ts +1 -0
- package/src/dom/features/portal/stub.ts +11 -0
- package/src/dom/features/suspense/full.ts +469 -0
- package/src/dom/features/suspense/index.ts +1 -0
- package/src/dom/features/suspense/stub.ts +13 -0
- package/src/dom/features/suspense-runtime/index.ts +1 -0
- package/src/dom/features/suspense-runtime/stub.ts +1 -0
- package/src/dom/features/view-transition/full.ts +292 -0
- package/src/dom/features/view-transition/index.ts +1 -0
- package/src/dom/features/view-transition/resources.ts +123 -0
- package/src/dom/features/view-transition/stub.ts +8 -0
- package/src/dom/features/view-transition/visual.ts +454 -0
- package/src/dom/form-actions.ts +69 -0
- package/src/dom/form-controls.ts +91 -0
- package/src/dom/fragment-instance.ts +462 -0
- package/src/dom/index.ts +49 -0
- package/src/dom/portal.ts +16 -0
- package/src/dom/react-ids.ts +36 -0
- package/src/dom/reconcile.ts +1423 -0
- package/src/dom/refresh.ts +171 -0
- package/src/dom/resource-hints.ts +104 -0
- package/src/dom/resource-store.ts +50 -0
- package/src/dom/resources.ts +47 -0
- package/src/dom/retained-effects.ts +57 -0
- package/src/dom/root-internal.ts +37 -0
- package/src/dom/root.ts +59 -0
- package/src/dom/synthetic-event.ts +22 -0
- package/src/dom/test-utils.ts +1 -0
- package/src/dom/transitions.ts +141 -0
- package/src/dom/tree.ts +56 -0
- package/src/dom/walk.ts +8 -0
- package/src/next/client.ts +10 -0
- package/src/next/dev-cache-loader.cjs +13 -0
- package/src/next/index.ts +95 -0
- package/src/next/loader.cjs +10 -0
- package/src/next/react.ts +7 -0
- package/src/react/act.ts +105 -0
- package/src/react/action-scope.ts +57 -0
- package/src/react/activity.ts +10 -0
- package/src/react/children.ts +86 -0
- package/src/react/class.ts +66 -0
- package/src/react/compiler-runtime.ts +8 -0
- package/src/react/context.ts +46 -0
- package/src/react/element.ts +82 -0
- package/src/react/form-state.ts +35 -0
- package/src/react/hooks.ts +214 -0
- package/src/react/index.ts +91 -0
- package/src/react/jsx-runtime.ts +50 -0
- package/src/react/memo.ts +42 -0
- package/src/react/portal.ts +1 -0
- package/src/react/shared-internals.ts +80 -0
- package/src/react/suspense.ts +18 -0
- package/src/react/thenable.ts +21 -0
- package/src/react/view-transition.ts +41 -0
- package/src/scheduler/index.ts +124 -0
- package/src/server/bootstrap-script.ts +92 -0
- package/src/server/dispatcher.ts +168 -0
- package/src/server/escape.ts +102 -0
- package/src/server/index.ts +26 -0
- package/src/server/insertion-context.ts +28 -0
- package/src/server/renderToString.ts +35 -0
- package/src/server/resource-hints.ts +166 -0
- package/src/server/stream-ids.ts +5 -0
- package/src/server/stream.ts +525 -0
- package/src/server/walk.ts +555 -0
- package/src/vinext/compatibility.ts +122 -0
- package/src/vinext/flight-timing.ts +37 -0
- package/src/vinext/index.ts +47 -0
- package/src/vite/index.ts +476 -0
- package/src/vite/react18.ts +74 -0
- package/vendor/cloudflare-vite-plugin/LICENSE +25 -0
- package/vendor/cloudflare-vite-plugin/README.md +9 -0
- package/vendor/cloudflare-vite-plugin/dist/chunk-U6NEESU5-BmLHqeIt.mjs +43 -0
- package/vendor/cloudflare-vite-plugin/dist/index.d.mts +155 -0
- package/vendor/cloudflare-vite-plugin/dist/index.mjs +94700 -0
- package/vendor/cloudflare-vite-plugin/dist/open-PCXX3ZDZ-DYH87NhH.mjs +530 -0
- package/vendor/cloudflare-vite-plugin/dist/package-4cnqy5mM.mjs +84 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/asset-worker/index.js +5996 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/router-worker/index.js +6414 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/index.js +457 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner-legacy.js +1129 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner.js +1259 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/vite-proxy-worker/index.js +31 -0
- package/vendor/cloudflare-vite-plugin/package.json +90 -0
- package/vendor/cloudflare-vite-plugin/provenance.json +26 -0
- package/README.md +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/dom/walk.ts"],
|
|
4
|
+
"sourcesContent": ["import { FiberTag, type Fiber } from '../core'\n\nexport function walkRetained(fiber: Fiber, visit: (fiber: Fiber) => void, postorder?: boolean): void {\n if (!postorder) visit(fiber)\n for (let child = fiber.c; child; child = child.s) walkRetained(child, visit, postorder)\n if (fiber.t === FiberTag.Suspense && fiber.b?.f) walkRetained(fiber.b.f, visit, postorder)\n if (postorder) visit(fiber)\n}\n"],
|
|
5
|
+
"mappings": "AAEM,SAAU,aAAa,OAAc,OAA+B,WAAmB;AAC3F,MAAI,CAAC;AAAW,UAAM,KAAK;AAC3B,WAAS,QAAQ,MAAM,GAAG,OAAO,QAAQ,MAAM;AAAG,iBAAa,OAAO,OAAO,SAAS;AACtF,MAAI,MAAM,MAAC,MAA0B,MAAM,GAAG;AAAG,iBAAa,MAAM,EAAE,GAAG,OAAO,SAAS;AACzF,MAAI;AAAW,UAAM,KAAK;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RootOptions } from "../dom/client.js";
|
|
2
|
+
export type { Root, RootOptions } from "../dom/client.js";
|
|
3
|
+
export declare function createRoot(container: Element | DocumentFragment | Document, options?: RootOptions): import("./client.js").Root;
|
|
4
|
+
export declare function hydrateRoot(container: Element | Document, children: any, options?: RootOptions): import("./client.js").Root;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
createRoot: typeof createRoot;
|
|
7
|
+
hydrateRoot: typeof hydrateRoot;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRoot as create, hydrateRoot as hydrate } from "../dom/client.js";
|
|
2
|
+
function createRoot(container, options = {}) {
|
|
3
|
+
return create(container, { ...options, identifierStrategy: "react" });
|
|
4
|
+
}
|
|
5
|
+
function hydrateRoot(container, children, options = {}) {
|
|
6
|
+
return hydrate(container, children, { ...options, identifierStrategy: "react" });
|
|
7
|
+
}
|
|
8
|
+
var client_default = { createRoot, hydrateRoot };
|
|
9
|
+
export {
|
|
10
|
+
createRoot,
|
|
11
|
+
client_default as default,
|
|
12
|
+
hydrateRoot
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/next/client.ts"],
|
|
4
|
+
"sourcesContent": ["import { createRoot as create, hydrateRoot as hydrate, type RootOptions } from '../dom/client'\nexport type { Root, RootOptions } from '../dom/client'\n\nexport function createRoot(container: Element | DocumentFragment | Document, options: RootOptions = {}) {\n return create(container, { ...options, identifierStrategy: 'react' })\n}\nexport function hydrateRoot(container: Element | Document, children: any, options: RootOptions = {}) {\n return hydrate(container, children, { ...options, identifierStrategy: 'react' })\n}\nexport default { createRoot, hydrateRoot }\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc,QAAQ,eAAe,eAAiC;AAGzE,SAAU,WAAW,WAAkD,UAAuB,CAAA,GAAE;AACpG,SAAO,OAAO,WAAW,EAAE,GAAG,SAAS,oBAAoB,QAAO,CAAE;AACtE;AACM,SAAU,YAAY,WAA+B,UAAe,UAAuB,CAAA,GAAE;AACjG,SAAO,QAAQ,WAAW,UAAU,EAAE,GAAG,SAAS,oBAAoB,QAAO,CAAE;AACjF;AACA,IAAA,iBAAe,EAAE,YAAY,YAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Next 16.2 reads navigation timing before Firefox finalizes streamed body
|
|
2
|
+
// sizes. A zero transfer size alone also describes an unfinished response.
|
|
3
|
+
// Keep Next's debug-channel cache restoration and require a decoded body.
|
|
4
|
+
module.exports = function (source) {
|
|
5
|
+
if (!source.includes('function wasServedFromCache()')) return source
|
|
6
|
+
const original = 'return entry?.transferSize === 0;'
|
|
7
|
+
const corrected = 'return entry?.transferSize === 0 && entry.decodedBodySize > 0;'
|
|
8
|
+
if (source.includes(corrected) && !source.includes(original)) return source
|
|
9
|
+
if (source.split(original).length !== 2) {
|
|
10
|
+
throw new Error('Unsupported Next.js 16.2 debug-channel cache detection. The Redact integration needs an update for this Next.js build.')
|
|
11
|
+
}
|
|
12
|
+
return source.replace(original, corrected)
|
|
13
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
const entries = {
|
|
4
|
+
react: "./react.js",
|
|
5
|
+
"react/jsx-runtime": "../react/jsx-runtime.js",
|
|
6
|
+
"react/jsx-dev-runtime": "../react/jsx-runtime.js",
|
|
7
|
+
"react/compiler-runtime": "../react/compiler-runtime.js",
|
|
8
|
+
"react-dom": "../dom/index.js",
|
|
9
|
+
"react-dom/client": "./client.js",
|
|
10
|
+
"react-dom/test-utils": "../dom/test-utils.js",
|
|
11
|
+
"react-dom/server": "../server/index.js",
|
|
12
|
+
"react-dom/server.browser": "../server/index.js",
|
|
13
|
+
"react-dom/server.edge": "../server/index.js",
|
|
14
|
+
"react-dom/server.node": "../server/index.js",
|
|
15
|
+
"react-dom/server.bun": "../server/index.js",
|
|
16
|
+
scheduler: "../scheduler/index.js"
|
|
17
|
+
};
|
|
18
|
+
function withRedact(config = {}) {
|
|
19
|
+
if (typeof config === "function")
|
|
20
|
+
return ((...args) => withRedact(config(...args)));
|
|
21
|
+
if (typeof config.then === "function")
|
|
22
|
+
return config.then((value) => withRedact(value));
|
|
23
|
+
const version = createRequire(import.meta.url)("next/package.json").version;
|
|
24
|
+
const [major] = version.split(".").map(Number);
|
|
25
|
+
if (!/^(?:15\.5|16\.[0-4])\.\d+$/.test(version))
|
|
26
|
+
throw new Error(`withRedact supports stable Next.js 15.5 and 16.0 through 16.4, received ${version}`);
|
|
27
|
+
const aliases = {};
|
|
28
|
+
for (const [name, entry] of Object.entries(entries)) {
|
|
29
|
+
const target = fileURLToPath(new URL(entry, import.meta.url));
|
|
30
|
+
aliases[name] = target;
|
|
31
|
+
if (name.startsWith("react")) {
|
|
32
|
+
aliases[`next/dist/compiled/${name}`] = target;
|
|
33
|
+
const [pkg, ...rest] = name.split("/");
|
|
34
|
+
aliases[`next/dist/compiled/${pkg}-experimental${rest.length ? "/" + rest.join("/") : ""}`] = target;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const rules = { ...config.turbopack?.rules };
|
|
38
|
+
if (major >= 16)
|
|
39
|
+
rules["*.js"] = rules["*.js"] ? [rules["*.js"]].flat() : [];
|
|
40
|
+
for (const [name, entry] of Object.entries(entries)) {
|
|
41
|
+
const [pkg, subpath = "index"] = name.split("/");
|
|
42
|
+
const loaders = [{
|
|
43
|
+
loader: fileURLToPath(new URL("./loader.cjs", import.meta.url)),
|
|
44
|
+
options: {
|
|
45
|
+
target: fileURLToPath(new URL(entry, import.meta.url)),
|
|
46
|
+
defaultExport: name === "react" || name === "react-dom" || name === "react-dom/client" || name.startsWith("react-dom/server")
|
|
47
|
+
}
|
|
48
|
+
}];
|
|
49
|
+
if (major >= 16) {
|
|
50
|
+
rules["*.js"].push({
|
|
51
|
+
condition: { all: ["browser", { path: new RegExp(`(?:^|/)node_modules/(?:next/dist/compiled/)?${pkg}(?:-experimental)?/${subpath}\\.js$`) }] },
|
|
52
|
+
loaders
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
for (const path of [pkg, `next/dist/compiled/${pkg}`, `next/dist/compiled/${pkg}-experimental`]) {
|
|
56
|
+
const glob = `**/node_modules/${path}/${subpath}.js`;
|
|
57
|
+
if (glob in rules)
|
|
58
|
+
throw new Error(`Conflicting Turbopack rule for ${glob}`);
|
|
59
|
+
rules[glob] = { browser: { loaders } };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const devCacheLoader = version.startsWith("16.2.") ? fileURLToPath(new URL("./dev-cache-loader.cjs", import.meta.url)) : void 0;
|
|
64
|
+
const devCachePath = /(?:^|[/\\])node_modules[/\\]next[/\\]dist[/\\](?:esm[/\\])?client[/\\]dev[/\\]debug-channel\.js$/;
|
|
65
|
+
if (devCacheLoader)
|
|
66
|
+
rules["*.js"].push({
|
|
67
|
+
condition: { all: ["browser", { path: /(?:^|\/)node_modules\/next\/dist\/(?:esm\/)?client\/dev\/debug-channel\.js$/ }, "development"] },
|
|
68
|
+
loaders: [{ loader: devCacheLoader }]
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
...config,
|
|
72
|
+
turbopack: {
|
|
73
|
+
...config.turbopack,
|
|
74
|
+
rules
|
|
75
|
+
},
|
|
76
|
+
webpack(webpackConfig, context) {
|
|
77
|
+
const result = config.webpack ? config.webpack(webpackConfig, context) : webpackConfig;
|
|
78
|
+
if (!context.isServer) {
|
|
79
|
+
if (context.dev && devCacheLoader) {
|
|
80
|
+
result.module ||= {};
|
|
81
|
+
result.module.rules ||= [];
|
|
82
|
+
result.module.rules.push({ test: devCachePath, use: [{ loader: devCacheLoader }] });
|
|
83
|
+
}
|
|
84
|
+
result.plugins ||= [];
|
|
85
|
+
result.plugins.push(new context.webpack.NormalModuleReplacementPlugin(/^(?:react(?:\/.*)?|react-dom(?:\/.*)?|scheduler|next\/dist\/compiled\/react(?:-dom)?(?:-experimental)?(?:\/.*)?)$/, (resource) => {
|
|
86
|
+
if (aliases[resource.request])
|
|
87
|
+
resource.request = aliases[resource.request];
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
withRedact
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/next/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { fileURLToPath } from 'node:url'\nimport { createRequire } from 'node:module'\n\nconst entries: Record<string, string> = {\n react: './react.js',\n 'react/jsx-runtime': '../react/jsx-runtime.js',\n 'react/jsx-dev-runtime': '../react/jsx-runtime.js',\n 'react/compiler-runtime': '../react/compiler-runtime.js',\n 'react-dom': '../dom/index.js',\n 'react-dom/client': './client.js',\n 'react-dom/test-utils': '../dom/test-utils.js',\n 'react-dom/server': '../server/index.js',\n 'react-dom/server.browser': '../server/index.js',\n 'react-dom/server.edge': '../server/index.js',\n 'react-dom/server.node': '../server/index.js',\n 'react-dom/server.bun': '../server/index.js',\n\n scheduler: '../scheduler/index.js',\n}\n\n/** Use Redact in the browser, keeping Next's server rendering and Flight on React. */\nexport function withRedact<T extends Record<string, any> | ((...args: any[]) => any)>(config: T = {} as T): T {\n if (typeof config === 'function') return ((...args: any[]) => withRedact(config(...args))) as T\n if (typeof config.then === 'function') return config.then((value: any) => withRedact(value))\n const version = createRequire(import.meta.url)('next/package.json').version as string\n const [major] = version.split('.').map(Number)\n if (!/^(?:15\\.5|16\\.[0-4])\\.\\d+$/.test(version)) throw new Error(`withRedact supports stable Next.js 15.5 and 16.0 through 16.4, received ${version}`)\n const aliases: Record<string, string> = {}\n for (const [name, entry] of Object.entries(entries)) {\n const target = fileURLToPath(new URL(entry, import.meta.url))\n aliases[name] = target\n if (name.startsWith('react')) {\n aliases[`next/dist/compiled/${name}`] = target\n const [pkg, ...rest] = name.split('/')\n aliases[`next/dist/compiled/${pkg}-experimental${rest.length ? '/' + rest.join('/') : ''}`] = target\n }\n }\n const rules = { ...config.turbopack?.rules }\n if (major! >= 16) rules['*.js'] = rules['*.js'] ? [rules['*.js']].flat() : []\n for (const [name, entry] of Object.entries(entries)) {\n const [pkg, subpath = 'index'] = name.split('/')\n const loaders = [{\n loader: fileURLToPath(new URL('./loader.cjs', import.meta.url)),\n options: {\n target: fileURLToPath(new URL(entry, import.meta.url)),\n defaultExport: name === 'react' || name === 'react-dom' || name === 'react-dom/client' || name.startsWith('react-dom/server'),\n },\n }]\n if (major! >= 16) {\n rules['*.js'].push({\n condition: { all: ['browser', { path: new RegExp(`(?:^|/)node_modules/(?:next/dist/compiled/)?${pkg}(?:-experimental)?/${subpath}\\\\.js$`) }] },\n loaders,\n })\n } else {\n for (const path of [pkg, `next/dist/compiled/${pkg}`, `next/dist/compiled/${pkg}-experimental`]) {\n const glob = `**/node_modules/${path}/${subpath}.js`\n if (glob in rules) throw new Error(`Conflicting Turbopack rule for ${glob}`)\n rules[glob] = { browser: { loaders } }\n }\n }\n }\n const devCacheLoader = version.startsWith('16.2.')\n ? fileURLToPath(new URL('./dev-cache-loader.cjs', import.meta.url))\n : undefined\n const devCachePath = /(?:^|[/\\\\])node_modules[/\\\\]next[/\\\\]dist[/\\\\](?:esm[/\\\\])?client[/\\\\]dev[/\\\\]debug-channel\\.js$/\n if (devCacheLoader) rules['*.js'].push({\n condition: { all: ['browser', { path: /(?:^|\\/)node_modules\\/next\\/dist\\/(?:esm\\/)?client\\/dev\\/debug-channel\\.js$/ }, 'development'] },\n loaders: [{ loader: devCacheLoader }],\n })\n return {\n ...config,\n turbopack: {\n ...config.turbopack,\n rules,\n },\n webpack(webpackConfig: any, context: any) {\n const result = config.webpack ? config.webpack(webpackConfig, context) : webpackConfig\n if (!context.isServer) {\n if (context.dev && devCacheLoader) {\n result.module ||= {}\n result.module.rules ||= []\n result.module.rules.push({ test: devCachePath, use: [{ loader: devCacheLoader }] })\n }\n result.plugins ||= []\n result.plugins.push(new context.webpack.NormalModuleReplacementPlugin(\n /^(?:react(?:\\/.*)?|react-dom(?:\\/.*)?|scheduler|next\\/dist\\/compiled\\/react(?:-dom)?(?:-experimental)?(?:\\/.*)?)$/,\n (resource: { request: string }) => {\n if (aliases[resource.request]) resource.request = aliases[resource.request]!\n },\n ))\n }\n return result\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAE9B,MAAM,UAAkC;EACtC,OAAO;EACP,qBAAqB;EACrB,yBAAyB;EACzB,0BAA0B;EAC1B,aAAa;EACb,oBAAoB;EACpB,wBAAwB;EACxB,oBAAoB;EACpB,4BAA4B;EAC5B,yBAAyB;EACzB,yBAAyB;EACzB,wBAAwB;EAExB,WAAW;;AAIP,SAAU,WAAsE,SAAY,CAAA,GAAO;AACvG,MAAI,OAAO,WAAW;AAAY,YAAQ,IAAI,SAAgB,WAAW,OAAO,GAAG,IAAI,CAAC;AACxF,MAAI,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SAAS,OAAO;QAC5E,CAAC,CACF;MACH;AACA,aAAO;IACT;;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Turbopack applies Next's built-in React aliases after user aliases. Replace
|
|
2
|
+
// the resolved browser entry through its supported loader API instead.
|
|
3
|
+
const { relative, dirname, sep } = require('node:path')
|
|
4
|
+
|
|
5
|
+
module.exports = function redactEntry() {
|
|
6
|
+
const { target, defaultExport } = this.getOptions()
|
|
7
|
+
const path = relative(dirname(this.resourcePath), target).split(sep).join('/')
|
|
8
|
+
const specifier = path.startsWith('.') ? path : './' + path
|
|
9
|
+
return `export * from ${JSON.stringify(specifier)};${defaultExport ? `\nexport { default } from ${JSON.stringify(specifier)};` : ''}`
|
|
10
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export * from "../react/index.js";
|
|
2
|
+
export declare const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: import("../react/shared-internals.js").SharedInternals;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: import("../react/shared-internals.js").SharedInternals;
|
|
5
|
+
act: <T>(callback: () => T | Promise<T>) => PromiseLike<T>;
|
|
6
|
+
version: string;
|
|
7
|
+
captureOwnerStack?: () => string | null;
|
|
8
|
+
createElement: typeof import("./react.js").createElement;
|
|
9
|
+
cloneElement: typeof import("./react.js").cloneElement;
|
|
10
|
+
isValidElement: typeof import("./react.js").isValidElement;
|
|
11
|
+
createRef: typeof import("./react.js").createRef;
|
|
12
|
+
Fragment: (props: {
|
|
13
|
+
children?: import("./react.js").ReactNode;
|
|
14
|
+
key?: string | number;
|
|
15
|
+
ref?: import("./react.js").Ref<import("./react.js").FragmentInstance>;
|
|
16
|
+
}) => import("./react.js").ReactElement;
|
|
17
|
+
useState: typeof import("./react.js").useState;
|
|
18
|
+
useReducer: typeof import("./react.js").useReducer;
|
|
19
|
+
useEffect: typeof import("./react.js").useEffect;
|
|
20
|
+
useLayoutEffect: typeof import("./react.js").useLayoutEffect;
|
|
21
|
+
useInsertionEffect: typeof import("./react.js").useInsertionEffect;
|
|
22
|
+
useRef: typeof import("./react.js").useRef;
|
|
23
|
+
useMemo: typeof import("./react.js").useMemo;
|
|
24
|
+
useCallback: typeof import("./react.js").useCallback;
|
|
25
|
+
useContext: typeof import("./react.js").useContext;
|
|
26
|
+
useImperativeHandle: typeof import("./react.js").useImperativeHandle;
|
|
27
|
+
useDebugValue: typeof import("./react.js").useDebugValue;
|
|
28
|
+
useId: typeof import("./react.js").useId;
|
|
29
|
+
useTransition: typeof import("./react.js").useTransition;
|
|
30
|
+
useDeferredValue: typeof import("./react.js").useDeferredValue;
|
|
31
|
+
useSyncExternalStore: typeof import("./react.js").useSyncExternalStore;
|
|
32
|
+
useSyncExternalStoreWithSelector: typeof import("./react.js").useSyncExternalStoreWithSelector;
|
|
33
|
+
use: typeof import("./react.js").use;
|
|
34
|
+
useActionState: typeof import("./react.js").useActionState;
|
|
35
|
+
useFormStatus: typeof import("./react.js").useFormStatus;
|
|
36
|
+
useOptimistic: typeof import("./react.js").useOptimistic;
|
|
37
|
+
useEffectEvent: typeof import("./react.js").useEffectEvent;
|
|
38
|
+
startTransition: typeof import("./react.js").startTransition;
|
|
39
|
+
unstable_useCacheRefresh: typeof import("./react.js").unstable_useCacheRefresh;
|
|
40
|
+
createContext: typeof import("./react.js").createContext;
|
|
41
|
+
Component: import("../react/class.js").ComponentConstructor;
|
|
42
|
+
PureComponent: import("../react/class.js").ComponentConstructor;
|
|
43
|
+
memo: typeof import("./react.js").memo;
|
|
44
|
+
forwardRef: typeof import("./react.js").forwardRef;
|
|
45
|
+
lazy: typeof import("./react.js").lazy;
|
|
46
|
+
Suspense: (props: {
|
|
47
|
+
children?: any;
|
|
48
|
+
fallback?: any;
|
|
49
|
+
}) => any;
|
|
50
|
+
StrictMode: (props: {
|
|
51
|
+
children?: any;
|
|
52
|
+
}) => any;
|
|
53
|
+
Profiler: (props: {
|
|
54
|
+
id: string;
|
|
55
|
+
onRender?: any;
|
|
56
|
+
children?: any;
|
|
57
|
+
}) => any;
|
|
58
|
+
Children: {
|
|
59
|
+
map(children: import("./react.js").ReactNode, fn: (child: import("./react.js").ReactNode, index: number) => any): any[] | null;
|
|
60
|
+
forEach(children: import("./react.js").ReactNode, fn: (child: import("./react.js").ReactNode, index: number) => void): void;
|
|
61
|
+
count(children: import("./react.js").ReactNode): number;
|
|
62
|
+
toArray(children: import("./react.js").ReactNode): any[];
|
|
63
|
+
only(children: import("./react.js").ReactNode): import("./react.js").ReactElement;
|
|
64
|
+
};
|
|
65
|
+
ViewTransition: (props: import("./react.js").ViewTransitionProps) => any;
|
|
66
|
+
Activity: (props: import("./react.js").ActivityProps) => any;
|
|
67
|
+
addTransitionType: typeof import("./react.js").addTransitionType;
|
|
68
|
+
cache: <T extends Function>(fn: T) => T;
|
|
69
|
+
cacheSignal: () => AbortSignal | null;
|
|
70
|
+
};
|
|
71
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactSharedInternals } from "../react/index.js";
|
|
2
|
+
export * from "../react/index.js";
|
|
3
|
+
const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
4
|
+
var react_default = { ...React, __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE };
|
|
5
|
+
export {
|
|
6
|
+
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
7
|
+
react_default as default
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/next/react.ts"],
|
|
4
|
+
"sourcesContent": ["import React, { ReactSharedInternals } from '../react'\n\nexport * from '../react'\n\n// Next's Flight decoder uses this object for development stack tracking.\nexport const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals\nexport default { ...React, __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE }\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,4BAA4B;AAE5C,cAAc;AAGP,MAAM,kEAAkE;AAC/E,IAAA,gBAAe,EAAE,GAAG,OAAO,gEAA+D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { isFunction } from "../core/functions.js";
|
|
2
|
+
import { ReactSharedInternals } from "./shared-internals.js";
|
|
3
|
+
let depth = 0;
|
|
4
|
+
let flushing = false;
|
|
5
|
+
const immediate = process.env.NODE_ENV !== "production" ? globalThis.setImmediate : void 0;
|
|
6
|
+
const timeout = process.env.NODE_ENV !== "production" ? setTimeout : void 0;
|
|
7
|
+
function flush(queue) {
|
|
8
|
+
if (flushing)
|
|
9
|
+
return;
|
|
10
|
+
flushing = true;
|
|
11
|
+
try {
|
|
12
|
+
while (queue.length)
|
|
13
|
+
queue.shift()();
|
|
14
|
+
} finally {
|
|
15
|
+
flushing = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function nextTask(callback) {
|
|
19
|
+
if (immediate)
|
|
20
|
+
immediate(callback);
|
|
21
|
+
else if (typeof MessageChannel !== "undefined") {
|
|
22
|
+
const channel = new MessageChannel();
|
|
23
|
+
channel.port1.onmessage = () => {
|
|
24
|
+
channel.port1.close();
|
|
25
|
+
channel.port2.close();
|
|
26
|
+
callback();
|
|
27
|
+
};
|
|
28
|
+
channel.port2.postMessage(null);
|
|
29
|
+
} else
|
|
30
|
+
timeout(callback, 0);
|
|
31
|
+
}
|
|
32
|
+
function drain(queue) {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const step = () => {
|
|
35
|
+
try {
|
|
36
|
+
flush(queue);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
reject(error);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
nextTask(() => {
|
|
42
|
+
if (queue.length)
|
|
43
|
+
step();
|
|
44
|
+
else
|
|
45
|
+
resolve();
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
step();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const act = process.env.NODE_ENV === "production" ? () => {
|
|
52
|
+
throw new Error();
|
|
53
|
+
} : actDevelopment;
|
|
54
|
+
function actDevelopment(callback) {
|
|
55
|
+
const outermost = depth === 0;
|
|
56
|
+
const previous = ReactSharedInternals.A ?? null;
|
|
57
|
+
const queue = ReactSharedInternals.A ||= [];
|
|
58
|
+
depth++;
|
|
59
|
+
let result;
|
|
60
|
+
let exited = false;
|
|
61
|
+
const leave = () => {
|
|
62
|
+
if (exited)
|
|
63
|
+
return;
|
|
64
|
+
exited = true;
|
|
65
|
+
depth--;
|
|
66
|
+
if (!depth)
|
|
67
|
+
ReactSharedInternals.A = previous;
|
|
68
|
+
};
|
|
69
|
+
try {
|
|
70
|
+
result = callback();
|
|
71
|
+
} catch (error) {
|
|
72
|
+
leave();
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
if (result && isFunction(result.then)) {
|
|
76
|
+
return {
|
|
77
|
+
then(resolve, reject) {
|
|
78
|
+
const fail = (error) => {
|
|
79
|
+
leave();
|
|
80
|
+
if (reject)
|
|
81
|
+
return reject(error);
|
|
82
|
+
throw error;
|
|
83
|
+
};
|
|
84
|
+
return result.then((value) => {
|
|
85
|
+
const finish = () => {
|
|
86
|
+
leave();
|
|
87
|
+
return resolve ? resolve(value) : value;
|
|
88
|
+
};
|
|
89
|
+
return depth === 1 ? drain(queue).then(finish, fail) : finish();
|
|
90
|
+
}, fail);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
if (depth === 1)
|
|
96
|
+
flush(queue);
|
|
97
|
+
} finally {
|
|
98
|
+
leave();
|
|
99
|
+
}
|
|
100
|
+
let completion;
|
|
101
|
+
return {
|
|
102
|
+
then(resolve, reject) {
|
|
103
|
+
if (!outermost)
|
|
104
|
+
return Promise.resolve(result).then(resolve, reject);
|
|
105
|
+
completion ||= (async () => {
|
|
106
|
+
const prior = ReactSharedInternals.A ?? null;
|
|
107
|
+
ReactSharedInternals.A = queue;
|
|
108
|
+
depth++;
|
|
109
|
+
try {
|
|
110
|
+
await drain(queue);
|
|
111
|
+
return result;
|
|
112
|
+
} finally {
|
|
113
|
+
depth--;
|
|
114
|
+
ReactSharedInternals.A = prior;
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
return completion.then(resolve, reject);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
act
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=act.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react/act.ts"],
|
|
4
|
+
"sourcesContent": ["import { isFunction } from '../core/functions'\nimport { ReactSharedInternals } from './shared-internals'\n\nlet depth = 0\nlet flushing = false\nconst immediate = process.env.NODE_ENV !== 'production' ? (globalThis as any).setImmediate : undefined\nconst timeout = process.env.NODE_ENV !== 'production' ? setTimeout : undefined\n\nfunction flush(queue: Array<() => void>): void {\n if (flushing) return\n flushing = true\n try {\n while (queue.length) queue.shift()!()\n } finally {\n flushing = false\n }\n}\n\n// Use a host task so promise continuations can enqueue renderer work first.\n// Close MessageChannel ports after each task so tests can exit normally.\nfunction nextTask(callback: () => void): void {\n if (immediate) immediate(callback)\n else if (typeof MessageChannel !== 'undefined') {\n const channel = new MessageChannel()\n channel.port1.onmessage = () => {\n channel.port1.close()\n channel.port2.close()\n callback()\n }\n channel.port2.postMessage(null)\n } else timeout!(callback, 0)\n}\n\nfunction drain(queue: Array<() => void>): Promise<void> {\n return new Promise((resolve, reject) => {\n const step = () => {\n try { flush(queue) } catch (error) { reject(error); return }\n nextTask(() => {\n if (queue.length) step()\n else resolve()\n })\n }\n step()\n })\n}\n\nexport const act: typeof actDevelopment = process.env.NODE_ENV === 'production'\n ? () => { throw new Error() }\n : actDevelopment\n\nfunction actDevelopment<T>(callback: () => T | Promise<T>): PromiseLike<T> {\n const outermost = depth === 0\n const previous = ReactSharedInternals.A ?? null\n const queue = ReactSharedInternals.A ||= []\n depth++\n let result: T | Promise<T>\n let exited = false\n const leave = () => {\n if (exited) return\n exited = true\n depth--\n if (!depth) ReactSharedInternals.A = previous\n }\n try {\n result = callback()\n } catch (error) {\n leave()\n throw error\n }\n if (result && isFunction((result as Promise<T>).then)) {\n return {\n then(resolve, reject) {\n const fail = (error: unknown) => {\n leave()\n if (reject) return reject(error)\n throw error\n }\n return (result as Promise<T>).then(value => {\n const finish = () => {\n leave()\n return resolve ? resolve(value) : value\n }\n return depth === 1 ? drain(queue).then(finish, fail) : finish()\n }, fail)\n },\n } as PromiseLike<T>\n }\n\n try { if (depth === 1) flush(queue) }\n finally { leave() }\n let completion: Promise<T> | undefined\n return {\n then(resolve, reject) {\n if (!outermost) return Promise.resolve(result as T).then(resolve, reject)\n completion ||= (async () => {\n const prior = ReactSharedInternals.A ?? null\n ReactSharedInternals.A = queue\n depth++\n try { await drain(queue); return result as T }\n finally { depth--; ReactSharedInternals.A = prior }\n })()\n return completion.then(resolve, reject)\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B;AAErC,IAAI,QAAQ;AACZ,IAAI,WAAW;AACf,MAAM,YAAY,yBAAyB,eAAgB,WAAmB,eAAe;AAC7F,MAAM,UAAU,yBAAyB,eAAe,aAAa;AAErE,SAAS,MAAM,OAAwB;AACrC,MAAI;AAAU;AACd,aAAW;AACX,MAAI;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AQ,OAAsB,KAAK,WAAQ;AACzC,gBAAM,SAAS,MAAK;AAClB,kBAAK;AACL,mBAAO,UAAU,QAAQ,KAAK,IAAI;UACpC;AACA,iBAAO,UAAU,IAAI,MAAM,KAAK,EAAE,KAAK,QAAQ,IAAI,IAAI,OAAM;QAC/D,GAAG,IAAI;MACT;;EAEJ;AAEA,MAAI;AAAE,QAAI,UAAU;AAAG,YAAM,KAAK;EAAE;AAC1B,UAAK;EAAG;AAClB,MAAI;AACJ,SAAO;IACL,KAAK,SAAS,QAAM;AAClB,UAAI,CAAC;AAAW,eAAO,QAAQ,QAAQ,MAAW,EAAE,KAAK,SAAS,MAAM;AACxE,sBAAgB,YAAW;AACzB,cAAM,QAAQ,qBAAqB,KAAK;AACxC,6BAAqB,IAAI;AACzB;AACA,YAAI;AAAE,gBAAM,MAAM,KAAK;AAAG,iBAAO;QAAY;AACnC;AAAS,+BAAqB,IAAI;QAAM;MACpD,GAAE;AACF,aAAO,WAAW,KAAK,SAAS,MAAM;IACxC;;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FiberRoot } from '../core/index.js';
|
|
2
|
+
export interface ActionScope {
|
|
3
|
+
o?: FiberRoot | null | undefined;
|
|
4
|
+
v?: number;
|
|
5
|
+
n?: ((scope: ActionScope) => void) | undefined;
|
|
6
|
+
p: number;
|
|
7
|
+
d: Promise<void>;
|
|
8
|
+
r: () => void;
|
|
9
|
+
e?: unknown;
|
|
10
|
+
h?: boolean;
|
|
11
|
+
f: boolean;
|
|
12
|
+
l: Set<() => void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function trackAction(scope: ActionScope, promise: PromiseLike<unknown>, nested?: ActionScope): void;
|
|
15
|
+
export declare function finish(scope: ActionScope): void;
|
|
16
|
+
export declare function runAction(callback: () => unknown, owner?: FiberRoot | null, notify?: (scope: ActionScope) => void): ActionScope;
|
|
17
|
+
export declare function withinAction<T>(scope: ActionScope | null | undefined, callback: () => T): T;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactSharedInternals } from "./shared-internals.js";
|
|
2
|
+
import { isThenable } from "../core/functions.js";
|
|
3
|
+
function trackAction(scope, promise, nested) {
|
|
4
|
+
scope.p++;
|
|
5
|
+
Promise.resolve(promise).then(() => {
|
|
6
|
+
if (nested?.f) {
|
|
7
|
+
scope.e = nested.e;
|
|
8
|
+
scope.f = true;
|
|
9
|
+
}
|
|
10
|
+
finish(scope);
|
|
11
|
+
}, (error) => {
|
|
12
|
+
scope.e = error;
|
|
13
|
+
scope.f = true;
|
|
14
|
+
finish(scope);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function finish(scope) {
|
|
18
|
+
if (--scope.p !== 0)
|
|
19
|
+
return;
|
|
20
|
+
for (const listener of scope.l)
|
|
21
|
+
listener();
|
|
22
|
+
scope.l.clear();
|
|
23
|
+
scope.r();
|
|
24
|
+
}
|
|
25
|
+
function runAction(callback, owner, notify) {
|
|
26
|
+
const previous = ReactSharedInternals.B;
|
|
27
|
+
let resolve;
|
|
28
|
+
const done = new Promise((yes) => {
|
|
29
|
+
resolve = yes;
|
|
30
|
+
});
|
|
31
|
+
const scope = { p: 1, d: done, r: resolve, f: false, l: /* @__PURE__ */ new Set(), o: owner ?? previous?.o, n: notify };
|
|
32
|
+
try {
|
|
33
|
+
const result = withinAction(scope, callback);
|
|
34
|
+
if (isThenable(result))
|
|
35
|
+
trackAction(scope, result);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
scope.f = true;
|
|
38
|
+
scope.e = error;
|
|
39
|
+
} finally {
|
|
40
|
+
finish(scope);
|
|
41
|
+
}
|
|
42
|
+
if (previous && scope.p > 0)
|
|
43
|
+
trackAction(previous, done, scope);
|
|
44
|
+
return scope;
|
|
45
|
+
}
|
|
46
|
+
function withinAction(scope, callback) {
|
|
47
|
+
const previous = ReactSharedInternals.B;
|
|
48
|
+
ReactSharedInternals.B = scope;
|
|
49
|
+
try {
|
|
50
|
+
return callback();
|
|
51
|
+
} finally {
|
|
52
|
+
ReactSharedInternals.B = previous;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
finish,
|
|
57
|
+
runAction,
|
|
58
|
+
trackAction,
|
|
59
|
+
withinAction
|
|
60
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react/action-scope.ts"],
|
|
4
|
+
"sourcesContent": ["import { ReactSharedInternals } from './shared-internals'\nimport { isThenable } from '../core/functions'\n// Action lifetimes are separate from transition types used by ViewTransition.\nexport interface ActionScope {\n v?: number\n n?: () => void\n p: number\n d: Promise<void>\n r: () => void\n e?: unknown\n h?: boolean\n f: boolean\n l: Set<() => void>\n}\n\nexport function trackAction(scope: ActionScope, promise: PromiseLike<unknown>, nested?: ActionScope): void {\n scope.p++\n Promise.resolve(promise).then(() => {\n if (nested?.f) { scope.e = nested.e; scope.f = true }\n finish(scope)\n }, error => {\n scope.e = error\n scope.f = true\n finish(scope)\n })\n}\nexport function finish(scope: ActionScope): void {\n if (--scope.p !== 0) return\n for (const listener of scope.l) listener()\n scope.l.clear()\n scope.r()\n}\nexport function runAction(callback: () => unknown): ActionScope {\n const previous = ReactSharedInternals.B\n let resolve!: () => void\n const done = new Promise<void>(yes => { resolve = yes })\n const scope: ActionScope = { p: 1, d: done, r: resolve, f: false, l: new Set() }\n try {\n const result = withinAction(scope, callback)\n if (isThenable(result)) trackAction(scope, result as PromiseLike<unknown>)\n } catch (error) {\n scope.f = true\n scope.e = error\n } finally {\n finish(scope)\n }\n if (previous && scope.p > 0) trackAction(previous, done, scope)\n return scope\n}\n\nexport function withinAction<T>(scope: ActionScope | null | undefined, callback: () => T): T {\n const previous = ReactSharedInternals.B\n ReactSharedInternals.B = scope\n try { return callback() } finally { ReactSharedInternals.B = previous }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B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actNode } from '../core'\n\nexport const REACT_ACTIVITY_TYPE = Symbol.for('react.activity')\n\nexport interface ActivityProps {\n children?: ReactNode\n mode?: 'hidden' | 'visible'\n}\n\nexport const Activity = REACT_ACTIVITY_TYPE as any as (props: ActivityProps) => any\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,sBAAsB,uBAAO,IAAI,gBAAgB;AAOvD,MAAM,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode, ReactElement } from "../core/index.js";
|
|
2
|
+
export declare const Children: {
|
|
3
|
+
map(children: ReactNode, fn: (child: ReactNode, index: number) => any): any[] | null;
|
|
4
|
+
forEach(children: ReactNode, fn: (child: ReactNode, index: number) => void): void;
|
|
5
|
+
count(children: ReactNode): number;
|
|
6
|
+
toArray(children: ReactNode): any[];
|
|
7
|
+
only(children: ReactNode): ReactElement;
|
|
8
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { isValidElement, cloneElement } from "./element.js";
|
|
2
|
+
function flatten(node, out) {
|
|
3
|
+
if (node == null || typeof node === "boolean")
|
|
4
|
+
return;
|
|
5
|
+
if (Array.isArray(node)) {
|
|
6
|
+
for (let i = 0; i < node.length; i++)
|
|
7
|
+
flatten(node[i], out);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
out.push(node);
|
|
11
|
+
}
|
|
12
|
+
function getKey(node, index, prefix) {
|
|
13
|
+
if (isValidElement(node) && node.key != null)
|
|
14
|
+
return prefix + "$" + node.key;
|
|
15
|
+
return prefix + ":" + index;
|
|
16
|
+
}
|
|
17
|
+
function mapChildren(children, fn, prefix = "") {
|
|
18
|
+
const flat = [];
|
|
19
|
+
flatten(children, flat);
|
|
20
|
+
const out = [];
|
|
21
|
+
for (let i = 0; i < flat.length; i++) {
|
|
22
|
+
const child = flat[i];
|
|
23
|
+
const mapped = fn(child, i);
|
|
24
|
+
if (mapped == null)
|
|
25
|
+
continue;
|
|
26
|
+
if (Array.isArray(mapped)) {
|
|
27
|
+
for (let j = 0; j < mapped.length; j++) {
|
|
28
|
+
const m = mapped[j];
|
|
29
|
+
if (m == null)
|
|
30
|
+
continue;
|
|
31
|
+
out.push(isValidElement(m) && m.key == null ? cloneElement(m, { key: getKey(child, i, prefix) + "/" + j }) : m);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
out.push(isValidElement(mapped) && mapped.key == null ? cloneElement(mapped, { key: getKey(child, i, prefix) }) : mapped);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
const Children = {
|
|
40
|
+
map(children, fn) {
|
|
41
|
+
if (children == null)
|
|
42
|
+
return null;
|
|
43
|
+
return mapChildren(children, fn);
|
|
44
|
+
},
|
|
45
|
+
forEach(children, fn) {
|
|
46
|
+
if (children == null)
|
|
47
|
+
return;
|
|
48
|
+
mapChildren(children, (c, i) => {
|
|
49
|
+
fn(c, i);
|
|
50
|
+
return null;
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
count(children) {
|
|
54
|
+
const flat = [];
|
|
55
|
+
flatten(children, flat);
|
|
56
|
+
return flat.length;
|
|
57
|
+
},
|
|
58
|
+
toArray(children) {
|
|
59
|
+
const flat = [];
|
|
60
|
+
flatten(children, flat);
|
|
61
|
+
return flat.map((c, i) => isValidElement(c) && c.key == null ? cloneElement(c, { key: "" + i }) : c);
|
|
62
|
+
},
|
|
63
|
+
only(children) {
|
|
64
|
+
if (!isValidElement(children)) {
|
|
65
|
+
if (process.env.NODE_ENV !== "production") {
|
|
66
|
+
throw new Error("Children.only expected a single React element.");
|
|
67
|
+
}
|
|
68
|
+
throw new Error();
|
|
69
|
+
}
|
|
70
|
+
return children;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
Children
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=children.js.map
|