@dxos/react-ui-form 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef

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.
Files changed (123) hide show
  1. package/dist/lib/browser/index.mjs +620 -440
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +82 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/lib/node-esm/index.mjs +620 -440
  7. package/dist/lib/node-esm/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/meta.json +1 -1
  9. package/dist/lib/node-esm/translations.mjs +84 -0
  10. package/dist/lib/node-esm/translations.mjs.map +7 -0
  11. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  12. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +63 -62
  13. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  14. package/dist/types/src/components/Form/Form.d.ts +27 -4
  15. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  16. package/dist/types/src/components/Form/Form.stories.d.ts +73 -72
  17. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  18. package/dist/types/src/components/Form/FormField.d.ts +5 -5
  19. package/dist/types/src/components/Form/FormField.d.ts.map +1 -1
  20. package/dist/types/src/components/Form/FormFieldComponent.d.ts +8 -6
  21. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -1
  22. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/Form/FormFieldSet.d.ts +5 -8
  24. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -1
  25. package/dist/types/src/components/Form/fields/ArrayField.d.ts +4 -4
  26. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -1
  27. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -1
  28. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -1
  29. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +8 -1
  30. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -1
  31. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +84 -0
  32. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -1
  34. package/dist/types/src/components/Form/fields/RefField.d.ts +10 -4
  35. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -1
  36. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -1
  37. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -1
  38. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +63 -62
  39. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -1
  40. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -1
  41. package/dist/types/src/components/Form/fields/TextField.d.ts +1 -1
  42. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -1
  43. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -1
  44. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -1
  45. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +17 -3
  46. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  47. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +63 -62
  48. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  49. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +1 -1
  50. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -1
  51. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +108 -64
  52. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -1
  53. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
  54. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
  55. package/dist/types/src/components/Settings/Settings.d.ts +24 -8
  56. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -1
  57. package/dist/types/src/components/Settings/Settings.stories.d.ts +64 -62
  58. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
  60. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
  61. package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
  62. package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
  63. package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
  64. package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
  65. package/dist/types/src/components/Settings/index.d.ts +2 -0
  66. package/dist/types/src/components/Settings/index.d.ts.map +1 -1
  67. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +2 -2
  68. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  69. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +63 -62
  70. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  71. package/dist/types/src/components/testing.d.ts +4 -4
  72. package/dist/types/src/components/testing.d.ts.map +1 -1
  73. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -1
  74. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -1
  75. package/dist/types/src/index.d.ts +0 -2
  76. package/dist/types/src/index.d.ts.map +1 -1
  77. package/dist/types/src/translations.d.ts +63 -62
  78. package/dist/types/src/translations.d.ts.map +1 -1
  79. package/dist/types/src/util/field-type.d.ts +19 -0
  80. package/dist/types/src/util/field-type.d.ts.map +1 -0
  81. package/dist/types/src/util/field.d.ts.map +1 -1
  82. package/dist/types/src/util/formatting.d.ts.map +1 -1
  83. package/dist/types/src/util/index.d.ts +1 -0
  84. package/dist/types/src/util/index.d.ts.map +1 -1
  85. package/dist/types/src/util/properties.d.ts.map +1 -1
  86. package/dist/types/src/util/refs.d.ts.map +1 -1
  87. package/dist/types/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +39 -38
  89. package/src/components/FieldEditor/FieldEditor.stories.tsx +3 -4
  90. package/src/components/FieldEditor/FieldEditor.tsx +3 -2
  91. package/src/components/Form/Form.stories.tsx +5 -16
  92. package/src/components/Form/Form.tsx +30 -7
  93. package/src/components/Form/FormField.tsx +7 -5
  94. package/src/components/Form/FormFieldComponent.tsx +3 -0
  95. package/src/components/Form/FormFieldSet.tsx +1 -3
  96. package/src/components/Form/fields/ArrayField.tsx +8 -3
  97. package/src/components/Form/fields/GeoPointField.tsx +2 -1
  98. package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
  99. package/src/components/Form/fields/MarkdownField.tsx +135 -45
  100. package/src/components/Form/fields/RefField.tsx +61 -30
  101. package/src/components/Form/fields/SelectOptionField.stories.tsx +8 -5
  102. package/src/components/Form/fields/SelectOptionField.tsx +3 -2
  103. package/src/components/Form/fields/TextField.tsx +2 -2
  104. package/src/components/ObjectForm/ObjectForm.tsx +6 -5
  105. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +5 -2
  106. package/src/components/ObjectPicker/ObjectPicker.tsx +28 -12
  107. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +321 -22
  108. package/src/components/ObjectProperties/ObjectProperties.test.tsx +101 -0
  109. package/src/components/ObjectProperties/ObjectProperties.tsx +26 -14
  110. package/src/components/Settings/AUDIT.md +52 -0
  111. package/src/components/Settings/Settings.stories.tsx +50 -1
  112. package/src/components/Settings/Settings.tsx +6 -53
  113. package/src/components/Settings/SettingsFieldSet.tsx +257 -0
  114. package/src/components/Settings/SettingsItem.tsx +62 -0
  115. package/src/components/Settings/SettingsSelectField.tsx +59 -0
  116. package/src/components/Settings/index.ts +2 -0
  117. package/src/components/ViewEditor/ViewEditor.stories.tsx +17 -18
  118. package/src/components/ViewEditor/ViewEditor.tsx +4 -3
  119. package/src/components/testing.tsx +20 -21
  120. package/src/index.ts +0 -4
  121. package/src/translations.ts +7 -4
  122. package/src/util/field-type.ts +60 -0
  123. package/src/util/index.ts +1 -0
