@rebasepro/plugin-data-enhancement 0.1.2 → 0.2.1

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 (33) hide show
  1. package/LICENSE +17 -109
  2. package/README.md +1 -1
  3. package/dist/common/src/util/entities.d.ts +2 -2
  4. package/dist/common/src/util/relations.d.ts +1 -1
  5. package/dist/core/src/components/LoginView/LoginView.d.ts +1 -6
  6. package/dist/core/src/contexts/SnackbarProvider.d.ts +1 -1
  7. package/dist/core/src/hooks/data/save.d.ts +2 -2
  8. package/dist/core/src/hooks/data/useEntityFetch.d.ts +5 -0
  9. package/dist/core/src/hooks/useResolvedComponent.d.ts +1 -1
  10. package/dist/index.es.js +1 -2
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/index.umd.js +5 -5
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/controllers/auth.d.ts +9 -8
  15. package/dist/types/src/controllers/client.d.ts +3 -0
  16. package/dist/types/src/types/auth_adapter.d.ts +356 -0
  17. package/dist/types/src/types/collections.d.ts +67 -2
  18. package/dist/types/src/types/database_adapter.d.ts +94 -0
  19. package/dist/types/src/types/entity_actions.d.ts +7 -1
  20. package/dist/types/src/types/entity_callbacks.d.ts +1 -1
  21. package/dist/types/src/types/entity_views.d.ts +36 -1
  22. package/dist/types/src/types/index.d.ts +2 -0
  23. package/dist/types/src/types/plugins.d.ts +1 -1
  24. package/dist/types/src/types/properties.d.ts +24 -5
  25. package/dist/types/src/types/property_config.d.ts +6 -2
  26. package/dist/types/src/types/relations.d.ts +1 -1
  27. package/dist/types/src/types/translations.d.ts +8 -0
  28. package/dist/types/src/users/user.d.ts +5 -0
  29. package/dist/ui/src/components/FilterChip.d.ts +42 -0
  30. package/dist/ui/src/components/index.d.ts +5 -0
  31. package/dist/ui/src/icons/index.d.ts +2 -0
  32. package/package.json +15 -16
  33. package/src/components/FormEnhanceAction.tsx +14 -2
@@ -1,5 +1,5 @@
1
1
  import type { ComponentRef } from "./component_ref";
2
- import type { EntityReference, EntityRelation, EntityValues, GeoPoint, Entity } from "./entities";
2
+ import type { EntityReference, EntityRelation, EntityValues, GeoPoint, Entity, Vector } from "./entities";
3
3
  import type { Relation, JoinStep, OnAction } from "./relations";
4
4
  import type { EntityCollection, FilterValues } from "./collections";
5
5
  import type { ColorKey, ColorScheme } from "./chips";
@@ -31,8 +31,8 @@ export type PropertyCallbacks<T = unknown, M extends Record<string, unknown> = R
31
31
  /**
32
32
  * @group Entity properties
33
33
  */
34
- export type DataType = "string" | "number" | "boolean" | "date" | "geopoint" | "reference" | "relation" | "array" | "map";
35
- export type Property = StringProperty | NumberProperty | BooleanProperty | DateProperty | GeopointProperty | ReferenceProperty | RelationProperty | ArrayProperty | MapProperty;
34
+ export type DataType = "string" | "number" | "boolean" | "date" | "geopoint" | "reference" | "relation" | "array" | "map" | "vector" | "binary";
35
+ export type Property = StringProperty | NumberProperty | BooleanProperty | DateProperty | GeopointProperty | ReferenceProperty | RelationProperty | ArrayProperty | MapProperty | VectorProperty | BinaryProperty;
36
36
  export type Properties = {
37
37
  [key: string]: Property;
38
38
  };
