@infomaximum/package-cli 1.15.0 → 1.16.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/CHANGELOG.md +19 -0
- package/dist/scripts/widget/init/actions.js +10 -4
- package/dist/templates/widget/src/definition/definition.js +32 -0
- package/dist/templates/widget/src/{panel.js → definition/panel.js} +1 -1
- package/dist/templates/widget/src/widgetIndex.js +5 -32
- package/package.json +1 -1
- /package/dist/templates/widget/src/{settings.js → definition/settings.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.16.1](https://github.com/Infomaximum/package-cli/compare/v1.16.0...v1.16.1) (2024-02-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* исправлен шаблон ([a02cafe](https://github.com/Infomaximum/package-cli/commit/a02cafe34a045cf1537702ae678626d97e4ff726))
|
|
11
|
+
|
|
12
|
+
## [1.16.0](https://github.com/Infomaximum/package-cli/compare/v1.15.0...v1.16.0) (2024-02-14)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* подержан definition ([13a3617](https://github.com/Infomaximum/package-cli/commit/13a3617493b7349f4ce39f0353c3fd7cdec1261e))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* исправлен шаблон ([a5da473](https://github.com/Infomaximum/package-cli/commit/a5da4737cb2aafd80f716fa984c04e853cb41d35))
|
|
23
|
+
|
|
5
24
|
## [1.15.0](https://github.com/Infomaximum/package-cli/compare/v1.14.0...v1.15.0) (2023-12-26)
|
|
6
25
|
|
|
7
26
|
|
|
@@ -10,9 +10,10 @@ import { APP_D_TS_TEMPLATE } from "../../../templates/widget/src/widgetAppDTs.js
|
|
|
10
10
|
import { WIDGET_INDEX_CSS_TEMPLATE } from "../../../templates/widget/src/widgetIndexCSS.js";
|
|
11
11
|
import { WIDGET_PACKAGE_JSON_TEMPLATE } from "../../../templates/widget/widgetPackageJson.js";
|
|
12
12
|
import { CUSTOM_PACKAGE_CLI_LIB_NAME, CUSTOM_WIDGET_LIB_NAME, MANIFEST_JSON_FILE_NAME, } from "../../../const.js";
|
|
13
|
-
import { WIDGET_SETTINGS_TEMPLATE } from "../../../templates/widget/src/settings.js";
|
|
14
|
-
import { WIDGET_PANEL_TEMPLATE } from "../../../templates/widget/src/panel.js";
|
|
13
|
+
import { WIDGET_SETTINGS_TEMPLATE } from "../../../templates/widget/src/definition/settings.js";
|
|
14
|
+
import { WIDGET_PANEL_TEMPLATE } from "../../../templates/widget/src/definition/panel.js";
|
|
15
15
|
import { GET_CHANGELOG_MD, GET_DOC_MD, } from "../../../templates/package/additionalFiles.js";
|
|
16
|
+
import { WIDGET_DEFINITION_TEMPLATE } from "../../../templates/widget/src/definition/definition.js";
|
|
16
17
|
const addIconActionName = "addIcon";
|
|
17
18
|
const addInitActions = (basePath, plop) => {
|
|
18
19
|
plop.setActionType(addIconActionName, function (answers, config, plop) {
|
|
@@ -80,12 +81,17 @@ const actions = ({ customWidgetVersion, packageCliVersion }) => {
|
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
83
|
type: "add",
|
|
83
|
-
path: "src/
|
|
84
|
+
path: "src/definition/definition.ts",
|
|
85
|
+
template: WIDGET_DEFINITION_TEMPLATE,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "add",
|
|
89
|
+
path: "src/definition/settings.ts",
|
|
84
90
|
template: WIDGET_SETTINGS_TEMPLATE,
|
|
85
91
|
},
|
|
86
92
|
{
|
|
87
93
|
type: "add",
|
|
88
|
-
path: "src/panel.ts",
|
|
94
|
+
path: "src/definition/panel.ts",
|
|
89
95
|
template: WIDGET_PANEL_TEMPLATE,
|
|
90
96
|
},
|
|
91
97
|
{
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const WIDGET_DEFINITION_TEMPLATE = `\
|
|
2
|
+
import type {
|
|
3
|
+
IDefinition,
|
|
4
|
+
IFillSettings,
|
|
5
|
+
IGroupSettings,
|
|
6
|
+
IPanelDescriptionCreator,
|
|
7
|
+
IWidgetDimension,
|
|
8
|
+
IWidgetDimensionHierarchy,
|
|
9
|
+
IWidgetMeasure,
|
|
10
|
+
} from "@infomaximum/custom-widget";
|
|
11
|
+
import { fillSettings, type WidgetSettings } from "definition/settings";
|
|
12
|
+
import { createPanelDescription } from "definition/panel";
|
|
13
|
+
|
|
14
|
+
export class Definition implements IDefinition<WidgetSettings, IGroupSettings> {
|
|
15
|
+
public createPanelDescription: IPanelDescriptionCreator<
|
|
16
|
+
WidgetSettings,
|
|
17
|
+
IGroupSettings
|
|
18
|
+
> = createPanelDescription;
|
|
19
|
+
|
|
20
|
+
public fillSettings: IFillSettings<WidgetSettings> = fillSettings;
|
|
21
|
+
|
|
22
|
+
public getDimensions(
|
|
23
|
+
settings: WidgetSettings
|
|
24
|
+
): (IWidgetDimension | IWidgetDimensionHierarchy)[] {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public getMeasures(settings: WidgetSettings): IWidgetMeasure[] {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type IPanelDescriptionCreator,
|
|
4
4
|
type IGroupSettings,
|
|
5
5
|
} from "@infomaximum/custom-widget";
|
|
6
|
-
import type { WidgetSettings } from "settings";
|
|
6
|
+
import type { WidgetSettings } from "definition/settings";
|
|
7
7
|
|
|
8
8
|
export const createPanelDescription: IPanelDescriptionCreator<
|
|
9
9
|
WidgetSettings,
|
|
@@ -6,18 +6,15 @@ import ReactDOM from "react-dom/client";
|
|
|
6
6
|
import "./index.css";
|
|
7
7
|
import {
|
|
8
8
|
type IWidget,
|
|
9
|
-
type IPanelDescription,
|
|
10
9
|
type ICustomWidgetProps,
|
|
11
|
-
type IWidgetsContext,
|
|
12
|
-
type IWidgetMeasure,
|
|
13
|
-
type IWidgetDimension,
|
|
14
|
-
type IWidgetDimensionHierarchy,
|
|
15
10
|
} from "@infomaximum/custom-widget";
|
|
16
11
|
import manifest from "../${MANIFEST_JSON_FILE_NAME}";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { type WidgetSettings } from "definition/settings";
|
|
13
|
+
import { Definition } from "definition/definition";
|
|
19
14
|
|
|
20
15
|
class CustomWidget implements IWidget<WidgetSettings> {
|
|
16
|
+
public static definition = new Definition();
|
|
17
|
+
|
|
21
18
|
root: ReactDOM.Root | null = null;
|
|
22
19
|
|
|
23
20
|
public initialize(container: HTMLElement) {
|
|
@@ -47,34 +44,10 @@ class CustomWidget implements IWidget<WidgetSettings> {
|
|
|
47
44
|
private render(props: ICustomWidgetProps<WidgetSettings>) {
|
|
48
45
|
this.root?.render(
|
|
49
46
|
<React.StrictMode>
|
|
50
|
-
|
|
47
|
+
<div>{{ ${capitalizeHelperName} packageName}}</div>
|
|
51
48
|
</React.StrictMode>
|
|
52
49
|
);
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
public static createPanelDescription(
|
|
56
|
-
context: IWidgetsContext,
|
|
57
|
-
settings: WidgetSettings
|
|
58
|
-
): IPanelDescription<WidgetSettings> {
|
|
59
|
-
return createPanelDescription(context, settings);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public static fillSettings(
|
|
63
|
-
settings: WidgetSettings,
|
|
64
|
-
context: IWidgetsContext
|
|
65
|
-
) {
|
|
66
|
-
return fillSettings(settings, context);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public static getDimensions(
|
|
70
|
-
settings: WidgetSettings
|
|
71
|
-
): (IWidgetDimension | IWidgetDimensionHierarchy)[] {
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public static getMeasures(settings: WidgetSettings): IWidgetMeasure[] {
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
51
|
}
|
|
79
52
|
|
|
80
53
|
window.im.defineWidget(manifest.uuid, CustomWidget);
|
package/package.json
CHANGED
|
File without changes
|