@@ -7,6 +7,13 @@ import { type FormFieldLabelProps, type FormFieldStateProps } from './FormFieldC
7
7
  import { type FormFieldSetProps as NaturalFormFieldSetProps } from './FormFieldSet';
8
8
  export type ExcludeId<S extends Schema.Schema.AnyNoContext> = Omit<Schema.Schema.Type<S>, 'id'>;
9
9
  export declare const omitId: <S extends Schema.Schema.AnyNoContext>(schema: S) => Schema.Schema<ExcludeId<S>, ExcludeId<S>>;
10
+ /**
11
+ * Drop fields annotated with `FormInputAnnotation.set(false)` from a schema so
12
+ * the form's validator doesn't trip on required-but-hidden fields. Used by
13
+ * the picker's inline create form, where a `FactoryAnnotation` typically
14
+ * supplies the hidden values (e.g. a backing-object Ref) outside the form.
15
+ */
16
+ export declare const omitHiddenFormFields: <S extends Schema.Schema.AnyNoContext>(schema: S) => S;
10
17
  type FormContextValue<T extends AnyProperties = any> = {
11
18
  /**
12
19
  * Form handler.
@@ -20,7 +27,7 @@ type FormContextValue<T extends AnyProperties = any> = {
20
27
  * Testing.
21
28
  */
22
29
  testId?: string;
23
- } & Pick<NaturalFormFieldSetProps<T>, 'readonly' | 'layout' | 'fieldMap' | 'fieldProvider' | 'projection' | 'createTypename' | 'createFieldMap'>;
30
+ } & Pick<NaturalFormFieldSetProps<T>, 'readonly' | 'layout' | 'fieldMap' | 'fieldProvider' | 'projection' | 'createTypename' | 'createFieldMap' | 'db'>;
24
31
  declare const useFormContext: (consumerName: string) => FormContextValue<any>;
25
32
  /**
26
33
  * Get the current form values.
@@ -43,15 +50,31 @@ type FormRootProps<T extends AnyProperties = AnyProperties> = PropsWithChildren<
43
50
  */
44
51
  onCancel?: () => void;
45
52
  } & Omit<FormContextValue<T>, 'form'> & Pick<FormHandlerProps<T>, 'schema' | 'autoSave' | 'values' | 'defaultValues' | 'onValidate' | 'onValuesChanged'> & Omit<NaturalFormFieldSetProps<T>, 'schema' | 'path'>>;
53
+ declare function FormRoot<T extends AnyProperties = AnyProperties>({ children, schema, values, onSave, onCancel, ...props }: FormRootProps<T>): React.JSX.Element;
54
+ declare namespace FormRoot {
55
+ var displayName: string;
56
+ }
46
57
  type FormViewportProps = {};
47
58
  type FormContentProps = ThemedClassName<PropsWithChildren<{}>>;
48
59
  type FormFieldSetProps = ThemedClassName<NaturalFormFieldSetProps<any>>;
60
+ declare function FormFieldSet(props: FormFieldSetProps): React.JSX.Element;
61
+ declare namespace FormFieldSet {
62
+ var displayName: string;
63
+ }
49
64
  type FormActionsProps = ThemedClassName<{}>;
65
+ declare function FormActions({ classNames }: FormActionsProps): React.JSX.Element | null;
66
+ declare namespace FormActions {
67
+ var displayName: string;
68
+ }
50
69
  type FormSectionProps = ThemedClassName<{
51
70
  label: string;
52
71
  description?: string;
53
72
  }>;
54
73
  type FormSubmitProps = ThemedClassName<Partial<Pick<IconButtonProps, 'icon' | 'label' | 'disabled'>>>;
