@rebasepro/admin 0.13.1-canary.gef9608c → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/{CollectionEditorDialog-7b-kSLno.js → CollectionEditorDialog-CSheud_E.js} +19 -9
  2. package/dist/CollectionEditorDialog-CSheud_E.js.map +1 -0
  3. package/dist/{PropertyEditView-C-31uvpG.js → PropertyEditView-CWZlC1gq.js} +5 -5
  4. package/dist/PropertyEditView-CWZlC1gq.js.map +1 -0
  5. package/dist/{RouterCollectionsStudioView-BJylABq3.js → RouterCollectionsStudioView-CwTpdzWF.js} +9 -13
  6. package/dist/RouterCollectionsStudioView-CwTpdzWF.js.map +1 -0
  7. package/dist/collection_editor/serializable_types.d.ts +1 -0
  8. package/dist/collection_editor_ui.js +4 -4
  9. package/dist/components/ClearFilterSortButton.d.ts +7 -1
  10. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +3 -1
  11. package/dist/components/CollectionViewBinding/SearchExplanation.d.ts +48 -0
  12. package/dist/components/CollectionViewBinding/SearchHighlight.d.ts +101 -0
  13. package/dist/components/CollectionViewBinding/SlotValue.d.ts +26 -0
  14. package/dist/components/CollectionViewBinding/SortButton.d.ts +7 -1
  15. package/dist/components/CollectionViewBinding/SplitListCloseButton.d.ts +17 -6
  16. package/dist/components/CollectionViewBinding/SplitListShowButton.d.ts +1 -1
  17. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +26 -1
  18. package/dist/components/DetailViewBinding.d.ts +7 -0
  19. package/dist/components/DrawerNavigationGroup.d.ts +4 -2
  20. package/dist/components/DrawerNavigationItem.d.ts +13 -5
  21. package/dist/components/EditViewBinding.d.ts +22 -7
  22. package/dist/components/EntityIdentityBar.d.ts +24 -1
  23. package/dist/components/RelationSelector.d.ts +13 -0
  24. package/dist/data_export/export/export.d.ts +7 -0
  25. package/dist/data_export/export/fetch_export_data.d.ts +48 -0
  26. package/dist/data_export/export/index.d.ts +1 -0
  27. package/dist/data_import/utils/csv.d.ts +30 -0
  28. package/dist/data_import/utils/index.d.ts +2 -0
  29. package/dist/data_import/utils/save_entities.d.ts +38 -0
  30. package/dist/data_import/utils/transforms.d.ts +9 -0
  31. package/dist/editor.js +3 -0
  32. package/dist/editor.js.map +1 -1
  33. package/dist/{export-C-XG3aRh.js → export-L53WektO.js} +175 -39
  34. package/dist/export-L53WektO.js.map +1 -0
  35. package/dist/form/form_utils.d.ts +38 -1
  36. package/dist/{history-DfMuvPfr.js → history-D5SKygpJ.js} +2 -2
  37. package/dist/{history-DfMuvPfr.js.map → history-D5SKygpJ.js.map} +1 -1
  38. package/dist/{import-B0GyllB0.js → import-C_4edkoD.js} +5 -4
  39. package/dist/import-C_4edkoD.js.map +1 -0
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.js +96 -80
  42. package/dist/index.js.map +1 -1
  43. package/dist/preview/components/date_fns_locales.d.ts +9 -0
  44. package/dist/util/view_constants.d.ts +24 -0
  45. package/dist/util/view_mode.d.ts +18 -0
  46. package/dist/{util-DHNXodBo.js → util-C-D5yD2n.js} +2173 -673
  47. package/dist/util-C-D5yD2n.js.map +1 -0
  48. package/package.json +10 -9
  49. package/src/collection_editor/serializable_types.ts +1 -0
  50. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +8 -3
  51. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -2
  52. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +1 -0
  53. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +9 -8
  54. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +9 -11
  55. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -2
  56. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -1
  57. package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +5 -2
  58. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +1 -0
  59. package/src/collection_editor/useJsonCollectionsConfigController.tsx +92 -84
  60. package/src/collection_editor/useLocalCollectionsConfigController.tsx +10 -3
  61. package/src/components/ClearFilterSortButton.tsx +16 -7
  62. package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +2 -2
  63. package/src/components/CollectionTableBinding/PropertyTableCell.tsx +2 -2
  64. package/src/components/CollectionTableBinding/column_utils.tsx +15 -6
  65. package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +2 -2
  66. package/src/components/CollectionTableBinding/table_bindings.tsx +7 -1
  67. package/src/components/CollectionViewBinding/BoardCardBinding.tsx +18 -1
  68. package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +13 -7
  69. package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +2 -1
  70. package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +816 -335
  71. package/src/components/CollectionViewBinding/CollectionViewActions.tsx +1 -1
  72. package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +26 -6
  73. package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +9 -0
  74. package/src/components/CollectionViewBinding/EntityCardBinding.tsx +45 -10
  75. package/src/components/CollectionViewBinding/SearchExplanation.tsx +106 -0
  76. package/src/components/CollectionViewBinding/SearchHighlight.tsx +311 -0
  77. package/src/components/CollectionViewBinding/SlotValue.tsx +96 -0
  78. package/src/components/CollectionViewBinding/SortButton.tsx +16 -4
  79. package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +23 -9
  80. package/src/components/CollectionViewBinding/SplitListShowButton.tsx +3 -3
  81. package/src/components/CollectionViewBinding/SplitListView.tsx +36 -9
  82. package/src/components/CollectionViewBinding/ViewModeToggle.tsx +10 -5
  83. package/src/components/CollectionViewBinding/useBoardDataController.tsx +11 -3
  84. package/src/components/CollectionViewBinding/usePreviewSlots.ts +76 -24
  85. package/src/components/CollectionViewBinding/utils.ts +7 -4
  86. package/src/components/DefaultDrawer.tsx +7 -0
  87. package/src/components/DetailViewBinding.tsx +33 -9
  88. package/src/components/DrawerNavigationGroup.tsx +12 -32
  89. package/src/components/DrawerNavigationItem.tsx +33 -12
  90. package/src/components/EditViewBinding.tsx +175 -28
  91. package/src/components/EntityIdentityBar.tsx +109 -17
  92. package/src/components/EntityInspector.tsx +24 -6
  93. package/src/components/EntityViewBinding.tsx +4 -2
  94. package/src/components/ReferenceTable/SelectionTableBinding.tsx +4 -2
  95. package/src/components/RelationSelector.tsx +61 -11
  96. package/src/components/SearchIconsView.tsx +14 -33
  97. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -0
  98. package/src/components/SidePanelBinding.tsx +36 -25
  99. package/src/components/UserSelector.tsx +52 -9
  100. package/src/components/history/LastEditedByIndicator.tsx +7 -12
  101. package/src/data_export/export/ExportCollectionAction.tsx +101 -48
  102. package/src/data_export/export/export.ts +63 -16
  103. package/src/data_export/export/fetch_export_data.ts +90 -0
  104. package/src/data_export/export/index.ts +1 -0
  105. package/src/data_import/components/DataNewPropertiesMapping.tsx +20 -3
  106. package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -0
  107. package/src/data_import/components/ImportSaveInProgress.tsx +35 -36
  108. package/src/data_import/import/ImportCollectionAction.tsx +13 -2
  109. package/src/data_import/utils/csv.ts +153 -0
  110. package/src/data_import/utils/data.ts +16 -2
  111. package/src/data_import/utils/file_to_json.ts +77 -6
  112. package/src/data_import/utils/index.ts +2 -0
  113. package/src/data_import/utils/save_entities.ts +138 -0
  114. package/src/data_import/utils/transforms.ts +23 -0
  115. package/src/editor/components/image-bubble.tsx +2 -0
  116. package/src/editor/selectors/link-selector.tsx +1 -0
  117. package/src/form/EntityForm.tsx +12 -3
  118. package/src/form/EntityFormBinding.tsx +8 -12
  119. package/src/form/PropertyFieldBinding.tsx +2 -2
  120. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +2 -2
  121. package/src/form/field_bindings/BinaryFieldBinding.tsx +1 -0
  122. package/src/form/field_bindings/BlockFieldBinding.tsx +3 -3
  123. package/src/form/field_bindings/DateTimeFieldBinding.tsx +4 -0
  124. package/src/form/field_bindings/KeyValueFieldBinding.tsx +3 -0
  125. package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
  126. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +15 -2
  127. package/src/form/field_bindings/RepeatFieldBinding.tsx +3 -3
  128. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +2 -2
  129. package/src/form/field_bindings/TextFieldBinding.tsx +18 -0
  130. package/src/form/field_bindings/VectorFieldBinding.tsx +1 -0
  131. package/src/form/form_utils.ts +78 -0
  132. package/src/index.ts +9 -1
  133. package/src/preview/PropertyPreview.tsx +7 -3
  134. package/src/preview/components/DatePreview.tsx +15 -2
  135. package/src/preview/components/ReferencePreview.tsx +5 -8
  136. package/src/preview/components/RelationPreview.tsx +8 -7
  137. package/src/preview/components/date_fns_locales.ts +125 -0
  138. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +6 -3
  139. package/src/util/navigation_utils.ts +4 -2
  140. package/src/util/property_utils.tsx +6 -1
  141. package/src/util/view_constants.ts +27 -0
  142. package/src/util/view_mode.ts +36 -0
  143. package/dist/CollectionEditorDialog-7b-kSLno.js.map +0 -1
  144. package/dist/PropertyEditView-C-31uvpG.js.map +0 -1
  145. package/dist/RouterCollectionsStudioView-BJylABq3.js.map +0 -1
  146. package/dist/export-C-XG3aRh.js.map +0 -1
  147. package/dist/import-B0GyllB0.js.map +0 -1
  148. package/dist/util-DHNXodBo.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, Ln as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-DHNXodBo.js";
