@protobase/ui 0.54.4 → 0.54.6

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/app/app.js +5 -4
  2. package/dist/app/nav-recent.js +7 -5
  3. package/dist/app/pages/field-value.js +19 -11
  4. package/dist/app/pages/merge-ui.d.ts +1 -1
  5. package/dist/app/pages/merge-ui.js +3 -1
  6. package/dist/app/pages/project-ui.d.ts +4 -1
  7. package/dist/app/record-page.js +3 -3
  8. package/dist/app/related-cards/related-card.js +32 -28
  9. package/dist/app/search/search-model.js +15 -6
  10. package/dist/app/search/use-global-search.js +3 -1
  11. package/dist/app/titles/record-title-of.js +17 -0
  12. package/dist/app/titles/record-titles.js +63 -0
  13. package/dist/app/titles/relation-title.js +35 -0
  14. package/dist/app/titles/title-rule.d.ts +14 -0
  15. package/dist/app/use-nav-recent.js +3 -1
  16. package/dist/app/use-related-records.js +9 -9
  17. package/dist/chat/chat-divider.d.ts +4 -1
  18. package/dist/chat/chat-divider.js +5 -1
  19. package/dist/chat/chat-thread.js +2 -16
  20. package/dist/chat/read-place.js +22 -0
  21. package/dist/data/query-keys.js +7 -0
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +1 -1
  24. package/dist/package.js +1 -1
  25. package/dist/plugins/plugin-ui.js +1 -0
  26. package/dist/shell/assets/app-Y_3vlU3f.js +9 -0
  27. package/dist/shell/assets/{index-FZEg_Him.js → index-IMD8ceia.js} +2 -2
  28. package/dist/shell/assets/{records-map-UOav4Lr-.js → records-map-TXpdTT7s.js} +2 -2
  29. package/dist/shell/assets/shared-protobase-ui-BHIhZYVr.js +2 -0
  30. package/dist/shell/index.html +3 -3
  31. package/dist/shell/protobase.shell.json +1 -1
  32. package/dist/shell/protobase.sw.js +2 -2
  33. package/dist/shell-source-maps/assets/app-Y_3vlU3f.js.map +1 -0
  34. package/dist/shell-source-maps/assets/{index-FZEg_Him.js.map → index-IMD8ceia.js.map} +1 -1
  35. package/dist/shell-source-maps/assets/{records-map-UOav4Lr-.js.map → records-map-TXpdTT7s.js.map} +1 -1
  36. package/dist/shell-source-maps/assets/shared-protobase-ui-BHIhZYVr.js.map +1 -0
  37. package/package.json +4 -4
  38. package/dist/shell/assets/app-BL9BABNY.js +0 -9
  39. package/dist/shell/assets/shared-protobase-ui-GVFI0C-Q.js +0 -2
  40. package/dist/shell-source-maps/assets/app-BL9BABNY.js.map +0 -1
  41. package/dist/shell-source-maps/assets/shared-protobase-ui-GVFI0C-Q.js.map +0 -1
@@ -1,25 +1,11 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { Button } from "../primitives/button.js";
3
3
  import { text } from "./messages.js";
4
- import { isAtEnd, scrollAfterChange } from "./thread-scroll.js";
4
+ import { scrollAfterChange } from "./thread-scroll.js";
5
+ import { readPlace } from "./read-place.js";
5
6
  import { useEffect, useLayoutEffect, useRef } from "react";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/chat/chat-thread.tsx