74
+ declare function FormSubmit({ classNames, label, icon, disabled }: FormSubmitProps): React.JSX.Element | null;
75
+ declare namespace FormSubmit {
76
+ var displayName: string;
77
+ }
55
78
  export declare const Form: {
56
79
  Root: {
57
80
  <T extends AnyProperties = AnyProperties>({ children, schema, values, onSave, onCancel, ...props }: FormRootProps<T>): React.JSX.Element;
@@ -59,13 +82,13 @@ export declare const Form: {
59
82
  };
60
83
  Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
61
84
  classNames?: import("@dxos/ui-types").ClassNameValue;
62
- } & Pick<React.HTMLAttributes<Element>, "style" | "children" | "className" | "role"> & React.RefAttributes<HTMLDivElement>>;
85
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
63
86
  Content: React.ForwardRefExoticComponent<Omit<FormContentProps, "className"> & {
64
87
  classNames?: import("@dxos/ui-types").ClassNameValue;
65
- } & Pick<React.HTMLAttributes<Element>, "style" | "children" | "className" | "role"> & React.RefAttributes<HTMLDivElement>>;
88
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
66
89
  Section: React.ForwardRefExoticComponent<Omit<FormSectionProps, "className"> & {
67
90
  classNames?: import("@dxos/ui-types").ClassNameValue;
68
- } & Pick<React.HTMLAttributes<Element>, "style" | "children" | "className" | "role"> & React.RefAttributes<HTMLDivElement>>;
91
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
69
92
  FieldSet: {
70
93
  (props: FormFieldSetProps): React.JSX.Element;
71
94
  displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAA8B,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,eAAe,EAGrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAGpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkB,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC1G,OAAO,EAEL,KAAK,iBAAiB,IAAI,wBAAwB,EACnD,MAAM,gBAAgB,CAAC;AAKxB,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAGhG,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,CA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gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,CAAC"}
@@ -11,24 +11,24 @@ export interface Organization extends Schema.Schema.Type<typeof Organization> {
11
11
  }
12
12
  declare const Person: Type.Obj<{
13
13
  readonly name: string;
14
+ readonly ignore?: string | undefined;
15
+ readonly active?: boolean | undefined;
14
16
  readonly address?: {
15
- readonly state: string;
16
17
  readonly street: string;
17
18
  readonly city: string;
19
+ readonly state: string;
18
20
  readonly zip: number;
19
21
  } | undefined;
20
- readonly status?: "active" | "inactive" | undefined;
21
- readonly location?: readonly [number, number, (number | undefined)?] | undefined;
22
- readonly tags?: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
23
- readonly hue?: string | undefined;
24
- readonly label: string;
25
- }>[] | undefined;
26
- readonly ignore?: string | undefined;
27
- readonly active?: boolean | undefined;
28
22
  readonly employer?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
29
23
  readonly name: string;
30
24
  }> | undefined;
25
+ readonly tags?: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
26
+ readonly label: string;
27
+ readonly hue?: string | undefined;
28
+ }>[] | undefined;
29
+ readonly status?: "active" | "inactive" | undefined;
31
30
  readonly notes?: string | undefined;
31
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
32
32
  readonly tasks?: readonly string[] | undefined;
33
33
  readonly locations?: readonly (readonly [number, number, (number | undefined)?])[] | undefined;
