@universe-platform/ui 0.1.0-beta.59 → 0.1.0-beta.60
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/globals.css +3 -0
- package/dist/index.js +45 -1
- package/dist/index.mjs +45 -1
- package/package.json +1 -1
package/dist/globals.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -8705,6 +8705,11 @@ function stateText(step, state) {
|
|
|
8705
8705
|
if (step.kind === "create") return state === "returned" ? "\u05DE\u05D5\u05DC\u05D0" : "\u05DC\u05D0 \u05DE\u05D5\u05DC\u05D0";
|
|
8706
8706
|
return state === "returned" ? "\u05D4\u05D5\u05D7\u05D6\u05E8" : state === "sent" ? "\u05E0\u05E9\u05DC\u05D7" : "\u05DC\u05D0 \u05E0\u05E9\u05DC\u05D7";
|
|
8707
8707
|
}
|
|
8708
|
+
function getPlatformOrigin() {
|
|
8709
|
+
const w = typeof window !== "undefined" ? window : {};
|
|
8710
|
+
const base = w.NEXT_PUBLIC_UNIVERSE_SERVER_URL || w.NEXT_PUBLIC_UNIVERSE_API_URL || process.env.NEXT_PUBLIC_UNIVERSE_SERVER_URL || process.env.NEXT_PUBLIC_UNIVERSE_API_URL || (typeof window !== "undefined" ? window.location.origin : "");
|
|
8711
|
+
return String(base).replace(/\/$/, "");
|
|
8712
|
+
}
|
|
8708
8713
|
function FormTrackingTableBlock(props) {
|
|
8709
8714
|
const { settings, executeAction, readOnly } = props;
|
|
8710
8715
|
const config = getFormTrackingConfig(settings);
|
|
@@ -8758,6 +8763,17 @@ function FormTrackingTableBlock(props) {
|
|
|
8758
8763
|
},
|
|
8759
8764
|
[executeAction, tableId, showError]
|
|
8760
8765
|
);
|
|
8766
|
+
const firstFormStep = config == null ? void 0 : config.steps.find((s) => s.kind === "create");
|
|
8767
|
+
const firstFormUrl = firstFormStep && tableId ? `${getPlatformOrigin()}/embed/form/${tableId}?form=${firstFormStep.formId}` : "";
|
|
8768
|
+
const copyFirstFormLink = (0, import_react19.useCallback)(async () => {
|
|
8769
|
+
if (!firstFormUrl) return;
|
|
8770
|
+
try {
|
|
8771
|
+
await navigator.clipboard.writeText(firstFormUrl);
|
|
8772
|
+
addToast({ type: "success", message: `\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${firstFormStep == null ? void 0 : firstFormStep.label}" \u05D4\u05D5\u05E2\u05EA\u05E7` });
|
|
8773
|
+
} catch (e) {
|
|
8774
|
+
window.prompt(`\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${firstFormStep == null ? void 0 : firstFormStep.label}" - \u05D4\u05E2\u05EA\u05E7 \u05D9\u05D3\u05E0\u05D9\u05EA:`, firstFormUrl);
|
|
8775
|
+
}
|
|
8776
|
+
}, [firstFormUrl, firstFormStep, addToast]);
|
|
8761
8777
|
const renderRowExtra = (0, import_react19.useCallback)(
|
|
8762
8778
|
(row) => {
|
|
8763
8779
|
var _a;
|
|
@@ -8807,7 +8823,35 @@ function FormTrackingTableBlock(props) {
|
|
|
8807
8823
|
[config, sentOverrides, busyKey, readOnly, copyLink, setSent]
|
|
8808
8824
|
);
|
|
8809
8825
|
if (!config) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableBlockClient, __spreadValues({}, props));
|
|
8810
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.
|
|
8826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
8827
|
+
firstFormUrl && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-wrap items-center gap-2 mb-2 text-xs", children: [
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "font-semibold text-slate-600 whitespace-nowrap", children: [
|
|
8829
|
+
"\u05E7\u05D9\u05E9\u05D5\u05E8 \u05E7\u05D1\u05D5\u05E2 \u05DC\u05D8\u05D5\u05E4\u05E1 \u05D4\u05E8\u05D0\u05E9\u05D5\u05DF (",
|
|
8830
|
+
firstFormStep == null ? void 0 : firstFormStep.label,
|
|
8831
|
+
"):"
|
|
8832
|
+
] }),
|
|
8833
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8834
|
+
"input",
|
|
8835
|
+
{
|
|
8836
|
+
readOnly: true,
|
|
8837
|
+
value: firstFormUrl,
|
|
8838
|
+
dir: "ltr",
|
|
8839
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
8840
|
+
className: "flex-1 min-w-[200px] rounded-lg border border-slate-200 bg-slate-50 px-2 py-1 text-[11px] text-slate-600"
|
|
8841
|
+
}
|
|
8842
|
+
),
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8844
|
+
"button",
|
|
8845
|
+
{
|
|
8846
|
+
type: "button",
|
|
8847
|
+
onClick: copyFirstFormLink,
|
|
8848
|
+
className: "font-semibold text-brand hover:underline cursor-pointer whitespace-nowrap",
|
|
8849
|
+
children: "\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D9\u05E9\u05D5\u05E8"
|
|
8850
|
+
}
|
|
8851
|
+
)
|
|
8852
|
+
] }),
|
|
8853
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableBlockClient, __spreadProps(__spreadValues({}, props), { rowExtraHeader: "\u05D4\u05EA\u05E7\u05D3\u05DE\u05D5\u05EA \u05D8\u05E4\u05E1\u05D9\u05DD", renderRowExtra }))
|
|
8854
|
+
] });
|
|
8811
8855
|
}
|
|
8812
8856
|
|
|
8813
8857
|
// src/components/TableBlock/TableBlock.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -8554,6 +8554,11 @@ function stateText(step, state) {
|
|
|
8554
8554
|
if (step.kind === "create") return state === "returned" ? "\u05DE\u05D5\u05DC\u05D0" : "\u05DC\u05D0 \u05DE\u05D5\u05DC\u05D0";
|
|
8555
8555
|
return state === "returned" ? "\u05D4\u05D5\u05D7\u05D6\u05E8" : state === "sent" ? "\u05E0\u05E9\u05DC\u05D7" : "\u05DC\u05D0 \u05E0\u05E9\u05DC\u05D7";
|
|
8556
8556
|
}
|
|
8557
|
+
function getPlatformOrigin() {
|
|
8558
|
+
const w = typeof window !== "undefined" ? window : {};
|
|
8559
|
+
const base = w.NEXT_PUBLIC_UNIVERSE_SERVER_URL || w.NEXT_PUBLIC_UNIVERSE_API_URL || process.env.NEXT_PUBLIC_UNIVERSE_SERVER_URL || process.env.NEXT_PUBLIC_UNIVERSE_API_URL || (typeof window !== "undefined" ? window.location.origin : "");
|
|
8560
|
+
return String(base).replace(/\/$/, "");
|
|
8561
|
+
}
|
|
8557
8562
|
function FormTrackingTableBlock(props) {
|
|
8558
8563
|
const { settings, executeAction, readOnly } = props;
|
|
8559
8564
|
const config = getFormTrackingConfig(settings);
|
|
@@ -8607,6 +8612,17 @@ function FormTrackingTableBlock(props) {
|
|
|
8607
8612
|
},
|
|
8608
8613
|
[executeAction, tableId, showError]
|
|
8609
8614
|
);
|
|
8615
|
+
const firstFormStep = config == null ? void 0 : config.steps.find((s) => s.kind === "create");
|
|
8616
|
+
const firstFormUrl = firstFormStep && tableId ? `${getPlatformOrigin()}/embed/form/${tableId}?form=${firstFormStep.formId}` : "";
|
|
8617
|
+
const copyFirstFormLink = useCallback13(async () => {
|
|
8618
|
+
if (!firstFormUrl) return;
|
|
8619
|
+
try {
|
|
8620
|
+
await navigator.clipboard.writeText(firstFormUrl);
|
|
8621
|
+
addToast({ type: "success", message: `\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${firstFormStep == null ? void 0 : firstFormStep.label}" \u05D4\u05D5\u05E2\u05EA\u05E7` });
|
|
8622
|
+
} catch (e) {
|
|
8623
|
+
window.prompt(`\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${firstFormStep == null ? void 0 : firstFormStep.label}" - \u05D4\u05E2\u05EA\u05E7 \u05D9\u05D3\u05E0\u05D9\u05EA:`, firstFormUrl);
|
|
8624
|
+
}
|
|
8625
|
+
}, [firstFormUrl, firstFormStep, addToast]);
|
|
8610
8626
|
const renderRowExtra = useCallback13(
|
|
8611
8627
|
(row) => {
|
|
8612
8628
|
var _a;
|
|
@@ -8656,7 +8672,35 @@ function FormTrackingTableBlock(props) {
|
|
|
8656
8672
|
[config, sentOverrides, busyKey, readOnly, copyLink, setSent]
|
|
8657
8673
|
);
|
|
8658
8674
|
if (!config) return /* @__PURE__ */ jsx17(TableBlockClient, __spreadValues({}, props));
|
|
8659
|
-
return /* @__PURE__ */
|
|
8675
|
+
return /* @__PURE__ */ jsxs14("div", { children: [
|
|
8676
|
+
firstFormUrl && /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2 mb-2 text-xs", children: [
|
|
8677
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-semibold text-slate-600 whitespace-nowrap", children: [
|
|
8678
|
+
"\u05E7\u05D9\u05E9\u05D5\u05E8 \u05E7\u05D1\u05D5\u05E2 \u05DC\u05D8\u05D5\u05E4\u05E1 \u05D4\u05E8\u05D0\u05E9\u05D5\u05DF (",
|
|
8679
|
+
firstFormStep == null ? void 0 : firstFormStep.label,
|
|
8680
|
+
"):"
|
|
8681
|
+
] }),
|
|
8682
|
+
/* @__PURE__ */ jsx17(
|
|
8683
|
+
"input",
|
|
8684
|
+
{
|
|
8685
|
+
readOnly: true,
|
|
8686
|
+
value: firstFormUrl,
|
|
8687
|
+
dir: "ltr",
|
|
8688
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
8689
|
+
className: "flex-1 min-w-[200px] rounded-lg border border-slate-200 bg-slate-50 px-2 py-1 text-[11px] text-slate-600"
|
|
8690
|
+
}
|
|
8691
|
+
),
|
|
8692
|
+
/* @__PURE__ */ jsx17(
|
|
8693
|
+
"button",
|
|
8694
|
+
{
|
|
8695
|
+
type: "button",
|
|
8696
|
+
onClick: copyFirstFormLink,
|
|
8697
|
+
className: "font-semibold text-brand hover:underline cursor-pointer whitespace-nowrap",
|
|
8698
|
+
children: "\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D9\u05E9\u05D5\u05E8"
|
|
8699
|
+
}
|
|
8700
|
+
)
|
|
8701
|
+
] }),
|
|
8702
|
+
/* @__PURE__ */ jsx17(TableBlockClient, __spreadProps(__spreadValues({}, props), { rowExtraHeader: "\u05D4\u05EA\u05E7\u05D3\u05DE\u05D5\u05EA \u05D8\u05E4\u05E1\u05D9\u05DD", renderRowExtra }))
|
|
8703
|
+
] });
|
|
8660
8704
|
}
|
|
8661
8705
|
|
|
8662
8706
|
// src/components/TableBlock/TableBlock.tsx
|