8
- /** The message the reader is reading: the first whose bottom shows. */
9
- const readPlace = (box, list, followKey) => {
10
- const top = box.getBoundingClientRect().top;
11
- const element = [...list.children].find((child) => child.getBoundingClientRect().bottom > top);
12
- const anchor = element && { anchor: {
13
- element,
14
- top: element.getBoundingClientRect().top - top
15
- } };
16
- return {
17
- atEnd: isAtEnd(box),
18
- first: list.firstElementChild ?? void 0,
19
- followKey,
20
- ...anchor
21
- };
22
- };
23
9
  /**
24
10
  * The scrolling list of a chat's messages. A reader at the end follows new messages; one who scrolled back stays where
25
11
  * they are until `followKey` changes, and earlier messages loaded above keep them on the message they were reading. It
@@ -0,0 +1,22 @@
1
+ import { isAtEnd } from "./thread-scroll.js";
2
+ //#region src/chat/read-place.ts
3
+ /**
4
+ * The message the reader is reading: the first whose bottom shows, or the first below the top when none shows. Never a
5
+ * divider, since a day divider moves to the new first message when earlier ones of the same day load above it.
6
+ */
7
+ const readPlace = (box, list, followKey) => {
8
+ const top = box.getBoundingClientRect().top;
9
+ const element = Array.from(list.children).find((child) => !child.hasAttribute("data-chat-divider") && child.getBoundingClientRect().bottom > top);
10
+ const anchor = element && { anchor: {
11
+ element,
12
+ top: element.getBoundingClientRect().top - top
13
+ } };
14
+ return {
15
+ atEnd: isAtEnd(box),
16
+ first: list.firstElementChild ?? void 0,
17
+ followKey,
18
+ ...anchor
19
+ };
20
+ };
21
+ //#endregion
22
+ export { readPlace };
@@ -114,6 +114,13 @@ const keys = {
114
114
  resource,
115
115
  id
116
116
  ],
117
+ /** The fields a record pointed at is read with for its view to derive its title. */
118
+ titleRow: (resource, id, fields) => [
119
+ "title-row",
120
+ resource,
121
+ id,
122
+ fields
123
+ ],
117
124
  labels: (resource, ids) => [
118
125
  "labels",
119
126
  resource,
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { LogoMark, ShellLogoProps } from "./app-shell/logo.js";
2
2
  import { FieldWidget, FieldWidgetEditorProps, FieldWidgetProps } from "./app/field-types/field-widget.js";
3
3
  import { BoardDrop, BoardDropContext, BoardDropUndo, BoardDropWrite } from "./app/displays/board-drop.js";
4
4
  import { Drop, DropRule } from "./app/hand-order/drop-rule.js";
5
+ import { TitleReader, TitleRule } from "./app/titles/title-rule.js";
5
6
  import { ActionContext, ActionHandler, BeforeSignInProps, ProjectUi, definePlugin, defineUi } from "./app/pages/project-ui.js";
6
7
  import { PluginInfo, usePlugin } from "./plugins/plugin-context.js";
7
8
  import { App, AppProps } from "./app/app.js";
@@ -80,4 +81,4 @@ import { Section } from "./record-view/section.js";
80
81
  import { Form, FormProps } from "./app/create/form.js";
81
82
  import { RecordPicker, RecordPickerProps } from "./app/record-picker.js";
82
83
  import { Spinner } from "./primitives/spinner.js";
83
- export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ActionInputError, type ActionInputProps, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, type BoardDrop, type BoardDropContext, type BoardDropUndo, type BoardDropWrite, Button, type ButtonProps, type CardAction, type CardTone, Carousel, type CarouselImage, type CarouselProps, type ChatAuthor, ChatDivider, type ChatDividerProps, ChatMessage, type ChatMessageProps, ChatThread, type ChatThreadProps, type ChoiceOption, Choices, type ChoicesProps, CodeForm, type CodeFormProps, CompactTable, type CompactTableProps, Composer, type ComposerProps, type CurrentAddress, Dialog, type DialogProps, type DiffLine, DiffView, type DiffViewProps, type Drop, type DropRule, Field, FieldList, type FieldProps, type FieldWidget, type FieldWidgetEditorProps, type FieldWidgetProps, Form, type FormProps, Input, type InputProps, type LayoutRecord, type ListAddress, type ListChange, type ListDisplay, type ListDisplayRow, LogoMark, Markdown, type MarkdownContentProps as MarkdownProps, type MembersResult, MentionBox, type MentionBoxProps, type MentionDraft, MentionedText, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PeopleSearch, type PickedUser, type PluginInfo, type ProjectUi, type PushState, type RecordCardProps, RecordLink, RecordPicker, type RecordPickerProps, ResendCodeButton, type ResendCodeButtonProps, ResponsiveDialog, type ResponsiveDialogProps, Section, Segmented, type SegmentedOption, type SegmentedProps, type ShellLogoProps, SidePanel, type SidePanelProps, SignInPrompt, type SignInPromptProps, Spinner, type Step, StepList, type StepState, Textarea, type TextareaProps, allowDelayMs, buttonClass, chatDayLabel, definePlugin, defineUi, diffStats, emptyDraft, isConflict, isFramed, mentionedIds, mergeUi, parseDiff, pluginApi, protobaseVersion, sameChatDay, uiFromModule, useApiToken, useAppAddress, useArmedAfterFocus, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useGuardedPress, useHistogram, useInbox, useLayoutRecord, useList, useListDisplay, useMarkNotificationsRead, useMembers, useMeta, usePlugin, usePushNotifications, useRecord, useResourceClient, useSeries, useUnreadNotifications, useUpdateRecord };
84
+ export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ActionInputError, type ActionInputProps, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, type BoardDrop, type BoardDropContext, type BoardDropUndo, type BoardDropWrite, Button, type ButtonProps, type CardAction, type CardTone, Carousel, type CarouselImage, type CarouselProps, type ChatAuthor, ChatDivider, type ChatDividerProps, ChatMessage, type ChatMessageProps, ChatThread, type ChatThreadProps, type ChoiceOption, Choices, type ChoicesProps, CodeForm, type CodeFormProps, CompactTable, type CompactTableProps, Composer, type ComposerProps, type CurrentAddress, Dialog, type DialogProps, type DiffLine, DiffView, type DiffViewProps, type Drop, type DropRule, Field, FieldList, type FieldProps, type FieldWidget, type FieldWidgetEditorProps, type FieldWidgetProps, Form, type FormProps, Input, type InputProps, type LayoutRecord, type ListAddress, type ListChange, type ListDisplay, type ListDisplayRow, LogoMark, Markdown, type MarkdownContentProps as MarkdownProps, type MembersResult, MentionBox, type MentionBoxProps, type MentionDraft, MentionedText, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PeopleSearch, type PickedUser, type PluginInfo, type ProjectUi, type PushState, type RecordCardProps, RecordLink, RecordPicker, type RecordPickerProps, ResendCodeButton, type ResendCodeButtonProps, ResponsiveDialog, type ResponsiveDialogProps, Section, Segmented, type SegmentedOption, type SegmentedProps, type ShellLogoProps, SidePanel, type SidePanelProps, SignInPrompt, type SignInPromptProps, Spinner, type Step, StepList, type StepState, Textarea, type TextareaProps, type TitleReader, type TitleRule, allowDelayMs, buttonClass, chatDayLabel, definePlugin, defineUi, diffStats, emptyDraft, isConflict, isFramed, mentionedIds, mergeUi, parseDiff, pluginApi, protobaseVersion, sameChatDay, uiFromModule, useApiToken, useAppAddress, useArmedAfterFocus, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useGuardedPress, useHistogram, useInbox, useLayoutRecord, useList, useListDisplay, useMarkNotificationsRead, useMembers, useMeta, usePlugin, usePushNotifications, useRecord, useResourceClient, useSeries, useUnreadNotifications, useUpdateRecord };
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ import { Markdown } from "./markdown/markdown.js";
18
18
  import { ActionInputError } from "./app/pages/action-inputs/input-errors.js";