3
- import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-C-31uvpG.js";
2
+ import { Bt as FieldCaption, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Hn as useCollectionRegistryController, Ot as ImportSaveInProgress, Rt as PropertyConfigBadge, St as DataNewPropertiesMapping, T as getFieldId, _ as useCollectionsConfigController, dn as useNavigationStateController, i as namespaceToPropertiesOrderPath, in as CollectionTableBinding, jt as ImportFileUpload, l as validateCollectionJson, ln as useUrlController, m as toSerializableCollectionConfig, n as getFullIdPath, nn as useSelectionController, o as CollectionGenerationApiError, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, w as getFieldConfig, xt as ImportNewPropertyFieldPreview, zt as SearchIconsView } from "./util-C-D5yD2n.js";
3
+ import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-CWZlC1gq.js";
4
4
  import * as React$1 from "react";
5
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Alert, AppWindow, ArrowLeftIcon, BooleanSwitchWithLabel, Button, Card, CheckIcon, Chip, CircularProgress, CircularProgressCenter, CodeIcon, ColumnsIcon, Container, CopyIcon, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, FileIcon, FileSearchIcon, FileTextIcon, IconButton, KanbanIcon, KeyIcon, LayoutGridIcon, ListIcon, LoadingButton, Menu, MultiSelect, MultiSelectItem, PanelLeftIcon, Paper, PlusIcon, Select, SelectItem, ShoppingCartIcon, SquareIcon, Tab, TableIcon, Tabs, TextField, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, UserIcon, XIcon, cls, coolIconKeys, defaultBorderMixin, iconSize } from "@rebasepro/ui";
7
7
  import { buildCollectionFromTableMetadata, getGeneratedPolicyNames, getSubcollections, getTableName, isPropertyBuilder } from "@rebasepro/common";
