@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260324081023 → 0.8.1-dev.20260324093446
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.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +8 -21
- package/dist/index.mjs +7 -18
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
|
|
3
|
-
type WidgetRegistryType = Record<string, ComponentType<any> | ((props: any) => any)>;
|
|
4
|
-
declare const registerWidgets: (widgets: WidgetRegistryType) => void;
|
|
5
|
-
declare const getWidget: (code: string) => ComponentType<any> | undefined;
|
|
6
|
-
|
|
7
3
|
interface ViewControlProps {
|
|
8
4
|
value?: unknown;
|
|
9
5
|
controlType?: string;
|
|
@@ -209,7 +205,10 @@ interface PageBodyRendererProps {
|
|
|
209
205
|
donotApplyContainerLargeClass?: boolean;
|
|
210
206
|
serviceClient?: ServiceClientInterface;
|
|
211
207
|
assetBaseUrl?: string;
|
|
208
|
+
widgetRegistry?: Record<string, React.ComponentType<unknown>>;
|
|
212
209
|
}
|
|
213
210
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
214
211
|
|
|
215
|
-
|
|
212
|
+
type WidgetRegistryType = Record<string, ComponentType<unknown>>;
|
|
213
|
+
|
|
214
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes, type WidgetRegistryType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
|
|
3
|
-
type WidgetRegistryType = Record<string, ComponentType<any> | ((props: any) => any)>;
|
|
4
|
-
declare const registerWidgets: (widgets: WidgetRegistryType) => void;
|
|
5
|
-
declare const getWidget: (code: string) => ComponentType<any> | undefined;
|
|
6
|
-
|
|
7
3
|
interface ViewControlProps {
|
|
8
4
|
value?: unknown;
|
|
9
5
|
controlType?: string;
|
|
@@ -209,7 +205,10 @@ interface PageBodyRendererProps {
|
|
|
209
205
|
donotApplyContainerLargeClass?: boolean;
|
|
210
206
|
serviceClient?: ServiceClientInterface;
|
|
211
207
|
assetBaseUrl?: string;
|
|
208
|
+
widgetRegistry?: Record<string, React.ComponentType<unknown>>;
|
|
212
209
|
}
|
|
213
210
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
214
211
|
|
|
215
|
-
|
|
212
|
+
type WidgetRegistryType = Record<string, ComponentType<unknown>>;
|
|
213
|
+
|
|
214
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes, type WidgetRegistryType };
|
package/dist/index.js
CHANGED
|
@@ -37,21 +37,10 @@ __export(index_exports, {
|
|
|
37
37
|
InputControlType: () => InputControlType_default,
|
|
38
38
|
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
39
39
|
ViewControl: () => ViewControl_default,
|
|
40
|
-
ViewControlTypes: () => ViewControlTypes_default
|
|
41
|
-
getWidget: () => getWidget,
|
|
42
|
-
registerWidgets: () => registerWidgets
|
|
40
|
+
ViewControlTypes: () => ViewControlTypes_default
|
|
43
41
|
});
|
|
44
42
|
module.exports = __toCommonJS(index_exports);
|
|
45
43
|
|
|
46
|
-
// src/components/pageRenderingEngine/nodes/WidgetRegistry.tsx
|
|
47
|
-
var registry = {};
|
|
48
|
-
var registerWidgets = (widgets) => {
|
|
49
|
-
registry = widgets;
|
|
50
|
-
};
|
|
51
|
-
var getWidget = (code) => {
|
|
52
|
-
return registry[code];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
44
|
// src/components/controls/view/ViewControl.tsx
|
|
56
45
|
var import_react11 = __toESM(require("react"));
|
|
57
46
|
|
|
@@ -3102,9 +3091,6 @@ var ImageNode_default = ImageNode;
|
|
|
3102
3091
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3103
3092
|
var import_react43 = __toESM(require("react"));
|
|
3104
3093
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3105
|
-
function resolveWidget(code) {
|
|
3106
|
-
return getWidget(code);
|
|
3107
|
-
}
|
|
3108
3094
|
var WidgetNode = (props) => {
|
|
3109
3095
|
const getWidgetParameters = () => {
|
|
3110
3096
|
const widgetInputParameters = {
|
|
@@ -3160,7 +3146,7 @@ var WidgetNode = (props) => {
|
|
|
3160
3146
|
return widgetInputParameters;
|
|
3161
3147
|
};
|
|
3162
3148
|
const widgetCode = props.node.widgetCode;
|
|
3163
|
-
const SelectedWidget =
|
|
3149
|
+
const SelectedWidget = props.widgetRegistry?.[widgetCode];
|
|
3164
3150
|
if (!SelectedWidget) {
|
|
3165
3151
|
console.warn("Widget not found:", widgetCode);
|
|
3166
3152
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
@@ -3169,6 +3155,7 @@ var WidgetNode = (props) => {
|
|
|
3169
3155
|
] });
|
|
3170
3156
|
}
|
|
3171
3157
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "container mt-2", children: "..." }), children: import_react43.default.createElement(SelectedWidget, {
|
|
3158
|
+
// @ts-expect-error custom code
|
|
3172
3159
|
params: getWidgetParameters(),
|
|
3173
3160
|
query: props.query,
|
|
3174
3161
|
session: props.session,
|
|
@@ -4648,7 +4635,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4648
4635
|
path: props.path,
|
|
4649
4636
|
apiBaseUrl: props.apiBaseUrl,
|
|
4650
4637
|
serviceClient: props.serviceClient,
|
|
4651
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4638
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4639
|
+
widgetRegistry: props.widgetRegistry
|
|
4652
4640
|
}
|
|
4653
4641
|
) }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4654
4642
|
SelectedNode,
|
|
@@ -4661,7 +4649,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4661
4649
|
path: props.path,
|
|
4662
4650
|
apiBaseUrl: props.apiBaseUrl,
|
|
4663
4651
|
serviceClient: props.serviceClient,
|
|
4664
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4652
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4653
|
+
widgetRegistry: props.widgetRegistry
|
|
4665
4654
|
}
|
|
4666
4655
|
) }) }) }, index);
|
|
4667
4656
|
}) });
|
|
@@ -4674,7 +4663,5 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
4674
4663
|
InputControlType,
|
|
4675
4664
|
PageBodyRenderer,
|
|
4676
4665
|
ViewControl,
|
|
4677
|
-
ViewControlTypes
|
|
4678
|
-
getWidget,
|
|
4679
|
-
registerWidgets
|
|
4666
|
+
ViewControlTypes
|
|
4680
4667
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
// src/components/pageRenderingEngine/nodes/WidgetRegistry.tsx
|
|
5
|
-
var registry = {};
|
|
6
|
-
var registerWidgets = (widgets) => {
|
|
7
|
-
registry = widgets;
|
|
8
|
-
};
|
|
9
|
-
var getWidget = (code) => {
|
|
10
|
-
return registry[code];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
4
|
// src/components/controls/view/ViewControl.tsx
|
|
14
5
|
import React11 from "react";
|
|
15
6
|
|
|
@@ -3068,9 +3059,6 @@ var ImageNode_default = ImageNode;
|
|
|
3068
3059
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3069
3060
|
import React42, { Suspense } from "react";
|
|
3070
3061
|
import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3071
|
-
function resolveWidget(code) {
|
|
3072
|
-
return getWidget(code);
|
|
3073
|
-
}
|
|
3074
3062
|
var WidgetNode = (props) => {
|
|
3075
3063
|
const getWidgetParameters = () => {
|
|
3076
3064
|
const widgetInputParameters = {
|
|
@@ -3126,7 +3114,7 @@ var WidgetNode = (props) => {
|
|
|
3126
3114
|
return widgetInputParameters;
|
|
3127
3115
|
};
|
|
3128
3116
|
const widgetCode = props.node.widgetCode;
|
|
3129
|
-
const SelectedWidget =
|
|
3117
|
+
const SelectedWidget = props.widgetRegistry?.[widgetCode];
|
|
3130
3118
|
if (!SelectedWidget) {
|
|
3131
3119
|
console.warn("Widget not found:", widgetCode);
|
|
3132
3120
|
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
@@ -3135,6 +3123,7 @@ var WidgetNode = (props) => {
|
|
|
3135
3123
|
] });
|
|
3136
3124
|
}
|
|
3137
3125
|
return /* @__PURE__ */ jsx56(Suspense, { fallback: /* @__PURE__ */ jsx56("div", { className: "container mt-2", children: "..." }), children: React42.createElement(SelectedWidget, {
|
|
3126
|
+
// @ts-expect-error custom code
|
|
3138
3127
|
params: getWidgetParameters(),
|
|
3139
3128
|
query: props.query,
|
|
3140
3129
|
session: props.session,
|
|
@@ -4614,7 +4603,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4614
4603
|
path: props.path,
|
|
4615
4604
|
apiBaseUrl: props.apiBaseUrl,
|
|
4616
4605
|
serviceClient: props.serviceClient,
|
|
4617
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4606
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4607
|
+
widgetRegistry: props.widgetRegistry
|
|
4618
4608
|
}
|
|
4619
4609
|
) }) : /* @__PURE__ */ jsx67(React50.Fragment, { children: /* @__PURE__ */ jsx67(
|
|
4620
4610
|
SelectedNode,
|
|
@@ -4627,7 +4617,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4627
4617
|
path: props.path,
|
|
4628
4618
|
apiBaseUrl: props.apiBaseUrl,
|
|
4629
4619
|
serviceClient: props.serviceClient,
|
|
4630
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4620
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4621
|
+
widgetRegistry: props.widgetRegistry
|
|
4631
4622
|
}
|
|
4632
4623
|
) }) }) }, index);
|
|
4633
4624
|
}) });
|
|
@@ -4639,7 +4630,5 @@ export {
|
|
|
4639
4630
|
InputControlType_default as InputControlType,
|
|
4640
4631
|
PageBodyRenderer_default as PageBodyRenderer,
|
|
4641
4632
|
ViewControl_default as ViewControl,
|
|
4642
|
-
ViewControlTypes_default as ViewControlTypes
|
|
4643
|
-
getWidget,
|
|
4644
|
-
registerWidgets
|
|
4633
|
+
ViewControlTypes_default as ViewControlTypes
|
|
4645
4634
|
};
|
package/package.json
CHANGED