19
19
  import { useLayoutRecord } from "./app/pages/record-scope.js";
20
20
  import { useFacets, useHistogram, useSeries } from "./data/use-aggregates.js";
21
+ import { useMembers } from "./people/use-members.js";
21
22
  import { LogoMark } from "./app-shell/logo.js";
22
23
  import { SignInPrompt } from "./auth/sign-in-prompt.js";
23
24
  import { useListDisplay } from "./app/displays/display-context.js";
@@ -58,7 +59,6 @@ import { useInbox, useMarkNotificationsRead, useUnreadNotifications } from "./no
58
59
  import { isConflict, useUpdateRecord } from "./data/use-update-record.js";
59
60
  import { App } from "./app/app.js";
60
61
  import { RecordLink } from "./app/displays/record-link.js";
61
- import { useMembers } from "./people/use-members.js";
62
62
  import { Carousel } from "./carousel/carousel.js";
63
63
  import { Choices } from "./primitives/choices.js";
64
64
  import { RecordPicker } from "./app/record-picker.js";
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.54.4";
2
+ var version = "0.54.6";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };
@@ -42,6 +42,7 @@ const pluginUi = (plugin, module) => {
42
42
  ...ui.actions && { actions: ui.actions },
43
43
  ...ui.dropRules && { dropRules: ui.dropRules },
44
44
  ...ui.boardDrops && { boardDrops: ui.boardDrops },
45
+ ...ui.titles && { titles: ui.titles },
45
46
  ...fields && { fields },
46
47
  ...shell && { shell },
47
48
  ...beforeSignIn && { beforeSignIn }