@dxos/react-ui-form 0.8.3-staging.0fa589b → 0.8.4-main.84f28bd

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 (41) hide show
  1. package/dist/lib/browser/index.mjs +40 -40
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +40 -40
  5. package/dist/lib/node-esm/index.mjs.map +3 -3
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +1 -1
  8. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +1 -1
  9. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +1 -1
  10. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  11. package/dist/types/src/components/Form/Form.stories.d.ts +1 -1
  12. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  13. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +1 -1
  14. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +1 -1
  16. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/deprecated/Form.stories.d.ts +1 -1
  18. package/dist/types/src/components/deprecated/Form.stories.d.ts.map +1 -1
  19. package/dist/types/src/index.d.ts +1 -1
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/translations.d.ts +56 -57
  22. package/dist/types/src/translations.d.ts.map +1 -1
  23. package/dist/types/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +30 -32
  25. package/src/components/ControlSection/ControlSection.stories.tsx +2 -2
  26. package/src/components/FieldEditor/FieldEditor.stories.tsx +2 -2
  27. package/src/components/Form/Form.stories.tsx +2 -2
  28. package/src/components/Form/RefField.tsx +1 -1
  29. package/src/components/Form/custom/SelectOptionsInput.stories.tsx +2 -2
  30. package/src/components/ViewEditor/ViewEditor.stories.tsx +2 -2
  31. package/src/components/ViewEditor/ViewEditor.test.tsx +23 -23
  32. package/src/components/deprecated/Form.stories.tsx +2 -2
  33. package/src/components/testing.tsx +1 -1
  34. package/src/index.ts +1 -1
  35. package/src/translations.ts +4 -2
  36. package/dist/lib/node/index.cjs +0 -2416
  37. package/dist/lib/node/index.cjs.map +0 -7
  38. package/dist/lib/node/meta.json +0 -1
  39. package/dist/types/src/components/ViewEditor/Test.stories.d.ts +0 -10
  40. package/dist/types/src/components/ViewEditor/Test.stories.d.ts.map +0 -1
  41. package/src/components/ViewEditor/Test.stories.tsx +0 -45
@@ -1,6 +1,6 @@
1
- // packages/ui/react-ui-form/src/translations.ts
1
+ // src/translations.ts
2
2
  var translationKey = "react-ui-form";
