@object-ui/plugin-detail 3.3.0 → 3.3.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 (134) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +21 -1
  3. package/dist/AddressField-LgHnO2Lk.js +98 -0
  4. package/dist/AutoNumberField-xZCrU0eW.js +14 -0
  5. package/dist/{AvatarField-Xuieq0ZI.js → AvatarField-Dy2XGlPz.js} +16 -15
  6. package/dist/{BooleanField-DwfMKknK.js → BooleanField-C0Clfka5.js} +11 -10
  7. package/dist/CodeField-CHUa07B6.js +23 -0
  8. package/dist/ColorField-vxHqEhcS.js +38 -0
  9. package/dist/CurrencyField-DiWjYWDo.js +49 -0
  10. package/dist/DateField-DGaRPM4P.js +22 -0
  11. package/dist/DateTimeField-8QnpsI_h.js +30 -0
  12. package/dist/EmailField-CkVgMbpI.js +26 -0
  13. package/dist/FileField-5UPV7uek.js +149 -0
  14. package/dist/FormulaField-BUgt6-Pi.js +17 -0
  15. package/dist/GeolocationField-D9T_jgG6.js +118 -0
  16. package/dist/GridField-DE_HwiIN.js +49 -0
  17. package/dist/ImageField-Dswnqtzf.js +73 -0
  18. package/dist/LocationField-gjqbE6na.js +36 -0
  19. package/dist/LookupField-BcS3LRKc.js +901 -0
  20. package/dist/{MasterDetailField-B0HTmmD7.js → MasterDetailField-BF6_-X3A.js} +20 -19
  21. package/dist/NumberField-Dj2rYmrS.js +27 -0
  22. package/dist/ObjectField-BymIojwd.js +50 -0
  23. package/dist/{PasswordField-DVTimsc3.js → PasswordField-ED_Xgqz-.js} +8 -7
  24. package/dist/PercentField-D-JKOxKC.js +61 -0
  25. package/dist/PhoneField-DSCaGYq7.js +26 -0
  26. package/dist/QRCodeField-CtcOUapi.js +73 -0
  27. package/dist/{RatingField-rRi_P0N0.js → RatingField-BDnyQFWy.js} +10 -9
  28. package/dist/RichTextField-CH6LVZQA.js +33 -0
  29. package/dist/SelectField-DE4dpkMV.js +36 -0
  30. package/dist/{SignatureField-2CnhcWI0.js → SignatureField-B1wh3f5A.js} +18 -17
  31. package/dist/{SliderField-DEpMVXko.js → SliderField-zoTCKh9n.js} +2 -1
  32. package/dist/SummaryField-BeBVT6VN.js +22 -0
  33. package/dist/TextAreaField-rfUGrRxh.js +37 -0
  34. package/dist/TextField-C_yM7ATQ.js +30 -0
  35. package/dist/TimeField-BcQmBZi9.js +22 -0
  36. package/dist/UrlField-BakaF6NI.js +31 -0
  37. package/dist/UserField-zS7y3eKb.js +76 -0
  38. package/dist/VectorField-CTZ4myDM.js +34 -0
  39. package/dist/index.js +1912 -1728
  40. package/dist/index.umd.cjs +38 -47
  41. package/dist/packages/plugin-detail/src/DetailSection.d.ts.map +1 -1
  42. package/dist/packages/plugin-detail/src/DetailView.d.ts +24 -0
  43. package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -1
  44. package/dist/packages/plugin-detail/src/RelatedList.d.ts +8 -0
  45. package/dist/packages/plugin-detail/src/RelatedList.d.ts.map +1 -1
  46. package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -1
  47. package/dist/plugin-detail.css +1 -2
  48. package/dist/rolldown-runtime-DnwLefa7.js +23 -0
  49. package/dist/{src-C56Ly5uG.js → src-DyUKLvMN.js} +18271 -26636
  50. package/dist/{useFieldTranslation-CkxqyB82.js → useFieldTranslation-BRgjC1oq.js} +1 -1
  51. package/package.json +33 -11
  52. package/.turbo/turbo-build.log +0 -64
  53. package/dist/AddressField-CDLSeyNx.js +0 -93
  54. package/dist/AutoNumberField-CtE7suf5.js +0 -14
  55. package/dist/CodeField-CfwgRxx2.js +0 -22
  56. package/dist/ColorField-YKHA7dBD.js +0 -37
  57. package/dist/CurrencyField-tvS3fPAF.js +0 -51
  58. package/dist/DateField-BKqXpkOh.js +0 -21
  59. package/dist/DateTimeField-CR-nJCE7.js +0 -32
  60. package/dist/EmailField-CgvW1Qal.js +0 -28
  61. package/dist/FileField-BVAme2ML.js +0 -151
  62. package/dist/FormulaField-DamJ2VaG.js +0 -14
  63. package/dist/GeolocationField-C99z7ZBM.js +0 -113
  64. package/dist/GridField-C9JbpTx_.js +0 -51
  65. package/dist/ImageField-CDANtgVV.js +0 -75
  66. package/dist/LocationField-ZSyZ0O-h.js +0 -35
  67. package/dist/LookupField-B3hQJt95.js +0 -903
  68. package/dist/LookupField-D00z6gn_.js +0 -2
  69. package/dist/NumberField-DL2QAL7X.js +0 -26
  70. package/dist/ObjectField-JYvUnuRO.js +0 -52
  71. package/dist/PercentField-DjR6BSpw.js +0 -63
  72. package/dist/PhoneField-CX1JL-jp.js +0 -28
  73. package/dist/QRCodeField-CH_1pU6R.js +0 -72
  74. package/dist/RichTextField-CJqLWlrb.js +0 -32
  75. package/dist/SelectField-DGoDoRM_.js +0 -30
  76. package/dist/SelectField-XBVI50AD.js +0 -2
  77. package/dist/SummaryField-7ch9aqAu.js +0 -19
  78. package/dist/TextAreaField-Cmw1oXcw.js +0 -36
  79. package/dist/TextField-OTLa3p51.js +0 -29
  80. package/dist/TimeField-DKPoNWoR.js +0 -21
  81. package/dist/UrlField-CxbmzP9f.js +0 -33
  82. package/dist/UserField-ChvwUkMK.js +0 -78
  83. package/dist/VectorField-BVClL8Vw.js +0 -36
  84. package/src/ActivityTimeline.tsx +0 -184
  85. package/src/CommentAttachment.tsx +0 -194
  86. package/src/CommentInput.tsx +0 -81
  87. package/src/DetailSection.tsx +0 -340
  88. package/src/DetailTabs.tsx +0 -73
  89. package/src/DetailView.stories.tsx +0 -334
  90. package/src/DetailView.tsx +0 -823
  91. package/src/DiffView.tsx +0 -233
  92. package/src/FieldChangeItem.tsx +0 -46
  93. package/src/HeaderHighlight.tsx +0 -88
  94. package/src/InlineCreateRelated.tsx +0 -291
  95. package/src/MentionAutocomplete.tsx +0 -123
  96. package/src/PointInTimeRestore.tsx +0 -261
  97. package/src/ReactionPicker.tsx +0 -106
  98. package/src/RecordActivityTimeline.tsx +0 -433
  99. package/src/RecordChatterPanel.tsx +0 -209
  100. package/src/RecordComments.tsx +0 -217
  101. package/src/RecordNavigationEnhanced.tsx +0 -213
  102. package/src/RelatedList.tsx +0 -413
  103. package/src/RelationshipGraph.tsx +0 -286
  104. package/src/RichTextCommentInput.tsx +0 -350
  105. package/src/SectionGroup.tsx +0 -101
  106. package/src/SubscriptionToggle.tsx +0 -62
  107. package/src/ThreadedReplies.tsx +0 -163
  108. package/src/__tests__/ActivityTimeline.test.tsx +0 -119
  109. package/src/__tests__/ActivityTimelineFiltering.test.tsx +0 -143
  110. package/src/__tests__/CommentInput.test.tsx +0 -57
  111. package/src/__tests__/DetailSection.test.tsx +0 -490
  112. package/src/__tests__/DetailView.test.tsx +0 -694
  113. package/src/__tests__/FieldChangeItem.test.tsx +0 -119
  114. package/src/__tests__/HeaderHighlight.test.tsx +0 -213
  115. package/src/__tests__/MentionAutocomplete.test.tsx +0 -97
  116. package/src/__tests__/ReactionPicker.test.tsx +0 -113
  117. package/src/__tests__/RecordActivityTimeline.test.tsx +0 -395
  118. package/src/__tests__/RecordChatterPanel.test.tsx +0 -265
  119. package/src/__tests__/RecordComments.test.tsx +0 -96
  120. package/src/__tests__/RecordCommentsPinSearch.test.tsx +0 -133
  121. package/src/__tests__/RelatedList.test.tsx +0 -160
  122. package/src/__tests__/SectionGroup.test.tsx +0 -101
  123. package/src/__tests__/SubscriptionToggle.test.tsx +0 -84
  124. package/src/__tests__/ThreadedReplies.test.tsx +0 -212
  125. package/src/__tests__/autoLayout.test.ts +0 -228
  126. package/src/__tests__/phase12-features.test.tsx +0 -583
  127. package/src/__tests__/roadmap-features.test.tsx +0 -478
  128. package/src/autoLayout.ts +0 -128
  129. package/src/index.tsx +0 -149
  130. package/src/useDetailTranslation.ts +0 -183
  131. package/tsconfig.json +0 -18
  132. package/vite.config.ts +0 -57
  133. package/vitest.config.ts +0 -13
  134. package/vitest.setup.ts +0 -1