34
34
  readonly identities?: readonly {
@@ -39,8 +39,8 @@ declare const Person: Type.Obj<{
39
39
  export interface Person extends Schema.Schema.Type<typeof Person> {
40
40
  }
41
41
  type DefaultStoryProps<T extends AnyProperties> = {
42
+ schema?: Schema.Schema<T>;
42
43
  debug?: boolean;
43
- schema: Schema.Schema<T>;
44
44
  } & FormRootProps<T>;
45
45
  declare const meta: {
46
46
  title: string;
@@ -55,68 +55,69 @@ declare const meta: {
55
55
  translations: [{
56
56
  readonly 'en-US': {
57
57
  readonly "@dxos/react-ui-form": {
58
- readonly 'fields.label': "Fields";
59
- readonly 'hidden-fields.label': "Hidden Fields";
60
- readonly 'empty-readonly-ref-field.label': "(none)";
61
- readonly 'add-property-button.label': "Add property";
62
- readonly 'field-property.label': "Property";
63
- readonly 'field-property.placeholder': "Property name";
64
- readonly 'field-format.label': "Type";
65
- readonly 'field-path.label': "Field path";
66
- readonly 'add-field.button': "Add field";
67
- readonly 'boolean-input-true.value': "Yes";
68
- readonly 'boolean-input-false.value': "No";
69
- readonly 'show-field.label': "Show field";
70
- readonly 'hide-field.label': "Hide field";
71
- readonly 'delete-field.label': "Delete field";
72
- readonly 'ref-field-combobox-input.placeholder': "Search…";
73
- readonly 'ref-field.placeholder': "Select…";
74
- readonly 'ref-field.placeholder_one': "Select…";
75
- readonly 'ref-field.placeholder_other': "Select items…";
76
- readonly 'create-option.label': "Create";
77
- readonly 'add-tag.label': "Add tag";
78
- readonly 'example.placeholder': "Example";
79
- readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
80
- readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
81
- readonly 'cancel-button.label': "Cancel";
82
- readonly 'save-button.label': "Save";
83
- readonly 'format.boolean.label': "Boolean";
84
- readonly 'format.currency.label': "Currency";
85
- readonly 'format.date.label': "Date";
86
- readonly 'format.date-time.label': "DateTime";
87
- readonly 'format.did.label': "DID";
88
- readonly 'format.duration.label': "Duration";
89
- readonly 'format.dxn.label': "DXN";
90
- readonly 'format.email.label': "Email";
91
- readonly 'format.formula.label': "Formula";
92
- readonly 'format.hostname.label': "Hostname";
93
- readonly 'format.integer.label': "Integer";
94
- readonly 'format.json.label': "JSON";
95
- readonly 'format.lnglat.label': "Geopoint";
96
- readonly 'format.markdown.label': "Markdown";
97
- readonly 'format.percent.label': "Percent";
98
- readonly 'format.ref.label': "Reference";
99
- readonly 'format.regex.label': "RegExp";
100
- readonly 'format.string.label': "String";
101
- readonly 'format.single-select.label': "Select";
102
- readonly 'format.multi-select.label': "Multi-select";
103
- readonly 'format.text.label': "Long text";
104
- readonly 'format.time.label': "Time";
105
- readonly 'format.timestamp.label': "Timestamp";
106
- readonly 'format.user.label': "User";
107
- readonly 'format.number.label': "Number";
108
- readonly 'format.uri.label': "URI";
109
- readonly 'format.url.label': "URL";
110
- readonly 'format.uuid.label': "UUID";
111
- readonly 'latitude.label': "Latitude";
112
- readonly 'longitude.label': "Longitude";
113
- readonly 'select-option.label': "Label";
114
- readonly 'select-option-label.placeholder': "Option label";
115
- readonly 'select-option-delete.button': "Delete";
116
- readonly 'select-option-add.button': "Add option";
117
- readonly 'system-schema.title': "System type";
118
- readonly 'system-schema.description': "System type: cannot add or remove fields.";
119
- readonly 'remove.button': "Remove";
58
+ readonly 'fields.label': 'Fields';
59
+ readonly 'hidden-fields.label': 'Hidden Fields';
60
+ readonly 'empty-readonly-ref-field.label': '(none)';
61
+ readonly 'field-property.label': 'Property';
62
+ readonly 'field-property.placeholder': 'Property name';
63
+ readonly 'field-format.label': 'Type';
64
+ readonly 'field-path.label': 'Field path';
65
+ readonly 'add-item.button': 'Add item';
66
+ readonly 'add-property-button.label': 'Add property';
67
+ readonly 'boolean-input-true.value': 'Yes';
68
+ readonly 'boolean-input-false.value': 'No';
69
+ readonly 'show-field.label': 'Show field';
70
+ readonly 'hide-field.label': 'Hide field';
71
+ readonly 'delete-field.label': 'Delete field';
72
+ readonly 'create-option.label': 'Create';
73
+ readonly 'add-tag.label': 'Add tag';
74
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
75
+ readonly 'ref-field.placeholder': 'Select\u2026';
76
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
77
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
78
+ readonly 'example.placeholder': 'Example';
79
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
80
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
81
+ readonly 'cancel-button.label': 'Cancel';
82
+ readonly 'save-button.label': 'Save';
83
+ readonly 'create-text.label': 'Create text';
84
+ readonly 'format.boolean.label': 'Boolean';
85
+ readonly 'format.currency.label': 'Currency';
86
+ readonly 'format.date.label': 'Date';
87
+ readonly 'format.date-time.label': 'DateTime';
88
+ readonly 'format.did.label': 'DID';
89
+ readonly 'format.duration.label': 'Duration';
90
+ readonly 'format.dxn.label': 'DXN';
91
+ readonly 'format.email.label': 'Email';
92
+ readonly 'format.formula.label': 'Formula';
93
+ readonly 'format.hostname.label': 'Hostname';
94
+ readonly 'format.integer.label': 'Integer';
95
+ readonly 'format.json.label': 'JSON';
96
+ readonly 'format.lnglat.label': 'Geopoint';
97
+ readonly 'format.markdown.label': 'Markdown';
98
+ readonly 'format.percent.label': 'Percent';
99
+ readonly 'format.ref.label': 'Reference';
100
+ readonly 'format.regex.label': 'RegExp';
101
+ readonly 'format.string.label': 'String';
102
+ readonly 'format.single-select.label': 'Select';
103
+ readonly 'format.multi-select.label': 'Multi-select';
104
+ readonly 'format.text.label': 'Long text';
105
+ readonly 'format.time.label': 'Time';
106
+ readonly 'format.timestamp.label': 'Timestamp';
107
+ readonly 'format.user.label': 'User';
108
+ readonly 'format.number.label': 'Number';
109
+ readonly 'format.uri.label': 'URI';
110
+ readonly 'format.url.label': 'URL';
111
+ readonly 'format.uuid.label': 'UUID';
112
+ readonly 'latitude.label': 'Latitude';
113
+ readonly 'longitude.label': 'Longitude';
114
+ readonly 'select-option.label': 'Label';
115
+ readonly 'select-option-label.placeholder': 'Option label';
116
+ readonly 'select-option-delete.button': 'Delete';
117
+ readonly 'select-option-add.button': 'Add option';
118
+ readonly 'system-schema.title': 'System type';
119
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
120
+ readonly 'remove.button': 'Remove';
120
121
  };
121
122
  };
122
123
  }];
@@ -1 +1 @@
1
- {"version":3,"file":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;;;aAjDY,CAAC,SAAS,aAAa,mEAK1C,iBAAiB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEiB,CAAC;eAE1B,IAAI;AAEnB,KAAK,KAAK,CAAC,CAAC,SAAS,aAAa,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAQrE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMnD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMpD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMlD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAEjD,CAAC"}
@@ -35,9 +35,9 @@ export type FormFieldProps = {
35
35
  * are only passed to ref fields whose typename matches.
36
36
  */
37
37
  createTypename?: string;
38
- } & Pick<FormFieldComponentProps, 'autoFocus' | 'readonly' | 'layout'> & Pick<RefFieldProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'schemaHook' | 'getOptions' | 'onCreate'>;
39
- export declare const FormField: {
40
- (props: FormFieldProps): React.JSX.Element | null;
41
- displayName: string;
42
- };
38
+ } & Pick<FormFieldComponentProps, 'autoFocus' | 'readonly' | 'layout'> & Pick<RefFieldProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useSchema' | 'getOptions' | 'onCreate'>;
39
+ export declare function FormField(props: FormFieldProps): React.JSX.Element | null;
40
+ export declare namespace FormField {
41
+ var displayName: string;
42
+ }
43
43
  //# sourceMappingURL=FormField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAcvC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,EAOL,KAAK,aAAa,EAInB,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC,GACpE,IAAI,CACF,aAAa,EACX,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,UAAU,CACb,CAAC;AAEJ,eAAO,MAAM,SAAS;YAAW,cAAc;;CAgK9C,CAAC"}
1
+ {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAcvC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAKpD,OAAO,EAOL,KAAK,aAAa,EAInB,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC,GACpE,IAAI,CACF,aAAa,EACX,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,WAAW,GACX,YAAY,GACZ,UAAU,CACb,CAAC;kCAEsB,KAAK,EAAE,cAAc"}
@@ -1,6 +1,7 @@
1
1
  import type * as Schema from 'effect/Schema';
2
2
  import type * as SchemaAST from 'effect/SchemaAST';
3
3
  import React, { Component, type FC, type FocusEvent, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
4
+ import { type Database } from '@dxos/echo';
4
5
  import { type Format } from '@dxos/echo/internal';
5
6
  import { type FormFieldStatus } from '../../hooks';
6
7
  /**
@@ -31,6 +32,8 @@ export type FormFieldComponentProps<T = any> = {
31
32
  placeholder?: string;
32
33
  autoFocus?: boolean;
33
34
  layout?: Presentation;
35
+ /** Database the form is editing against; populated for fields whose value is an ECHO object/Ref. */
36
+ db?: Database.Database;
34
37
  } & FormFieldStateProps<T>;
35
38
  /**
36
39
  * Form field component.
@@ -46,10 +49,10 @@ export type FormFieldLabelProps = {
46
49
  asChild?: boolean;
47
50
  error?: string;
48
51
  } & Pick<FormFieldComponentProps, 'label' | 'readonly'>;
49
- export declare const FormFieldLabel: {
50
- ({ label, error, readonly, asChild }: FormFieldLabelProps): React.JSX.Element;
51
- displayName: string;
52
- };
52
+ export declare function FormFieldLabel({ label, error, readonly, asChild }: FormFieldLabelProps): React.JSX.Element;
53
+ export declare namespace FormFieldLabel {
54
+ var displayName: string;
55
+ }
53
56
  export type FormFieldWrapperProps<T = any> = Pick<FormFieldComponentProps, 'readonly' | 'label' | 'layout' | 'getStatus' | 'getValue'> & {
54
57
  children?: (props: {
55
58
  value: T;
@@ -70,8 +73,7 @@ export declare class FormFieldErrorBoundary extends Component<FormFieldErrorBoun
70
73
  error: undefined;
71
74
  };
72
75
  componentDidUpdate(prevProps: FormFieldErrorBoundaryProps): void;
73
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
76
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
74
77
  private resetError;
75
78
  }
76
- export {};
77
79
  //# sourceMappingURL=FormFieldComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,EACZ,SAAS,EACT,KAAK,EAAE,E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B,GAAG,iBAAiB,CAAC;IACnD,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,qBAAa,sBAAuB,SAAQ,SAAS,CAAC,2BAA2B,EAAE,mBAAmB,CAAC;IACrG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAE9D;IAEQ,KAAK;QAAK,KAAK;MAAc;IAE7B,kBAAkB,CAAC,SAAS,EAAE,2BAA2B,QAIjE;IAEQ,MAAM,kRAWd;IAED,OAAO,CAAC,UAAU;CAGnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldComponent.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,sBAAsB,CAAC;AAEtF,QAAA,MAAM,YAAY,GAAI,kEAOnB,uBAAuB,CAAC,MAAM,CAAC,sBAsBjC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAOnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
1
+ {"version":3,"file":"FormFieldComponent.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,sBAAsB,CAAC;AAEtF,QAAA,MAAM,YAAY,qEAOf,uBAAuB,CAAC,MAAM,CAAC,sBAsBjC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAOnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
@@ -7,12 +7,9 @@ export type FormFieldSetProps<T extends AnyProperties> = {
7
7
  label?: string;
8
8
  sort?: string[];
9
9
  exclude?: (props: SchemaProperty[]) => SchemaProperty[];
10
- } & Pick<FormHandlerProps<T>, 'schema'> & Pick<FormFieldProps, 'path' | 'autoFocus' | 'readonly' | 'layout' | 'projection' | 'fieldMap' | 'fieldProvider' | 'createTypename' | 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'schemaHook' | 'getOptions' | 'onCreate'>;
11
- /**
12
- * Renders a set of form fields derived from a schema object.
13
- */
14
- export declare const FormFieldSet: {
15
- ({ label, schema, readonly, path, sort, exclude, projection, layout, ...props }: FormFieldSetProps<any>): React.JSX.Element | null;
16
- displayName: string;
17
- };
10
+ } & Pick<FormHandlerProps<T>, 'schema'> & Pick<FormFieldProps, 'path' | 'autoFocus' | 'readonly' | 'layout' | 'projection' | 'fieldMap' | 'fieldProvider' | 'createTypename' | 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useSchema' | 'getOptions' | 'onCreate'>;
11
+ export declare function FormFieldSet({ label, schema, readonly, path, sort, exclude, projection, layout, ...props }: FormFieldSetProps<any>): React.JSX.Element | null;
12
+ export declare namespace FormFieldSet {
13
+ var displayName: string;
14
+ }
18
15
  //# sourceMappingURL=FormFieldSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldSet.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAK7D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;CACzD,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GACrC,IAAI,CACF,cAAc,EACZ,MAAM,GACN,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,UAAU,CACb,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY;qFAUtB,iBAAiB,CAAC,GAAG,CAAC;;CA8BxB,CAAC"}
1
+ {"version":3,"file":"FormFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldSet.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAK7D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;CACzD,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GACrC,IAAI,CACF,cAAc,EACZ,MAAM,GACN,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,WAAW,GACX,YAAY,GACZ,UAAU,CACb,CAAC;qCAKyB,EAC3B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,GAAG,CAAC"}
@@ -6,10 +6,10 @@ export type ArrayFieldProps = {
6
6
  label: string;
7
7
  fieldProps: FormFieldStateProps;
8
8
  } & FormFieldProps;
9
- export declare const ArrayField: {
10
- ({ type, path, label, readonly, layout, fieldProps: inputProps, ...props }: ArrayFieldProps): React.JSX.Element | null;
11
- displayName: string;
12
- };
9
+ export declare function ArrayField({ type, path, label, readonly, layout, fieldProps: inputProps, ...props }: ArrayFieldProps): React.JSX.Element | null;
10
+ export declare namespace ArrayField {
11
+ var displayName: string;
12
+ }
13
13
  /**
14
14
  * Returns the default empty value for a given AST.
15
15
  * Used for initializing new array values etc.
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAsB,MAAM,OAAO,CAAC;AAQ3C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;CACjC,GAAG,cAAc,CAAC;AAEnB,eAAO,MAAM,UAAU;gFAQpB,eAAe;;CA4FjB,CAAC;AAIF;;;GAGG;AAEH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,CAAC,GAAG,KAAG,GAsBrD,CAAC"}
1
+ {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAsB,MAAM,OAAO,CAAC;AAS3C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;CACjC,GAAG,cAAc,CAAC;mCAEQ,EACzB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EAAE,UAAU,EACtB,GAAG,KAAK,EACT,EAAE,eAAe;;;;AAoGlB;;;GAGG;AAEH,eAAO,MAAM,eAAe,SAAU,SAAS,CAAC,GAAG,KAAG,GAsBrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/BooleanField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,YAAY,GAAI,6CAA6C,uBAAuB,CAAC,OAAO,CAAC,sBAWzG,CAAC"}
1
+ {"version":3,"file":"BooleanField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/BooleanField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,YAAY,gDAAiD,uBAAuB,CAAC,OAAO,CAAC,sBAWzG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoPointField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/GeoPointField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKjE,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,GAAI,gFAS3B,uBAAuB,CAAC,QAAQ,CAAC,6BA+EnC,CAAC"}
1
+ {"version":3,"file":"GeoPointField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/GeoPointField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMjE,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,mFASvB,uBAAuB,CAAC,QAAQ,CAAC,6BA+EnC,CAAC"}
@@ -1,4 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type FormFieldComponentProps } from '../FormFieldComponent';
3
- export declare const MarkdownField: ({ type, readonly, label, placeholder, layout, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps) => React.JSX.Element | null;
3
+ /**
4
+ * Form field that edits a markdown value in a CodeMirror editor.
5
+ * Supports two backings:
6
+ * - `Schema.String` annotated with `Format.TypeFormat.Markdown`: edited as plain text via `getValue`/`onValueChange`.
7
+ * - `Ref<Text>` annotated with `Format.TypeFormat.Markdown`: edited in-place via an Automerge doc accessor.
8
+ * When the ref is empty and a database is available, a create button is shown to allocate a new Text.
9
+ */
10
+ export declare const MarkdownField: ({ type, readonly, label, placeholder, layout, db, getStatus, getValue, onValueChange, }: FormFieldComponentProps) => React.JSX.Element | null;
4
11
  //# sourceMappingURL=MarkdownField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,GAAI,6FAU3B,uBAAuB,6BAyDzB,CAAC"}
1
+ {"version":3,"file":"MarkdownField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAYpD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAKrF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,4FAUvB,uBAAuB,6BAgDzB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ decorators: import("@storybook/react").Decorator[];
5
+ parameters: {
6
+ layout: string;
7
+ translations: [{
8
+ readonly 'en-US': {
9
+ readonly "@dxos/react-ui-form": {
10
+ readonly 'fields.label': 'Fields';
11
+ readonly 'hidden-fields.label': 'Hidden Fields';
12
+ readonly 'empty-readonly-ref-field.label': '(none)';
13
+ readonly 'field-property.label': 'Property';
14
+ readonly 'field-property.placeholder': 'Property name';
15
+ readonly 'field-format.label': 'Type';
16
+ readonly 'field-path.label': 'Field path';
17
+ readonly 'add-item.button': 'Add item';
18
+ readonly 'add-property-button.label': 'Add property';
19
+ readonly 'boolean-input-true.value': 'Yes';
20
+ readonly 'boolean-input-false.value': 'No';
21
+ readonly 'show-field.label': 'Show field';
22
+ readonly 'hide-field.label': 'Hide field';
23
+ readonly 'delete-field.label': 'Delete field';
24
+ readonly 'create-option.label': 'Create';
25
+ readonly 'add-tag.label': 'Add tag';
26
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
27
+ readonly 'ref-field.placeholder': 'Select\u2026';
28
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
29
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
30
+ readonly 'example.placeholder': 'Example';
31
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
32
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
33
+ readonly 'cancel-button.label': 'Cancel';
34
+ readonly 'save-button.label': 'Save';
35
+ readonly 'create-text.label': 'Create text';
36
+ readonly 'format.boolean.label': 'Boolean';
37
+ readonly 'format.currency.label': 'Currency';
38
+ readonly 'format.date.label': 'Date';
39
+ readonly 'format.date-time.label': 'DateTime';
40
+ readonly 'format.did.label': 'DID';
41
+ readonly 'format.duration.label': 'Duration';
42
+ readonly 'format.dxn.label': 'DXN';
43
+ readonly 'format.email.label': 'Email';
44
+ readonly 'format.formula.label': 'Formula';
45
+ readonly 'format.hostname.label': 'Hostname';
46
+ readonly 'format.integer.label': 'Integer';
47
+ readonly 'format.json.label': 'JSON';
48
+ readonly 'format.lnglat.label': 'Geopoint';
49
+ readonly 'format.markdown.label': 'Markdown';
50
+ readonly 'format.percent.label': 'Percent';
51
+ readonly 'format.ref.label': 'Reference';
52
+ readonly 'format.regex.label': 'RegExp';
53
+ readonly 'format.string.label': 'String';
54
+ readonly 'format.single-select.label': 'Select';
55
+ readonly 'format.multi-select.label': 'Multi-select';
56
+ readonly 'format.text.label': 'Long text';
57
+ readonly 'format.time.label': 'Time';
58
+ readonly 'format.timestamp.label': 'Timestamp';
59
+ readonly 'format.user.label': 'User';
60
+ readonly 'format.number.label': 'Number';
61
+ readonly 'format.uri.label': 'URI';
62
+ readonly 'format.url.label': 'URL';
63
+ readonly 'format.uuid.label': 'UUID';
64
+ readonly 'latitude.label': 'Latitude';
65
+ readonly 'longitude.label': 'Longitude';
66
+ readonly 'select-option.label': 'Label';
67
+ readonly 'select-option-label.placeholder': 'Option label';
68
+ readonly 'select-option-delete.button': 'Delete';
69
+ readonly 'select-option-add.button': 'Add option';
70
+ readonly 'system-schema.title': 'System type';
71
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
72
+ readonly 'remove.button': 'Remove';
73
+ };
74
+ };
75
+ }];
76
+ };
77
+ };
78
+ export default meta;
79
+ type Story = StoryObj<typeof meta>;
80
+ export declare const StringBacked: Story;
81
+ export declare const StringBackedKeepsFocus: Story;
82
+ export declare const RefPopulated: Story;
83
+ export declare const RefEmpty: Story;
84
+ //# sourceMappingURL=MarkdownField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA4GjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,KA+CpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAY1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,GAAI,kEAOzB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,qEAOrB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -1,16 +1,22 @@
1
1
  import React from 'react';
2
2
  import '@dxos/lit-ui/dx-tag-picker.pcss';
3
- import { type Database, Entity, Type } from '@dxos/echo';
3
+ import { type Database, Entity, Obj, Type } from '@dxos/echo';
4
4
  import { type ObjectPickerContentProps, type RefOption } from '../../ObjectPicker';
5
5
  import { type FormFieldComponentProps } from '../FormFieldComponent';
6
6
  export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap'> & {
7
7
  db?: Database.Database;
8
- resultsHook?: (db?: Database.Database, typename?: string) => Entity.Any[];
9
- schemaHook?: (db?: Database.Database, typename?: string) => Type.AnyEntity;
8
+ useSchema?: (db?: Database.Database, typename?: string) => Type.AnyEntity;
9
+ useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
10
10
  getOptions?: (objects: Entity.Any[], options?: {
11
11
  parentLabel?: boolean;
12
12
  }) => RefOption[];
13
- onCreate?: (schema: Type.AnyEntity, values: any) => void;
13
+ /**
14
+ * Persist a newly-created object. Called after the user fills out the
15
+ * inline create form and clicks Save. Should add the object to the
16
+ * database and return it (sync or async). The returned object is then
17
+ * wired into this slot's form value as a Ref.
18
+ */
19
+ onCreate?: (schema: Type.AnyEntity, values: any) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void;
14
20
  };
15
21
  export declare const RefField: (props: RefFieldProps) => React.JSX.Element | null;
16
22
  //# sourceMappingURL=RefField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAoB,IAAI,EAAE,MAAM,YAAY,CAAC;AAW3E,OAAO,EAAgB,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AA0BrF,MAAM,MAAM,aAAa,GAAG,uBAAuB,GACjD,IAAI,CACF,wBAAwB,EACxB,mBAAmB,GAAG,kBAAkB,GAAG,wBAAwB,GAAG,gBAAgB,CACvF,GAAG;IACF,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC;IAC3E,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,EAAE,CAAC;IACzF,QAAQ,CAAC,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AAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3G,CAAC;AAEJ,eAAO,MAAM,QAAQ,UAAW,aAAa,6BAmK5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,8FAUzB,kBAAkB,6BAwCpB,CAAC"}
1
+ {"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,iGAUrB,kBAAkB,6BAwCpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,GAAI,gEAO/B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA4KrD,CAAC"}
1
+ {"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,mEAO3B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA4KrD,CAAC"}