3
- var translations_default = [
3
+ var translations = [
4
4
  {
5
5
  "en-US": {
6
6
  [translationKey]: {
@@ -67,7 +67,7 @@ var translations_default = [
67
67
  }
68
68
  ];
69
69
 
70
- // packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx
70
+ // src/components/deprecated/FormInput.tsx
71
71
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
72
72
  import React from "react";
73
73
  import { Input } from "@dxos/react-ui";
@@ -119,7 +119,7 @@ var DeprecatedFormInput = ({ label, description, secondary, children }) => {
119
119
  }
120
120
  };
121
121
 
122
- // packages/ui/react-ui-form/src/components/ControlSection/ControlSection.tsx
122
+ // src/components/ControlSection/ControlSection.tsx
123
123
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
124
124
  import React2 from "react";
125
125
  import { Button, Input as Input2, toLocalizedString, useTranslation } from "@dxos/react-ui";
@@ -250,7 +250,7 @@ var ControlFrameItem = ({ title, description, children }) => {
250
250
  }
251
251
  };
252
252
 
253
- // packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx
253
+ // src/components/FieldEditor/FieldEditor.tsx
254
254
  import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
255
255
  import React14, { useCallback as useCallback9, useEffect as useEffect8, useMemo as useMemo7, useState as useState5 } from "react";
256
256
  import { FormatEnum as FormatEnum5, FormatEnums, formatToType } from "@dxos/echo-schema";
@@ -258,14 +258,14 @@ import { log as log3 } from "@dxos/log";
258
258
  import { useTranslation as useTranslation8 } from "@dxos/react-ui";
259
259
  import { getFormatSchema, getSchemaProperties as getSchemaProperties3, sortProperties } from "@dxos/schema";
260
260
 
261
- // packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx
261
+ // src/components/Form/custom/GeoPointInput.tsx
262
262
  import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
263
263
  import React4, { useCallback, useState, useEffect, useMemo } from "react";
264
264
  import { GeoLocation } from "@dxos/echo-schema";
265
265
  import { Input as Input4, useTranslation as useTranslation2 } from "@dxos/react-ui";
266
266
  import { safeParseFloat } from "@dxos/util";
267
267
 
268
- // packages/ui/react-ui-form/src/components/Form/Input.tsx
268
+ // src/components/Form/Input.tsx
269
269
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
270
270
  import React3 from "react";
271
271
  import { Icon, Input as Input3, Tooltip } from "@dxos/react-ui";
@@ -295,7 +295,7 @@ var InputHeader = ({ error, label, readonly }) => {
295
295
  }
296
296
  };
297
297
 
298
- // packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx
298
+ // src/components/Form/custom/GeoPointInput.tsx
299
299
  var GeoPointInput = ({ type, label, disabled, getStatus, getValue: getValue3, onValueChange, onBlur }) => {
300
300
  var _effect = _useSignals4();
301
301
  try {
@@ -372,7 +372,7 @@ var GeoPointInput = ({ type, label, disabled, getStatus, getValue: getValue3, on
372
372
  }
373
373
  };
374
374
 
375
- // packages/ui/react-ui-form/src/components/Form/custom/SelectOptionsInput.tsx
375
+ // src/components/Form/custom/SelectOptionsInput.tsx
376
376
  import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
377
377
  import React5, { useCallback as useCallback2, useEffect as useEffect2, useState as useState2, useRef } from "react";
378
378
  import { PublicKey } from "@dxos/keys";
@@ -563,7 +563,7 @@ var SelectOptionInput = ({ type, label, disabled, getStatus, getValue: getValue3
563
563
  }
564
564
  };
565
565
 
566
- // packages/ui/react-ui-form/src/components/Form/custom/TupleInput.tsx
566
+ // src/components/Form/custom/TupleInput.tsx
567
567
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
568
568
  import React6 from "react";
569
569
  import { Input as Input6 } from "@dxos/react-ui";
@@ -603,7 +603,7 @@ var TupleInput = ({ binding, type, label, disabled, getStatus, getValue: getValu
603
603
  }
604
604
  };
605
605
 
606
- // packages/ui/react-ui-form/src/components/Form/Defaults.tsx
606
+ // src/components/Form/Defaults.tsx
607
607
  import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
608
608
  import React7, { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef2 } from "react";
609
609
  import { Input as Input7, Select, useTranslation as useTranslation4 } from "@dxos/react-ui";
@@ -745,26 +745,26 @@ var MarkdownInput = ({ type, label, inputOnly, disabled, placeholder, getStatus,
745
745
  }
746
746
  };
747
747
 
748
- // packages/ui/react-ui-form/src/components/Form/Form.tsx
748
+ // src/components/Form/Form.tsx
749
749
  import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
750
750
  import React13, { useEffect as useEffect7, useMemo as useMemo6, useRef as useRef3 } from "react";
751
751
  import { cardDialogOverflow, cardSpacing as cardSpacing2 } from "@dxos/react-ui-stack";
752
752
 
753
- // packages/ui/react-ui-form/src/components/Form/FormActions.tsx
753
+ // src/components/Form/FormActions.tsx
754
754
  import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
755
755
  import React9 from "react";
756
756
  import { IconButton as IconButton2, useTranslation as useTranslation5 } from "@dxos/react-ui";
757
757
  import { cardSpacing } from "@dxos/react-ui-stack";
758
758
  import { mx as mx6 } from "@dxos/react-ui-theme";
759
759
 
760
- // packages/ui/react-ui-form/src/components/Form/FormContext.tsx
760
+ // src/components/Form/FormContext.tsx
761
761
  import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
762
762
  import React8, { createContext, useContext, useEffect as useEffect6, useMemo as useMemo3, useCallback as useCallback6 } from "react";
763
763
  import { raise } from "@dxos/debug";
764
764
  import { getValue as getValue2 } from "@dxos/echo-schema";
765
765
  import { createJsonPath as createJsonPath2 } from "@dxos/effect";
766
766
 
767
- // packages/ui/react-ui-form/src/hooks/useForm.ts
767
+ // src/hooks/useForm.ts
768
768
  import { SchemaAST } from "effect";
769
769
  import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo2, useState as useState3 } from "react";
770
770
  import { getValue, setValue } from "@dxos/echo-schema";
@@ -772,7 +772,7 @@ import { createJsonPath, fromEffectValidationPath } from "@dxos/effect";
772
772
  import { invariant } from "@dxos/invariant";
773
773
  import { log } from "@dxos/log";
774
774
  import { validateSchema } from "@dxos/schema";
775
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/hooks/useForm.ts";
775
+ var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-form/src/hooks/useForm.ts";
776
776
  var useForm = ({ schema, initialValues, onValuesChanged, onValidate, onValid, onSave }) => {
777
777
  invariant(SchemaAST.isTypeLiteral(schema.ast), void 0, {
778
778
  F: __dxlog_file,
@@ -973,7 +973,7 @@ var flatMap = (errors) => {
973
973
  }, {});
974
974
  };
975
975
 
976
- // packages/ui/react-ui-form/src/hooks/useRefQueryLookupHandler.ts
976
+ // src/hooks/useRefQueryLookupHandler.ts
977
977
  import { useCallback as useCallback5 } from "react";
978
978
  import { getObjectDXN } from "@dxos/echo-schema";
979
979
  import { Filter } from "@dxos/react-client/echo";
@@ -1001,10 +1001,10 @@ var useRefQueryLookupHandler = ({ space }) => {
1001
1001
  ]);
1002
1002
  };
1003
1003
 
1004
- // packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts
1004
+ // src/hooks/useQueryRefOptions.ts
1005
1005
  import { useEffect as useEffect5, useState as useState4 } from "react";
1006
1006
  import { log as log2 } from "@dxos/log";
1007
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts";
1007
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts";
1008
1008
  var useQueryRefOptions = ({ refTypeInfo, onQueryRefOptions }) => {
1009
1009
  const [options, setOptions] = useState4([]);
1010
1010
  const [loading, setLoading] = useState4(false);
@@ -1047,7 +1047,7 @@ var useQueryRefOptions = ({ refTypeInfo, onQueryRefOptions }) => {
1047
1047
  };
1048
1048
  };
1049
1049
 
1050
- // packages/ui/react-ui-form/src/components/Form/FormContext.tsx
1050
+ // src/components/Form/FormContext.tsx
1051
1051
  var FormContext = /* @__PURE__ */ createContext(void 0);
1052
1052
  var useFormContext = () => {
1053
1053
  return useContext(FormContext) ?? raise(new Error("Missing FormContext"));
@@ -1120,7 +1120,7 @@ var FormProvider = ({ children, formRef, autoSave, ...formOptions }) => {
1120
1120
  }
1121
1121
  };
1122
1122
 
1123
- // packages/ui/react-ui-form/src/components/Form/FormActions.tsx
1123
+ // src/components/Form/FormActions.tsx
1124
1124
  var FormActions = ({ readonly, onCancel, outerSpacing = true }) => {
1125
1125
  var _effect = _useSignals9();
1126
1126
  try {
@@ -1147,7 +1147,7 @@ var FormActions = ({ readonly, onCancel, outerSpacing = true }) => {
1147
1147
  }
1148
1148
  };
1149
1149
 
1150
- // packages/ui/react-ui-form/src/components/Form/FormContent.tsx
1150
+ // src/components/Form/FormContent.tsx
1151
1151
  import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1152
1152
  import { Schema, SchemaAST as SchemaAST4, pipe as pipe2 } from "effect";
1153
1153
  import { capitalize as capitalize2 } from "effect/String";
@@ -1157,7 +1157,7 @@ import { mx as mx8 } from "@dxos/react-ui-theme";
1157
1157
  import { getSchemaProperties as getSchemaProperties2 } from "@dxos/schema";
1158
1158
  import { isNotFalsy } from "@dxos/util";
1159
1159
 
1160
- // packages/ui/react-ui-form/src/components/Form/ArrayField.tsx
1160
+ // src/components/Form/ArrayField.tsx
1161
1161
  import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
1162
1162
  import { SchemaAST as SchemaAST3, pipe } from "effect";
1163
1163
  import { capitalize } from "effect/String";
@@ -1167,7 +1167,7 @@ import { invariant as invariant2 } from "@dxos/invariant";
1167
1167
  import { IconButton as IconButton3, useTranslation as useTranslation6 } from "@dxos/react-ui";
1168
1168
  import { getSchemaProperties } from "@dxos/schema";
1169
1169
 
1170
- // packages/ui/react-ui-form/src/util/field.ts
1170
+ // src/util/field.ts
1171
1171
  import { FormatEnum, GeoLocation as GeoLocation2, TypeEnum } from "@dxos/echo-schema";
1172
1172
  var parseValue = ({ type, format, value }) => {
1173
1173
  if (value === void 0 || value === null || value === "") {
@@ -1299,7 +1299,7 @@ var pathNotUniqueError = (path) => ({
1299
1299
  message: `'${path}' is already present`
1300
1300
  });
1301
1301
 
1302
- // packages/ui/react-ui-form/src/util/formatting.ts
1302
+ // src/util/formatting.ts
1303
1303
  import { format as formatDate } from "date-fns/format";
1304
1304
  import { FormatEnum as FormatEnum2, GeoLocation as GeoLocation3, TypeEnum as TypeEnum2 } from "@dxos/echo-schema";
1305
1305
  var formatForDisplay = ({ type, format, value, locale = void 0 }) => {
@@ -1437,11 +1437,11 @@ var formatForEditing = ({ type, format, value, locale = void 0 }) => {
1437
1437
  }
1438
1438
  };
1439
1439
 
1440
- // packages/ui/react-ui-form/src/util/refs.ts
1440
+ // src/util/refs.ts
1441
1441
  import { FormatEnum as FormatEnum3, ReferenceAnnotationId } from "@dxos/echo-schema";
1442
1442
  import { findAnnotation } from "@dxos/effect";
1443
1443
 
1444
- // packages/ui/react-ui-form/src/util/schema.ts
1444
+ // src/util/schema.ts
1445
1445
  import { SchemaAST as SchemaAST2 } from "effect";
1446
1446
  import { findNode } from "@dxos/effect";
1447
1447
  var findArrayElementType = (ast) => {
@@ -1450,7 +1450,7 @@ var findArrayElementType = (ast) => {
1450
1450
  return elementType;
1451
1451
  };
1452
1452
 
1453
- // packages/ui/react-ui-form/src/util/refs.ts
1453
+ // src/util/refs.ts
1454
1454
  var getRefProps = (property) => {
1455
1455
  const { ast, format, array } = property;
1456
1456
  if (format === FormatEnum3.Ref) {
@@ -1474,8 +1474,8 @@ var getRefProps = (property) => {
1474
1474
  return void 0;
1475
1475
  };
1476
1476
 
1477
- // packages/ui/react-ui-form/src/components/Form/ArrayField.tsx
1478
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/Form/ArrayField.tsx";
1477
+ // src/components/Form/ArrayField.tsx
1478
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/Form/ArrayField.tsx";
1479
1479
  var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponent }) => {
1480
1480
  var _effect = _useSignals10();
1481
1481
  try {
@@ -1571,7 +1571,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
1571
1571
  }
1572
1572
  };
1573
1573
 
1574
- // packages/ui/react-ui-form/src/components/Form/RefField.tsx
1574
+ // src/components/Form/RefField.tsx
1575
1575
  import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1576
1576
  import React11, { useCallback as useCallback8, useMemo as useMemo4 } from "react";
1577
1577
  import { Expando, getTypeAnnotation, Ref, ReferenceAnnotationId as ReferenceAnnotationId2 } from "@dxos/echo-schema";
@@ -1694,7 +1694,7 @@ var RefField = ({ type, label, disabled, placeholder, inputOnly, array, ast, get
1694
1694
  onBlur: (event) => onBlur(event),
1695
1695
  onUpdate: handleUpdate,
1696
1696
  onSearch: handleSearch,
1697
- classNames: "rounded-sm bg-inputSurface p-1.5"
1697
+ classNames: "bg-inputSurface p-1.5 rounded-sm"
1698
1698
  })), inputOnly && /* @__PURE__ */ React11.createElement(Input8.DescriptionAndValidation, null, error));
1699
1699
  } finally {
1700
1700
  _effect.f();
@@ -1738,7 +1738,7 @@ var RefFieldFallback = ({ type, label, disabled, placeholder, inputOnly, getValu
1738
1738
  }
1739
1739
  };
1740
1740
 
1741
- // packages/ui/react-ui-form/src/components/Form/factory.tsx
1741
+ // src/components/Form/factory.tsx
1742
1742
  import { FormatEnum as FormatEnum4 } from "@dxos/echo-schema";
1743
1743
  var getInputComponent = (type, format) => {
1744
1744
  switch (format) {
@@ -1757,7 +1757,7 @@ var getInputComponent = (type, format) => {
1757
1757
  }
1758
1758
  };
1759
1759
 
1760
- // packages/ui/react-ui-form/src/components/Form/FormContent.tsx
1760
+ // src/components/Form/FormContent.tsx
1761
1761
  var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupComponent, Custom }) => {
1762
1762
  var _effect = _useSignals12();
1763
1763
  try {
@@ -1908,7 +1908,7 @@ var FormFields = /* @__PURE__ */ forwardRef(({ classNames, testId, schema, path,
1908
1908
  }
1909
1909
  });
1910
1910
 
1911
- // packages/ui/react-ui-form/src/components/Form/Form.tsx
1911
+ // src/components/Form/Form.tsx
1912
1912
  var Form = ({ classNames, testId, values: initialValues, autoFocus, readonly, autoSave, outerSpacing = true, onCancel, schema, onValuesChanged, onValidate, onSave, ...props }) => {
1913
1913
  var _effect = _useSignals13();
1914
1914
  try {
@@ -1960,8 +1960,8 @@ var Form = ({ classNames, testId, values: initialValues, autoFocus, readonly, au
1960
1960
  }
1961
1961
  };
1962
1962
 
1963
- // packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx
1964
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx";
1963
+ // src/components/FieldEditor/FieldEditor.tsx
1964
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx";
1965
1965
  var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerSpacing }) => {
1966
1966
  var _effect = _useSignals14();
1967
1967
  try {
@@ -2125,7 +2125,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2125
2125
  }
2126
2126
  };
2127
2127
 
2128
- // packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx
2128
+ // src/components/ViewEditor/ViewEditor.tsx
2129
2129
  import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
2130
2130
  import { Schema as Schema2 } from "effect";
2131
2131
  import React15, { useCallback as useCallback10, useMemo as useMemo8, useState as useState6 } from "react";
@@ -2136,7 +2136,7 @@ import { List as List2 } from "@dxos/react-ui-list";
2136
2136
  import { cardSpacing as cardSpacing3 } from "@dxos/react-ui-stack";
2137
2137
  import { ghostHover, inputTextLabel, mx as mx9 } from "@dxos/react-ui-theme";
2138
2138
  import { FieldSchema, ViewProjection, VIEW_FIELD_LIMIT } from "@dxos/schema";
2139
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
2139
+ var __dxlog_file5 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
2140
2140
  var grid = "grid grid-cols-[32px_1fr_32px_32px] min-bs-[2.5rem]";
2141
2141
  var ViewMetaSchema = Schema2.Struct({
2142
2142
  name: Schema2.String.annotations({
@@ -2396,7 +2396,7 @@ export {
2396
2396
  getRefProps,
2397
2397
  parseValue,
2398
2398
  pathNotUniqueError,
2399
- translations_default as translations,
2399
+ translations,
2400
2400
  useForm,
2401
2401
  useFormContext,
2402
2402
  useFormValues,