@fluid-app/portal-sdk 0.1.337 → 0.1.338
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.
- package/dist/{AddressAutocompleteInput-DanWRCgg.mjs → AddressAutocompleteInput-D8vKXhYO.mjs} +2 -2
- package/dist/{AddressAutocompleteInput-DanWRCgg.mjs.map → AddressAutocompleteInput-D8vKXhYO.mjs.map} +1 -1
- package/dist/{AddressAutocompleteInput-BV235EvZ.cjs → AddressAutocompleteInput-Dt4OoHWV.cjs} +2 -2
- package/dist/{AddressAutocompleteInput-BV235EvZ.cjs.map → AddressAutocompleteInput-Dt4OoHWV.cjs.map} +1 -1
- package/dist/{ContactsScreen-BYrRJ55W.cjs → ContactsScreen-B3eVauD-.cjs} +2 -2
- package/dist/{ContactsScreen-Dm8b4SyY.cjs → ContactsScreen-BhgI_-6s.cjs} +2 -2
- package/dist/{ContactsScreen-Dm8b4SyY.cjs.map → ContactsScreen-BhgI_-6s.cjs.map} +1 -1
- package/dist/{ContactsScreen-DDgwD2MI.mjs → ContactsScreen-DW-F0wJy.mjs} +2 -2
- package/dist/{ContactsScreen-DDgwD2MI.mjs.map → ContactsScreen-DW-F0wJy.mjs.map} +1 -1
- package/dist/{FluidProvider-Y4bOFCeb.cjs → FluidProvider-DtsjXKhW.cjs} +4 -4
- package/dist/{FluidProvider-Y4bOFCeb.cjs.map → FluidProvider-DtsjXKhW.cjs.map} +1 -1
- package/dist/{FluidProvider-BFF-jYEi.mjs → FluidProvider-kt_D_70p.mjs} +4 -4
- package/dist/{FluidProvider-BFF-jYEi.mjs.map → FluidProvider-kt_D_70p.mjs.map} +1 -1
- package/dist/{MessagingScreen-DOlluxeU.mjs → MessagingScreen-DIqEqpHc.mjs} +4 -4
- package/dist/{MessagingScreen-CivCILvd.cjs → MessagingScreen-DaGUbFap.cjs} +4 -4
- package/dist/{MessagingScreen-DDvXMf79.cjs → MessagingScreen-IusKBudc.cjs} +2 -2
- package/dist/{MessagingScreen-DDvXMf79.cjs.map → MessagingScreen-IusKBudc.cjs.map} +1 -1
- package/dist/{MessagingScreen-D9zBmiaG.mjs → MessagingScreen-pNgGuv10.mjs} +2 -2
- package/dist/{MessagingScreen-D9zBmiaG.mjs.map → MessagingScreen-pNgGuv10.mjs.map} +1 -1
- package/dist/{OrdersScreen-CDapyY_h.cjs → OrdersScreen-BVirBT0C.cjs} +4 -4
- package/dist/{OrdersScreen-DzlRT9Ca.mjs → OrdersScreen-DMoa1Trl.mjs} +4 -4
- package/dist/{OrdersScreen-DC-nm1a1.cjs → OrdersScreen-DUgM6eSF.cjs} +2 -2
- package/dist/{OrdersScreen-DC-nm1a1.cjs.map → OrdersScreen-DUgM6eSF.cjs.map} +1 -1
- package/dist/{OrdersScreen-o7TLSwmK.mjs → OrdersScreen-DtIEFDdH.mjs} +2 -2
- package/dist/{OrdersScreen-o7TLSwmK.mjs.map → OrdersScreen-DtIEFDdH.mjs.map} +1 -1
- package/dist/{ProfileScreen-BtwcUtLz.cjs → ProfileScreen-B1ufOonA.cjs} +5 -5
- package/dist/{ProfileScreen-Pm3QnOyX.mjs → ProfileScreen-BbWJH8PZ.mjs} +3 -3
- package/dist/{ProfileScreen-Pm3QnOyX.mjs.map → ProfileScreen-BbWJH8PZ.mjs.map} +1 -1
- package/dist/{ProfileScreen-gsxSAd6x.mjs → ProfileScreen-CXXrYwSr.mjs} +5 -5
- package/dist/{ProfileScreen-DWKfau7t.cjs → ProfileScreen-P_oroi6n.cjs} +3 -3
- package/dist/{ProfileScreen-DWKfau7t.cjs.map → ProfileScreen-P_oroi6n.cjs.map} +1 -1
- package/dist/{ShopScreen-DZu0Ex05.mjs → ShopScreen-Bpx3RVcL.mjs} +2 -2
- package/dist/{ShopScreen-DZu0Ex05.mjs.map → ShopScreen-Bpx3RVcL.mjs.map} +1 -1
- package/dist/{ShopScreen-BDgMDHX-.cjs → ShopScreen-CmHEYzWO.cjs} +4 -4
- package/dist/{ShopScreen-DptaDDUY.mjs → ShopScreen-Cp4C5F-S.mjs} +4 -4
- package/dist/{ShopScreen-C37KsJb6.cjs → ShopScreen-Dy4vW550.cjs} +2 -2
- package/dist/{ShopScreen-C37KsJb6.cjs.map → ShopScreen-Dy4vW550.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BeWSDupT.mjs → SubscriptionsScreen-CCLs-jWG.mjs} +5 -5
- package/dist/{SubscriptionsScreen-Dhg1H4Q_.mjs → SubscriptionsScreen-CnMPK8cR.mjs} +3 -3
- package/dist/{SubscriptionsScreen-Dhg1H4Q_.mjs.map → SubscriptionsScreen-CnMPK8cR.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CfAi7nh8.cjs → SubscriptionsScreen-DOfdH7d7.cjs} +3 -3
- package/dist/{SubscriptionsScreen-CfAi7nh8.cjs.map → SubscriptionsScreen-DOfdH7d7.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-C3Yj6fWJ.cjs → SubscriptionsScreen-Dyy_wCaB.cjs} +5 -5
- package/dist/{ToDoWidget-6Yj9hQQ5.cjs → ToDoWidget-C8R0i2cb.cjs} +3 -3
- package/dist/ToDoWidget-C8R0i2cb.cjs.map +1 -0
- package/dist/{ToDoWidget-Bc3uv4ft.cjs → ToDoWidget-CPtn_Ptx.cjs} +2 -2
- package/dist/{ToDoWidget-B3sq5pIT.mjs → ToDoWidget-eYF1VvRa.mjs} +3 -3
- package/dist/ToDoWidget-eYF1VvRa.mjs.map +1 -0
- package/dist/index.cjs +22 -22
- package/dist/index.mjs +22 -22
- package/dist/{task-composer-form-CHyQZUCo.mjs → task-composer-form-Cq3KTV0Y.mjs} +17 -21
- package/dist/{task-composer-form-CHyQZUCo.mjs.map → task-composer-form-Cq3KTV0Y.mjs.map} +1 -1
- package/dist/{task-composer-form-D9KhWUI1.cjs → task-composer-form-DvVQw5ud.cjs} +17 -21
- package/dist/{task-composer-form-D9KhWUI1.cjs.map → task-composer-form-DvVQw5ud.cjs.map} +1 -1
- package/package.json +18 -18
- package/dist/ToDoWidget-6Yj9hQQ5.cjs.map +0 -1
- package/dist/ToDoWidget-B3sq5pIT.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
require("./FluidProvider-
|
|
2
|
+
require("./FluidProvider-DtsjXKhW.cjs");
|
|
3
3
|
require("./ScreenRenderer-BYiZunHL.cjs");
|
|
4
4
|
require("./PortalTenantClientProvider-Bpm-CZq1.cjs");
|
|
5
5
|
require("./store-api-context-D1gZn22Z.cjs");
|
|
6
6
|
require("./mysite-api-context-CilZcDS4.cjs");
|
|
7
7
|
require("./countries-api-context-G-NW4BoH.cjs");
|
|
8
|
-
require("./task-composer-form-
|
|
8
|
+
require("./task-composer-form-DvVQw5ud.cjs");
|
|
9
9
|
require("./registry-context-DJ5xiVnt.cjs");
|
|
10
10
|
require("./WidgetInteractionContext-BhkusA95.cjs");
|
|
11
11
|
require("./EmbedWidget-Apuoqmq4.cjs");
|
|
@@ -40,13 +40,13 @@ require("./RecentActivityWidget-DEQHXSNu.cjs");
|
|
|
40
40
|
require("./SeparatorWidget-DFL3n-Yu.cjs");
|
|
41
41
|
require("./SpacerWidget-CYHjTF38.cjs");
|
|
42
42
|
require("./TableWidget-SgL9bBT9.cjs");
|
|
43
|
-
require("./ToDoWidget-
|
|
43
|
+
require("./ToDoWidget-C8R0i2cb.cjs");
|
|
44
44
|
require("./VideoWidget-5oAZXEKw.cjs");
|
|
45
45
|
require("./SearchSort-Bi9QWJQQ.cjs");
|
|
46
46
|
require("./ShopWidget-CGs4oaaC.cjs");
|
|
47
47
|
require("./ScreenHeaderContext-DWDN0-mb.cjs");
|
|
48
|
-
require("./AddressAutocompleteInput-
|
|
48
|
+
require("./AddressAutocompleteInput-Dt4OoHWV.cjs");
|
|
49
49
|
require("./Combobox-D9lqcqeg.cjs");
|
|
50
|
-
const require_SubscriptionsScreen = require("./SubscriptionsScreen-
|
|
50
|
+
const require_SubscriptionsScreen = require("./SubscriptionsScreen-DOfdH7d7.cjs");
|
|
51
51
|
exports.SubscriptionsScreen = require_SubscriptionsScreen.SubscriptionsScreen;
|
|
52
52
|
exports.subscriptionsScreenPropertySchema = require_SubscriptionsScreen.subscriptionsScreenPropertySchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_task_composer_form = require("./task-composer-form-
|
|
2
|
+
const require_task_composer_form = require("./task-composer-form-DvVQw5ud.cjs");
|
|
3
3
|
const require_registry_context = require("./registry-context-DJ5xiVnt.cjs");
|
|
4
4
|
const require_error_state = require("./error-state-BI3jxWlb.cjs");
|
|
5
5
|
const require_registries = require("./registries-BxNpO5DV.cjs");
|
|
@@ -141,7 +141,7 @@ function CreateTodoDialog({ open, onOpenChange }) {
|
|
|
141
141
|
open,
|
|
142
142
|
onOpenChange,
|
|
143
143
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DialogContent, {
|
|
144
|
-
className: "sm:max-w-md",
|
|
144
|
+
className: "gap-4 p-4 sm:max-w-md sm:gap-6 sm:p-6",
|
|
145
145
|
children: [
|
|
146
146
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DialogHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DialogTitle, { children: "Add a to-do" }) }),
|
|
147
147
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.PortalContainerProvider, {
|
|
@@ -549,4 +549,4 @@ Object.defineProperty(exports, "toDoWidgetPropertySchema", {
|
|
|
549
549
|
}
|
|
550
550
|
});
|
|
551
551
|
|
|
552
|
-
//# sourceMappingURL=ToDoWidget-
|
|
552
|
+
//# sourceMappingURL=ToDoWidget-C8R0i2cb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToDoWidget-C8R0i2cb.cjs","names":["useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","useWidgetPreviewContext","useDataSourceRegistryConfig","Dialog","DialogContent","DialogHeader","DialogTitle","PortalContainerProvider","TaskComposerForm","useContactsTranslation","useInfiniteContacts","Popover","PopoverTrigger","cn","ChevronsUpDown","PopoverContent","Search","Input","Check","useWidgetPreviewContext","borderWidthClasses","borderColorClasses","ListChecks","ErrorState","Plus","parseTaskBody","getFontSizeField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../widgets/src/hooks/use-todos.preview.ts","../../widgets/src/hooks/use-todos.ts","../../widgets/src/hooks/use-update-todo.ts","../../widgets/src/widgets/CreateTodoDialog.tsx","../../widgets/src/widgets/ToDoWidget.tsx"],"sourcesContent":["import type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction daysFromNow(days: number): string {\n const d = new Date(now);\n d.setDate(d.getDate() + days);\n return d.toISOString();\n}\n\nexport const PREVIEW_DATA: Todo[] = [\n {\n id: 1,\n body: \"Send follow-up email to new leads\",\n dueAt: daysFromNow(1),\n completedAt: null,\n createdAt: daysFromNow(-2),\n contactId: 101,\n contactName: \"Sarah Johnson\",\n },\n {\n id: 2,\n body: \"Prepare slides for team training\",\n dueAt: daysFromNow(3),\n completedAt: null,\n createdAt: daysFromNow(-1),\n contactId: null,\n contactName: null,\n },\n {\n id: 3,\n body: \"Review monthly sales report\",\n dueAt: daysFromNow(-1),\n completedAt: null,\n createdAt: daysFromNow(-5),\n contactId: 102,\n contactName: \"Mike Chen\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-todos.preview\";\nimport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\n/**\n * Shared cache key for the todos list. Both useTodos (read) and\n * useUpdateTodo (write) use this — drift would silently break optimistic\n * updates.\n */\nexport function todosQueryKey(args: {\n baseUrl: string | undefined;\n isPreview: boolean;\n}) {\n return [\n \"portal-widget-use\",\n \"todos\",\n args.isPreview ? \"preview\" : args.baseUrl,\n ] as const;\n}\n\nexport function useTodos(): UseQueryResult<Todo[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: todosQueryKey({ baseUrl, isPreview }),\n queryFn: ({ signal }) => widgetsApi.fetchTodos(signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\nimport { todosQueryKey } from \"./use-todos\";\n\ntype UpdateVariables = { id: number; completed: boolean };\n\nexport function useUpdateTodo() {\n const widgetsApi = useWidgetsApi();\n const queryClient = useQueryClient();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n const queryKey = todosQueryKey({ baseUrl, isPreview });\n\n return useMutation({\n mutationFn: ({ id, completed }: UpdateVariables) => {\n // Defense in depth: ToDoWidget already disables the checkbox in\n // preview mode, but if any other caller fires this mutation while\n // previewing we'd PATCH demo data on the real backend. Fail closed.\n if (isPreview) {\n return Promise.reject(\n new Error(\"Todo updates are disabled in preview mode\"),\n );\n }\n return widgetsApi.updateTodo(id, completed);\n },\n onMutate: async ({ id, completed }) => {\n await queryClient.cancelQueries({ queryKey });\n const previous = queryClient.getQueryData<Todo[]>(queryKey);\n queryClient.setQueryData<Todo[]>(queryKey, (current) =>\n (current ?? []).map((todo) =>\n todo.id === id\n ? {\n ...todo,\n completedAt: completed ? new Date().toISOString() : null,\n }\n : todo,\n ),\n );\n return { previous };\n },\n onSuccess: (updated, { completed }) => {\n queryClient.setQueryData<Todo[]>(queryKey, (current) =>\n (current ?? []).map((todo) =>\n todo.id === updated.id ? updated : todo,\n ),\n );\n // Match the documented test plan: completing toasts, un-completing\n // is silent. The widget today only ever fires completed=true, but\n // gating here keeps the contract honest for any future caller that\n // toggles either direction.\n if (completed) {\n fluidToast({ title: \"Todo completed\", type: \"success\" });\n }\n },\n onError: (_error, _variables, context) => {\n if (context?.previous) {\n queryClient.setQueryData(queryKey, context.previous);\n }\n fluidToast({ title: \"Failed to update todo\", type: \"error\" });\n },\n // Belt-and-suspenders refetch to reconcile any race we couldn't see\n // (e.g., a different tab mutated the same todo). Cheap — one GET per\n // toggle.\n onSettled: () => {\n queryClient.invalidateQueries({ queryKey });\n },\n });\n}\n","\"use client\";\n\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Check, ChevronsUpDown, Search } from \"lucide-react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport {\n cn,\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n PortalContainerProvider,\n} from \"@fluid-app/ui-primitives\";\nimport { useInfiniteContacts } from \"@fluid-app/contacts-core/hooks/use-infinite-contacts\";\nimport { useContactsTranslation } from \"@fluid-app/contacts-core/translation-api-context\";\nimport type { Contact } from \"@fluid-app/contacts-core/types\";\nimport { TaskComposerForm } from \"@fluid-app/contacts-ui/portal/components/tasks/task-composer-form\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { todosQueryKey } from \"../hooks/use-todos\";\n\nconst SEARCH_DEBOUNCE_MS = 200;\n\nexport interface CreateTodoDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\nexport function CreateTodoDialog({\n open,\n onOpenChange,\n}: CreateTodoDialogProps): React.JSX.Element {\n const queryClient = useQueryClient();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n const [selectedContact, setSelectedContact] = useState<Contact | null>(null);\n // Anchor the popover's portal inside the dialog. Dialog applies\n // pointer-events: none to the body while open, which kills clicks and\n // scroll on a body-portaled popover in WebKit. See edit-bill-date-dialog\n // for the canonical pattern.\n const [popoverContainer, setPopoverContainer] =\n useState<HTMLDivElement | null>(null);\n\n // Reset state when the dialog closes so the next open starts fresh.\n useEffect(() => {\n if (!open) setSelectedContact(null);\n }, [open]);\n\n const handleDone = () => {\n queryClient.invalidateQueries({\n queryKey: todosQueryKey({ baseUrl, isPreview }),\n });\n onOpenChange(false);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"gap-4 p-4 sm:max-w-md sm:gap-6 sm:p-6\">\n <DialogHeader>\n <DialogTitle>Add a to-do</DialogTitle>\n </DialogHeader>\n\n <PortalContainerProvider container={popoverContainer}>\n <div className=\"mt-2 flex flex-col gap-3\">\n <ContactPicker\n value={selectedContact}\n onSelect={setSelectedContact}\n />\n\n {selectedContact && (\n <TaskComposerForm\n key={selectedContact.id}\n contactId={String(selectedContact.id)}\n onDone={handleDone}\n />\n )}\n </div>\n </PortalContainerProvider>\n {/* Portal target for the popover. Must live INSIDE DialogContent so\n it ends up in the dialog's body-level portal — otherwise it\n renders inline next to the widget, and any transformed ancestor\n (builder canvas zoom, etc.) would break `position: fixed`.\n Intentionally NOT aria-hidden — the popover content portaled\n into this container has its own listbox/option semantics that\n screen readers need to reach. `pointer-events-none` keeps the\n empty overlay from capturing clicks; the popover content sets\n `pointer-events-auto` so it remains interactive. */}\n <div\n ref={setPopoverContainer}\n className=\"pointer-events-none fixed inset-0 z-[9998]\"\n />\n </DialogContent>\n </Dialog>\n );\n}\n\ninterface ContactPickerProps {\n value: Contact | null;\n onSelect: (contact: Contact) => void;\n}\n\nfunction ContactPicker({\n value,\n onSelect,\n}: ContactPickerProps): React.JSX.Element {\n const { t } = useContactsTranslation();\n const [open, setOpen] = useState(false);\n const [searchInput, setSearchInput] = useState(\"\");\n const [debouncedSearch, setDebouncedSearch] = useState(\"\");\n const sentinelRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handle = window.setTimeout(() => {\n setDebouncedSearch(searchInput.trim());\n }, SEARCH_DEBOUNCE_MS);\n return () => window.clearTimeout(handle);\n }, [searchInput]);\n\n const queryParams = useMemo(\n () => ({\n ...(debouncedSearch ? { search_query: debouncedSearch } : {}),\n sort_by: \"full_name\",\n sort_direction: \"asc\",\n per_page: 25,\n }),\n [debouncedSearch],\n );\n\n const {\n data,\n isLoading,\n isError,\n hasNextPage,\n isFetchingNextPage,\n fetchNextPage,\n } = useInfiniteContacts(queryParams);\n\n const contacts: Contact[] = useMemo(\n () => data?.pages.flatMap((page) => page.contacts ?? []) ?? [],\n [data],\n );\n\n // Auto-load the next page when the sentinel scrolls into view, so reps\n // with many contacts can reach all of them without typing a precise\n // search query.\n useEffect(() => {\n const sentinel = sentinelRef.current;\n if (!sentinel || !hasNextPage) return;\n\n const observer = new IntersectionObserver((entries) => {\n const entry = entries[0];\n if (entry?.isIntersecting && !isFetchingNextPage) {\n fetchNextPage();\n }\n });\n\n observer.observe(sentinel);\n return () => observer.disconnect();\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n return (\n <div className=\"flex flex-col gap-1\">\n <label className=\"text-muted-foreground text-xs font-medium\">\n {t(\"contact_label\")}\n </label>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n className=\"border-input bg-background hover:bg-muted/40 flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors\"\n >\n <span\n className={cn(\n \"truncate\",\n !value && \"text-muted-foreground font-normal\",\n )}\n >\n {value ? value.full_name : t(\"empty_select_contact\")}\n </span>\n <ChevronsUpDown\n className=\"text-muted-foreground size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"bg-popover text-popover-foreground pointer-events-auto z-[9999] w-(--radix-popover-trigger-width) overflow-hidden rounded-md border p-0 shadow-md\"\n >\n <div className=\"border-border flex items-center gap-2 border-b px-3 py-2\">\n <Search\n className=\"text-muted-foreground size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n <Input\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n placeholder={t(\"search_placeholder\")}\n aria-label={t(\"search_placeholder\")}\n className=\"h-7 border-0 px-0 shadow-none focus-visible:ring-0\"\n />\n </div>\n <div className=\"max-h-64 overflow-y-auto py-1\" role=\"listbox\">\n {isLoading ? (\n <div className=\"text-muted-foreground px-3 py-6 text-center text-xs\">\n {t(\"loading\")}\n </div>\n ) : isError ? (\n <div className=\"text-destructive px-3 py-6 text-center text-xs\">\n {t(\"error_loading_list\")}\n </div>\n ) : contacts.length === 0 ? (\n <div className=\"text-muted-foreground px-3 py-6 text-center text-xs\">\n {debouncedSearch\n ? t(\"no_contacts_search\", { term: debouncedSearch })\n : t(\"no_contacts_yet\")}\n </div>\n ) : (\n <>\n {contacts.map((contact) => {\n const isSelected = value?.id === contact.id;\n return (\n <button\n key={contact.id}\n type=\"button\"\n role=\"option\"\n aria-selected={isSelected}\n onClick={() => {\n onSelect(contact);\n setOpen(false);\n }}\n className=\"hover:bg-muted/50 flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-sm transition-colors\"\n >\n <span className=\"truncate\">{contact.full_name}</span>\n {isSelected && (\n <Check\n className=\"text-primary size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n })}\n {hasNextPage && (\n <div ref={sentinelRef} aria-hidden=\"true\" className=\"h-4\" />\n )}\n {isFetchingNextPage && (\n <div className=\"text-muted-foreground px-3 py-2 text-center text-xs\">\n {t(\"loading_more\")}\n </div>\n )}\n </>\n )}\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","import { useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { ListChecks, Plus } from \"lucide-react\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { parseTaskBody } from \"@fluid-app/contacts-core/parse-task-body\";\nimport { useTodos } from \"../hooks/use-todos\";\nimport { useUpdateTodo } from \"../hooks/use-update-todo\";\nimport { ErrorState } from \"../components/error-state\";\nimport { CreateTodoDialog } from \"./CreateTodoDialog\";\n\ntype ToDoWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content\n maxItems?: number;\n};\n\nexport function ToDoWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"To-Do\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Content defaults\n maxItems = 5,\n\n className,\n ...props\n}: ToDoWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data: todos = [], isLoading, isError } = useTodos();\n const updateTodo = useUpdateTodo();\n const { isPreview } = useWidgetPreviewContext();\n const [pendingIds, setPendingIds] = useState<Set<number>>(new Set());\n const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false);\n\n const toggleTodo = (id: number, completed: boolean) => {\n if (isPreview || pendingIds.has(id)) return;\n setPendingIds((prev) => new Set(prev).add(id));\n updateTodo.mutate(\n { id, completed },\n {\n onSettled: () =>\n setPendingIds((prev) => {\n const next = new Set(prev);\n next.delete(id);\n return next;\n }),\n },\n );\n };\n\n const activeTodos = todos.filter((todo) => !todo.completedAt);\n const todosToShow = activeTodos.slice(0, maxItems);\n const remainingCount = activeTodos.length - todosToShow.length;\n const isEmpty = activeTodos.length === 0;\n\n // Group todos by contactId so same-named contacts stay separate.\n const groupedTodos = todosToShow.reduce<\n {\n contactId: number | null;\n contactName: string | null;\n todos: typeof todosToShow;\n }[]\n >((groups, todo) => {\n const existing = groups.find((g) => g.contactId === todo.contactId);\n if (existing) {\n existing.todos.push(todo);\n } else {\n groups.push({\n contactId: todo.contactId,\n contactName: todo.contactName,\n todos: [todo],\n });\n }\n return groups;\n }, []);\n\n return (\n <div\n className={`overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {titleText}\n </h2>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {!isEmpty && !isLoading && (\n <span className={`text-2xl font-bold text-${accentColor}`}>\n {activeTodos.length}\n </span>\n )}\n <div\n className={`flex h-10 w-10 shrink-0 items-center justify-center`}\n >\n <ListChecks className={`h-5 w-5 text-${accentColor}-foreground`} />\n </div>\n </div>\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[120px] items-center justify-center\">\n <div className=\"h-6 w-6 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : isEmpty ? (\n /* Empty state */\n <div className=\"flex flex-col items-center justify-center gap-3 py-8\">\n <p className={`text-center text-${textColor}/60`}>\n You've got nothing else To-Do!\n </p>\n {!isPreview && (\n <button\n type=\"button\"\n onClick={() => setIsCreateDialogOpen(true)}\n className={`inline-flex items-center gap-1.5 rounded-full bg-${accentColor} text-${accentColor}-foreground hover:bg-${accentColor}/90 px-4 py-1.5 text-xs font-semibold transition-colors`}\n >\n <Plus className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n Add to-do\n </button>\n )}\n </div>\n ) : (\n /* Todo List */\n <>\n <div className=\"flex flex-col gap-3\">\n {groupedTodos.map((group) => (\n <div\n key={group.contactId ?? \"__unassigned__\"}\n className=\"flex flex-col\"\n >\n {group.contactName && (\n <div\n className={`mb-1 text-xs font-semibold tracking-wide uppercase text-${textColor}/60`}\n >\n {group.contactName}\n </div>\n )}\n {group.todos.map((todo, index) => (\n <div\n key={todo.id}\n className={`flex items-center gap-3 py-2 ${\n index !== group.todos.length - 1\n ? `border-b border-${textColor}/10`\n : \"\"\n }`}\n >\n <input\n type=\"checkbox\"\n className={`h-5 w-5 rounded-full border-2 border-${textColor}/30 bg-transparent not-disabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-60`}\n checked={!!todo.completedAt}\n disabled={isPreview || pendingIds.has(todo.id)}\n onChange={(event) =>\n toggleTodo(todo.id, event.target.checked)\n }\n />\n <span className=\"line-clamp-1 flex-1 text-sm\">\n {parseTaskBody(todo.body).title}\n </span>\n </div>\n ))}\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"mt-2 flex items-center justify-between\">\n {remainingCount > 0 && (\n <span className={`text-sm text-${textColor}/50 underline`}>\n {remainingCount} more task{remainingCount > 1 ? \"s\" : \"\"}\n </span>\n )}\n <div className=\"ml-auto\">\n <button\n type=\"button\"\n onClick={() => setIsCreateDialogOpen(true)}\n disabled={isPreview}\n aria-label=\"Add to-do\"\n className={`flex h-8 w-8 items-center justify-center rounded-full transition-colors not-disabled:cursor-pointer hover:bg-${textColor}/10 disabled:opacity-60`}\n >\n <Plus className={`h-5 w-5 text-${textColor}/50`} />\n </button>\n </div>\n </div>\n </>\n )}\n\n {!isPreview && (\n <CreateTodoDialog\n open={isCreateDialogOpen}\n onOpenChange={setIsCreateDialogOpen}\n />\n )}\n </div>\n );\n}\n\nexport const toDoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ToDoWidget\",\n displayName: \"To-Do Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Styling Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the todo list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the todo list\",\n defaultValue: \"To-Do\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for todo items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count badge and icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of todo items to display\",\n min: 1,\n max: 20,\n step: 1,\n defaultValue: 5,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,YAAY,MAAsB;CACzC,MAAM,IAAI,IAAI,KAAK,IAAI;AACvB,GAAE,QAAQ,EAAE,SAAS,GAAG,KA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,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFA,mBAAAA,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACDC,mBAAAA,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
require("./task-composer-form-
|
|
2
|
+
require("./task-composer-form-DvVQw5ud.cjs");
|
|
3
3
|
require("./registry-context-DJ5xiVnt.cjs");
|
|
4
4
|
require("./error-state-BI3jxWlb.cjs");
|
|
5
5
|
require("./translation-api-context-factory-6jtyJm6d.cjs");
|
|
@@ -7,5 +7,5 @@ require("./registries-BxNpO5DV.cjs");
|
|
|
7
7
|
require("./fields-D4qgIZ7Y.cjs");
|
|
8
8
|
require("./preview-context-B4-iZOzd.cjs");
|
|
9
9
|
require("./src-DoVMGOoV.cjs");
|
|
10
|
-
const require_ToDoWidget = require("./ToDoWidget-
|
|
10
|
+
const require_ToDoWidget = require("./ToDoWidget-C8R0i2cb.cjs");
|
|
11
11
|
exports.toDoWidgetPropertySchema = require_ToDoWidget.toDoWidgetPropertySchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vt as __exportAll } from "./PortalTenantClientProvider-BmRtQAbi.mjs";
|
|
2
|
-
import { c as useContactsTranslation, o as parseTaskBody, r as useInfiniteContacts, t as TaskComposerForm } from "./task-composer-form-
|
|
2
|
+
import { c as useContactsTranslation, o as parseTaskBody, r as useInfiniteContacts, t as TaskComposerForm } from "./task-composer-form-Cq3KTV0Y.mjs";
|
|
3
3
|
import { n as useDataSourceRegistryConfig } from "./registry-context-BKvTiuXB.mjs";
|
|
4
4
|
import { r as useWidgetsApi, t as ErrorState } from "./error-state-Djgt-RGW.mjs";
|
|
5
5
|
import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-C-t6-veK.mjs";
|
|
@@ -140,7 +140,7 @@ function CreateTodoDialog({ open, onOpenChange }) {
|
|
|
140
140
|
open,
|
|
141
141
|
onOpenChange,
|
|
142
142
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
143
|
-
className: "sm:max-w-md",
|
|
143
|
+
className: "gap-4 p-4 sm:max-w-md sm:gap-6 sm:p-6",
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Add a to-do" }) }),
|
|
146
146
|
/* @__PURE__ */ jsx(PortalContainerProvider, {
|
|
@@ -541,4 +541,4 @@ const toDoWidgetPropertySchema = {
|
|
|
541
541
|
//#endregion
|
|
542
542
|
export { ToDoWidget_exports as n, toDoWidgetPropertySchema as r, ToDoWidget as t };
|
|
543
543
|
|
|
544
|
-
//# sourceMappingURL=ToDoWidget-
|
|
544
|
+
//# sourceMappingURL=ToDoWidget-eYF1VvRa.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToDoWidget-eYF1VvRa.mjs","names":[],"sources":["../../widgets/src/hooks/use-todos.preview.ts","../../widgets/src/hooks/use-todos.ts","../../widgets/src/hooks/use-update-todo.ts","../../widgets/src/widgets/CreateTodoDialog.tsx","../../widgets/src/widgets/ToDoWidget.tsx"],"sourcesContent":["import type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction daysFromNow(days: number): string {\n const d = new Date(now);\n d.setDate(d.getDate() + days);\n return d.toISOString();\n}\n\nexport const PREVIEW_DATA: Todo[] = [\n {\n id: 1,\n body: \"Send follow-up email to new leads\",\n dueAt: daysFromNow(1),\n completedAt: null,\n createdAt: daysFromNow(-2),\n contactId: 101,\n contactName: \"Sarah Johnson\",\n },\n {\n id: 2,\n body: \"Prepare slides for team training\",\n dueAt: daysFromNow(3),\n completedAt: null,\n createdAt: daysFromNow(-1),\n contactId: null,\n contactName: null,\n },\n {\n id: 3,\n body: \"Review monthly sales report\",\n dueAt: daysFromNow(-1),\n completedAt: null,\n createdAt: daysFromNow(-5),\n contactId: 102,\n contactName: \"Mike Chen\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-todos.preview\";\nimport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\n\n/**\n * Shared cache key for the todos list. Both useTodos (read) and\n * useUpdateTodo (write) use this — drift would silently break optimistic\n * updates.\n */\nexport function todosQueryKey(args: {\n baseUrl: string | undefined;\n isPreview: boolean;\n}) {\n return [\n \"portal-widget-use\",\n \"todos\",\n args.isPreview ? \"preview\" : args.baseUrl,\n ] as const;\n}\n\nexport function useTodos(): UseQueryResult<Todo[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: todosQueryKey({ baseUrl, isPreview }),\n queryFn: ({ signal }) => widgetsApi.fetchTodos(signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport type { Todo } from \"@fluid-app/portal-core/widgets-api-types\";\nimport { todosQueryKey } from \"./use-todos\";\n\ntype UpdateVariables = { id: number; completed: boolean };\n\nexport function useUpdateTodo() {\n const widgetsApi = useWidgetsApi();\n const queryClient = useQueryClient();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n const queryKey = todosQueryKey({ baseUrl, isPreview });\n\n return useMutation({\n mutationFn: ({ id, completed }: UpdateVariables) => {\n // Defense in depth: ToDoWidget already disables the checkbox in\n // preview mode, but if any other caller fires this mutation while\n // previewing we'd PATCH demo data on the real backend. Fail closed.\n if (isPreview) {\n return Promise.reject(\n new Error(\"Todo updates are disabled in preview mode\"),\n );\n }\n return widgetsApi.updateTodo(id, completed);\n },\n onMutate: async ({ id, completed }) => {\n await queryClient.cancelQueries({ queryKey });\n const previous = queryClient.getQueryData<Todo[]>(queryKey);\n queryClient.setQueryData<Todo[]>(queryKey, (current) =>\n (current ?? []).map((todo) =>\n todo.id === id\n ? {\n ...todo,\n completedAt: completed ? new Date().toISOString() : null,\n }\n : todo,\n ),\n );\n return { previous };\n },\n onSuccess: (updated, { completed }) => {\n queryClient.setQueryData<Todo[]>(queryKey, (current) =>\n (current ?? []).map((todo) =>\n todo.id === updated.id ? updated : todo,\n ),\n );\n // Match the documented test plan: completing toasts, un-completing\n // is silent. The widget today only ever fires completed=true, but\n // gating here keeps the contract honest for any future caller that\n // toggles either direction.\n if (completed) {\n fluidToast({ title: \"Todo completed\", type: \"success\" });\n }\n },\n onError: (_error, _variables, context) => {\n if (context?.previous) {\n queryClient.setQueryData(queryKey, context.previous);\n }\n fluidToast({ title: \"Failed to update todo\", type: \"error\" });\n },\n // Belt-and-suspenders refetch to reconcile any race we couldn't see\n // (e.g., a different tab mutated the same todo). Cheap — one GET per\n // toggle.\n onSettled: () => {\n queryClient.invalidateQueries({ queryKey });\n },\n });\n}\n","\"use client\";\n\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Check, ChevronsUpDown, Search } from \"lucide-react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport {\n cn,\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n PortalContainerProvider,\n} from \"@fluid-app/ui-primitives\";\nimport { useInfiniteContacts } from \"@fluid-app/contacts-core/hooks/use-infinite-contacts\";\nimport { useContactsTranslation } from \"@fluid-app/contacts-core/translation-api-context\";\nimport type { Contact } from \"@fluid-app/contacts-core/types\";\nimport { TaskComposerForm } from \"@fluid-app/contacts-ui/portal/components/tasks/task-composer-form\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { todosQueryKey } from \"../hooks/use-todos\";\n\nconst SEARCH_DEBOUNCE_MS = 200;\n\nexport interface CreateTodoDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\nexport function CreateTodoDialog({\n open,\n onOpenChange,\n}: CreateTodoDialogProps): React.JSX.Element {\n const queryClient = useQueryClient();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n const [selectedContact, setSelectedContact] = useState<Contact | null>(null);\n // Anchor the popover's portal inside the dialog. Dialog applies\n // pointer-events: none to the body while open, which kills clicks and\n // scroll on a body-portaled popover in WebKit. See edit-bill-date-dialog\n // for the canonical pattern.\n const [popoverContainer, setPopoverContainer] =\n useState<HTMLDivElement | null>(null);\n\n // Reset state when the dialog closes so the next open starts fresh.\n useEffect(() => {\n if (!open) setSelectedContact(null);\n }, [open]);\n\n const handleDone = () => {\n queryClient.invalidateQueries({\n queryKey: todosQueryKey({ baseUrl, isPreview }),\n });\n onOpenChange(false);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"gap-4 p-4 sm:max-w-md sm:gap-6 sm:p-6\">\n <DialogHeader>\n <DialogTitle>Add a to-do</DialogTitle>\n </DialogHeader>\n\n <PortalContainerProvider container={popoverContainer}>\n <div className=\"mt-2 flex flex-col gap-3\">\n <ContactPicker\n value={selectedContact}\n onSelect={setSelectedContact}\n />\n\n {selectedContact && (\n <TaskComposerForm\n key={selectedContact.id}\n contactId={String(selectedContact.id)}\n onDone={handleDone}\n />\n )}\n </div>\n </PortalContainerProvider>\n {/* Portal target for the popover. Must live INSIDE DialogContent so\n it ends up in the dialog's body-level portal — otherwise it\n renders inline next to the widget, and any transformed ancestor\n (builder canvas zoom, etc.) would break `position: fixed`.\n Intentionally NOT aria-hidden — the popover content portaled\n into this container has its own listbox/option semantics that\n screen readers need to reach. `pointer-events-none` keeps the\n empty overlay from capturing clicks; the popover content sets\n `pointer-events-auto` so it remains interactive. */}\n <div\n ref={setPopoverContainer}\n className=\"pointer-events-none fixed inset-0 z-[9998]\"\n />\n </DialogContent>\n </Dialog>\n );\n}\n\ninterface ContactPickerProps {\n value: Contact | null;\n onSelect: (contact: Contact) => void;\n}\n\nfunction ContactPicker({\n value,\n onSelect,\n}: ContactPickerProps): React.JSX.Element {\n const { t } = useContactsTranslation();\n const [open, setOpen] = useState(false);\n const [searchInput, setSearchInput] = useState(\"\");\n const [debouncedSearch, setDebouncedSearch] = useState(\"\");\n const sentinelRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handle = window.setTimeout(() => {\n setDebouncedSearch(searchInput.trim());\n }, SEARCH_DEBOUNCE_MS);\n return () => window.clearTimeout(handle);\n }, [searchInput]);\n\n const queryParams = useMemo(\n () => ({\n ...(debouncedSearch ? { search_query: debouncedSearch } : {}),\n sort_by: \"full_name\",\n sort_direction: \"asc\",\n per_page: 25,\n }),\n [debouncedSearch],\n );\n\n const {\n data,\n isLoading,\n isError,\n hasNextPage,\n isFetchingNextPage,\n fetchNextPage,\n } = useInfiniteContacts(queryParams);\n\n const contacts: Contact[] = useMemo(\n () => data?.pages.flatMap((page) => page.contacts ?? []) ?? [],\n [data],\n );\n\n // Auto-load the next page when the sentinel scrolls into view, so reps\n // with many contacts can reach all of them without typing a precise\n // search query.\n useEffect(() => {\n const sentinel = sentinelRef.current;\n if (!sentinel || !hasNextPage) return;\n\n const observer = new IntersectionObserver((entries) => {\n const entry = entries[0];\n if (entry?.isIntersecting && !isFetchingNextPage) {\n fetchNextPage();\n }\n });\n\n observer.observe(sentinel);\n return () => observer.disconnect();\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n return (\n <div className=\"flex flex-col gap-1\">\n <label className=\"text-muted-foreground text-xs font-medium\">\n {t(\"contact_label\")}\n </label>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n className=\"border-input bg-background hover:bg-muted/40 flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors\"\n >\n <span\n className={cn(\n \"truncate\",\n !value && \"text-muted-foreground font-normal\",\n )}\n >\n {value ? value.full_name : t(\"empty_select_contact\")}\n </span>\n <ChevronsUpDown\n className=\"text-muted-foreground size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"bg-popover text-popover-foreground pointer-events-auto z-[9999] w-(--radix-popover-trigger-width) overflow-hidden rounded-md border p-0 shadow-md\"\n >\n <div className=\"border-border flex items-center gap-2 border-b px-3 py-2\">\n <Search\n className=\"text-muted-foreground size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n <Input\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n placeholder={t(\"search_placeholder\")}\n aria-label={t(\"search_placeholder\")}\n className=\"h-7 border-0 px-0 shadow-none focus-visible:ring-0\"\n />\n </div>\n <div className=\"max-h-64 overflow-y-auto py-1\" role=\"listbox\">\n {isLoading ? (\n <div className=\"text-muted-foreground px-3 py-6 text-center text-xs\">\n {t(\"loading\")}\n </div>\n ) : isError ? (\n <div className=\"text-destructive px-3 py-6 text-center text-xs\">\n {t(\"error_loading_list\")}\n </div>\n ) : contacts.length === 0 ? (\n <div className=\"text-muted-foreground px-3 py-6 text-center text-xs\">\n {debouncedSearch\n ? t(\"no_contacts_search\", { term: debouncedSearch })\n : t(\"no_contacts_yet\")}\n </div>\n ) : (\n <>\n {contacts.map((contact) => {\n const isSelected = value?.id === contact.id;\n return (\n <button\n key={contact.id}\n type=\"button\"\n role=\"option\"\n aria-selected={isSelected}\n onClick={() => {\n onSelect(contact);\n setOpen(false);\n }}\n className=\"hover:bg-muted/50 flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-sm transition-colors\"\n >\n <span className=\"truncate\">{contact.full_name}</span>\n {isSelected && (\n <Check\n className=\"text-primary size-4 shrink-0\"\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n })}\n {hasNextPage && (\n <div ref={sentinelRef} aria-hidden=\"true\" className=\"h-4\" />\n )}\n {isFetchingNextPage && (\n <div className=\"text-muted-foreground px-3 py-2 text-center text-xs\">\n {t(\"loading_more\")}\n </div>\n )}\n </>\n )}\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","import { useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { ListChecks, Plus } from \"lucide-react\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { parseTaskBody } from \"@fluid-app/contacts-core/parse-task-body\";\nimport { useTodos } from \"../hooks/use-todos\";\nimport { useUpdateTodo } from \"../hooks/use-update-todo\";\nimport { ErrorState } from \"../components/error-state\";\nimport { CreateTodoDialog } from \"./CreateTodoDialog\";\n\ntype ToDoWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content\n maxItems?: number;\n};\n\nexport function ToDoWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"To-Do\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Content defaults\n maxItems = 5,\n\n className,\n ...props\n}: ToDoWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data: todos = [], isLoading, isError } = useTodos();\n const updateTodo = useUpdateTodo();\n const { isPreview } = useWidgetPreviewContext();\n const [pendingIds, setPendingIds] = useState<Set<number>>(new Set());\n const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false);\n\n const toggleTodo = (id: number, completed: boolean) => {\n if (isPreview || pendingIds.has(id)) return;\n setPendingIds((prev) => new Set(prev).add(id));\n updateTodo.mutate(\n { id, completed },\n {\n onSettled: () =>\n setPendingIds((prev) => {\n const next = new Set(prev);\n next.delete(id);\n return next;\n }),\n },\n );\n };\n\n const activeTodos = todos.filter((todo) => !todo.completedAt);\n const todosToShow = activeTodos.slice(0, maxItems);\n const remainingCount = activeTodos.length - todosToShow.length;\n const isEmpty = activeTodos.length === 0;\n\n // Group todos by contactId so same-named contacts stay separate.\n const groupedTodos = todosToShow.reduce<\n {\n contactId: number | null;\n contactName: string | null;\n todos: typeof todosToShow;\n }[]\n >((groups, todo) => {\n const existing = groups.find((g) => g.contactId === todo.contactId);\n if (existing) {\n existing.todos.push(todo);\n } else {\n groups.push({\n contactId: todo.contactId,\n contactName: todo.contactName,\n todos: [todo],\n });\n }\n return groups;\n }, []);\n\n return (\n <div\n className={`overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {titleText}\n </h2>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {!isEmpty && !isLoading && (\n <span className={`text-2xl font-bold text-${accentColor}`}>\n {activeTodos.length}\n </span>\n )}\n <div\n className={`flex h-10 w-10 shrink-0 items-center justify-center`}\n >\n <ListChecks className={`h-5 w-5 text-${accentColor}-foreground`} />\n </div>\n </div>\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[120px] items-center justify-center\">\n <div className=\"h-6 w-6 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : isEmpty ? (\n /* Empty state */\n <div className=\"flex flex-col items-center justify-center gap-3 py-8\">\n <p className={`text-center text-${textColor}/60`}>\n You've got nothing else To-Do!\n </p>\n {!isPreview && (\n <button\n type=\"button\"\n onClick={() => setIsCreateDialogOpen(true)}\n className={`inline-flex items-center gap-1.5 rounded-full bg-${accentColor} text-${accentColor}-foreground hover:bg-${accentColor}/90 px-4 py-1.5 text-xs font-semibold transition-colors`}\n >\n <Plus className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n Add to-do\n </button>\n )}\n </div>\n ) : (\n /* Todo List */\n <>\n <div className=\"flex flex-col gap-3\">\n {groupedTodos.map((group) => (\n <div\n key={group.contactId ?? \"__unassigned__\"}\n className=\"flex flex-col\"\n >\n {group.contactName && (\n <div\n className={`mb-1 text-xs font-semibold tracking-wide uppercase text-${textColor}/60`}\n >\n {group.contactName}\n </div>\n )}\n {group.todos.map((todo, index) => (\n <div\n key={todo.id}\n className={`flex items-center gap-3 py-2 ${\n index !== group.todos.length - 1\n ? `border-b border-${textColor}/10`\n : \"\"\n }`}\n >\n <input\n type=\"checkbox\"\n className={`h-5 w-5 rounded-full border-2 border-${textColor}/30 bg-transparent not-disabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-60`}\n checked={!!todo.completedAt}\n disabled={isPreview || pendingIds.has(todo.id)}\n onChange={(event) =>\n toggleTodo(todo.id, event.target.checked)\n }\n />\n <span className=\"line-clamp-1 flex-1 text-sm\">\n {parseTaskBody(todo.body).title}\n </span>\n </div>\n ))}\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"mt-2 flex items-center justify-between\">\n {remainingCount > 0 && (\n <span className={`text-sm text-${textColor}/50 underline`}>\n {remainingCount} more task{remainingCount > 1 ? \"s\" : \"\"}\n </span>\n )}\n <div className=\"ml-auto\">\n <button\n type=\"button\"\n onClick={() => setIsCreateDialogOpen(true)}\n disabled={isPreview}\n aria-label=\"Add to-do\"\n className={`flex h-8 w-8 items-center justify-center rounded-full transition-colors not-disabled:cursor-pointer hover:bg-${textColor}/10 disabled:opacity-60`}\n >\n <Plus className={`h-5 w-5 text-${textColor}/50`} />\n </button>\n </div>\n </div>\n </>\n )}\n\n {!isPreview && (\n <CreateTodoDialog\n open={isCreateDialogOpen}\n onOpenChange={setIsCreateDialogOpen}\n />\n )}\n </div>\n );\n}\n\nexport const toDoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ToDoWidget\",\n displayName: \"To-Do Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Styling Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the todo list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the todo list\",\n defaultValue: \"To-Do\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for todo items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count badge and icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of todo items to display\",\n min: 1,\n max: 20,\n step: 1,\n defaultValue: 5,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,YAAY,MAAsB;CACzC,MAAM,IAAI,IAAI,KAAK,IAAI;AACvB,GAAE,QAAQ,EAAE,SAAS,GAAG,KAAK;AAC7B,QAAO,EAAE,aAAa;;AAGxB,MAAa,eAAuB;CAClC;EACE,IAAI;EACJ,MAAM;EACN,OAAO,YAAY,EAAE;EACrB,aAAa;EACb,WAAW,YAAY,GAAG;EAC1B,WAAW;EACX,aAAa;EACd;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO,YAAY,EAAE;EACrB,aAAa;EACb,WAAW,YAAY,GAAG;EAC1B,WAAW;EACX,aAAa;EACd;C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ACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
3
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
3
|
+
const require_FluidProvider = require("./FluidProvider-DtsjXKhW.cjs");
|
|
4
4
|
const require_ScreenRenderer = require("./ScreenRenderer-BYiZunHL.cjs");
|
|
5
5
|
const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-Bpm-CZq1.cjs");
|
|
6
6
|
require("./store-api-context-D1gZn22Z.cjs");
|
|
7
7
|
require("./mysite-api-context-CilZcDS4.cjs");
|
|
8
8
|
require("./countries-api-context-G-NW4BoH.cjs");
|
|
9
|
-
require("./task-composer-form-
|
|
9
|
+
require("./task-composer-form-DvVQw5ud.cjs");
|
|
10
10
|
require("./registry-context-DJ5xiVnt.cjs");
|
|
11
11
|
const require_WidgetInteractionContext = require("./WidgetInteractionContext-BhkusA95.cjs");
|
|
12
12
|
const require_EmbedWidget = require("./EmbedWidget-Apuoqmq4.cjs");
|
|
@@ -41,7 +41,7 @@ const require_RecentActivityWidget = require("./RecentActivityWidget-DEQHXSNu.cj
|
|
|
41
41
|
const require_SeparatorWidget = require("./SeparatorWidget-DFL3n-Yu.cjs");
|
|
42
42
|
const require_SpacerWidget = require("./SpacerWidget-CYHjTF38.cjs");
|
|
43
43
|
const require_TableWidget = require("./TableWidget-SgL9bBT9.cjs");
|
|
44
|
-
const require_ToDoWidget = require("./ToDoWidget-
|
|
44
|
+
const require_ToDoWidget = require("./ToDoWidget-C8R0i2cb.cjs");
|
|
45
45
|
const require_VideoWidget = require("./VideoWidget-5oAZXEKw.cjs");
|
|
46
46
|
const require_SearchSort = require("./SearchSort-Bi9QWJQQ.cjs");
|
|
47
47
|
const require_ShopWidget = require("./ShopWidget-CGs4oaaC.cjs");
|
|
@@ -50,21 +50,21 @@ const require_CustomersScreen = require("./CustomersScreen-DtDU7jkB.cjs");
|
|
|
50
50
|
const require_use_store = require("./use-store-D2S1FywW.cjs");
|
|
51
51
|
const require_use_account = require("./use-account-BMLTwG3m.cjs");
|
|
52
52
|
const require_AppNavigationContext = require("./AppNavigationContext-CDowN9gd.cjs");
|
|
53
|
-
const require_MessagingScreen = require("./MessagingScreen-
|
|
54
|
-
require("./AddressAutocompleteInput-
|
|
53
|
+
const require_MessagingScreen = require("./MessagingScreen-IusKBudc.cjs");
|
|
54
|
+
require("./AddressAutocompleteInput-Dt4OoHWV.cjs");
|
|
55
55
|
require("./Combobox-D9lqcqeg.cjs");
|
|
56
56
|
require("./use-mysite-portal-BmrDScmS.cjs");
|
|
57
|
-
const require_ProfileScreen = require("./ProfileScreen-
|
|
58
|
-
const require_SubscriptionsScreen = require("./SubscriptionsScreen-
|
|
57
|
+
const require_ProfileScreen = require("./ProfileScreen-P_oroi6n.cjs");
|
|
58
|
+
const require_SubscriptionsScreen = require("./SubscriptionsScreen-DOfdH7d7.cjs");
|
|
59
59
|
require("./dist-BPZPs7SF.cjs");
|
|
60
60
|
require("./es-CtTr3tb5.cjs");
|
|
61
|
-
const require_ContactsScreen = require("./ContactsScreen-
|
|
61
|
+
const require_ContactsScreen = require("./ContactsScreen-BhgI_-6s.cjs");
|
|
62
62
|
require("./dist-C-U7FKrp.cjs");
|
|
63
|
-
const require_OrdersScreen = require("./OrdersScreen-
|
|
63
|
+
const require_OrdersScreen = require("./OrdersScreen-DUgM6eSF.cjs");
|
|
64
64
|
const require_MySiteScreen = require("./MySiteScreen-D95Kir2t.cjs");
|
|
65
65
|
require("./dist-DSufwDW6.cjs");
|
|
66
66
|
const require_ShareablesScreen = require("./ShareablesScreen-CSCdh897.cjs");
|
|
67
|
-
const require_ShopScreen = require("./ShopScreen-
|
|
67
|
+
const require_ShopScreen = require("./ShopScreen-Dy4vW550.cjs");
|
|
68
68
|
require("./UpgradeScreen-B8G83QW_.cjs");
|
|
69
69
|
require("./AppDownloadScreen-Cn1gi2aM.cjs");
|
|
70
70
|
let react = require("react");
|
|
@@ -2178,12 +2178,12 @@ function BuilderScreenViewImpl({ screen, className }) {
|
|
|
2178
2178
|
const BuilderScreenView = (0, react.memo)(BuilderScreenViewImpl);
|
|
2179
2179
|
//#endregion
|
|
2180
2180
|
//#region src/shell/system-screen-map.ts
|
|
2181
|
-
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-
|
|
2182
|
-
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-
|
|
2183
|
-
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-
|
|
2184
|
-
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-
|
|
2185
|
-
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-
|
|
2186
|
-
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-
|
|
2181
|
+
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-B1ufOonA.cjs")).then((m) => ({ default: m.ProfileScreen })));
|
|
2182
|
+
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-BVirBT0C.cjs")).then((m) => ({ default: m.OrdersScreen })));
|
|
2183
|
+
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-Dyy_wCaB.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
2184
|
+
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-DaGUbFap.cjs")).then((m) => ({ default: m.MessagingScreen })));
|
|
2185
|
+
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-B3eVauD-.cjs")).then((m) => ({ default: m.ContactsScreen })));
|
|
2186
|
+
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-CmHEYzWO.cjs")).then((m) => ({ default: m.ShopScreen })));
|
|
2187
2187
|
const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-DtDU7jkB.cjs")).then((n) => n.CustomersScreen_exports).then((m) => ({ default: m.CustomersScreen })));
|
|
2188
2188
|
const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-Cvxi4Fen.cjs")).then((m) => ({ default: m.ShareablesScreen })));
|
|
2189
2189
|
const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-f8zAVWT-.cjs")).then((m) => ({ default: m.MySiteScreen })));
|
|
@@ -4090,15 +4090,15 @@ zod.z.object({
|
|
|
4090
4090
|
//#endregion
|
|
4091
4091
|
//#region src/screens/index.ts
|
|
4092
4092
|
const screenPropertySchemas = {
|
|
4093
|
-
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-
|
|
4094
|
-
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-
|
|
4095
|
-
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-
|
|
4096
|
-
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-
|
|
4097
|
-
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-
|
|
4093
|
+
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-B1ufOonA.cjs")).then((m) => m.profileScreenPropertySchema),
|
|
4094
|
+
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-DaGUbFap.cjs")).then((m) => m.messagingScreenPropertySchema),
|
|
4095
|
+
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-B3eVauD-.cjs")).then((m) => m.contactsScreenPropertySchema),
|
|
4096
|
+
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-BVirBT0C.cjs")).then((m) => m.ordersScreenPropertySchema),
|
|
4097
|
+
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-Dyy_wCaB.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
|
|
4098
4098
|
CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-DtDU7jkB.cjs")).then((n) => n.CustomersScreen_exports).then((m) => m.customersScreenPropertySchema),
|
|
4099
4099
|
MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-f8zAVWT-.cjs")).then((m) => m.mySiteScreenPropertySchema),
|
|
4100
4100
|
ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-Cvxi4Fen.cjs")).then((m) => m.shareablesScreenPropertySchema),
|
|
4101
|
-
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-
|
|
4101
|
+
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-CmHEYzWO.cjs")).then((m) => m.shopScreenPropertySchema),
|
|
4102
4102
|
UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-ayWak9W9.cjs")).then((m) => m.upgradeScreenPropertySchema),
|
|
4103
4103
|
AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-Cn1gi2aM.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
|
|
4104
4104
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $ as products_search, Q as products_media_list, X as product_by_visits, Y as product_by_shares, Z as products_list, et as products_show, n as usePortalTenantClient } from "./PortalTenantClientProvider-BmRtQAbi.mjs";
|
|
2
|
-
import { A as mergeDarkOverrides, C as DEFAULT_SPACING, D as generateThemeCSS, E as getDefaultThemeDefinition, F as RADIUS_KEYS, H as useAppDefinitionApi, I as SEMANTIC_COLOR_NAMES, M as resolveTheme, N as FONT_FAMILY_KEYS, O as deriveDarkVariant, P as FONT_SIZE_KEYS, S as DEFAULT_RADII, T as DEFAULT_THEME_NAME, U as createPersister, W as deleteDatabase, _ as deserialiseTheme, a as widgetPropertySchemas, b as DEFAULT_FONT_FAMILIES, c as createWidgetRegistry, d as applyTheme, f as removeAllThemes, g as transformThemes, h as getActiveThemeId, i as DEFAULT_SDK_WIDGET_REGISTRY, j as parseColor, k as getForegroundColor, l as FluidThemeProvider, m as buildThemeDefinition, n as useFluidContext, o as createScreen, p as removeTheme, r as SUPPORTED_LANGUAGES, s as createWidgetFromShareable, t as FluidProvider, u as useThemeContext, v as serialiseTheme, w as DEFAULT_THEME_ID, x as DEFAULT_FONT_SIZES, y as DEFAULT_COLORS } from "./FluidProvider-
|
|
2
|
+
import { A as mergeDarkOverrides, C as DEFAULT_SPACING, D as generateThemeCSS, E as getDefaultThemeDefinition, F as RADIUS_KEYS, H as useAppDefinitionApi, I as SEMANTIC_COLOR_NAMES, M as resolveTheme, N as FONT_FAMILY_KEYS, O as deriveDarkVariant, P as FONT_SIZE_KEYS, S as DEFAULT_RADII, T as DEFAULT_THEME_NAME, U as createPersister, W as deleteDatabase, _ as deserialiseTheme, a as widgetPropertySchemas, b as DEFAULT_FONT_FAMILIES, c as createWidgetRegistry, d as applyTheme, f as removeAllThemes, g as transformThemes, h as getActiveThemeId, i as DEFAULT_SDK_WIDGET_REGISTRY, j as parseColor, k as getForegroundColor, l as FluidThemeProvider, m as buildThemeDefinition, n as useFluidContext, o as createScreen, p as removeTheme, r as SUPPORTED_LANGUAGES, s as createWidgetFromShareable, t as FluidProvider, u as useThemeContext, v as serialiseTheme, w as DEFAULT_THEME_ID, x as DEFAULT_FONT_SIZES, y as DEFAULT_COLORS } from "./FluidProvider-kt_D_70p.mjs";
|
|
3
3
|
import { a as assertNever, i as assertDefined, n as DataAwareWidget, o as isWidgetType, r as WIDGET_TYPE_NAMES, s as isWidgetTypeName, u as useRegistry } from "./ScreenRenderer-1ZCNOyIb.mjs";
|
|
4
4
|
import "./store-api-context-DViwxyG4.mjs";
|
|
5
5
|
import "./mysite-api-context-kUTM3GNG.mjs";
|
|
6
6
|
import "./countries-api-context-DScC_39w.mjs";
|
|
7
|
-
import "./task-composer-form-
|
|
7
|
+
import "./task-composer-form-Cq3KTV0Y.mjs";
|
|
8
8
|
import "./registry-context-BKvTiuXB.mjs";
|
|
9
9
|
import { t as WidgetInteractionProvider } from "./WidgetInteractionContext-BWH7njU7.mjs";
|
|
10
10
|
import { a as useRepUser, i as RepUserProvider, r as embedWidgetPropertySchema, t as EmbedWidget } from "./EmbedWidget-CWGftI9F.mjs";
|
|
@@ -25,8 +25,8 @@ import "./MediaRenderer-CLmBOrvK.mjs";
|
|
|
25
25
|
import { r as carouselWidgetPropertySchema, t as CarouselWidget } from "./CarouselWidget-Ce0X7aS8.mjs";
|
|
26
26
|
import { r as catchUpWidgetPropertySchema, t as CatchUpWidget } from "./CatchUpWidget-Cr21SMIo.mjs";
|
|
27
27
|
import { Dt as CardHeader, Et as CardFooter, Ot as CardTitle, St as Card, Tt as CardDescription, at as Popover, ct as PopoverTrigger, gt as CollapsibleTrigger, h as Skeleton$1, ht as CollapsibleContent, kn as cn$1, mt as Collapsible, p as Toaster, st as PopoverContent, wn as Button } from "./src-DC5QoBhR.mjs";
|
|
28
|
-
import { a as useMessagingAuth, i as useMessagingConfig, n as messagingScreenPropertySchema, r as createFluidFileUploader, t as MessagingScreen } from "./MessagingScreen-
|
|
29
|
-
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-
|
|
28
|
+
import { a as useMessagingAuth, i as useMessagingConfig, n as messagingScreenPropertySchema, r as createFluidFileUploader, t as MessagingScreen } from "./MessagingScreen-pNgGuv10.mjs";
|
|
29
|
+
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-CnMPK8cR.mjs";
|
|
30
30
|
import { r as chartWidgetPropertySchema, t as ChartWidget } from "./ChartWidget-80AuzFPc.mjs";
|
|
31
31
|
import { r as containerWidgetPropertySchema, t as ContainerWidget } from "./ContainerWidget-IgR1Ao3c.mjs";
|
|
32
32
|
import { r as imageWidgetPropertySchema, t as ImageWidget } from "./ImageWidget-urRs17bw.mjs";
|
|
@@ -41,7 +41,7 @@ import { r as recentActivityWidgetPropertySchema, t as RecentActivityWidget } fr
|
|
|
41
41
|
import { r as separatorWidgetPropertySchema, t as SeparatorWidget } from "./SeparatorWidget-DG_rWVnP.mjs";
|
|
42
42
|
import { r as spacerWidgetPropertySchema, t as SpacerWidget } from "./SpacerWidget-B0l19UqF.mjs";
|
|
43
43
|
import { r as tableWidgetPropertySchema, t as TableWidget } from "./TableWidget-D4NBSOmz.mjs";
|
|
44
|
-
import { r as toDoWidgetPropertySchema, t as ToDoWidget } from "./ToDoWidget-
|
|
44
|
+
import { r as toDoWidgetPropertySchema, t as ToDoWidget } from "./ToDoWidget-eYF1VvRa.mjs";
|
|
45
45
|
import { r as videoWidgetPropertySchema, t as VideoWidget } from "./VideoWidget-UJH0EhF-.mjs";
|
|
46
46
|
import { o as PortalProductsCoreProvider } from "./SearchSort-BeYMXXIi.mjs";
|
|
47
47
|
import { o as ShopTranslationProvider } from "./ShopWidget-BBNFWedL.mjs";
|
|
@@ -50,19 +50,19 @@ import { a as ShellTranslationContext, i as CoreScreenPlaceholder, o as ShellTra
|
|
|
50
50
|
import { t as useStore } from "./use-store-fLSf5hUc.mjs";
|
|
51
51
|
import { t as useAccount } from "./use-account-DtQOpv3N.mjs";
|
|
52
52
|
import { n as useAppNavigation, t as AppNavigationProvider } from "./AppNavigationContext-DNomMUij.mjs";
|
|
53
|
-
import "./AddressAutocompleteInput-
|
|
53
|
+
import "./AddressAutocompleteInput-D8vKXhYO.mjs";
|
|
54
54
|
import "./Combobox-B-rNFLTr.mjs";
|
|
55
55
|
import "./use-mysite-portal-DyB9666K.mjs";
|
|
56
|
-
import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-
|
|
56
|
+
import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-BbWJH8PZ.mjs";
|
|
57
57
|
import "./dist-PbA1vxAz.mjs";
|
|
58
58
|
import "./es-DU0BGuLZ.mjs";
|
|
59
|
-
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-
|
|
59
|
+
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-DW-F0wJy.mjs";
|
|
60
60
|
import "./dist-o2cjwzIa.mjs";
|
|
61
|
-
import { n as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-
|
|
61
|
+
import { n as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-DtIEFDdH.mjs";
|
|
62
62
|
import { r as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-C3xnULq3.mjs";
|
|
63
63
|
import "./sortable.esm-BdhSkRKn.mjs";
|
|
64
64
|
import { n as shareablesScreenPropertySchema, t as ShareablesScreen } from "./ShareablesScreen-BDHGcO4c.mjs";
|
|
65
|
-
import { n as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-
|
|
65
|
+
import { n as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-Bpx3RVcL.mjs";
|
|
66
66
|
import "./UpgradeScreen-DGJsj2Yx.mjs";
|
|
67
67
|
import "./AppDownloadScreen-CauIkIKI.mjs";
|
|
68
68
|
import * as React$1 from "react";
|
|
@@ -2176,12 +2176,12 @@ function BuilderScreenViewImpl({ screen, className }) {
|
|
|
2176
2176
|
const BuilderScreenView = memo(BuilderScreenViewImpl);
|
|
2177
2177
|
//#endregion
|
|
2178
2178
|
//#region src/shell/system-screen-map.ts
|
|
2179
|
-
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-
|
|
2180
|
-
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-
|
|
2181
|
-
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-
|
|
2182
|
-
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-
|
|
2183
|
-
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-
|
|
2184
|
-
const ShopScreen$1 = lazy(() => import("./ShopScreen-
|
|
2179
|
+
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-CXXrYwSr.mjs").then((m) => ({ default: m.ProfileScreen })));
|
|
2180
|
+
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-DMoa1Trl.mjs").then((m) => ({ default: m.OrdersScreen })));
|
|
2181
|
+
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-CCLs-jWG.mjs").then((m) => ({ default: m.SubscriptionsScreen })));
|
|
2182
|
+
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-DIqEqpHc.mjs").then((m) => ({ default: m.MessagingScreen })));
|
|
2183
|
+
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-DW-F0wJy.mjs").then((n) => n.n).then((m) => ({ default: m.ContactsScreen })));
|
|
2184
|
+
const ShopScreen$1 = lazy(() => import("./ShopScreen-Cp4C5F-S.mjs").then((m) => ({ default: m.ShopScreen })));
|
|
2185
2185
|
const CustomersScreen$1 = lazy(() => import("./CustomersScreen-6QY5c1N8.mjs").then((n) => n.n).then((m) => ({ default: m.CustomersScreen })));
|
|
2186
2186
|
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-DK5h1Wv1.mjs").then((m) => ({ default: m.ShareablesScreen })));
|
|
2187
2187
|
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-C3xnULq3.mjs").then((n) => n.n).then((m) => ({ default: m.MySiteScreen })));
|
|
@@ -4088,15 +4088,15 @@ z.object({
|
|
|
4088
4088
|
//#endregion
|
|
4089
4089
|
//#region src/screens/index.ts
|
|
4090
4090
|
const screenPropertySchemas = {
|
|
4091
|
-
ProfileScreen: () => import("./ProfileScreen-
|
|
4092
|
-
MessagingScreen: () => import("./MessagingScreen-
|
|
4093
|
-
ContactsScreen: () => import("./ContactsScreen-
|
|
4094
|
-
OrdersScreen: () => import("./OrdersScreen-
|
|
4095
|
-
SubscriptionsScreen: () => import("./SubscriptionsScreen-
|
|
4091
|
+
ProfileScreen: () => import("./ProfileScreen-CXXrYwSr.mjs").then((m) => m.profileScreenPropertySchema),
|
|
4092
|
+
MessagingScreen: () => import("./MessagingScreen-DIqEqpHc.mjs").then((m) => m.messagingScreenPropertySchema),
|
|
4093
|
+
ContactsScreen: () => import("./ContactsScreen-DW-F0wJy.mjs").then((n) => n.n).then((m) => m.contactsScreenPropertySchema),
|
|
4094
|
+
OrdersScreen: () => import("./OrdersScreen-DMoa1Trl.mjs").then((m) => m.ordersScreenPropertySchema),
|
|
4095
|
+
SubscriptionsScreen: () => import("./SubscriptionsScreen-CCLs-jWG.mjs").then((m) => m.subscriptionsScreenPropertySchema),
|
|
4096
4096
|
CustomersScreen: () => import("./CustomersScreen-6QY5c1N8.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
|
|
4097
4097
|
MySiteScreen: () => import("./MySiteScreen-C3xnULq3.mjs").then((n) => n.n).then((m) => m.mySiteScreenPropertySchema),
|
|
4098
4098
|
ShareablesScreen: () => import("./ShareablesScreen-DK5h1Wv1.mjs").then((m) => m.shareablesScreenPropertySchema),
|
|
4099
|
-
ShopScreen: () => import("./ShopScreen-
|
|
4099
|
+
ShopScreen: () => import("./ShopScreen-Cp4C5F-S.mjs").then((m) => m.shopScreenPropertySchema),
|
|
4100
4100
|
UpgradeScreen: () => import("./UpgradeScreen-DGJsj2Yx.mjs").then((n) => n.t).then((m) => m.upgradeScreenPropertySchema),
|
|
4101
4101
|
AppDownloadScreen: () => import("./AppDownloadScreen-CauIkIKI.mjs").then((n) => n.t).then((m) => m.appDownloadScreenPropertySchema)
|
|
4102
4102
|
};
|
|
@@ -334,31 +334,27 @@ function TaskComposerForm({ contactId, onDone, onClose, autoFocus = true }) {
|
|
|
334
334
|
})
|
|
335
335
|
]
|
|
336
336
|
}), /* @__PURE__ */ jsxs("div", {
|
|
337
|
-
className: "mt-3 flex items-center gap-1.5 pl-
|
|
338
|
-
children: [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return /* @__PURE__ */ jsx("button", {
|
|
342
|
-
type: "button",
|
|
343
|
-
onClick: () => setDueDate(isActive ? null : q.iso),
|
|
344
|
-
"aria-pressed": isActive,
|
|
345
|
-
className: cn("shrink-0 rounded-full px-3 py-1 text-xs font-medium transition-colors", isActive ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/70"),
|
|
346
|
-
children: quickLabels[q.key]
|
|
347
|
-
}, q.key);
|
|
348
|
-
}),
|
|
349
|
-
/* @__PURE__ */ jsx("div", { className: "ml-auto" }),
|
|
350
|
-
/* @__PURE__ */ jsx("button", {
|
|
337
|
+
className: "mt-3 flex flex-wrap items-center gap-1.5 pl-(--row-indent) [--row-indent:2rem]",
|
|
338
|
+
children: [quickDates.map((q) => {
|
|
339
|
+
const isActive = dueDate === q.iso;
|
|
340
|
+
return /* @__PURE__ */ jsx("button", {
|
|
351
341
|
type: "button",
|
|
352
|
-
onClick:
|
|
353
|
-
|
|
354
|
-
className: "
|
|
355
|
-
children:
|
|
356
|
-
})
|
|
357
|
-
|
|
342
|
+
onClick: () => setDueDate(isActive ? null : q.iso),
|
|
343
|
+
"aria-pressed": isActive,
|
|
344
|
+
className: cn("shrink-0 rounded-full px-3 py-1 text-xs font-medium transition-colors", isActive ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/70"),
|
|
345
|
+
children: quickLabels[q.key]
|
|
346
|
+
}, q.key);
|
|
347
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
348
|
+
type: "button",
|
|
349
|
+
onClick: submit,
|
|
350
|
+
disabled: !canSubmit,
|
|
351
|
+
className: "bg-primary text-primary-foreground hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground mt-1 -ml-(--row-indent) inline-flex h-10 w-[calc(100%+var(--row-indent))] items-center justify-center rounded-lg text-sm font-semibold transition-colors disabled:cursor-not-allowed sm:mt-0 sm:ml-auto sm:h-auto sm:w-auto sm:shrink-0 sm:gap-1.5 sm:rounded-full sm:px-4 sm:py-1.5 sm:text-xs",
|
|
352
|
+
children: createTask.isPending ? t("adding") : t("add_task")
|
|
353
|
+
})]
|
|
358
354
|
})]
|
|
359
355
|
});
|
|
360
356
|
}
|
|
361
357
|
//#endregion
|
|
362
358
|
export { contactsKeys as a, useContactsTranslation as c, useGroupsApi as d, useNotesApi as f, CONTACTS_QUERY_KEYS as i, ContactsApiProvider as l, parseApiErrors as m, startOfLocalDay as n, parseTaskBody as o, useTasksApi as p, useInfiniteContacts as r, ContactsTranslationProvider as s, TaskComposerForm as t, useContactsCrud as u };
|
|
363
359
|
|
|
364
|
-
//# sourceMappingURL=task-composer-form-
|
|
360
|
+
//# sourceMappingURL=task-composer-form-Cq3KTV0Y.mjs.map
|