@@ -48,7 +48,7 @@ export type FirebaseProperties = {
48
48
  * A helper type to infer the underlying data type from a Property definition.
49
49
  * This is the core of the type inference system.
50
50
  */
51
- export type InferPropertyType<P extends Property> = P extends StringProperty ? string : P extends NumberProperty ? number : P extends BooleanProperty ? boolean : P extends DateProperty ? Date : P extends GeopointProperty ? GeoPoint : P extends ReferenceProperty ? EntityReference : P extends RelationProperty ? EntityRelation | EntityRelation[] : P extends ArrayProperty ? (P["of"] extends Property ? InferPropertyType<P["of"]>[] : unknown[]) : P extends MapProperty ? (P["properties"] extends Properties ? InferEntityType<P["properties"]> : Record<string, unknown>) : never;
51
+ export type InferPropertyType<P extends Property> = P extends StringProperty ? string : P extends NumberProperty ? number : P extends BooleanProperty ? boolean : P extends DateProperty ? Date : P extends GeopointProperty ? GeoPoint : P extends ReferenceProperty ? EntityReference : P extends RelationProperty ? EntityRelation | EntityRelation[] : P extends ArrayProperty ? (P["of"] extends Property ? InferPropertyType<P["of"]>[] : unknown[]) : P extends MapProperty ? (P["properties"] extends Properties ? InferEntityType<P["properties"]> : Record<string, unknown>) : P extends VectorProperty ? Vector : P extends BinaryProperty ? string : never;
52
52
  /**
53
53
  * Helper type that determines whether a property is required.
54
54
  * Uses direct structural matching against `{ validation: { required: true } }`
@@ -309,6 +309,25 @@ export interface BooleanProperty extends BaseProperty {
309
309
  */
310
310
  validation?: PropertyValidationSchema;
311
311
  }
312
+ /**
313
+ * @group Entity properties
314
+ */
315
+ export interface VectorUIConfig extends BaseUIConfig {
316
+ clearable?: boolean;
317
+ }
318
+ export interface VectorProperty extends BaseProperty {
319
+ ui?: VectorUIConfig;
320
+ type: "vector";
321
+ dimensions: number;
322
+ validation?: PropertyValidationSchema;
323
+ }
324
+ /**
325
+ * @group Entity properties
326
+ */
327
+ export interface BinaryProperty extends BaseProperty {
328
+ type: "binary";
329
+ validation?: PropertyValidationSchema;
330
+ }
312
331
  /**
313
332
  * @group Entity properties
314
333
  */
@@ -421,7 +440,7 @@ export interface RelationProperty extends BaseProperty {
421
440
  * When set, the framework treats this property as a self-contained relation
422
441
  * definition and no separate `relations[]` entry is needed.
423
442
  */
424
- target?: () => EntityCollection;
443
+ target?: string | (() => EntityCollection | string);
425
444
  /**
426
445
  * Whether this property references one or many records.
427
446
  * Defaults to `"one"`.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ArrayProperty, MapProperty, StringProperty, NumberProperty, BooleanProperty, DateProperty, GeopointProperty, ReferenceProperty, RelationProperty } from "./properties";
2
+ import { ArrayProperty, MapProperty, StringProperty, NumberProperty, BooleanProperty, DateProperty, GeopointProperty, ReferenceProperty, RelationProperty, VectorProperty, BinaryProperty } from "./properties";
3
3
  import { BaseProperty } from "./properties";
4
4
  type CMSBasePropertyNoName = Omit<BaseProperty, "name">;
5
5
  export type ConfigProperty = (Omit<StringProperty, "name"> & {
@@ -28,6 +28,10 @@ export type ConfigProperty = (Omit<StringProperty, "name"> & {
28
28
  } & CMSBasePropertyNoName) | (Omit<MapProperty, "name" | "properties"> & {
29
29
  name?: string;
30
30
  properties?: Record<string, ConfigProperty>;
31
+ } & CMSBasePropertyNoName) | (Omit<VectorProperty, "name"> & {
32
+ name?: string;
33
+ } & CMSBasePropertyNoName) | (Omit<BinaryProperty, "name"> & {
34
+ name?: string;
31
35
  } & CMSBasePropertyNoName);
32
36
  /**
33
37
  * This is the configuration object for a property.
@@ -66,5 +70,5 @@ export type PropertyConfig = {
66
70
  */
67
71
  description?: string;
68
72
  };
69
- export type PropertyConfigId = "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference" | "reference_as_string" | "multi_references" | "relation" | "switch" | "date_time" | "repeat" | "custom_array" | "block";
73
+ export type PropertyConfigId = "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference" | "reference_as_string" | "multi_references" | "relation" | "switch" | "date_time" | "repeat" | "custom_array" | "block" | "vector_input";
70
74
  export {};
