@squaredr/fieldcraft-pro 1.6.4 → 1.7.0
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/README.md +13 -13
- package/dist/{chunk-VECQKSWS.mjs → chunk-4MMKB2EW.mjs} +60 -86
- package/dist/{chunk-CFVT2R42.mjs → chunk-4TN6YJDF.mjs} +1 -1
- package/dist/{chunk-5LKGCZAW.mjs → chunk-GZIV2XAD.mjs} +1 -1
- package/dist/{chunk-ANBMT5AW.mjs → chunk-J5V6OVZO.mjs} +127 -55
- package/dist/chunk-VEP3DOCQ.mjs +1111 -0
- package/dist/form-builder/index.d.mts +176 -6
- package/dist/form-builder/index.d.ts +176 -6
- package/dist/form-builder/index.js +128 -79
- package/dist/form-builder/index.mjs +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1310 -147
- package/dist/index.mjs +14 -12
- package/dist/response-viewer/index.js +4 -27
- package/dist/response-viewer/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/templates/index.d.mts +43 -0
- package/dist/templates/index.d.ts +43 -0
- package/dist/templates/index.js +1119 -0
- package/dist/templates/index.mjs +1 -0
- package/dist/theme-editor/index.js +4 -27
- package/dist/theme-editor/index.mjs +2 -2
- package/dist/types-bFHsZT1n.d.mts +217 -0
- package/dist/types-bFHsZT1n.d.ts +217 -0
- package/package.json +8 -7
- package/dist/index-D19524df.d.mts +0 -387
- package/dist/index-D19524df.d.ts +0 -387
|
@@ -12,27 +12,6 @@ var react$1 = require('@xyflow/react');
|
|
|
12
12
|
require('@xyflow/react/dist/style.css');
|
|
13
13
|
|
|
14
14
|
// ../license/dist/index.mjs
|
|
15
|
-
var PRO_FEATURES = [
|
|
16
|
-
"SchemaEditor",
|
|
17
|
-
"ResponseViewer",
|
|
18
|
-
"ThemeEditor",
|
|
19
|
-
"FormBuilder",
|
|
20
|
-
"ApiManager",
|
|
21
|
-
"Analytics"
|
|
22
|
-
];
|
|
23
|
-
var ALL_FEATURES = [
|
|
24
|
-
...PRO_FEATURES,
|
|
25
|
-
"Telehealth"
|
|
26
|
-
];
|
|
27
|
-
var TIER_FEATURES = {
|
|
28
|
-
starter: ["SchemaEditor", "ResponseViewer"],
|
|
29
|
-
pro: PRO_FEATURES,
|
|
30
|
-
business: ALL_FEATURES,
|
|
31
|
-
enterprise: ALL_FEATURES
|
|
32
|
-
};
|
|
33
|
-
function tierHasFeature(tier, featureName) {
|
|
34
|
-
return TIER_FEATURES[tier]?.includes(featureName) ?? false;
|
|
35
|
-
}
|
|
36
15
|
var DEV_HOSTNAMES = /* @__PURE__ */ new Set([
|
|
37
16
|
"localhost",
|
|
38
17
|
"127.0.0.1",
|
|
@@ -104,7 +83,8 @@ function isProductionEnvironment() {
|
|
|
104
83
|
}
|
|
105
84
|
return false;
|
|
106
85
|
}
|
|
107
|
-
|
|
86
|
+
typeof process !== "undefined" && process.env?.NEXT_PUBLIC_FCPRO_PING_URL || "https://fieldcraft.dev/api/license/ping";
|
|
87
|
+
var defaultContext = { status: "validating" };
|
|
108
88
|
var LicenseCtx = react.createContext(defaultContext);
|
|
109
89
|
function useLicense() {
|
|
110
90
|
return react.useContext(LicenseCtx);
|
|
@@ -304,7 +284,7 @@ function UnlicensedOverlay({ featureName, reason, children }) {
|
|
|
304
284
|
}
|
|
305
285
|
function requireLicense(Component3, featureName) {
|
|
306
286
|
function LicenseGated(props) {
|
|
307
|
-
const { status
|
|
287
|
+
const { status } = useLicense();
|
|
308
288
|
const isProduction = isProductionEnvironment();
|
|
309
289
|
if (!isProduction) {
|
|
310
290
|
return /* @__PURE__ */ jsxRuntime.jsx(Component3, { ...props });
|
|
@@ -312,8 +292,7 @@ function requireLicense(Component3, featureName) {
|
|
|
312
292
|
if (status === "validating") {
|
|
313
293
|
return null;
|
|
314
294
|
}
|
|
315
|
-
|
|
316
|
-
if (isLicensed) {
|
|
295
|
+
if (status === "valid") {
|
|
317
296
|
return /* @__PURE__ */ jsxRuntime.jsx(Component3, { ...props });
|
|
318
297
|
}
|
|
319
298
|
let reason = "A valid license is required for production use.";
|
|
@@ -325,8 +304,6 @@ function requireLicense(Component3, featureName) {
|
|
|
325
304
|
reason = "This license key has been revoked. Please contact support or purchase a new license.";
|
|
326
305
|
} else if (status === "domain_mismatch") {
|
|
327
306
|
reason = "This license key is registered to a different domain. Each key can only be used on one production domain. Please purchase a new license for this domain.";
|
|
328
|
-
} else if (!tier || !tierHasFeature(tier, featureName)) {
|
|
329
|
-
reason = "Your license does not include this feature. Please upgrade your plan.";
|
|
330
307
|
}
|
|
331
308
|
return /* @__PURE__ */ jsxRuntime.jsx(UnlicensedOverlay, { featureName, reason, children: /* @__PURE__ */ jsxRuntime.jsx(Component3, { ...props }) });
|
|
332
309
|
}
|
|
@@ -3752,7 +3729,7 @@ var defaultEdgeOptions = {
|
|
|
3752
3729
|
height: 12
|
|
3753
3730
|
}
|
|
3754
3731
|
};
|
|
3755
|
-
function LogicFlowEditor({ schema, onChange
|
|
3732
|
+
function LogicFlowEditor({ schema, onChange }) {
|
|
3756
3733
|
const noSections = schema.sections.length === 0;
|
|
3757
3734
|
const flowGraph = react.useMemo(() => buildReactFlowGraph(schema), [schema]);
|
|
3758
3735
|
const [nodes, setNodes, onNodesChange] = react$1.useNodesState(flowGraph.nodes);
|
|
@@ -3844,33 +3821,89 @@ function LogicFlowEditor({ schema, onChange, onClose }) {
|
|
|
3844
3821
|
const jumpCount = flowGraph.edges.filter(
|
|
3845
3822
|
(e) => e.data?.edgeType === "onExit"
|
|
3846
3823
|
).length;
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3824
|
+
const totalFields = react.useMemo(
|
|
3825
|
+
() => schema.sections.reduce((sum, s) => sum + s.questions.length, 0),
|
|
3826
|
+
[schema]
|
|
3827
|
+
);
|
|
3828
|
+
const conditionalFields = react.useMemo(
|
|
3829
|
+
() => schema.sections.reduce(
|
|
3830
|
+
(sum, s) => sum + s.questions.filter((q) => !!q.showIf).length,
|
|
3831
|
+
0
|
|
3832
|
+
),
|
|
3833
|
+
[schema]
|
|
3834
|
+
);
|
|
3835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.ReactFlowProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3836
|
+
LogicFlowInner,
|
|
3837
|
+
{
|
|
3838
|
+
noSections,
|
|
3839
|
+
nodes,
|
|
3840
|
+
edges,
|
|
3841
|
+
onNodesChange,
|
|
3842
|
+
onEdgesChange,
|
|
3843
|
+
onNodeClick,
|
|
3844
|
+
onConnect,
|
|
3845
|
+
onEdgesDelete,
|
|
3846
|
+
selectedFieldId,
|
|
3847
|
+
selectedQuestion,
|
|
3848
|
+
setSelectedFieldId,
|
|
3849
|
+
handleConditionUpdate,
|
|
3850
|
+
schema,
|
|
3851
|
+
sectionIds,
|
|
3852
|
+
showIfCount,
|
|
3853
|
+
jumpCount,
|
|
3854
|
+
totalFields,
|
|
3855
|
+
conditionalFields
|
|
3856
|
+
}
|
|
3857
|
+
) });
|
|
3858
|
+
}
|
|
3859
|
+
function LogicFlowInner({
|
|
3860
|
+
noSections,
|
|
3861
|
+
nodes,
|
|
3862
|
+
edges,
|
|
3863
|
+
onNodesChange,
|
|
3864
|
+
onEdgesChange,
|
|
3865
|
+
onNodeClick,
|
|
3866
|
+
onConnect,
|
|
3867
|
+
onEdgesDelete,
|
|
3868
|
+
selectedFieldId,
|
|
3869
|
+
selectedQuestion,
|
|
3870
|
+
setSelectedFieldId,
|
|
3871
|
+
handleConditionUpdate,
|
|
3872
|
+
schema,
|
|
3873
|
+
sectionIds,
|
|
3874
|
+
showIfCount,
|
|
3875
|
+
jumpCount,
|
|
3876
|
+
totalFields,
|
|
3877
|
+
conditionalFields
|
|
3878
|
+
}) {
|
|
3879
|
+
const { zoomIn, zoomOut, fitView } = react$1.useReactFlow();
|
|
3880
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col bg-background min-h-0", children: [
|
|
3881
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 h-9 flex items-center justify-between px-4 border-b border-border bg-card/50", children: [
|
|
3882
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
3883
|
+
sectionIds.length,
|
|
3884
|
+
" section",
|
|
3885
|
+
sectionIds.length !== 1 ? "s" : "",
|
|
3886
|
+
" \xB7 ",
|
|
3887
|
+
totalFields,
|
|
3888
|
+
" field",
|
|
3889
|
+
totalFields !== 1 ? "s" : "",
|
|
3890
|
+
conditionalFields > 0 && ` \xB7 ${conditionalFields} conditional`,
|
|
3891
|
+
showIfCount > 0 && ` \xB7 ${showIfCount} rule${showIfCount !== 1 ? "s" : ""}`,
|
|
3892
|
+
jumpCount > 0 && ` \xB7 ${jumpCount} jump${jumpCount !== 1 ? "s" : ""}`
|
|
3893
|
+
] }) }),
|
|
3863
3894
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
3864
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground mr-2", children: "Drag between nodes to create conditions \xB7 Select edges
|
|
3865
|
-
/* @__PURE__ */ jsxRuntime.jsx(fieldcraftReact.Button, { variant: "ghost", size: "icon-
|
|
3895
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground mr-2 hidden md:inline", children: "Drag between nodes to create conditions \xB7 Select edges + Delete to remove" }),
|
|
3896
|
+
/* @__PURE__ */ jsxRuntime.jsx(fieldcraftReact.Button, { variant: "ghost", size: "icon-xs", onClick: () => zoomOut(), title: "Zoom out", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomOut, { size: 14, strokeWidth: 1.75 }) }),
|
|
3897
|
+
/* @__PURE__ */ jsxRuntime.jsx(fieldcraftReact.Button, { variant: "ghost", size: "icon-xs", onClick: () => zoomIn(), title: "Zoom in", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomIn, { size: 14, strokeWidth: 1.75 }) }),
|
|
3898
|
+
/* @__PURE__ */ jsxRuntime.jsx(fieldcraftReact.Button, { variant: "ghost", size: "icon-xs", onClick: () => fitView({ padding: 0.2 }), title: "Fit to view", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize, { size: 14, strokeWidth: 1.75 }) })
|
|
3866
3899
|
] })
|
|
3867
3900
|
] }),
|
|
3868
|
-
noSections ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground text-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-
|
|
3869
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { size:
|
|
3870
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: "No
|
|
3871
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs max-w-xs", children: "
|
|
3872
|
-
] }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex", children: [
|
|
3873
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3901
|
+
noSections ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground text-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-3", children: [
|
|
3902
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { size: 40, className: "mx-auto opacity-30" }),
|
|
3903
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: "No logic to display" }),
|
|
3904
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs max-w-xs mx-auto", children: "Switch to Design mode and add sections with fields. Then come back here to visualize and edit branching logic." })
|
|
3905
|
+
] }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex min-h-0", children: [
|
|
3906
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3874
3907
|
react$1.ReactFlow,
|
|
3875
3908
|
{
|
|
3876
3909
|
nodes,
|
|
@@ -3889,7 +3922,6 @@ function LogicFlowEditor({ schema, onChange, onClose }) {
|
|
|
3889
3922
|
proOptions: { hideAttribution: true },
|
|
3890
3923
|
children: [
|
|
3891
3924
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Background, { gap: 20, size: 1 }),
|
|
3892
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.Controls, { showInteractive: false }),
|
|
3893
3925
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3894
3926
|
react$1.MiniMap,
|
|
3895
3927
|
{
|
|
@@ -3904,9 +3936,9 @@ function LogicFlowEditor({ schema, onChange, onClose }) {
|
|
|
3904
3936
|
]
|
|
3905
3937
|
}
|
|
3906
3938
|
) }),
|
|
3907
|
-
selectedFieldId && selectedQuestion && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-72 border-l border-border bg-card overflow-auto", children: [
|
|
3939
|
+
selectedFieldId && selectedQuestion && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-72 shrink-0 border-l border-border bg-card overflow-auto", children: [
|
|
3908
3940
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 border-b border-border flex items-center justify-between", children: [
|
|
3909
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3941
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
3910
3942
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold truncate", children: selectedQuestion.label || selectedQuestion.id }),
|
|
3911
3943
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-muted-foreground", children: selectedQuestion.type })
|
|
3912
3944
|
] }),
|
|
@@ -3917,7 +3949,7 @@ function LogicFlowEditor({ schema, onChange, onClose }) {
|
|
|
3917
3949
|
size: "icon-xs",
|
|
3918
3950
|
onClick: () => setSelectedFieldId(null),
|
|
3919
3951
|
title: "Close panel",
|
|
3920
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3952
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: "\xD7" })
|
|
3921
3953
|
}
|
|
3922
3954
|
)
|
|
3923
3955
|
] }),
|
|
@@ -3931,7 +3963,7 @@ function LogicFlowEditor({ schema, onChange, onClose }) {
|
|
|
3931
3963
|
) })
|
|
3932
3964
|
] })
|
|
3933
3965
|
] }),
|
|
3934
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 px-4 py-
|
|
3966
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 px-4 py-1.5 border-t border-border bg-card/50 flex items-center gap-4 text-[11px] text-muted-foreground flex-wrap", children: [
|
|
3935
3967
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
3936
3968
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5 h-0.5 rounded", style: { background: "var(--muted-foreground)", opacity: 0.4 } }),
|
|
3937
3969
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "flow" })
|
|
@@ -4186,7 +4218,6 @@ function FormBuilderCore(props) {
|
|
|
4186
4218
|
const [viewMode, setViewMode] = react.useState("design");
|
|
4187
4219
|
const [jsonText, setJsonText] = react.useState("");
|
|
4188
4220
|
const [jsonSwitchError, setJsonSwitchError] = react.useState(null);
|
|
4189
|
-
const [showLogicMap, setShowLogicMap] = react.useState(false);
|
|
4190
4221
|
const [showTemplateGallery, setShowTemplateGallery] = react.useState(false);
|
|
4191
4222
|
const [saveValidationErrors, setSaveValidationErrors] = react.useState(null);
|
|
4192
4223
|
const [schemaUrlLoading, setSchemaUrlLoading] = react.useState(!!schemaUrl);
|
|
@@ -4343,6 +4374,11 @@ ${details}`);
|
|
|
4343
4374
|
handleSave();
|
|
4344
4375
|
return;
|
|
4345
4376
|
}
|
|
4377
|
+
if (mod && e.key === "l") {
|
|
4378
|
+
e.preventDefault();
|
|
4379
|
+
handleViewModeChange(viewMode === "logic" ? "design" : "logic");
|
|
4380
|
+
return;
|
|
4381
|
+
}
|
|
4346
4382
|
if (isEditing) return;
|
|
4347
4383
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
4348
4384
|
const sel = builderState.selectedItem;
|
|
@@ -4373,7 +4409,7 @@ ${details}`);
|
|
|
4373
4409
|
}
|
|
4374
4410
|
}
|
|
4375
4411
|
},
|
|
4376
|
-
[builderState, handleSave]
|
|
4412
|
+
[builderState, handleSave, handleViewModeChange, viewMode]
|
|
4377
4413
|
);
|
|
4378
4414
|
return /* @__PURE__ */ jsxRuntime.jsx(FormBuilderThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4379
4415
|
core.DndContext,
|
|
@@ -4464,6 +4500,19 @@ ${details}`);
|
|
|
4464
4500
|
"JSON"
|
|
4465
4501
|
]
|
|
4466
4502
|
}
|
|
4503
|
+
),
|
|
4504
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4505
|
+
fieldcraftReact.Button,
|
|
4506
|
+
{
|
|
4507
|
+
variant: viewMode === "logic" ? "secondary" : "ghost",
|
|
4508
|
+
size: "sm",
|
|
4509
|
+
onClick: () => handleViewModeChange("logic"),
|
|
4510
|
+
className: "gap-1.5 h-7 px-2.5 text-xs",
|
|
4511
|
+
children: [
|
|
4512
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { size: 13, strokeWidth: 1.75 }),
|
|
4513
|
+
"Logic"
|
|
4514
|
+
]
|
|
4515
|
+
}
|
|
4467
4516
|
)
|
|
4468
4517
|
] }),
|
|
4469
4518
|
toolbarExtra
|
|
@@ -4480,17 +4529,6 @@ ${details}`);
|
|
|
4480
4529
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutTemplate, { size: 15, strokeWidth: 1.75 })
|
|
4481
4530
|
}
|
|
4482
4531
|
),
|
|
4483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4484
|
-
fieldcraftReact.Button,
|
|
4485
|
-
{
|
|
4486
|
-
variant: "ghost",
|
|
4487
|
-
size: "icon-sm",
|
|
4488
|
-
onClick: () => setShowLogicMap(true),
|
|
4489
|
-
title: "View branching logic map",
|
|
4490
|
-
"aria-label": "Logic map",
|
|
4491
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { size: 15, strokeWidth: 1.75 })
|
|
4492
|
-
}
|
|
4493
|
-
),
|
|
4494
4532
|
/* @__PURE__ */ jsxRuntime.jsx(fieldcraftReact.Separator, { orientation: "vertical", className: "mx-1 h-5" }),
|
|
4495
4533
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4496
4534
|
fieldcraftReact.Button,
|
|
@@ -4574,6 +4612,19 @@ ${details}`);
|
|
|
4574
4612
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: "JSON" })
|
|
4575
4613
|
]
|
|
4576
4614
|
}
|
|
4615
|
+
),
|
|
4616
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4617
|
+
fieldcraftReact.Button,
|
|
4618
|
+
{
|
|
4619
|
+
variant: viewMode === "logic" ? "secondary" : "ghost",
|
|
4620
|
+
size: "sm",
|
|
4621
|
+
onClick: () => handleViewModeChange("logic"),
|
|
4622
|
+
className: "gap-1 h-7 px-2 text-xs",
|
|
4623
|
+
children: [
|
|
4624
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { size: 12, strokeWidth: 1.75 }),
|
|
4625
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: "Logic" })
|
|
4626
|
+
]
|
|
4627
|
+
}
|
|
4577
4628
|
)
|
|
4578
4629
|
] }),
|
|
4579
4630
|
toolbarExtra,
|
|
@@ -4707,7 +4758,13 @@ ${details}`);
|
|
|
4707
4758
|
errors: jsonErrors,
|
|
4708
4759
|
onValidate: validateJson
|
|
4709
4760
|
}
|
|
4710
|
-
) : viewMode === "preview" ? /* @__PURE__ */ jsxRuntime.jsx(FormPreviewPanel, { schema: builderState.schema, preview }) : /* @__PURE__ */ jsxRuntime.
|
|
4761
|
+
) : viewMode === "preview" ? /* @__PURE__ */ jsxRuntime.jsx(FormPreviewPanel, { schema: builderState.schema, preview }) : viewMode === "logic" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4762
|
+
LogicFlowEditor,
|
|
4763
|
+
{
|
|
4764
|
+
schema: builderState.schema,
|
|
4765
|
+
onChange: (updated) => builderState.resetSchema(updated)
|
|
4766
|
+
}
|
|
4767
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4711
4768
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsxRuntime.jsx(QuestionPalette, { questionTypes: mergedQuestionTypes, palette }) }),
|
|
4712
4769
|
/* @__PURE__ */ jsxRuntime.jsx(FormCanvas, { builderState }),
|
|
4713
4770
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsxRuntime.jsx(PropertiesPanel, { builderState }) }),
|
|
@@ -4726,14 +4783,6 @@ ${details}`);
|
|
|
4726
4783
|
}
|
|
4727
4784
|
),
|
|
4728
4785
|
/* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { dropAnimation: null, children: dragDrop.activeDragItem && /* @__PURE__ */ jsxRuntime.jsx(DragOverlayContent, { item: dragDrop.activeDragItem, schema: builderState.schema, questionTypes: mergedQuestionTypes }) }),
|
|
4729
|
-
showLogicMap && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4730
|
-
LogicFlowEditor,
|
|
4731
|
-
{
|
|
4732
|
-
schema: builderState.schema,
|
|
4733
|
-
onChange: (updated) => builderState.resetSchema(updated),
|
|
4734
|
-
onClose: () => setShowLogicMap(false)
|
|
4735
|
-
}
|
|
4736
|
-
),
|
|
4737
4786
|
showTemplateGallery && templates && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4738
4787
|
TemplateGallery,
|
|
4739
4788
|
{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from '../chunk-
|
|
1
|
+
export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from '../chunk-J5V6OVZO.mjs';
|
|
2
2
|
export { cn } from '../chunk-QQ4JZGTD.mjs';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-4MMKB2EW.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
export {
|
|
3
|
+
export { BuilderStateHook, DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, UndoRedoState, addOption, addQuestion, addSection, cn, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './form-builder/index.mjs';
|
|
4
|
+
export { B as BuilderState, D as DragItem, a as DropTarget, F as FormBuilderPreviewProps, b as FormBuilderProps, c as FormBuilderTemplate, d as FormBuilderTheme, M as MutationAction, P as PaletteCategory, e as PropertyPanelTab, Q as QuestionTypeCategory, f as QuestionTypeInfo, S as SelectedItem } from './types-bFHsZT1n.mjs';
|
|
4
5
|
import { FieldComponent, FieldProps } from '@squaredr/fieldcraft-react';
|
|
5
6
|
export { ResponseField, ResponseViewer, ResponseViewerProps, ViewMode } from './response-viewer/index.mjs';
|
|
6
7
|
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor, ThemeEditorProps, ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from './theme-editor/index.mjs';
|
|
8
|
+
export { consultationBooking, consultationBookingMeta, consultationBookingSchema, ecommerceCheckout, ecommerceCheckoutMeta, ecommerceCheckoutSchema, proTemplates } from './templates/index.mjs';
|
|
7
9
|
import '@squaredr/fieldcraft-core';
|
|
8
10
|
import 'clsx';
|
|
9
11
|
import '@dnd-kit/core';
|
|
10
12
|
|
|
11
13
|
type LicenseStatus = "validating" | "valid" | "invalid" | "expired" | "revoked" | "domain_mismatch";
|
|
12
|
-
type LicenseTier = "starter" | "pro" | "business" | "enterprise";
|
|
13
14
|
type LicenseContext = {
|
|
14
15
|
status: LicenseStatus;
|
|
15
|
-
tier: LicenseTier | null;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
type FieldCraftProProviderProps = {
|
|
@@ -65,7 +65,7 @@ declare function isProductionEnvironment(): boolean;
|
|
|
65
65
|
* 3. `config.serverUrl` — SaaS mode (POST to create intent)
|
|
66
66
|
* 4. Nothing — show setup message
|
|
67
67
|
*
|
|
68
|
-
* Requires `@squaredr/paykit-react` and `@squaredr/paykit
|
|
68
|
+
* Requires `@squaredr/paykit-react` and `@squaredr/paykit/stripe/client` as peer deps.
|
|
69
69
|
*/
|
|
70
70
|
declare function ProPaymentField(props: FieldProps): react_jsx_runtime.JSX.Element;
|
|
71
71
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
export {
|
|
3
|
+
export { BuilderStateHook, DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, UndoRedoState, addOption, addQuestion, addSection, cn, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './form-builder/index.js';
|
|
4
|
+
export { B as BuilderState, D as DragItem, a as DropTarget, F as FormBuilderPreviewProps, b as FormBuilderProps, c as FormBuilderTemplate, d as FormBuilderTheme, M as MutationAction, P as PaletteCategory, e as PropertyPanelTab, Q as QuestionTypeCategory, f as QuestionTypeInfo, S as SelectedItem } from './types-bFHsZT1n.js';
|
|
4
5
|
import { FieldComponent, FieldProps } from '@squaredr/fieldcraft-react';
|
|
5
6
|
export { ResponseField, ResponseViewer, ResponseViewerProps, ViewMode } from './response-viewer/index.js';
|
|
6
7
|
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor, ThemeEditorProps, ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from './theme-editor/index.js';
|
|
8
|
+
export { consultationBooking, consultationBookingMeta, consultationBookingSchema, ecommerceCheckout, ecommerceCheckoutMeta, ecommerceCheckoutSchema, proTemplates } from './templates/index.js';
|
|
7
9
|
import '@squaredr/fieldcraft-core';
|
|
8
10
|
import 'clsx';
|
|
9
11
|
import '@dnd-kit/core';
|
|
10
12
|
|
|
11
13
|
type LicenseStatus = "validating" | "valid" | "invalid" | "expired" | "revoked" | "domain_mismatch";
|
|
12
|
-
type LicenseTier = "starter" | "pro" | "business" | "enterprise";
|
|
13
14
|
type LicenseContext = {
|
|
14
15
|
status: LicenseStatus;
|
|
15
|
-
tier: LicenseTier | null;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
type FieldCraftProProviderProps = {
|
|
@@ -65,7 +65,7 @@ declare function isProductionEnvironment(): boolean;
|
|
|
65
65
|
* 3. `config.serverUrl` — SaaS mode (POST to create intent)
|
|
66
66
|
* 4. Nothing — show setup message
|
|
67
67
|
*
|
|
68
|
-
* Requires `@squaredr/paykit-react` and `@squaredr/paykit
|
|
68
|
+
* Requires `@squaredr/paykit-react` and `@squaredr/paykit/stripe/client` as peer deps.
|
|
69
69
|
*/
|
|
70
70
|
declare function ProPaymentField(props: FieldProps): react_jsx_runtime.JSX.Element;
|
|
71
71
|
|