@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260324082757 → 0.8.1-dev.20260324095329
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 +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/index.js +7 -30
- package/dist/index.mjs +6 -27
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React
|
|
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;
|
|
1
|
+
import React from 'react';
|
|
6
2
|
|
|
7
3
|
interface ViewControlProps {
|
|
8
4
|
value?: unknown;
|
|
@@ -209,7 +205,8 @@ interface PageBodyRendererProps {
|
|
|
209
205
|
donotApplyContainerLargeClass?: boolean;
|
|
210
206
|
serviceClient?: ServiceClientInterface;
|
|
211
207
|
assetBaseUrl?: string;
|
|
208
|
+
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
212
209
|
}
|
|
213
210
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
214
211
|
|
|
215
|
-
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes
|
|
212
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React
|
|
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;
|
|
1
|
+
import React from 'react';
|
|
6
2
|
|
|
7
3
|
interface ViewControlProps {
|
|
8
4
|
value?: unknown;
|
|
@@ -209,7 +205,8 @@ interface PageBodyRendererProps {
|
|
|
209
205
|
donotApplyContainerLargeClass?: boolean;
|
|
210
206
|
serviceClient?: ServiceClientInterface;
|
|
211
207
|
assetBaseUrl?: string;
|
|
208
|
+
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
212
209
|
}
|
|
213
210
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
214
211
|
|
|
215
|
-
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes
|
|
212
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -37,30 +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 GLOBAL_KEY = "__DIGITALSTORE_WIDGET_REGISTRY__";
|
|
48
|
-
var getRegistry = () => {
|
|
49
|
-
const globalAny = globalThis;
|
|
50
|
-
if (!globalAny[GLOBAL_KEY]) {
|
|
51
|
-
globalAny[GLOBAL_KEY] = {};
|
|
52
|
-
}
|
|
53
|
-
return globalAny[GLOBAL_KEY];
|
|
54
|
-
};
|
|
55
|
-
var registerWidgets = (widgets) => {
|
|
56
|
-
const registry = getRegistry();
|
|
57
|
-
Object.assign(registry, widgets);
|
|
58
|
-
};
|
|
59
|
-
var getWidget = (code) => {
|
|
60
|
-
const registry = getRegistry();
|
|
61
|
-
return registry[code];
|
|
62
|
-
};
|
|
63
|
-
|
|
64
44
|
// src/components/controls/view/ViewControl.tsx
|
|
65
45
|
var import_react11 = __toESM(require("react"));
|
|
66
46
|
|
|
@@ -3111,9 +3091,6 @@ var ImageNode_default = ImageNode;
|
|
|
3111
3091
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3112
3092
|
var import_react43 = __toESM(require("react"));
|
|
3113
3093
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3114
|
-
function resolveWidget(code) {
|
|
3115
|
-
return getWidget(code);
|
|
3116
|
-
}
|
|
3117
3094
|
var WidgetNode = (props) => {
|
|
3118
3095
|
const getWidgetParameters = () => {
|
|
3119
3096
|
const widgetInputParameters = {
|
|
@@ -3169,7 +3146,7 @@ var WidgetNode = (props) => {
|
|
|
3169
3146
|
return widgetInputParameters;
|
|
3170
3147
|
};
|
|
3171
3148
|
const widgetCode = props.node.widgetCode;
|
|
3172
|
-
const SelectedWidget =
|
|
3149
|
+
const SelectedWidget = props.widgetRegistry?.[widgetCode];
|
|
3173
3150
|
if (!SelectedWidget) {
|
|
3174
3151
|
console.warn("Widget not found:", widgetCode);
|
|
3175
3152
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
@@ -4657,7 +4634,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4657
4634
|
path: props.path,
|
|
4658
4635
|
apiBaseUrl: props.apiBaseUrl,
|
|
4659
4636
|
serviceClient: props.serviceClient,
|
|
4660
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4637
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4638
|
+
widgetRegistry: props.widgetRegistry
|
|
4661
4639
|
}
|
|
4662
4640
|
) }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4663
4641
|
SelectedNode,
|
|
@@ -4670,7 +4648,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4670
4648
|
path: props.path,
|
|
4671
4649
|
apiBaseUrl: props.apiBaseUrl,
|
|
4672
4650
|
serviceClient: props.serviceClient,
|
|
4673
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4651
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4652
|
+
widgetRegistry: props.widgetRegistry
|
|
4674
4653
|
}
|
|
4675
4654
|
) }) }) }, index);
|
|
4676
4655
|
}) });
|
|
@@ -4683,7 +4662,5 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
4683
4662
|
InputControlType,
|
|
4684
4663
|
PageBodyRenderer,
|
|
4685
4664
|
ViewControl,
|
|
4686
|
-
ViewControlTypes
|
|
4687
|
-
getWidget,
|
|
4688
|
-
registerWidgets
|
|
4665
|
+
ViewControlTypes
|
|
4689
4666
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
// src/components/pageRenderingEngine/nodes/WidgetRegistry.tsx
|
|
5
|
-
var GLOBAL_KEY = "__DIGITALSTORE_WIDGET_REGISTRY__";
|
|
6
|
-
var getRegistry = () => {
|
|
7
|
-
const globalAny = globalThis;
|
|
8
|
-
if (!globalAny[GLOBAL_KEY]) {
|
|
9
|
-
globalAny[GLOBAL_KEY] = {};
|
|
10
|
-
}
|
|
11
|
-
return globalAny[GLOBAL_KEY];
|
|
12
|
-
};
|
|
13
|
-
var registerWidgets = (widgets) => {
|
|
14
|
-
const registry = getRegistry();
|
|
15
|
-
Object.assign(registry, widgets);
|
|
16
|
-
};
|
|
17
|
-
var getWidget = (code) => {
|
|
18
|
-
const registry = getRegistry();
|
|
19
|
-
return registry[code];
|
|
20
|
-
};
|
|
21
|
-
|
|
22
4
|
// src/components/controls/view/ViewControl.tsx
|
|
23
5
|
import React11 from "react";
|
|
24
6
|
|
|
@@ -3077,9 +3059,6 @@ var ImageNode_default = ImageNode;
|
|
|
3077
3059
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3078
3060
|
import React42, { Suspense } from "react";
|
|
3079
3061
|
import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3080
|
-
function resolveWidget(code) {
|
|
3081
|
-
return getWidget(code);
|
|
3082
|
-
}
|
|
3083
3062
|
var WidgetNode = (props) => {
|
|
3084
3063
|
const getWidgetParameters = () => {
|
|
3085
3064
|
const widgetInputParameters = {
|
|
@@ -3135,7 +3114,7 @@ var WidgetNode = (props) => {
|
|
|
3135
3114
|
return widgetInputParameters;
|
|
3136
3115
|
};
|
|
3137
3116
|
const widgetCode = props.node.widgetCode;
|
|
3138
|
-
const SelectedWidget =
|
|
3117
|
+
const SelectedWidget = props.widgetRegistry?.[widgetCode];
|
|
3139
3118
|
if (!SelectedWidget) {
|
|
3140
3119
|
console.warn("Widget not found:", widgetCode);
|
|
3141
3120
|
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
@@ -4623,7 +4602,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4623
4602
|
path: props.path,
|
|
4624
4603
|
apiBaseUrl: props.apiBaseUrl,
|
|
4625
4604
|
serviceClient: props.serviceClient,
|
|
4626
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4605
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4606
|
+
widgetRegistry: props.widgetRegistry
|
|
4627
4607
|
}
|
|
4628
4608
|
) }) : /* @__PURE__ */ jsx67(React50.Fragment, { children: /* @__PURE__ */ jsx67(
|
|
4629
4609
|
SelectedNode,
|
|
@@ -4636,7 +4616,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4636
4616
|
path: props.path,
|
|
4637
4617
|
apiBaseUrl: props.apiBaseUrl,
|
|
4638
4618
|
serviceClient: props.serviceClient,
|
|
4639
|
-
assetBaseUrl: props.assetBaseUrl
|
|
4619
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4620
|
+
widgetRegistry: props.widgetRegistry
|
|
4640
4621
|
}
|
|
4641
4622
|
) }) }) }, index);
|
|
4642
4623
|
}) });
|
|
@@ -4648,7 +4629,5 @@ export {
|
|
|
4648
4629
|
InputControlType_default as InputControlType,
|
|
4649
4630
|
PageBodyRenderer_default as PageBodyRenderer,
|
|
4650
4631
|
ViewControl_default as ViewControl,
|
|
4651
|
-
ViewControlTypes_default as ViewControlTypes
|
|
4652
|
-
getWidget,
|
|
4653
|
-
registerWidgets
|
|
4632
|
+
ViewControlTypes_default as ViewControlTypes
|
|
4654
4633
|
};
|
package/package.json
CHANGED