@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260415060612 → 0.8.1-dev.20260416043301
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Button_default,
|
|
4
|
-
ServiceClient_default
|
|
5
|
-
|
|
4
|
+
ServiceClient_default,
|
|
5
|
+
ToastService_default
|
|
6
|
+
} from "./chunk-O5BPFXEO.mjs";
|
|
6
7
|
|
|
7
8
|
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
8
9
|
import { useCallback, useState } from "react";
|
|
@@ -87,6 +88,7 @@ var LinkNodeButton = (props) => {
|
|
|
87
88
|
console.log("API Response:", response);
|
|
88
89
|
if (response && !response.isSuccessful) {
|
|
89
90
|
const errorMessage = response.message || "API request failed";
|
|
91
|
+
ToastService_default.showError(errorMessage);
|
|
90
92
|
setError(errorMessage);
|
|
91
93
|
setIsLoading(false);
|
|
92
94
|
return { isSuccessful: false, message: errorMessage };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// src/components/Button.tsx
|
|
2
|
-
import React3, { useState as useState2 } from "react";
|
|
3
|
-
|
|
4
1
|
// src/components/ToastService.tsx
|
|
5
2
|
var ToastService = class _ToastService {
|
|
6
3
|
static initialize(showToast, closeToast) {
|
|
@@ -25,6 +22,9 @@ var ToastService = class _ToastService {
|
|
|
25
22
|
};
|
|
26
23
|
var ToastService_default = ToastService;
|
|
27
24
|
|
|
25
|
+
// src/components/Button.tsx
|
|
26
|
+
import React3, { useState as useState2 } from "react";
|
|
27
|
+
|
|
28
28
|
// src/components/StyleTypes.tsx
|
|
29
29
|
var buttonClasses = /* @__PURE__ */ new Map([
|
|
30
30
|
["Primary" /* Solid */, "btn-solid"],
|
|
@@ -394,6 +394,7 @@ var ServiceClient = class {
|
|
|
394
394
|
var ServiceClient_default = ServiceClient;
|
|
395
395
|
|
|
396
396
|
export {
|
|
397
|
+
ToastService_default,
|
|
397
398
|
buttonClasses,
|
|
398
399
|
Button_default,
|
|
399
400
|
ServiceClient_default
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ViewControlProps {
|
|
4
5
|
value?: any;
|
|
@@ -215,4 +216,15 @@ interface PageBodyRendererProps {
|
|
|
215
216
|
}
|
|
216
217
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
declare const Toast: () => react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
declare class ToastService {
|
|
222
|
+
private static showToast;
|
|
223
|
+
private static closeToast;
|
|
224
|
+
static initialize(showToast: (message: string, messageType: string) => void, closeToast: () => void): void;
|
|
225
|
+
static showError(message: string): void;
|
|
226
|
+
static showInfo(message: string): void;
|
|
227
|
+
static close(): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ViewControlProps {
|
|
4
5
|
value?: any;
|
|
@@ -215,4 +216,15 @@ interface PageBodyRendererProps {
|
|
|
215
216
|
}
|
|
216
217
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
declare const Toast: () => react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
declare class ToastService {
|
|
222
|
+
private static showToast;
|
|
223
|
+
private static closeToast;
|
|
224
|
+
static initialize(showToast: (message: string, messageType: string) => void, closeToast: () => void): void;
|
|
225
|
+
static showError(message: string): void;
|
|
226
|
+
static showInfo(message: string): void;
|
|
227
|
+
static close(): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -626,6 +626,7 @@ var init_LinkNodeButton = __esm({
|
|
|
626
626
|
import_react35 = require("react");
|
|
627
627
|
init_Button();
|
|
628
628
|
init_ServiceClient();
|
|
629
|
+
init_ToastService();
|
|
629
630
|
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
630
631
|
LinkNodeButton = (props) => {
|
|
631
632
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
@@ -707,6 +708,7 @@ var init_LinkNodeButton = __esm({
|
|
|
707
708
|
console.log("API Response:", response);
|
|
708
709
|
if (response && !response.isSuccessful) {
|
|
709
710
|
const errorMessage = response.message || "API request failed";
|
|
711
|
+
ToastService_default.showError(errorMessage);
|
|
710
712
|
setError(errorMessage);
|
|
711
713
|
setIsLoading(false);
|
|
712
714
|
return { isSuccessful: false, message: errorMessage };
|
|
@@ -964,6 +966,8 @@ __export(index_exports, {
|
|
|
964
966
|
InputControl: () => InputControl_default,
|
|
965
967
|
InputControlType: () => InputControlType_default,
|
|
966
968
|
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
969
|
+
Toast: () => Toast_default,
|
|
970
|
+
ToastService: () => ToastService_default,
|
|
967
971
|
ViewControl: () => ViewControl_default,
|
|
968
972
|
ViewControlTypes: () => ViewControlTypes_default
|
|
969
973
|
});
|
|
@@ -5623,12 +5627,96 @@ var PageBodyRenderer = (props) => {
|
|
|
5623
5627
|
}) });
|
|
5624
5628
|
};
|
|
5625
5629
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5630
|
+
|
|
5631
|
+
// src/components/Toast.tsx
|
|
5632
|
+
var import_react52 = require("react");
|
|
5633
|
+
init_ToastService();
|
|
5634
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5635
|
+
var Toast = () => {
|
|
5636
|
+
const [showToast, setShowToast] = (0, import_react52.useState)(false);
|
|
5637
|
+
const [message, setMessage] = (0, import_react52.useState)("");
|
|
5638
|
+
const [messageType, setMessageType] = (0, import_react52.useState)("error");
|
|
5639
|
+
ToastService_default.showError = function(message2) {
|
|
5640
|
+
setShowToast(true);
|
|
5641
|
+
setMessage(message2);
|
|
5642
|
+
setMessageType("error");
|
|
5643
|
+
};
|
|
5644
|
+
ToastService_default.showInfo = function(message2) {
|
|
5645
|
+
setShowToast(true);
|
|
5646
|
+
setMessage(message2);
|
|
5647
|
+
setMessageType("info");
|
|
5648
|
+
setTimeout(() => {
|
|
5649
|
+
setShowToast(false);
|
|
5650
|
+
}, 4e3);
|
|
5651
|
+
};
|
|
5652
|
+
ToastService_default.close = function() {
|
|
5653
|
+
setShowToast(false);
|
|
5654
|
+
};
|
|
5655
|
+
const closeToast = () => {
|
|
5656
|
+
setShowToast(false);
|
|
5657
|
+
};
|
|
5658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_jsx_runtime70.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5659
|
+
"div",
|
|
5660
|
+
{
|
|
5661
|
+
className: "fixed top-2 flex justify-center w-1/2 left-1/2 -translate-x-1/2",
|
|
5662
|
+
style: { zIndex: 1e3 },
|
|
5663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
5664
|
+
"div",
|
|
5665
|
+
{
|
|
5666
|
+
className: `w-full items-center flex justify-between p-3 rounded-md relative ${messageType == "error" ? "bg-error" : "bg-success-soft"}`,
|
|
5667
|
+
children: [
|
|
5668
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5669
|
+
"span",
|
|
5670
|
+
{
|
|
5671
|
+
className: "font-medium text-inherit text-sm",
|
|
5672
|
+
style: { whiteSpace: "pre-line" },
|
|
5673
|
+
children: message
|
|
5674
|
+
}
|
|
5675
|
+
),
|
|
5676
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5677
|
+
"button",
|
|
5678
|
+
{
|
|
5679
|
+
className: "absolute right-2 top-2 ml-2 focus:outline-none",
|
|
5680
|
+
onClick: closeToast,
|
|
5681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5682
|
+
"svg",
|
|
5683
|
+
{
|
|
5684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5685
|
+
className: "h-4 w-4",
|
|
5686
|
+
fill: "none",
|
|
5687
|
+
viewBox: "0 0 24 24",
|
|
5688
|
+
stroke: "currentColor",
|
|
5689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5690
|
+
"path",
|
|
5691
|
+
{
|
|
5692
|
+
strokeLinecap: "round",
|
|
5693
|
+
strokeLinejoin: "round",
|
|
5694
|
+
strokeWidth: "2",
|
|
5695
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
5696
|
+
}
|
|
5697
|
+
)
|
|
5698
|
+
}
|
|
5699
|
+
)
|
|
5700
|
+
}
|
|
5701
|
+
)
|
|
5702
|
+
]
|
|
5703
|
+
}
|
|
5704
|
+
)
|
|
5705
|
+
}
|
|
5706
|
+
) });
|
|
5707
|
+
};
|
|
5708
|
+
var Toast_default = Toast;
|
|
5709
|
+
|
|
5710
|
+
// src/index.ts
|
|
5711
|
+
init_ToastService();
|
|
5626
5712
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5627
5713
|
0 && (module.exports = {
|
|
5628
5714
|
DataList,
|
|
5629
5715
|
InputControl,
|
|
5630
5716
|
InputControlType,
|
|
5631
5717
|
PageBodyRenderer,
|
|
5718
|
+
Toast,
|
|
5719
|
+
ToastService,
|
|
5632
5720
|
ViewControl,
|
|
5633
5721
|
ViewControlTypes
|
|
5634
5722
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Button_default,
|
|
6
6
|
ServiceClient_default,
|
|
7
|
+
ToastService_default,
|
|
7
8
|
buttonClasses
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-O5BPFXEO.mjs";
|
|
9
10
|
|
|
10
11
|
// src/components/controls/view/ViewControl.tsx
|
|
11
12
|
import React9 from "react";
|
|
@@ -2817,7 +2818,7 @@ var ImageNode_default = ImageNode;
|
|
|
2817
2818
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
2818
2819
|
import dynamic2 from "next/dynamic";
|
|
2819
2820
|
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2820
|
-
var LinkNodeButton = dynamic2(() => import("./LinkNodeButton-
|
|
2821
|
+
var LinkNodeButton = dynamic2(() => import("./LinkNodeButton-ETDJGBBZ.mjs"), {
|
|
2821
2822
|
ssr: false
|
|
2822
2823
|
});
|
|
2823
2824
|
var LinkNode = (props) => {
|
|
@@ -4657,11 +4658,91 @@ var PageBodyRenderer = (props) => {
|
|
|
4657
4658
|
}) });
|
|
4658
4659
|
};
|
|
4659
4660
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
4661
|
+
|
|
4662
|
+
// src/components/Toast.tsx
|
|
4663
|
+
import { useState as useState8 } from "react";
|
|
4664
|
+
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4665
|
+
var Toast = () => {
|
|
4666
|
+
const [showToast, setShowToast] = useState8(false);
|
|
4667
|
+
const [message, setMessage] = useState8("");
|
|
4668
|
+
const [messageType, setMessageType] = useState8("error");
|
|
4669
|
+
ToastService_default.showError = function(message2) {
|
|
4670
|
+
setShowToast(true);
|
|
4671
|
+
setMessage(message2);
|
|
4672
|
+
setMessageType("error");
|
|
4673
|
+
};
|
|
4674
|
+
ToastService_default.showInfo = function(message2) {
|
|
4675
|
+
setShowToast(true);
|
|
4676
|
+
setMessage(message2);
|
|
4677
|
+
setMessageType("info");
|
|
4678
|
+
setTimeout(() => {
|
|
4679
|
+
setShowToast(false);
|
|
4680
|
+
}, 4e3);
|
|
4681
|
+
};
|
|
4682
|
+
ToastService_default.close = function() {
|
|
4683
|
+
setShowToast(false);
|
|
4684
|
+
};
|
|
4685
|
+
const closeToast = () => {
|
|
4686
|
+
setShowToast(false);
|
|
4687
|
+
};
|
|
4688
|
+
return /* @__PURE__ */ jsx61(Fragment9, { children: showToast && /* @__PURE__ */ jsx61(
|
|
4689
|
+
"div",
|
|
4690
|
+
{
|
|
4691
|
+
className: "fixed top-2 flex justify-center w-1/2 left-1/2 -translate-x-1/2",
|
|
4692
|
+
style: { zIndex: 1e3 },
|
|
4693
|
+
children: /* @__PURE__ */ jsxs34(
|
|
4694
|
+
"div",
|
|
4695
|
+
{
|
|
4696
|
+
className: `w-full items-center flex justify-between p-3 rounded-md relative ${messageType == "error" ? "bg-error" : "bg-success-soft"}`,
|
|
4697
|
+
children: [
|
|
4698
|
+
/* @__PURE__ */ jsx61(
|
|
4699
|
+
"span",
|
|
4700
|
+
{
|
|
4701
|
+
className: "font-medium text-inherit text-sm",
|
|
4702
|
+
style: { whiteSpace: "pre-line" },
|
|
4703
|
+
children: message
|
|
4704
|
+
}
|
|
4705
|
+
),
|
|
4706
|
+
/* @__PURE__ */ jsx61(
|
|
4707
|
+
"button",
|
|
4708
|
+
{
|
|
4709
|
+
className: "absolute right-2 top-2 ml-2 focus:outline-none",
|
|
4710
|
+
onClick: closeToast,
|
|
4711
|
+
children: /* @__PURE__ */ jsx61(
|
|
4712
|
+
"svg",
|
|
4713
|
+
{
|
|
4714
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4715
|
+
className: "h-4 w-4",
|
|
4716
|
+
fill: "none",
|
|
4717
|
+
viewBox: "0 0 24 24",
|
|
4718
|
+
stroke: "currentColor",
|
|
4719
|
+
children: /* @__PURE__ */ jsx61(
|
|
4720
|
+
"path",
|
|
4721
|
+
{
|
|
4722
|
+
strokeLinecap: "round",
|
|
4723
|
+
strokeLinejoin: "round",
|
|
4724
|
+
strokeWidth: "2",
|
|
4725
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
4726
|
+
}
|
|
4727
|
+
)
|
|
4728
|
+
}
|
|
4729
|
+
)
|
|
4730
|
+
}
|
|
4731
|
+
)
|
|
4732
|
+
]
|
|
4733
|
+
}
|
|
4734
|
+
)
|
|
4735
|
+
}
|
|
4736
|
+
) });
|
|
4737
|
+
};
|
|
4738
|
+
var Toast_default = Toast;
|
|
4660
4739
|
export {
|
|
4661
4740
|
DataList_default as DataList,
|
|
4662
4741
|
InputControl_default as InputControl,
|
|
4663
4742
|
InputControlType_default as InputControlType,
|
|
4664
4743
|
PageBodyRenderer_default as PageBodyRenderer,
|
|
4744
|
+
Toast_default as Toast,
|
|
4745
|
+
ToastService_default as ToastService,
|
|
4665
4746
|
ViewControl_default as ViewControl,
|
|
4666
4747
|
ViewControlTypes_default as ViewControlTypes
|
|
4667
4748
|
};
|
package/package.json
CHANGED