@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260323123345 → 0.8.1-dev.20260323130039
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -12
- package/dist/index.mjs +9 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -205,7 +205,7 @@ interface PageBodyRendererProps {
|
|
|
205
205
|
donotApplyContainerLargeClass?: boolean;
|
|
206
206
|
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
207
207
|
serviceClient?: ServiceClientInterface;
|
|
208
|
-
|
|
208
|
+
assetBaseUrl?: string;
|
|
209
209
|
dataMap?: Record<string, any>;
|
|
210
210
|
}
|
|
211
211
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -205,7 +205,7 @@ interface PageBodyRendererProps {
|
|
|
205
205
|
donotApplyContainerLargeClass?: boolean;
|
|
206
206
|
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
207
207
|
serviceClient?: ServiceClientInterface;
|
|
208
|
-
|
|
208
|
+
assetBaseUrl?: string;
|
|
209
209
|
dataMap?: Record<string, any>;
|
|
210
210
|
}
|
|
211
211
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
package/dist/index.js
CHANGED
|
@@ -3037,17 +3037,14 @@ var import_react47 = __toESM(require("react"));
|
|
|
3037
3037
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3038
3038
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3039
3039
|
var ImageNode = (props) => {
|
|
3040
|
-
const { node,
|
|
3041
|
-
let imageUrl;
|
|
3040
|
+
const { node, assetBaseUrl = "" } = props;
|
|
3042
3041
|
if (!node.imageUrl) return null;
|
|
3042
|
+
let imageUrl;
|
|
3043
3043
|
if (node.imageUrl.startsWith("http")) {
|
|
3044
3044
|
imageUrl = node.imageUrl;
|
|
3045
|
-
} else if (resolveAssetUrl) {
|
|
3046
|
-
imageUrl = resolveAssetUrl(node.imageUrl);
|
|
3047
3045
|
} else {
|
|
3048
|
-
imageUrl = `${
|
|
3046
|
+
imageUrl = assetBaseUrl ? `${assetBaseUrl}/${node.imageUrl}` : node.imageUrl;
|
|
3049
3047
|
}
|
|
3050
|
-
if (!imageUrl) return null;
|
|
3051
3048
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_jsx_runtime55.Fragment, { children: node.width ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { width: node.width }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3052
3049
|
"img",
|
|
3053
3050
|
{
|
|
@@ -4293,13 +4290,13 @@ var getNestedValue = (obj, path) => {
|
|
|
4293
4290
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4294
4291
|
}, obj);
|
|
4295
4292
|
};
|
|
4296
|
-
function generateCompleteBackgroundString(layers,
|
|
4293
|
+
function generateCompleteBackgroundString(layers, apiBaseUrl) {
|
|
4297
4294
|
if (!layers || !Array.isArray(layers)) return "";
|
|
4298
4295
|
return layers.filter((layer) => layer && layer.type && layer.value).map((layer) => {
|
|
4299
4296
|
if (layer.type === "image" && typeof layer.value === "object") {
|
|
4300
4297
|
const imageValue = layer.value;
|
|
4301
4298
|
if (!imageValue.assetUrl) return "";
|
|
4302
|
-
const resolvedAssetUrl =
|
|
4299
|
+
const resolvedAssetUrl = AssetUtility_default.resolveUrl(apiBaseUrl, imageValue.assetUrl);
|
|
4303
4300
|
if (!resolvedAssetUrl) return "";
|
|
4304
4301
|
const url = `url('${resolvedAssetUrl}')`;
|
|
4305
4302
|
const repeat = layer.repeat || "no-repeat";
|
|
@@ -4387,7 +4384,7 @@ var DivContainer = async (props) => {
|
|
|
4387
4384
|
const updatedStyles = convertKeysToCamelCase(styles);
|
|
4388
4385
|
var background = generateCompleteBackgroundString(
|
|
4389
4386
|
props.node.backgroundLayers,
|
|
4390
|
-
props.resolveAssetUrl,
|
|
4387
|
+
// props.resolveAssetUrl,
|
|
4391
4388
|
props.apiBaseUrl
|
|
4392
4389
|
);
|
|
4393
4390
|
let containerPaddingClass = "";
|
|
@@ -4453,7 +4450,7 @@ var DivContainer = async (props) => {
|
|
|
4453
4450
|
host: props2.host,
|
|
4454
4451
|
path: props2.path,
|
|
4455
4452
|
apiBaseUrl: props2.apiBaseUrl,
|
|
4456
|
-
|
|
4453
|
+
assetBaseUrl: props2.assetBaseUrl,
|
|
4457
4454
|
breadcrumb: props2.breadcrumb,
|
|
4458
4455
|
dataitem,
|
|
4459
4456
|
href,
|
|
@@ -4606,7 +4603,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4606
4603
|
apiBaseUrl: props.apiBaseUrl,
|
|
4607
4604
|
widgetRegistry: props.widgetRegistry,
|
|
4608
4605
|
serviceClient: props.serviceClient,
|
|
4609
|
-
|
|
4606
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4610
4607
|
dataMap: props.dataMap
|
|
4611
4608
|
}
|
|
4612
4609
|
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
@@ -4621,7 +4618,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4621
4618
|
apiBaseUrl: props.apiBaseUrl,
|
|
4622
4619
|
widgetRegistry: props.widgetRegistry,
|
|
4623
4620
|
serviceClient: props.serviceClient,
|
|
4624
|
-
|
|
4621
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4625
4622
|
dataMap: props.dataMap
|
|
4626
4623
|
}
|
|
4627
4624
|
) }) }) }, index);
|
package/dist/index.mjs
CHANGED
|
@@ -3005,17 +3005,14 @@ import React46 from "react";
|
|
|
3005
3005
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3006
3006
|
import { Fragment as Fragment6, jsx as jsx55 } from "react/jsx-runtime";
|
|
3007
3007
|
var ImageNode = (props) => {
|
|
3008
|
-
const { node,
|
|
3009
|
-
let imageUrl;
|
|
3008
|
+
const { node, assetBaseUrl = "" } = props;
|
|
3010
3009
|
if (!node.imageUrl) return null;
|
|
3010
|
+
let imageUrl;
|
|
3011
3011
|
if (node.imageUrl.startsWith("http")) {
|
|
3012
3012
|
imageUrl = node.imageUrl;
|
|
3013
|
-
} else if (resolveAssetUrl) {
|
|
3014
|
-
imageUrl = resolveAssetUrl(node.imageUrl);
|
|
3015
3013
|
} else {
|
|
3016
|
-
imageUrl = `${
|
|
3014
|
+
imageUrl = assetBaseUrl ? `${assetBaseUrl}/${node.imageUrl}` : node.imageUrl;
|
|
3017
3015
|
}
|
|
3018
|
-
if (!imageUrl) return null;
|
|
3019
3016
|
return /* @__PURE__ */ jsx55(Fragment6, { children: node.width ? /* @__PURE__ */ jsx55("div", { style: { width: node.width }, children: /* @__PURE__ */ jsx55(
|
|
3020
3017
|
"img",
|
|
3021
3018
|
{
|
|
@@ -4261,13 +4258,13 @@ var getNestedValue = (obj, path) => {
|
|
|
4261
4258
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4262
4259
|
}, obj);
|
|
4263
4260
|
};
|
|
4264
|
-
function generateCompleteBackgroundString(layers,
|
|
4261
|
+
function generateCompleteBackgroundString(layers, apiBaseUrl) {
|
|
4265
4262
|
if (!layers || !Array.isArray(layers)) return "";
|
|
4266
4263
|
return layers.filter((layer) => layer && layer.type && layer.value).map((layer) => {
|
|
4267
4264
|
if (layer.type === "image" && typeof layer.value === "object") {
|
|
4268
4265
|
const imageValue = layer.value;
|
|
4269
4266
|
if (!imageValue.assetUrl) return "";
|
|
4270
|
-
const resolvedAssetUrl =
|
|
4267
|
+
const resolvedAssetUrl = AssetUtility_default.resolveUrl(apiBaseUrl, imageValue.assetUrl);
|
|
4271
4268
|
if (!resolvedAssetUrl) return "";
|
|
4272
4269
|
const url = `url('${resolvedAssetUrl}')`;
|
|
4273
4270
|
const repeat = layer.repeat || "no-repeat";
|
|
@@ -4355,7 +4352,7 @@ var DivContainer = async (props) => {
|
|
|
4355
4352
|
const updatedStyles = convertKeysToCamelCase(styles);
|
|
4356
4353
|
var background = generateCompleteBackgroundString(
|
|
4357
4354
|
props.node.backgroundLayers,
|
|
4358
|
-
props.resolveAssetUrl,
|
|
4355
|
+
// props.resolveAssetUrl,
|
|
4359
4356
|
props.apiBaseUrl
|
|
4360
4357
|
);
|
|
4361
4358
|
let containerPaddingClass = "";
|
|
@@ -4421,7 +4418,7 @@ var DivContainer = async (props) => {
|
|
|
4421
4418
|
host: props2.host,
|
|
4422
4419
|
path: props2.path,
|
|
4423
4420
|
apiBaseUrl: props2.apiBaseUrl,
|
|
4424
|
-
|
|
4421
|
+
assetBaseUrl: props2.assetBaseUrl,
|
|
4425
4422
|
breadcrumb: props2.breadcrumb,
|
|
4426
4423
|
dataitem,
|
|
4427
4424
|
href,
|
|
@@ -4574,7 +4571,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4574
4571
|
apiBaseUrl: props.apiBaseUrl,
|
|
4575
4572
|
widgetRegistry: props.widgetRegistry,
|
|
4576
4573
|
serviceClient: props.serviceClient,
|
|
4577
|
-
|
|
4574
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4578
4575
|
dataMap: props.dataMap
|
|
4579
4576
|
}
|
|
4580
4577
|
) }) : /* @__PURE__ */ jsx70(React52.Fragment, { children: /* @__PURE__ */ jsx70(
|
|
@@ -4589,7 +4586,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4589
4586
|
apiBaseUrl: props.apiBaseUrl,
|
|
4590
4587
|
widgetRegistry: props.widgetRegistry,
|
|
4591
4588
|
serviceClient: props.serviceClient,
|
|
4592
|
-
|
|
4589
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
4593
4590
|
dataMap: props.dataMap
|
|
4594
4591
|
}
|
|
4595
4592
|
) }) }) }, index);
|
package/package.json
CHANGED