@yahoo/uds-v5-wip 1.58.0 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/dist/createConfig.js +1 -1
- package/dist/core/dist/compositeStyles.d.ts +2 -1
- package/dist/core/dist/configurable-prop-helpers.d.ts +2 -1
- package/dist/core/dist/createComponent.d.ts +2 -1
- package/dist/core/dist/createComponentExample.d.ts +2 -1
- package/dist/core/dist/createProvider.d.ts +2 -1
- package/dist/core/dist/generated/stylePropsTwMap.d.ts +2 -1
- package/dist/core/dist/getComponentStyles.d.ts +2 -1
- package/dist/core/dist/getStyles.d.ts +2 -1
- package/dist/core/dist/modifier-mappings.d.ts +2 -1
- package/dist/core/dist/resolveMotionState.d.ts +2 -1
- package/dist/core/dist/style-prop-data.d.ts +2 -1
- package/dist/core/dist/transformPreset.d.ts +2 -1
- package/dist/core/dist/withDefaultStyleProps.d.ts +2 -1
- package/dist/loader/dist/_virtual/_rolldown/runtime.js +6 -0
- package/dist/loader/dist/loader/create-component-lowering.js +1 -1
- package/dist/loader/dist/loader/data-attr-transform.js +1 -1
- package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -28
- package/dist/loader/dist/loader/style-transform.js +4 -4
- package/dist/loader/dist/loader.d.ts +2 -1
- package/dist/loader/dist/loader.js +3 -3
- package/dist/loader/dist/next.d.ts +2 -1
- package/dist/loader/dist/next.js +1 -1
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +203 -0
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +25 -0
- package/dist/loader/dist/node_modules/react/cjs/react.development.js +762 -0
- package/dist/loader/dist/node_modules/react/cjs/react.production.js +351 -0
- package/dist/loader/dist/node_modules/react/index.js +10 -0
- package/dist/loader/dist/node_modules/react/jsx-runtime.js +10 -0
- package/dist/loader/dist/packages/core/dist/color-opacity-map.js +33 -0
- package/dist/loader/dist/packages/core/dist/compositeStyles.js +43 -0
- package/dist/loader/dist/packages/core/dist/createComponent.js +6 -0
- package/dist/loader/dist/packages/core/dist/createProvider.js +7 -0
- package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +570 -0
- package/dist/loader/dist/packages/core/dist/getComponentStyles.js +2 -0
- package/dist/loader/dist/packages/core/dist/getStyles.js +60 -0
- package/dist/loader/dist/packages/core/dist/index.js +6 -0
- package/dist/loader/dist/packages/core/dist/modifier-mappings.js +61 -0
- package/dist/loader/dist/packages/core/dist/style-prop-data.js +1257 -0
- package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +1 -0
- package/dist/loader.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/_virtual/_rolldown/runtime.js +0 -7
|
@@ -4,9 +4,9 @@ import "../../utils/dist/index.js";
|
|
|
4
4
|
import { getConfigurablePropMapping } from "../../core/dist/configurable-prop-helpers.js";
|
|
5
5
|
import "../../core/dist/index.js";
|
|
6
6
|
import { buildMotionReference, resolveComponentMotionAliases, validateComponentVariants } from "./component-resolution.js";
|
|
7
|
-
import { applyPresetToData, deepMerge, mergeAtomic } from "./preset-merge.js";
|
|
8
7
|
import { resolveTokenType, sniffTokenTypeFromValue } from "./resolveTokenTypes.js";
|
|
9
8
|
import { resolveStyleProp } from "./resolveStyleProp.js";
|
|
9
|
+
import { applyPresetToData, deepMerge, mergeAtomic } from "./preset-merge.js";
|
|
10
10
|
import { setRegisteredStyleProps } from "./runtime-registry.js";
|
|
11
11
|
//#region ../config/dist/createConfig.js
|
|
12
12
|
/** biome-ignore-all lint/suspicious/noExplicitAny: necessary for dynamic builder to work correctly */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CompositeStylesConfig } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/compositeStyles.d.ts
|
|
4
|
+
//#region src/compositeStyles.d.ts
|
|
4
5
|
/** Set the composite-styles config (called by loader at build time) */
|
|
5
6
|
declare function setCompositeStylesConfig(config: CompositeStylesConfig): void;
|
|
6
7
|
/** Get the current composite-styles config */
|
|
@@ -16,6 +17,6 @@ declare function getCompositeStylesConfig(): CompositeStylesConfig;
|
|
|
16
17
|
declare function expandCompositeStyles(props: Record<string, unknown>, config?: CompositeStylesConfig): {
|
|
17
18
|
expanded: Record<string, unknown>;
|
|
18
19
|
markerClasses: string[];
|
|
19
|
-
};
|
|
20
|
+
}; //#endregion
|
|
20
21
|
//#endregion
|
|
21
22
|
export { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig };
|
|
@@ -2,6 +2,7 @@ import { PropMapping } from "./style-prop-data.js";
|
|
|
2
2
|
import { ConfigurableProp } from "@uds/types";
|
|
3
3
|
|
|
4
4
|
//#region ../core/dist/configurable-prop-helpers.d.ts
|
|
5
|
+
//#region src/configurable-prop-helpers.d.ts
|
|
5
6
|
/** Look up a {@link PropMapping} by ConfigurableProp name. */
|
|
6
7
|
declare function getConfigurablePropMapping(prop: ConfigurableProp): PropMapping | undefined;
|
|
7
8
|
interface ConfigurablePropertyEntry {
|
|
@@ -26,6 +27,6 @@ interface CssVariablePrefixEntry {
|
|
|
26
27
|
* Only includes props that have both `cssProperty` and `defaultVarPrefix`.
|
|
27
28
|
* Deduplicates by `defaultVarPrefix` so each namespace appears once.
|
|
28
29
|
*/
|
|
29
|
-
declare function getCssVariablePrefixes(): CssVariablePrefixEntry[];
|
|
30
|
+
declare function getCssVariablePrefixes(): CssVariablePrefixEntry[]; //#endregion
|
|
30
31
|
//#endregion
|
|
31
32
|
export { ConfigurablePropertyEntry, CssVariablePrefixEntry, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CreateComponentConfig, CreateComponentProps, CreateComponentRenderFn, CreateComponentSlotTagConfig, CreateComponentTypeInput } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/createComponent.d.ts
|
|
4
|
+
//#region src/createComponent.d.ts
|
|
4
5
|
type PrimitiveTag = keyof React.JSX.IntrinsicElements;
|
|
5
6
|
type SpecConfig<TSpec> = TSpec extends {
|
|
6
7
|
config: infer TConfig extends CreateComponentTypeInput;
|
|
@@ -51,6 +52,6 @@ declare function createComponent<TSpecOrProps = {}>(tag: PrimitiveTag): React.FC
|
|
|
51
52
|
props: infer TOwnProps;
|
|
52
53
|
} ? CreateComponentProps<TConfig, TOwnProps, PrimitiveTag> : PrimitiveOwnProps<TSpecOrProps>>;
|
|
53
54
|
declare function createComponent<TSpec>(renderFn: CreateComponentRenderFn<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>): React.FC<CreateComponentProps<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>>;
|
|
54
|
-
declare function createComponent(config: CreateComponentConfig<string>, renderFn: CreateComponentRenderFn<any, any, any>): React.FC<any>;
|
|
55
|
+
declare function createComponent(config: CreateComponentConfig<string>, renderFn: CreateComponentRenderFn<any, any, any>): React.FC<any>; //#endregion
|
|
55
56
|
//#endregion
|
|
56
57
|
export { createComponent };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, ComponentType } from "react";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/createComponentExample.d.ts
|
|
4
|
+
//#region src/createComponentExample.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Extracts variant fixtures from a Component's props type.
|
|
6
7
|
* If Button has `variant?: 'brand' | 'outline'` and `size?: 'sm' | 'md'`,
|
|
@@ -36,6 +37,6 @@ type ExamplesResult<TComponent extends ComponentType<any>> = {
|
|
|
36
37
|
* }));
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
|
-
declare function createComponentExample<TComponent extends ComponentType<any>, T extends Record<string, ExampleFn<TComponent>>>(Component: TComponent, examplesFn: (fixtures: VariantFixtures<TComponent>) => ExamplesResult<TComponent>): ComponentExample<T>;
|
|
40
|
+
declare function createComponentExample<TComponent extends ComponentType<any>, T extends Record<string, ExampleFn<TComponent>>>(Component: TComponent, examplesFn: (fixtures: VariantFixtures<TComponent>) => ExamplesResult<TComponent>): ComponentExample<T>; //#endregion
|
|
40
41
|
//#endregion
|
|
41
42
|
export { ComponentExample, createComponentExample };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region ../core/dist/createProvider.d.ts
|
|
2
|
+
//#region src/createProvider.d.ts
|
|
2
3
|
type ProviderRenderFn<TContext, TProps = Record<never, never>> = (props: {
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
} & TProps) => {
|
|
@@ -7,6 +8,6 @@ type ProviderRenderFn<TContext, TProps = Record<never, never>> = (props: {
|
|
|
7
8
|
};
|
|
8
9
|
declare function createProvider<TContext, TProps = Record<never, never>>(name: string, renderFn: ProviderRenderFn<TContext, TProps>): [React.FC<{
|
|
9
10
|
children: React.ReactNode;
|
|
10
|
-
} & TProps>, () => TContext];
|
|
11
|
+
} & TProps>, () => TContext]; //#endregion
|
|
11
12
|
//#endregion
|
|
12
13
|
export { createProvider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region ../core/dist/generated/stylePropsTwMap.d.ts
|
|
2
|
+
//#region src/generated/stylePropsTwMap.d.ts
|
|
2
3
|
declare const stylePropsTwMap: {
|
|
3
4
|
readonly "border-boolean": {
|
|
4
5
|
readonly border: "boolean";
|
|
@@ -1695,6 +1696,6 @@ declare const stylePropsTwMap: {
|
|
|
1695
1696
|
readonly "hyphens-manual": {
|
|
1696
1697
|
readonly hyphens: "manual";
|
|
1697
1698
|
};
|
|
1698
|
-
};
|
|
1699
|
+
}; //#endregion
|
|
1699
1700
|
//#endregion
|
|
1700
1701
|
export { stylePropsTwMap };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentRegistry, ComponentSlotsOf, ComponentVariantsOf } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/getComponentStyles.d.ts
|
|
4
|
+
//#region src/getComponentStyles.d.ts
|
|
4
5
|
type ResolveSlots<Name extends string> = Name extends keyof ComponentRegistry ? ComponentSlotsOf<Name> : string;
|
|
5
6
|
type ResolveVariants<Name extends string> = Name extends keyof ComponentRegistry ? ComponentVariantsOf<Name> : Record<string, string>;
|
|
6
7
|
interface UdsRuntimeMeta {
|
|
@@ -44,6 +45,6 @@ interface ComponentStyler<Name extends string> {
|
|
|
44
45
|
* @param slots - Array of slot names
|
|
45
46
|
* @param element - Optional HTML element tag for element-specific prop forwarding
|
|
46
47
|
*/
|
|
47
|
-
declare function createComponentStyler<Name extends string>(componentName: Name, slots: readonly string[], element?: string, variants?: readonly string[]): ComponentStyler<Name>;
|
|
48
|
+
declare function createComponentStyler<Name extends string>(componentName: Name, slots: readonly string[], element?: string, variants?: readonly string[]): ComponentStyler<Name>; //#endregion
|
|
48
49
|
//#endregion
|
|
49
50
|
export { createComponentStyler };
|
|
@@ -2,6 +2,7 @@ import { ClassValue } from "clsx";
|
|
|
2
2
|
import { ModifierProp, ModifierProps, StyleAndModifierProps, StyleProps } from "@uds/types";
|
|
3
3
|
|
|
4
4
|
//#region ../core/dist/getStyles.d.ts
|
|
5
|
+
//#region src/getStyles.d.ts
|
|
5
6
|
/** Convert kebab-case CSS property to camelCase for React inline styles.
|
|
6
7
|
* CSS custom properties (--*) are kept as-is since React supports them verbatim. */
|
|
7
8
|
declare function toCamelCase(str: string): string;
|
|
@@ -37,6 +38,6 @@ interface GetStylesParams extends StyleProps, ModifierProps {
|
|
|
37
38
|
* so they can be included in the CSS safelist.
|
|
38
39
|
*/
|
|
39
40
|
declare function getStyles(props: GetStylesParams): string;
|
|
40
|
-
declare function getVariantClassName(componentName: string, variant: string | undefined): string;
|
|
41
|
+
declare function getVariantClassName(componentName: string, variant: string | undefined): string; //#endregion
|
|
41
42
|
//#endregion
|
|
42
43
|
export { createVariants, cx, getStyles, getVariantClassName, processStyleProps, toCamelCase };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ModifierProp } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/modifier-mappings.d.ts
|
|
4
|
+
//#region src/modifier-mappings.d.ts
|
|
4
5
|
declare const modifierMappings: Record<ModifierProp, string>;
|
|
5
6
|
interface ModifierEntry {
|
|
6
7
|
prop: string;
|
|
7
8
|
cssSelector: string;
|
|
8
9
|
category: string;
|
|
9
10
|
description: string;
|
|
10
|
-
}
|
|
11
|
+
} //#endregion
|
|
11
12
|
//#endregion
|
|
12
13
|
export { ModifierEntry, modifierMappings };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region ../core/dist/resolveMotionState.d.ts
|
|
2
|
-
|
|
2
|
+
//#region src/resolveMotionState.d.ts
|
|
3
|
+
declare function resolveMotionState(stateKeyframe: Record<string, unknown>, index: number): Record<string, number>; //#endregion
|
|
3
4
|
//#endregion
|
|
4
5
|
export { resolveMotionState };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleProp } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/style-prop-data.d.ts
|
|
4
|
+
//#region src/style-prop-data.d.ts
|
|
4
5
|
interface PropMapping {
|
|
5
6
|
/** Class name prefix for runtime class generation. 'no-prefix' means value IS the class. */
|
|
6
7
|
classPrefix: string;
|
|
@@ -27,6 +28,6 @@ interface PropMapping {
|
|
|
27
28
|
}
|
|
28
29
|
/** Exclude className — it's passed through, not mapped to a utility class */
|
|
29
30
|
type MappedStyleProp = Exclude<StyleProp, 'className'>;
|
|
30
|
-
declare const propMappings: Record<MappedStyleProp, PropMapping>;
|
|
31
|
+
declare const propMappings: Record<MappedStyleProp, PropMapping>; //#endregion
|
|
31
32
|
//#endregion
|
|
32
33
|
export { PropMapping, propMappings };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MotionPreset } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/transformPreset.d.ts
|
|
4
|
+
//#region src/transformPreset.d.ts
|
|
4
5
|
interface TransformedMotionProps {
|
|
5
6
|
initial?: Record<string, unknown>;
|
|
6
7
|
animate?: Record<string, unknown>;
|
|
@@ -12,6 +13,6 @@ interface TransformedMotionProps {
|
|
|
12
13
|
/**
|
|
13
14
|
* Convert a JS-runtime MotionPreset to a motion/react-compatible props object.
|
|
14
15
|
*/
|
|
15
|
-
declare function transformPreset(preset: MotionPreset): TransformedMotionProps;
|
|
16
|
+
declare function transformPreset(preset: MotionPreset): TransformedMotionProps; //#endregion
|
|
16
17
|
//#endregion
|
|
17
18
|
export { TransformedMotionProps, transformPreset };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BorderRadius, GridSpan, GridStartEnd, GridTemplate, StyleAndModifierProps } from "@uds/types";
|
|
2
2
|
|
|
3
3
|
//#region ../core/dist/withDefaultStyleProps.d.ts
|
|
4
|
+
//#region src/withDefaultStyleProps.d.ts
|
|
4
5
|
interface StackDefaultsInput extends StyleAndModifierProps {
|
|
5
6
|
gap?: StyleAndModifierProps['gap'];
|
|
6
7
|
}
|
|
@@ -38,6 +39,6 @@ declare const withDefaultStyleProps: {
|
|
|
38
39
|
shape?: BorderRadius;
|
|
39
40
|
}) => StyleAndModifierProps;
|
|
40
41
|
Svg: (props: SvgDefaultsInput) => StyleAndModifierProps;
|
|
41
|
-
};
|
|
42
|
+
}; //#endregion
|
|
42
43
|
//#endregion
|
|
43
44
|
export { withDefaultStyleProps };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region ../loader/dist/_virtual/_rolldown/runtime.js
|
|
3
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { __commonJSMin, __require };
|
|
@@ -2,8 +2,8 @@ import { isCompiledJsxCallee } from "./babel-utils.js";
|
|
|
2
2
|
import { hasAnyOwnKeys } from "./create-component-data.js";
|
|
3
3
|
import { applySlotMotionToCompiledJsx, applySlotMotionToElement, wrapCompiledConditionalWithAnimatePresence, wrapParentConditionalWithAnimatePresence } from "./motion-transform.js";
|
|
4
4
|
import { findSlotPropsParamName } from "./data-attr-transform.js";
|
|
5
|
-
import _traverse from "@babel/traverse";
|
|
6
5
|
import * as t from "@babel/types";
|
|
6
|
+
import _traverse from "@babel/traverse";
|
|
7
7
|
//#region ../loader/dist/loader/create-component-lowering.js
|
|
8
8
|
const traverse = _traverse.default ?? _traverse;
|
|
9
9
|
/** Reserved createComponent keys (never treated as own props) */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildSourceRef, buildUdsId } from "./internal-meta.js";
|
|
2
1
|
import { applySlotMotionToCompiledJsx, getCustomSlotMotion } from "./motion-transform.js";
|
|
2
|
+
import { buildSourceRef, buildUdsId } from "./internal-meta.js";
|
|
3
3
|
import * as t from "@babel/types";
|
|
4
4
|
//#region ../loader/dist/loader/data-attr-transform.js
|
|
5
5
|
/**
|
|
@@ -1,33 +1,5 @@
|
|
|
1
1
|
//#region ../loader/dist/loader/lower-new-api-primitive.js
|
|
2
2
|
/**
|
|
3
|
-
* Build-time lowering of new-API primitive-form JSX call sites.
|
|
4
|
-
*
|
|
5
|
-
* Given a JSX element whose tag name resolves to an entry in
|
|
6
|
-
* `manifest.components[name]` with non-empty `propBindings` (built by
|
|
7
|
-
* codegen — see `packages/codegen/src/loader/extractLoweringMetadata.ts`),
|
|
8
|
-
* this helper mutates the AST to bake every statically-known prop into a
|
|
9
|
-
* `className` string and replace the JSX tag with the underlying HTML
|
|
10
|
-
* element. The result skips the runtime `bindRender` lookup, registry
|
|
11
|
-
* walk, and per-render className concatenation entirely.
|
|
12
|
-
*
|
|
13
|
-
* // Before:
|
|
14
|
-
* <Box bg="brand" id="x">hi</Box>
|
|
15
|
-
*
|
|
16
|
-
* // After (when `bg` is a registered style prop with classPrefix
|
|
17
|
-
* // 'bg' and a static value, and `id` isn't a known binding):
|
|
18
|
-
* <div className="bg-brand" id="x">hi</div>
|
|
19
|
-
*
|
|
20
|
-
* The lowering bails (returns `false` without mutating the AST) when:
|
|
21
|
-
* - any spread attribute (`{...rest}`) — could carry unknown props,
|
|
22
|
-
* - any bound prop has a dynamic value — can't statically compute the
|
|
23
|
-
* class,
|
|
24
|
-
* - `as=` is dynamic — can't statically pick the tag,
|
|
25
|
-
* - the JSX attribute name isn't a simple identifier.
|
|
26
|
-
*
|
|
27
|
-
* Callers fall through to runtime when the helper returns `false`; the
|
|
28
|
-
* runtime path is correct for every case, just slower.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
3
|
* Build the className a binding emits for a given value. Mirrors the
|
|
32
4
|
* codegen convention in `packages/codegen/src/css/prepareCss.ts`:
|
|
33
5
|
*
|
|
@@ -2,10 +2,10 @@ import { applyComponentStyleDefaults } from "../../../utils/dist/component-style
|
|
|
2
2
|
import { kebabCase } from "../../../utils/dist/string-utils/kebabCase.js";
|
|
3
3
|
import { componentVariantClass } from "../../../utils/dist/string-utils/componentClassName.js";
|
|
4
4
|
import "../../../utils/dist/index.js";
|
|
5
|
-
import { expandCompositeStyles } from "
|
|
6
|
-
import { propMappings } from "
|
|
7
|
-
import { toCamelCase } from "
|
|
8
|
-
import "
|
|
5
|
+
import { expandCompositeStyles } from "../packages/core/dist/compositeStyles.js";
|
|
6
|
+
import { propMappings } from "../packages/core/dist/style-prop-data.js";
|
|
7
|
+
import { toCamelCase } from "../packages/core/dist/getStyles.js";
|
|
8
|
+
import "../packages/core/dist/index.js";
|
|
9
9
|
import { buildDynamicClassExpression, parseHandlerString } from "./dynamic-style-codegen.js";
|
|
10
10
|
import * as t from "@babel/types";
|
|
11
11
|
//#region ../loader/dist/loader/style-transform.js
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LoaderDefinitionFunction } from "webpack";
|
|
2
2
|
|
|
3
3
|
//#region ../loader/dist/loader.d.ts
|
|
4
|
+
//#region src/loader.d.ts
|
|
4
5
|
declare const transformLoader: LoaderDefinitionFunction;
|
|
5
|
-
declare const normal: LoaderDefinitionFunction<{}, {}>;
|
|
6
|
+
declare const normal: LoaderDefinitionFunction<{}, {}>; //#endregion
|
|
6
7
|
//#endregion
|
|
7
8
|
export { normal, transformLoader };
|
|
@@ -8,11 +8,11 @@ import { findClassesParamName, findSlotFromClassNameAttr, findSlotFromPropsSprea
|
|
|
8
8
|
import { buildInlineSimpleLoweredCreateComponentRenderFn, buildInlineSimplePrimitiveCreateComponentRenderFn, buildLoweredCreateComponentConfigExpression, extractOwnPropKeys, inferCreateComponentNameFromAssignment, isCreateComponentRenderFnNode, remapOnPressToOnClickInJsxAttributes } from "./loader/create-component-lowering.js";
|
|
9
9
|
import { lowerNewApiPrimitiveJsx } from "./loader/lower-new-api-primitive.js";
|
|
10
10
|
import { createStyleTransformRuntime } from "./loader/style-transform.js";
|
|
11
|
+
import * as t from "@babel/types";
|
|
11
12
|
import path from "node:path";
|
|
13
|
+
import _traverse from "@babel/traverse";
|
|
12
14
|
import _generate from "@babel/generator";
|
|
13
15
|
import { parse } from "@babel/parser";
|
|
14
|
-
import _traverse from "@babel/traverse";
|
|
15
|
-
import * as t from "@babel/types";
|
|
16
16
|
//#region ../loader/dist/loader.js
|
|
17
17
|
const traverse = _traverse.default ?? _traverse;
|
|
18
18
|
const generate = _generate.default ?? _generate;
|
|
@@ -367,4 +367,4 @@ const transformLoader = function(source) {
|
|
|
367
367
|
};
|
|
368
368
|
const normal = transformLoader;
|
|
369
369
|
//#endregion
|
|
370
|
-
export {
|
|
370
|
+
export { normal, transformLoader };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NextConfig } from "next";
|
|
2
2
|
|
|
3
3
|
//#region ../loader/dist/next.d.ts
|
|
4
|
+
//#region src/next.d.ts
|
|
4
5
|
interface WithUdsOptions {
|
|
5
6
|
/** Output directory for generated files (default: '.uds') */
|
|
6
7
|
outputDir?: string;
|
|
@@ -11,6 +12,6 @@ interface WithUdsOptions {
|
|
|
11
12
|
type NextConfigFn = (phase: string, ctx: {
|
|
12
13
|
defaultConfig: NextConfig;
|
|
13
14
|
}) => NextConfig | Promise<NextConfig>;
|
|
14
|
-
declare function withUds(nextConfigOrFn: NextConfig | NextConfigFn, options?: WithUdsOptions): NextConfig | NextConfigFn;
|
|
15
|
+
declare function withUds(nextConfigOrFn: NextConfig | NextConfigFn, options?: WithUdsOptions): NextConfig | NextConfigFn; //#endregion
|
|
15
16
|
//#endregion
|
|
16
17
|
export { WithUdsOptions, withUds };
|
package/dist/loader/dist/next.js
CHANGED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_react } from "../index.js";
|
|
3
|
+
//#region ../loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.development.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
14
|
+
(function() {
|
|
15
|
+
function getComponentNameFromType(type) {
|
|
16
|
+
if (null == type) return null;
|
|
17
|
+
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
18
|
+
if ("string" === typeof type) return type;
|
|
19
|
+
switch (type) {
|
|
20
|
+
case REACT_FRAGMENT_TYPE: return "Fragment";
|
|
21
|
+
case REACT_PROFILER_TYPE: return "Profiler";
|
|
22
|
+
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
|
23
|
+
case REACT_SUSPENSE_TYPE: return "Suspense";
|
|
24
|
+
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
|
25
|
+
case REACT_ACTIVITY_TYPE: return "Activity";
|
|
26
|
+
}
|
|
27
|
+
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
|
28
|
+
case REACT_PORTAL_TYPE: return "Portal";
|
|
29
|
+
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
|
30
|
+
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
|
31
|
+
case REACT_FORWARD_REF_TYPE:
|
|
32
|
+
var innerType = type.render;
|
|
33
|
+
type = type.displayName;
|
|
34
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
35
|
+
return type;
|
|
36
|
+
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
37
|
+
case REACT_LAZY_TYPE:
|
|
38
|
+
innerType = type._payload;
|
|
39
|
+
type = type._init;
|
|
40
|
+
try {
|
|
41
|
+
return getComponentNameFromType(type(innerType));
|
|
42
|
+
} catch (x) {}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function testStringCoercion(value) {
|
|
47
|
+
return "" + value;
|
|
48
|
+
}
|
|
49
|
+
function checkKeyStringCoercion(value) {
|
|
50
|
+
try {
|
|
51
|
+
testStringCoercion(value);
|
|
52
|
+
var JSCompiler_inline_result = !1;
|
|
53
|
+
} catch (e) {
|
|
54
|
+
JSCompiler_inline_result = !0;
|
|
55
|
+
}
|
|
56
|
+
if (JSCompiler_inline_result) {
|
|
57
|
+
JSCompiler_inline_result = console;
|
|
58
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
59
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
60
|
+
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
|
61
|
+
return testStringCoercion(value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function getTaskName(type) {
|
|
65
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
66
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
|
67
|
+
try {
|
|
68
|
+
var name = getComponentNameFromType(type);
|
|
69
|
+
return name ? "<" + name + ">" : "<...>";
|
|
70
|
+
} catch (x) {
|
|
71
|
+
return "<...>";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function getOwner() {
|
|
75
|
+
var dispatcher = ReactSharedInternals.A;
|
|
76
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
77
|
+
}
|
|
78
|
+
function UnknownOwner() {
|
|
79
|
+
return Error("react-stack-top-frame");
|
|
80
|
+
}
|
|
81
|
+
function hasValidKey(config) {
|
|
82
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
83
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
84
|
+
if (getter && getter.isReactWarning) return !1;
|
|
85
|
+
}
|
|
86
|
+
return void 0 !== config.key;
|
|
87
|
+
}
|
|
88
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
89
|
+
function warnAboutAccessingKey() {
|
|
90
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
|
91
|
+
}
|
|
92
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
|
93
|
+
Object.defineProperty(props, "key", {
|
|
94
|
+
get: warnAboutAccessingKey,
|
|
95
|
+
configurable: !0
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
99
|
+
var componentName = getComponentNameFromType(this.type);
|
|
100
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
|
101
|
+
componentName = this.props.ref;
|
|
102
|
+
return void 0 !== componentName ? componentName : null;
|
|
103
|
+
}
|
|
104
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
105
|
+
var refProp = props.ref;
|
|
106
|
+
type = {
|
|
107
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
108
|
+
type,
|
|
109
|
+
key,
|
|
110
|
+
props,
|
|
111
|
+
_owner: owner
|
|
112
|
+
};
|
|
113
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
114
|
+
enumerable: !1,
|
|
115
|
+
get: elementRefGetterWithDeprecationWarning
|
|
116
|
+
}) : Object.defineProperty(type, "ref", {
|
|
117
|
+
enumerable: !1,
|
|
118
|
+
value: null
|
|
119
|
+
});
|
|
120
|
+
type._store = {};
|
|
121
|
+
Object.defineProperty(type._store, "validated", {
|
|
122
|
+
configurable: !1,
|
|
123
|
+
enumerable: !1,
|
|
124
|
+
writable: !0,
|
|
125
|
+
value: 0
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
128
|
+
configurable: !1,
|
|
129
|
+
enumerable: !1,
|
|
130
|
+
writable: !0,
|
|
131
|
+
value: null
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(type, "_debugStack", {
|
|
134
|
+
configurable: !1,
|
|
135
|
+
enumerable: !1,
|
|
136
|
+
writable: !0,
|
|
137
|
+
value: debugStack
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(type, "_debugTask", {
|
|
140
|
+
configurable: !1,
|
|
141
|
+
enumerable: !1,
|
|
142
|
+
writable: !0,
|
|
143
|
+
value: debugTask
|
|
144
|
+
});
|
|
145
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
146
|
+
return type;
|
|
147
|
+
}
|
|
148
|
+
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
149
|
+
var children = config.children;
|
|
150
|
+
if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
|
|
151
|
+
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
|
152
|
+
Object.freeze && Object.freeze(children);
|
|
153
|
+
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
154
|
+
else validateChildKeys(children);
|
|
155
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
156
|
+
children = getComponentNameFromType(type);
|
|
157
|
+
var keys = Object.keys(config).filter(function(k) {
|
|
158
|
+
return "key" !== k;
|
|
159
|
+
});
|
|
160
|
+
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
161
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
|
162
|
+
}
|
|
163
|
+
children = null;
|
|
164
|
+
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
165
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
166
|
+
if ("key" in config) {
|
|
167
|
+
maybeKey = {};
|
|
168
|
+
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
169
|
+
} else maybeKey = config;
|
|
170
|
+
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
|
171
|
+
return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
|
|
172
|
+
}
|
|
173
|
+
function validateChildKeys(node) {
|
|
174
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
175
|
+
}
|
|
176
|
+
function isValidElement(object) {
|
|
177
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
178
|
+
}
|
|
179
|
+
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
180
|
+
return null;
|
|
181
|
+
};
|
|
182
|
+
React = { react_stack_bottom_frame: function(callStackForError) {
|
|
183
|
+
return callStackForError();
|
|
184
|
+
} };
|
|
185
|
+
var specialPropKeyWarningShown;
|
|
186
|
+
var didWarnAboutElementRef = {};
|
|
187
|
+
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
|
|
188
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
189
|
+
var didWarnAboutKeySpread = {};
|
|
190
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
191
|
+
exports.jsx = function(type, config, maybeKey) {
|
|
192
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
193
|
+
return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
|
194
|
+
};
|
|
195
|
+
exports.jsxs = function(type, config, maybeKey) {
|
|
196
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
197
|
+
return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
|
198
|
+
};
|
|
199
|
+
})();
|
|
200
|
+
}));
|
|
201
|
+
require_react_jsx_runtime_development();
|
|
202
|
+
//#endregion
|
|
203
|
+
export { require_react_jsx_runtime_development };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
(/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
4
|
+
function jsxProd(type, config, maybeKey) {
|
|
5
|
+
var key = null;
|
|
6
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
7
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
8
|
+
if ("key" in config) {
|
|
9
|
+
maybeKey = {};
|
|
10
|
+
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
11
|
+
} else maybeKey = config;
|
|
12
|
+
config = maybeKey.ref;
|
|
13
|
+
return {
|
|
14
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
15
|
+
type,
|
|
16
|
+
key,
|
|
17
|
+
ref: void 0 !== config ? config : null,
|
|
18
|
+
props: maybeKey
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
22
|
+
exports.jsx = jsxProd;
|
|
23
|
+
exports.jsxs = jsxProd;
|
|
24
|
+
})))();
|
|
25
|
+
//#endregion
|