@@ -1,119 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
-
9
- import { describe, it, expect } from 'vitest';
10
- import { render, screen } from '@testing-library/react';
11
- import '@testing-library/jest-dom';
12
- import { ActivityTimeline } from '../ActivityTimeline';
13
- import type { ActivityEntry } from '@object-ui/types';
14
-
15
- const mockActivities: ActivityEntry[] = [
16
- {
17
- id: '1',
18
- type: 'create',
19
- user: 'Alice',
20
- timestamp: '2026-02-15T10:00:00Z',
21
- },
22
- {
23
- id: '2',
24
- type: 'field_change',
25
- field: 'status',
26
- oldValue: 'open',
27
- newValue: 'in_progress',
28
- user: 'Bob',
29
- timestamp: '2026-02-16T08:30:00Z',
30
- },
31
- {
32
- id: '3',
33
- type: 'status_change',
34
- field: 'stage',
35
- newValue: 'Completed',
36
- user: 'Charlie',
37
- timestamp: '2026-02-16T09:00:00Z',
38
- description: 'Moved to Completed stage',
39
- },
40
- {
41
- id: '4',
42
- type: 'comment',
43
- user: 'Alice',
44
- timestamp: '2026-02-16T09:30:00Z',
45
- description: 'Added a comment',
46
- },
47
- ];
48
-
49
- describe('ActivityTimeline', () => {
50
- it('should render activity heading with count', () => {
51
- render(<ActivityTimeline activities={mockActivities} />);
52
- expect(screen.getByText('Activity')).toBeInTheDocument();
53
- expect(screen.getByText('(4)')).toBeInTheDocument();
54
- });
55
-
56
- it('should render user names', () => {
57
- render(<ActivityTimeline activities={mockActivities} />);
58
- expect(screen.getAllByText('Alice')).toHaveLength(2);
59
- expect(screen.getByText('Bob')).toBeInTheDocument();
60
- expect(screen.getByText('Charlie')).toBeInTheDocument();
61
- });
62
-
63
- it('should show "No activity recorded" when empty', () => {
64
- render(<ActivityTimeline activities={[]} />);
65
- expect(screen.getByText('No activity recorded')).toBeInTheDocument();
66
- });
67
-
68
- it('should render field change description for field_change type', () => {
69
- render(
70
- <ActivityTimeline
71
- activities={[
72
- {
73
- id: '1',
74
- type: 'field_change',
75
- field: 'priority',
76
- oldValue: 'low',
77
- newValue: 'high',
78
- user: 'Eve',
79
- timestamp: '2026-02-16T10:00:00Z',
80
- },
81
- ]}
82
- />,
83
- );
84
- expect(screen.getByText(/Changed Priority from "low" to "high"/)).toBeInTheDocument();
85
- });
86
-
87
- it('should use description if provided', () => {
88
- render(
89
- <ActivityTimeline
90
- activities={[
91
- {
92
- id: '1',
93
- type: 'comment',
94
- user: 'Alice',
95
- timestamp: '2026-02-16T09:30:00Z',
96
- description: 'Added a comment',
97
- },
98
- ]}
99
- />,
100
- );
101
- expect(screen.getByText('Added a comment')).toBeInTheDocument();
102
- });
103
-
104
- it('should render create type with default description', () => {
105
- render(
106
- <ActivityTimeline
107
- activities={[
108
- {
109
- id: '1',
110
- type: 'create',
111
- user: 'Eve',
112
- timestamp: '2026-02-16T10:00:00Z',
113
- },
114
- ]}
115
- />,
116
- );
117
- expect(screen.getByText('Created this record')).toBeInTheDocument();
118
- });
119
- });
@@ -1,143 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
-
9
- import { describe, it, expect } from 'vitest';
10
- import { render, screen, fireEvent } from '@testing-library/react';
11
- import '@testing-library/jest-dom';
12
- import { ActivityTimeline } from '../ActivityTimeline';
13
- import type { ActivityEntry } from '@object-ui/types';
14
-
15
- const mockActivities: ActivityEntry[] = [
16
- {
17
- id: '1',
18
- type: 'create',
19
- user: 'Alice',
20
- timestamp: '2026-02-15T10:00:00Z',
21
- },
22
- {
23
- id: '2',
24
- type: 'field_change',
25
- field: 'status',
26
- oldValue: 'open',
27
- newValue: 'in_progress',
28
- user: 'Bob',
29
- timestamp: '2026-02-16T08:30:00Z',
30
- },
31
- {
32
- id: '3',
33
- type: 'comment',
34
- user: 'Charlie',
35
- timestamp: '2026-02-16T09:00:00Z',
36
- description: 'Added a comment on the record',
37
- },
38
- {
39
- id: '4',
40
- type: 'delete',
41
- user: 'Diana',
42
- timestamp: '2026-02-16T09:30:00Z',
43
- },
44
- {
45
- id: '5',
46
- type: 'comment',
47
- user: 'Eve',
48
- timestamp: '2026-02-16T10:00:00Z',
49
- description: 'Another comment here',
50
- },
51
- ];
52
-
53
- describe('ActivityTimeline - Filtering', () => {
54
- it('does not render filter controls when filterable is false/not provided', () => {
55
- render(<ActivityTimeline activities={mockActivities} />);
56
- expect(screen.queryByRole('group', { name: 'Activity type filter' })).not.toBeInTheDocument();
57
- });
58
-
59
- it('renders filter controls when filterable is true', () => {
60
- render(<ActivityTimeline activities={mockActivities} filterable />);
61
- const filterGroup = screen.getByRole('group', { name: 'Activity type filter' });
62
- expect(filterGroup).toBeInTheDocument();
63
-
64
- // Should have "All", "Field Changes", "Creates", "Deletes", "Comments", "Status Changes"
65
- expect(screen.getByText('All')).toBeInTheDocument();
66
- expect(screen.getByText('Comments')).toBeInTheDocument();
67
- expect(screen.getByText('Field Changes')).toBeInTheDocument();
68
- expect(screen.getByText('Creates')).toBeInTheDocument();
69
- expect(screen.getByText('Deletes')).toBeInTheDocument();
70
- });
71
-
72
- it('shows all activities by default', () => {
73
- render(<ActivityTimeline activities={mockActivities} filterable />);
74
- // Count should be (5)
75
- expect(screen.getByText('(5)')).toBeInTheDocument();
76
- });
77
-
78
- it('filters to only comments when Comments filter is selected', () => {
79
- render(<ActivityTimeline activities={mockActivities} filterable />);
80
-
81
- const commentsFilter = screen.getByText('Comments');
82
- fireEvent.click(commentsFilter);
83
-
84
- // Only 2 comment activities
85
- expect(screen.getByText('(2)')).toBeInTheDocument();
86
- expect(screen.getByText('Added a comment on the record')).toBeInTheDocument();
87
- expect(screen.getByText('Another comment here')).toBeInTheDocument();
88
- });
89
-
90
- it('filters to only field changes when Field Changes filter is selected', () => {
91
- render(<ActivityTimeline activities={mockActivities} filterable />);
92
-
93
- const fieldChangesFilter = screen.getByText('Field Changes');
94
- fireEvent.click(fieldChangesFilter);
95
-
96
- // Only 1 field_change activity
97
- expect(screen.getByText('(1)')).toBeInTheDocument();
98
- });
99
-
100
- it('shows all activities when All filter is re-selected', () => {
101
- render(<ActivityTimeline activities={mockActivities} filterable />);
102
-
103
- // First filter to comments only
104
- fireEvent.click(screen.getByText('Comments'));
105
- expect(screen.getByText('(2)')).toBeInTheDocument();
106
-
107
- // Then go back to All
108
- fireEvent.click(screen.getByText('All'));
109
- expect(screen.getByText('(5)')).toBeInTheDocument();
110
- });
111
-
112
- it('respects defaultFilter prop', () => {
113
- render(
114
- <ActivityTimeline
115
- activities={mockActivities}
116
- filterable
117
- defaultFilter="comment"
118
- />,
119
- );
120
-
121
- // Should start filtered to comments
122
- expect(screen.getByText('(2)')).toBeInTheDocument();
123
- });
124
-
125
- it('shows "No activity recorded" when filter has no results', () => {
126
- render(
127
- <ActivityTimeline
128
- activities={mockActivities}
129
- filterable
130
- defaultFilter="status_change"
131
- />,
132
- );
133
-
134
- expect(screen.getByText('No activity recorded')).toBeInTheDocument();
135
- });
136
-
137
- it('renders all activities without filter when filterable is not set', () => {
138
- render(<ActivityTimeline activities={mockActivities} />);
139
- expect(screen.getByText('(5)')).toBeInTheDocument();
140
- expect(screen.getByText('Alice')).toBeInTheDocument();
141
- expect(screen.getByText('Bob')).toBeInTheDocument();
142
- });
143
- });
@@ -1,57 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
-
9
- import { describe, it, expect, vi } from 'vitest';
10
- import { render, screen, fireEvent } from '@testing-library/react';
11
- import '@testing-library/jest-dom';
12
- import { CommentInput } from '../CommentInput';
13
-
14
- describe('CommentInput', () => {
15
- it('should render placeholder text', () => {
16
- const onSubmit = vi.fn();
17
- render(<CommentInput onSubmit={onSubmit} />);
18
- expect(screen.getByPlaceholderText('Leave a comment…')).toBeInTheDocument();
19
- });
20
-
21
- it('should render custom placeholder', () => {
22
- const onSubmit = vi.fn();
23
- render(<CommentInput onSubmit={onSubmit} placeholder="Type here…" />);
24
- expect(screen.getByPlaceholderText('Type here…')).toBeInTheDocument();
25
- });
26
-
27
- it('should disable submit when textarea is empty', () => {
28
- const onSubmit = vi.fn();
29
- render(<CommentInput onSubmit={onSubmit} />);
30
- expect(screen.getByLabelText('Submit comment')).toBeDisabled();
31
- });
32
-
33
- it('should enable submit when text is entered', () => {
34
- const onSubmit = vi.fn();
35
- render(<CommentInput onSubmit={onSubmit} />);
36
- fireEvent.change(screen.getByPlaceholderText('Leave a comment…'), {
37
- target: { value: 'Hello' },
38
- });
39
- expect(screen.getByLabelText('Submit comment')).not.toBeDisabled();
40
- });
41
-
42
- it('should call onSubmit with text when clicked', () => {
43
- const onSubmit = vi.fn().mockResolvedValue(undefined);
44
- render(<CommentInput onSubmit={onSubmit} />);
45
- fireEvent.change(screen.getByPlaceholderText('Leave a comment…'), {
46
- target: { value: 'Hello world' },
47
- });
48
- fireEvent.click(screen.getByLabelText('Submit comment'));
49
- expect(onSubmit).toHaveBeenCalledWith('Hello world');
50
- });
51
-
52
- it('should disable input when disabled prop is true', () => {
53
- const onSubmit = vi.fn();
54
- render(<CommentInput onSubmit={onSubmit} disabled />);
55
- expect(screen.getByPlaceholderText('Leave a comment…')).toBeDisabled();
56
- });
57
- });