8
- import { AIIcon, ConfirmationDialog, ErrorView, IconForView, UnsavedChangesDialog, removeInitialAndTrailingSlashes, useAuthController, useCustomizationController, useLargeLayout, useRebaseContext, useUnsavedChangesDialog } from "@rebasepro/app";
8
+ import { AIIcon, ConfirmationDialog, ErrorView, IconForView, UnsavedChangesDialog, removeInitialAndTrailingSlashes, useAuthController, useCustomizationController, useLargeLayout, useRebaseContext, useTranslation, useUnsavedChangesDialog } from "@rebasepro/app";
9
9
  import { Field, Formex, clone, getIn, useCreateFormex, useFormex } from "@rebasepro/forms";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { camelCase, getPolicyNamesForRule, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
@@ -191,12 +191,14 @@ function GeneralSettingsForm({ isNewCollection, existingPaths, existingIds, pare
191
191
  });
192
192
  }
193
193
  function DefaultDatabaseField({ databaseId, disabled = false, onDatabaseIdUpdate }) {
194
+ const { t } = useTranslation();
194
195
  return /* @__PURE__ */ jsx(Tooltip, {
195
- title: "Database ID",
196
+ title: t("database_id"),
196
197
  side: "top",
197
198
  align: "start",
198
199
  children: /* @__PURE__ */ jsx(TextField, {
199
200
  size: "small",
201
+ "aria-label": t("database_id"),
200
202
  invisible: true,
201
203
  inputClassName: "text-end",
202
204
  disabled,
@@ -1247,6 +1249,7 @@ function CollectionJsonImportDialog({ open, onClose, onImport }) {
1247
1249
  /* @__PURE__ */ jsx(TextField, {
1248
1250
  multiline: true,
1249
1251
  minRows: 12,
1252
+ "aria-label": "Collection JSON",
1250
1253
  value: jsonValue,
1251
1254
  onChange: handleJsonChange,
1252
1255
  placeholder: EXAMPLE_JSON,
@@ -1719,6 +1722,7 @@ var pagesCollectionTemplate = {
1719
1722
  //#endregion
1720
1723
  //#region src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx
1721
1724
  function AICollectionGeneratorPopover({ existingCollection, onGenerated, generateCollection, trigger, size = "small", showLabel = true, onAnalyticsEvent }) {
1725
+ const { t } = useTranslation();
1722
1726
  const [menuOpen, setMenuOpen] = useState(false);
1723
1727
  const [prompt, setPrompt] = useState("");
1724
1728
  const [loading, setLoading] = useState(false);
@@ -1824,12 +1828,13 @@ function AICollectionGeneratorPopover({ existingCollection, onGenerated, generat
1824
1828
  /* @__PURE__ */ jsx(Typography, {
1825
1829
  variant: "caption",
1826
1830
  color: "secondary",
1827
- children: existingCollection ? "Describe the changes you want to make to this collection." : "Describe the collection you want to create."
1831
+ children: existingCollection ? t("describe_changes_to_make") : t("describe_collection_to_create")
1828
1832
  }),
1829
1833
  /* @__PURE__ */ jsx(TextField, {
1830
1834
  size: "small",
1831
1835
  multiline: true,
1832
1836
  autoFocus: true,
1837
+ "aria-label": existingCollection ? t("describe_changes_to_make") : t("describe_collection_to_create"),
1833
1838
  className: "w-full text-text-primary dark:text-text-primary-dark",
1834
1839
  value: prompt,
1835
1840
  onChange: (e) => setPrompt(e.target.value),
@@ -2672,6 +2677,7 @@ var COMMAND_OPTIONS = [
2672
2677
  "DELETE"
2673
2678
  ];
2674
2679
  function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, onSave, onCancel }) {
2680
+ const { t } = useTranslation();
2675
2681
  const [name, setName] = useState(policy?.policyname || "");
2676
2682
  const [behavior, setBehavior] = useState(policy?.permissive || "PERMISSIVE");
2677
2683
  const [command, setCommand] = useState(policy?.cmd || "ALL");
@@ -2720,8 +2726,9 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
2720
2726
  children: [/* @__PURE__ */ jsx(Typography, {
2721
2727
  variant: "caption",
2722
2728
  className: "uppercase tracking-wider text-text-secondary",
2723
- children: "Policy Name"
2729
+ children: t("studio_policy_name")
2724
2730
  }), /* @__PURE__ */ jsx(TextField, {
2731
+ "aria-label": t("studio_policy_name"),
2725
2732
  value: name,
2726
2733
  onChange: (e) => setName(e.target.value),
2727
2734
  placeholder: "e.g. allow_read_all"
@@ -2807,6 +2814,7 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
2807
2814
  className: "flex gap-2 items-center",
2808
2815
  children: [/* @__PURE__ */ jsx(TextField, {
2809
2816
  size: "small",
2817
+ "aria-label": "Add a custom role",
2810
2818
  value: customRole,
2811
2819
  onChange: (e) => setCustomRole(e.target.value),
2812
2820
  onKeyDown: (e) => {
@@ -2832,8 +2840,9 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
2832
2840
  children: [/* @__PURE__ */ jsx(Typography, {
2833
2841
  variant: "caption",
2834
2842
  className: "uppercase tracking-wider text-text-secondary",
2835
- children: "USING expression"
2843
+ children: t("studio_policy_using_expr")
2836
2844
  }), /* @__PURE__ */ jsx(TextField, {
2845
+ "aria-label": t("studio_policy_using_expr"),
2837
2846
  value: usingExpr,
2838
2847
  onChange: (e) => setUsingExpr(e.target.value),
2839
2848
  placeholder: "e.g. auth.uid() = uid"
@@ -2844,8 +2853,9 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
2844
2853
  children: [/* @__PURE__ */ jsx(Typography, {
2845
2854
  variant: "caption",
2846
2855
  className: "uppercase tracking-wider text-text-secondary",
2847
- children: "WITH CHECK expression"
2856
+ children: t("studio_policy_check_expr")
2848
2857
  }), /* @__PURE__ */ jsx(TextField, {
2858
+ "aria-label": t("studio_policy_check_expr"),
2849
2859
  value: checkExpr,
2850
2860
  onChange: (e) => setCheckExpr(e.target.value),
2851
2861
  placeholder: "e.g. auth.uid() = uid"
@@ -3550,4 +3560,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
3550
3560
  //#endregion
3551
3561
  export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
3552
3562
 
3553
- //# sourceMappingURL=CollectionEditorDialog-7b-kSLno.js.map
3563
+ //# sourceMappingURL=CollectionEditorDialog-CSheud_E.js.map