@squaredr/fieldcraft-pro 0.0.4 → 1.0.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/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
- export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, cleanPreset, cn, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, squaredrDarkPreset, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './chunk-APHGEYG4.mjs';
2
- export { ResponseViewer } from './chunk-NIKQEWPG.mjs';
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-DDQDYTMB.mjs';
2
+ export { ResponseViewer } from './chunk-LOFGBNJV.mjs';
3
+ export { cn } from './chunk-QQ4JZGTD.mjs';
3
4
  export { PREVIEW_SCHEMA, ThemeEditor, ThemeEditorInner } from './chunk-MQGR25NG.mjs';
4
5
  export { FieldCraftProProvider, UnlicensedOverlay, isProductionEnvironment, requireLicense, useLicense, validateLicense } from '@squaredr/fieldcraft-pro-license';
5
6
 
6
7
  if (typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" && globalThis.process.env?.NODE_ENV !== "production") {
7
8
  const _fc_banner = `
8
- %c FieldCraft Pro %c v0.0.0
9
+ %c FieldCraft Pro %c v1.0.1
9
10
 
10
11
  %cForm Builder \xB7 Response Viewer \xB7 Theme Editor
11
12
 
@@ -1,12 +1,15 @@
1
1
  import * as react from 'react';
2
2
  import { FormEngineSchema, FormResponse } from '@squaredr/fieldcraft-core';
3
3
 
4
+ type FieldRenderer = (field: ResponseField, response: FormResponse) => React.ReactNode;
4
5
  type ResponseViewerProps = {
5
6
  schema: FormEngineSchema;
6
7
  responses: FormResponse[];
7
8
  onResponseSelect?: (response: FormResponse) => void;
8
9
  height?: string | number;
9
10
  width?: string | number;
11
+ /** Custom per-type field renderers. Keys are field type strings (e.g. "vitals_entry"). */
12
+ fieldRenderers?: Record<string, FieldRenderer>;
10
13
  };
11
14
  type ViewMode = "table" | "card" | "detail";
12
15
  type ResponseField = {
@@ -18,4 +21,4 @@ type ResponseField = {
18
21
 
19
22
  declare const ResponseViewer: react.ComponentType<ResponseViewerProps>;
20
23
 
21
- export { type ResponseField, ResponseViewer, type ResponseViewerProps, type ViewMode };
24
+ export { type FieldRenderer, type ResponseField, ResponseViewer, type ResponseViewerProps, type ViewMode };
@@ -1,12 +1,15 @@
1
1
  import * as react from 'react';
2
2
  import { FormEngineSchema, FormResponse } from '@squaredr/fieldcraft-core';
3
3
 
4
+ type FieldRenderer = (field: ResponseField, response: FormResponse) => React.ReactNode;
4
5
  type ResponseViewerProps = {
5
6
  schema: FormEngineSchema;
6
7
  responses: FormResponse[];
7
8
  onResponseSelect?: (response: FormResponse) => void;
8
9
  height?: string | number;
9
10
  width?: string | number;
11
+ /** Custom per-type field renderers. Keys are field type strings (e.g. "vitals_entry"). */
12
+ fieldRenderers?: Record<string, FieldRenderer>;
10
13
  };
11
14
  type ViewMode = "table" | "card" | "detail";
12
15
  type ResponseField = {
@@ -18,4 +21,4 @@ type ResponseField = {
18
21
 
19
22
  declare const ResponseViewer: react.ComponentType<ResponseViewerProps>;
20
23
 
21
- export { type ResponseField, ResponseViewer, type ResponseViewerProps, type ViewMode };
24
+ export { type FieldRenderer, type ResponseField, ResponseViewer, type ResponseViewerProps, type ViewMode };