@squaredr/fieldcraft-pro 1.3.0 → 1.4.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/dist/chunk-22T5PY6L.mjs +1081 -0
- package/dist/{chunk-4BX7FCXH.mjs → chunk-BK4SMEW4.mjs} +840 -21
- package/dist/{chunk-GNBXIG63.mjs → chunk-BYT2P3I6.mjs} +1264 -88
- package/dist/form-builder/index.d.mts +7 -367
- package/dist/form-builder/index.d.ts +7 -367
- package/dist/form-builder/index.js +1266 -90
- package/dist/form-builder/index.mjs +1 -1
- package/dist/index-nvIvXlmc.d.mts +398 -0
- package/dist/index-nvIvXlmc.d.ts +398 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2926 -335
- package/dist/index.mjs +4 -4
- package/dist/preview-schema-DFvV4y6J.d.mts +66 -0
- package/dist/preview-schema-DFvV4y6J.d.ts +66 -0
- package/dist/response-viewer/index.d.mts +9 -1
- package/dist/response-viewer/index.d.ts +9 -1
- package/dist/response-viewer/index.js +838 -19
- package/dist/response-viewer/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme-editor/index.d.mts +30 -26
- package/dist/theme-editor/index.d.ts +30 -26
- package/dist/theme-editor/index.js +702 -22
- package/dist/theme-editor/index.mjs +1 -1
- package/package.json +8 -6
- package/theme-editor/styles.css +266 -62
- package/dist/chunk-7LQW5QYT.mjs +0 -407
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, cleanPreset, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, squaredrDarkPreset, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './chunk-
|
|
2
|
-
export { ResponseViewer } from './chunk-
|
|
1
|
+
export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, cleanPreset, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, squaredrDarkPreset, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './chunk-BYT2P3I6.mjs';
|
|
2
|
+
export { ResponseViewer } from './chunk-BK4SMEW4.mjs';
|
|
3
3
|
export { cn } from './chunk-QQ4JZGTD.mjs';
|
|
4
|
-
export { PREVIEW_SCHEMA, ThemeEditor, ThemeEditorInner } from './chunk-
|
|
4
|
+
export { PREVIEW_SCHEMA, ThemeEditor, ThemeEditorInner } from './chunk-22T5PY6L.mjs';
|
|
5
5
|
export { FieldCraftProProvider, UnlicensedOverlay, isProductionEnvironment, requireLicense, useLicense, validateLicense } from './chunk-VECQKSWS.mjs';
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
if (typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" && globalThis.process.env?.NODE_ENV !== "production") {
|
|
9
9
|
const _fc_banner = `
|
|
10
|
-
%c FieldCraft Pro %c v1.
|
|
10
|
+
%c FieldCraft Pro %c v1.4.0
|
|
11
11
|
|
|
12
12
|
%cForm Builder \xB7 Response Viewer \xB7 Theme Editor
|
|
13
13
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { FormEngineTheme, FormEngineSchema } from '@squaredr/fieldcraft-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ThemeEditor chrome theme configuration.
|
|
8
|
+
* Controls the appearance of the editor UI (toolbar, controls, panels)
|
|
9
|
+
* — NOT the form preview, which uses the FormEngineTheme being edited.
|
|
10
|
+
*
|
|
11
|
+
* All values are CSS color strings (hex, oklch, hsl, etc.).
|
|
12
|
+
*/
|
|
13
|
+
type ThemeEditorTheme = {
|
|
14
|
+
/** Main background of the entire editor */
|
|
15
|
+
background?: string;
|
|
16
|
+
/** Surface background (toolbar, panels, editor column) */
|
|
17
|
+
surface?: string;
|
|
18
|
+
/** Surface hover state */
|
|
19
|
+
surfaceHover?: string;
|
|
20
|
+
/** Primary text color */
|
|
21
|
+
text?: string;
|
|
22
|
+
/** Muted text color (labels, secondary info) */
|
|
23
|
+
textMuted?: string;
|
|
24
|
+
/** Dim text color (suffixes, tertiary info) */
|
|
25
|
+
textDim?: string;
|
|
26
|
+
/** Default border color */
|
|
27
|
+
border?: string;
|
|
28
|
+
/** Strong border color (inputs, emphasis) */
|
|
29
|
+
borderStrong?: string;
|
|
30
|
+
/** Input background color */
|
|
31
|
+
inputBackground?: string;
|
|
32
|
+
/** Primary accent color (buttons, focus) */
|
|
33
|
+
accent?: string;
|
|
34
|
+
/** Text color on accent backgrounds */
|
|
35
|
+
accentForeground?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ThemeEditorProps = {
|
|
39
|
+
/** Initial theme to load. Defaults to draftingTealPreset. */
|
|
40
|
+
initialTheme?: FormEngineTheme;
|
|
41
|
+
/** Called on every theme change. */
|
|
42
|
+
onChange?: (theme: FormEngineTheme) => void;
|
|
43
|
+
/** Called when user clicks Save or presses Ctrl+S. */
|
|
44
|
+
onSave?: (theme: FormEngineTheme) => void;
|
|
45
|
+
/** Editor chrome theme. Controls toolbar, panel, and control appearance. */
|
|
46
|
+
theme?: ThemeEditorTheme;
|
|
47
|
+
/** Container height. */
|
|
48
|
+
height?: string | number;
|
|
49
|
+
/** Container width. */
|
|
50
|
+
width?: string | number;
|
|
51
|
+
/** Additional CSS class on root element. */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Extra content in the toolbar. */
|
|
54
|
+
toolbarExtra?: ReactNode;
|
|
55
|
+
/** Show live preview panel. Default: true. */
|
|
56
|
+
showPreview?: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
declare const ThemeEditor: react.ComponentType<ThemeEditorProps>;
|
|
60
|
+
|
|
61
|
+
declare function ThemeEditorInner({ initialTheme, onChange, onSave, theme: chromeTheme, height, width, className, toolbarExtra, showPreview, }: ThemeEditorProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
/** Compact schema used in the ThemeEditor live preview panel. */
|
|
64
|
+
declare const PREVIEW_SCHEMA: FormEngineSchema;
|
|
65
|
+
|
|
66
|
+
export { PREVIEW_SCHEMA as P, ThemeEditor as T, ThemeEditorInner as a, type ThemeEditorProps as b, type ThemeEditorTheme as c };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { FormEngineTheme, FormEngineSchema } from '@squaredr/fieldcraft-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ThemeEditor chrome theme configuration.
|
|
8
|
+
* Controls the appearance of the editor UI (toolbar, controls, panels)
|
|
9
|
+
* — NOT the form preview, which uses the FormEngineTheme being edited.
|
|
10
|
+
*
|
|
11
|
+
* All values are CSS color strings (hex, oklch, hsl, etc.).
|
|
12
|
+
*/
|
|
13
|
+
type ThemeEditorTheme = {
|
|
14
|
+
/** Main background of the entire editor */
|
|
15
|
+
background?: string;
|
|
16
|
+
/** Surface background (toolbar, panels, editor column) */
|
|
17
|
+
surface?: string;
|
|
18
|
+
/** Surface hover state */
|
|
19
|
+
surfaceHover?: string;
|
|
20
|
+
/** Primary text color */
|
|
21
|
+
text?: string;
|
|
22
|
+
/** Muted text color (labels, secondary info) */
|
|
23
|
+
textMuted?: string;
|
|
24
|
+
/** Dim text color (suffixes, tertiary info) */
|
|
25
|
+
textDim?: string;
|
|
26
|
+
/** Default border color */
|
|
27
|
+
border?: string;
|
|
28
|
+
/** Strong border color (inputs, emphasis) */
|
|
29
|
+
borderStrong?: string;
|
|
30
|
+
/** Input background color */
|
|
31
|
+
inputBackground?: string;
|
|
32
|
+
/** Primary accent color (buttons, focus) */
|
|
33
|
+
accent?: string;
|
|
34
|
+
/** Text color on accent backgrounds */
|
|
35
|
+
accentForeground?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ThemeEditorProps = {
|
|
39
|
+
/** Initial theme to load. Defaults to draftingTealPreset. */
|
|
40
|
+
initialTheme?: FormEngineTheme;
|
|
41
|
+
/** Called on every theme change. */
|
|
42
|
+
onChange?: (theme: FormEngineTheme) => void;
|
|
43
|
+
/** Called when user clicks Save or presses Ctrl+S. */
|
|
44
|
+
onSave?: (theme: FormEngineTheme) => void;
|
|
45
|
+
/** Editor chrome theme. Controls toolbar, panel, and control appearance. */
|
|
46
|
+
theme?: ThemeEditorTheme;
|
|
47
|
+
/** Container height. */
|
|
48
|
+
height?: string | number;
|
|
49
|
+
/** Container width. */
|
|
50
|
+
width?: string | number;
|
|
51
|
+
/** Additional CSS class on root element. */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Extra content in the toolbar. */
|
|
54
|
+
toolbarExtra?: ReactNode;
|
|
55
|
+
/** Show live preview panel. Default: true. */
|
|
56
|
+
showPreview?: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
declare const ThemeEditor: react.ComponentType<ThemeEditorProps>;
|
|
60
|
+
|
|
61
|
+
declare function ThemeEditorInner({ initialTheme, onChange, onSave, theme: chromeTheme, height, width, className, toolbarExtra, showPreview, }: ThemeEditorProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
/** Compact schema used in the ThemeEditor live preview panel. */
|
|
64
|
+
declare const PREVIEW_SCHEMA: FormEngineSchema;
|
|
65
|
+
|
|
66
|
+
export { PREVIEW_SCHEMA as P, ThemeEditor as T, ThemeEditorInner as a, type ThemeEditorProps as b, type ThemeEditorTheme as c };
|
|
@@ -20,8 +20,16 @@ type ResponseViewerProps = {
|
|
|
20
20
|
onExport?: (format: "csv" | "json", count: number) => void;
|
|
21
21
|
/** Number of responses per page in table/card views. Defaults to 25. */
|
|
22
22
|
pageSize?: 10 | 25 | 50 | 100;
|
|
23
|
+
/** Callback to delete a single response by its sessionToken. */
|
|
24
|
+
onDelete?: (sessionToken: string) => void;
|
|
25
|
+
/** Callback to bulk-delete responses by sessionToken. */
|
|
26
|
+
onBulkDelete?: (sessionTokens: string[]) => void;
|
|
27
|
+
/** Callback to bulk-export selected responses. */
|
|
28
|
+
onBulkExport?: (responses: FormResponse[]) => void;
|
|
29
|
+
/** Enable checkbox selection for bulk operations. */
|
|
30
|
+
selectable?: boolean;
|
|
23
31
|
};
|
|
24
|
-
type ViewMode = "table" | "card" | "detail";
|
|
32
|
+
type ViewMode = "table" | "card" | "detail" | "timeline";
|
|
25
33
|
type ResponseField = {
|
|
26
34
|
questionId: string;
|
|
27
35
|
label: string;
|
|
@@ -20,8 +20,16 @@ type ResponseViewerProps = {
|
|
|
20
20
|
onExport?: (format: "csv" | "json", count: number) => void;
|
|
21
21
|
/** Number of responses per page in table/card views. Defaults to 25. */
|
|
22
22
|
pageSize?: 10 | 25 | 50 | 100;
|
|
23
|
+
/** Callback to delete a single response by its sessionToken. */
|
|
24
|
+
onDelete?: (sessionToken: string) => void;
|
|
25
|
+
/** Callback to bulk-delete responses by sessionToken. */
|
|
26
|
+
onBulkDelete?: (sessionTokens: string[]) => void;
|
|
27
|
+
/** Callback to bulk-export selected responses. */
|
|
28
|
+
onBulkExport?: (responses: FormResponse[]) => void;
|
|
29
|
+
/** Enable checkbox selection for bulk operations. */
|
|
30
|
+
selectable?: boolean;
|
|
23
31
|
};
|
|
24
|
-
type ViewMode = "table" | "card" | "detail";
|
|
32
|
+
type ViewMode = "table" | "card" | "detail" | "timeline";
|
|
25
33
|
type ResponseField = {
|
|
26
34
|
questionId: string;
|
|
27
35
|
label: string;
|