@storybook/preact 10.6.0-alpha.0 → 10.6.0-alpha.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/dist/index.d.ts +103 -177
- package/dist/preset.js +6 -6
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { AnyComponent, ComponentType, ComponentProps } from 'preact';
|
|
1
|
+
import { AnnotatedStoryFn, ArgTypes, Args, Args as Args$1, ArgsFromMeta, ArgsStoryFn, ComponentAnnotations, DecoratorFunction, LoaderFunction, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Parameters as Parameters$1, ProjectAnnotations, StoryAnnotations, StoryContext as StoryContext$1, StrictArgs, StrictArgs as StrictArgs$1, WebRenderer } from "storybook/internal/types";
|
|
2
|
+
import { AnyComponent, ComponentProps, ComponentType } from "preact";
|
|
4
3
|
|
|
4
|
+
//#region node_modules/type-fest/source/union-to-intersection.d.ts
|
|
5
5
|
/**
|
|
6
6
|
Convert a union type to an intersection type.
|
|
7
7
|
|
|
@@ -19,23 +19,18 @@ type Intersection = UnionToIntersection<Union>;
|
|
|
19
19
|
|
|
20
20
|
@category Type
|
|
21
21
|
*/
|
|
22
|
-
type UnionToIntersection<Union> = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
) extends ((mergedIntersection: infer Intersection) => void)
|
|
35
|
-
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
36
|
-
? Intersection & Union
|
|
37
|
-
: never;
|
|
38
|
-
|
|
22
|
+
type UnionToIntersection<Union> = (// `extends unknown` is always going to be the case and is used to convert the
|
|
23
|
+
// `Union` into a [distributive conditional
|
|
24
|
+
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
25
|
+
Union extends unknown // The union type is used as the only argument to a function since the union
|
|
26
|
+
// of function arguments is an intersection.
|
|
27
|
+
? (distributedUnion: Union) => void // This won't happen.
|
|
28
|
+
: never // Infer the `Intersection` type since TypeScript represents the positional
|
|
29
|
+
// arguments of unions of functions as an intersection of the union.
|
|
30
|
+
) extends ((mergedIntersection: infer Intersection) => void) // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
31
|
+
? Intersection & Union : never;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region node_modules/type-fest/source/keys-of-union.d.ts
|
|
39
34
|
/**
|
|
40
35
|
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
41
36
|
|
|
@@ -73,10 +68,10 @@ type AllKeys = KeysOfUnion<Union>;
|
|
|
73
68
|
|
|
74
69
|
@category Object
|
|
75
70
|
*/
|
|
76
|
-
type KeysOfUnion<ObjectType> =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
type KeysOfUnion<ObjectType> = // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
72
|
+
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region node_modules/type-fest/source/is-any.d.ts
|
|
80
75
|
/**
|
|
81
76
|
Returns a boolean for whether the given type is `any`.
|
|
82
77
|
|
|
@@ -106,7 +101,8 @@ const anyA = get(anyObject, 'a');
|
|
|
106
101
|
@category Utilities
|
|
107
102
|
*/
|
|
108
103
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
109
|
-
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
110
106
|
/**
|
|
111
107
|
Returns a boolean for whether the given key is an optional key of type.
|
|
112
108
|
|
|
@@ -147,14 +143,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
147
143
|
@category Type Guard
|
|
148
144
|
@category Utilities
|
|
149
145
|
*/
|
|
150
|
-
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
? Type extends Record<Key, Type[Key]>
|
|
154
|
-
? false
|
|
155
|
-
: true
|
|
156
|
-
: false;
|
|
157
|
-
|
|
146
|
+
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region node_modules/type-fest/source/optional-keys-of.d.ts
|
|
158
149
|
/**
|
|
159
150
|
Extract all optional keys from the given type.
|
|
160
151
|
|
|
@@ -188,16 +179,11 @@ const update2: UpdateOperation<User> = {
|
|
|
188
179
|
|
|
189
180
|
@category Utilities
|
|
190
181
|
*/
|
|
191
|
-
type OptionalKeysOf<Type extends object> =
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
: Key
|
|
197
|
-
]: never
|
|
198
|
-
}) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
199
|
-
: never; // Should never happen
|
|
200
|
-
|
|
182
|
+
type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
183
|
+
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
184
|
+
: never;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region node_modules/type-fest/source/required-keys-of.d.ts
|
|
201
187
|
/**
|
|
202
188
|
Extract all required keys from the given type.
|
|
203
189
|
|
|
@@ -228,11 +214,10 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
228
214
|
|
|
229
215
|
@category Utilities
|
|
230
216
|
*/
|
|
231
|
-
type RequiredKeysOf<Type extends object> =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
217
|
+
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
218
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region node_modules/type-fest/source/is-never.d.ts
|
|
236
221
|
/**
|
|
237
222
|
Returns a boolean for whether the given type is `never`.
|
|
238
223
|
|
|
@@ -287,7 +272,8 @@ type B = IsTrueFixed<never>;
|
|
|
287
272
|
@category Utilities
|
|
288
273
|
*/
|
|
289
274
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
290
|
-
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region node_modules/type-fest/source/if.d.ts
|
|
291
277
|
/**
|
|
292
278
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
293
279
|
|
|
@@ -380,13 +366,9 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
380
366
|
@category Type Guard
|
|
381
367
|
@category Utilities
|
|
382
368
|
*/
|
|
383
|
-
type If<Type extends boolean, IfBranch, ElseBranch> =
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
: Type extends true
|
|
387
|
-
? IfBranch
|
|
388
|
-
: ElseBranch;
|
|
389
|
-
|
|
369
|
+
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region node_modules/type-fest/source/simplify.d.ts
|
|
390
372
|
/**
|
|
391
373
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
392
374
|
|
|
@@ -445,8 +427,9 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
445
427
|
@see {@link SimplifyDeep}
|
|
446
428
|
@category Object
|
|
447
429
|
*/
|
|
448
|
-
type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};
|
|
449
|
-
|
|
430
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region node_modules/type-fest/source/is-equal.d.ts
|
|
450
433
|
/**
|
|
451
434
|
Returns a boolean for whether the two given types are equal.
|
|
452
435
|
|
|
@@ -473,20 +456,11 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
473
456
|
@category Type Guard
|
|
474
457
|
@category Utilities
|
|
475
458
|
*/
|
|
476
|
-
type IsEqual<A, B> =
|
|
477
|
-
[A] extends [B]
|
|
478
|
-
? [B] extends [A]
|
|
479
|
-
? _IsEqual<A, B>
|
|
480
|
-
: false
|
|
481
|
-
: false;
|
|
482
|
-
|
|
459
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
483
460
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
484
|
-
type _IsEqual<A, B> =
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
? true
|
|
488
|
-
: false;
|
|
489
|
-
|
|
461
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region node_modules/type-fest/source/omit-index-signature.d.ts
|
|
490
464
|
/**
|
|
491
465
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
492
466
|
|
|
@@ -578,12 +552,9 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
578
552
|
@see {@link PickIndexSignature}
|
|
579
553
|
@category Object
|
|
580
554
|
*/
|
|
581
|
-
type OmitIndexSignature<ObjectType> = {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
: KeyType]: ObjectType[KeyType];
|
|
585
|
-
};
|
|
586
|
-
|
|
555
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region node_modules/type-fest/source/pick-index-signature.d.ts
|
|
587
558
|
/**
|
|
588
559
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
589
560
|
|
|
@@ -629,17 +600,11 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
629
600
|
@see {@link OmitIndexSignature}
|
|
630
601
|
@category Object
|
|
631
602
|
*/
|
|
632
|
-
type PickIndexSignature<ObjectType> = {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
: never]: ObjectType[KeyType];
|
|
636
|
-
};
|
|
637
|
-
|
|
603
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region node_modules/type-fest/source/merge.d.ts
|
|
638
606
|
// Merges two objects without worrying about index signatures.
|
|
639
|
-
type SimpleMerge<Destination, Source> = Simplify<{
|
|
640
|
-
[Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
|
|
641
|
-
} & Source>;
|
|
642
|
-
|
|
607
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
643
608
|
/**
|
|
644
609
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
645
610
|
|
|
@@ -702,19 +667,14 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
|
|
|
702
667
|
@see {@link ObjectMerge}
|
|
703
668
|
@category Object
|
|
704
669
|
*/
|
|
705
|
-
type Merge<Destination, Source> =
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
type
|
|
713
|
-
Simplify<
|
|
714
|
-
SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
|
|
715
|
-
& SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
|
|
716
|
-
>;
|
|
717
|
-
|
|
670
|
+
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
671
|
+
? Source extends unknown // For distributing `Source`
|
|
672
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
673
|
+
: never;
|
|
674
|
+
// Should never happen
|
|
675
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region node_modules/type-fest/source/internal/object.d.ts
|
|
718
678
|
/**
|
|
719
679
|
Works similar to the built-in `Pick` utility type, except for the following differences:
|
|
720
680
|
- Distributes over union types and allows picking keys from any member of the union type.
|
|
@@ -752,10 +712,7 @@ type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
|
|
|
752
712
|
type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
|
|
753
713
|
//=> {}
|
|
754
714
|
*/
|
|
755
|
-
type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = {
|
|
756
|
-
[P in keyof T as Extract<P, Keys>]: T[P]
|
|
757
|
-
};
|
|
758
|
-
|
|
715
|
+
type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
|
|
759
716
|
/**
|
|
760
717
|
Merges user specified options with default options.
|
|
761
718
|
|
|
@@ -808,19 +765,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
808
765
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
809
766
|
```
|
|
810
767
|
*/
|
|
811
|
-
type ApplyDefaultOptions<
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
SpecifiedOptions extends Options,
|
|
815
|
-
> =
|
|
816
|
-
If<IsAny<SpecifiedOptions>, Defaults,
|
|
817
|
-
If<IsNever<SpecifiedOptions>, Defaults,
|
|
818
|
-
Simplify<Merge<Defaults, {
|
|
819
|
-
[Key in keyof SpecifiedOptions
|
|
820
|
-
as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key
|
|
821
|
-
]: SpecifiedOptions[Key]
|
|
822
|
-
}> & Required<Options>>>>;
|
|
823
|
-
|
|
768
|
+
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
769
|
+
//#endregion
|
|
770
|
+
//#region node_modules/type-fest/source/except.d.ts
|
|
824
771
|
/**
|
|
825
772
|
Filter out keys from an object.
|
|
826
773
|
|
|
@@ -849,22 +796,17 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
849
796
|
@see {Except}
|
|
850
797
|
*/
|
|
851
798
|
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
852
|
-
|
|
853
799
|
type ExceptOptions = {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
*/
|
|
861
|
-
requireExactProps?: boolean;
|
|
800
|
+
/**
|
|
801
|
+
Disallow assigning non-specified properties.
|
|
802
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
803
|
+
@default false
|
|
804
|
+
*/
|
|
805
|
+
requireExactProps?: boolean;
|
|
862
806
|
};
|
|
863
|
-
|
|
864
807
|
type DefaultExceptOptions = {
|
|
865
|
-
|
|
808
|
+
requireExactProps: false;
|
|
866
809
|
};
|
|
867
|
-
|
|
868
810
|
/**
|
|
869
811
|
Create a type from an object type without certain keys.
|
|
870
812
|
|
|
@@ -920,15 +862,10 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
920
862
|
|
|
921
863
|
@category Object
|
|
922
864
|
*/
|
|
923
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> =
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
type
|
|
927
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
928
|
-
} & (Options['requireExactProps'] extends true
|
|
929
|
-
? Partial<Record<KeysType, never>>
|
|
930
|
-
: {});
|
|
931
|
-
|
|
865
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
866
|
+
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
867
|
+
//#endregion
|
|
868
|
+
//#region node_modules/type-fest/source/set-optional.d.ts
|
|
932
869
|
/**
|
|
933
870
|
Create a type that makes the given keys optional, while keeping the remaining keys as is.
|
|
934
871
|
|
|
@@ -950,62 +887,51 @@ type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
|
|
|
950
887
|
|
|
951
888
|
@category Object
|
|
952
889
|
*/
|
|
953
|
-
type SetOptional<BaseType, Keys extends keyof BaseType> =
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
BaseType extends unknown // To distribute `BaseType` when it's a union type.
|
|
961
|
-
? Simplify<
|
|
962
|
-
// Pick just the keys that are readonly from the base type.
|
|
963
|
-
Except<BaseType, Keys>
|
|
964
|
-
// Pick the keys that should be mutable from the base type and make them mutable.
|
|
965
|
-
& Partial<HomomorphicPick<BaseType, Keys>>
|
|
966
|
-
>
|
|
967
|
-
: never;
|
|
968
|
-
|
|
890
|
+
type SetOptional<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetOptional<BaseType, Keys>;
|
|
891
|
+
type _SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends unknown // To distribute `BaseType` when it's a union type.
|
|
892
|
+
? Simplify< // Pick just the keys that are readonly from the base type.
|
|
893
|
+
Except<BaseType, Keys> // Pick the keys that should be mutable from the base type and make them mutable.
|
|
894
|
+
& Partial<HomomorphicPick<BaseType, Keys>>> : never;
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region code/renderers/preact/.dts-emit/code/renderers/preact/src/types.d.ts
|
|
969
897
|
type StoryFnPreactReturnType = string | Node | preact.JSX.Element;
|
|
970
898
|
interface PreactRenderer extends WebRenderer {
|
|
971
|
-
|
|
972
|
-
|
|
899
|
+
component: AnyComponent<this['T'], any>;
|
|
900
|
+
storyResult: StoryFnPreactReturnType;
|
|
973
901
|
}
|
|
974
|
-
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region code/renderers/preact/.dts-emit/code/renderers/preact/src/public-types.d.ts
|
|
975
904
|
/**
|
|
976
905
|
* Metadata to configure the stories for a component.
|
|
977
906
|
*
|
|
978
907
|
* @see [Default export](https://storybook.js.org/docs/api/csf#default-export)
|
|
979
908
|
*/
|
|
980
|
-
type Meta<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? ComponentAnnotations<PreactRenderer, ComponentProps<TCmpOrArgs>> : ComponentAnnotations<PreactRenderer, TCmpOrArgs>;
|
|
909
|
+
type Meta<TCmpOrArgs = Args$1> = [TCmpOrArgs] extends [ComponentType<any>] ? ComponentAnnotations<PreactRenderer, ComponentProps<TCmpOrArgs>> : ComponentAnnotations<PreactRenderer, TCmpOrArgs>;
|
|
981
910
|
/**
|
|
982
911
|
* Story function that represents a CSFv2 component example.
|
|
983
912
|
*
|
|
984
913
|
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
985
914
|
*/
|
|
986
|
-
type StoryFn<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? AnnotatedStoryFn<PreactRenderer, ComponentProps<TCmpOrArgs>> : AnnotatedStoryFn<PreactRenderer, TCmpOrArgs>;
|
|
915
|
+
type StoryFn<TCmpOrArgs = Args$1> = [TCmpOrArgs] extends [ComponentType<any>] ? AnnotatedStoryFn<PreactRenderer, ComponentProps<TCmpOrArgs>> : AnnotatedStoryFn<PreactRenderer, TCmpOrArgs>;
|
|
987
916
|
/**
|
|
988
917
|
* Story object that represents a CSFv3 component example.
|
|
989
918
|
*
|
|
990
919
|
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
991
920
|
*/
|
|
992
|
-
type StoryObj<TMetaOrCmpOrArgs = Args> = [TMetaOrCmpOrArgs] extends [
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}>;
|
|
1004
|
-
type Decorator<TArgs = StrictArgs> = DecoratorFunction<PreactRenderer, TArgs>;
|
|
1005
|
-
type Loader<TArgs = StrictArgs> = LoaderFunction<PreactRenderer, TArgs>;
|
|
1006
|
-
type StoryContext<TArgs = StrictArgs> = StoryContext$1<PreactRenderer, TArgs>;
|
|
921
|
+
type StoryObj<TMetaOrCmpOrArgs = Args$1> = [TMetaOrCmpOrArgs] extends [{
|
|
922
|
+
render?: ArgsStoryFn<PreactRenderer, any>;
|
|
923
|
+
component?: infer Component;
|
|
924
|
+
args?: infer DefaultArgs;
|
|
925
|
+
}] ? Simplify<(Component extends ComponentType<any> ? ComponentProps<Component> : unknown) & ArgsFromMeta<PreactRenderer, TMetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<PreactRenderer, AddMocks<TArgs, DefaultArgs>, SetOptional<TArgs, keyof TArgs & keyof DefaultArgs>> : never : TMetaOrCmpOrArgs extends ComponentType<any> ? StoryAnnotations<PreactRenderer, ComponentProps<TMetaOrCmpOrArgs>> : StoryAnnotations<PreactRenderer, TMetaOrCmpOrArgs>;
|
|
926
|
+
type AddMocks<TArgs, DefaultArgs> = Simplify<{ [T in keyof TArgs]: T extends keyof DefaultArgs ? DefaultArgs[T] extends ((...args: any) => any & {
|
|
927
|
+
mock: {};
|
|
928
|
+
}) ? DefaultArgs[T] : TArgs[T] : TArgs[T] }>;
|
|
929
|
+
type Decorator<TArgs = StrictArgs$1> = DecoratorFunction<PreactRenderer, TArgs>;
|
|
930
|
+
type Loader<TArgs = StrictArgs$1> = LoaderFunction<PreactRenderer, TArgs>;
|
|
931
|
+
type StoryContext<TArgs = StrictArgs$1> = StoryContext$1<PreactRenderer, TArgs>;
|
|
1007
932
|
type Preview = ProjectAnnotations<PreactRenderer>;
|
|
1008
|
-
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region code/renderers/preact/.dts-emit/code/renderers/preact/src/portable-stories.d.ts
|
|
1009
935
|
/**
|
|
1010
936
|
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
1011
937
|
* your .storybook folder.
|
|
@@ -1026,5 +952,5 @@ type Preview = ProjectAnnotations<PreactRenderer>;
|
|
|
1026
952
|
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
|
|
1027
953
|
*/
|
|
1028
954
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<PreactRenderer>;
|
|
1029
|
-
|
|
1030
|
-
export { type
|
|
955
|
+
//#endregion
|
|
956
|
+
export { AddMocks, type ArgTypes, type Args, Decorator, Loader, Meta, type Parameters$1 as Parameters, type PreactRenderer, Preview, StoryContext, StoryFn, StoryObj, type StrictArgs, setProjectAnnotations };
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6amch16yex9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6amch16yex9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6amch16yex9 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6amch16yex9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6amch16yex9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6amch16yex9.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preact",
|
|
3
|
-
"version": "10.6.0-alpha.
|
|
3
|
+
"version": "10.6.0-alpha.1",
|
|
4
4
|
"description": "Storybook Preact renderer: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"preact": "^10.5.13",
|
|
52
|
-
"typescript": "^
|
|
52
|
+
"typescript": "^6.0.3"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"preact": "^8.0.0||^10.0.0",
|
|
56
|
-
"storybook": "^10.6.0-alpha.
|
|
56
|
+
"storybook": "^10.6.0-alpha.1"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|