@@ -17,7 +17,7 @@ export interface Relation {
17
17
  /**
18
18
  * The final collection you want to retrieve records from.
19
19
  */
20
- target: () => EntityCollection;
20
+ target: (() => EntityCollection) | any;
21
21
  /**
22
22
  * The nature of the relationship, determining if one or many records are returned.
23
23
  */
@@ -30,6 +30,8 @@ export interface RebaseTranslations {
30
30
  copy: string;
31
31
  delete: string;
32
32
  delete_not_allowed: string;
33
+ edit_entity?: string;
34
+ back_to_detail?: string;
33
35
  delete_confirmation_title: string;
34
36
  delete_confirmation_body: string;
35
37
  delete_multiple_confirmation_body: string;
@@ -392,6 +394,12 @@ export interface RebaseTranslations {
392
394
  submit: string;
393
395
  no_filterable_properties: string;
394
396
  apply_filters: string;
397
+ /** Label shown on the filter presets dropdown trigger */
398
+ filter_presets?: string;
399
+ /** Tooltip shown when hovering over a preset entry */
400
+ filter_preset_apply?: string;
401
+ /** Shown when a preset is active, with {{label}} interpolation */
402
+ filter_preset_active?: string;
395
403
  list: string;
396
404
  table_view_mode: string;
397
405
  cards: string;
@@ -42,5 +42,10 @@ export type User = {
42
42
  * The date and time when the user was created.
43
43
  */
44
44
  createdAt?: Date | string | null;
45
+ /**
46
+ * Additional metadata/custom claims associated with the user.
47
+ * Accessible by the frontend, but only writable by the backend.
48
+ */
49
+ readonly metadata?: Record<string, any>;
45
50
  getIdToken?: (forceRefresh?: boolean) => Promise<string>;
46
51
  };
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ export interface FilterChipProps {
3
+ /**
4
+ * The text label displayed on the chip.
5
+ */
6
+ children: React.ReactNode;
7
+ /**
8
+ * Whether the chip is currently in an active/selected state.
9
+ */
10
+ active?: boolean;
11
+ /**
12
+ * Callback when the chip is clicked.
13
+ */
14
+ onClick?: () => void;
15
+ /**
16
+ * Optional icon rendered before the label.
17
+ */
18
+ icon?: React.ReactNode;
19
+ /**
20
+ * Size variant.
21
+ * @default "medium"
22
+ */
23
+ size?: "small" | "medium";
24
+ /**
25
+ * Additional class names.
26
+ */
27
+ className?: string;
28
+ /**
29
+ * Whether the chip is disabled.
30
+ */
31
+ disabled?: boolean;
32
+ }
33
+ /**
34
+ * A toggle chip used for filter presets and similar multi-select controls.
35
+ *
36
+ * Uses an inset box-shadow for the active ring instead of `border` so the
37
+ * chip size stays stable across states and the ring cannot be clipped by
38
+ * parent `overflow-hidden` containers.
39
+ *
40
+ * @group Interactive components
41
+ */
42
+ export declare function FilterChip({ children, active, onClick, icon, size, className, disabled }: FilterChipProps): import("react/jsx-runtime").JSX.Element;
@@ -22,6 +22,7 @@ export * from "./DialogContent";
22
22
  export * from "./DialogTitle";
23
23
  export * from "./ExpandablePanel";
24
24
  export * from "./FileUpload";
25
+ export * from "./FilterChip";
25
26
  export * from "./IconButton";
26
27
  export * from "./InputLabel";
27
28
  export * from "./InfoLabel";
@@ -51,3 +52,7 @@ export * from "./DebouncedTextField";
51
52
  export * from "./Skeleton";
52
53
  export * from "./ToggleButtonGroup";
53
54
  export * from "./VirtualTable";
55
+ import * as Portal from "@radix-ui/react-portal";
56
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
57
+ export { Portal, PopoverPrimitive };
58
+ export { Slot } from "@radix-ui/react-slot";
@@ -4,3 +4,5 @@ export * from "./Icon";
4
4
  export * from "./GitHubIcon";
5
5
  export * from "./HandleIcon";
6
6
  export type { LucideProps, LucideIcon } from "lucide-react";
7
+ export { icons as lucideIcons } from "lucide-react";
8
+ export { AlertCircleIcon, AlertTriangleIcon, AlignLeftIcon, AppWindow, ArrowDownToLineIcon, ArrowLeftIcon, ArrowRightFromLineIcon, ArrowRightIcon, ArrowRightToLineIcon, ArrowUpToLineIcon, BoldIcon, BookOpenIcon, CalendarIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, CircleUserIcon, CodeIcon, ColumnsIcon, CopyIcon, DatabaseIcon, DownloadIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileIcon, FileSearchIcon, FileTextIcon, FilterIcon, FilterXIcon, FlagIcon, FolderIcon, FolderPlusIcon, FolderUpIcon, FunctionSquareIcon, GitBranchIcon, GlobeIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HistoryIcon, HomeIcon, ImageIcon, ImageOffIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyIcon, KeyRoundIcon, LanguagesIcon, LayoutGridIcon, LinkIcon, ListIcon, ListOrderedIcon, LoaderIcon, LogOutIcon, MailIcon, Maximize2Icon, MenuIcon, MinusCircleIcon, MinusIcon, MoonIcon, MoreVerticalIcon, Music2Icon, PanelLeftIcon, PauseIcon, PencilIcon, PhoneIcon, PlayIcon, PlusIcon, QuoteIcon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, Rows3Icon, SaveIcon, SearchIcon, SendIcon, SettingsIcon, ShieldIcon, ShoppingCartIcon, SlidersHorizontalIcon, SquareIcon, StarIcon, StrikethroughIcon, SunIcon, SunMoonIcon, TableIcon, TagIcon, TerminalIcon, TextIcon, Trash2Icon, TypeIcon, UnderlineIcon, UndoIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, VideoIcon, VoteIcon, Wand2Icon, XCircleIcon, XIcon, } from "lucide-react";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/plugin-data-enhancement",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.2.1",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "./dist/index.d.ts",
@@ -9,20 +9,19 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",
12
- "development": "./src/index.ts",
12
+ "development": "./dist/index.es.js",
13
13
  "import": "./dist/index.es.js",
14
14
  "require": "./dist/index.umd.js"
15
15
  },
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "dependencies": {
19
- "react-compiler-runtime": "1.0.0",
20
- "@rebasepro/core": "0.1.2",
21
- "@rebasepro/admin": "0.1.2",
22
- "@rebasepro/common": "0.1.2",
23
- "@rebasepro/types": "0.1.2",
24
- "@rebasepro/ui": "0.1.2",
25
- "@rebasepro/utils": "0.1.2"
19
+ "@rebasepro/common": "0.2.1",
20
+ "@rebasepro/admin": "0.2.1",
21
+ "@rebasepro/core": "0.2.1",
22
+ "@rebasepro/types": "0.2.1",
23
+ "@rebasepro/utils": "0.2.1",
24
+ "@rebasepro/ui": "0.2.1"
26
25
  },
27
26
  "peerDependencies": {
28
27
  "react": ">=19.0.0",
@@ -45,16 +44,16 @@
45
44
  "devDependencies": {
46
45
  "@testing-library/jest-dom": "^6.9.1",
47
46
  "@types/jest": "^29.5.14",
48
- "@types/react": "^19.0.8",
49
- "@types/react-dom": "^19.0.3",
50
- "@vitejs/plugin-react": "^4.3.4",
47
+ "@types/node": "^20.19.41",
48
+ "@types/react": "^19.2.15",
49
+ "@types/react-dom": "^19.2.3",
50
+ "@vitejs/plugin-react": "^4.7.0",
51
51
  "babel-jest": "^29.7.0",
52
- "babel-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
53
- "eslint-plugin-react-compiler": "^19.1.0-rc.2",
52
+ "babel-plugin-react-compiler": "19.0.0-beta-ebf51a3-20250411",
54
53
  "jest": "^29.7.0",
55
- "ts-jest": "^29.4.5",
54
+ "ts-jest": "^29.4.10",
56
55
  "typescript": "^5.9.3",
57
- "vite": "^7.2.4"
56
+ "vite": "^7.3.3"
58
57
  },
59
58
  "jest": {
60
59
  "transform": {
@@ -1,8 +1,20 @@
1
1
 
2
2
  import React, { useCallback, useDeferredValue, useEffect, useRef } from "react";
3
3
 
4
- import { Button, CircularProgress, cls, focusedDisabled, IconButton, Menu, MenuItem, Separator, TextareaAutosize , iconSize } from "@rebasepro/ui";
5
- import { XIcon, SendIcon } from "lucide-react";
4
+ import {
5
+ Button,
6
+ CircularProgress,
7
+ cls,
8
+ focusedDisabled,
9
+ IconButton,
10
+ iconSize,
11
+ Menu,
12
+ MenuItem,
13
+ SendIcon,
14
+ Separator,
15
+ TextareaAutosize,
16
+ XIcon
17
+ } from "@rebasepro/ui";
6
18
  import {
7
19
  AIIcon,
8
20
  useLargeLayout