@dxos/react-ui-form 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/README.md +0 -1
- package/dist/lib/browser/index.mjs +4005 -2402
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +87 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4005 -2402
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +89 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +73 -59
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +135 -27
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +192 -137
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +52 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +98 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts +26 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts +19 -0
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.d.ts +50 -0
- package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts +123 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/annotation.d.ts +30 -0
- package/dist/types/src/components/Form/Layout/annotation.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/index.d.ts +4 -0
- package/dist/types/src/components/Form/Layout/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/parser.d.ts +31 -0
- package/dist/types/src/components/Form/Layout/parser.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/parser.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/DateField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/DateField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/InlineRefField.d.ts +13 -0
- package/dist/types/src/components/Form/fields/InlineRefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +89 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts +34 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.test.d.ts +2 -0
- package/dist/types/src/components/Form/fields/RefField.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts +13 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +89 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/index.d.ts +14 -0
- package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +5 -4
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/meta-tags.d.ts +30 -0
- package/dist/types/src/components/Form/meta-tags.d.ts.map +1 -0
- package/dist/types/src/components/Form/meta-tags.test.d.ts +2 -0
- package/dist/types/src/components/Form/meta-tags.test.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +8 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.stories.d.ts +87 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
- package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +39 -12
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +69 -58
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +132 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.d.ts +9 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.d.ts.map +1 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts +91 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectTree/index.d.ts +2 -0
- package/dist/types/src/components/ObjectTree/index.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/RefEditor.d.ts +73 -0
- package/dist/types/src/components/RefEditor/RefEditor.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts +92 -0
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/index.d.ts +3 -0
- package/dist/types/src/components/RefEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts +47 -0
- package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.d.ts +51 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts +89 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +4 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +15 -19
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +75 -64
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +13 -6
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +70 -59
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/field-type.d.ts +19 -0
- package/dist/types/src/util/field-type.d.ts.map +1 -0
- package/dist/types/src/util/field.d.ts +3 -3
- package/dist/types/src/util/field.d.ts.map +1 -1
- package/dist/types/src/util/formatting.d.ts +2 -2
- package/dist/types/src/util/formatting.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/properties.d.ts +35 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/properties.test.d.ts +2 -0
- package/dist/types/src/util/properties.test.d.ts.map +1 -0
- package/dist/types/src/util/refs.d.ts +2 -2
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -52
- package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
- package/src/components/FieldEditor/FieldEditor.test.tsx +4 -2
- package/src/components/FieldEditor/FieldEditor.tsx +91 -86
- package/src/components/Form/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +147 -252
- package/src/components/Form/Form.tsx +461 -108
- package/src/components/Form/FormField.tsx +345 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +253 -0
- package/src/components/Form/FormFieldSet.tsx +213 -0
- package/src/components/Form/FormTooltipsContext.ts +25 -0
- package/src/components/Form/Layout/FormLayout.stories.test.tsx +51 -0
- package/src/components/Form/Layout/FormLayout.stories.tsx +422 -0
- package/src/components/Form/Layout/FormLayout.test.ts +59 -0
- package/src/components/Form/Layout/FormLayout.tsx +251 -0
- package/src/components/Form/Layout/annotation.ts +38 -0
- package/src/components/Form/Layout/index.ts +7 -0
- package/src/components/Form/Layout/parser.test.ts +120 -0
- package/src/components/Form/Layout/parser.ts +167 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +173 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/DateField.tsx +101 -0
- package/src/components/Form/fields/GeoPointField.tsx +124 -0
- package/src/components/Form/fields/InlineRefField.tsx +138 -0
- package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
- package/src/components/Form/fields/MarkdownField.tsx +167 -0
- package/src/components/Form/fields/NumberField.tsx +76 -0
- package/src/components/Form/fields/RefField.test.ts +45 -0
- package/src/components/Form/fields/RefField.tsx +266 -0
- package/src/components/Form/fields/SelectField.tsx +77 -0
- package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +33 -26
- package/src/components/Form/fields/TextAreaField.tsx +38 -0
- package/src/components/Form/fields/TextField.tsx +38 -0
- package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +17 -9
- package/src/components/Form/fields/index.ts +17 -0
- package/src/components/Form/index.ts +6 -4
- package/src/components/Form/meta-tags.test.ts +47 -0
- package/src/components/Form/meta-tags.ts +33 -0
- package/src/components/ObjectForm/ObjectForm.stories.tsx +62 -0
- package/src/components/ObjectForm/ObjectForm.tsx +111 -0
- package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +26 -21
- package/src/components/ObjectPicker/ObjectPicker.tsx +123 -82
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +350 -0
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +111 -0
- package/src/components/ObjectProperties/ObjectProperties.tsx +146 -0
- package/src/components/ObjectProperties/index.ts +5 -0
- package/src/components/ObjectTree/ObjectTree.stories.tsx +134 -0
- package/src/components/ObjectTree/ObjectTree.tsx +190 -0
- package/src/components/ObjectTree/index.ts +5 -0
- package/src/components/RefEditor/RefEditor.stories.tsx +148 -0
- package/src/components/RefEditor/RefEditor.tsx +275 -0
- package/src/components/RefEditor/index.ts +6 -0
- package/src/components/RefEditor/ref-editor-extension.ts +254 -0
- package/src/components/Settings/AUDIT.md +51 -0
- package/src/components/Settings/Settings.stories.tsx +104 -0
- package/src/components/Settings/Settings.tsx +81 -0
- package/src/components/Settings/SettingsFieldSet.tsx +257 -0
- package/src/components/Settings/SettingsItem.tsx +58 -0
- package/src/components/Settings/SettingsSelectField.tsx +59 -0
- package/src/components/Settings/index.ts +7 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +70 -76
- package/src/components/ViewEditor/ViewEditor.test.tsx +17 -13
- package/src/components/ViewEditor/ViewEditor.tsx +340 -226
- package/src/components/index.ts +5 -1
- package/src/components/testing.tsx +24 -11
- package/src/hooks/index.ts +2 -3
- package/src/hooks/useFormHandler.ts +380 -0
- package/src/hooks/useKeyHandler.tsx +37 -0
- package/src/index.ts +0 -4
- package/src/translations.ts +76 -64
- package/src/util/field-type.ts +60 -0
- package/src/util/field.ts +25 -25
- package/src/util/formatting.ts +22 -22
- package/src/util/index.ts +2 -1
- package/src/util/properties.test.ts +153 -0
- package/src/util/properties.ts +100 -0
- package/src/util/refs.ts +16 -15
- package/src/vite-env.d.ts +10 -0
- package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
- package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -83
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/index.d.ts +0 -2
- package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
- package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
- package/dist/types/src/components/Form/Defaults.d.ts +0 -14
- package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormActions.d.ts +0 -9
- package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContent.d.ts +0 -63
- package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContext.d.ts +0 -23
- package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
- package/dist/types/src/components/Form/Input.d.ts +0 -29
- package/dist/types/src/components/Form/Input.d.ts.map +0 -1
- package/dist/types/src/components/Form/RefField.d.ts +0 -22
- package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -78
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/index.d.ts +0 -4
- package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/factory.d.ts +0 -8
- package/dist/types/src/components/Form/factory.d.ts.map +0 -1
- package/dist/types/src/hooks/useForm.d.ts +0 -67
- package/dist/types/src/hooks/useForm.d.ts.map +0 -1
- package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
- package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
- package/dist/types/src/util/schema.d.ts +0 -3
- package/dist/types/src/util/schema.d.ts.map +0 -1
- package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
- package/src/components/ControlSection/ControlSection.tsx +0 -153
- package/src/components/Form/ArrayField.tsx +0 -125
- package/src/components/Form/Defaults.tsx +0 -205
- package/src/components/Form/FormActions.tsx +0 -54
- package/src/components/Form/FormContent.tsx +0 -362
- package/src/components/Form/FormContext.tsx +0 -110
- package/src/components/Form/Input.tsx +0 -54
- package/src/components/Form/RefField.tsx +0 -283
- package/src/components/Form/custom/GeoPointInput.tsx +0 -80
- package/src/components/Form/custom/index.ts +0 -7
- package/src/components/Form/factory.tsx +0 -31
- package/src/hooks/useForm.ts +0 -296
- package/src/hooks/useQueryRefOptions.ts +0 -62
- package/src/hooks/useRefQueryLookupHandler.ts +0 -39
- package/src/util/schema.ts +0 -12
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Obj } from '@dxos/echo';
|
|
3
|
+
import { useClientStory } from '@dxos/react-client/testing';
|
|
4
|
+
export type ObjectPropertiesDebug = {
|
|
5
|
+
/** Live database the story is rendering against. */
|
|
6
|
+
db: ReturnType<typeof useClientStory>['space'] extends infer S ? (S extends {
|
|
7
|
+
db: infer D;
|
|
8
|
+
} ? D : never) : never;
|
|
9
|
+
/** Object whose properties are being edited. */
|
|
10
|
+
object: Obj.Unknown;
|
|
11
|
+
};
|
|
12
|
+
declare const meta: {
|
|
13
|
+
title: string;
|
|
14
|
+
component: any;
|
|
15
|
+
decorators: import("@storybook/react").Decorator[];
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: string;
|
|
18
|
+
translations: [{
|
|
19
|
+
readonly 'en-US': {
|
|
20
|
+
readonly "@dxos/react-ui-form": {
|
|
21
|
+
readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
|
|
22
|
+
readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
|
|
23
|
+
readonly 'fields.label': 'Fields';
|
|
24
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
25
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
26
|
+
readonly 'field-property.label': 'Property';
|
|
27
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
28
|
+
readonly 'field-format.label': 'Type';
|
|
29
|
+
readonly 'field-path.label': 'Field path';
|
|
30
|
+
readonly 'remove-item.button': 'Delete item';
|
|
31
|
+
readonly 'add-item.button': 'Add item';
|
|
32
|
+
readonly 'add-property-button.label': 'Add property';
|
|
33
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
34
|
+
readonly 'boolean-input-false.value': 'No';
|
|
35
|
+
readonly 'show-field.label': 'Show field';
|
|
36
|
+
readonly 'hide-field.label': 'Hide field';
|
|
37
|
+
readonly 'expand-fields.label': 'Expand';
|
|
38
|
+
readonly 'collapse-fields.label': 'Collapse';
|
|
39
|
+
readonly 'delete-field.label': 'Delete field';
|
|
40
|
+
readonly 'create-option.label': 'Create';
|
|
41
|
+
readonly 'add-tag.label': 'Add tag';
|
|
42
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
43
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
44
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
45
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
46
|
+
readonly 'example.placeholder': 'Example';
|
|
47
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
48
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
49
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
50
|
+
readonly 'save-button.label': 'Save';
|
|
51
|
+
readonly 'create-text.label': 'Create text';
|
|
52
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
53
|
+
readonly 'format.currency.label': 'Currency';
|
|
54
|
+
readonly 'format.date.label': 'Date';
|
|
55
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
56
|
+
readonly 'format.did.label': 'DID';
|
|
57
|
+
readonly 'format.duration.label': 'Duration';
|
|
58
|
+
readonly 'format.dxn.label': 'DXN';
|
|
59
|
+
readonly 'format.email.label': 'Email';
|
|
60
|
+
readonly 'format.formula.label': 'Formula';
|
|
61
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
62
|
+
readonly 'format.integer.label': 'Integer';
|
|
63
|
+
readonly 'format.json.label': 'JSON';
|
|
64
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
65
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
66
|
+
readonly 'format.percent.label': 'Percent';
|
|
67
|
+
readonly 'format.ref.label': 'Reference';
|
|
68
|
+
readonly 'format.regex.label': 'RegExp';
|
|
69
|
+
readonly 'format.string.label': 'String';
|
|
70
|
+
readonly 'format.single-select.label': 'Select';
|
|
71
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
72
|
+
readonly 'format.text.label': 'Long text';
|
|
73
|
+
readonly 'format.time.label': 'Time';
|
|
74
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
75
|
+
readonly 'format.user.label': 'User';
|
|
76
|
+
readonly 'format.number.label': 'Number';
|
|
77
|
+
readonly 'format.uri.label': 'URI';
|
|
78
|
+
readonly 'format.url.label': 'URL';
|
|
79
|
+
readonly 'format.uuid.label': 'UUID';
|
|
80
|
+
readonly 'latitude.label': 'Latitude';
|
|
81
|
+
readonly 'longitude.label': 'Longitude';
|
|
82
|
+
readonly 'select-option.label': 'Label';
|
|
83
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
84
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
85
|
+
readonly 'select-option-add.button': 'Add option';
|
|
86
|
+
readonly 'system-schema.title': 'System type';
|
|
87
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
88
|
+
readonly 'remove.button': 'Delete';
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export default meta;
|
|
95
|
+
type Story = StoryObj<typeof meta>;
|
|
96
|
+
/**
|
|
97
|
+
* Default Pipeline form — manual exploration. Includes the Tags picker (which
|
|
98
|
+
* is the only ref-array path that currently works end-to-end, by virtue of
|
|
99
|
+
* `Tag.Tag` being special-cased in `ObjectProperties.handleCreate`).
|
|
100
|
+
*/
|
|
101
|
+
export declare const Default: Story;
|
|
102
|
+
/**
|
|
103
|
+
* Tag-creation play. Walks the inline create flow against the Tags picker and
|
|
104
|
+
* leaves the magazine in the post-Save state for assertions to inspect via
|
|
105
|
+
* `OBJECT_PROPERTIES_DEBUG_SYMBOL`.
|
|
106
|
+
*
|
|
107
|
+
* Expected end-state (currently passes):
|
|
108
|
+
* - new Tag.Tag exists in the DB with `label === "PinnedTag"`
|
|
109
|
+
* - `Obj.getMeta(object).tags` includes its DXN.
|
|
110
|
+
*/
|
|
111
|
+
export declare const CreateTagPlay: Story;
|
|
112
|
+
/**
|
|
113
|
+
* Ref-array creation play. Walks Add → Open → Create → Save against
|
|
114
|
+
* `Article.authors`. After the fix, the new Author should be persisted AND
|
|
115
|
+
* wired into `article.authors[0]`. Today it persists to the DB but the array
|
|
116
|
+
* slot stays empty.
|
|
117
|
+
*/
|
|
118
|
+
export declare const CreateRefArrayPlay: Story;
|
|
119
|
+
/**
|
|
120
|
+
* Ref-array creation against a schema with a hidden required field. `Note`
|
|
121
|
+
* mirrors the shape of `Subscription.Feed`: the form omits `backing` (a
|
|
122
|
+
* required `Ref` annotated `FormInputAnnotation.set(false)`) but the schema
|
|
123
|
+
* requires it. Without `omitHiddenFormFields` + `FactoryAnnotation`, the
|
|
124
|
+
* form's validator would reject Save and the popover would never close.
|
|
125
|
+
*
|
|
126
|
+
* Expected end-state after the fix:
|
|
127
|
+
* - new Note exists in DB with a synthesised `backing` ref
|
|
128
|
+
* - `notebook.notes[0]` references the new Note
|
|
129
|
+
* - the create form is gone
|
|
130
|
+
*/
|
|
131
|
+
export declare const CreateHiddenFieldPlay: Story;
|
|
132
|
+
//# sourceMappingURL=ObjectProperties.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectProperties.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAA2B,GAAG,EAAkB,MAAM,YAAY,CAAC;AAG1E,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AA0EhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,oDAAoD;IACpD,EAAE,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;IACjH,gDAAgD;IAChD,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AA8CF,QAAA,MAAM,IAAI;;eAEuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAME,CAAC;eAExB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4DnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,KAmC3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAkChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,KA8BnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectProperties.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { type ReactElement, type RefAttributes } from 'react';
|
|
3
|
+
import { type ComposableProps } from '@dxos/ui-types';
|
|
4
|
+
export type ObjectTreeProps<T> = {
|
|
5
|
+
schema: Schema.Schema<T, any, never>;
|
|
6
|
+
value: T;
|
|
7
|
+
};
|
|
8
|
+
export declare const ObjectTree: <T>(props: ComposableProps<ObjectTreeProps<T>> & RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
9
|
+
//# sourceMappingURL=ObjectTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectTree.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/ObjectTree.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAc,EAAE,KAAK,YAAY,EAAkB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIrF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAuBF,eAAO,MAAM,UAAU,EAAgC,CAAC,CAAC,EACvD,KAAK,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,KACvE,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: <T>(props: import("@dxos/ui-types").ComposableProps<import("./ObjectTree").ObjectTreeProps<T>> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
translations: [{
|
|
10
|
+
readonly 'en-US': {
|
|
11
|
+
readonly "@dxos/react-ui-form": {
|
|
12
|
+
readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
|
|
13
|
+
readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
|
|
14
|
+
readonly 'fields.label': 'Fields';
|
|
15
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
16
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
17
|
+
readonly 'field-property.label': 'Property';
|
|
18
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
19
|
+
readonly 'field-format.label': 'Type';
|
|
20
|
+
readonly 'field-path.label': 'Field path';
|
|
21
|
+
readonly 'remove-item.button': 'Delete item';
|
|
22
|
+
readonly 'add-item.button': 'Add item';
|
|
23
|
+
readonly 'add-property-button.label': 'Add property';
|
|
24
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
25
|
+
readonly 'boolean-input-false.value': 'No';
|
|
26
|
+
readonly 'show-field.label': 'Show field';
|
|
27
|
+
readonly 'hide-field.label': 'Hide field';
|
|
28
|
+
readonly 'expand-fields.label': 'Expand';
|
|
29
|
+
readonly 'collapse-fields.label': 'Collapse';
|
|
30
|
+
readonly 'delete-field.label': 'Delete field';
|
|
31
|
+
readonly 'create-option.label': 'Create';
|
|
32
|
+
readonly 'add-tag.label': 'Add tag';
|
|
33
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
34
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
35
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
36
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
37
|
+
readonly 'example.placeholder': 'Example';
|
|
38
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
39
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
40
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
41
|
+
readonly 'save-button.label': 'Save';
|
|
42
|
+
readonly 'create-text.label': 'Create text';
|
|
43
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
44
|
+
readonly 'format.currency.label': 'Currency';
|
|
45
|
+
readonly 'format.date.label': 'Date';
|
|
46
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
47
|
+
readonly 'format.did.label': 'DID';
|
|
48
|
+
readonly 'format.duration.label': 'Duration';
|
|
49
|
+
readonly 'format.dxn.label': 'DXN';
|
|
50
|
+
readonly 'format.email.label': 'Email';
|
|
51
|
+
readonly 'format.formula.label': 'Formula';
|
|
52
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
53
|
+
readonly 'format.integer.label': 'Integer';
|
|
54
|
+
readonly 'format.json.label': 'JSON';
|
|
55
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
56
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
57
|
+
readonly 'format.percent.label': 'Percent';
|
|
58
|
+
readonly 'format.ref.label': 'Reference';
|
|
59
|
+
readonly 'format.regex.label': 'RegExp';
|
|
60
|
+
readonly 'format.string.label': 'String';
|
|
61
|
+
readonly 'format.single-select.label': 'Select';
|
|
62
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
63
|
+
readonly 'format.text.label': 'Long text';
|
|
64
|
+
readonly 'format.time.label': 'Time';
|
|
65
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
66
|
+
readonly 'format.user.label': 'User';
|
|
67
|
+
readonly 'format.number.label': 'Number';
|
|
68
|
+
readonly 'format.uri.label': 'URI';
|
|
69
|
+
readonly 'format.url.label': 'URL';
|
|
70
|
+
readonly 'format.uuid.label': 'UUID';
|
|
71
|
+
readonly 'latitude.label': 'Latitude';
|
|
72
|
+
readonly 'longitude.label': 'Longitude';
|
|
73
|
+
readonly 'select-option.label': 'Label';
|
|
74
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
75
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
76
|
+
readonly 'select-option-add.button': 'Add option';
|
|
77
|
+
readonly 'system-schema.title': 'System type';
|
|
78
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
79
|
+
readonly 'remove.button': 'Delete';
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export default meta;
|
|
86
|
+
type Story = StoryObj<typeof meta>;
|
|
87
|
+
export declare const Default: Story;
|
|
88
|
+
export declare const JSON: () => React.JSX.Element;
|
|
89
|
+
export declare const WithForm: () => React.JSX.Element;
|
|
90
|
+
export declare const WithReadOnlyForm: () => React.JSX.Element;
|
|
91
|
+
//# sourceMappingURL=ObjectTree.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectTree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/ObjectTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAmE1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQyB,CAAC;eAErB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,IAAI,yBAShB,CAAC;AAMF,eAAO,MAAM,QAAQ,yBAcpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBAS5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Database, Obj, type Type } from '@dxos/echo';
|
|
3
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type EditorController, type EditorMenuProviderProps, type EditorViewProps } from '@dxos/react-ui-editor';
|
|
5
|
+
import { type RefEditorMode } from './ref-editor-extension';
|
|
6
|
+
export type RefEditorProps = ThemedClassName<{
|
|
7
|
+
/** Database queried for objects of {@link RefEditorProps.type}. */
|
|
8
|
+
db?: Database.Database;
|
|
9
|
+
/** ECHO object type whose instances are offered in the typeahead and referenced as `@<id>`. */
|
|
10
|
+
type: Type.AnyObj;
|
|
11
|
+
value?: string;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Content model:
|
|
15
|
+
* - `'ref'` (default): the picker only matches existing objects; selection inserts an
|
|
16
|
+
* `@<id>` reference (raw tokens accepted by `match` are also allowed).
|
|
17
|
+
* - `'email'`: the picker shows one item per (object, value) pair and selection captures the
|
|
18
|
+
* value; the content is an RFC 5322 mailbox list (`Name <email>, ...`) with the comma
|
|
19
|
+
* separators hidden inside the tags.
|
|
20
|
+
*/
|
|
21
|
+
mode?: RefEditorMode;
|
|
22
|
+
/** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens are accepted as values. */
|
|
23
|
+
match?: RegExp;
|
|
24
|
+
/** Display label for an object; defaults to `Obj.getLabel` falling back to the id. */
|
|
25
|
+
getLabel?: (object: Obj.Unknown) => string;
|
|
26
|
+
/** Values an object can be captured as in `'email'` mode (e.g. a person's email addresses). */
|
|
27
|
+
getValues?: (object: Obj.Unknown) => readonly string[];
|
|
28
|
+
/** Menu item icon. */
|
|
29
|
+
icon?: string;
|
|
30
|
+
/** Already-translated placeholder; defaults to a generic hint. */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** Open the typeahead while typing (the `@` trigger remains available but is not required). */
|
|
33
|
+
activateOnTyping?: boolean;
|
|
34
|
+
} & Omit<EditorViewProps, 'initialValue'> & Pick<EditorMenuProviderProps, 'numItems'>>;
|
|
35
|
+
/**
|
|
36
|
+
* Single-line input for a list of object references. Typing `@` (or any text, with
|
|
37
|
+
* `activateOnTyping`) opens a typeahead menu matching objects of the given type by label (and
|
|
38
|
+
* by their `getValues` values). The content model depends on {@link RefEditorProps.mode}.
|
|
39
|
+
* Resolved entries render as atomic tags with the object's label; raw tokens accepted by the
|
|
40
|
+
* pluggable `match` regexp render as neutral tags.
|
|
41
|
+
*/
|
|
42
|
+
export declare const RefEditor: React.ForwardRefExoticComponent<Omit<{
|
|
43
|
+
/** Database queried for objects of {@link RefEditorProps.type}. */
|
|
44
|
+
db?: Database.Database;
|
|
45
|
+
/** ECHO object type whose instances are offered in the typeahead and referenced as `@<id>`. */
|
|
46
|
+
type: Type.AnyObj;
|
|
47
|
+
value?: string;
|
|
48
|
+
readonly?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Content model:
|
|
51
|
+
* - `'ref'` (default): the picker only matches existing objects; selection inserts an
|
|
52
|
+
* `@<id>` reference (raw tokens accepted by `match` are also allowed).
|
|
53
|
+
* - `'email'`: the picker shows one item per (object, value) pair and selection captures the
|
|
54
|
+
* value; the content is an RFC 5322 mailbox list (`Name <email>, ...`) with the comma
|
|
55
|
+
* separators hidden inside the tags.
|
|
56
|
+
*/
|
|
57
|
+
mode?: RefEditorMode;
|
|
58
|
+
/** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens are accepted as values. */
|
|
59
|
+
match?: RegExp;
|
|
60
|
+
/** Display label for an object; defaults to `Obj.getLabel` falling back to the id. */
|
|
61
|
+
getLabel?: (object: Obj.Unknown) => string;
|
|
62
|
+
/** Values an object can be captured as in `'email'` mode (e.g. a person's email addresses). */
|
|
63
|
+
getValues?: (object: Obj.Unknown) => readonly string[];
|
|
64
|
+
/** Menu item icon. */
|
|
65
|
+
icon?: string;
|
|
66
|
+
/** Already-translated placeholder; defaults to a generic hint. */
|
|
67
|
+
placeholder?: string;
|
|
68
|
+
/** Open the typeahead while typing (the `@` trigger remains available but is not required). */
|
|
69
|
+
activateOnTyping?: boolean;
|
|
70
|
+
} & Omit<EditorViewProps, "initialValue"> & Pick<EditorMenuProviderProps, "numItems">, "className"> & {
|
|
71
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
72
|
+
} & React.RefAttributes<EditorController>>;
|
|
73
|
+
//# sourceMappingURL=RefEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/RefEditor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,KAAK,QAAQ,EAAU,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,EAAE,KAAK,eAAe,EAAmC,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAErB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAGL,KAAK,aAAa,EAKnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG,eAAe,CAC1C;IACE,mEAAmE;IACnE,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,+FAA+F;IAC/F,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC;IAC3C,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,MAAM,EAAE,CAAC;IACvD,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,GACvC,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;IAtClB,mEAAmE;SAC9D,QAAQ,CAAC,QAAQ;IACtB,+FAA+F;UACzF,IAAI,CAAC,MAAM;YACT,MAAM;eACH,OAAO;IAClB;;;;;;;OAOG;WACI,aAAa;IACpB,sGAAsG;YAC9F,MAAM;IACd,sFAAsF;eAC3E,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,MAAM;IAC1C,+FAA+F;gBACnF,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,MAAM,EAAE;IACtD,sBAAsB;WACf,MAAM;IACb,kEAAkE;kBACpD,MAAM;IACpB,+FAA+F;uBAC5E,OAAO;;;0CAmM7B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type RefEditorProps } from './RefEditor';
|
|
4
|
+
type StoryProps = Partial<Pick<RefEditorProps, 'value' | 'mode' | 'activateOnTyping' | 'autoFocus'>>;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
render: ({ value: initialValue, ...args }: StoryProps) => React.JSX.Element;
|
|
8
|
+
decorators: import("@storybook/react").Decorator[];
|
|
9
|
+
parameters: {
|
|
10
|
+
translations: [{
|
|
11
|
+
readonly 'en-US': {
|
|
12
|
+
readonly "@dxos/react-ui-form": {
|
|
13
|
+
readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
|
|
14
|
+
readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
|
|
15
|
+
readonly 'fields.label': 'Fields';
|
|
16
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
17
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
18
|
+
readonly 'field-property.label': 'Property';
|
|
19
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
20
|
+
readonly 'field-format.label': 'Type';
|
|
21
|
+
readonly 'field-path.label': 'Field path';
|
|
22
|
+
readonly 'remove-item.button': 'Delete item';
|
|
23
|
+
readonly 'add-item.button': 'Add item';
|
|
24
|
+
readonly 'add-property-button.label': 'Add property';
|
|
25
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
26
|
+
readonly 'boolean-input-false.value': 'No';
|
|
27
|
+
readonly 'show-field.label': 'Show field';
|
|
28
|
+
readonly 'hide-field.label': 'Hide field';
|
|
29
|
+
readonly 'expand-fields.label': 'Expand';
|
|
30
|
+
readonly 'collapse-fields.label': 'Collapse';
|
|
31
|
+
readonly 'delete-field.label': 'Delete field';
|
|
32
|
+
readonly 'create-option.label': 'Create';
|
|
33
|
+
readonly 'add-tag.label': 'Add tag';
|
|
34
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
35
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
36
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
37
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
38
|
+
readonly 'example.placeholder': 'Example';
|
|
39
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
40
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
41
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
42
|
+
readonly 'save-button.label': 'Save';
|
|
43
|
+
readonly 'create-text.label': 'Create text';
|
|
44
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
45
|
+
readonly 'format.currency.label': 'Currency';
|
|
46
|
+
readonly 'format.date.label': 'Date';
|
|
47
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
48
|
+
readonly 'format.did.label': 'DID';
|
|
49
|
+
readonly 'format.duration.label': 'Duration';
|
|
50
|
+
readonly 'format.dxn.label': 'DXN';
|
|
51
|
+
readonly 'format.email.label': 'Email';
|
|
52
|
+
readonly 'format.formula.label': 'Formula';
|
|
53
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
54
|
+
readonly 'format.integer.label': 'Integer';
|
|
55
|
+
readonly 'format.json.label': 'JSON';
|
|
56
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
57
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
58
|
+
readonly 'format.percent.label': 'Percent';
|
|
59
|
+
readonly 'format.ref.label': 'Reference';
|
|
60
|
+
readonly 'format.regex.label': 'RegExp';
|
|
61
|
+
readonly 'format.string.label': 'String';
|
|
62
|
+
readonly 'format.single-select.label': 'Select';
|
|
63
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
64
|
+
readonly 'format.text.label': 'Long text';
|
|
65
|
+
readonly 'format.time.label': 'Time';
|
|
66
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
67
|
+
readonly 'format.user.label': 'User';
|
|
68
|
+
readonly 'format.number.label': 'Number';
|
|
69
|
+
readonly 'format.uri.label': 'URI';
|
|
70
|
+
readonly 'format.url.label': 'URL';
|
|
71
|
+
readonly 'format.uuid.label': 'UUID';
|
|
72
|
+
readonly 'latitude.label': 'Latitude';
|
|
73
|
+
readonly 'longitude.label': 'Longitude';
|
|
74
|
+
readonly 'select-option.label': 'Label';
|
|
75
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
76
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
77
|
+
readonly 'select-option-add.button': 'Add option';
|
|
78
|
+
readonly 'system-schema.title': 'System type';
|
|
79
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
80
|
+
readonly 'remove.button': 'Delete';
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export default meta;
|
|
87
|
+
type Story = StoryObj<typeof meta>;
|
|
88
|
+
export declare const Default: Story;
|
|
89
|
+
export declare const ActivateOnTyping: Story;
|
|
90
|
+
export declare const EmailMode: Story;
|
|
91
|
+
export declare const WithEmail: Story;
|
|
92
|
+
//# sourceMappingURL=RefEditor.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/RefEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAoD7D,KAAK,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,GAAG,kBAAkB,GAAG,WAAW,CAAC,CAAC,CAAC;AA2BrG,QAAA,MAAM,IAAI;;+CAvB8C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC7B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAK9B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Display info for a resolved object reference.
|
|
4
|
+
*/
|
|
5
|
+
export type RefInfo = {
|
|
6
|
+
label: string;
|
|
7
|
+
hue?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Content model:
|
|
11
|
+
* - `'ref'`: whitespace-separated tokens; `@<id>` references to existing objects (and raw tokens
|
|
12
|
+
* accepted by the pluggable {@link RefEditorExtensionOptions.match} regexp).
|
|
13
|
+
* - `'email'`: comma-separated RFC 5322 mailboxes (`Name <email>` or bare `email`); the comma
|
|
14
|
+
* separators are consumed into the atomic tags so they are not visible.
|
|
15
|
+
*/
|
|
16
|
+
export type RefEditorMode = 'ref' | 'email';
|
|
17
|
+
export type RefEditorExtensionOptions = {
|
|
18
|
+
mode?: RefEditorMode;
|
|
19
|
+
/** Resolve an object id referenced as `@<id>` to display info. */
|
|
20
|
+
getRef?: (id: string) => RefInfo | undefined;
|
|
21
|
+
/** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens render as neutral tags. */
|
|
22
|
+
match?: RegExp;
|
|
23
|
+
};
|
|
24
|
+
/** Matches an object reference token (`@<object id>`). */
|
|
25
|
+
export declare const REF_REGEX: RegExp;
|
|
26
|
+
/** Matches a well-formed email address token. */
|
|
27
|
+
export declare const EMAIL_REGEX: RegExp;
|
|
28
|
+
/** Matches an RFC 5322 name-addr (`Name <email>`); group 1 = display name, group 2 = addr-spec. */
|
|
29
|
+
export declare const NAME_ADDR_REGEX: RegExp;
|
|
30
|
+
/** Formats an RFC 5322 mailbox (`Name <email>`). */
|
|
31
|
+
export declare const formatMailbox: (name: string | undefined, email: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Effect dispatched when reference data changes out-of-band (e.g. objects finish loading) so that
|
|
34
|
+
* already-rendered reference decorations re-resolve without a document change.
|
|
35
|
+
*/
|
|
36
|
+
export declare const refEditorRedecorate: import("@codemirror/state").StateEffectType<null>;
|
|
37
|
+
/**
|
|
38
|
+
* CodeMirror extension rendering reference-editor tokens as tags. Tags are atomic: the cursor
|
|
39
|
+
* cannot enter them and deletion removes the whole token.
|
|
40
|
+
* - `'ref'` mode: `@<id>` references resolve to the object's label (via
|
|
41
|
+
* {@link RefEditorExtensionOptions.getRef}); tokens accepted by the pluggable `match` regexp
|
|
42
|
+
* render as neutral tags.
|
|
43
|
+
* - `'email'` mode: RFC 5322 mailboxes render as tags labelled with the display name (falling
|
|
44
|
+
* back to the address); the trailing comma separator is hidden inside the tag's atomic range.
|
|
45
|
+
*/
|
|
46
|
+
export declare const refEditor: ({ mode, getRef, match }?: RefEditorExtensionOptions) => Extension;
|
|
47
|
+
//# sourceMappingURL=ref-editor-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-editor-extension.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/ref-editor-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAM/G;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC;IAC7C,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,SAAS,QAAsB,CAAC;AAE7C,iDAAiD;AACjD,eAAO,MAAM,WAAW,QAAqD,CAAC;AAE9E,mGAAmG;AACnG,eAAO,MAAM,eAAe,QAAiE,CAAC;AAE9F,oDAAoD;AACpD,eAAO,MAAM,aAAa,SAAU,MAAM,GAAG,SAAS,SAAS,MAAM,KAAG,MAA+C,CAAC;AAExH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,mDAA6B,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,6BAAqC,yBAAyB,KAAQ,SAoH3F,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type SettingsRootProps = ThemedClassName<PropsWithChildren>;
|
|
4
|
+
declare function SettingsRoot({ children, classNames }: SettingsRootProps): React.JSX.Element;
|
|
5
|
+
declare namespace SettingsRoot {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
type SettingsSectionProps = PropsWithChildren<{
|
|
9
|
+
title: Label;
|
|
10
|
+
description?: Label;
|
|
11
|
+
}>;
|
|
12
|
+
declare function SettingsSection({ title, description, children }: SettingsSectionProps): React.JSX.Element;
|
|
13
|
+
declare namespace SettingsSection {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Settings: {
|
|
17
|
+
Root: {
|
|
18
|
+
({ children, classNames }: SettingsRootProps): React.JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
|
|
22
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
23
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
Section: {
|
|
25
|
+
({ title, description, children }: SettingsSectionProps): React.JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
Panel: {
|
|
29
|
+
({ classNames, children }: Omit<{
|
|
30
|
+
children?: React.ReactNode | undefined;
|
|
31
|
+
}, "className"> & {
|
|
32
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
Item: {
|
|
37
|
+
({ title, description, children }: {
|
|
38
|
+
title: Label;
|
|
39
|
+
description?: Label;
|
|
40
|
+
} & {
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
|
+
}): React.JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
FieldSet: {
|
|
46
|
+
<T extends Record<string, any>>({ schema, values, onValuesChanged, readonly, fieldMap, visible, sort, pathPrefix, }: import("./SettingsFieldSet").SettingsFieldSetProps<T>): React.JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=Settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,KAAK,EAAc,KAAK,eAAe,EAAqC,MAAM,gBAAgB,CAAC;AAiBjH,KAAK,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;8BAEtC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,iBAAiB;;;;AA0BjE,KAAK,oBAAoB,GAAG,iBAAiB,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;iCAEsB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,oBAAoB;;;;AAiB/E,eAAO,MAAM,QAAQ;IACnB,IAAI;mCAjD0C,iBAAiB;;;IAkD/D,QAAQ;;;IACR,OAAO;2CApBkD,oBAAoB;;;IAqB7E,KAAK;;;;;;;;IACL,IAAI;;;;;;;;;IACJ,QAAQ;;;;CACT,CAAC"}
|