@kosdev-code/kos-codegen-core 3.0.0 → 3.0.2
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/package.json +2 -2
- package/templates/kos-component/control-pour/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/cui/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/nav/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/setting/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/setup/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/trouble-action/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-component/utility/__nameDashCase__.stories.tsx__template__ +1 -1
- package/templates/kos-hook/with-__nameDashCase__.tsx.template +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"kos": {
|
|
26
26
|
"build": {
|
|
27
|
-
"gitHash": "
|
|
27
|
+
"gitHash": "c361188e6e049be5caaf953b41a50d2e6e12786d"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { ControlPourStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { ControlPourStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { CUIStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { CUIStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { NavStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { NavStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { SettingStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { SettingStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { SetupStepStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { SetupStepStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { UtilityStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { UtilityStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Note: The plugin project Storybook configuration requires that the Studio
|
|
3
3
|
* Simulator is running in order to retrieve model data...
|
|
4
4
|
*/
|
|
5
|
-
import { UtilityStoryContainer } from "@kosdev-code/kos-
|
|
5
|
+
import { UtilityStoryContainer } from "@kosdev-code/kos-ddk-story-containers";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
7
|
import { <%= namePascalCase %> } from "./<%= nameDashCase %>";
|
|
8
8
|
|
|
@@ -11,18 +11,24 @@ interface Identifiable {
|
|
|
11
11
|
}
|
|
12
12
|
<% } %>
|
|
13
13
|
|
|
14
|
-
type HoC<%= nameProperCase %>Props = <%= nameProperCase %>Props<% if (!singleton) { %> & Identifiable<% } %>;
|
|
15
14
|
// react HOC to provide a <%= nameProperCase %> to a component
|
|
16
|
-
export function with<%= nameProperCase %><T extends
|
|
15
|
+
export function with<%= nameProperCase %><T extends <%= nameProperCase %>Props<% if (!singleton) { %> & Identifiable<% } %>>(
|
|
17
16
|
WrappedComponent: React.ComponentType<T>
|
|
18
17
|
) {
|
|
19
|
-
|
|
18
|
+
const ComponentWith<%= nameProperCase %> = (props: Omit<T, keyof <%= nameProperCase %>Props>) => {
|
|
20
19
|
const { model, status, KosModelLoader } = use<%= nameProperCase %>(<% if (!singleton) { %>props.id<% } %>);
|
|
21
20
|
|
|
22
21
|
return (
|
|
23
22
|
<KosModelLoader {...status}>
|
|
24
|
-
<WrappedComponent
|
|
23
|
+
<WrappedComponent
|
|
24
|
+
{...(props as any)}
|
|
25
|
+
<%= nameCamelCase %>={model}
|
|
26
|
+
/>
|
|
25
27
|
</KosModelLoader>
|
|
26
28
|
);
|
|
27
29
|
};
|
|
28
|
-
|
|
30
|
+
|
|
31
|
+
ComponentWith<%= nameProperCase %>.displayName = `With<%= nameProperCase %>(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
|
|
32
|
+
|
|
33
|
+
return ComponentWith<%= nameProperCase %>;
|
|
34
|
+
}
|